kopia lustrzana https://gitlab.com/eliggett/wfview
Merge remote-tracking branch 'origin/pbt-fixes' into morecontrols
Fixed bugs in offset frequencymerge-requests/16/head
commit
bc508565ee
110
CHANGELOG
110
CHANGELOG
|
@ -1,3 +1,107 @@
|
|||
commit fe36ff1ac73dee5b14df534b50454587c95fe4bd
|
||||
Merge: 13f06e1 4950127
|
||||
Author: Roeland Jansen <roeland.jansen69@gmail.com>
|
||||
Date: Thu Jan 26 07:33:00 2023 +0100
|
||||
|
||||
Merge branch 'pbt-fixes'
|
||||
|
||||
commit 49501273d02e02df7b2b1ca58be7a576daa1a19f
|
||||
Author: Phil Taylor <phil@m0vse.uk>
|
||||
Date: Wed Jan 25 21:37:12 2023 +0000
|
||||
|
||||
Fix for shuttle resource files
|
||||
|
||||
commit ea46d6c625e02c4869bd5fcd42c191f111a590f7
|
||||
Author: Phil Taylor <phil@m0vse.uk>
|
||||
Date: Wed Jan 25 21:22:06 2023 +0000
|
||||
|
||||
Add math.h for cwsender
|
||||
|
||||
commit 13f06e1dd7596a83f1686be7e632f62121574036
|
||||
Merge: 6df7099 ded6bd1
|
||||
Author: Roeland Jansen <roeland.jansen69@gmail.com>
|
||||
Date: Wed Jan 25 22:17:23 2023 +0100
|
||||
|
||||
Merge branch 'pbt-fixes'
|
||||
|
||||
commit ded6bd1adeba5790b1457fa1afcae651f322f045
|
||||
Author: Phil Taylor <phil@m0vse.uk>
|
||||
Date: Wed Jan 25 18:01:24 2023 +0000
|
||||
|
||||
Add CW Speed spinbox to CW sender
|
||||
|
||||
commit 4b40e20d9825e66c7b7cd77371d3f1e8801f06ae
|
||||
Author: Phil Taylor <phil@m0vse.uk>
|
||||
Date: Wed Jan 25 15:39:01 2023 +0000
|
||||
|
||||
Remove some debugging
|
||||
|
||||
commit 6df7099cb3ac8d48fdbff501cc0c1a7e2b236341
|
||||
Merge: bc0f9f0 5483732
|
||||
Author: Roeland Jansen <roeland.jansen69@gmail.com>
|
||||
Date: Wed Jan 25 13:17:03 2023 +0100
|
||||
|
||||
Merge branch 'pbt-fixes'
|
||||
|
||||
commit 54837327663bbb1b0aff5bb8cde45e1ebc4d63ee
|
||||
Merge: 8b8668a 7f97625
|
||||
Author: Phil Taylor <phil@m0vse.uk>
|
||||
Date: Wed Jan 25 11:42:13 2023 +0000
|
||||
|
||||
Merge branch 'master' into pbt-fixes
|
||||
|
||||
commit 8b8668a6deacb528cf9e0bf7311465966abc1614
|
||||
Author: Phil Taylor <phil@m0vse.uk>
|
||||
Date: Wed Jan 25 11:41:50 2023 +0000
|
||||
|
||||
Finally PBT works in all modes/filter widths/cw pitch settings.
|
||||
|
||||
commit bc0f9f01c7333285214d3b847517625de2a63899
|
||||
Merge: 85e38d9 be0aee6
|
||||
Author: Roeland Jansen <roeland.jansen69@gmail.com>
|
||||
Date: Wed Jan 25 09:16:36 2023 +0100
|
||||
|
||||
Merge branch 'morecontrols'
|
||||
|
||||
commit be0aee6183286a73604f5eba7c4b2d57b530d383
|
||||
Author: Elliott Liggett <kilocharlie8@gmail.com>
|
||||
Date: Wed Jan 25 00:15:20 2023 -0800
|
||||
|
||||
Split mode is working, can also live-sync frequency and mode.
|
||||
|
||||
commit 85e38d940f2874bbcbdcbbb619203732b0f1c146
|
||||
Merge: 7f97625 a1d3f93
|
||||
Author: Roeland Jansen <roeland.jansen69@gmail.com>
|
||||
Date: Wed Jan 25 07:47:41 2023 +0100
|
||||
|
||||
Merge branch 'pbt-fixes'
|
||||
|
||||
commit 4fea16c356189b06caad2adb2e5399dbbcc01945
|
||||
Author: Elliott Liggett <kilocharlie8@gmail.com>
|
||||
Date: Tue Jan 24 16:35:46 2023 -0800
|
||||
|
||||
Refined split interface controls. Offset is KHz, automatic tracking mode
|
||||
added.
|
||||
|
||||
commit ae64677c4213c0e0f2789a4388f5f2120c1574ff
|
||||
Merge: 0a7f6b0 7f97625
|
||||
Author: Elliott Liggett <kilocharlie8@gmail.com>
|
||||
Date: Tue Jan 24 15:17:17 2023 -0800
|
||||
|
||||
Merge branch 'master' into morecontrols
|
||||
|
||||
commit a1d3f93dad7141a54a4ffd5585eaad0ee7774591
|
||||
Author: Phil Taylor <phil@m0vse.uk>
|
||||
Date: Tue Jan 24 20:12:23 2023 +0000
|
||||
|
||||
PBT should now display correctly in ALL modes!
|
||||
|
||||
commit 7f97625e38eec48affcb4abe174802636a7b07ad
|
||||
Author: Roeland Jansen <roeland.jansen69@gmail.com>
|
||||
Date: Tue Jan 24 19:49:43 2023 +0100
|
||||
|
||||
modified CHANGELOG
|
||||
|
||||
commit d53c9b028e1e962b80334bbeaac794d4572d9939
|
||||
Author: Elliott Liggett <kilocharlie8@gmail.com>
|
||||
Date: Tue Jan 24 10:37:26 2023 -0800
|
||||
|
@ -5,6 +109,12 @@ Date: Tue Jan 24 10:37:26 2023 -0800
|
|||
Added a rapidPollCmdQueue for things we need to poll rapidly on not-s-
|
||||
meter-intervals. Moved command types to wfviewtypes.h.
|
||||
|
||||
commit 0a7f6b0b6547087841bd0f5da1f962250cdda49c
|
||||
Author: Elliott Liggett <kilocharlie8@gmail.com>
|
||||
Date: Tue Jan 24 09:21:09 2023 -0800
|
||||
|
||||
Started work on the UI for a split control interface.
|
||||
|
||||
commit 2df82d4f922fcebd256816d41839977840d08e5b
|
||||
Author: Roeland Jansen <roeland.jansen69@gmail.com>
|
||||
Date: Tue Jan 24 17:22:34 2023 +0100
|
||||
|
|
|
@ -116,11 +116,11 @@ void controllerSetup::newDevice(unsigned char devType, QVector<BUTTON>* but, QVe
|
|||
|
||||
switch (devType) {
|
||||
case shuttleXpress:
|
||||
image.load(":/resources/controllerxpress.png");
|
||||
image.load(":/resources/shuttlexpress.png");
|
||||
deviceName = "shuttleXpress";
|
||||
break;
|
||||
case shuttlePro2:
|
||||
image.load(":/resources/controllerpro.png");
|
||||
image.load(":/resources/shuttlepro.png");
|
||||
deviceName = "shuttlePro2";
|
||||
break;
|
||||
case RC28:
|
||||
|
|
16
cwsender.cpp
16
cwsender.cpp
|
@ -41,6 +41,13 @@ void cwSender::handleKeySpeed(unsigned char wpm)
|
|||
}
|
||||
}
|
||||
|
||||
void cwSender::handlePitch(unsigned char pitch) {
|
||||
quint16 cwPitch = round((((600.0 / 255.0) * pitch) + 300) / 5.0) * 5.0;
|
||||
ui->pitchSpin->blockSignals(true);
|
||||
ui->pitchSpin->setValue(cwPitch);
|
||||
ui->pitchSpin->blockSignals(false);
|
||||
}
|
||||
|
||||
void cwSender::handleBreakInMode(unsigned char b)
|
||||
{
|
||||
if(b < 3)
|
||||
|
@ -107,6 +114,15 @@ void cwSender::on_wpmSpin_valueChanged(int wpm)
|
|||
emit setKeySpeed((unsigned char)wpm);
|
||||
}
|
||||
|
||||
void cwSender::on_pitchSpin_valueChanged(int arg1)
|
||||
{
|
||||
// quint16 cwPitch = round((((600.0 / 255.0) * pitch) + 300) / 5.0) * 5.0;
|
||||
unsigned char pitch = 0;
|
||||
pitch = ceil((arg1 - 300) * (255.0 / 600.0));
|
||||
qDebug() << "Setting pitch" << pitch;
|
||||
emit setPitch(pitch);
|
||||
}
|
||||
|
||||
void cwSender::on_macro1btn_clicked()
|
||||
{
|
||||
processMacroButton(1, ui->macro1btn);
|
||||
|
|
|
@ -6,10 +6,12 @@
|
|||
#include <QFont>
|
||||
#include <QInputDialog>
|
||||
#include <QMessageBox>
|
||||
#include <math.h>
|
||||
#include "wfviewtypes.h"
|
||||
#include "logcategories.h"
|
||||
|
||||
|
||||
|
||||
namespace Ui {
|
||||
class cwSender;
|
||||
}
|
||||
|
@ -27,11 +29,13 @@ signals:
|
|||
void sendCW(QString cwMessage);
|
||||
void stopCW();
|
||||
void setKeySpeed(unsigned char wpm);
|
||||
void setPitch(unsigned char pitch);
|
||||
void setBreakInMode(unsigned char b);
|
||||
void getCWSettings();
|
||||
|
||||
public slots:
|
||||
void handleKeySpeed(unsigned char wpm);
|
||||
void handlePitch(unsigned char pitch);
|
||||
void handleBreakInMode(unsigned char b);
|
||||
void handleCurrentModeUpdate(mode_kind mode);
|
||||
|
||||
|
@ -47,6 +51,8 @@ private slots:
|
|||
|
||||
void on_wpmSpin_valueChanged(int arg1);
|
||||
|
||||
void on_pitchSpin_valueChanged(int arg1);
|
||||
|
||||
void on_macro1btn_clicked();
|
||||
|
||||
void on_macro2btn_clicked();
|
||||
|
|
220
cwsender.ui
220
cwsender.ui
|
@ -6,7 +6,7 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>681</width>
|
||||
<width>636</width>
|
||||
<height>451</height>
|
||||
</rect>
|
||||
</property>
|
||||
|
@ -18,23 +18,7 @@
|
|||
</property>
|
||||
<widget class="QWidget" name="centralwidget">
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0" colspan="8">
|
||||
<widget class="QPlainTextEdit" name="transcriptText">
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>CW Transmission Transcript</string>
|
||||
</property>
|
||||
<property name="undoRedoEnabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="8">
|
||||
<item row="3" column="0" colspan="12">
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>Macros</string>
|
||||
|
@ -177,45 +161,6 @@
|
|||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="3">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Break In</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QPushButton" name="stopBtn">
|
||||
<property name="toolTip">
|
||||
<string>Stop sending CW</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Stop</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="4">
|
||||
<widget class="QComboBox" name="breakinCombo">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Set the desired break-in mode:</p><p>1. None: You must manually key and unkey the radio.</p><p>2. Semi: Transmit is automatic and switches to receive at the end of the text.</p><p>3. Full: Same as semi, but with breaks between characters when possible.</p></body></html></string>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Off</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Semi</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Full</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QComboBox" name="textToSendEdit">
|
||||
<property name="sizePolicy">
|
||||
|
@ -238,29 +183,6 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="5">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>WPM:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="6">
|
||||
<widget class="QSpinBox" name="wpmSpin">
|
||||
<property name="toolTip">
|
||||
<string>Set the Words Per Minute</string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>48</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>20</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QPushButton" name="sendBtn">
|
||||
<property name="text">
|
||||
|
@ -274,6 +196,144 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" colspan="12">
|
||||
<widget class="QPlainTextEdit" name="transcriptText">
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>CW Transmission Transcript</string>
|
||||
</property>
|
||||
<property name="undoRedoEnabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QPushButton" name="stopBtn">
|
||||
<property name="toolTip">
|
||||
<string>Stop sending CW</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Stop</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="3" colspan="2">
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetMinimumSize</enum>
|
||||
</property>
|
||||
<item row="3" column="0">
|
||||
<widget class="QComboBox" name="breakinCombo">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Set the desired break-in mode:</p><p>1. None: You must manually key and unkey the radio.</p><p>2. Semi: Transmit is automatic and switches to receive at the end of the text.</p><p>3. Full: Same as semi, but with breaks between characters when possible.</p></body></html></string>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Off</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Semi</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Full</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>WPM:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QSpinBox" name="wpmSpin">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Set the Words Per Minute</string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>48</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>20</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Break In</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="2">
|
||||
<widget class="QSpinBox" name="pitchSpin">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>300</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>900</number>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="stepType">
|
||||
<enum>QAbstractSpinBox::DefaultStepType</enum>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>600</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>PITCH (Hz):</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QStatusBar" name="statusbar"/>
|
||||
|
|
|
@ -286,7 +286,7 @@ void repeaterSetup::receiveDuplexMode(duplexMode dm)
|
|||
switch(dm)
|
||||
{
|
||||
case dmSplitOff:
|
||||
//ui->splitEnableChk->setChecked(false);
|
||||
ui->splitOffBtn->setChecked(true);
|
||||
ui->autoTrackLiveBtn->setChecked(false);
|
||||
break;
|
||||
case dmSplitOn:
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
<RCC>
|
||||
<qresource prefix="resources">
|
||||
<file>wfview.png</file>
|
||||
<file>shuttlexpress.png</file>
|
||||
<file>shuttlepro.png</file>
|
||||
<file>rc28.png</file>
|
||||
<file>xbox.png</file>
|
||||
</qresource>
|
||||
<qresource prefix="/resources">
|
||||
<file>wfview.png</file>
|
||||
<file>shuttlexpress.png</file>
|
||||
<file>shuttlepro.png</file>
|
||||
<file>rc28.png</file>
|
||||
<file>xbox.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
|
|
@ -996,6 +996,14 @@ void rigCommander::getCwPitch()
|
|||
prepDataAndSend(payload);
|
||||
}
|
||||
|
||||
void rigCommander::setCwPitch(unsigned char pitch)
|
||||
{
|
||||
QByteArray payload;
|
||||
payload.setRawData("\x14\x09", 2);
|
||||
payload.append(bcdEncodeInt(pitch));
|
||||
prepDataAndSend(payload);
|
||||
}
|
||||
|
||||
void rigCommander::getPskTone()
|
||||
{
|
||||
QByteArray payload;
|
||||
|
@ -1003,6 +1011,14 @@ void rigCommander::getPskTone()
|
|||
prepDataAndSend(payload);
|
||||
}
|
||||
|
||||
void rigCommander::setPskTone(unsigned char tone)
|
||||
{
|
||||
QByteArray payload;
|
||||
payload.setRawData("\x1a\x05\x00\x44", 4);
|
||||
payload.append(bcdEncodeInt(tone));
|
||||
prepDataAndSend(payload);
|
||||
}
|
||||
|
||||
void rigCommander::getRttyMark()
|
||||
{
|
||||
QByteArray payload;
|
||||
|
@ -1010,6 +1026,14 @@ void rigCommander::getRttyMark()
|
|||
prepDataAndSend(payload);
|
||||
}
|
||||
|
||||
void rigCommander::setRttyMark(unsigned char mark)
|
||||
{
|
||||
QByteArray payload;
|
||||
payload.setRawData("\x1a\x05\x00\x41", 4);
|
||||
payload.append(bcdEncodeInt(mark));
|
||||
prepDataAndSend(payload);
|
||||
}
|
||||
|
||||
void rigCommander::getTransmitFrequency()
|
||||
{
|
||||
QByteArray payload;
|
||||
|
@ -1548,7 +1572,7 @@ void rigCommander::parseCommand()
|
|||
this->parseMode();
|
||||
break;
|
||||
case '\x0C':
|
||||
qDebug(logRig) << "Have 0x0C reply";
|
||||
//qDebug(logRig) << "Have 0x0C reply";
|
||||
emit haveRptOffsetFrequency(parseFrequencyRptOffset(payloadIn));
|
||||
break;
|
||||
case '\x0F':
|
||||
|
@ -4438,20 +4462,23 @@ void rigCommander::parseFrequency()
|
|||
|
||||
freqt rigCommander::parseFrequencyRptOffset(QByteArray data)
|
||||
{
|
||||
// VHF 600 KHz:
|
||||
// DATA: 0c 00 60 00 fd
|
||||
// INDEX: 00 01 02 03 04
|
||||
// 00.600.0 MHz (600.0 KHz)
|
||||
|
||||
// UHF 5 MHz:
|
||||
// DATA: 0c 00 00 05 fd
|
||||
// INDEX: 00 01 02 03 04
|
||||
|
||||
freqt f;
|
||||
f.Hz = 0;
|
||||
|
||||
f.Hz += (data[1] & 0x0f) * 1E6; // 1 MHz
|
||||
f.Hz += ((data[1] & 0xf0) >> 4) * 1E6 * 10; // 10 MHz
|
||||
f.Hz += (data[3] & 0x0f) * 1E6; // 1 MHz
|
||||
f.Hz += ((data[3] & 0xf0) >> 4) * 1E6 * 10; // 10 MHz
|
||||
f.Hz += (data[2] & 0x0f) * 10E3; // 10 KHz
|
||||
f.Hz += ((data[2] & 0xf0) >> 4) * 100E3; // 100 KHz
|
||||
|
||||
f.Hz += (data[3] & 0x0f) * 100; // 100 Hz
|
||||
f.Hz += ((data[3] & 0xf0) >> 4) * 1000; // 1 KHz
|
||||
f.Hz += (data[1] & 0x0f) * 100; // 100 Hz
|
||||
f.Hz += ((data[1] & 0xf0) >> 4) * 1000; // 1 KHz
|
||||
|
||||
return f;
|
||||
}
|
||||
|
|
|
@ -128,8 +128,11 @@ public slots:
|
|||
|
||||
void getPassband();
|
||||
void getCwPitch();
|
||||
void setCwPitch(unsigned char pitch);
|
||||
void getPskTone();
|
||||
void setPskTone(unsigned char tone);
|
||||
void getRttyMark();
|
||||
void setRttyMark(unsigned char mark);
|
||||
|
||||
// Repeater:
|
||||
void setDuplexMode(duplexMode dm);
|
||||
|
|
|
@ -35,6 +35,7 @@ struct udpPreferences {
|
|||
QString password;
|
||||
QString clientName;
|
||||
quint8 waterfallFormat;
|
||||
bool halfDuplex;
|
||||
};
|
||||
|
||||
struct networkAudioLevels {
|
||||
|
|
410
wfmain.cpp
410
wfmain.cpp
|
@ -355,10 +355,13 @@ void wfmain::rigConnections()
|
|||
connect(this, SIGNAL(stopCW()), rig, SLOT(sendStopCW()));
|
||||
connect(this, SIGNAL(setKeySpeed(unsigned char)), rig, SLOT(setKeySpeed(unsigned char)));
|
||||
connect(this, SIGNAL(getKeySpeed()), rig, SLOT(getKeySpeed()));
|
||||
connect(this, SIGNAL(setCwPitch(unsigned char)), rig, SLOT(setCwPitch(unsigned char)));
|
||||
connect(this, SIGNAL(setCWBreakMode(unsigned char)), rig, SLOT(setBreakIn(unsigned char)));
|
||||
connect(this, SIGNAL(getCWBreakMode()), rig, SLOT(getBreakIn()));
|
||||
connect(this->rig, &rigCommander::haveKeySpeed,
|
||||
[=](const unsigned char &wpm) { cw->handleKeySpeed(wpm);});
|
||||
[=](const unsigned char& wpm) { cw->handleKeySpeed(wpm); });
|
||||
connect(this->rig, &rigCommander::haveCwPitch,
|
||||
[=](const unsigned char& speed) { cw->handlePitch(speed); });
|
||||
connect(this->rig, &rigCommander::haveCWBreakMode,
|
||||
[=](const unsigned char &bm) { cw->handleBreakInMode(bm);});
|
||||
|
||||
|
@ -1118,7 +1121,9 @@ void wfmain::setupMainUI()
|
|||
connect(this->cw, &cwSender::setBreakInMode,
|
||||
[=](const unsigned char &bmode) { issueCmd(cmdSetBreakMode, bmode);});
|
||||
connect(this->cw, &cwSender::setKeySpeed,
|
||||
[=](const unsigned char &wpm) { issueCmd(cmdSetKeySpeed, wpm);});
|
||||
[=](const unsigned char& wpm) { issueCmd(cmdSetKeySpeed, wpm); });
|
||||
connect(this->cw, &cwSender::setPitch,
|
||||
[=](const unsigned char& pitch) { issueCmd(cmdSetCwPitch, pitch); });
|
||||
connect(this->cw, &cwSender::getCWSettings,
|
||||
[=]() { issueDelayedCommand(cmdGetKeySpeed);
|
||||
issueDelayedCommand(cmdGetBreakMode);});
|
||||
|
@ -2074,6 +2079,8 @@ void wfmain::loadSettings()
|
|||
|
||||
udpPrefs.clientName = settings->value("ClientName", udpDefPrefs.clientName).toString();
|
||||
|
||||
udpPrefs.halfDuplex = settings->value("HalfDuplex", udpDefPrefs.halfDuplex).toBool();
|
||||
|
||||
settings->endGroup();
|
||||
|
||||
settings->beginGroup("Server");
|
||||
|
@ -2734,6 +2741,7 @@ void wfmain::saveSettings()
|
|||
settings->setValue("ResampleQuality", rxSetup.resampleQuality);
|
||||
settings->setValue("ClientName", udpPrefs.clientName);
|
||||
settings->setValue("WaterfallFormat", prefs.waterfallFormat);
|
||||
settings->setValue("HalfDuplex", udpPrefs.halfDuplex);
|
||||
|
||||
settings->endGroup();
|
||||
|
||||
|
@ -3777,6 +3785,12 @@ void wfmain::doCmd(commandtype cmddata)
|
|||
emit setKeySpeed(wpm);
|
||||
break;
|
||||
}
|
||||
case cmdSetCwPitch:
|
||||
{
|
||||
unsigned char pitch = (*std::static_pointer_cast<unsigned char>(data));
|
||||
emit setCwPitch(pitch);
|
||||
break;
|
||||
}
|
||||
case cmdSetATU:
|
||||
{
|
||||
bool atuOn = (*std::static_pointer_cast<bool>(data));
|
||||
|
@ -4125,9 +4139,15 @@ void wfmain::issueDelayedCommandUnique(cmds cmd)
|
|||
cmddata.cmd = cmd;
|
||||
cmddata.data = NULL;
|
||||
|
||||
delayedCmdQue.push_front(cmddata);
|
||||
delayedCmdQue.erase(std::remove_if(delayedCmdQue.begin() + 1, delayedCmdQue.end(), [cmd](const commandtype& c) { return (c.cmd == cmd); }), delayedCmdQue.end());
|
||||
|
||||
// The following is both expensive and not that great,
|
||||
// since it does not check if the arguments are the same.
|
||||
bool found = false;
|
||||
// since it does not check if the arguments are the same.
|
||||
/* bool found = false;
|
||||
|
||||
|
||||
|
||||
for(unsigned int i=0; i < delayedCmdQue.size(); i++)
|
||||
{
|
||||
if(delayedCmdQue.at(i).cmd == cmd)
|
||||
|
@ -4146,7 +4166,9 @@ void wfmain::issueDelayedCommandUnique(cmds cmd)
|
|||
// {
|
||||
// delayedCmdQue.push_front(cmddata);
|
||||
// }
|
||||
*/
|
||||
|
||||
// delayedCmdQue.push_front(cmddata);
|
||||
}
|
||||
|
||||
void wfmain::issueCmd(cmds cmd, mode_info m)
|
||||
|
@ -4269,7 +4291,9 @@ void wfmain::issueCmdUniquePriority(cmds cmd, bool b)
|
|||
cmddata.cmd = cmd;
|
||||
cmddata.data = std::shared_ptr<bool>(new bool(b));
|
||||
delayedCmdQue.push_front(cmddata);
|
||||
removeSimilarCommand(cmd);
|
||||
delayedCmdQue.erase(std::remove_if(delayedCmdQue.begin() + 1, delayedCmdQue.end(), [cmd](const commandtype& c) { return (c.cmd == cmd); }), delayedCmdQue.end());
|
||||
|
||||
//removeSimilarCommand(cmd);
|
||||
}
|
||||
|
||||
void wfmain::issueCmdUniquePriority(cmds cmd, unsigned char c)
|
||||
|
@ -4278,7 +4302,9 @@ void wfmain::issueCmdUniquePriority(cmds cmd, unsigned char c)
|
|||
cmddata.cmd = cmd;
|
||||
cmddata.data = std::shared_ptr<unsigned char>(new unsigned char(c));
|
||||
delayedCmdQue.push_front(cmddata);
|
||||
removeSimilarCommand(cmd);
|
||||
delayedCmdQue.erase(std::remove_if(delayedCmdQue.begin() + 1, delayedCmdQue.end(), [cmd](const commandtype& c) { return (c.cmd == cmd); }), delayedCmdQue.end());
|
||||
|
||||
//removeSimilarCommand(cmd);
|
||||
}
|
||||
|
||||
void wfmain::issueCmdUniquePriority(cmds cmd, char c)
|
||||
|
@ -4287,7 +4313,8 @@ void wfmain::issueCmdUniquePriority(cmds cmd, char c)
|
|||
cmddata.cmd = cmd;
|
||||
cmddata.data = std::shared_ptr<char>(new char(c));
|
||||
delayedCmdQue.push_front(cmddata);
|
||||
removeSimilarCommand(cmd);
|
||||
delayedCmdQue.erase(std::remove_if(delayedCmdQue.begin() + 1, delayedCmdQue.end(), [cmd](const commandtype& c) { return (c.cmd == cmd); }), delayedCmdQue.end());
|
||||
//removeSimilarCommand(cmd);
|
||||
}
|
||||
|
||||
void wfmain::issueCmdUniquePriority(cmds cmd, freqt f)
|
||||
|
@ -4296,7 +4323,8 @@ void wfmain::issueCmdUniquePriority(cmds cmd, freqt f)
|
|||
cmddata.cmd = cmd;
|
||||
cmddata.data = std::shared_ptr<freqt>(new freqt(f));
|
||||
delayedCmdQue.push_front(cmddata);
|
||||
removeSimilarCommand(cmd);
|
||||
delayedCmdQue.erase(std::remove_if(delayedCmdQue.begin() + 1, delayedCmdQue.end(), [cmd](const commandtype& c) { return (c.cmd == cmd); }), delayedCmdQue.end());
|
||||
//removeSimilarCommand(cmd);
|
||||
}
|
||||
|
||||
void wfmain::issueCmdUniquePriority(cmds cmd, quint16 c)
|
||||
|
@ -4305,7 +4333,8 @@ void wfmain::issueCmdUniquePriority(cmds cmd, quint16 c)
|
|||
cmddata.cmd = cmd;
|
||||
cmddata.data = std::shared_ptr<quint16>(new quint16(c));
|
||||
delayedCmdQue.push_front(cmddata);
|
||||
removeSimilarCommand(cmd);
|
||||
delayedCmdQue.erase(std::remove_if(delayedCmdQue.begin() + 1, delayedCmdQue.end(), [cmd](const commandtype& c) { return (c.cmd == cmd); }), delayedCmdQue.end());
|
||||
//removeSimilarCommand(cmd);
|
||||
}
|
||||
|
||||
void wfmain::issueCmdUniquePriority(cmds cmd, qint16 c)
|
||||
|
@ -4314,7 +4343,8 @@ void wfmain::issueCmdUniquePriority(cmds cmd, qint16 c)
|
|||
cmddata.cmd = cmd;
|
||||
cmddata.data = std::shared_ptr<qint16>(new qint16(c));
|
||||
delayedCmdQue.push_front(cmddata);
|
||||
removeSimilarCommand(cmd);
|
||||
delayedCmdQue.erase(std::remove_if(delayedCmdQue.begin() + 1, delayedCmdQue.end(), [cmd](const commandtype& c) { return (c.cmd == cmd); }), delayedCmdQue.end());
|
||||
//removeSimilarCommand(cmd);
|
||||
}
|
||||
|
||||
void wfmain::removeSimilarCommand(cmds cmd)
|
||||
|
@ -4605,14 +4635,10 @@ void wfmain::initPeriodicCommands()
|
|||
rapidPollCmdQueue.clear();
|
||||
if (rigCaps.hasSpectrum) {
|
||||
// Get passband
|
||||
insertPeriodicRapidCmd(cmdGetPassband);
|
||||
insertPeriodicRapidCmd(cmdGetTPBFInner);
|
||||
insertPeriodicRapidCmd(cmdGetTPBFOuter);
|
||||
|
||||
// insertPeriodicCommand(cmdGetPassband, 128);
|
||||
// insertPeriodicCommand(cmdGetTPBFInner, 128);
|
||||
// insertPeriodicCommand(cmdGetTPBFOuter, 128);
|
||||
|
||||
insertSlowPeriodicCommand(cmdGetPassband, 128);
|
||||
insertSlowPeriodicCommand(cmdGetTPBFInner, 128);
|
||||
insertSlowPeriodicCommand(cmdGetTPBFOuter, 128);
|
||||
}
|
||||
rapidPollCmdQueueEnabled = true;
|
||||
}
|
||||
|
@ -4653,6 +4679,10 @@ void wfmain::insertPeriodicCommandUnique(cmds cmd)
|
|||
|
||||
void wfmain::removePeriodicRapidCmd(cmds cmd)
|
||||
{
|
||||
|
||||
rapidPollCmdQueue.erase(std::remove_if(rapidPollCmdQueue.begin(), rapidPollCmdQueue.end(), [cmd](const cmds& c) { return (c == cmd); }), rapidPollCmdQueue.end());
|
||||
|
||||
/*
|
||||
while(true)
|
||||
{
|
||||
auto it = std::find(this->rapidPollCmdQueue.begin(), this->rapidPollCmdQueue.end(), cmd);
|
||||
|
@ -4663,11 +4693,15 @@ void wfmain::removePeriodicRapidCmd(cmds cmd)
|
|||
break;
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
void wfmain::removePeriodicCommand(cmds cmd)
|
||||
{
|
||||
while(true)
|
||||
|
||||
periodicCmdQueue.erase(std::remove_if(periodicCmdQueue.begin(), periodicCmdQueue.end(), [cmd](const cmds& c) { return (c == cmd); }), periodicCmdQueue.end());
|
||||
|
||||
/* while (true)
|
||||
{
|
||||
auto it = std::find(this->periodicCmdQueue.begin(), this->periodicCmdQueue.end(), cmd);
|
||||
if(it != periodicCmdQueue.end())
|
||||
|
@ -4677,6 +4711,7 @@ void wfmain::removePeriodicCommand(cmds cmd)
|
|||
break;
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
|
@ -4867,7 +4902,17 @@ void wfmain::receiveSpectrumData(QByteArray spectrum, double startFreq, double e
|
|||
passbandIndicator->topLeft->setCoords(pbStart, 0);
|
||||
passbandIndicator->bottomRight->setCoords(pbEnd, rigCaps.spectAmpMax);
|
||||
|
||||
if (TPBFInner || TPBFOuter) {
|
||||
if ((currentModeInfo.mk == modeCW || currentModeInfo.mk == modeCW_R) && passbandWidth > 0.0006)
|
||||
{
|
||||
pbtDefault = round((passbandWidth - (cwPitch / 1000000.0)) * 200000.0) / 200000.0;
|
||||
}
|
||||
else
|
||||
{
|
||||
pbtDefault = 0.0;
|
||||
}
|
||||
|
||||
if ((TPBFInner - pbtDefault || TPBFOuter - pbtDefault) && passbandAction != passbandResizing && currentModeInfo.mk != modeFM)
|
||||
{
|
||||
pbtIndicator->setVisible(true);
|
||||
}
|
||||
else
|
||||
|
@ -4878,10 +4923,12 @@ void wfmain::receiveSpectrumData(QByteArray spectrum, double startFreq, double e
|
|||
/*
|
||||
pbtIndicator displays the intersection between TPBFInner and TPBFOuter
|
||||
*/
|
||||
pbtIndicator->topLeft->setCoords(qMax(pbStart + (TPBFInner / 2), pbStart + (TPBFOuter / 2)), 0);
|
||||
pbtIndicator->topLeft->setCoords(qMax(pbStart + (TPBFInner / 2) - (pbtDefault /2), pbStart + (TPBFOuter / 2) - (pbtDefault /2)), 0);
|
||||
|
||||
pbtIndicator->bottomRight->setCoords(qMin(pbStart + (TPBFInner / 2) + passbandWidth,
|
||||
pbStart + (TPBFOuter / 2) + passbandWidth), rigCaps.spectAmpMax);
|
||||
pbtIndicator->bottomRight->setCoords(qMin(pbStart + (TPBFInner / 2) - (pbtDefault /2) + passbandWidth,
|
||||
pbStart + (TPBFOuter / 2) - (pbtDefault/2) + passbandWidth), rigCaps.spectAmpMax);
|
||||
|
||||
//qDebug() << "Default" << pbtDefault << "Inner" << TPBFInner << "Outer" << TPBFOuter << "Pass" << passbandWidth << "Center" << passbandCenterFrequency << "CW" << cwPitch;
|
||||
}
|
||||
|
||||
if (underlayMode == underlayPeakHold)
|
||||
|
@ -5031,8 +5078,13 @@ void wfmain::handlePlotDoubleClick(QMouseEvent *me)
|
|||
QCPAbstractItem* item = plot->itemAt(me->pos(), true);
|
||||
QCPItemRect* rectItem = dynamic_cast<QCPItemRect*> (item);
|
||||
if (rectItem != nullptr) {
|
||||
issueCmdUniquePriority(cmdSetTPBFInner, (unsigned char)128);
|
||||
issueCmdUniquePriority(cmdSetTPBFOuter, (unsigned char)128);
|
||||
double pbFreq = (pbtDefault / passbandWidth) * 127.0;
|
||||
qint16 newFreq = pbFreq + 128;
|
||||
issueCmdUniquePriority(cmdSetTPBFInner, (unsigned char)newFreq);
|
||||
issueCmdUniquePriority(cmdSetTPBFOuter, (unsigned char)newFreq);
|
||||
issueDelayedCommandUnique(cmdGetTPBFInner);
|
||||
issueDelayedCommandUnique(cmdGetTPBFOuter);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -5201,31 +5253,36 @@ void wfmain::handlePlotMouseMove(QMouseEvent* me)
|
|||
}
|
||||
else if (passbandAction == passbandResizing)
|
||||
{
|
||||
// We are currently resizing the passband.
|
||||
double pb = 0.0;
|
||||
double origin = 0.0;
|
||||
switch (currentModeInfo.mk)
|
||||
{
|
||||
case modeCW:
|
||||
case modeCW_R:
|
||||
origin = 0.0;
|
||||
break;
|
||||
case modeLSB:
|
||||
origin = -passbandCenterFrequency;
|
||||
break;
|
||||
default:
|
||||
origin = passbandCenterFrequency;
|
||||
break;
|
||||
}
|
||||
static double lastFreq = movedFrequency;
|
||||
if (lastFreq - movedFrequency > 0.000049 || movedFrequency - lastFreq > 0.000049) {
|
||||
|
||||
if (plot->xAxis->pixelToCoord(cursor) >= freq.MHzDouble + origin) {
|
||||
pb = plot->xAxis->pixelToCoord(cursor) - passbandIndicator->topLeft->coords().x();
|
||||
}
|
||||
else {
|
||||
pb = passbandIndicator->bottomRight->coords().x() - plot->xAxis->pixelToCoord(cursor);
|
||||
}
|
||||
// We are currently resizing the passband.
|
||||
double pb = 0.0;
|
||||
double origin = 0.0;
|
||||
switch (currentModeInfo.mk)
|
||||
{
|
||||
case modeCW:
|
||||
case modeCW_R:
|
||||
origin = 0.0;
|
||||
break;
|
||||
case modeLSB:
|
||||
origin = -passbandCenterFrequency;
|
||||
break;
|
||||
default:
|
||||
origin = passbandCenterFrequency;
|
||||
break;
|
||||
}
|
||||
|
||||
issueCmdUniquePriority(cmdSetPassband, (quint16)(pb * 1000000));
|
||||
if (plot->xAxis->pixelToCoord(cursor) >= freq.MHzDouble + origin) {
|
||||
pb = plot->xAxis->pixelToCoord(cursor) - passbandIndicator->topLeft->coords().x();
|
||||
}
|
||||
else {
|
||||
pb = passbandIndicator->bottomRight->coords().x() - plot->xAxis->pixelToCoord(cursor);
|
||||
}
|
||||
issueCmdUniquePriority(cmdSetPassband, (quint16)(pb * 1000000));
|
||||
issueDelayedCommandUnique(cmdGetPassband);
|
||||
lastFreq = movedFrequency;
|
||||
}
|
||||
}
|
||||
else if (passbandAction == pbtMoving) {
|
||||
|
||||
|
@ -5245,25 +5302,36 @@ void wfmain::handlePlotMouseMove(QMouseEvent* me)
|
|||
qDebug() << QString("Moving passband by %1 Hz (Inner %2) (Outer %3) Mode:%4").arg((qint16)(movedFrequency * 1000000))
|
||||
.arg(newInFreq).arg(newOutFreq).arg(currentModeInfo.mk);
|
||||
|
||||
issueCmd(cmdSetTPBFInner, (unsigned char)newInFreq);
|
||||
issueCmd(cmdSetTPBFOuter, (unsigned char)newOutFreq);
|
||||
|
||||
issueCmdUniquePriority(cmdSetTPBFInner, (unsigned char)newInFreq);
|
||||
issueCmdUniquePriority(cmdSetTPBFOuter, (unsigned char)newOutFreq);
|
||||
issueDelayedCommandUnique(cmdGetTPBFInner);
|
||||
issueDelayedCommandUnique(cmdGetTPBFOuter);
|
||||
}
|
||||
lastFreq = movedFrequency;
|
||||
}
|
||||
}
|
||||
else if (passbandAction == pbtInnerMove) {
|
||||
double pbFreq = ((double)(TPBFInner + movedFrequency) / passbandWidth) * 127.0;
|
||||
qint16 newFreq = pbFreq + 128;
|
||||
if (newFreq >= 0 && newFreq <= 255) {
|
||||
issueCmdUniquePriority(cmdSetTPBFInner, (unsigned char)newFreq);
|
||||
static double lastFreq = movedFrequency;
|
||||
if (lastFreq - movedFrequency > 0.000049 || movedFrequency - lastFreq > 0.000049) {
|
||||
double pbFreq = ((double)(TPBFInner + movedFrequency) / passbandWidth) * 127.0;
|
||||
qint16 newFreq = pbFreq + 128;
|
||||
if (newFreq >= 0 && newFreq <= 255) {
|
||||
issueCmdUniquePriority(cmdSetTPBFInner, (unsigned char)newFreq);
|
||||
issueDelayedCommandUnique(cmdGetTPBFInner);
|
||||
}
|
||||
lastFreq = movedFrequency;
|
||||
}
|
||||
}
|
||||
else if (passbandAction == pbtOuterMove) {
|
||||
double pbFreq = ((double)(TPBFOuter + movedFrequency) / passbandWidth) * 127.0;
|
||||
qint16 newFreq = pbFreq + 128;
|
||||
if (newFreq >= 0 && newFreq <= 255) {
|
||||
issueCmdUniquePriority(cmdSetTPBFOuter, (unsigned char)newFreq);
|
||||
static double lastFreq = movedFrequency;
|
||||
if (lastFreq - movedFrequency > 0.000049 || movedFrequency - lastFreq > 0.000049) {
|
||||
double pbFreq = ((double)(TPBFOuter + movedFrequency) / passbandWidth) * 127.0;
|
||||
qint16 newFreq = pbFreq + 128;
|
||||
if (newFreq >= 0 && newFreq <= 255) {
|
||||
issueCmdUniquePriority(cmdSetTPBFOuter, (unsigned char)newFreq);
|
||||
issueDelayedCommandUnique(cmdGetTPBFOuter);
|
||||
}
|
||||
lastFreq = movedFrequency;
|
||||
}
|
||||
}
|
||||
else if (passbandAction == passbandStatic && me->buttons() == Qt::LeftButton && textItem == nullptr && prefs.clickDragTuningEnable)
|
||||
|
@ -5357,109 +5425,95 @@ void wfmain::receiveMode(unsigned char mode, unsigned char filter)
|
|||
if(mode < 0x23)
|
||||
{
|
||||
|
||||
for(int i=0; i < ui->modeSelectCombo->count(); i++)
|
||||
// Update mode information if mode/filter has changed
|
||||
if (currentModeInfo.mk != (mode_kind)mode || currentModeInfo.filter != filter)
|
||||
{
|
||||
if(ui->modeSelectCombo->itemData(i).toInt() == mode)
|
||||
{
|
||||
ui->modeSelectCombo->blockSignals(true);
|
||||
ui->modeSelectCombo->setCurrentIndex(i);
|
||||
ui->modeSelectCombo->blockSignals(false);
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
currentModeIndex = mode;
|
||||
currentModeInfo.mk = (mode_kind)mode;
|
||||
cw->handleCurrentModeUpdate((mode_kind)mode);
|
||||
currentModeInfo.filter = filter;
|
||||
|
||||
switch (currentModeInfo.mk) {
|
||||
case modeFM:
|
||||
if (currentModeInfo.filter == 1)
|
||||
passbandWidth = 0.015;
|
||||
else if (currentModeInfo.filter == 2)
|
||||
passbandWidth = 0.010;
|
||||
else
|
||||
passbandWidth = 0.007;
|
||||
passbandCenterFrequency = 0.0;
|
||||
break;
|
||||
case modeLSB:
|
||||
case modeUSB:
|
||||
removePeriodicCommand(cmdGetCwPitch);
|
||||
removePeriodicCommand(cmdGetPskTone);
|
||||
removePeriodicCommand(cmdGetRttyMark);
|
||||
passbandCenterFrequency = 0.0015;
|
||||
break;
|
||||
case modeCW:
|
||||
case modeCW_R:
|
||||
insertPeriodicCommandUnique(cmdGetCwPitch);
|
||||
removePeriodicCommand(cmdGetPskTone);
|
||||
removePeriodicCommand(cmdGetRttyMark);
|
||||
break;
|
||||
default:
|
||||
removePeriodicCommand(cmdGetCwPitch);
|
||||
removePeriodicCommand(cmdGetPskTone);
|
||||
removePeriodicCommand(cmdGetRttyMark);
|
||||
passbandCenterFrequency = 0.0;
|
||||
break;
|
||||
removePeriodicRapidCmd(cmdGetCwPitch);
|
||||
quint16 maxPassbandHz = 0;
|
||||
switch ((mode_kind)mode) {
|
||||
case modeFM:
|
||||
if (filter == 1)
|
||||
passbandWidth = 0.015;
|
||||
else if (filter == 2)
|
||||
passbandWidth = 0.010;
|
||||
else
|
||||
passbandWidth = 0.007;
|
||||
passbandCenterFrequency = 0.0;
|
||||
maxPassbandHz = 10E3;
|
||||
break;
|
||||
case modeCW:
|
||||
case modeCW_R:
|
||||
insertPeriodicRapidCmdUnique(cmdGetCwPitch);
|
||||
maxPassbandHz = 3600;
|
||||
break;
|
||||
case modeAM:
|
||||
passbandCenterFrequency = 0.0;
|
||||
maxPassbandHz = 10E3;
|
||||
break;
|
||||
case modeLSB:
|
||||
case modeUSB:
|
||||
passbandCenterFrequency = 0.0015;
|
||||
maxPassbandHz = 3600;
|
||||
break;
|
||||
default:
|
||||
passbandCenterFrequency = 0.0;
|
||||
maxPassbandHz = 3600;
|
||||
break;
|
||||
}
|
||||
|
||||
for (int i = 0; i < ui->modeSelectCombo->count(); i++)
|
||||
{
|
||||
if (ui->modeSelectCombo->itemData(i).toInt() == mode)
|
||||
{
|
||||
ui->modeSelectCombo->blockSignals(true);
|
||||
ui->modeSelectCombo->setCurrentIndex(i);
|
||||
ui->modeSelectCombo->blockSignals(false);
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
|
||||
if ((filter) && (filter < 4)) {
|
||||
ui->modeFilterCombo->blockSignals(true);
|
||||
ui->modeFilterCombo->setCurrentIndex(filter - 1);
|
||||
ui->modeFilterCombo->blockSignals(false);
|
||||
}
|
||||
|
||||
currentModeIndex = mode;
|
||||
currentModeInfo.mk = (mode_kind)mode;
|
||||
currentMode = (mode_kind)mode;
|
||||
currentModeInfo.filter = filter;
|
||||
currentModeInfo.reg = mode;
|
||||
rpt->handleUpdateCurrentMainMode(currentModeInfo);
|
||||
|
||||
if (!found)
|
||||
{
|
||||
qWarning(logSystem()) << __func__ << "Received mode " << mode << " but could not match to any index within the modeSelectCombo. ";
|
||||
return;
|
||||
}
|
||||
|
||||
if (maxPassbandHz != 0)
|
||||
{
|
||||
trxadj->setMaxPassband(maxPassbandHz);
|
||||
}
|
||||
|
||||
issueDelayedCommandUnique(cmdGetPassband);
|
||||
issueDelayedCommandUnique(cmdGetCwPitch);
|
||||
issueDelayedCommandUnique(cmdGetTPBFInner);
|
||||
issueDelayedCommandUnique(cmdGetTPBFOuter);
|
||||
|
||||
// Note: we need to know if the DATA mode is active to reach mode-D
|
||||
// some kind of queued query:
|
||||
if (rigCaps.hasDataModes && rigCaps.hasTransmit)
|
||||
{
|
||||
issueDelayedCommand(cmdGetDataMode);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
qCritical(logSystem()) << __func__ << "Invalid mode " << mode << " received. ";
|
||||
}
|
||||
|
||||
if(!found)
|
||||
{
|
||||
qWarning(logSystem()) << __func__ << "Received mode " << mode << " but could not match to any index within the modeSelectCombo. ";
|
||||
return;
|
||||
}
|
||||
|
||||
currentModeIndex = mode;
|
||||
currentModeInfo.mk = (mode_kind)mode;
|
||||
currentMode = (mode_kind)mode;
|
||||
currentModeInfo.filter = filter;
|
||||
currentModeInfo.reg = mode;
|
||||
rpt->handleUpdateCurrentMainMode(currentModeInfo);
|
||||
|
||||
if( (filter) && (filter < 4)){
|
||||
ui->modeFilterCombo->blockSignals(true);
|
||||
ui->modeFilterCombo->setCurrentIndex(filter-1);
|
||||
ui->modeFilterCombo->blockSignals(false);
|
||||
}
|
||||
|
||||
quint16 maxPassbandHz = 0;
|
||||
switch(currentMode)
|
||||
{
|
||||
case modeUSB:
|
||||
case modeLSB:
|
||||
case modeCW:
|
||||
case modeCW_R:
|
||||
case modePSK:
|
||||
case modePSK_R:
|
||||
maxPassbandHz = 3600;
|
||||
break;
|
||||
case modeRTTY:
|
||||
case modeRTTY_R:
|
||||
maxPassbandHz = 2700;
|
||||
break;
|
||||
case modeAM:
|
||||
maxPassbandHz = 10E3;
|
||||
break;
|
||||
case modeFM:
|
||||
maxPassbandHz = 10E3;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if(maxPassbandHz != 0)
|
||||
{
|
||||
trxadj->setMaxPassband(maxPassbandHz);
|
||||
}
|
||||
// Note: we need to know if the DATA mode is active to reach mode-D
|
||||
// some kind of queued query:
|
||||
if (rigCaps.hasDataModes && rigCaps.hasTransmit)
|
||||
{
|
||||
issueDelayedCommand(cmdGetDataMode);
|
||||
}
|
||||
}
|
||||
|
||||
void wfmain::receiveDataModeStatus(bool dataEnabled)
|
||||
|
@ -5742,7 +5796,9 @@ void wfmain::on_modeSelectCombo_activated(int index)
|
|||
}
|
||||
|
||||
issueCmd(cmdSetMode, mode);
|
||||
currentModeInfo = mode;
|
||||
issueDelayedCommand(cmdGetMode);
|
||||
|
||||
//currentModeInfo = mode;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -6284,6 +6340,11 @@ void wfmain::on_passwordTxt_textChanged(QString text)
|
|||
udpPrefs.password = text;
|
||||
}
|
||||
|
||||
void wfmain::on_audioDuplexCombo_currentIndexChanged(int value)
|
||||
{
|
||||
udpPrefs.halfDuplex = (bool)value;
|
||||
}
|
||||
|
||||
void wfmain::on_audioOutputCombo_currentIndexChanged(int value)
|
||||
{
|
||||
|
||||
|
@ -6437,6 +6498,7 @@ void wfmain::on_modeFilterCombo_activated(int index)
|
|||
m.mk = (mode_kind)newMode;
|
||||
m.reg = newMode;
|
||||
issueCmd(cmdSetMode, m);
|
||||
|
||||
//emit setMode(newMode, (unsigned char)filterSelection);
|
||||
}
|
||||
}
|
||||
|
@ -6698,22 +6760,46 @@ void wfmain::receivePassband(quint16 pass)
|
|||
|
||||
void wfmain::receiveCwPitch(unsigned char pitch) {
|
||||
if (currentModeInfo.mk == modeCW || currentModeInfo.mk == modeCW_R) {
|
||||
passbandCenterFrequency = (double)((((600 / 256) * pitch) + 300) / 1000000.0)/2.0;
|
||||
cwPitch = round((((600.0 / 255.0) * pitch) + 300) / 5.0) * 5.0;
|
||||
passbandCenterFrequency = cwPitch / 2000000.0;
|
||||
}
|
||||
//qDebug() << "CW" << pitch << "Pitch" << cwPitch;
|
||||
}
|
||||
|
||||
void wfmain::receiveTPBFInner(unsigned char level) {
|
||||
|
||||
/*
|
||||
* This is written like this as although PBT is supposed to be sent in 25Hz steps,
|
||||
* sometimes it sends the 'nearest' value. This results in math errors.
|
||||
* In CW mode, the value is also dependant on the CW Pitch setting
|
||||
*/
|
||||
qint16 shift = (qint16)(level - 128);
|
||||
TPBFInner = (double)(shift / 127.0) * (passbandWidth);
|
||||
//qDebug() << "Inner" << level;
|
||||
double tempVar = ceil((shift / 127.0) * passbandWidth * 20000.0) / 20000.0;
|
||||
// tempVar now contains value to the nearest 50Hz If CW mode, add/remove the cwPitch.
|
||||
double pitch = 0.0;
|
||||
if ((currentModeInfo.mk == modeCW || currentModeInfo.mk == modeCW_R) && passbandWidth > 0.0006)
|
||||
{
|
||||
pitch = (600.0 - cwPitch) / 1000000.0;
|
||||
}
|
||||
TPBFInner = round((tempVar + pitch) * 200000.0) / 200000.0; // Nearest 5Hz.
|
||||
//qDebug() << "Inner" << level << "TPBFInner" << TPBFInner;
|
||||
}
|
||||
|
||||
void wfmain::receiveTPBFOuter(unsigned char level) {
|
||||
|
||||
/*
|
||||
* This is written like this as although PBT is supposed to be sent in 25Hz steps,
|
||||
* sometimes it sends the 'nearest' value. This results in math errors.
|
||||
* In CW mode, the value is also dependant on the CW Pitch setting
|
||||
*/
|
||||
qint16 shift = (qint16)(level - 128);
|
||||
TPBFOuter = (double)(shift / 127.0) * (passbandWidth);
|
||||
/// qDebug() << "Outer" << level;
|
||||
double tempVar = ceil((shift / 127.0) * passbandWidth * 20000.0) / 20000.0;
|
||||
// tempVar now contains value to the nearest 50Hz If CW mode, add/remove the cwPitch.
|
||||
double pitch = 0.0;
|
||||
if ((currentModeInfo.mk == modeCW || currentModeInfo.mk == modeCW_R) && passbandWidth > 0.0006)
|
||||
{
|
||||
pitch = (600.0 - cwPitch) / 1000000.0;
|
||||
}
|
||||
TPBFOuter = round((tempVar + pitch) * 200000.0) / 200000.0; // Nearest 5Hz.
|
||||
//qDebug() << "Outer" << level << "TPBFOuter" << TPBFOuter;
|
||||
}
|
||||
|
||||
|
||||
|
|
6
wfmain.h
6
wfmain.h
|
@ -184,6 +184,7 @@ signals:
|
|||
void stopCW();
|
||||
void getKeySpeed();
|
||||
void setKeySpeed(unsigned char wpm);
|
||||
void setCwPitch(unsigned char pitch);
|
||||
void setCWBreakMode(unsigned char breakMode);
|
||||
void getCWBreakMode();
|
||||
|
||||
|
@ -459,6 +460,8 @@ private slots:
|
|||
|
||||
void on_passwordTxt_textChanged(QString text);
|
||||
|
||||
void on_audioDuplexCombo_currentIndexChanged(int value);
|
||||
|
||||
void on_audioOutputCombo_currentIndexChanged(int value);
|
||||
|
||||
void on_audioInputCombo_currentIndexChanged(int value);
|
||||
|
@ -1109,6 +1112,9 @@ private:
|
|||
double TPBFInner = 0.0;
|
||||
double TPBFOuter = 0.0;
|
||||
double passbandCenterFrequency = 0.0;
|
||||
double pbtDefault = 0.0;
|
||||
quint16 cwPitch = 600;
|
||||
|
||||
SERVERCONFIG serverConfig;
|
||||
void serverAddUserLine(const QString& user, const QString& pass, const int& type);
|
||||
|
||||
|
|
136
wfmain.ui
136
wfmain.ui
|
@ -6,7 +6,7 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>1082</width>
|
||||
<width>1063</width>
|
||||
<height>660</height>
|
||||
</rect>
|
||||
</property>
|
||||
|
@ -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">
|
||||
|
@ -1808,7 +1808,6 @@
|
|||
<font>
|
||||
<family>DejaVu Sans Mono</family>
|
||||
<pointsize>14</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
|
@ -2233,7 +2232,7 @@
|
|||
<item>
|
||||
<widget class="QStackedWidget" name="settingsStack">
|
||||
<property name="currentIndex">
|
||||
<number>1</number>
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="radioAccess">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_21">
|
||||
|
@ -2775,61 +2774,26 @@
|
|||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_15">
|
||||
<widget class="QLabel" name="label_51">
|
||||
<property name="text">
|
||||
<string>Audio Output </string>
|
||||
<string>Duplex</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="audioOutputCombo">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>120</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="accessibleName">
|
||||
<string>Audio Output Selector</string>
|
||||
</property>
|
||||
<widget class="QComboBox" name="audioDuplexCombo">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Full Duplex</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Half Duplex</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_18">
|
||||
<property name="text">
|
||||
<string>Audio Input</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="audioInputCombo">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>120</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="accessibleName">
|
||||
<string>Audio Input Selector</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_8">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>15</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_40">
|
||||
<property name="text">
|
||||
|
@ -2871,6 +2835,63 @@
|
|||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_47">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_15">
|
||||
<property name="text">
|
||||
<string>Audio Output </string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="audioOutputCombo">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>200</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="accessibleName">
|
||||
<string>Audio Output Selector</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_18">
|
||||
<property name="text">
|
||||
<string>Audio Input</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="audioInputCombo">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>200</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="accessibleName">
|
||||
<string>Audio Input Selector</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_37">
|
||||
<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>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -3409,8 +3430,8 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>858</width>
|
||||
<height>287</height>
|
||||
<width>579</width>
|
||||
<height>224</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
|
@ -5359,7 +5380,6 @@
|
|||
<widget class="QPushButton" name="exitBtn">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>50</weight>
|
||||
<bold>false</bold>
|
||||
</font>
|
||||
</property>
|
||||
|
@ -5378,8 +5398,8 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>1082</width>
|
||||
<height>21</height>
|
||||
<width>1063</width>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
|
@ -5407,7 +5427,7 @@
|
|||
<connections/>
|
||||
<buttongroups>
|
||||
<buttongroup name="pollingButtonGroup"/>
|
||||
<buttongroup name="underlayButtonGroup"/>
|
||||
<buttongroup name="buttonGroup"/>
|
||||
<buttongroup name="underlayButtonGroup"/>
|
||||
</buttongroups>
|
||||
</ui>
|
||||
|
|
Ładowanie…
Reference in New Issue