CIV may now be changed as-needed while running.

merge-requests/5/head
Elliott Liggett 2021-05-30 15:08:22 -07:00
rodzic f2c82e2ca0
commit d601983beb
3 zmienionych plików z 14 dodań i 5 usunięć

Wyświetl plik

@ -170,9 +170,7 @@ void rigCommander::setup()
// common elements between the two constructors go here:
setCIVAddr(civAddr);
spectSeqMax = 0; // this is now set after rig ID determined
payloadPrefix = QByteArray("\xFE\xFE");
payloadPrefix.append(civAddr);
payloadPrefix.append((char)compCivAddr);
payloadSuffix = QByteArray("\xFD");
@ -183,6 +181,8 @@ void rigCommander::setup()
pttAllowed = true; // This is for developing, set to false for "safe" debugging. Set to true for deployment.
}
void rigCommander::process()
{
// new thread enters here. Do nothing but do check for errors.
@ -963,10 +963,13 @@ void rigCommander::setPTT(bool pttOn)
void rigCommander::setCIVAddr(unsigned char civAddr)
{
// Note: This is the radio's CIV address
// Note: This sets the radio's CIV address
// the computer's CIV address is defined in the header file.
// TODO: this function *could* be written to re-write the CIV preamble.
this->civAddr = civAddr;
payloadPrefix = QByteArray("\xFE\xFE");
payloadPrefix.append(civAddr);
payloadPrefix.append((char)compCivAddr);
}
void rigCommander::handleNewData(const QByteArray& data)

Wyświetl plik

@ -182,6 +182,8 @@ void wfmain::openRig()
void wfmain::rigConnections()
{
connect(this, SIGNAL(setCIVAddr(unsigned char)), rig, SLOT(setCIVAddr(unsigned char)));
connect(this, SIGNAL(sendPowerOn()), rig, SLOT(powerOn()));
connect(this, SIGNAL(sendPowerOff()), rig, SLOT(powerOff()));
@ -4426,6 +4428,7 @@ void wfmain::on_rigCIVaddrHexLine_editingFinished()
if(okconvert && (propCIVAddr < 0xe0) && (propCIVAddr != 0))
{
prefs.radioCIVAddr = propCIVAddr;
emit setCIVAddr(propCIVAddr);
showStatusBarText(QString("Setting radio CI-V address to: 0x%1. Press Save Settings to retain.").arg(propCIVAddr, 2, 16));
} else {
showStatusBarText(QString("Could not use provided CI-V address. Address must be < 0xE0"));

Wyświetl plik

@ -44,6 +44,9 @@ public:
~wfmain();
signals:
// Basic to rig:
void setCIVAddr(unsigned char);
// Power
void sendPowerOn();
void sendPowerOff();