Added UI elements with some supporting code: squelch and calibration

window.
merge-requests/2/head
Elliott Liggett 2021-02-10 21:22:38 -08:00
rodzic 7021cd935d
commit fa50414138
9 zmienionych plików z 389 dodań i 8 usunięć

Wyświetl plik

@ -0,0 +1,24 @@
#include "calibrationwindow.h"
#include "ui_calibrationwindow.h"
calibrationWindow::calibrationWindow(QWidget *parent) :
QDialog(parent),
ui(new Ui::calibrationWindow)
{
ui->setupUi(this);
}
calibrationWindow::~calibrationWindow()
{
delete ui;
}
void calibrationWindow::handleCurrentFreq(double tunedFreq)
{
}
void calibrationWindow::handleSpectrumPeak(double peakFreq)
{
}

Wyświetl plik

@ -0,0 +1,30 @@
#ifndef CALIBRATIONWINDOW_H
#define CALIBRATIONWINDOW_H
#include <QDialog>
namespace Ui {
class calibrationWindow;
}
class calibrationWindow : public QDialog
{
Q_OBJECT
public:
explicit calibrationWindow(QWidget *parent = 0);
~calibrationWindow();
public slots:
void handleSpectrumPeak(double peakFreq);
void handleCurrentFreq(double tunedFreq);
signals:
void requestSpectrumPeak(double peakFreq);
void requestCurrentFreq(double tunedFreq);
private:
Ui::calibrationWindow *ui;
};
#endif // CALIBRATIONWINDOW_H

Wyświetl plik

@ -0,0 +1,268 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>calibrationWindow</class>
<widget class="QDialog" name="calibrationWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
<widget class="QWidget" name="verticalLayoutWidget">
<property name="geometry">
<rect>
<x>9</x>
<y>9</y>
<width>381</width>
<height>281</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QLabel" name="label_3">
<property name="text">
<string>IC-9700</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_4">
<property name="text">
<string>Reference Adjustment</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QLabel" name="label_7">
<property name="text">
<string>Peak</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="calPeakFreqLabel">
<property name="text">
<string>446.000125</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QLabel" name="label_6">
<property name="text">
<string>Tune</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="calTuneFreqLabel">
<property name="text">
<string>446.00000</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<widget class="QLabel" name="label_5">
<property name="text">
<string>Delta</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="calDeltaFreqLabel">
<property name="text">
<string>-0.125</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<layout class="QVBoxLayout" name="verticalLayout_5">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Course</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>Fine</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_8">
<property name="rightMargin">
<number>10</number>
</property>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_6">
<item>
<widget class="QSlider" name="calCourseSlider">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<widget class="QSlider" name="calFineSlider">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_9">
<property name="leftMargin">
<number>10</number>
</property>
<property name="rightMargin">
<number>10</number>
</property>
<item>
<widget class="QSpinBox" name="calCourseSpinbox">
<property name="maximum">
<number>255</number>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="calFineSpinbox">
<property name="maximum">
<number>255</number>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="topMargin">
<number>10</number>
</property>
<item>
<widget class="QPushButton" name="calSaveSlotBtn">
<property name="text">
<string>Save</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="calLoadSlotBtn">
<property name="text">
<string>Load</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_11">
<property name="text">
<string>Slot:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="comboBox">
<item>
<property name="text">
<string>1</string>
</property>
</item>
<item>
<property name="text">
<string>2</string>
</property>
</item>
<item>
<property name="text">
<string>3</string>
</property>
</item>
<item>
<property name="text">
<string>4</string>
</property>
</item>
<item>
<property name="text">
<string>5</string>
</property>
</item>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<widget class="QPushButton" name="calReadRigCalBtn">
<property name="text">
<string>Read Current Rig Calibration</string>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
<resources/>
<connections/>
</ui>

Wyświetl plik

