kopia lustrzana https://gitlab.com/eliggett/wfview
Receiver Incremental Tuning is in. The UI does not check the rig's
initial state yet, but the functions are partially in rigCommander for that purpose.merge-requests/2/head
rodzic
5bfb287294
commit
f619e9eca1
|
@ -592,6 +592,63 @@ QByteArray rigCommander::makeFreqPayload(double freq)
|
|||
return result;
|
||||
}
|
||||
|
||||
void rigCommander::setRitEnable(bool ritEnabled)
|
||||
{
|
||||
QByteArray payload;
|
||||
|
||||
if(ritEnabled)
|
||||
{
|
||||
payload.setRawData("\x21\x01\x01", 3);
|
||||
} else {
|
||||
payload.setRawData("\x21\x01\x00", 3);
|
||||
}
|
||||
prepDataAndSend(payload);
|
||||
}
|
||||
|
||||
void rigCommander::getRitEnabled()
|
||||
{
|
||||
QByteArray payload;
|
||||
payload.setRawData("\x21\x01", 2);
|
||||
prepDataAndSend(payload);
|
||||
}
|
||||
|
||||
void rigCommander::getRitValue()
|
||||
{
|
||||
QByteArray payload;
|
||||
payload.setRawData("\x21\x00", 2);
|
||||
prepDataAndSend(payload);
|
||||
}
|
||||
|
||||
void rigCommander::setRitValue(int ritValue)
|
||||
{
|
||||
QByteArray payload;
|
||||
QByteArray freqBytes;
|
||||
freqt f;
|
||||
|
||||
bool isNegative = false;
|
||||
payload.setRawData("\x21\x00", 2);
|
||||
|
||||
if(ritValue < 0)
|
||||
{
|
||||
isNegative = true;
|
||||
ritValue *= -1;
|
||||
}
|
||||
|
||||
if(ritValue > 9999)
|
||||
return;
|
||||
|
||||
f.Hz = ritValue;
|
||||
|
||||
freqBytes = makeFreqPayload(f);
|
||||
|
||||
freqBytes.truncate(2);
|
||||
payload.append(freqBytes);
|
||||
|
||||
payload.append(QByteArray(1,(char)isNegative));
|
||||
|
||||
prepDataAndSend(payload);
|
||||
}
|
||||
|
||||
void rigCommander::setMode(unsigned char mode, unsigned char modeFilter)
|
||||
{
|
||||
QByteArray payload;
|
||||
|
|
|
@ -94,6 +94,10 @@ public slots:
|
|||
void setDataMode(bool dataOn);
|
||||
void getDataMode();
|
||||
void getBandStackReg(char band, char regCode);
|
||||
void getRitEnabled();
|
||||
void getRitValue();
|
||||
void setRitValue(int ritValue);
|
||||
void setRitEnable(bool ritEnabled);
|
||||
|
||||
// PTT, ATU, ATT, Antenna, and Preamp:
|
||||
void getPTT();
|
||||
|
|
12
wfmain.cpp
12
wfmain.cpp
|
@ -353,6 +353,8 @@ wfmain::wfmain(const QString serialPortCL, const QString hostCL, QWidget *parent
|
|||
connect(this, SIGNAL(setPTT(bool)), rig, SLOT(setPTT(bool)));
|
||||
connect(this, SIGNAL(getPTT()), rig, SLOT(getPTT()));
|
||||
connect(rig, SIGNAL(haveBandStackReg(float,char,bool)), this, SLOT(receiveBandStackReg(float,char,bool)));
|
||||
connect(this, SIGNAL(setRitEnable(bool)), rig, SLOT(setRitEnable(bool)));
|
||||
connect(this, SIGNAL(setRitValue(int)), rig, SLOT(setRitValue(int)));
|
||||
connect(this, SIGNAL(getDebug()), rig, SLOT(getDebug()));
|
||||
|
||||
connect(this, SIGNAL(spectOutputDisable()), rig, SLOT(disableSpectOutput()));
|
||||
|
@ -3790,6 +3792,16 @@ void wfmain::powerRigOff()
|
|||
emit sendPowerOff();
|
||||
}
|
||||
|
||||
void wfmain::on_ritTuneDial_valueChanged(int value)
|
||||
{
|
||||
emit setRitValue(value);
|
||||
}
|
||||
|
||||
void wfmain::on_ritEnableChk_clicked(bool checked)
|
||||
{
|
||||
emit setRitEnable(checked);
|
||||
}
|
||||
|
||||
// --- DEBUG FUNCTION ---
|
||||
void wfmain::on_debugBtn_clicked()
|
||||
{
|
||||
|
|
8
wfmain.h
8
wfmain.h
|
@ -58,6 +58,10 @@ signals:
|
|||
void setModInput(rigInput input, bool dataOn);
|
||||
void getBandStackReg(char band, char regCode);
|
||||
void getDebug();
|
||||
void getRitEnabled();
|
||||
void getRitValue();
|
||||
void setRitValue(int ritValue);
|
||||
void setRitEnable(bool ritEnabled);
|
||||
|
||||
// Repeater:
|
||||
void getDuplexMode();
|
||||
|
@ -407,6 +411,10 @@ private slots:
|
|||
|
||||
void on_rigPowerOffBtn_clicked();
|
||||
|
||||
void on_ritTuneDial_valueChanged(int value);
|
||||
|
||||
void on_ritEnableChk_clicked(bool checked);
|
||||
|
||||
private:
|
||||
Ui::wfmain *ui;
|
||||
QSettings settings;
|
||||
|
|
44
wfmain.ui
44
wfmain.ui
|
@ -18,7 +18,7 @@
|
|||
<item>
|
||||
<widget class="QTabWidget" name="tabWidget">
|
||||
<property name="currentIndex">
|
||||
<number>3</number>
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="mainTab">
|
||||
<attribute name="title">
|
||||
|
@ -280,6 +280,48 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_25">
|
||||
<item>
|
||||
<widget class="QDial" name="ritTuneDial">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>30</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>-500</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>500</number>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<property name="pageStep">
|
||||
<number>50</number>
|
||||
</property>
|
||||
<property name="invertedAppearance">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="notchTarget">
|
||||
<double>50.000000000000000</double>
|
||||
</property>
|
||||
<property name="notchesVisible">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="ritEnableChk">
|
||||
<property name="text">
|
||||
<string>RIT</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
|
|
Ładowanie…
Reference in New Issue