File: wfmain.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 (770 lines) | stat: -rw-r--r-- 21,856 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
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
#ifdef BUILD_WFSERVER
#include "servermain.h"
#else

#ifndef WFMAIN_H
#define WFMAIN_H

#include <QMainWindow>
#include <QCloseEvent>
#include <QThread>
#include <QString>
#include <QVector>
#include <QTimer>
#include <QSettings>
#include <QShortcut>
#include <QThread>
#include <QMetaType>
#include <QMutex>
#include <QMutexLocker>
#include <QColorDialog>
#include <QColor>
#include <QMap>

#include "logcategories.h"
#include "wfviewtypes.h"
#include "prefs.h"
#include "commhandler.h"
#include "rigcommander.h"
#include "icomcommander.h"
#include "kenwoodcommander.h"
#include "freqmemory.h"
#include "rigidentities.h"
#include "repeaterattributes.h"
#include "memories.h"
#include "firsttimesetup.h"

#include "packettypes.h"
#include "calibrationwindow.h"
#include "repeatersetup.h"
#include "satellitesetup.h"
//#include "transceiveradjustments.h"
#include "cwsender.h"
#include "bandbuttons.h"
#include "frequencyinputwidget.h"
#include "settingswidget.h"
#include "udpserver.h"
#include "qledlabel.h"
#include "rigctld.h"
#include "aboutbox.h"
#include "selectradio.h"
#include "colorprefs.h"
#include "loggingwindow.h"
#include "cluster.h"
#include "audiodevices.h"
#include "sidebandchooser.h"
#include "debugwindow.h"
#include "receiverwidget.h"
#include "tciserver.h"

#include <qcustomplot.h>
#include <qserialportinfo.h>
#include "usbcontroller.h"
#include "controllersetup.h"
#include "rigcreator.h"
#include "cachingqueue.h"

#include <deque>
#include <memory>

#include <portaudio.h>
#ifndef Q_OS_LINUX
#include "RtAudio.h"
#else
#include "rtaudio/RtAudio.h"
#endif

#ifdef USB_CONTROLLER
    #ifdef Q_OS_WIN
        #include <windows.h>
        #include <dbt.h>
        #define USB_HOTPLUG
    #elif defined(Q_OS_LINUX)
        #include <QSocketNotifier>
        #include <libudev.h>
        #define USB_HOTPLUG
    #endif
#endif

namespace Ui {
class wfmain;
}

class wfmain : public QMainWindow
{
    Q_OBJECT

public:
    explicit wfmain(const QString settingsFile, const QString logFile, bool debugMode, QWidget *parent = 0);
    ~wfmain();
    static void messageHandler(QtMsgType type, const QMessageLogContext& context, const QString& msg);
    void handleLogText(QPair<QtMsgType,QString> logMessage);

#ifdef USB_HOTPLUG
    #if defined(Q_OS_WIN)
        protected:
            virtual bool nativeEvent(const QByteArray& eventType, void* message, qintptr* result);
    #elif defined(Q_OS_LINUX)
        private slots:
           void uDevEvent();
    #endif
#endif

signals:
    void usbHotplug();
    // Basic to rig:
    void setCIVAddr(quint8 newRigCIVAddr);
    void setRigID(quint8 rigID);
    void setPTTType(pttType_t enabled);

    
    void sendPowerOn();
    void sendPowerOff();

    // Frequency, mode, band:
    void getFrequency();
    void getFrequency(quint8);
    void setFrequency(quint8 receiver, freqt freq);
    void getMode();
    void setMode(quint8 modeIndex, quint8 modeFilter);
    void setMode(modeInfo);
    void selectVFO(vfo_t vfo);
    void sendVFOSwap();
    void sendVFOEqualAB();
    void sendVFOEqualMS();
    void setDataMode(bool dataOn, quint8 filter);
    void getDataMode();
    void getModInput(bool dataOn);
    void setModInput(inputTypes input, bool dataOn);
    void getBandStackReg(char band, char regCode);
    void getDebug();
    void getRitEnabled();
    void getRitValue();
    void setRitValue(int ritValue);
    void setRitEnable(bool ritEnabled);
    void getTuningStep();
    void setTuningStep(quint8);

