File: rigidentities.h

package info (click to toggle)
wfview 2.11-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 15,256 kB
  • sloc: cpp: 43,386; ansic: 3,196; sh: 32; xml: 29; makefile: 11
file content (350 lines) | stat: -rw-r--r-- 9,584 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
#ifndef RIGIDENTITIES_H
#define RIGIDENTITIES_H

#include <QtNumeric>
#include <QString>
#include <QList>
#include <vector>
#include <QHash>
#include <QColor>

#include "freqmemory.h"
#include "packettypes.h"
#include "udpbase.h"

// Credit for parts of CIV list:
// http://www.docksideradio.com/Icom%20Radio%20Hex%20Addresses.htm

// 7850 and 7851 have the same commands and are essentially identical


enum model_kind {
    model7100 = 0x88,
    model7200 = 0x76,
    model7300 = 0x94,
    modelR8600 = 0x96,
    model7600 = 0x7A,
    model7610 = 0x98,
    model7700 = 0x74,
    model7800 = 0x6A,
    model7000 = 0x70,
    model7410 = 0x80,
    model7850 = 0x8E,
    model9700 = 0xA2,
    model703 = 0x68,
    model705 = 0xA4,
    model706 = 0x58,
    model718 = 0x5E,
    model736 = 0x40,
    model737 = 0x3C,
    model738 = 0x44,
    model746 = 0x56,
    model756 = 0x50,
    model756pro = 0x5C,
    model756proii = 0x64,
    model756proiii = 0x6E,
    model905 = 0xAC,
    model910h = 0x60,
    model9100 = 0x7C,
    modelUnknown = 0xFF
};



enum inputTypes{ inputMic=0,
                  inputACCA=1,
                  inputACCB=2,
                  inputUSB=3,
                  inputLAN=4,
                  inputMICACCA=5,
                  inputMICACCB=6,
                  inputACCAACCB=7,
                  inputMICACCAACCB=8,
                  inputSPDIF=9,
                  inputMICUSB=10,
                  inputAV=11,
                  inputMICAV=12,
                  inputACCUSB=13,
                  inputLINE=14,
                  inputMICUSBACC=15,
                  inputMICLINEACC=16,
                  inputMICLINE=17,
                  inputNone,
                  inputUnknown=0xff
};

struct rigInput {
    rigInput() : type(inputUnknown),reg(0), name(""), level(0) {}
    //rigInput(rigInput const &r): type(r.type), reg(r.reg), name(r.name), level(r.level) {};
    rigInput(inputTypes type) : type(type),reg(0) ,name(""),level(0) {}
    rigInput(inputTypes type, qint8 reg, QString name) : type(type), reg(reg), name(name), level(0){}
    inputTypes type;
    qint8 reg;
    QString name;
    uchar level;
};



enum availableBands {
                band3cm = 0,
                band6cm,   //1
                band9cm,   //2
                band13cm,  //3
                band23cm,  //4
                band70cm,  //5
                band2m,    //6
                bandAir,    //7
                bandWFM,    //8
                band4m,     //9
                band6m,     //10
                band10m,    //11
                band12m,    //12
                band15m,    //13
                band17m,    //14
                band20m,    //15
                band30m,    //16
                band40m,    //17
                band60m,    //18
                band80m,    //19
                band160m,   //20
                band630m,   //21
                band2200m,  //22
                bandGen,     //23
                bandUnknown // 24
};

enum centerSpansType {
    cs2p5k = 0,
    cs5k = 1,
    cs10k = 2,
    cs25k = 3,
    cs50k = 4,
    cs100k = 5,
    cs250k = 6,
    cs500k = 7,
    cs1M = 8,
    cs2p5M = 9,
    cs5M = 10,
    cs10M = 11,
    cs25M = 12,
};

struct centerSpanData {
    centerSpanData() {}
    centerSpanData(centerSpanData const &c): cstype(c.cstype), name(c.name), freq(c.freq)  {}
    centerSpanData(centerSpansType cstype, QString name, unsigned int freq) :
        cstype(cstype), name(name), freq(freq){}
    centerSpansType cstype;
    QString name;
    unsigned int freq;

    centerSpanData &operator=(const centerSpanData &i) {
        this->cstype=i.cstype;
        this->name=i.name;
        this->freq=i.freq;
        return *this;
    }
};

struct bandType {
    bandType() {band=bandUnknown;}
    bandType(bandType const &b): region(b.region), band(b.band), bsr(b.bsr), lowFreq(b.lowFreq), highFreq(b.highFreq), range(b.range), memGroup(b.memGroup), bytes(b.bytes), ants(b.ants), power(b.power), color(b.color), name(b.name), offset(b.offset){};
    bandType(QString region, availableBands band, uchar bsr, quint64 lowFreq, quint64 highFreq, double range, int memGroup, qint8 bytes, bool ants, float power, QColor color, QString name, int offset) :
        region(region), band(band), bsr(bsr), lowFreq(lowFreq), highFreq(highFreq), range(range), memGroup(memGroup), bytes(bytes), ants(ants), power(power), color(color), name(name), offset(offset) {}

    QString region;
    availableBands band;
    uchar bsr;
    quint64 lowFreq;
    quint64 highFreq;
    rigMode_t defaultMode;
    double range;
    int memGroup;
    qint8 bytes;
    bool ants;
    float power;
    QColor color;
    QString name;
    qint64 newFreq=0;
    qint64 offset;
    bandType &operator=(const bandType &i) {
        this->region=i.region;
        this->band=i.band;
        this->bsr=i.bsr;
        this->lowFreq=i.highFreq;
        this->defaultMode=i.defaultMode;
        this->range=i.range;
        this->memGroup=i.memGroup;
        this->bytes=i.bytes;
        this->ants=i.ants;
        this->power=i.power;
        this->color=i.color;
        this->name=i.name;
        this->newFreq=i.newFreq;
        this->offset=i.offset;
        return *this;
    }
};

