Fixed to widgets and remove rigState()

translations
Phil Taylor 2023-05-27 20:26:53 +01:00
rodzic 15c0d40a3e
commit 07baed4704
18 zmienionych plików z 559 dodań i 1387 usunięć

Wyświetl plik

@ -11,6 +11,8 @@ bandbuttons::bandbuttons(QWidget *parent) :
ui->bandStkDataBtn->setVisible(false);
ui->bandStkCWBtn->setVisible(false);
this->setWindowTitle("Band Switcher");
this->setObjectName("bandButtons");
queue = cachingQueue::getInstance(this);
}
bandbuttons::~bandbuttons()
@ -71,11 +73,9 @@ void bandbuttons::setUIToRig()
hideButton(ui->band2200mbtn);
hideButton(ui->bandGenbtn);
bandType bandSel;
for(unsigned int i=0; i < rigCaps.bands.size(); i++)
foreach (auto band, rigCaps.bands)
{
bandSel = rigCaps.bands.at(i);
switch(bandSel.band)
switch(band.band)
{
case(band23cm):
showButton(ui->band23cmbtn);
@ -98,7 +98,6 @@ void bandbuttons::setUIToRig()
case(band6m):
showButton(ui->band6mbtn);
break;
case(band10m):
showButton(ui->band10mbtn);
break;
@ -129,7 +128,6 @@ void bandbuttons::setUIToRig()
case(band160m):
showButton(ui->band160mbtn);
break;
case(band630m):
showButton(ui->band630mbtn);
break;
@ -182,16 +180,20 @@ void bandbuttons::bandStackBtnClick(availableBands band)
{
if(haveRigCaps)
{
unsigned char bandRegister = rigCaps.bsr[band];
if(bandRegister == 00)
foreach (auto b, rigCaps.bands)
{
qDebug(logGui()) << "requested to drop to band that does not have a BSR.";
// TODO: Jump to reasonable frequency for the selected band
jumpToBandWithoutBSR(band);
} else {
waitingForBSR = true;
// TODO: request the BSR 1, 2, or 3
emit issueCmd(cmdGetBandStackReg, (unsigned char)band);
if (b.band == band)
{
if(b.bsr == 0)
{
qDebug(logGui()) << "requested to drop to band that does not have a BSR.";
jumpToBandWithoutBSR(band);
} else {
queue->add(priorityImmediate,queueItem(funcBandStackReg,
QVariant::fromValue<bandStackType>(bandStackType(b.bsr,ui->bandStkPopdown->currentIndex()+1)),false));
}
break;
}
}
} else {
qWarning(logGui()) << "bandbuttons, Asked to go to a band but do not have rigCaps yet.";
@ -201,39 +203,17 @@ void bandbuttons::bandStackBtnClick(availableBands band)
void bandbuttons::jumpToBandWithoutBSR(availableBands band)
{
// Sometimes we do not have a BSR for these bands:
freqt f;
f.Hz = 0;
switch(band)
foreach (auto b, rigCaps.bands)
{
case band2200m:
f.Hz = 136 * 1E3;
break;
case band630m:
f.Hz = 475 * 1E3;
break;
case band60m:
f.Hz = (5.3305) * 1E6;
break;
case band4m:
f.Hz = (70.200) * 1E6;
break;
case bandAir:
f.Hz = 121.5 * 1E6;
break;
case bandGen:
f.Hz = 10.0 * 1E6;
break;
case bandWFM:
f.Hz = (100.1) * 1E6;
break;
default:
qCritical(logGui()) << "Band " << (unsigned char) band << " not understood.";
break;
}
if(f.Hz != 0)
{
emit issueCmdF(cmdSetFreq, f);
if (b.band == band)
{
freqt f;
f.Hz = (b.lowFreq+b.highFreq)/2.0;
f.MHzDouble = f.Hz/1000000.0;
f.VFO = activeVFO;
queue->add(priorityImmediate,queueItem(funcSelectedFreq,QVariant::fromValue<freqt>(f),false));
break;
}
}
}

Wyświetl plik

@ -4,6 +4,7 @@
#include <QWidget>
#include <QPushButton>
#include "cachingqueue.h"
#include "logcategories.h"
#include "wfviewtypes.h"
#include "rigidentities.h"
@ -88,7 +89,7 @@ private:
bool waitingForBSR = false;
rigCapabilities rigCaps;
bool haveRigCaps = false;
cachingQueue* queue;
};
#endif // BANDBUTTONS_H

Wyświetl plik

@ -8,6 +8,8 @@ frequencyinputwidget::frequencyinputwidget(QWidget *parent) :
ui->setupUi(this);
this->setWindowTitle("Frequency Input");
ui->freqMhzLineEdit->setValidator( new QDoubleValidator(0, 100, 6, this));
this->setObjectName("freqInput");
queue = cachingQueue::getInstance(this);
}
frequencyinputwidget::~frequencyinputwidget()
@ -196,7 +198,7 @@ void frequencyinputwidget::on_goFreqBtn_clicked()
if(ok)
{
modeInfo m;
issueCmdF(cmdSetFreq, f);
queue->add(priorityImmediate,queueItem(funcFreqSet,QVariant::fromValue<freqt>(f),false));
m.mk = sidebandChooser::getMode(f, currentMode);
m.reg = (unsigned char) m.mk;
@ -211,7 +213,7 @@ void frequencyinputwidget::on_goFreqBtn_clicked()
}
f.MHzDouble = (float)f.Hz / 1E6;
emit updateUIFrequency(f);
//emit updateUIFrequency(f);
currentFrequency = f;
} else {
qWarning(logGui()) << "Could not understand frequency" << ui->freqMhzLineEdit->text();

Wyświetl plik

@ -7,6 +7,7 @@
#include "sidebandchooser.h"
#include "wfviewtypes.h"
#include "logcategories.h"
#include "cachingqueue.h"
namespace Ui {
class frequencyinputwidget;
@ -63,6 +64,8 @@ private:
freqt currentFrequency;
int currentFilter = 1;
void checkFreqSel();
cachingQueue* queue;
};
#endif // FREQUENCYINPUTWIDGET_H

42
prefs.h
Wyświetl plik

@ -4,6 +4,7 @@
#include <QString>
#include <QColor>
#include <QMap>
#include "rigidentities.h"
#include "wfviewtypes.h"
enum prefIfItem {
@ -27,6 +28,41 @@ enum prefIfItem {
if_all = 1 << 17
};
enum prefColItem {
col_grid = 1 << 0,
col_axis = 1 << 1,
col_text = 1 << 2,
col_plotBackground = 1 << 3,
col_spectrumLine = 1 << 4,
col_spectrumFill = 1 << 5,
col_underlayLine = 1 << 6,
col_underlayFill = 1 << 7,
col_tuningLine = 1 << 8,
col_passband = 1 << 9,
col_pbtIndicator = 1 << 10,
col_meterLevel = 1 << 11,
col_meterAverage = 1 << 12,
col_meterPeakLevel = 1 << 13,
col_meterHighScale = 1 << 14,
col_meterScale = 1 << 15,
col_meterText = 1 << 16,
col_waterfallBack = 1 << 17,
col_waterfallGrid = 1 << 18,
col_waterfallAxis = 1 << 19,
col_waterfallText = 1 << 20,
col_clusterSpots = 1 << 21,
col_all = 1 << 22
};
enum prefRsItem {
rs_dataOffMod = 1 << 0,
rs_data1Mod = 1 << 1,
rs_data2Mod = 1 << 2,
rs_data3Mod = 1 << 3,
rs_clockUseUtc = 1 << 4,
rs_all = 1 << 5
};
enum prefRaItem {
ra_radioCIVAddr = 1 << 0,
@ -114,6 +150,12 @@ struct preferences {
unsigned char localAFgain;
audioType audioSystem;
// Radio settings:
inputTypes inputDataOff=inputNone;
inputTypes inputData1=inputNone;
inputTypes inputData2=inputNone;
inputTypes inputData3=inputNone;
// Controls:
bool enablePTT;
bool niceTS;

Plik diff jest za duży Load Diff

Wyświetl plik

@ -17,8 +17,6 @@
#include "tcpserver.h"
#include "cachingqueue.h"
#include "rigstate.h"
// This file figures out what to send to the comm and also
// parses returns into useful things.
@ -48,7 +46,6 @@ public slots:
void commSetup(rigTypedef rigList, unsigned char rigCivAddr, QString rigSerialPort, quint32 rigBaudRate, QString vsp, quint16 tcp, quint8 wf);
void commSetup(rigTypedef rigList, unsigned char rigCivAddr, udpPreferences prefs, audioSetup rxSetup, audioSetup txSetup, QString vsp, quint16 tcp);
void closeComm();
void stateUpdated();
void setRTSforPTT(bool enabled);
// Power:
@ -286,7 +283,6 @@ public slots:
void radioSelection(QList<radio_cap_packet> radios);
void radioUsage(quint8 radio, quint8 busy, QString name, QString ip);
void setCurrentRadio(quint8 radio);
void sendState();
void getDebug();
void receiveCommand(queueItemType type, funcs func, QVariant value);
@ -396,10 +392,6 @@ signals:
void haveCWBreakMode(unsigned char bmode);
void haveDashRatio(unsigned char ratio);
// Rig State
void stateInfo(rigstate* state);
// Housekeeping:
void requestRadioSelection(QList<radio_cap_packet> radios);
void setRadioUsage(quint8 radio, quint8 busy, QString user, QString ip);
@ -488,8 +480,6 @@ private:
//double spectrumEndFreq;
struct rigCapabilities rigCaps;
rigstate state;
bool haveRigCaps=false;
quint8 model = 0; // Was model_kind but that makes no sense when users can create their own rigs!

Wyświetl plik

@ -280,15 +280,6 @@ rigCtlD::~rigCtlD()
}
void rigCtlD::receiveStateInfo(rigstate* state)
{
qInfo("Setting rig state");
rigState = state;
}
int rigCtlD::startServer(qint16 port)
{
if (!this->listen(QHostAddress::Any, port)) {
@ -304,7 +295,7 @@ int rigCtlD::startServer(qint16 port)
}
void rigCtlD::incomingConnection(qintptr socket) {
rigCtlClient* client = new rigCtlClient(socket, rigCaps, rigState, this);
rigCtlClient* client = new rigCtlClient(socket, rigCaps, this);
connect(this, SIGNAL(onStopped()), client, SLOT(closeSocket()));
}
@ -321,14 +312,13 @@ void rigCtlD::receiveRigCaps(rigCapabilities caps)
this->rigCaps = caps;
}
rigCtlClient::rigCtlClient(int socketId, rigCapabilities caps, rigstate* state, rigCtlD* parent) : QObject(parent)
rigCtlClient::rigCtlClient(int socketId, rigCapabilities caps, rigCtlD* parent) : QObject(parent)
{
queue = cachingQueue::getInstance(this);
commandBuffer.clear();
sessionId = socketId;
rigCaps = caps;
rigState = state;
socket = new QTcpSocket(this);
this->parent = parent;
if (!socket->setSocketDescriptor(sessionId))
@ -340,7 +330,6 @@ rigCtlClient::rigCtlClient(int socketId, rigCapabilities caps, rigstate* state,
connect(socket, SIGNAL(disconnected()), this, SLOT(socketDisconnected()), Qt::DirectConnection);
connect(parent, SIGNAL(sendData(QString)), this, SLOT(sendData(QString)), Qt::DirectConnection);
qInfo(logRigCtlD()) << " session connected: " << sessionId;
emit parent->stateUpdated(); // Get the current state.
}

Wyświetl plik

@ -21,7 +21,6 @@
#include "rigcommander.h"
#include "cachingqueue.h"
#include "rigstate.h"
#define CONSTANT_64BIT_FLAG(BIT) (1ull << (BIT))
@ -291,7 +290,6 @@ signals:
void setVFO(quint8 vfo);
void setSplit(quint8 split);
void setDuplexMode(duplexMode_t dm);
void stateUpdated();
// Power
void sendPowerOn();
void sendPowerOff();
@ -315,12 +313,8 @@ signals:
public slots:
virtual void incomingConnection(qintptr socketDescriptor);
void receiveRigCaps(rigCapabilities caps);
void receiveStateInfo(rigstate* state);
// void receiveFrequency(freqt freq);
private:
rigstate* rigState = Q_NULLPTR;
};
@ -330,7 +324,7 @@ class rigCtlClient : public QObject
public:
explicit rigCtlClient(int socket, rigCapabilities caps, rigstate *state, rigCtlD* parent = Q_NULLPTR);
explicit rigCtlClient(int socket, rigCapabilities caps, rigCtlD* parent = Q_NULLPTR);
int getSocketId();
@ -348,7 +342,6 @@ protected:
private:
cachingQueue* queue;
rigCapabilities rigCaps;
rigstate* rigState = Q_NULLPTR;
rigCtlD* parent;
bool chkVfoEecuted=false;
unsigned long crcTable[256];

Wyświetl plik

@ -130,10 +130,11 @@ struct centerSpanData {
struct bandType {
bandType() {}
bandType(availableBands band, quint64 lowFreq, quint64 highFreq, double range, int memGroup) :
band(band), lowFreq(lowFreq), highFreq(highFreq), range(range), memGroup(memGroup) {}
bandType(availableBands band, uchar bsr, quint64 lowFreq, quint64 highFreq, double range, int memGroup) :
band(band), bsr(bsr), lowFreq(lowFreq), highFreq(highFreq), range(range), memGroup(memGroup) {}
availableBands band;
uchar bsr;
quint64 lowFreq;
quint64 highFreq;
rigMode_t defaultMode;
@ -141,6 +142,21 @@ struct bandType {
int memGroup;
};
// Used for setting/retrieving BSR information
struct bandStackType {
bandStackType() {}
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;
};
struct filterType {
filterType() {}
filterType(unsigned char num, QString name, unsigned int modes) :
@ -160,19 +176,6 @@ struct genericType {
};
struct bandStackType {
bandStackType() {}
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;
};
//model_kind determineRadioModel(unsigned char rigID);

Wyświetl plik

@ -82,6 +82,11 @@ void settingswidget::populateComboBoxes()
ui->audioTXCodecCombo->blockSignals(false);
ui->controlPortTxt->setValidator(new QIntValidator(this));
ui->modInputData2ComboText->setVisible(false);
ui->modInputData2Combo->setVisible(false);
ui->modInputData3ComboText->setVisible(false);
ui->modInputData3Combo->setVisible(false);
}
// Updating Preferences:
@ -175,7 +180,7 @@ void settingswidget::setUItoClustersList()
}
}
void settingswidget::updateIfPrefs(int items)
void settingswidget::updateIfPrefs(quint64 items)
{
prefIfItem pif;
if(items & (int)if_all)
@ -193,7 +198,25 @@ void settingswidget::updateIfPrefs(int items)
}
}
void settingswidget::updateRaPrefs(int items)
void settingswidget::updateColPrefs(quint64 items)
{
prefColItem col;
if(items & (int)if_all)
{
items = 0xffffffff;
}
for(int i=1; i < (int)col_all; i = i << 1)
{
if(items & i)
{
qDebug(logGui()) << "Updating Color pref" << (int)i;
col = (prefColItem)i;
updateColPref(col);
}
}
}
void settingswidget::updateRaPrefs(quint64 items)
{
prefRaItem pra;
if(items & (int)ra_all)
@ -211,7 +234,26 @@ void settingswidget::updateRaPrefs(int items)
}
}
void settingswidget::updateCtPrefs(int items)
void settingswidget::updateRsPrefs(quint64 items)
{
prefRsItem prs;
if(items & (int)rs_all)
{
items = 0xffffffff;
}
for(int i=1; i < (int)rs_all; i = i << 1)
{
if(items & i)
{
qInfo(logGui()) << "Updating Rs pref" << (int)i;
prs = (prefRsItem)i;
updateRsPref(prs);
}
}
}
void settingswidget::updateCtPrefs(quint64 items)
{
prefCtItem pct;
if(items & (int)ct_all)
@ -229,7 +271,7 @@ void settingswidget::updateCtPrefs(int items)
}
}
void settingswidget::updateServerConfigs(int items)
void settingswidget::updateServerConfigs(quint64 items)
{
serverItems si;
if(items & (int)s_all)
@ -247,7 +289,7 @@ void settingswidget::updateServerConfigs(int items)
}
}
void settingswidget::updateLanPrefs(int items)
void settingswidget::updateLanPrefs(quint64 items)
{
prefLanItem plan;
if(items & (int)l_all)
@ -265,7 +307,7 @@ void settingswidget::updateLanPrefs(int items)
}
}
void settingswidget::updateClusterPrefs(int items)
void settingswidget::updateClusterPrefs(quint64 items)
{
prefClusterItem pcl;
if(items & (int)cl_all)
@ -358,6 +400,23 @@ void settingswidget::updateIfPref(prefIfItem pif)
updatingUIFromPrefs = false;
}
void settingswidget::updateColPref(prefColItem col)
{
if(prefs==NULL)
return;
updatingUIFromPrefs = true;
switch(col)
{
case col_grid:
break;
default:
qWarning(logGui()) << "Did not understand color pref update item " << (int)col;
break;
}
updatingUIFromPrefs = false;
}
void settingswidget::updateRaPref(prefRaItem pra)
{
if(prefs==NULL)
@ -432,9 +491,7 @@ void settingswidget::updateRaPref(prefRaItem pra)
break;
}
case ra_serialPortBaud:
ui->baudRateCombo->blockSignals(true);
ui->baudRateCombo->setCurrentIndex(ui->baudRateCombo->findData(prefs->serialPortBaud));
ui->baudRateCombo->blockSignals(false);
quietlyUpdateCombobox(ui->baudRateCombo,QVariant::fromValue(prefs->serialPortBaud));
break;
case ra_virtualSerialPort:
{
@ -473,6 +530,34 @@ void settingswidget::updateRaPref(prefRaItem pra)
updatingUIFromPrefs = false;
}
void settingswidget::updateRsPref(prefRsItem prs)
{
if(prefs==NULL)
return;
updatingUIFromPrefs = true;
switch(prs)
{
case rs_dataOffMod:
quietlyUpdateCombobox(ui->modInputCombo,QVariant::fromValue(prefs->inputDataOff));
break;
case rs_data1Mod:
quietlyUpdateCombobox(ui->modInputData1Combo,QVariant::fromValue(prefs->inputData1));
break;
case rs_data2Mod:
quietlyUpdateCombobox(ui->modInputData2Combo,QVariant::fromValue(prefs->inputData2));
break;
case rs_data3Mod:
quietlyUpdateCombobox(ui->modInputData3Combo,QVariant::fromValue(prefs->inputData3));
break;
default:
qWarning(logGui()) << "Cannot update rs pref" << (int)prs;
}
updatingUIFromPrefs = false;
}
void settingswidget::updateCtPref(prefCtItem pct)
{
if(prefs==NULL)
@ -831,26 +916,44 @@ void settingswidget::updateVSPList(QStringList deviceList, QVector<int> data)
}
}
void settingswidget::updateModSourceList(QStringList deviceNames, QVector<rigInput> data)
void settingswidget::updateModSourceList(uchar num, QVector<rigInput> data)
{
ui->modInputCombo->blockSignals(true);
ui->modInputCombo->clear();
for(int i=0; i < deviceNames.length(); i++)
{
ui->modInputCombo->addItem(deviceNames.at(i), QVariant::fromValue(data.at(i)));
}
ui->modInputCombo->blockSignals(false);
}
void settingswidget::updateDataModSourceList(QStringList deviceNames, QVector<rigInput> data)
{
ui->modInputDataCombo->blockSignals(true);
ui->modInputDataCombo->clear();
for(int i=0; i < deviceNames.length(); i++)
QComboBox* combo;
switch (num)
{
ui->modInputDataCombo->addItem(deviceNames.at(i), QVariant::fromValue(data.at(i)));
case 0:
combo = ui->modInputCombo;
break;
case 1:
combo = ui->modInputData1Combo;
break;
case 2:
combo = ui->modInputData2Combo;
ui->modInputData2ComboText->setVisible(true);
break;
case 3:
combo = ui->modInputData3Combo;
ui->modInputData3ComboText->setVisible(true);
break;
default:
return;
}
ui->modInputDataCombo->blockSignals(false);
combo->blockSignals(true);
combo->clear();
foreach (auto input, data)
{
combo->addItem(input.name, QVariant::fromValue(input.type));
}
if (data.length()==0){
combo->addItem("None", QVariant::fromValue(inputNone));
}
combo->setVisible(true);
combo->blockSignals(false);
}
void settingswidget::populateServerUsers()
@ -965,6 +1068,20 @@ void settingswidget::quietlyUpdateSlider(QSlider *sl, int val)
sl->blockSignals(false);
}
void settingswidget::quietlyUpdateCombobox(QComboBox *cb, int index)
{
cb->blockSignals(true);
cb->setCurrentIndex(index);
cb->blockSignals(false);
}
void settingswidget::quietlyUpdateCombobox(QComboBox *cb, QVariant val)
{
cb->blockSignals(true);
cb->setCurrentIndex(cb->findData(val));
cb->blockSignals(false);
}
void settingswidget::quietlyUpdateSpinbox(QSpinBox *sb, int val)
{
sb->blockSignals(true);
@ -1184,9 +1301,7 @@ void settingswidget::on_serialDeviceListCombo_activated(const QString &arg1)
tr("/dev/device"), &ok);
if(manualPort.isEmpty() || !ok)
{
ui->serialDeviceListCombo->blockSignals(true);
ui->serialDeviceListCombo->setCurrentIndex(0);
ui->serialDeviceListCombo->blockSignals(false);
quietlyUpdateCombobox(ui->serialDeviceListCombo,0);
return;
} else {
prefs->serialPortRadio = manualPort;
@ -1234,18 +1349,14 @@ void settingswidget::on_vspCombo_activated(int index)
void settingswidget::on_audioSystemCombo_currentIndexChanged(int value)
{
prefs->audioSystem = static_cast<audioType>(value);
ui->audioSystemServerCombo->blockSignals(true);
ui->audioSystemServerCombo->setCurrentIndex(value);
ui->audioSystemServerCombo->blockSignals(false);
quietlyUpdateCombobox(ui->audioSystemServerCombo,value);
emit changedRaPref(ra_audioSystem);
}
void settingswidget::on_audioSystemServerCombo_currentIndexChanged(int value)
{
prefs->audioSystem = static_cast<audioType>(value);
ui->audioSystemCombo->blockSignals(true);
ui->audioSystemCombo->setCurrentIndex(value);
ui->audioSystemCombo->blockSignals(false);
quietlyUpdateCombobox(ui->audioSystemCombo,value);
emit changedRaPref(ra_audioSystem);
}
@ -1391,17 +1502,10 @@ void settingswidget::on_clusterServerNameCombo_currentIndexChanged(int index)
qInfo(logGui) << "Editing Cluster server" << text;
clusters[index].server = text;
}
ui->clusterUsernameLineEdit->blockSignals(true);
ui->clusterPasswordLineEdit->blockSignals(true);
ui->clusterTimeoutLineEdit->blockSignals(true);
ui->clusterTcpPortLineEdit->setText(QString::number(clusters[index].port));
ui->clusterUsernameLineEdit->setText(clusters[index].userName);
ui->clusterPasswordLineEdit->setText(clusters[index].password);
ui->clusterTimeoutLineEdit->setText(QString::number(clusters[index].timeout));
ui->clusterUsernameLineEdit->blockSignals(false);
ui->clusterPasswordLineEdit->blockSignals(false);
ui->clusterTimeoutLineEdit->blockSignals(false);
quietlyUpdateLineEdit(ui->clusterTcpPortLineEdit,QString::number(clusters[index].port));
quietlyUpdateLineEdit(ui->clusterUsernameLineEdit,clusters[index].userName);
quietlyUpdateLineEdit(ui->clusterPasswordLineEdit,clusters[index].password);
quietlyUpdateLineEdit(ui->clusterTimeoutLineEdit,QString::number(clusters[index].timeout));
for (int i = 0; i < clusters.size(); i++) {
if (i == index)
@ -1611,3 +1715,26 @@ void settingswidget::on_serverAddUserBtn_clicked()
ui->serverAddUserBtn->setEnabled(false);
}
void settingswidget::on_modInputCombo_activated(int index)
{
emit changedModInput(0,ui->modInputCombo->currentData().value<inputTypes>());
}
void settingswidget::on_modInputData1Combo_activated(int index)
{
emit changedModInput(1,ui->modInputData1Combo->currentData().value<inputTypes>());
}
void settingswidget::on_modInputData2Combo_activated(int index)
{
emit changedModInput(2,ui->modInputData2Combo->currentData().value<inputTypes>());
}
void settingswidget::on_modInputData3Combo_activated(int index)
{
emit changedModInput(3,ui->modInputData3Combo->currentData().value<inputTypes>());
}