    // Repeater:
    void getDuplexMode();
    void setQuickSplit(bool qsOn);
    void getTone();
    void getTSQL();
    void getDTCS();
    void getRptAccessMode();
    void setRepeaterAccessMode(rptrAccessData rd);
    void setTone(toneInfo t);
    void setTSQL(toneInfo t);
    void getToneEnabled();
    void getTSQLEnabled();
    void setToneEnabled(bool enabled);
    void setTSQLEnabled(bool enabled);
    void setRptDuplexOffset(freqt f);
    void getRptDuplexOffset();
    void setMemory(memoryType mem);
    void getMemory(quint32 mem);
    void getSatMemory(quint32 mem);
    void recallMemory(quint32 mem);
    void clearMemory(quint32 mem);
    void setMemoryMode();
    void setSatelliteMode(bool en);

    // Level get:
    void getLevels(); // get all levels
    void getRfGain();
    void getAfGain();
    void getSql();
    void getIfShift();
    void getPBTInner();
    void getPBTOuter();
    void getTxPower();
    void getMicGain();
    void getSpectrumRefLevel();
    void getModInputLevel(inputTypes input);
    void getMeters(meter_t meter);
    void getPassband();
    void getVoxGain();
    void getAntiVoxGain();
    void getMonitorGain();
    void getNBLevel();
    void getNRLevel();
    void getCompLevel();
    void getCwPitch();

    void getVox();
    void getMonitor();
    void getCompressor();
    void getNB();
    void getNR();

    void getDashRatio();
    void getPskTone();
    void getRttyMark();

    // Level set:
    void setRfGain(quint8 level);
    void setSql(quint8 level);
    void setIFShift(quint8 level);
    void setPBTInner(quint8 level);
    void setPBTOuter(quint8 level);
  
    void setIFShiftWindow(quint8 level);
    void setPBTInnerWindow(quint8 level);
    void setPBTOuterWindow(quint8 level);
    void setMicGain(quint8);
    void setCompLevel(quint8);
    void setTxPower(quint8);
    void setMonitorGain(quint8);
    void setVoxGain(quint8);
    void setAntiVoxGain(quint8);
    void setNBLevel(quint8 level);
    void setNRLevel(quint8 level);

    void setVox(bool en);
    void setMonitor(bool en);
    void setCompressor(bool en);
    void setNB(bool en);
    void setNR(bool en);

    void setSpectrumRefLevel(int);

    void setModLevel(inputTypes input, quint8 level);
    void setACCGain(quint8 level);
    void setACCAGain(quint8 level);
    void setACCBGain(quint8 level);
    void setUSBGain(quint8 level);
    void setLANGain(quint8 level);

    void setPassband(quint16 pass);

    // PTT, ATU, ATT, Antenna, Preamp:
    void getPTT();
    void setPTT(bool pttOn);    
    void getAttenuator();
    void getPreamp();
    void getAntenna();
    void setAttenuator(quint8 att);
    void setPreamp(quint8 pre);
    void setAntenna(quint8 ant, bool rx);
    void startATU();
    void setATU(bool atuEnabled);
    void getATUStatus();

    // CW Keying:
    void sendCW(QString message);
    void stopCW();
    void getKeySpeed();
    void setKeySpeed(quint8 wpm);
    void setCwPitch(quint8 pitch);
    void setDashRatio(quint8 ratio);
    void setCWBreakMode(quint8 breakMode);
    void getCWBreakMode();

    // Time and date:
    void setTime(timekind t);
    void setDate(datekind d);
    void setUTCOffset(timekind t);

    void spectOutputEnable();
    void spectOutputDisable();
    void scopeDisplayEnable();
    void scopeDisplayDisable();
    void setScopeMode(spectrumMode_t spectMode);
    void setScopeSpan(char span);
    void setScopeEdge(char edge);
    void setScopeFixedEdge(double startFreq, double endFreq, quint8 edgeNumber);
    void getScopeMode();
    void getScopeEdge();
    void getScopeSpan();
    void sayFrequency();
    void sayMode();
    void sayAll();
    void sendCommSetup(rigTypedef rigList, quint8 rigCivAddr, QString rigSerialPort, quint32 rigBaudRate,QString vsp, quint16 tcp, quint8 wf);
    void sendCommSetup(rigTypedef rigList, quint8 rigCivAddr, udpPreferences prefs, audioSetup rxSetup, audioSetup txSetup, QString vsp, quint16 tcp);
    void sendCloseComm();
    void sendChangeLatency(quint16 latency);
    void initServer();
    void sendRigCaps(rigCapabilities caps);
    void openShuttle();