// Used for setting/retrieving BSR information
struct bandStackType {
    bandStackType(): band(0),regCode(0),freq(freqt()),data(0),mode(0),filter(0) {}
    bandStackType(bandStackType const &b): band(b.band),regCode(b.regCode),freq(b.freq),data(b.data),
        mode(b.mode),filter(b.filter), sql(b.sql), tone(b.tone), tsql(b.tsql) {}
    bandStackType(uchar band, uchar regCode): band(band),regCode(regCode), freq(), data(0), mode(0), filter(0) {}
    bandStackType(uchar band, uchar regCode, freqt freq, uchar data, uchar mode, uchar filter):
        band(band), regCode(regCode), freq(freq), data(data), mode(mode), filter(filter) {};
    uchar band;
    uchar regCode;
    freqt freq;
    uchar data;
    uchar mode;
    uchar filter;
    uchar sql;
    toneInfo tone;
    toneInfo tsql;
    bandStackType &operator=(const bandStackType &i) {
        this->band=i.band;
        this->regCode=i.regCode;
        this->freq=i.freq;
        this->data=i.data;
        this->mode=i.mode;
        this->filter=i.filter;
        this->sql=i.sql;
        this->tone=i.tone;
        this->tsql=i.tsql;
        return *this;
    }

};


struct filterType {
    filterType():num(0),name(""),modes(0) {}
    filterType(filterType const &f): num(f.num),name(f.name),modes(f.modes) {}
    filterType(quint8 num, QString name, unsigned int modes) :
        num(num), name(name), modes(modes) {}

    quint8 num;
    QString name;
    unsigned int modes;
};

struct genericType {
    genericType():num(0),name("") {}
    genericType(genericType const &g):num(g.num),name(g.name) {}
    genericType(quint8 num, QString name) :
        num(num), name(name) {}
    quint8 num;
    QString name;
};

//model_kind determineRadioModel(quint8 rigID);

struct bsrRequest {
    availableBands band;
    int bsrPosition=1;
};

struct rigCapabilities {
    quint8 model;
    quint8 modelID = 0; //CIV address
    manufacturersType_t manufacturer=manufIcom;
    QString filename;
    int rigctlModel;
    QString modelName;

    bool hasLan; // OEM ethernet or wifi connection
    bool hasEthernet;
    bool hasWiFi;
    bool hasFDcomms;

    QVector<rigInput> inputs;

    bool hasSpectrum=true;
    quint8 spectSeqMax;
    quint16 spectAmpMax;
    quint16 spectLenMax;
    quint8 numReceiver;
    quint8 numVFO;

    bool hasNB = false;
    QByteArray nbCommand;

    bool hasDD;
    bool hasDV;
    bool hasATU;

    bool hasCTCSS;
    bool hasDTCS;
    bool hasRepeaterModes = false;

    bool hasTransmit;
    bool hasPTTCommand;
    bool hasAttenuator;
    bool hasPreamp;
    bool hasAntennaSel;
    bool hasIFShift;
    bool hasTBPF;

    bool hasRXAntenna;

    bool hasSpecifyMainSubCmd = false; // 0x29
    bool hasVFOMS = false;
    bool hasVFOAB = true; // 0x07 [00||01]

    bool hasAdvancedRptrToneCmds = false;
    bool hasQuickSplitCommand = false;

    bool hasCommand29 = false;

    QByteArray quickSplitCommand;
    QHash<funcs,funcType> commands;
    QHash<QByteArray,funcs> commandsReverse;

    std::vector <genericType> attenuators;
    std::vector <genericType> preamps;
    std::vector <genericType> antennas;
    std::vector <filterType> filters;
    std::vector <centerSpanData> scopeCenterSpans;
    std::vector <bandType> bands;
    std::vector <toneInfo> ctcss;
    std::vector <toneInfo> dtcs;
    std::vector <genericType> roofing;
    //std::vector <spanType> spans;
    std::vector <stepType> steps;
    quint8 bsr[24] = {0};

    std::vector <modeInfo> modes;

    QByteArray transceiveCommand;
    quint8 guid[GUIDLEN] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 };
    quint32 baudRate;
    quint16 memGroups;
    quint16 memories;
    quint16 memStart;
    QString memFormat;
    QVector<memParserFormat> memParser;
    quint16 satMemories;
    QString satFormat;
    QVector<memParserFormat> satParser;
    QVector<periodicType> periodic;
    QMap<int,double> meters[meterUnknown];
    double meterLines[meterUnknown];
};

Q_DECLARE_METATYPE(manufacturersType_t)
Q_DECLARE_METATYPE(connectionType_t)
Q_DECLARE_METATYPE(udpPreferences)
Q_DECLARE_METATYPE(rigCapabilities)
Q_DECLARE_METATYPE(modeInfo)
Q_DECLARE_METATYPE(rigInput)
Q_DECLARE_METATYPE(filterType)
Q_DECLARE_METATYPE(inputTypes)
Q_DECLARE_METATYPE(genericType)
Q_DECLARE_METATYPE(bandType)
Q_DECLARE_METATYPE(bandStackType)
Q_DECLARE_METATYPE(centerSpanData)

#endif // RIGIDENTITIES_H