@ -843,6 +843,11 @@ void rigCommander::getSql()
prepDataAndSend(payload);
}
void rigCommander::setSquelch(unsigned char level)
{
sendLevelCmd(0x03, level);
}
void rigCommander::setRfGain(unsigned char level)
{
sendLevelCmd(0x02, level);

Wyświetl plik

@ -55,6 +55,7 @@ public slots:
void getRfGain();
void getAfGain();
void getSql();
void setSquelch(unsigned char level);
void setRfGain(unsigned char level);
void setAfGain(unsigned char level);
void startATU();

Wyświetl plik

@ -23,6 +23,8 @@ wfmain::wfmain(const QString serialPortCL, const QString hostCL, QWidget *parent
this->serialPortCL = serialPortCL;
this->hostCL = hostCL;
cal = new calibrationWindow();
haveRigCaps = false;
ui->bandStkLastUsedBtn->setVisible(false);
@ -277,6 +279,7 @@ wfmain::wfmain(const QString serialPortCL, const QString hostCL, QWidget *parent
connect(rig, SIGNAL(haveAfGain(unsigned char)), this, SLOT(receiveAfGain(unsigned char)));
connect(this, SIGNAL(getSql()), rig, SLOT(getSql()));
connect(rig, SIGNAL(haveSql(unsigned char)), this, SLOT(receiveSql(unsigned char)));
connect(this, SIGNAL(setSql(unsigned char)), rig, SLOT(setSquelch(unsigned char)));
connect(this, SIGNAL(startATU()), rig, SLOT(startATU()));
connect(this, SIGNAL(setATU(bool)), rig, SLOT(setATU(bool)));
connect(this, SIGNAL(getATUStatus()), rig, SLOT(getATUStatus()));
@ -1099,7 +1102,7 @@ void wfmain:: getInitialRigState()
cmdOutQue.append(cmdGetRxGain);
cmdOutQue.append(cmdGetAfGain);
// cmdOutQue.append(cmdGetSql); // implimented but not used
cmdOutQue.append(cmdGetSql); // implimented but not used
// TODO:
// get TX level
// get Scope reference Level
@ -2148,9 +2151,8 @@ void wfmain::receiveAfGain(unsigned char level)
void wfmain::receiveSql(unsigned char level)
{
// TODO: Maybe add squelch control
// qDebug() << "Receive SQL level of " << (int)level << " = " << 100*level/255.0 << "%";
// ui->sqlSlider->setValue(level); // No SQL control so far
qDebug() << "Receive SQL level of " << (int)level << " = " << 100*level/255.0 << "%";
ui->sqlSlider->setValue(level);
(void)level;
}
@ -2367,6 +2369,12 @@ void wfmain::on_connectBtn_clicked()
}
}
void wfmain::on_sqlSlider_valueChanged(int value)
{
emit setSql((unsigned char)value);
}
// --- DEBUG FUNCTION ---
void wfmain::on_debugBtn_clicked()
{
@ -2378,7 +2386,7 @@ void wfmain::on_debugBtn_clicked()
//emit getScopeSpan(); // in khz, only in "center" mode
//qDebug() << "Debug: finding rigs attached. Let's see if this works. ";
//rig->findRigs();
cal->show();
}

Wyświetl plik

@ -15,6 +15,7 @@
#include "rigcommander.h"
#include "freqmemory.h"
#include "rigidentities.h"
#include "calibrationwindow.h"
#include <qcustomplot.h>
#include <qserialportinfo.h>
@ -49,6 +50,7 @@ signals:
void getDebug();
void setRfGain(unsigned char level);
void setAfGain(unsigned char level);
void setSql(unsigned char level);
void startATU();
void setATU(bool atuEnabled);
void getATUStatus();
@ -277,6 +279,8 @@ private slots:
void on_scopeEnableWFBtn_clicked(bool checked);
void on_sqlSlider_valueChanged(int value);
private:
Ui::wfmain *ui;
QSettings settings;
@ -433,6 +437,8 @@ private:
rigCapabilities rigCaps;
bool haveRigCaps;
calibrationWindow *cal;
void bandStackBtnClick();
bool waitingForBandStackRtn;
char bandStkBand;

Wyświetl plik

@ -291,6 +291,42 @@
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_10">
<property name="leftMargin">
<number>0</number>
</property>
<item>
<widget class="QSlider" name="sqlSlider">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>60</height>
</size>
</property>
<property name="maximum">
<number>255</number>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_21">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>15</height>
</size>
</property>
<property name="text">
<string>SQ</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">

Wyświetl plik

@ -81,7 +81,8 @@ SOURCES += main.cpp\
rigidentities.cpp \
udphandler.cpp \
logcategories.cpp \
rxaudiohandler.cpp
rxaudiohandler.cpp \
calibrationwindow.cpp
HEADERS += wfmain.h \
commhandler.h \
@ -90,8 +91,10 @@ HEADERS += wfmain.h \
rigidentities.h \
udphandler.h \
logcategories.h \
rxaudiohandler.h
rxaudiohandler.h \
calibrationwindow.h
FORMS += wfmain.ui
FORMS += wfmain.ui \
calibrationwindow.ui