    void initUsbController(QMutex* mutex,usbDevMap* devs ,QVector<BUTTON>* buts,QVector<KNOB>* knobs);
    void setClusterUdpPort(int port);
    void setClusterEnableUdp(bool udp);
    void setClusterEnableTcp(bool tcp);
    void setClusterServerName(QString name);
    void setClusterTcpPort(int port);
    void setClusterUserName(QString name);
    void setClusterPassword(QString pass);
    void setClusterTimeout(int timeout);
    void setClusterSkimmerSpots(bool enable);
    void setFrequencyRange(double low, double high);
    void sendControllerRequest(USBDEVICE* dev, usbFeatureType request, int val=0, QString text="", QImage* img=Q_NULLPTR, QColor* color=Q_NULLPTR);
    void tciInit(quint16 port);

    // Signals to forward incoming data onto other areas
    void haveMemory(memoryType mem);
    void connectionStatus(bool conn);

private slots:
    // Triggered from external preference changes:
    void extChangedIfPrefs(quint64 items);
    void extChangedColPrefs(quint64 items);
    void extChangedRaPrefs(quint64 items);
    void extChangedRsPrefs(quint64 items);
    void extChangedCtPrefs(quint64 items);
    void extChangedLanPrefs(quint64 items);
    void extChangedClusterPrefs(quint64 items);
    void extChangedUdpPrefs(quint64 items);
    void extChangedServerPrefs(quint64 items);

    void extChangedIfPref(prefIfItem i);
    void extChangedColPref(prefColItem i);
    void extChangedRaPref(prefRaItem i);
    void extChangedRsPref(prefRsItem i);
    void extChangedCtPref(prefCtItem i);
    void extChangedLanPref(prefLanItem i);
    void extChangedClusterPref(prefClusterItem i);
    void extChangedUdpPref(prefUDPItem i);
    void extChangedServerPref(prefServerItem i);

    void handleExtConnectBtn();
    void handleRevertSettingsBtn();

    void receiveScopeSettings(uchar receiver, int theme, quint16 len, int floor, int ceiling);
    void receiveValue(cacheItem val);
    void setAudioDevicesUI();

    void runShortcut(const QKeySequence k);

    void handlePttLimit(); // hit at 3 min transmit length

    void doShuttle(bool up, quint8 level);

    void receiveCommReady();

    void receivePTTstatus(bool pttOn);
    void receiveRITStatus(bool ritEnabled);
    void receiveRITValue(int ritValHz);
    void receiveModInput(rigInput input, quint8 data);
    void receiveMonitor(bool en);
    void receiveTuningStep(quint8 step);

    void receiveScopeImage(uchar receiver);
    // Meters:
    void receiveMeter(meter_t meter, double level);
//    void receiveSMeter(quint8 level);
//    void receivePowerMeter(quint8 level);
//    void receiveALCMeter(quint8 level);
//    void receiveCompMeter(quint8 level);


    void receiveATUStatus(quint8 atustatus);
    void receivePreamp(quint8 pre, uchar receiver);
    void receiveAttenuator(quint8 att, uchar receiver);

    void receivePortError(errorType err);
    void receiveStatusUpdate(networkStatus status);
    void receiveNetworkAudioLevels(networkAudioLevels l);

    void showStatusBarText(QString text);
    void receiveBaudRate(quint32 baudrate);
    void radioSelection(QList<radio_cap_packet> radios);

    void dataModeChanged(modeInfo m);

    // Added for RC28/Shuttle support
    void pttToggle(bool);
    void stepUp();
    void stepDown();
    void changeFrequency(int value);

    void setRadioTimeDateSend();
    void logCheck();
    void setDebugLogging(bool debugModeOn);
    void setInsaneDebugLogging(bool insaneLoggingOn);
    void setRigctlDebugLogging(bool rigctlLoggingOn);

    void buttonControl(const COMMAND* cmd);

    void changeFullScreenMode(bool checked);

    void on_freqDial_valueChanged(int value);
    void on_aboutBtn_clicked();

    void on_rfGainSlider_valueChanged(int value);
    void on_afGainSlider_valueChanged(int value);

    void on_monitorSlider_valueChanged(int value);

    void on_monitorLabel_linkActivated(const QString&);

    void on_tuneNowBtn_clicked();
    void on_tuneEnableChk_clicked(bool checked);
    bool on_exitBtn_clicked();
    void on_saveSettingsBtn_clicked();
    void debugBtn_clicked();

    void on_connectBtn_clicked();

    void on_sqlSlider_valueChanged(int value);

    void on_transmitBtn_clicked();
    void on_txPowerSlider_valueChanged(int value);
    void on_micGainSlider_valueChanged(int value);
    void useSystemTheme(bool checked);

    void on_tuneLockChk_clicked(bool checked);

    void on_tuningStepCombo_currentIndexChanged(int index);
    void on_rptSetupBtn_clicked();
    void on_attSelCombo_activated(int index);
    void on_preampSelCombo_activated(int index);
    void on_antennaSelCombo_activated(int index);
    void on_rxAntennaCheck_clicked(bool value);
    void on_rigPowerOnBtn_clicked();
    void on_rigPowerOffBtn_clicked();
    void on_ritTuneDial_valueChanged(int value);
    void on_ritEnableChk_clicked(bool checked);

    void changeMeterType(meter_t m, int meterNum);
    void enableRigCtl(bool enabled);

    void on_memoriesBtn_clicked();

    void on_radioStatusBtn_clicked();

    void on_showLogBtn_clicked();

    void receiveClusterOutput(QString text);

    void on_cwButton_clicked();

    void on_showBandsBtn_clicked();

    void on_showFreqBtn_clicked();

    void on_showSettingsBtn_clicked();

    void on_rigCreatorBtn_clicked();

    void on_scopeMainSubBtn_clicked();
    void on_scopeDualBtn_toggled(bool en);
    void on_dualWatchBtn_toggled(bool en);
    void on_swapMainSubBtn_clicked();
    //void on_mainSubTrackingBtn_toggled(bool en);
    void on_splitBtn_toggled(bool en);
    void on_mainEqualsSubBtn_clicked();

    void receiveElapsed(bool sub, qint64 us);
    void connectionTimeout();
    void receiveRigCaps(rigCapabilities* caps);
    void radioInUse(quint8 radio, bool admin, quint8 busy, QString user, QString ip);
    void updatedQueueInterval(qint64 interval);

    // Moved to slots to allow them to be delayed.
    void getInitialRigState();
    void initPeriodicCommands();

    void setupLambdaSlots();

private:
    Ui::wfmain *ui; // Main UI
    QVector<receiverWidget*>receivers;   // Spectrum Scope items.
    void closeEvent(QCloseEvent *event);
    QString logFilename;
    bool debugMode;
    QString version;
    QSettings *settings=Q_NULLPTR;
    void loadSettings();
    void saveSettings();
    void connectSettingsWidget();

    void initLogging();
    QTimer logCheckingTimer;
    int logCheckingOldPosition = 0;
    QTimer ATUCheckTimer;
    QTimer ConnectionTimer;

    QCustomPlot *plot; // line plot
    QCustomPlot *wf; // waterfall image
    QCPItemLine * freqIndicatorLine;
    QCPItemRect* passbandIndicator;
    QCPItemRect* pbtIndicator;
    QCPItemText* oorIndicator;
    QCPItemText* ovfIndicator;
    void setAppTheme(bool isCustom);

    void showButton(QPushButton *btn);
    void hideButton(QPushButton *btn);

    FirstTimeSetup *fts = Q_NULLPTR;
    void openRig();
    void powerRigOff();
    void powerRigOn();
    QStringList portList;
    QString serialPortRig;

    QList<QShortcut *> shortcuts;

    rigCommander * rig=Q_NULLPTR;
    QThread* rigThread = Q_NULLPTR;
    QCPColorMap * colorMap;
    QCPColorMapData * colorMapData;
    QCPColorScale * colorScale;
    QTimer * delayedCommand;
    QTimer * pttTimer;
    uint16_t loopTickCounter;
    uint16_t slowCmdNum=0;
    uint16_t rapidCmdNum=0;

    void makeRig();
    void rigConnections();
    void removeRig();
    void findSerialPort();

