kopia lustrzana https://gitlab.com/eliggett/wfview
Attenuators are in! Please try them out!
rodzic
d18bb2b649
commit
92f019b787
|
@ -28,9 +28,9 @@ repeaterSetup::~repeaterSetup()
|
|||
delete ui;
|
||||
}
|
||||
|
||||
void repeaterSetup::setRig(rigCapabilities rig)
|
||||
void repeaterSetup::setRig(rigCapabilities inRig)
|
||||
{
|
||||
this->rig = rig;
|
||||
this->rig = inRig;
|
||||
haveRig = true;
|
||||
if(rig.hasCTCSS)
|
||||
{
|
||||
|
|
|
@ -2326,6 +2326,8 @@ void rigCommander::determineRigCaps()
|
|||
rigCaps.inputs.clear();
|
||||
rigCaps.inputs.append(inputMic);
|
||||
|
||||
rigCaps.hasAttenuator = true; // Verify that all recent rigs have attenuators
|
||||
rigCaps.attenuators.push_back('\x00');
|
||||
|
||||
rigCaps.hasTransmit = true;
|
||||
|
||||
|
@ -2343,6 +2345,7 @@ void rigCommander::determineRigCaps()
|
|||
rigCaps.hasWiFi = false;
|
||||
rigCaps.hasATU = true;
|
||||
rigCaps.hasCTCSS = true;
|
||||
rigCaps.attenuators.push_back('\x20');
|
||||
break;
|
||||
case modelR8600:
|
||||
rigCaps.modelName = QString("IC-R8600");
|
||||
|
@ -2357,6 +2360,9 @@ void rigCommander::determineRigCaps()
|
|||
rigCaps.hasTransmit = false;
|
||||
rigCaps.hasCTCSS = true;
|
||||
rigCaps.hasDTCS = true;
|
||||
rigCaps.attenuators.push_back('\x10');
|
||||
rigCaps.attenuators.push_back('\x20');
|
||||
rigCaps.attenuators.push_back('\x30');
|
||||
break;
|
||||
case model9700:
|
||||
rigCaps.modelName = QString("IC-9700");
|
||||
|
@ -2374,6 +2380,7 @@ void rigCommander::determineRigCaps()
|
|||
rigCaps.hasDV = true;
|
||||
rigCaps.hasCTCSS = true;
|
||||
rigCaps.hasDTCS = true;
|
||||
rigCaps.attenuators.push_back('\x10');
|
||||
break;
|
||||
case model7610:
|
||||
rigCaps.modelName = QString("IC-7610");
|
||||
|
@ -2388,6 +2395,11 @@ void rigCommander::determineRigCaps()
|
|||
rigCaps.hasEthernet = true;
|
||||
rigCaps.hasWiFi = false;
|
||||
rigCaps.hasCTCSS = true;
|
||||
rigCaps.attenuators.insert(rigCaps.attenuators.end(),
|
||||
{'\x03', '\x06', '\x09', '\x12',\
|
||||
'\x15', '\x18', '\x21', '\x24',\
|
||||
'\x27', '\x30', '\x33', '\x36',
|
||||
'\x39', '\x42', '\x45'});
|
||||
break;
|
||||
case model7850:
|
||||
rigCaps.modelName = QString("IC-785x");
|
||||
|
@ -2404,6 +2416,9 @@ void rigCommander::determineRigCaps()
|
|||
rigCaps.hasWiFi = false;
|
||||
rigCaps.hasATU = true;
|
||||
rigCaps.hasCTCSS = true;
|
||||
rigCaps.attenuators.insert(rigCaps.attenuators.end(),
|
||||
{'\x03', '\x06', '\x09',
|
||||
'\x12', '\x15', '\x18', '\x21'});
|
||||
break;
|
||||
case model705:
|
||||
rigCaps.modelName = QString("IC-705");
|
||||
|
@ -2421,6 +2436,7 @@ void rigCommander::determineRigCaps()
|
|||
rigCaps.hasATU = true;
|
||||
rigCaps.hasCTCSS = true;
|
||||
rigCaps.hasDTCS = true;
|
||||
rigCaps.attenuators = { '\x10' , '\x20'};
|
||||
break;
|
||||
case model7100:
|
||||
rigCaps.modelName = QString("IC-7100");
|
||||
|
@ -2433,6 +2449,7 @@ void rigCommander::determineRigCaps()
|
|||
rigCaps.hasATU = true;
|
||||
rigCaps.hasCTCSS = true;
|
||||
rigCaps.hasDTCS = true;
|
||||
rigCaps.attenuators.push_back('\x12');
|
||||
break;
|
||||
case model706:
|
||||
rigCaps.modelName = QString("IC-706");
|
||||
|
@ -2442,6 +2459,7 @@ void rigCommander::determineRigCaps()
|
|||
rigCaps.hasEthernet = false;
|
||||
rigCaps.hasWiFi = false;
|
||||
rigCaps.hasATU = true;
|
||||
rigCaps.attenuators.push_back('\x20');
|
||||
break;
|
||||
default:
|
||||
rigCaps.modelName = QString("IC-RigID: 0x%1").arg(rigCaps.model, 0, 16);
|
||||
|
@ -2453,9 +2471,10 @@ void rigCommander::determineRigCaps()
|
|||
rigCaps.hasLan = false;
|
||||
rigCaps.hasEthernet = false;
|
||||
rigCaps.hasWiFi = false;
|
||||
rigCaps.attenuators.push_back('\x10');
|
||||
rigCaps.attenuators.push_back('\x20');
|
||||
qDebug(logRig()) << "Found unknown rig: " << rigCaps.modelName;
|
||||
break;
|
||||
|
||||
}
|
||||
haveRigCaps = true;
|
||||
if(lookingForRig)
|
||||
|
@ -2834,6 +2853,49 @@ void rigCommander::getATUStatus()
|
|||
prepDataAndSend(payload);
|
||||
}
|
||||
|
||||
void rigCommander::getAttenuator()
|
||||
{
|
||||
QByteArray payload("\x11");
|
||||
prepDataAndSend(payload);
|
||||
}
|
||||
|
||||
void rigCommander::getPreamp()
|
||||
{
|
||||
QByteArray payload("\x16\x02");
|
||||
prepDataAndSend(payload);
|
||||
}
|
||||
|
||||
void rigCommander::getAntenna()
|
||||
{
|
||||
// This one might neet some thought
|
||||
// as it seems each antenna has to be checked.
|
||||
// Maybe 0x12 alone will do it.
|
||||
QByteArray payload("\x12");
|
||||
prepDataAndSend(payload);
|
||||
}
|
||||
|
||||
void rigCommander::setAttenuator(unsigned char att)
|
||||
{
|
||||
QByteArray payload("\x11");
|
||||
payload.append(att);
|
||||
prepDataAndSend(payload);
|
||||
}
|
||||
|
||||
void rigCommander::setPreamp(unsigned char pre)
|
||||
{
|
||||
QByteArray payload("\x16\x02");
|
||||
payload.append(pre);
|
||||
prepDataAndSend(payload);
|
||||
}
|
||||
|
||||
void rigCommander::setAntenna(unsigned char ant)
|
||||
{
|
||||
QByteArray payload("\x12");
|
||||
payload.append(ant);
|
||||
payload.append("\x01"); // "on", presumably the other ones turn off...
|
||||
prepDataAndSend(payload);
|
||||
}
|
||||
|
||||
void rigCommander::getRigID()
|
||||
{
|
||||
QByteArray payload;
|
||||
|
|
|
@ -72,7 +72,7 @@ public slots:
|
|||
void getScopeEdge();
|
||||
void getScopeMode();
|
||||
|
||||
// Frequency, Mode, PTT:
|
||||
// Frequency, Mode, BSR:
|
||||
void setFrequency(freqt freq);
|
||||
void getFrequency();
|
||||
void setMode(unsigned char mode, unsigned char modeFilter);
|
||||
|
@ -81,12 +81,18 @@ public slots:
|
|||
void getDataMode();
|
||||
void getBandStackReg(char band, char regCode);
|
||||
|
||||
// PTT and ATU:
|
||||
// PTT, ATU, ATT, Antenna, and Preamp:
|
||||
void getPTT();
|
||||
void setPTT(bool pttOn);
|
||||
void startATU();
|
||||
void setATU(bool enabled);
|
||||
void getATUStatus();
|
||||
void getAttenuator();
|
||||
void getPreamp();
|
||||
void getAntenna();
|
||||
void setAttenuator(unsigned char att);
|
||||
void setPreamp(unsigned char pre);
|
||||
void setAntenna(unsigned char ant);
|
||||
|
||||
// Repeater:
|
||||
void setDuplexMode(duplexMode dm);
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
#include <QtNumeric>
|
||||
#include <QString>
|
||||
#include <QList>
|
||||
#include <vector>
|
||||
|
||||
// Credit for parts of CIV list:
|
||||
// http://www.docksideradio.com/Icom%20Radio%20Hex%20Addresses.htm
|
||||
|
@ -66,6 +67,9 @@ struct rigCapabilities {
|
|||
|
||||
bool hasTransmit;
|
||||
|
||||
bool hasAttenuator;
|
||||
//QVector <unsigned char> attenuators;
|
||||
std::vector <unsigned char> attenuators;
|
||||
};
|
||||
|
||||
|
||||
|
|
15
wfmain.cpp
15
wfmain.cpp
|
@ -481,6 +481,7 @@ wfmain::wfmain(const QString serialPortCL, const QString hostCL, QWidget *parent
|
|||
connect(this, SIGNAL(getRigID()), rig, SLOT(getRigID()));
|
||||
connect(rig, SIGNAL(haveATUStatus(unsigned char)), this, SLOT(receiveATUStatus(unsigned char)));
|
||||
connect(rig, SIGNAL(haveRigID(rigCapabilities)), this, SLOT(receiveRigID(rigCapabilities)));
|
||||
connect(this, SIGNAL(setAttenuator(unsigned char)), rig, SLOT(setAttenuator(unsigned char)));
|
||||
|
||||
// Speech (emitted from rig speaker)
|
||||
connect(this, SIGNAL(sayAll()), rig, SLOT(sayAll()));
|
||||
|
@ -2050,6 +2051,14 @@ void wfmain::receiveRigID(rigCapabilities rigCaps)
|
|||
ui->modInputDataCombo->addItem("None", inputNone);
|
||||
}
|
||||
|
||||
ui->attSelCombo->clear();
|
||||
for(unsigned int i=0; i < rigCaps.attenuators.size(); i++)
|
||||
{
|
||||
inName = QString("%1").arg(rigCaps.attenuators.at(i), 0, 16);
|
||||
ui->attSelCombo->addItem(inName, rigCaps.attenuators.at(i));
|
||||
}
|
||||
|
||||
|
||||
ui->tuneEnableChk->setEnabled(rigCaps.hasATU);
|
||||
ui->tuneNowBtn->setEnabled(rigCaps.hasATU);
|
||||
|
||||
|
@ -3641,6 +3650,12 @@ void wfmain::on_rptSetupBtn_clicked()
|
|||
rpt->show();
|
||||
}
|
||||
|
||||
void wfmain::on_attSelCombo_activated(int index)
|
||||
{
|
||||
unsigned char att = (unsigned char)ui->attSelCombo->itemData(index).toInt();
|
||||
emit setAttenuator(att);
|
||||
}
|
||||
|
||||
// --- DEBUG FUNCTION ---
|
||||
void wfmain::on_debugBtn_clicked()
|
||||
{
|
||||
|
|
15
wfmain.h
15
wfmain.h
|
@ -50,8 +50,6 @@ signals:
|
|||
void getDataMode();
|
||||
void getModInput(bool dataOn);
|
||||
void setModInput(rigInput input, bool dataOn);
|
||||
void getPTT();
|
||||
void setPTT(bool pttOn);
|
||||
void getBandStackReg(char band, char regCode);
|
||||
void getDebug();
|
||||
|
||||
|
@ -94,10 +92,19 @@ signals:
|
|||
void getMeters(meterKind meter);
|
||||
|
||||
|
||||
|
||||
// PTT, ATU, ATT, Antenna, Preamp:
|
||||
void getPTT();
|
||||
void setPTT(bool pttOn);
|
||||
void getAttenuator();
|
||||
void getPreamp();
|
||||
void getAntenna();
|
||||
void setAttenuator(unsigned char att);
|
||||
void setPreamp(unsigned char pre);
|
||||
void setAntenna(unsigned char ant);
|
||||
void startATU();
|
||||
void setATU(bool atuEnabled);
|
||||
void getATUStatus();
|
||||
|
||||
void getRigID(); // this is the model of the rig
|
||||
void getRigCIV(); // get the rig's CIV addr
|
||||
void spectOutputEnable();
|
||||
|
@ -380,6 +387,8 @@ private slots:
|
|||
|
||||
void on_rptSetupBtn_clicked();
|
||||
|
||||
void on_attSelCombo_activated(int index);
|
||||
|
||||
private:
|
||||
Ui::wfmain *ui;
|
||||
QSettings settings;
|
||||
|
|
Ładowanie…
Reference in New Issue