diff --git a/aboutbox.cpp b/aboutbox.cpp index ba8de0f..03715c1 100644 --- a/aboutbox.cpp +++ b/aboutbox.cpp @@ -15,10 +15,12 @@ aboutbox::aboutbox(QWidget *parent) : ui->topText->setText("wfview version " + QString(WFVIEW_VERSION)); QString head = QString(""); - QString copyright = QString("Copyright 2017-2021 Elliott H. Liggett, W6EL. All rights reserved. wfview source code is licensed under the GNU GPLv3."); + QString copyright = QString("Copyright 2017-2022 Elliott H. Liggett, W6EL. All rights reserved. wfview source code is licensed under the GNU GPLv3."); QString nacode = QString("

Networking, audio, rigctl server, and much more written by Phil Taylor, M0VSE"); QString doctest = QString("

Testing, documentation, bug fixes, and development mentorship from
Roeland Jansen, PA3MET, and Jim Nijkamp, PA8E."); + QString dedication = QString("

This version of wfview is dedicated to the ones we lost."); + #if defined(Q_OS_LINUX) QString ssCredit = QString("

Stylesheet qdarkstyle used under MIT license, stored in /usr/share/wfview/stylesheets/."); #else @@ -83,7 +85,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."); // String it all together: - QString aboutText = head + copyright + "\n" + nacode + "\n" + doctest + wfviewcommunityack; + QString aboutText = head + copyright + "\n" + nacode + "\n" + doctest + dedication + wfviewcommunityack; aboutText.append(website + "\n" + donate + "\n"+ docs + support + contact +"\n"); aboutText.append("\n" + ssCredit + "\n" + rsCredit + "\n"); diff --git a/loggingwindow.cpp b/loggingwindow.cpp index 789b31d..c9ad5be 100644 --- a/loggingwindow.cpp +++ b/loggingwindow.cpp @@ -46,6 +46,12 @@ loggingWindow::~loggingWindow() delete ui; } +void loggingWindow::showEvent(QShowEvent *event) +{ + (void)event; + on_toBottomBtn_clicked(); +} + void loggingWindow::setInitialDebugState(bool debugModeEnabled) { ui->debugBtn->blockSignals(true); diff --git a/loggingwindow.h b/loggingwindow.h index 67be898..dda0efa 100644 --- a/loggingwindow.h +++ b/loggingwindow.h @@ -34,7 +34,7 @@ private slots: void disconnectedFromHost(); void handleDataFromLoggingHost(); void handleLoggingHostError(QAbstractSocket::SocketError); - + void showEvent(QShowEvent* event); void on_clearDisplayBtn_clicked(); void on_openDirBtn_clicked(); diff --git a/wfmain.cpp b/wfmain.cpp index 88e1cae..d030d8d 100644 --- a/wfmain.cpp +++ b/wfmain.cpp @@ -195,6 +195,10 @@ void wfmain::openRig() // showRigSettings(); // rig setting dialog box for network/serial, CIV, hostname, port, baud rate, serial device, etc // TODO: How do we know if the setting was loaded? + ui->audioSystemServerCombo->setEnabled(false); + ui->audioSystemCombo->setEnabled(false); + + ui->connectBtn->setText("Cancel connection"); // We are attempting to connect // TODO: Use these if they are found if(!serialPortCL.isEmpty()) @@ -949,7 +953,6 @@ void wfmain::setupMainUI() connect(this->trxadj, &transceiverAdjustments::setTPBFOuter, [=](const unsigned char &newValue) { issueCmdUniquePriority(cmdSetTPBFOuter, newValue);} ); - } void wfmain::prepareSettingsWindow() @@ -1531,7 +1534,10 @@ void wfmain::loadSettings() prefs.audioSystem = static_cast(settings->value("AudioSystem", defPrefs.audioSystem).toInt()); ui->audioSystemCombo->blockSignals(true); + ui->audioSystemServerCombo->blockSignals(true); ui->audioSystemCombo->setCurrentIndex(prefs.audioSystem); + ui->audioSystemServerCombo->setCurrentIndex(prefs.audioSystem); + ui->audioSystemServerCombo->blockSignals(false); ui->audioSystemCombo->blockSignals(false); @@ -3336,6 +3342,7 @@ void wfmain::receiveRigID(rigCapabilities rigCaps) ui->topLevelSlider->setMaximum(rigCaps.spectAmpMax); haveRigCaps = true; + // Added so that server receives rig capabilities. emit sendRigCaps(rigCaps); rpt->setRig(rigCaps); @@ -3471,8 +3478,10 @@ void wfmain::receiveRigID(rigCapabilities rigCaps) ui->useRTSforPTTchk->setChecked(rigCaps.useRTSforPTT); ui->useRTSforPTTchk->blockSignals(false); - ui->connectBtn->setText("Disconnect"); // We must be connected now. ui->audioSystemCombo->setEnabled(false); + ui->audioSystemServerCombo->setEnabled(false); + + ui->connectBtn->setText("Disconnect from Radio"); // We must be connected now. prepareWf(ui->wfLengthSlider->value()); if(usingLAN) @@ -4244,7 +4253,7 @@ void wfmain::on_modeSelectCombo_activated(int index) void wfmain::on_freqDial_valueChanged(int value) { - int maxVal = ui->freqDial->maximum(); + int fullSweep = ui->freqDial->maximum() - ui->freqDial->minimum(); freqt f; f.Hz = 0; @@ -4252,12 +4261,6 @@ void wfmain::on_freqDial_valueChanged(int value) volatile int delta = 0; - int directPath = 0; - int crossingPath = 0; - - int distToMaxNew = 0; - int distToMaxOld = 0; - if(freqLock) { ui->freqDial->blockSignals(true); @@ -4265,50 +4268,25 @@ void wfmain::on_freqDial_valueChanged(int value) ui->freqDial->blockSignals(false); return; } - - if(value == 0) + + delta = (value - oldFreqDialVal); + + if(delta > fullSweep/2) { - distToMaxNew = 0; - } else { - distToMaxNew = maxVal - value; + // counter-clockwise past the zero mark + // ie, from +3000 to 3990, old=3000, new = 3990, new-old = 990 + // desired delta here would actually be -10 + delta = delta - fullSweep; + } else if (delta < -fullSweep/2) + { + // clock-wise past the zero mark + // ie, from +3990 to 3000, old=3990, new = 3000, new-old = -990 + // desired delta here would actually be +10 + delta = fullSweep + delta; } - if(oldFreqDialVal != 0) - { - distToMaxOld = maxVal - oldFreqDialVal; - } else { - distToMaxOld = 0; - } - - directPath = abs(value - oldFreqDialVal); - if(value < maxVal / 2) - { - crossingPath = value + distToMaxOld; - } else { - crossingPath = distToMaxNew + oldFreqDialVal; - } - - if(directPath > crossingPath) - { - // use crossing path, it is shorter - delta = crossingPath; - // now calculate the direction: - if( value > oldFreqDialVal) - { - // CW - delta = delta; - } else { - // CCW - delta *= -1; - } - - } else { - // use direct path - // crossing path is larger than direct path, use direct path - //delta = directPath; - // now calculate the direction - delta = value - oldFreqDialVal; - } + // The step size is 10, which forces the knob to not skip a step crossing zero. + delta = delta / ui->freqDial->singleStep(); // With the number of steps and direction of steps established, // we can now adjust the frequency: @@ -4318,12 +4296,8 @@ void wfmain::on_freqDial_valueChanged(int value) if(f.Hz > 0) { freq = f; - oldFreqDialVal = value; - ui->freqLabel->setText(QString("%1").arg(f.MHzDouble, 0, 'f')); - - //emit setFrequency(0,f); issueCmdUniquePriority(cmdSetFreq, f); } else { ui->freqDial->blockSignals(true); @@ -4890,16 +4864,23 @@ void wfmain::on_connectBtn_clicked() if (haveRigCaps) { emit sendCloseComm(); - ui->connectBtn->setText("Connect"); + ui->connectBtn->setText("Connect to Radio"); ui->audioSystemCombo->setEnabled(true); + ui->audioSystemServerCombo->setEnabled(true); haveRigCaps = false; rigName->setText("NONE"); } - else + else { emit sendCloseComm(); // Just in case there is a failed connection open. - openRig(); + if (ui->connectBtn->text() != "Cancel connection") { + openRig(); + } + else { + ui->connectBtn->setText("Connect to Radio"); + } } + ui->connectBtn->clearFocus(); } void wfmain::on_sqlSlider_valueChanged(int value) @@ -6152,6 +6133,14 @@ void wfmain::setAudioDevicesUI() } + // Make the audio comboboxes expand when clicked (only needed for Windows) +#ifdef Q_OS_WIN + ui->audioInputCombo->setStyleSheet("QComboBox QAbstractItemView {min-width: 300px;}"); + ui->audioOutputCombo->setStyleSheet("QComboBox QAbstractItemView {min-width: 300px;}"); + ui->serverTXAudioOutputCombo->setStyleSheet("QComboBox QAbstractItemView {min-width: 300px;}"); + ui->serverRXAudioInputCombo->setStyleSheet("QComboBox QAbstractItemView {min-width: 300px;}"); +#endif + // Stop blocking signals so we can set the current values ui->audioInputCombo->blockSignals(false); ui->audioOutputCombo->blockSignals(false); @@ -6214,6 +6203,18 @@ void wfmain::on_audioSystemCombo_currentIndexChanged(int value) { prefs.audioSystem = static_cast(value); setAudioDevicesUI(); // Force all audio devices to update + ui->audioSystemServerCombo->blockSignals(true); + ui->audioSystemServerCombo->setCurrentIndex(value); + ui->audioSystemServerCombo->blockSignals(false); +} + +void wfmain::on_audioSystemServerCombo_currentIndexChanged(int value) +{ + prefs.audioSystem = static_cast(value); + setAudioDevicesUI(); // Force all audio devices to update + ui->audioSystemCombo->blockSignals(true); + ui->audioSystemCombo->setCurrentIndex(value); + ui->audioSystemCombo->blockSignals(false); } void wfmain::on_topLevelSlider_valueChanged(int value) @@ -7069,4 +7070,3 @@ void wfmain::messageHandler(QtMsgType type, const QMessageLogContext& context, c logStringBuffer.push_front(text); logTextMutex.unlock(); } - diff --git a/wfmain.h b/wfmain.h index 337f3b1..e52bdb5 100644 --- a/wfmain.h +++ b/wfmain.h @@ -643,6 +643,8 @@ private slots: void on_showLogBtn_clicked(); + void on_audioSystemServerCombo_currentIndexChanged(int index); + private: Ui::wfmain *ui; void closeEvent(QCloseEvent *event); diff --git a/wfmain.ui b/wfmain.ui index 68f5855..3ac271b 100644 --- a/wfmain.ui +++ b/wfmain.ui @@ -18,7 +18,7 @@ - 0 + 3 @@ -338,6 +338,18 @@ Tuning Dial + + 3000 + + + 4000 + + + 10 + + + 100 + true @@ -2809,7 +2821,7 @@ - QT Audio + Qt Audio @@ -2849,13 +2861,6 @@ 0 - - - - Connect - - - @@ -3328,8 +3333,8 @@ 0 0 - 794 - 582 + 194 + 563 @@ -4185,7 +4190,7 @@ - + @@ -4232,6 +4237,32 @@ + + + + Audio System + + + + + + + + Qt Audio + + + + + PortAudio + + + + + RT Audio + + + + @@ -4682,6 +4713,26 @@ + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Connect to Radio + + + @@ -4746,7 +4797,7 @@ - +