Wyświetl plik

@ -42,15 +42,19 @@ public slots:
void copyClusterList(QList<clusterSettings> c);
void insertClusterOutputText(QString text);
void updateIfPrefs(int items);
void updateRaPrefs(int items);
void updateCtPrefs(int items);
void updateLanPrefs(int items);
void updateClusterPrefs(int items);
void updateServerConfigs(int items);
void updateIfPrefs(quint64 items);
void updateColPrefs(quint64 items);
void updateRaPrefs(quint64 items);
void updateRsPrefs(quint64 items);
void updateCtPrefs(quint64 items);
void updateLanPrefs(quint64 items);
void updateClusterPrefs(quint64 items);
void updateServerConfigs(quint64 items);
void updateIfPref(prefIfItem pif);
void updateColPref(prefColItem pra);
void updateRaPref(prefRaItem pra);
void updateRsPref(prefRsItem pra);
void updateCtPref(prefCtItem pct);
void updateLanPref(prefLanItem plan);
void updateClusterPref(prefClusterItem pcl);
@ -67,17 +71,17 @@ public slots:
void updateSerialPortList(QStringList deviceList, QVector<int> data);
void updateVSPList(QStringList deviceList, QVector<int> data);
void updateModSourceList(QStringList deviceNames, QVector<rigInput> data);
void updateDataModSourceList(QStringList deviceNames, QVector<rigInput> data);
void updateModSourceList(uchar num, QVector<rigInput> data);
signals:
void changedIfPrefs(int items);
void changedRaPrefs(int items);
void changedCtPrefs(int items);
void changedLanPrefs(int items);
void changedClusterPrefs(int items);
void changedUdpPrefs(int items);
void changedServerConfigs(int i);
void changedIfPrefs(quint64 items);
void changedRaPrefs(quint64 items);
void changedRsPrefs(quint64 items);
void changedCtPrefs(quint64 items);
void changedLanPrefs(quint64 items);
void changedClusterPrefs(quint64 items);
void changedUdpPrefs(quint64 items);
void changedServerConfigs(quint64 items);
void changedAudioOutputCombo(int index);
void changedAudioInputCombo(int index);
@ -86,6 +90,7 @@ signals:
void changedIfPref(prefIfItem i);
void changedRaPref(prefRaItem i);
void changedRsPref(prefRsItem i);
void changedCtPref(prefCtItem i);
void changedLanPref(prefLanItem i);
void changedClusterPref(prefClusterItem i);
@ -93,6 +98,7 @@ signals:
void changedServerConfig(serverItems i);
void showUSBControllerSetup();
void changedModInput(uchar num, inputTypes input);
private slots:
void on_settingsList_currentRowChanged(int currentRow);
@ -151,6 +157,12 @@ private slots:
void on_serverAddUserBtn_clicked();
void on_modInputCombo_activated(int index);
void on_modInputData1Combo_activated(int index);
void on_modInputData2Combo_activated(int index);
void on_modInputData3Combo_activated(int index);
private:
Ui::settingswidget *ui;
void createSettingsListItems();
@ -161,6 +173,8 @@ private:
// Utility:
void quietlyUpdateSlider(QSlider* sl, int val);
void quietlyUpdateCombobox(QComboBox *cb, int index);
void quietlyUpdateCombobox(QComboBox *cb, QVariant val);
void quietlyUpdateSpinbox(QSpinBox *sb, int val);
void quietlyUpdateCheckbox(QCheckBox *cb, bool isChecked);
void quietlyUpdateRadiobutton(QRadioButton *rb, bool isChecked);

