kopia lustrzana https://gitlab.com/eliggett/wfview
Merge branch 'morecontrols' of gitlab.com:eliggett/wfview into morecontrols
commit
de9f510d76
42
wfmain.cpp
42
wfmain.cpp
|
@ -4643,13 +4643,6 @@ void wfmain::initPeriodicCommands()
|
||||||
|
|
||||||
rapidPollCmdQueueEnabled = false;
|
rapidPollCmdQueueEnabled = false;
|
||||||
rapidPollCmdQueue.clear();
|
rapidPollCmdQueue.clear();
|
||||||
if (rigCaps.hasSpectrum) {
|
|
||||||
// Get passband
|
|
||||||
|
|
||||||
insertSlowPeriodicCommand(cmdGetPassband, 128);
|
|
||||||
insertSlowPeriodicCommand(cmdGetTPBFInner, 128);
|
|
||||||
insertSlowPeriodicCommand(cmdGetTPBFOuter, 128);
|
|
||||||
}
|
|
||||||
rapidPollCmdQueueEnabled = true;
|
rapidPollCmdQueueEnabled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4690,7 +4683,9 @@ 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());
|
qDebug() << "Removing" << cmd << "From periodic queue, len" << slowPollCmdQueue.size();
|
||||||
|
periodicCmdQueue.erase(std::remove_if(periodicCmdQueue.begin(), periodicCmdQueue.end(), [cmd](const cmds& c) { return (c == cmd); }), periodicCmdQueue.end());
|
||||||
|
qDebug() << "Removed" << cmd << "From periodic queue, len" << slowPollCmdQueue.size();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
while(true)
|
while(true)
|
||||||
|
@ -4709,7 +4704,9 @@ void wfmain::removePeriodicRapidCmd(cmds cmd)
|
||||||
void wfmain::removePeriodicCommand(cmds cmd)
|
void wfmain::removePeriodicCommand(cmds cmd)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
qDebug() << "Removing" << cmd << "From periodic queue, len" << slowPollCmdQueue.size();
|
||||||
periodicCmdQueue.erase(std::remove_if(periodicCmdQueue.begin(), periodicCmdQueue.end(), [cmd](const cmds& c) { return (c == cmd); }), periodicCmdQueue.end());
|
periodicCmdQueue.erase(std::remove_if(periodicCmdQueue.begin(), periodicCmdQueue.end(), [cmd](const cmds& c) { return (c == cmd); }), periodicCmdQueue.end());
|
||||||
|
qDebug() << "Removed" << cmd << "From periodic queue, len" << slowPollCmdQueue.size();
|
||||||
|
|
||||||
/* while (true)
|
/* while (true)
|
||||||
{
|
{
|
||||||
|
@ -4730,12 +4727,21 @@ void wfmain::insertSlowPeriodicCommand(cmds cmd, unsigned char priority=100)
|
||||||
// TODO: meaningful priority
|
// TODO: meaningful priority
|
||||||
// These commands are run every 20 "ticks" of the primary radio command loop
|
// These commands are run every 20 "ticks" of the primary radio command loop
|
||||||
// Basically 20 times less often than the standard periodic command
|
// Basically 20 times less often than the standard periodic command
|
||||||
|
qDebug() << "Inserting" << cmd << "To slow queue, priority" << priority << "len" << slowPollCmdQueue.size();
|
||||||
if(priority < 10)
|
if(priority < 10)
|
||||||
{
|
{
|
||||||
slowPollCmdQueue.push_front(cmd);
|
slowPollCmdQueue.push_front(cmd);
|
||||||
} else {
|
} else {
|
||||||
slowPollCmdQueue.push_back(cmd);
|
slowPollCmdQueue.push_back(cmd);
|
||||||
}
|
}
|
||||||
|
qDebug() << "Inserted" << cmd << "To slow queue, priority" << priority << "len" << slowPollCmdQueue.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
void wfmain::removeSlowPeriodicCommand(cmds cmd)
|
||||||
|
{
|
||||||
|
qDebug() << "Removing" << cmd << "From slow queue, len" << slowPollCmdQueue.size();
|
||||||
|
slowPollCmdQueue.erase(std::remove_if(slowPollCmdQueue.begin(), slowPollCmdQueue.end(), [cmd](const cmds& c) { return (c == cmd); }), slowPollCmdQueue.end());
|
||||||
|
qDebug() << "Removed" << cmd << "From slow queue, len" << slowPollCmdQueue.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
void wfmain::receiveFreq(freqt freqStruct)
|
void wfmain::receiveFreq(freqt freqStruct)
|
||||||
|
@ -5449,6 +5455,10 @@ void wfmain::receiveMode(unsigned char mode, unsigned char filter)
|
||||||
{
|
{
|
||||||
|
|
||||||
removePeriodicRapidCmd(cmdGetCwPitch);
|
removePeriodicRapidCmd(cmdGetCwPitch);
|
||||||
|
removeSlowPeriodicCommand(cmdGetPassband);
|
||||||
|
removeSlowPeriodicCommand(cmdGetTPBFInner);
|
||||||
|
removeSlowPeriodicCommand(cmdGetTPBFOuter);
|
||||||
|
|
||||||
quint16 maxPassbandHz = 0;
|
quint16 maxPassbandHz = 0;
|
||||||
switch ((mode_kind)mode) {
|
switch ((mode_kind)mode) {
|
||||||
case modeFM:
|
case modeFM:
|
||||||
|
@ -5464,6 +5474,7 @@ void wfmain::receiveMode(unsigned char mode, unsigned char filter)
|
||||||
case modeCW:
|
case modeCW:
|
||||||
case modeCW_R:
|
case modeCW_R:
|
||||||
insertPeriodicRapidCmdUnique(cmdGetCwPitch);
|
insertPeriodicRapidCmdUnique(cmdGetCwPitch);
|
||||||
|
issueDelayedCommandUnique(cmdGetCwPitch);
|
||||||
maxPassbandHz = 3600;
|
maxPassbandHz = 3600;
|
||||||
break;
|
break;
|
||||||
case modeAM:
|
case modeAM:
|
||||||
|
@ -5516,11 +5527,16 @@ void wfmain::receiveMode(unsigned char mode, unsigned char filter)
|
||||||
trxadj->setMaxPassband(maxPassbandHz);
|
trxadj->setMaxPassband(maxPassbandHz);
|
||||||
}
|
}
|
||||||
|
|
||||||
issueDelayedCommandUnique(cmdGetPassband);
|
if (currentModeInfo.mk != modeFM)
|
||||||
issueDelayedCommandUnique(cmdGetCwPitch);
|
{
|
||||||
issueDelayedCommandUnique(cmdGetTPBFInner);
|
insertSlowPeriodicCommand(cmdGetPassband, 128);
|
||||||
issueDelayedCommandUnique(cmdGetTPBFOuter);
|
insertSlowPeriodicCommand(cmdGetTPBFInner, 128);
|
||||||
|
insertSlowPeriodicCommand(cmdGetTPBFOuter, 128);
|
||||||
|
issueDelayedCommandUnique(cmdGetPassband);
|
||||||
|
issueDelayedCommandUnique(cmdGetTPBFInner);
|
||||||
|
issueDelayedCommandUnique(cmdGetTPBFOuter);
|
||||||
|
}
|
||||||
|
|
||||||
// Note: we need to know if the DATA mode is active to reach mode-D
|
// Note: we need to know if the DATA mode is active to reach mode-D
|
||||||
// some kind of queued query:
|
// some kind of queued query:
|
||||||
if (rigCaps.hasDataModes && rigCaps.hasTransmit)
|
if (rigCaps.hasDataModes && rigCaps.hasTransmit)
|
||||||
|
|
1
wfmain.h
1
wfmain.h
|
@ -1038,6 +1038,7 @@ private:
|
||||||
|
|
||||||
|
|
||||||
void insertSlowPeriodicCommand(cmds cmd, unsigned char priority);
|
void insertSlowPeriodicCommand(cmds cmd, unsigned char priority);
|
||||||
|
void removeSlowPeriodicCommand(cmds cmd);
|
||||||
void calculateTimingParameters();
|
void calculateTimingParameters();
|
||||||
void changePollTiming(int timing_ms, bool setUI=false);
|
void changePollTiming(int timing_ms, bool setUI=false);
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue