Merge branch 'sequence'

audioplugins
Roeland Jansen 2021-06-19 20:09:57 +02:00
commit cfc29bb86f
5 zmienionych plików z 68 dodań i 6 usunięć

Wyświetl plik

@ -362,6 +362,10 @@ void rigCommander::setSpectrumBounds(double startFreq, double endFreq, unsigned
if(startFreq > 400.0)
freqRange++;
break;
case modelR8600:
freqRange = 1;
edgeNumber = 1;
break;
default:
return;
break;
@ -429,7 +433,7 @@ void rigCommander::setScopeSpan(char span)
// See ICD, page 165, "19-12".
// 2.5k = 0
// 5k = 2, etc.
if((span <0 ) || (span >7))
if((span <0 ) || (span >9))
return;
QByteArray payload;
@ -464,6 +468,12 @@ void rigCommander::setScopeSpan(char span)
case 7:
freq = 500.0E-3;
break;
case 8:
freq = 1000.0E-3;
break;
case 9:
freq = 2500.0E-3;
break;
default:
return;
break;
@ -2561,6 +2571,14 @@ mode_info rigCommander::createMode(mode_kind m, unsigned char reg, QString name)
return mode;
}
centerSpanData rigCommander::createScopeCenter(centerSpansType s, QString name)
{
centerSpanData csd;
csd.cstype = s;
csd.name = name;
return csd;
}
void rigCommander::determineRigCaps()
{
//TODO: Determine available bands (low priority, rig will reject out of band requests anyway)
@ -2597,6 +2615,12 @@ void rigCommander::determineRigCaps()
rigCaps.spectSeqMax = 0;
rigCaps.spectAmpMax = 0;
rigCaps.spectLenMax = 0;
rigCaps.scopeCenterSpans = { createScopeCenter(cs2p5k, "±2.5k"), createScopeCenter(cs5k, "±5k"),
createScopeCenter(cs10k, "±10k"), createScopeCenter(cs25k, "±25k"),
createScopeCenter(cs50k, "±50k"), createScopeCenter(cs100k, "±100k"),
createScopeCenter(cs250k, "±250k"), createScopeCenter(cs500k, "±500k")
};
rigCaps.hasFDcomms = true; // false for older radios
@ -2696,6 +2720,7 @@ void rigCommander::determineRigCaps()
createMode(modeP25, 0x16, "P25"), createMode(modedPMR, 0x18, "dPMR"),
createMode(modeNXDN_VN, 0x19, "NXDN-VN"), createMode(modeNXDN_N, 0x20, "NXDN-N"),
createMode(modeDCR, 0x21, "DCR")});
rigCaps.scopeCenterSpans.insert(rigCaps.scopeCenterSpans.end(), {createScopeCenter(cs1M, "±1M"), createScopeCenter(cs2p5M, "±2.5M")});
break;
case model9700:
rigCaps.modelName = QString("IC-9700");

Wyświetl plik

@ -377,6 +377,7 @@ private:
void printHex(const QByteArray &pdata);
void printHex(const QByteArray &pdata, bool printVert, bool printHoriz);
mode_info createMode(mode_kind m, unsigned char reg, QString name);
centerSpanData createScopeCenter(centerSpansType s, QString name);
commHandler* comm = Q_NULLPTR;
pttyHandler* ptty = Q_NULLPTR;

Wyświetl plik

@ -55,8 +55,8 @@ model_kind determineRadioModel(unsigned char rigID)
case model718:
rig = model718;
break;
case model756proiii:
rig = model756proiii;
case model910h:
rig = model910h;
break;
case model756pro:
rig = model756pro;
@ -64,6 +64,9 @@ model_kind determineRadioModel(unsigned char rigID)
case model756proii:
rig = model756proii;
break;
case model756proiii:
rig = model756proiii;
break;
default:
rig = modelUnknown;
break;

Wyświetl plik

@ -68,6 +68,24 @@ enum bandType { band23cm=0,
bandGen
};
enum centerSpansType {
cs2p5k = 0,
cs5k = 1,
cs10k = 2,
cs25k = 3,
cs50k = 4,
cs100k = 5,
cs250k = 6,
cs500k = 7,
cs1M = 8,
cs2p5M = 9
};
struct centerSpanData {
centerSpansType cstype;
QString name;
};
model_kind determineRadioModel(unsigned char rigID);
struct rigCapabilities {
@ -105,6 +123,7 @@ struct rigCapabilities {
std::vector <unsigned char> attenuators;
std::vector <unsigned char> preamps;
std::vector <unsigned char> antennas;
std::vector <centerSpanData> scopeCenterSpans;
std::vector <bandType> bands;
unsigned char bsr[20] = {0};

Wyświetl plik

@ -407,9 +407,6 @@ void wfmain::findSerialPort()
QDirIterator it705("/dev/serial", QStringList() << "*IC-705*A", QDir::Files, QDirIterator::Subdirectories);
QDirIterator it7610("/dev/serial", QStringList() << "*IC-7610*A", QDir::Files, QDirIterator::Subdirectories);
QDirIterator itR8600("/dev/serial", QStringList() << "*IC-R8600*A", QDir::Files, QDirIterator::Subdirectories);
QDirIterator itTest("/tmp/test", QStringList() << "*radio*", QDir::NoFilter, QDirIterator::Subdirectories);
qDebug() << "test iterator isEmpty: " << itTest.filePath().isEmpty();
if(!it73.filePath().isEmpty())
{
@ -702,6 +699,8 @@ void wfmain::setupMainUI()
void wfmain::updateSizes(int tabIndex)
{
if(!haveRigCaps)
return;
// This function does nothing unless you are using a rig without spectrum.
// This is a hack. It is not great, but it seems to work ok.
if(!rigCaps.hasSpectrum)
@ -2644,6 +2643,21 @@ void wfmain::receiveRigID(rigCapabilities rigCaps)
ui->antennaSelCombo->setDisabled(true);
}
ui->scopeBWCombo->blockSignals(true);
ui->scopeBWCombo->clear();
if(rigCaps.hasSpectrum)
{
ui->scopeBWCombo->setHidden(false);
for(unsigned int i=0; i < rigCaps.scopeCenterSpans.size(); i++)
{
ui->scopeBWCombo->addItem(rigCaps.scopeCenterSpans.at(i).name, (int)rigCaps.scopeCenterSpans.at(i).cstype);
}
} else {
ui->scopeBWCombo->setHidden(true);
}
ui->scopeBWCombo->blockSignals(false);
setBandButtons();
ui->tuneEnableChk->setEnabled(rigCaps.hasATU);