    QShortcut* setupKeyShortcut(const QKeySequence k, bool appWide=false);

    void setupKeyShortcuts();
    void setupMainUI();
    void configureVFOs();
    void setSerialDevicesUI();
    void setServerToPrefs();
    void setupUsbControllerDevice();
    void setInitialTiming();
    void getSettingsFilePath(QString settingsFile);
    void enableControls(bool en);

    QStringList modes;
    int currentModeIndex;
    QStringList spans;
    QStringList edges;
    QStringList commPorts;
    QLabel* rigStatus;
    QLabel* rigName;
    QLedLabel* pttLed;
    QLedLabel* connectedLed;

    double passbandWidth = 0.0;

    double mousePressFreq = 0.0;
    double mouseReleaseFreq = 0.0;

    QVector <QByteArray> wfimage;

    bool onFullscreen;
    bool freqTextSelected;

    double oldLowerFreq;
    double oldUpperFreq;
    //freqt freq;
    //freqt freqb;
    float tsKnobMHz;

    quint8 setModeVal=0;
    quint8 setFilterVal=0;
    qint64 lastFreqCmdTime_ms;

    int pCmdNum = 0;
    int delayedCmdIntervalLAN_ms = 100;
    int delayedCmdIntervalSerial_ms = 100;
    int delayedCmdStartupInterval_ms = 100;
    bool runPeriodicCommands;
    bool usingLAN = false;

    cachingQueue* queue;
    // Radio time sync:
    QTimer *timeSync;
    bool waitingToSetTimeDate;
    void setRadioTimeDatePrep();
    timekind timesetpoint;
    timekind utcsetting;
    datekind datesetpoint;

    freqMemory mem;
    void gotoMemoryPreset(int presetNumber);
    void saveMemoryPreset(int presetNumber);

    colorPrefsType colorPreset[numColorPresetsTotal];

    preferences prefs;
    preferences defPrefs;
    udpPreferences udpPrefs;
    udpPreferences udpDefPrefs;

    void setDefaultColors(int presetNumber); // populate with default values
    void setDefaultColorPresets();
    void useColorPreset(colorPrefsType *cp);

    void useColors(); // set the plot up
    void setDefPrefs(); // populate default values to default prefs
    void setTuningSteps();

    void calculateTimingParameters();
    void changePollTiming(int timing_ms, bool setUI=false);

    quint64 roundFrequency(quint64 frequency, unsigned int tsHz);
    quint64 roundFrequencyWithStep(quint64 oldFreq, int steps,\
                                   unsigned int tsHz);

    void changeTxBtn();
    void changePrimaryMeter(bool transmitOn);
    void changeSliderQuietly(QSlider *slider, int value);
    void showAndRaiseWidget(QWidget *w);
    void statusFromSliderPercent(QString name, int percentValue);
    void statusFromSliderRaw(QString name, int rawValue);

    void processModLevel(inputTypes source, quint8 level);

    void processChangingCurrentModLevel(quint8 level);

    void changeModLabel(rigInput source);
    void changeModLabel(rigInput source, bool updateLevel);

    void changeModLabelAndSlider(rigInput source);

    void changeMode(rigMode_t mode, quint8 rx=0);
    void changeMode(rigMode_t mode, quint8 data, quint8 rx=0);

    void connectionHandler(bool connect);

    funcs meter_tToMeterCommand(meter_t m);
    void getMeterExtremities(const meter_t m, double &lowVal,
                             double &highVal, double&redLineVal);
    void updateUsbButtons();

    void setManufacturer(manufacturersType_t man);

    int oldFreqDialVal;

    QHash<quint8,rigInfo> rigList;
    rigCapabilities* rigCaps = Q_NULLPTR;

    rigInput currentModSrc[4];

    rigMode_t currentMode = modeUnknown;
    modeInfo currentModeInfo = modeInfo();

    bool haveRigCaps;
    bool amTransmitting = false;
    bool splitModeEnabled = false;
    quint8 usingDataMode = 99; // Set to invalid value initially