Wyświetl plik

@ -41,7 +41,7 @@
<item>
<widget class="QStackedWidget" name="settingsStack">
<property name="currentIndex">
<number>3</number>
<number>2</number>
</property>
<widget class="QWidget" name="radioAccess">
<layout class="QVBoxLayout" name="verticalLayout_21">
@ -1211,8 +1211,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>916</width>
<height>311</height>
<width>925</width>
<height>332</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_2">
@ -1960,7 +1960,7 @@
<item>
<widget class="QLabel" name="label_27">
<property name="text">
<string>Modulation Input:</string>
<string>Data Off Modulation Input:</string>
</property>
</widget>
</item>
@ -1980,12 +1980,12 @@
<item>
<widget class="QLabel" name="label_29">
<property name="text">
<string>Data Mod Input:</string>
<string>(Data Mod Inputs) DATA1:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="modInputDataCombo">
<widget class="QComboBox" name="modInputData1Combo">
<property name="accessibleName">
<string>Data Modulation Input</string>
</property>
@ -1997,6 +1997,26 @@
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="modInputData2ComboText">
<property name="text">
<string>DATA2:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="modInputData2Combo"/>
</item>
<item>
<widget class="QLabel" name="modInputData3ComboText">
<property name="text">
<string>DATA3:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="modInputData3Combo"/>
</item>
<item>
<spacer name="horizontalSpacer_15">
<property name="orientation">

