Fixed annoying data mode bug.

merge-requests/1/merge
Elliott Liggett 2018-11-26 23:10:23 -08:00
rodzic 973dec0b25
commit b432482e0c
4 zmienionych plików z 58 dodań i 17 usunięć

Wyświetl plik

@ -13,7 +13,7 @@
// + Impliment additional commands (of course)
// + Impliment external serial port "pass through"
// + Impliment XML RPC server?
//
// + Grab initial state of band scope and adjust UI accordingly.
//
// See here for a wonderful CI-V overview:
@ -31,6 +31,8 @@ rigCommander::rigCommander()
{
// construct
// TODO: Bring this parameter and the comm port from the UI.
// Keep in hex in the UI as is done with other CIV apps.
civAddr = 0x94; // address of the radio. Decimal is 148.
setCIVAddr(civAddr);
@ -43,7 +45,12 @@ rigCommander::rigCommander()
// payloadPrefix.append("\xE0");
payloadSuffix = QByteArray("\xFD");
comm = new commHandler();
// TODO: list full contents of /dev/serial, grep for IC-7300
// /dev/serial/by-path$ ls
// total 0
// lrwxrwxrwx 1 root root 13 Nov 24 21:43 pci-0000:00:12.0-usb-0:2.1:1.0-port0 -> ../../ttyUSB0
comm = new commHandler("/dev/ttyUSB0");
// data from the comm port to the program:
connect(comm, SIGNAL(haveDataFromPort(QByteArray)), this, SLOT(handleNewData(QByteArray)));

Wyświetl plik

@ -211,7 +211,14 @@ void wfmain::loadSettings()
double freq;
unsigned char mode;
bool isSet;
// preset_kind temp;
// Annoying: QSettings will write the array to the
// preference file starting the array at 1 and ending at 100.
// Thus, we are writing the channel number each time.
// It is also annoying that they get written with their array
// numbers in alphabetical order without zero padding.
// Also annoying that the preference groups are not written in
// the order they are specified here.
for(int i=0; i < size; i++)
{
@ -239,21 +246,21 @@ void wfmain::saveSettings()
// UI: (full screen, dark theme, draw peaks, colors, etc)
settings.beginGroup("Interface");
settings.setValue("UseFullScreen", true);
settings.setValue("UseDarkMode", true);
settings.setValue("DrawPeaks", true);
settings.setValue("UseFullScreen", prefs.useFullScreen);
settings.setValue("UseDarkMode", prefs.useDarkMode);
settings.setValue("DrawPeaks", prefs.drawPeaks);
settings.endGroup();
// Radio and Comms: C-IV addr, port to use
settings.beginGroup("Radio");
settings.setValue("RigCIVuInt", 0x94);
settings.setValue("SerialPortRadio", "/dev/ttyUSB0");
settings.setValue("RigCIVuInt", prefs.radioCIVAddr);
settings.setValue("SerialPortRadio", prefs.serialPortRadio);
settings.endGroup();
// Misc. user settings (enable PTT, draw peaks, etc)
settings.beginGroup("Controls");
settings.setValue("EnablePTT", true);
settings.setValue("NiceTS", true);
settings.setValue("EnablePTT", prefs.enablePTT);
settings.setValue("NiceTS", prefs.niceTS);
settings.endGroup();
// Memory channels
@ -374,7 +381,7 @@ void wfmain::on_useDarkThemeChk_clicked(bool checked)
setAppTheme(checked);
setPlotTheme(wf, checked);
setPlotTheme(plot, checked);
prefs.useDarkMode = checked;
}
void wfmain::setAppTheme(bool isDark)
@ -781,21 +788,26 @@ void wfmain::receiveDataModeStatus(bool dataEnabled)
{
if(currentModeIndex == 0)
{
// USB
// LSB
ui->modeSelectCombo->setCurrentIndex(8);
ui->modeLabel->setText( "USB-D" );
ui->modeLabel->setText( "LSB-D" );
} else if (currentModeIndex == 1)
{
// LSB
// USB
ui->modeSelectCombo->setCurrentIndex(9);
ui->modeLabel->setText( "LSB-D" );
ui->modeLabel->setText( "USB-D" );
}
// TODO: be more intelligent here to avoid -D-D-D.
// include the text above.
// ui->modeLabel->setText( ui->modeLabel->text() + "-D" );
// Remove if works.
} else {
// update to _not_ have the -D
ui->modeSelectCombo->setCurrentIndex(currentModeIndex);
// No need to update status label?
}
}
@ -818,6 +830,8 @@ void wfmain::on_drawPeakChk_clicked(bool checked)
plot->graph(1)->clearData();
}
prefs.drawPeaks = checked;
}
@ -827,6 +841,7 @@ void wfmain::on_fullScreenChk_clicked(bool checked)
this->showFullScreen();
else
this->showNormal();
prefs.useFullScreen = checked;
}
void wfmain::on_goFreqBtn_clicked()
@ -1304,6 +1319,7 @@ void wfmain::receiveSql(unsigned char level)
void wfmain::on_drawTracerChk_toggled(bool checked)
{
tracer->setVisible(checked);
prefs.drawTracer = checked;
}
void wfmain::on_tuneNowBtn_clicked()
@ -1345,6 +1361,13 @@ void wfmain::on_pttOffBtn_clicked()
{
// Send the PTT OFF command (more than once?)
// Stop the 3 min tumer
// Stop the 3 min timer
}
void wfmain::on_saveSettingsBtn_clicked()
{
saveSettings(); // save memory, UI, and radio settings
}

Wyświetl plik

@ -174,6 +174,9 @@ private slots:
void on_pttOffBtn_clicked();
void on_saveSettingsBtn_clicked();
private:
Ui::wfmain *ui;
QSettings settings;
@ -252,6 +255,7 @@ private:
bool useFullScreen;
bool useDarkMode;
bool drawPeaks;
bool drawTracer;
unsigned char radioCIVAddr;
QString serialPortRadio;
bool enablePTT;

Wyświetl plik

@ -18,7 +18,7 @@
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>0</number>
<number>3</number>
</property>
<widget class="QWidget" name="mainTab">
<attribute name="title">
@ -1251,6 +1251,13 @@
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="saveSettingsBtn">
<property name="text">
<string>Save Settings</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="exitBtn">
<property name="text">