Merge branch 'rigctl-cw' into 'master'

CW sending from rigctl

See merge request eliggett/wfview!21
merge-requests/21/merge
Christoph Berg 2024-04-02 20:57:29 +00:00
commit bdf5defbe5
3 zmienionych plików z 39 dodań i 3 usunięć

Wyświetl plik

@ -5644,6 +5644,12 @@ void rigCommander::stateUpdated()
case KEYLIGHT:
break;
case SENDCW:
sendCW(state.getCwMsg());
break;
case STOPCW:
sendStopCW();
break;
}
}
++i;

Wyświetl plik

@ -1163,9 +1163,18 @@ void rigCtlClient::socketReadyRead()
{
responseCode = -11; //Unimplemented
}
else if (command.length() > 0 && (command[0] == "b" || command[0] == "send_morse"))
else if (command.length() > 1 && (command[0] == "b" || command[0] == "send_morse"))
{
responseCode = -11; //Unimplemented
setCommand = true;
QStringList args = command;
args.removeFirst();
QString cwmsg = args.join(" ").trimmed(); // join remaining arguments together
rigState->setCwMsg(SENDCW, cwmsg, true);
}
else if (command.length() > 0 && command[0] == "stop_morse")
{
setCommand = true;
rigState->set(STOPCW, rigState->getInt32(STOPCW) + 1, true); // increment counter force change
}
else if (command.length() > 1 && (command[0] == '\x87' || command[0] == "set_powerstat"))
{

Wyświetl plik

@ -18,6 +18,7 @@ enum stateTypes { VFOAFREQ, VFOBFREQ, CURRENTVFO, PTT, MODE, FILTER, PASSBAND, D
FAGCFUNC, NBFUNC, COMPFUNC, VOXFUNC, TONEFUNC, TSQLFUNC, SBKINFUNC, FBKINFUNC, ANFFUNC, NRFUNC, AIPFUNC, APFFUNC, MONFUNC, MNFUNC,RFFUNC,
AROFUNC, MUTEFUNC, VSCFUNC, REVFUNC, SQLFUNC, ABMFUNC, BCFUNC, MBCFUNC, RITFUNC, AFCFUNC, SATMODEFUNC, SCOPEFUNC,
ANN, APO, BACKLIGHT, BEEP, TIME, BAT, KEYLIGHT,
SENDCW, STOPCW,
RESUMEFUNC, TBURSTFUNC, TUNERFUNC, LOCKFUNC, SMETER, POWERMETER, SWRMETER, ALCMETER, COMPMETER, VOLTAGEMETER, CURRENTMETER,
};
@ -120,6 +121,26 @@ public:
}
}
void setCwMsg(stateTypes s, QString x, bool u) {
if (((!u && !map[s]._updated) || (u))) {
_mutex.lock();
//map[s]._value = quint64(x);
cwmsg = x;
map[s]._valid = true;
map[s]._updated = u;
map[s]._dateUpdated = QDateTime::currentDateTime();
_mutex.unlock();
}
}
QString getCwMsg() {
_mutex.lock();
QString msg = QString(cwmsg); // copy string
_mutex.unlock();
return msg;
}
bool getBool(stateTypes s) { return map[s]._value != 0; }
quint8 getChar(stateTypes s) { return quint8(map[s]._value); }
qint16 getInt16(stateTypes s) { return qint16(map[s]._value); }
@ -130,7 +151,7 @@ public:
duplexMode getDuplex(stateTypes s) { return duplexMode(map[s]._value); }
rigInput getInput(stateTypes s) { return rigInput(map[s]._value); }
QMap<stateTypes, value> map;
QString cwmsg;
private:
//std::map<stateTypes, std::unique_ptr<valueBase> > values;