kopia lustrzana https://gitlab.com/eliggett/wfview
Remove passband/PBT commands for FM
rodzic
c91d06fea5
commit
166905ee76
34
wfmain.cpp
34
wfmain.cpp
|
@ -4633,13 +4633,6 @@ void wfmain::initPeriodicCommands()
|
|||
|
||||
rapidPollCmdQueueEnabled = false;
|
||||
rapidPollCmdQueue.clear();
|
||||
if (rigCaps.hasSpectrum) {
|
||||
// Get passband
|
||||
|
||||
insertSlowPeriodicCommand(cmdGetPassband, 128);
|
||||
insertSlowPeriodicCommand(cmdGetTPBFInner, 128);
|
||||
insertSlowPeriodicCommand(cmdGetTPBFOuter, 128);
|
||||
}
|
||||
rapidPollCmdQueueEnabled = true;
|
||||
}
|
||||
|
||||
|
@ -4680,7 +4673,9 @@ void wfmain::insertPeriodicCommandUnique(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)
|
||||
|
@ -4699,7 +4694,9 @@ void wfmain::removePeriodicRapidCmd(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());
|
||||
qDebug() << "Removed" << cmd << "From periodic queue, len" << slowPollCmdQueue.size();
|
||||
|
||||
/* while (true)
|
||||
{
|
||||
|
@ -4720,12 +4717,21 @@ void wfmain::insertSlowPeriodicCommand(cmds cmd, unsigned char priority=100)
|
|||
// TODO: meaningful priority
|
||||
// These commands are run every 20 "ticks" of the primary radio command loop
|
||||
// Basically 20 times less often than the standard periodic command
|
||||
qDebug() << "Inserting" << cmd << "To slow queue, priority" << priority << "len" << slowPollCmdQueue.size();
|
||||
if(priority < 10)
|
||||
{
|
||||
slowPollCmdQueue.push_front(cmd);
|
||||
} else {
|
||||
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)
|
||||
|
@ -5430,6 +5436,10 @@ void wfmain::receiveMode(unsigned char mode, unsigned char filter)
|
|||
{
|
||||
|
||||
removePeriodicRapidCmd(cmdGetCwPitch);
|
||||
removeSlowPeriodicCommand(cmdGetPassband);
|
||||
removeSlowPeriodicCommand(cmdGetTPBFInner);
|
||||
removeSlowPeriodicCommand(cmdGetTPBFOuter);
|
||||
|
||||
quint16 maxPassbandHz = 0;
|
||||
switch ((mode_kind)mode) {
|
||||
case modeFM:
|
||||
|
@ -5445,6 +5455,7 @@ void wfmain::receiveMode(unsigned char mode, unsigned char filter)
|
|||
case modeCW:
|
||||
case modeCW_R:
|
||||
insertPeriodicRapidCmdUnique(cmdGetCwPitch);
|
||||
issueDelayedCommandUnique(cmdGetCwPitch);
|
||||
maxPassbandHz = 3600;
|
||||
break;
|
||||
case modeAM:
|
||||
|
@ -5497,10 +5508,15 @@ void wfmain::receiveMode(unsigned char mode, unsigned char filter)
|
|||
trxadj->setMaxPassband(maxPassbandHz);
|
||||
}
|
||||
|
||||
if (currentModeInfo.mk != modeFM)
|
||||
{
|
||||
insertSlowPeriodicCommand(cmdGetPassband, 128);
|
||||
insertSlowPeriodicCommand(cmdGetTPBFInner, 128);
|
||||
insertSlowPeriodicCommand(cmdGetTPBFOuter, 128);
|
||||
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:
|
||||
|
|
1
wfmain.h
1
wfmain.h
|
@ -1038,6 +1038,7 @@ private:
|
|||
|
||||
|
||||
void insertSlowPeriodicCommand(cmds cmd, unsigned char priority);
|
||||
void removeSlowPeriodicCommand(cmds cmd);
|
||||
void calculateTimingParameters();
|
||||
void changePollTiming(int timing_ms, bool setUI=false);
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue