Merge branch 'log'

knobtest
Roeland Jansen 2022-09-18 12:54:15 +02:00
commit 6dd7cc0247
6 zmienionych plików z 135 dodań i 74 usunięć

Wyświetl plik

@ -15,10 +15,12 @@ aboutbox::aboutbox(QWidget *parent) :
ui->topText->setText("wfview version " + QString(WFVIEW_VERSION));
QString head = QString("<html><head></head><body>");
QString copyright = QString("Copyright 2017-2021 Elliott H. Liggett, W6EL. All rights reserved. wfview source code is <a href=\"https://gitlab.com/eliggett/wfview/-/blob/master/LICENSE\">licensed</a> under the GNU GPLv3.");
QString copyright = QString("Copyright 2017-2022 Elliott H. Liggett, W6EL. All rights reserved. wfview source code is <a href=\"https://gitlab.com/eliggett/wfview/-/blob/master/LICENSE\">licensed</a> under the GNU GPLv3.");
QString nacode = QString("<br/><br/>Networking, audio, rigctl server, and much more written by Phil Taylor, M0VSE");
QString doctest = QString("<br/><br/>Testing, documentation, bug fixes, and development mentorship from<br/>Roeland Jansen, PA3MET, and Jim Nijkamp, PA8E.");
QString dedication = QString("<br/><br/>This version of wfview is dedicated to the ones we lost.");
#if defined(Q_OS_LINUX)
QString ssCredit = QString("<br/><br/>Stylesheet <a href=\"https://github.com/ColinDuquesnoy/QDarkStyleSheet/tree/master/qdarkstyle\" style=\"color: cyan;\">qdarkstyle</a> 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");

Wyświetl plik

@ -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);

Wyświetl plik

@ -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();

Wyświetl plik

@ -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<audioType>(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<audioType>(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<audioType>(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();
}

Wyświetl plik

@ -643,6 +643,8 @@ private slots:
void on_showLogBtn_clicked();
void on_audioSystemServerCombo_currentIndexChanged(int index);
private:
Ui::wfmain *ui;
void closeEvent(QCloseEvent *event);

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">
@ -338,6 +338,18 @@
<property name="accessibleName">
<string>Tuning Dial</string>
</property>
<property name="minimum">
<number>3000</number>
</property>
<property name="maximum">
<number>4000</number>
</property>
<property name="singleStep">
<number>10</number>
</property>
<property name="pageStep">
<number>100</number>
</property>
<property name="wrapping">
<bool>true</bool>
</property>
@ -2809,7 +2821,7 @@
<widget class="QComboBox" name="audioSystemCombo">
<item>
<property name="text">
<string>QT Audio</string>
<string>Qt Audio</string>
</property>
</item>
<item>
@ -2849,13 +2861,6 @@
<property name="topMargin">
<number>0</number>
</property>
<item>
<widget class="QPushButton" name="connectBtn">
<property name="text">
<string>Connect</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_5">
<property name="orientation">
@ -3328,8 +3333,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>794</width>
<height>582</height>
<width>194</width>
<height>563</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_2">
@ -4185,7 +4190,7 @@
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_33">
<layout class="QHBoxLayout" name="serverAudioHorizLayout">
<item>
<widget class="QLabel" name="label_33">
<property name="text">
@ -4232,6 +4237,32 @@
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_44">
<property name="text">
<string>Audio System</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="audioSystemServerCombo">
<item>
<property name="text">
<string>Qt Audio</string>
</property>
</item>
<item>
<property name="text">
<string>PortAudio</string>
</property>
</item>
<item>
<property name="text">
<string>RT Audio</string>
</property>
</item>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_23">
<property name="orientation">
@ -4682,6 +4713,26 @@
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_32">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="connectBtn">
<property name="text">
<string>Connect to Radio</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_9">
<property name="orientation">
@ -4746,7 +4797,7 @@
<resources/>
<connections/>
<buttongroups>
<buttongroup name="underlayButtonGroup"/>
<buttongroup name="buttonGroup"/>
<buttongroup name="underlayButtonGroup"/>
</buttongroups>
</ui>