    // Widgets and Special Windows:
    calibrationWindow *cal = Q_NULLPTR;
    repeaterSetup *rpt = Q_NULLPTR;
    satelliteSetup *sat = Q_NULLPTR;
    //transceiverAdjustments *trxadj = Q_NULLPTR;
    cwSender *cw = Q_NULLPTR;
    controllerSetup* usbWindow = Q_NULLPTR;
    aboutbox *abtBox = Q_NULLPTR;
    selectRadio *selRad = Q_NULLPTR;
    loggingWindow *logWindow = Q_NULLPTR;
    rigCreator *creator = Q_NULLPTR;
    bandbuttons* bandbtns;
    frequencyinputwidget* finputbtns;
    settingswidget* setupui;


    udpServer* udp = Q_NULLPTR;
    QThread* serverThread = Q_NULLPTR;
    rigCtlD* rigCtl = Q_NULLPTR;
    tciServer* tci = Q_NULLPTR;
    QThread* tciThread = Q_NULLPTR;

    void bandStackBtnClick();
    bool waitingForBandStackRtn;
    char bandStkBand;
    char bandStkRegCode;

    bool freqLock;

    float tsPlus;
    float tsPlusShift;
    float tsPlusControl;
    float tsPage;
    float tsPageShift;
    float tsWfScroll;

    unsigned int tsPlusHz;
    unsigned int tsPlusShiftHz;
    unsigned int tsPlusControlHz;
    unsigned int tsPageHz;
    unsigned int tsPageShiftHz;
    unsigned int tsWfScrollHz;
    unsigned int tsKnobHz;

    passbandActions passbandAction = passbandStatic;
    double PBTInner = 0.0;
    double PBTOuter = 0.0;
    double passbandCenterFrequency = 0.0;
    double pbtDefault = 0.0;
    quint16 cwPitch = 600;

    bool subScope = false;

    //availableBands lastRequestedBand=bandGen;

    SERVERCONFIG serverConfig;

    quint64 mainElapsed=0;
    quint64 subElapsed=0;
    colorPrefsType* colorPrefs=Q_NULLPTR;

    QString currentRegion = "1";
    funcType getInputTypeCommand(inputTypes input);

#if defined (USB_CONTROLLER)
    usbController *usbControllerDev = Q_NULLPTR;
    QThread *usbControllerThread = Q_NULLPTR;
    QString typeName;
    QVector<BUTTON> usbButtons;
    QVector<KNOB> usbKnobs;
    usbDevMap usbDevices;
    QMutex usbMutex;
    qint64 lastUsbNotify=0;

    #if defined (Q_OS_LINUX)
	struct udev* uDev = nullptr;
        struct udev_monitor* uDevMonitor = nullptr;
        QSocketNotifier* uDevNotifier = nullptr;
    #endif
#endif
    memories* memWindow = Q_NULLPTR;
    dxClusterClient* cluster = Q_NULLPTR;
    QThread* clusterThread = Q_NULLPTR;
    QMap<QString, spotData*> clusterSpots;
    QTimer clusterTimer;
    QCPItemText* text=Q_NULLPTR;
    QMutex clusterMutex;
    QColor clusterColor;
    audioDevices* audioDev = Q_NULLPTR;
    QImage lcdImage;
    connectionStatus_t connStatus = connDisconnected;
    uchar currentReceiver = 0;
    bool isRadioAdmin = true;
};

Q_DECLARE_METATYPE(audioPacket)
Q_DECLARE_METATYPE(audioSetup)
Q_DECLARE_METATYPE(SERVERCONFIG)
Q_DECLARE_METATYPE(networkStatus)
Q_DECLARE_METATYPE(networkAudioLevels)
Q_DECLARE_METATYPE(spotData)
Q_DECLARE_METATYPE(radio_cap_packet)
Q_DECLARE_METATYPE(BUTTON)
Q_DECLARE_METATYPE(QVector<BUTTON>*)
Q_DECLARE_METATYPE(KNOB)
Q_DECLARE_METATYPE(QVector<KNOB>*)
Q_DECLARE_METATYPE(COMMAND)
Q_DECLARE_METATYPE(QVector<COMMAND>*)
Q_DECLARE_METATYPE(const COMMAND*)
Q_DECLARE_METATYPE(USBDEVICE)
Q_DECLARE_METATYPE(const USBDEVICE*)
Q_DECLARE_METATYPE(codecType)
Q_DECLARE_METATYPE(errorType)
Q_DECLARE_METATYPE(rigTypedef)

//void (*wfmain::logthistext)(QString text) = NULL;

#endif // WFMAIN_H
#endif