Wyświetl plik

@ -74,7 +74,6 @@ wfmain::wfmain(const QString settingsFile, const QString logFile, bool debugMode
qRegisterMetaType<SERVERCONFIG>();
qRegisterMetaType<timekind>();
qRegisterMetaType<datekind>();
qRegisterMetaType<rigstate*>();
qRegisterMetaType<QList<radio_cap_packet>>();
qRegisterMetaType<QVector<BUTTON>*>();
qRegisterMetaType<QVector<KNOB>*>();
@ -836,13 +835,6 @@ void wfmain::makeRig()
connect(rig, SIGNAL(discoveredRigID(rigCapabilities)), this, SLOT(receiveFoundRigID(rigCapabilities)));
connect(rig, SIGNAL(commReady()), this, SLOT(receiveCommReady()));
connect(this, SIGNAL(requestRigState()), rig, SLOT(sendState()));
connect(this, SIGNAL(stateUpdated()), rig, SLOT(stateUpdated()));
connect(rig, SIGNAL(stateInfo(rigstate*)), this, SLOT(receiveStateInfo(rigstate*)));
if (rigCtl != Q_NULLPTR) {
connect(rig, SIGNAL(stateInfo(rigstate*)), rigCtl, SLOT(receiveStateInfo(rigstate*)));
connect(rigCtl, SIGNAL(stateUpdated()), rig, SLOT(stateUpdated()));
}
// Create link for server so it can have easy access to rig.
if (serverConfig.rigs.first() != Q_NULLPTR) {
serverConfig.rigs.first()->rig = rig;
@ -1166,10 +1158,10 @@ void wfmain::setupMainUI()
ui->baudRateCombo->insertItem(8, QString("1200"), 1200);
ui->baudRateCombo->insertItem(9, QString("300"), 300);
ui->spectrumMode_tCombo->addItem("Center", (spectrumMode_t)spectModeCenter);
ui->spectrumMode_tCombo->addItem("Fixed", (spectrumMode_t)spectModeFixed);
ui->spectrumMode_tCombo->addItem("Scroll-C", (spectrumMode_t)spectModeScrollC);
ui->spectrumMode_tCombo->addItem("Scroll-F", (spectrumMode_t)spectModeScrollF);
ui->spectrumModeCombo->addItem("Center", (spectrumMode_t)spectModeCenter);
ui->spectrumModeCombo->addItem("Fixed", (spectrumMode_t)spectModeFixed);
ui->spectrumModeCombo->addItem("Scroll-C", (spectrumMode_t)spectModeScrollC);
ui->spectrumModeCombo->addItem("Scroll-F", (spectrumMode_t)spectModeScrollF);
ui->modeFilterCombo->addItem("1", 1);
ui->modeFilterCombo->addItem("2", 2);
@ -1359,24 +1351,30 @@ void wfmain::setupMainUI()
void wfmain::connectSettingsWidget()
{
connect(setupui, SIGNAL(changedClusterPref(prefClusterItem)), this, SLOT(extChangedClusterPref(prefClusterItem)));
connect(setupui, SIGNAL(changedClusterPrefs(int)), this, SLOT(extChangedClusterPrefs(int)));
connect(setupui, SIGNAL(changedClusterPrefs(quint64)), this, SLOT(extChangedClusterPrefs(quint64)));
connect(setupui, SIGNAL(changedCtPref(prefCtItem)), this, SLOT(extChangedCtPref(prefCtItem)));
connect(setupui, SIGNAL(changedCtPrefs(int)), this, SLOT(extChangedCtPrefs(int)));
connect(setupui, SIGNAL(changedCtPrefs(quint64)), this, SLOT(extChangedCtPrefs(quint64)));
connect(setupui, SIGNAL(changedIfPref(prefIfItem)), this, SLOT(extChangedIfPref(prefIfItem)));
connect(setupui, SIGNAL(changedIfPrefs(int)), this, SLOT(extChangedIfPrefs(int)));
connect(setupui, SIGNAL(changedIfPrefs(quint64)), this, SLOT(extChangedIfPrefs(quint64)));
connect(setupui, SIGNAL(changedColPref(prefColItem)), this, SLOT(extChangedColPref(prefColItem)));
connect(setupui, SIGNAL(changedColPrefs(quint64)), this, SLOT(extChangedColPrefs(quint64)));
connect(setupui, SIGNAL(changedLanPref(prefLanItem)), this, SLOT(extChangedLanPref(prefLanItem)));
connect(setupui, SIGNAL(changedLanPrefs(int)), this, SLOT(extChangedLanPrefs(int)));
connect(setupui, SIGNAL(changedLanPrefs(quint64)), this, SLOT(extChangedLanPrefs(quint64)));
connect(setupui, SIGNAL(changedRaPref(prefRaItem)), this, SLOT(extChangedRaPref(prefRaItem)));
connect(setupui, SIGNAL(changedRaPrefs(int)), this, SLOT(extChangedRaPrefs(int)));
connect(setupui, SIGNAL(changedRaPrefs(quint64)), this, SLOT(extChangedRaPrefs(quint64)));
connect(setupui, SIGNAL(changedRsPref(prefRsItem)), this, SLOT(extChangedRsPref(prefRsItem)));
connect(setupui, SIGNAL(changedRsPrefs(quint64)), this, SLOT(extChangedRsPrefs(quint64)));
connect(setupui, SIGNAL(changedUdpPref(udpPrefsItem)), this, SLOT(extChangedUdpPref(udpPrefsItem)));
connect(setupui, SIGNAL(changedUdpPrefs(int)), this, SLOT(extChangedUdpPrefs(int)));
connect(setupui, SIGNAL(changedUdpPrefs(quint64)), this, SLOT(extChangedUdpPrefs(quint64)));
connect(setupui, &settingswidget::showUSBControllerSetup, [=](){
connect(setupui, &settingswidget::showUSBControllerSetup, this, [=](){
if(usbWindow != Q_NULLPTR)
showAndRaiseWidget(usbWindow);
});
@ -1388,6 +1386,7 @@ void wfmain::connectSettingsWidget()
connect(setupui, SIGNAL(changedServerRXAudioInputCombo(int)), this, SLOT(changedServerRXAudioInput(int)));
connect(setupui, SIGNAL(changedServerTXAudioOutputCombo(int)), this, SLOT(changedServerTXAudioOutput(int)));
connect(setupui, SIGNAL(changedModInput(uchar,inputTypes)), this, SLOT(changedModInput(uchar,inputTypes)));
}
void wfmain::prepareSettingsWindow()
@ -2862,6 +2861,7 @@ void wfmain::loadSettings()
setupui->acceptPreferencesPtr(&prefs);
setupui->updateIfPrefs((int)if_all);
setupui->updateRaPrefs((int)ra_all);
setupui->updateRsPrefs((int)ra_all); // Most of these come from the rig anyway
setupui->updateCtPrefs((int)ct_all);
setupui->updateClusterPrefs((int)cl_all);
setupui->updateLanPrefs((int)l_all);
@ -2871,7 +2871,7 @@ void wfmain::loadSettings()
}
void wfmain::extChangedIfPrefs(int items)
void wfmain::extChangedIfPrefs(quint64 items)
{
prefIfItem pif;
if(items & (int)if_all)
@ -2889,7 +2889,25 @@ void wfmain::extChangedIfPrefs(int items)
}
}
void wfmain::extChangedRaPrefs(int items)
void wfmain::extChangedColPrefs(quint64 items)
{
prefColItem col;
if(items & (int)col_all)
{
items = 0xffffffff;
}
for(int i=1; i < (int)col_all; i = i << 1)
{
if(items & i)
{
qDebug(logSystem()) << "Updating Color pref in wfmain" << (int)i;
col = (prefColItem)i;
extChangedColPref(col);
}
}
}
void wfmain::extChangedRaPrefs(quint64 items)
{
prefRaItem pra;
if(items & (int)ra_all)
@ -2907,7 +2925,25 @@ void wfmain::extChangedRaPrefs(int items)
}
}
void wfmain::extChangedCtPrefs(int items)
void wfmain::extChangedRsPrefs(quint64 items)
{
prefRsItem prs;
if(items & (int)rs_all)
{
items = 0xffffffff;
}
for(int i=1; i < (int)rs_all; i = i << 1)
{
if(items & i)
{
qDebug(logSystem()) << "Updating Rs pref in wfmain" << (int)i;
prs = (prefRsItem)i;
extChangedRsPref(prs);
}
}
}
void wfmain::extChangedCtPrefs(quint64 items)
{
prefCtItem pct;
if(items & (int)ct_all)
@ -2925,7 +2961,7 @@ void wfmain::extChangedCtPrefs(int items)
}
}
void wfmain::extChangedLanPrefs(int items)
void wfmain::extChangedLanPrefs(quint64 items)
{
prefLanItem plan;
if(items & (int)l_all)
@ -2943,7 +2979,7 @@ void wfmain::extChangedLanPrefs(int items)
}
}
void wfmain::extChangedClusterPrefs(int items)
void wfmain::extChangedClusterPrefs(quint64 items)
{
prefClusterItem pcl;
if(items & (int)cl_all)
@ -2961,7 +2997,7 @@ void wfmain::extChangedClusterPrefs(int items)
}
}
void wfmain::extChangedUdpPrefs(int items)
void wfmain::extChangedUdpPrefs(quint64 items)
{
udpPrefsItem upi;
if(items & (int)u_all)
@ -3052,6 +3088,17 @@ void wfmain::extChangedIfPref(prefIfItem i)
}
}
void wfmain::extChangedColPref(prefColItem i)
{
switch(i)
{
case col_grid:
break;
default:
qWarning(logSystem()) << "Cannot update wfmain col pref" << (int)i;
}
}
void wfmain::extChangedRaPref(prefRaItem i)
{
// Radio Access Prefs
@ -3103,6 +3150,27 @@ void wfmain::extChangedRaPref(prefRaItem i)
}
}
void wfmain::extChangedRsPref(prefRsItem i)
{
// Radio Settings prefs
switch(i)
{
case rs_dataOffMod:
break;
case rs_data1Mod:
break;
case rs_data2Mod:
break;
case rs_data3Mod:
break;
case rs_clockUseUtc:
break;
default:
qWarning(logSystem()) << "Cannot update wfmain rs pref" << (int)i;
}
}
void wfmain::extChangedCtPref(prefCtItem i)
{
switch(i)
@ -3390,6 +3458,44 @@ void wfmain::changedServerTXAudioOutput(int value)
}
void wfmain::changedModInput(uchar val, inputTypes type)
{
queue->del(getInputTypeCommand(currentModData1Src.type));
funcs func=funcNone;
switch (val)
{
case 0:
func = funcDATAOffMod;
break;
case 1:
func = funcDATA1Mod;
break;
case 2:
func = funcDATA2Mod;
break;
case 3:
func = funcDATA3Mod;
break;
default:
break;
}
foreach(auto inp, rigCaps.inputs)
{
if (inp.type == type)
{
queue->add(priorityImmediate,queueItem(func,QVariant::fromValue<rigInput>(inp)));
if(usingDataMode==val)
{
changeModLabel(inp);
}
break;
}
}
}
void wfmain::saveSettings()
@ -3730,7 +3836,7 @@ void wfmain::showHideSpectrum(bool show)
// Controls:
ui->spectrumGroupBox->setVisible(show);
ui->spectrumMode_tCombo->setVisible(show);
ui->spectrumModeCombo->setVisible(show);
ui->scopeBWCombo->setVisible(show);
ui->scopeEdgeCombo->setVisible(show);
ui->scopeEnableWFBtn->setVisible(show);
@ -3760,11 +3866,6 @@ void wfmain::showHideSpectrum(bool show)
}
void wfmain::prepareWf()
{
prepareWf(160);
}
void wfmain::prepareWf(unsigned int wfLength)
{
// All this code gets moved in from the constructor of wfmain.
@ -4573,10 +4674,7 @@ void wfmain::receiveRigID(rigCapabilities rigCaps)
ui->tuningStepCombo->setCurrentIndex(2);
ui->tuningStepCombo->blockSignals(false);
QStringList modSources;
QVector<rigInput> modData;
if(rigCaps.model == model9700)
if(rigCaps.commands.contains(funcSatelliteMode))
{
ui->satOpsBtn->setDisabled(false);
ui->adjRefBtn->setDisabled(false);
@ -4584,58 +4682,26 @@ void wfmain::receiveRigID(rigCapabilities rigCaps)
ui->satOpsBtn->setDisabled(true);
ui->adjRefBtn->setDisabled(true);
}
// Clear input combos before adding known inputs.
ui->modInputCombo->clear();
ui->modInputData1Combo->clear();
ui->modInputData2Combo->clear();
ui->modInputData3Combo->clear();
foreach (auto&& input, rigCaps.inputs)
{
qInfo() << "Adding mod input" << input.name << input.type;
ui->modInputCombo->addItem(input.name, input.type);
ui->modInputData1Combo->addItem(input.name, input.type);
ui->modInputData2Combo->addItem(input.name, input.type);
ui->modInputData3Combo->addItem(input.name, input.type);
}
if(rigCaps.inputs.length() == 0)
{
ui->modInputCombo->addItem("None", inputNone);
ui->modInputData1Combo->addItem("None", inputNone);
ui->modInputData2Combo->addItem("None", inputNone);
ui->modInputData3Combo->addItem("None", inputNone);
}
setupui->updateModSourceList(0, rigCaps.inputs);
setupui->updateModSourceList(1, rigCaps.inputs);
ui->datamodeCombo->clear();
ui->datamodeCombo->addItem("Off",0);
if (rigCaps.commands.contains(funcDATA2Mod))
{
ui->modInputData2ComboText->setVisible(true);
ui->modInputData2Combo->setVisible(true);
setupui->updateModSourceList(2, rigCaps.inputs);
ui->datamodeCombo->addItem("Data1",1);
ui->datamodeCombo->addItem("Data2",2);
} else {
ui->datamodeCombo->addItem("On",1);
ui->modInputData2ComboText->setVisible(false);
ui->modInputData2Combo->setVisible(false);
}
if (rigCaps.commands.contains(funcDATA3Mod))
{
ui->modInputData3ComboText->setVisible(true);
ui->modInputData3Combo->setVisible(true);
setupui->updateModSourceList(3, rigCaps.inputs);
ui->datamodeCombo->addItem("Data3",3);
} else {
ui->modInputData3ComboText->setVisible(false);
ui->modInputData3Combo->setVisible(false);
ui->modInputCombo->addItem("None", inputNone);
modSources.append("None");
modData.append(inputNone);
}
setupui->updateModSourceList(modSources, modData);
setupui->updateDataModSourceList(modSources, modData);
ui->attSelCombo->clear();
if(rigCaps.commands.contains(funcAttenuator))
@ -4756,6 +4822,7 @@ void wfmain::initPeriodicCommands()
queue->add(priorityMediumHigh,(rigCaps.commands.contains(funcDATAOffMod)?funcDATAOffMod:funcNone),true);
queue->add(priorityMediumHigh,(rigCaps.commands.contains(funcDATA1Mod)?funcDATA1Mod:funcNone),true);
queue->add(priorityMediumHigh,(rigCaps.commands.contains(funcDATA2Mod)?funcDATA2Mod:funcNone),true);
queue->add(priorityMediumHigh,(rigCaps.commands.contains(funcDATA3Mod)?funcDATA3Mod:funcNone),true);
}
if (rigCaps.commands.contains(funcRFPower))
queue->add(priorityMedium,funcRFPower,true);
@ -5160,9 +5227,9 @@ void wfmain::computePlasma()
void wfmain::receivespectrumMode(spectrumMode_t spectMode)
{
ui->spectrumMode_tCombo->blockSignals(true);
ui->spectrumMode_tCombo->setCurrentIndex(ui->spectrumMode_tCombo->findData(spectMode));
ui->spectrumMode_tCombo->blockSignals(false);
ui->spectrumModeCombo->blockSignals(true);
ui->spectrumModeCombo->setCurrentIndex(ui->spectrumModeCombo->findData(spectMode));
ui->spectrumModeCombo->blockSignals(false);
setUISpectrumControlsToMode(spectMode);
}
@ -5613,20 +5680,10 @@ void wfmain::receiveMode(modeInfo mode)
ui->modeFilterCombo->blockSignals(false);
}
//currentModeIndex = mode;
finputbtns->updateCurrentMode(currentMode);
//finputbtns->updateFilterSelection(filter);
//currentModeInfo.mk = (rigMode_t)mode;
//currentMode = (rigMode_t)mode;
//currentModeInfo.filter = filter;
//currentModeInfo.reg = mode;
//rpt->handleUpdateCurrentMainMode(currentModeInfo);
//cw->handleCurrentModeUpdate(currentMode);
//if (!found)
//{
// qWarning(logSystem()) << __func__ << "Received mode " << mode << " but could not match to any index within the modeSelectCombo. ";
// return;
//}
finputbtns->updateCurrentMode(mode.mk);
rpt->handleUpdateCurrentMainMode(mode);
cw->handleCurrentModeUpdate(mode.mk);
if (maxPassbandHz != 0)
{
@ -5638,9 +5695,12 @@ void wfmain::receiveMode(modeInfo mode)
{
queue->add(priorityImmediate,funcDataModeWithFilter);
} else {
receiveDataModeStatus(mode.data,mode.filter);
//receiveDataModeStatus(mode.data,mode.filter);
finputbtns->updateFilterSelection(mode.filter);
}
currentModeInfo = mode;
return; // We have nothing more to process
}
}
@ -5685,7 +5745,7 @@ void wfmain::changeFullScreenMode(bool checked)
void wfmain::on_spectrumModeCombo_currentIndexChanged(int index)
{
spectrumMode_t smode = static_cast<spectrumMode_t>(ui->spectrumMode_tCombo->itemData(index).toInt());
spectrumMode_t smode = static_cast<spectrumMode_t>(ui->spectrumModeCombo->itemData(index).toInt());
queue->add(priorityImmediate,queueItem(funcScopeMainMode,QVariant::fromValue(smode)));
setUISpectrumControlsToMode(smode);
}
@ -5765,27 +5825,19 @@ void wfmain::on_modeSelectCombo_activated(int index)
// The "activated" signal means the user initiated a mode change.
// This function is not called if code initiated the change.
unsigned char newMode = static_cast<unsigned char>(ui->modeSelectCombo->itemData(index).toUInt());
rigMode_t newMode = static_cast<rigMode_t>(ui->modeSelectCombo->itemData(index).toUInt());
int filterSelection = ui->modeFilterCombo->currentData().toInt();
if(filterSelection == 99)
qInfo(logSystem()) << __func__ << " at index " << index << " has newMode: " << newMode;
foreach (modeInfo mi, rigCaps.modes)
{
// oops, we forgot to reset the combo box
return;
} else {
//qInfo(logSystem()) << __func__ << " at index " << index << " has newMode: " << newMode;
foreach (modeInfo mi, rigCaps.modes)
if (mi.mk == newMode)
{
if (mi.mk == (rigMode_t)newMode)
{
modeInfo m = modeInfo(mi);
m.filter = filterSelection;
m.data = usingDataMode;
m.VFO=selVFO_t::activeVFO;
queue->add(priorityImmediate,queueItem((rigCaps.commands.contains(funcSelectedMode)?funcSelectedMode:funcModeSet),QVariant::fromValue<modeInfo>(m),false));
queue->add(priorityImmediate,(rigCaps.commands.contains(funcSelectedMode)?funcSelectedMode:funcModeGet),false);
break;
}
modeInfo m = modeInfo(mi);
m.filter = static_cast<uchar>(ui->modeFilterCombo->currentData().toInt());
m.data = usingDataMode;
m.VFO=selVFO_t::activeVFO;
queue->add(priorityImmediate,queueItem((rigCaps.commands.contains(funcSelectedMode)?funcSelectedMode:funcModeSet),QVariant::fromValue<modeInfo>(m),false));
break;
}
}
}
@ -6504,37 +6556,44 @@ void wfmain::processModLevel(inputTypes source, unsigned char level)
void wfmain::receiveModInput(rigInput input, unsigned char data)
{
QComboBox *box = Q_NULLPTR;
//qInfo() << QString("Data: %0 Input: %1 current: %2").arg(data).arg(input.name).arg(currentModDataOffSrc.name);
prefRsItem item= rs_all;
// This will ONLY fire if the input type is different to the current one
if (data == 0 && currentModDataOffSrc.type != input.type) {
qInfo() << QString("Data: %0 Input: %1 current: %2").arg(data).arg(input.name).arg(currentModDataOffSrc.name);
queue->del(getInputTypeCommand(currentModDataOffSrc.type));
box = ui->modInputCombo;
item = rs_dataOffMod;
prefs.inputDataOff = input.type;
currentModDataOffSrc = input;
} else if (data == 1 && currentModData1Src.type != input.type) {
qInfo() << QString("Data: %0 Input: %1 current: %2").arg(data).arg(input.name).arg(currentModData1Src.name);
queue->del(getInputTypeCommand(currentModData1Src.type));
box = ui->modInputData1Combo;
item = rs_data1Mod;
prefs.inputData1 = input.type;
currentModData1Src = input;
} else if (data == 2 && currentModData2Src.type != input.type) {
qInfo() << QString("Data: %0 Input: %1 current: %2").arg(data).arg(input.name).arg(currentModData2Src.name);
queue->del(getInputTypeCommand(currentModData2Src.type));
box = ui->modInputData2Combo;
item = rs_data2Mod;
prefs.inputData2 = input.type;
currentModData2Src = input;
} else if (data == 3 && currentModData3Src.type != input.type) {
qInfo() << QString("Data: %0 Input: %1 current: %2").arg(data).arg(input.name).arg(currentModData3Src.name);
queue->del(getInputTypeCommand(currentModData3Src.type));
box = ui->modInputData3Combo;
item = rs_data3Mod;
prefs.inputData3 = input.type;
currentModData3Src = input;
}
if (box != Q_NULLPTR)
if (item != rs_all)
{
box->blockSignals(true);
box->setCurrentIndex(box->findData((int)input.type));
box->blockSignals(false);
setupui->updateRsPrefs(item);
if (ui->datamodeCombo->currentData().toUInt() == data) {
queue->add(priorityImmediate,getInputTypeCommand(input.type),false);
changeModLabel(input);
}
}
}
@ -6734,92 +6793,6 @@ void wfmain::receiveSpectrumRefLevel(int level)
changeSliderQuietly(ui->scopeRefLevelSlider, level);
}
void wfmain::on_modInputCombo_activated(int index)
{
queue->del(getInputTypeCommand(currentModDataOffSrc.type));
foreach(auto inp, rigCaps.inputs)
{
if (inp.type == inputTypes(ui->modInputCombo->currentData().toInt()))
{
currentModDataOffSrc = rigInput(inp);
if(usingDataMode==0)
{
queue->add(priorityImmediate,queueItem(funcDATAOffMod,QVariant::fromValue<rigInput>(currentModDataOffSrc)));
changeModLabel(currentModDataOffSrc);
}
return;;
}
}
qWarning(logSystem()) << "Invalid Input type (check rigcaps)" << ui->modInputCombo->currentData().toInt();
(void)index;
}
void wfmain::on_modInputData1Combo_activated(int index)
{
queue->del(getInputTypeCommand(currentModData1Src.type));
foreach(auto inp, rigCaps.inputs)
{
if (inp.type == inputTypes(ui->modInputData1Combo->currentData().toInt()))
{
currentModData1Src = rigInput(inp);
if(usingDataMode==1)
{
queue->add(priorityImmediate,queueItem(funcDATA1Mod,QVariant::fromValue<rigInput>(currentModData1Src)));
changeModLabel(currentModData1Src);
}
return;
}
}
qWarning(logSystem()) << "DATA1 Invalid Input type (check rigcaps)" << ui->modInputData1Combo->currentData().toInt();
(void)index;
}
void wfmain::on_modInputData2Combo_activated(int index)
{
queue->del(getInputTypeCommand(currentModData2Src.type));
foreach(auto inp, rigCaps.inputs)
{
if (inp.type == inputTypes(ui->modInputData2Combo->currentData().toInt()))
{
currentModData2Src = rigInput(inp);
if(usingDataMode==1)
{
changeModLabel(currentModData1Src);
queue->add(priorityImmediate,queueItem(funcDATA2Mod,QVariant::fromValue<rigInput>(currentModData2Src)));
}
return;
}
}
qWarning(logSystem()) << "DATA2 Invalid Input type (check rigcaps)" << ui->modInputData2Combo->currentData().toInt();
(void)index;
}
void wfmain::on_modInputData3Combo_activated(int index)
{
queue->del(getInputTypeCommand(currentModData3Src.type));
foreach(auto inp, rigCaps.inputs)
{
if (inp.type == inputTypes(ui->modInputData3Combo->currentData().toInt()))
{
currentModData3Src = rigInput(inp);
if(usingDataMode==3)
{
changeModLabel(currentModData3Src);
queue->add(priorityImmediate,queueItem(funcDATA3Mod,QVariant::fromValue<rigInput>(currentModData3Src)));
}
return;
}
}
qWarning(logSystem()) << "DATA3 Invalid Input type (check rigcaps)" << ui->modInputData3Combo->currentData().toInt();
(void)index;
}
void wfmain::changeModLabelAndSlider(rigInput source)
@ -7322,14 +7295,9 @@ void wfmain::enableRigCtl(bool enabled)
connect(this, SIGNAL(sendRigCaps(rigCapabilities)), rigCtl, SLOT(receiveRigCaps(rigCapabilities)));
if (rig != Q_NULLPTR) {
// We are already connected to a rig.
connect(rig, SIGNAL(stateInfo(rigstate*)), rigCtl, SLOT(receiveStateInfo(rigstate*)));
connect(rigCtl, SIGNAL(stateUpdated()), rig, SLOT(stateUpdated()));
emit sendRigCaps(rigCaps);
emit requestRigState();
}
}
//prefs.enableRigCtlD = checked;
}
void wfmain::on_moreControlsBtn_clicked()
@ -7350,12 +7318,6 @@ void wfmain::on_useCIVasRigIDChk_clicked(bool checked)
prefs.CIVisRadioModel = checked;
}
void wfmain::receiveStateInfo(rigstate* state)
{
qInfo("Setting rig state for wfmain");
rigState = state;
}
void wfmain::on_setClockBtn_clicked()
{
setRadioTimeDatePrep();
@ -9212,9 +9174,9 @@ void wfmain::receiveValue(cacheItem val){
break;
case funcDSPIFFilter:
break;
case funcNotchWidth:
case funcManualNotchWidth:
break;
case funcSSBBandwidth:
case funcSSBTXBandwidth:
break;
case funcMainSubTracking:
break;

Wyświetl plik

@ -26,7 +26,6 @@
#include "prefs.h"
#include "commhandler.h"
#include "rigcommander.h"
#include "rigstate.h"
#include "freqmemory.h"
#include "rigidentities.h"
#include "repeaterattributes.h"
@ -289,8 +288,7 @@ signals:
void initServer();
void sendRigCaps(rigCapabilities caps);
void openShuttle();
void requestRigState();
void stateUpdated();
void initUsbController(QMutex* mutex,usbDevMap* devs ,QVector<BUTTON>* buts,QVector<KNOB>* knobs);
void setClusterUdpPort(int port);
void setClusterEnableUdp(bool udp);
@ -308,15 +306,19 @@ signals:
private slots:
// Triggered from external preference changes:
void extChangedIfPrefs(int items);
void extChangedRaPrefs(int items);
void extChangedCtPrefs(int items);
void extChangedLanPrefs(int items);
void extChangedClusterPrefs(int items);
void extChangedUdpPrefs(int items);
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 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);
@ -510,11 +512,6 @@ private slots:
void on_micGainSlider_valueChanged(int value);
void on_scopeRefLevelSlider_valueChanged(int value);
void useSystemTheme(bool checked);
void on_modInputCombo_activated(int index);
void on_modInputData1Combo_activated(int index);
void on_modInputData2Combo_activated(int index);
void on_modInputData3Combo_activated(int index);
void on_tuneLockChk_clicked(bool checked);
@ -547,17 +544,18 @@ private slots:
void on_useCIVasRigIDChk_clicked(bool checked);
void receiveStateInfo(rigstate* state);
void on_settingsList_currentRowChanged(int currentRow);
void on_setClockBtn_clicked();
void on_serverEnableCheckbox_clicked(bool checked);
void on_serverControlPortText_textChanged(QString text);
void on_serverCivPortText_textChanged(QString text);
void on_serverAudioPortText_textChanged(QString text);
void changedServerTXAudioOutput(int value);
void changedServerRXAudioInput(int value);
void onServerUserFieldChanged();
void changedModInput(uchar val, inputTypes type);
void on_serverAddUserBtn_clicked();
void on_radioStatusBtn_clicked();
void on_audioSystemCombo_currentIndexChanged(int value);
@ -677,7 +675,6 @@ private:
QCPItemText* oorIndicator;
QCPItemText* ovfIndicator;
void setAppTheme(bool isCustom);
void prepareWf();
void prepareWf(unsigned int wfLength);
void preparePlasma();
bool plasmaPrepared = false;
@ -975,8 +972,6 @@ private:
unsigned int tsWfScrollHz;
unsigned int tsKnobHz;
rigstate* rigState = Q_NULLPTR;
passbandActions passbandAction = passbandStatic;
double PBTInner = 0.0;
double PBTOuter = 0.0;
@ -1028,7 +1023,6 @@ Q_DECLARE_METATYPE(networkStatus)
Q_DECLARE_METATYPE(networkAudioLevels)
Q_DECLARE_METATYPE(spotData)
Q_DECLARE_METATYPE(radio_cap_packet)
Q_DECLARE_METATYPE(rigstate*)
Q_DECLARE_METATYPE(BUTTON)
Q_DECLARE_METATYPE(QVector<BUTTON>*)
Q_DECLARE_METATYPE(KNOB)

Wyświetl plik

@ -18,7 +18,7 @@
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>0</number>
<number>1</number>
</property>
<widget class="QWidget" name="mainTab">
<attribute name="title">
@ -68,7 +68,7 @@
</widget>
</item>
<item>
<widget class="QComboBox" name="spectrumMode_tCombo">
<widget class="QComboBox" name="spectrumModeCombo">
<property name="accessibleName">
<string>Spectrum Mode</string>
</property>
@ -1685,7 +1685,7 @@
<item>
<widget class="QStackedWidget" name="settingsStack">
<property name="currentIndex">
<number>3</number>
<number>1</number>
</property>
<widget class="QWidget" name="radioAccess">
<layout class="QVBoxLayout" name="verticalLayout_21">
@ -2403,13 +2403,6 @@ Please use the &quot;Radio Server&quot; page to select server audio</string>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="rigCreatorBtn">
<property name="text">
<string>Rig Creator</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
@ -2635,8 +2628,8 @@ Please use the &quot;Radio Server&quot; page to select server audio</string>
<rect>
<x>0</x>
<y>0</y>
<width>453</width>
<height>235</height>
<width>852</width>
<height>259</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_2">
@ -3381,66 +3374,6 @@ Please use the &quot;Radio Server&quot; page to select server audio</string>
<layout class="QVBoxLayout" name="verticalLayout_25">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_30">
<item>
<widget class="QLabel" name="label_27">
<property name="text">
<string>Modulation Input:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="modInputCombo">
<property name="accessibleName">
<string>Modulation Input</string>
</property>
<property name="accessibleDescription">
<string>Transmit modulation source</string>
</property>
<property name="sizeAdjustPolicy">
<enum>QComboBox::AdjustToContents</enum>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_29">
<property name="text">
<string>(Data Mod Inputs) DATA1</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="modInputData1Combo">
<property name="accessibleName">
<string>Data Modulation Input</string>
</property>
<property name="accessibleDescription">
<string>Transmit Data-mode modulation input source</string>
</property>
<property name="sizeAdjustPolicy">
<enum>QComboBox::AdjustToContents</enum>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="modInputData2ComboText">
<property name="text">
<string>DATA2</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="modInputData2Combo"/>
</item>
<item>
<widget class="QLabel" name="modInputData3ComboText">
<property name="text">
<string>DATA3</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="modInputData3Combo"/>
</item>
<item>
<spacer name="horizontalSpacer_15">
<property name="orientation">
@ -4593,6 +4526,13 @@ Please use the &quot;Radio Server&quot; page to select server audio</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="rigCreatorBtn">
<property name="text">
<string>Rig Creator</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_32">
<property name="orientation">
@ -4648,7 +4588,7 @@ Please use the &quot;Radio Server&quot; page to select server audio</string>
<rect>
<x>0</x>
<y>0</y>
<width>1042</width>
<width>1063</width>
<height>20</height>
</rect>
</property>

Wyświetl plik

@ -316,7 +316,6 @@ HEADERS += wfmain.h \
repeatersetup.h \
repeaterattributes.h \
rigctld.h \
rigstate.h \
ulaw.h \
usbcontroller.h \
controllersetup.h \

Wyświetl plik

@ -222,7 +222,7 @@ funcSWRMeter, funcALCMeter, funcCompMeter, funcVdMeter,
funcAGCTime, funcNoiseBlanker, funcAudioPeakFilter, funcNoiseReduction, funcAutoNotch, funcRepeaterTone,
funcRepeaterTSQL, funcRepeaterDTCS, funcRepeaterCSQL, funcCompressor, funcMonitor, funcVox,
funcBreakIn, funcManualNotch, funcDigiSel, funcTwinPeakFilter, funcDialLock, funcRXAntenna,
funcDSPIFFilter, funcNotchWidth, funcSSBBandwidth, funcMainSubTracking, funcSatelliteMode, funcDSQLSetting,
funcDSPIFFilter, funcManualNotchWidth, funcSSBTXBandwidth, funcMainSubTracking, funcSatelliteMode, funcDSQLSetting,
funcToneSquelchType, funcIPPlus, funcSendCW, funcPowerControl, funcTransceiverId, funcFilterWidth,
funcMemoryContents, funcBandStackReg, funcMemoryKeyer, funcIFFilterWidth, funcQuickDualWatch, funcQuickSplit,
funcAutoRepeater, funcTunerStatus, funcTransverter, funcTransverterOffset, funcLockFunction, funcREFAdjust,
@ -262,7 +262,7 @@ static QString funcString[] { "None",
"AGC Time Constant", "Noise Blanker", "Audio Peak Filter", "Noise Reduction", "Auto Notch", "Repeater Tone",
"Repeater TSQL", "Repeater DTCS", "Repeater CSQL", "Compressor Status", "Monitor Status", "Vox Status",
"Break-In Status", "Manual Notch", "DIGI-Sel Status", "Twin Peak Filter", "Dial Lock Status", "RX Antenna",
"DSP IF Filter", "Manual Notch Width", "SSB Bandwidth", "Main/Sub Tracking", "Satellite Mode", "DSQL Setting",
"DSP IF Filter", "Manual Notch Width", "SSB TX Bandwidth", "Main/Sub Tracking", "Satellite Mode", "DSQL Setting",
"Tone Squelch Type", "IP Plus Status", "Send CW", "Power Control", "Transceiver ID", "Filter Width",
"Memory Contents", "Band Stacking Reg", "Memory Keyer", "IF Filter Width", "Quick Dual Watch", "Quick Split",
"Auto Repeater Mode", "Tuner/ATU Status", "Transverter Function", "Transverter Offset", "Lock Function", "REF Adjust",