kopia lustrzana https://gitlab.com/eliggett/wfview
Merge branch 'pbt-fixes' into half-duplex
commit
6759625c37
|
@ -35,6 +35,7 @@ struct udpPreferences {
|
||||||
QString password;
|
QString password;
|
||||||
QString clientName;
|
QString clientName;
|
||||||
quint8 waterfallFormat;
|
quint8 waterfallFormat;
|
||||||
|
bool halfDuplex;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct networkAudioLevels {
|
struct networkAudioLevels {
|
||||||
|
|
329
wfmain.cpp
329
wfmain.cpp
|
@ -2708,6 +2708,7 @@ void wfmain::saveSettings()
|
||||||
settings->setValue("ResampleQuality", rxSetup.resampleQuality);
|
settings->setValue("ResampleQuality", rxSetup.resampleQuality);
|
||||||
settings->setValue("ClientName", udpPrefs.clientName);
|
settings->setValue("ClientName", udpPrefs.clientName);
|
||||||
settings->setValue("WaterfallFormat", prefs.waterfallFormat);
|
settings->setValue("WaterfallFormat", prefs.waterfallFormat);
|
||||||
|
settings->setValue("HalfDuplex", udpPrefs.halfDuplex);
|
||||||
|
|
||||||
settings->endGroup();
|
settings->endGroup();
|
||||||
|
|
||||||
|
@ -4063,9 +4064,15 @@ void wfmain::issueDelayedCommandUnique(cmds cmd)
|
||||||
cmddata.cmd = cmd;
|
cmddata.cmd = cmd;
|
||||||
cmddata.data = NULL;
|
cmddata.data = NULL;
|
||||||
|
|
||||||
|
delayedCmdQue.push_front(cmddata);
|
||||||
|
delayedCmdQue.erase(std::remove_if(delayedCmdQue.begin() + 1, delayedCmdQue.end(), [cmd](const commandtype& c) { return (c.cmd == cmd); }), delayedCmdQue.end());
|
||||||
|
|
||||||
// The following is both expensive and not that great,
|
// The following is both expensive and not that great,
|
||||||
// since it does not check if the arguments are the same.
|
// since it does not check if the arguments are the same.
|
||||||
bool found = false;
|
/* bool found = false;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
for(unsigned int i=0; i < delayedCmdQue.size(); i++)
|
for(unsigned int i=0; i < delayedCmdQue.size(); i++)
|
||||||
{
|
{
|
||||||
if(delayedCmdQue.at(i).cmd == cmd)
|
if(delayedCmdQue.at(i).cmd == cmd)
|
||||||
|
@ -4084,7 +4091,9 @@ void wfmain::issueDelayedCommandUnique(cmds cmd)
|
||||||
// {
|
// {
|
||||||
// delayedCmdQue.push_front(cmddata);
|
// delayedCmdQue.push_front(cmddata);
|
||||||
// }
|
// }
|
||||||
|
*/
|
||||||
|
|
||||||
|
// delayedCmdQue.push_front(cmddata);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wfmain::issueCmd(cmds cmd, mode_info m)
|
void wfmain::issueCmd(cmds cmd, mode_info m)
|
||||||
|
@ -4183,7 +4192,9 @@ void wfmain::issueCmdUniquePriority(cmds cmd, bool b)
|
||||||
cmddata.cmd = cmd;
|
cmddata.cmd = cmd;
|
||||||
cmddata.data = std::shared_ptr<bool>(new bool(b));
|
cmddata.data = std::shared_ptr<bool>(new bool(b));
|
||||||
delayedCmdQue.push_front(cmddata);
|
delayedCmdQue.push_front(cmddata);
|
||||||
removeSimilarCommand(cmd);
|
delayedCmdQue.erase(std::remove_if(delayedCmdQue.begin() + 1, delayedCmdQue.end(), [cmd](const commandtype& c) { return (c.cmd == cmd); }), delayedCmdQue.end());
|
||||||
|
|
||||||
|
//removeSimilarCommand(cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wfmain::issueCmdUniquePriority(cmds cmd, unsigned char c)
|
void wfmain::issueCmdUniquePriority(cmds cmd, unsigned char c)
|
||||||
|
@ -4192,7 +4203,9 @@ void wfmain::issueCmdUniquePriority(cmds cmd, unsigned char c)
|
||||||
cmddata.cmd = cmd;
|
cmddata.cmd = cmd;
|
||||||
cmddata.data = std::shared_ptr<unsigned char>(new unsigned char(c));
|
cmddata.data = std::shared_ptr<unsigned char>(new unsigned char(c));
|
||||||
delayedCmdQue.push_front(cmddata);
|
delayedCmdQue.push_front(cmddata);
|
||||||
removeSimilarCommand(cmd);
|
delayedCmdQue.erase(std::remove_if(delayedCmdQue.begin() + 1, delayedCmdQue.end(), [cmd](const commandtype& c) { return (c.cmd == cmd); }), delayedCmdQue.end());
|
||||||
|
|
||||||
|
//removeSimilarCommand(cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wfmain::issueCmdUniquePriority(cmds cmd, char c)
|
void wfmain::issueCmdUniquePriority(cmds cmd, char c)
|
||||||
|
@ -4201,7 +4214,8 @@ void wfmain::issueCmdUniquePriority(cmds cmd, char c)
|
||||||
cmddata.cmd = cmd;
|
cmddata.cmd = cmd;
|
||||||
cmddata.data = std::shared_ptr<char>(new char(c));
|
cmddata.data = std::shared_ptr<char>(new char(c));
|
||||||
delayedCmdQue.push_front(cmddata);
|
delayedCmdQue.push_front(cmddata);
|
||||||
removeSimilarCommand(cmd);
|
delayedCmdQue.erase(std::remove_if(delayedCmdQue.begin() + 1, delayedCmdQue.end(), [cmd](const commandtype& c) { return (c.cmd == cmd); }), delayedCmdQue.end());
|
||||||
|
//removeSimilarCommand(cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wfmain::issueCmdUniquePriority(cmds cmd, freqt f)
|
void wfmain::issueCmdUniquePriority(cmds cmd, freqt f)
|
||||||
|
@ -4210,7 +4224,8 @@ void wfmain::issueCmdUniquePriority(cmds cmd, freqt f)
|
||||||
cmddata.cmd = cmd;
|
cmddata.cmd = cmd;
|
||||||
cmddata.data = std::shared_ptr<freqt>(new freqt(f));
|
cmddata.data = std::shared_ptr<freqt>(new freqt(f));
|
||||||
delayedCmdQue.push_front(cmddata);
|
delayedCmdQue.push_front(cmddata);
|
||||||
removeSimilarCommand(cmd);
|
delayedCmdQue.erase(std::remove_if(delayedCmdQue.begin() + 1, delayedCmdQue.end(), [cmd](const commandtype& c) { return (c.cmd == cmd); }), delayedCmdQue.end());
|
||||||
|
//removeSimilarCommand(cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wfmain::issueCmdUniquePriority(cmds cmd, quint16 c)
|
void wfmain::issueCmdUniquePriority(cmds cmd, quint16 c)
|
||||||
|
@ -4219,7 +4234,8 @@ void wfmain::issueCmdUniquePriority(cmds cmd, quint16 c)
|
||||||
cmddata.cmd = cmd;
|
cmddata.cmd = cmd;
|
||||||
cmddata.data = std::shared_ptr<quint16>(new quint16(c));
|
cmddata.data = std::shared_ptr<quint16>(new quint16(c));
|
||||||
delayedCmdQue.push_front(cmddata);
|
delayedCmdQue.push_front(cmddata);
|
||||||
removeSimilarCommand(cmd);
|
delayedCmdQue.erase(std::remove_if(delayedCmdQue.begin() + 1, delayedCmdQue.end(), [cmd](const commandtype& c) { return (c.cmd == cmd); }), delayedCmdQue.end());
|
||||||
|
//removeSimilarCommand(cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wfmain::issueCmdUniquePriority(cmds cmd, qint16 c)
|
void wfmain::issueCmdUniquePriority(cmds cmd, qint16 c)
|
||||||
|
@ -4228,7 +4244,8 @@ void wfmain::issueCmdUniquePriority(cmds cmd, qint16 c)
|
||||||
cmddata.cmd = cmd;
|
cmddata.cmd = cmd;
|
||||||
cmddata.data = std::shared_ptr<qint16>(new qint16(c));
|
cmddata.data = std::shared_ptr<qint16>(new qint16(c));
|
||||||
delayedCmdQue.push_front(cmddata);
|
delayedCmdQue.push_front(cmddata);
|
||||||
removeSimilarCommand(cmd);
|
delayedCmdQue.erase(std::remove_if(delayedCmdQue.begin() + 1, delayedCmdQue.end(), [cmd](const commandtype& c) { return (c.cmd == cmd); }), delayedCmdQue.end());
|
||||||
|
//removeSimilarCommand(cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wfmain::removeSimilarCommand(cmds cmd)
|
void wfmain::removeSimilarCommand(cmds cmd)
|
||||||
|
@ -4515,9 +4532,13 @@ void wfmain::initPeriodicCommands()
|
||||||
rapidPollCmdQueue.clear();
|
rapidPollCmdQueue.clear();
|
||||||
if (rigCaps.hasSpectrum) {
|
if (rigCaps.hasSpectrum) {
|
||||||
// Get passband
|
// Get passband
|
||||||
insertPeriodicRapidCmd(cmdGetPassband);
|
//insertPeriodicRapidCmd(cmdGetPassband);
|
||||||
insertPeriodicRapidCmd(cmdGetTPBFInner);
|
//insertPeriodicRapidCmd(cmdGetTPBFInner);
|
||||||
insertPeriodicRapidCmd(cmdGetTPBFOuter);
|
//insertPeriodicRapidCmd(cmdGetTPBFOuter);
|
||||||
|
insertSlowPeriodicCommand(cmdGetPassband, 128);
|
||||||
|
insertSlowPeriodicCommand(cmdGetTPBFInner, 128);
|
||||||
|
insertSlowPeriodicCommand(cmdGetTPBFOuter, 128);
|
||||||
|
|
||||||
}
|
}
|
||||||
rapidPollCmdQueueEnabled = true;
|
rapidPollCmdQueueEnabled = true;
|
||||||
}
|
}
|
||||||
|
@ -4558,6 +4579,10 @@ void wfmain::insertPeriodicCommandUnique(cmds cmd)
|
||||||
|
|
||||||
void wfmain::removePeriodicRapidCmd(cmds cmd)
|
void wfmain::removePeriodicRapidCmd(cmds cmd)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
rapidPollCmdQueue.erase(std::remove_if(rapidPollCmdQueue.begin(), rapidPollCmdQueue.end(), [cmd](const cmds& c) { return (c == cmd); }), rapidPollCmdQueue.end());
|
||||||
|
|
||||||
|
/*
|
||||||
while(true)
|
while(true)
|
||||||
{
|
{
|
||||||
auto it = std::find(this->rapidPollCmdQueue.begin(), this->rapidPollCmdQueue.end(), cmd);
|
auto it = std::find(this->rapidPollCmdQueue.begin(), this->rapidPollCmdQueue.end(), cmd);
|
||||||
|
@ -4568,11 +4593,15 @@ void wfmain::removePeriodicRapidCmd(cmds cmd)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
void wfmain::removePeriodicCommand(cmds cmd)
|
void wfmain::removePeriodicCommand(cmds cmd)
|
||||||
{
|
{
|
||||||
while(true)
|
|
||||||
|
periodicCmdQueue.erase(std::remove_if(periodicCmdQueue.begin(), periodicCmdQueue.end(), [cmd](const cmds& c) { return (c == cmd); }), periodicCmdQueue.end());
|
||||||
|
|
||||||
|
/* while (true)
|
||||||
{
|
{
|
||||||
auto it = std::find(this->periodicCmdQueue.begin(), this->periodicCmdQueue.end(), cmd);
|
auto it = std::find(this->periodicCmdQueue.begin(), this->periodicCmdQueue.end(), cmd);
|
||||||
if(it != periodicCmdQueue.end())
|
if(it != periodicCmdQueue.end())
|
||||||
|
@ -4582,6 +4611,7 @@ void wfmain::removePeriodicCommand(cmds cmd)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -4952,6 +4982,9 @@ void wfmain::handlePlotDoubleClick(QMouseEvent *me)
|
||||||
qint16 newFreq = pbFreq + 128;
|
qint16 newFreq = pbFreq + 128;
|
||||||
issueCmdUniquePriority(cmdSetTPBFInner, (unsigned char)newFreq);
|
issueCmdUniquePriority(cmdSetTPBFInner, (unsigned char)newFreq);
|
||||||
issueCmdUniquePriority(cmdSetTPBFOuter, (unsigned char)newFreq);
|
issueCmdUniquePriority(cmdSetTPBFOuter, (unsigned char)newFreq);
|
||||||
|
issueDelayedCommandUnique(cmdGetTPBFInner);
|
||||||
|
issueDelayedCommandUnique(cmdGetTPBFOuter);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5120,31 +5153,36 @@ void wfmain::handlePlotMouseMove(QMouseEvent* me)
|
||||||
}
|
}
|
||||||
else if (passbandAction == passbandResizing)
|
else if (passbandAction == passbandResizing)
|
||||||
{
|
{
|
||||||
// We are currently resizing the passband.
|
static double lastFreq = movedFrequency;
|
||||||
double pb = 0.0;
|
if (lastFreq - movedFrequency > 0.000049 || movedFrequency - lastFreq > 0.000049) {
|
||||||
double origin = 0.0;
|
|
||||||
switch (currentModeInfo.mk)
|
|
||||||
{
|
|
||||||
case modeCW:
|
|
||||||
case modeCW_R:
|
|
||||||
origin = 0.0;
|
|
||||||
break;
|
|
||||||
case modeLSB:
|
|
||||||
origin = -passbandCenterFrequency;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
origin = passbandCenterFrequency;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (plot->xAxis->pixelToCoord(cursor) >= freq.MHzDouble + origin) {
|
// We are currently resizing the passband.
|
||||||
pb = plot->xAxis->pixelToCoord(cursor) - passbandIndicator->topLeft->coords().x();
|
double pb = 0.0;
|
||||||
}
|
double origin = 0.0;
|
||||||
else {
|
switch (currentModeInfo.mk)
|
||||||
pb = passbandIndicator->bottomRight->coords().x() - plot->xAxis->pixelToCoord(cursor);
|
{
|
||||||
}
|
case modeCW:
|
||||||
|
case modeCW_R:
|
||||||
|
origin = 0.0;
|
||||||
|
break;
|
||||||
|
case modeLSB:
|
||||||
|
origin = -passbandCenterFrequency;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
origin = passbandCenterFrequency;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
issueCmdUniquePriority(cmdSetPassband, (quint16)(pb * 1000000));
|
if (plot->xAxis->pixelToCoord(cursor) >= freq.MHzDouble + origin) {
|
||||||
|
pb = plot->xAxis->pixelToCoord(cursor) - passbandIndicator->topLeft->coords().x();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
pb = passbandIndicator->bottomRight->coords().x() - plot->xAxis->pixelToCoord(cursor);
|
||||||
|
}
|
||||||
|
issueCmdUniquePriority(cmdSetPassband, (quint16)(pb * 1000000));
|
||||||
|
issueDelayedCommandUnique(cmdGetPassband);
|
||||||
|
lastFreq = movedFrequency;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (passbandAction == pbtMoving) {
|
else if (passbandAction == pbtMoving) {
|
||||||
|
|
||||||
|
@ -5164,25 +5202,36 @@ void wfmain::handlePlotMouseMove(QMouseEvent* me)
|
||||||
qDebug() << QString("Moving passband by %1 Hz (Inner %2) (Outer %3) Mode:%4").arg((qint16)(movedFrequency * 1000000))
|
qDebug() << QString("Moving passband by %1 Hz (Inner %2) (Outer %3) Mode:%4").arg((qint16)(movedFrequency * 1000000))
|
||||||
.arg(newInFreq).arg(newOutFreq).arg(currentModeInfo.mk);
|
.arg(newInFreq).arg(newOutFreq).arg(currentModeInfo.mk);
|
||||||
|
|
||||||
issueCmd(cmdSetTPBFInner, (unsigned char)newInFreq);
|
issueCmdUniquePriority(cmdSetTPBFInner, (unsigned char)newInFreq);
|
||||||
issueCmd(cmdSetTPBFOuter, (unsigned char)newOutFreq);
|
issueCmdUniquePriority(cmdSetTPBFOuter, (unsigned char)newOutFreq);
|
||||||
|
issueDelayedCommandUnique(cmdGetTPBFInner);
|
||||||
|
issueDelayedCommandUnique(cmdGetTPBFOuter);
|
||||||
}
|
}
|
||||||
lastFreq = movedFrequency;
|
lastFreq = movedFrequency;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (passbandAction == pbtInnerMove) {
|
else if (passbandAction == pbtInnerMove) {
|
||||||
double pbFreq = ((double)(TPBFInner + movedFrequency) / passbandWidth) * 127.0;
|
static double lastFreq = movedFrequency;
|
||||||
qint16 newFreq = pbFreq + 128;
|
if (lastFreq - movedFrequency > 0.000049 || movedFrequency - lastFreq > 0.000049) {
|
||||||
if (newFreq >= 0 && newFreq <= 255) {
|
double pbFreq = ((double)(TPBFInner + movedFrequency) / passbandWidth) * 127.0;
|
||||||
issueCmdUniquePriority(cmdSetTPBFInner, (unsigned char)newFreq);
|
qint16 newFreq = pbFreq + 128;
|
||||||
|
if (newFreq >= 0 && newFreq <= 255) {
|
||||||
|
issueCmdUniquePriority(cmdSetTPBFInner, (unsigned char)newFreq);
|
||||||
|
issueDelayedCommandUnique(cmdGetTPBFInner);
|
||||||
|
}
|
||||||
|
lastFreq = movedFrequency;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (passbandAction == pbtOuterMove) {
|
else if (passbandAction == pbtOuterMove) {
|
||||||
double pbFreq = ((double)(TPBFOuter + movedFrequency) / passbandWidth) * 127.0;
|
static double lastFreq = movedFrequency;
|
||||||
qint16 newFreq = pbFreq + 128;
|
if (lastFreq - movedFrequency > 0.000049 || movedFrequency - lastFreq > 0.000049) {
|
||||||
if (newFreq >= 0 && newFreq <= 255) {
|
double pbFreq = ((double)(TPBFOuter + movedFrequency) / passbandWidth) * 127.0;
|
||||||
issueCmdUniquePriority(cmdSetTPBFOuter, (unsigned char)newFreq);
|
qint16 newFreq = pbFreq + 128;
|
||||||
|
if (newFreq >= 0 && newFreq <= 255) {
|
||||||
|
issueCmdUniquePriority(cmdSetTPBFOuter, (unsigned char)newFreq);
|
||||||
|
issueDelayedCommandUnique(cmdGetTPBFOuter);
|
||||||
|
}
|
||||||
|
lastFreq = movedFrequency;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (passbandAction == passbandStatic && me->buttons() == Qt::LeftButton && textItem == nullptr && prefs.clickDragTuningEnable)
|
else if (passbandAction == passbandStatic && me->buttons() == Qt::LeftButton && textItem == nullptr && prefs.clickDragTuningEnable)
|
||||||
|
@ -5276,109 +5325,95 @@ void wfmain::receiveMode(unsigned char mode, unsigned char filter)
|
||||||
if(mode < 0x23)
|
if(mode < 0x23)
|
||||||
{
|
{
|
||||||
|
|
||||||
for(int i=0; i < ui->modeSelectCombo->count(); i++)
|
// Update mode information if mode/filter has changed
|
||||||
|
if (currentModeInfo.mk != (mode_kind)mode || currentModeInfo.filter != filter)
|
||||||
{
|
{
|
||||||
if(ui->modeSelectCombo->itemData(i).toInt() == mode)
|
|
||||||
{
|
|
||||||
ui->modeSelectCombo->blockSignals(true);
|
|
||||||
ui->modeSelectCombo->setCurrentIndex(i);
|
|
||||||
ui->modeSelectCombo->blockSignals(false);
|
|
||||||
found = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
currentModeIndex = mode;
|
|
||||||
currentModeInfo.mk = (mode_kind)mode;
|
|
||||||
cw->handleCurrentModeUpdate((mode_kind)mode);
|
|
||||||
currentModeInfo.filter = filter;
|
|
||||||
|
|
||||||
switch (currentModeInfo.mk) {
|
removePeriodicRapidCmd(cmdGetCwPitch);
|
||||||
case modeFM:
|
quint16 maxPassbandHz = 0;
|
||||||
if (currentModeInfo.filter == 1)
|
switch ((mode_kind)mode) {
|
||||||
passbandWidth = 0.015;
|
case modeFM:
|
||||||
else if (currentModeInfo.filter == 2)
|
if (filter == 1)
|
||||||
passbandWidth = 0.010;
|
passbandWidth = 0.015;
|
||||||
else
|
else if (filter == 2)
|
||||||
passbandWidth = 0.007;
|
passbandWidth = 0.010;
|
||||||
passbandCenterFrequency = 0.0;
|
else
|
||||||
break;
|
passbandWidth = 0.007;
|
||||||
case modeLSB:
|
passbandCenterFrequency = 0.0;
|
||||||
case modeUSB:
|
maxPassbandHz = 10E3;
|
||||||
removePeriodicCommand(cmdGetCwPitch);
|
break;
|
||||||
removePeriodicCommand(cmdGetPskTone);
|
case modeCW:
|
||||||
removePeriodicCommand(cmdGetRttyMark);
|
case modeCW_R:
|
||||||
passbandCenterFrequency = 0.0015;
|
insertPeriodicRapidCmdUnique(cmdGetCwPitch);
|
||||||
break;
|
maxPassbandHz = 3600;
|
||||||
case modeCW:
|
break;
|
||||||
case modeCW_R:
|
case modeAM:
|
||||||
insertPeriodicCommandUnique(cmdGetCwPitch);
|
passbandCenterFrequency = 0.0;
|
||||||
removePeriodicCommand(cmdGetPskTone);
|
maxPassbandHz = 10E3;
|
||||||
removePeriodicCommand(cmdGetRttyMark);
|
break;
|
||||||
break;
|
case modeLSB:
|
||||||
default:
|
case modeUSB:
|
||||||
removePeriodicCommand(cmdGetCwPitch);
|
passbandCenterFrequency = 0.0015;
|
||||||
removePeriodicCommand(cmdGetPskTone);
|
maxPassbandHz = 3600;
|
||||||
removePeriodicCommand(cmdGetRttyMark);
|
break;
|
||||||
passbandCenterFrequency = 0.0;
|
default:
|
||||||
break;
|
passbandCenterFrequency = 0.0;
|
||||||
|
maxPassbandHz = 3600;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i = 0; i < ui->modeSelectCombo->count(); i++)
|
||||||
|
{
|
||||||
|
if (ui->modeSelectCombo->itemData(i).toInt() == mode)
|
||||||
|
{
|
||||||
|
ui->modeSelectCombo->blockSignals(true);
|
||||||
|
ui->modeSelectCombo->setCurrentIndex(i);
|
||||||
|
ui->modeSelectCombo->blockSignals(false);
|
||||||
|
found = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((filter) && (filter < 4)) {
|
||||||
|
ui->modeFilterCombo->blockSignals(true);
|
||||||
|
ui->modeFilterCombo->setCurrentIndex(filter - 1);
|
||||||
|
ui->modeFilterCombo->blockSignals(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
currentModeIndex = mode;
|
||||||
|
currentModeInfo.mk = (mode_kind)mode;
|
||||||
|
currentMode = (mode_kind)mode;
|
||||||
|
currentModeInfo.filter = filter;
|
||||||
|
currentModeInfo.reg = mode;
|
||||||
|
rpt->handleUpdateCurrentMainMode(currentModeInfo);
|
||||||
|
|
||||||
|
if (!found)
|
||||||
|
{
|
||||||
|
qWarning(logSystem()) << __func__ << "Received mode " << mode << " but could not match to any index within the modeSelectCombo. ";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (maxPassbandHz != 0)
|
||||||
|
{
|
||||||
|
trxadj->setMaxPassband(maxPassbandHz);
|
||||||
|
}
|
||||||
|
|
||||||
|
issueDelayedCommandUnique(cmdGetPassband);
|
||||||
|
issueDelayedCommandUnique(cmdGetCwPitch);
|
||||||
|
issueDelayedCommandUnique(cmdGetTPBFInner);
|
||||||
|
issueDelayedCommandUnique(cmdGetTPBFOuter);
|
||||||
|
|
||||||
|
// Note: we need to know if the DATA mode is active to reach mode-D
|
||||||
|
// some kind of queued query:
|
||||||
|
if (rigCaps.hasDataModes && rigCaps.hasTransmit)
|
||||||
|
{
|
||||||
|
issueDelayedCommand(cmdGetDataMode);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
qCritical(logSystem()) << __func__ << "Invalid mode " << mode << " received. ";
|
qCritical(logSystem()) << __func__ << "Invalid mode " << mode << " received. ";
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!found)
|
|
||||||
{
|
|
||||||
qWarning(logSystem()) << __func__ << "Received mode " << mode << " but could not match to any index within the modeSelectCombo. ";
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
currentModeIndex = mode;
|
|
||||||
currentModeInfo.mk = (mode_kind)mode;
|
|
||||||
currentMode = (mode_kind)mode;
|
|
||||||
currentModeInfo.filter = filter;
|
|
||||||
currentModeInfo.reg = mode;
|
|
||||||
rpt->handleUpdateCurrentMainMode(currentModeInfo);
|
|
||||||
|
|
||||||
if( (filter) && (filter < 4)){
|
|
||||||
ui->modeFilterCombo->blockSignals(true);
|
|
||||||
ui->modeFilterCombo->setCurrentIndex(filter-1);
|
|
||||||
ui->modeFilterCombo->blockSignals(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
quint16 maxPassbandHz = 0;
|
|
||||||
switch(currentMode)
|
|
||||||
{
|
|
||||||
case modeUSB:
|
|
||||||
case modeLSB:
|
|
||||||
case modeCW:
|
|
||||||
case modeCW_R:
|
|
||||||
case modePSK:
|
|
||||||
case modePSK_R:
|
|
||||||
maxPassbandHz = 3600;
|
|
||||||
break;
|
|
||||||
case modeRTTY:
|
|
||||||
case modeRTTY_R:
|
|
||||||
maxPassbandHz = 2700;
|
|
||||||
break;
|
|
||||||
case modeAM:
|
|
||||||
maxPassbandHz = 10E3;
|
|
||||||
break;
|
|
||||||
case modeFM:
|
|
||||||
maxPassbandHz = 10E3;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if(maxPassbandHz != 0)
|
|
||||||
{
|
|
||||||
trxadj->setMaxPassband(maxPassbandHz);
|
|
||||||
}
|
|
||||||
// Note: we need to know if the DATA mode is active to reach mode-D
|
|
||||||
// some kind of queued query:
|
|
||||||
if (rigCaps.hasDataModes && rigCaps.hasTransmit)
|
|
||||||
{
|
|
||||||
issueDelayedCommand(cmdGetDataMode);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void wfmain::receiveDataModeStatus(bool dataEnabled)
|
void wfmain::receiveDataModeStatus(bool dataEnabled)
|
||||||
|
@ -5661,7 +5696,9 @@ void wfmain::on_modeSelectCombo_activated(int index)
|
||||||
}
|
}
|
||||||
|
|
||||||
issueCmd(cmdSetMode, mode);
|
issueCmd(cmdSetMode, mode);
|
||||||
currentModeInfo = mode;
|
issueDelayedCommand(cmdGetMode);
|
||||||
|
|
||||||
|
//currentModeInfo = mode;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6203,6 +6240,11 @@ void wfmain::on_passwordTxt_textChanged(QString text)
|
||||||
udpPrefs.password = text;
|
udpPrefs.password = text;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void wfmain::on_audioDuplexCombo_currentIndexChanged(int value)
|
||||||
|
{
|
||||||
|
udpPrefs.halfDuplex = (bool)value;
|
||||||
|
}
|
||||||
|
|
||||||
void wfmain::on_audioOutputCombo_currentIndexChanged(int value)
|
void wfmain::on_audioOutputCombo_currentIndexChanged(int value)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -6356,6 +6398,7 @@ void wfmain::on_modeFilterCombo_activated(int index)
|
||||||
m.mk = (mode_kind)newMode;
|
m.mk = (mode_kind)newMode;
|
||||||
m.reg = newMode;
|
m.reg = newMode;
|
||||||
issueCmd(cmdSetMode, m);
|
issueCmd(cmdSetMode, m);
|
||||||
|
|
||||||
//emit setMode(newMode, (unsigned char)filterSelection);
|
//emit setMode(newMode, (unsigned char)filterSelection);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
2
wfmain.h
2
wfmain.h
|
@ -451,6 +451,8 @@ private slots:
|
||||||
|
|
||||||
void on_passwordTxt_textChanged(QString text);
|
void on_passwordTxt_textChanged(QString text);
|
||||||
|
|
||||||
|
void on_audioDuplexCombo_currentIndexChanged(int value);
|
||||||
|
|
||||||
void on_audioOutputCombo_currentIndexChanged(int value);
|
void on_audioOutputCombo_currentIndexChanged(int value);
|
||||||
|
|
||||||
void on_audioInputCombo_currentIndexChanged(int value);
|
void on_audioInputCombo_currentIndexChanged(int value);
|
||||||
|
|
136
wfmain.ui
136
wfmain.ui
|
@ -6,7 +6,7 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>1082</width>
|
<width>1063</width>
|
||||||
<height>660</height>
|
<height>660</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
|
@ -18,7 +18,7 @@
|
||||||
<item>
|
<item>
|
||||||
<widget class="QTabWidget" name="tabWidget">
|
<widget class="QTabWidget" name="tabWidget">
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>0</number>
|
<number>3</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="mainTab">
|
<widget class="QWidget" name="mainTab">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
|
@ -1808,7 +1808,6 @@
|
||||||
<font>
|
<font>
|
||||||
<family>DejaVu Sans Mono</family>
|
<family>DejaVu Sans Mono</family>
|
||||||
<pointsize>14</pointsize>
|
<pointsize>14</pointsize>
|
||||||
<weight>75</weight>
|
|
||||||
<bold>true</bold>
|
<bold>true</bold>
|
||||||
</font>
|
</font>
|
||||||
</property>
|
</property>
|
||||||
|
@ -2233,7 +2232,7 @@
|
||||||
<item>
|
<item>
|
||||||
<widget class="QStackedWidget" name="settingsStack">
|
<widget class="QStackedWidget" name="settingsStack">
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>1</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="radioAccess">
|
<widget class="QWidget" name="radioAccess">
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_21">
|
<layout class="QVBoxLayout" name="verticalLayout_21">
|
||||||
|
@ -2775,61 +2774,26 @@
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_15">
|
<widget class="QLabel" name="label_51">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Audio Output </string>
|
<string>Duplex</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QComboBox" name="audioOutputCombo">
|
<widget class="QComboBox" name="audioDuplexCombo">
|
||||||
<property name="maximumSize">
|
<item>
|
||||||
<size>
|
<property name="text">
|
||||||
<width>120</width>
|
<string>Full Duplex</string>
|
||||||
<height>16777215</height>
|
</property>
|
||||||
</size>
|
</item>
|
||||||
</property>
|
<item>
|
||||||
<property name="accessibleName">
|
<property name="text">
|
||||||
<string>Audio Output Selector</string>
|
<string>Half Duplex</string>
|
||||||
</property>
|
</property>
|
||||||
|
</item>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="label_18">
|
|
||||||
<property name="text">
|
|
||||||
<string>Audio Input</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QComboBox" name="audioInputCombo">
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>120</width>
|
|
||||||
<height>16777215</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="accessibleName">
|
|
||||||
<string>Audio Input Selector</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<spacer name="horizontalSpacer_8">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeType">
|
|
||||||
<enum>QSizePolicy::Fixed</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>15</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_40">
|
<widget class="QLabel" name="label_40">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
|
@ -2871,6 +2835,63 @@
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_47">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_15">
|
||||||
|
<property name="text">
|
||||||
|
<string>Audio Output </string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QComboBox" name="audioOutputCombo">
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>200</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="accessibleName">
|
||||||
|
<string>Audio Output Selector</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_18">
|
||||||
|
<property name="text">
|
||||||
|
<string>Audio Input</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QComboBox" name="audioInputCombo">
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>200</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="accessibleName">
|
||||||
|
<string>Audio Input Selector</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer_37">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -3409,8 +3430,8 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>858</width>
|
<width>579</width>
|
||||||
<height>287</height>
|
<height>224</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout_2">
|
<layout class="QGridLayout" name="gridLayout_2">
|
||||||
|
@ -5359,7 +5380,6 @@
|
||||||
<widget class="QPushButton" name="exitBtn">
|
<widget class="QPushButton" name="exitBtn">
|
||||||
<property name="font">
|
<property name="font">
|
||||||
<font>
|
<font>
|
||||||
<weight>50</weight>
|
|
||||||
<bold>false</bold>
|
<bold>false</bold>
|
||||||
</font>
|
</font>
|
||||||
</property>
|
</property>
|
||||||
|
@ -5378,8 +5398,8 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>1082</width>
|
<width>1063</width>
|
||||||
<height>21</height>
|
<height>22</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
|
@ -5407,7 +5427,7 @@
|
||||||
<connections/>
|
<connections/>
|
||||||
<buttongroups>
|
<buttongroups>
|
||||||
<buttongroup name="pollingButtonGroup"/>
|
<buttongroup name="pollingButtonGroup"/>
|
||||||
<buttongroup name="underlayButtonGroup"/>
|
|
||||||
<buttongroup name="buttonGroup"/>
|
<buttongroup name="buttonGroup"/>
|
||||||
|
<buttongroup name="underlayButtonGroup"/>
|
||||||
</buttongroups>
|
</buttongroups>
|
||||||
</ui>
|
</ui>
|
||||||
|
|
Ładowanie…
Reference in New Issue