kopia lustrzana https://gitlab.com/eliggett/wfview
Merge branch 'sidetone'
commit
6049e1dee6
248
cwsender.cpp
248
cwsender.cpp
|
@ -1,6 +1,8 @@
|
|||
#include "cwsender.h"
|
||||
#include "ui_cwsender.h"
|
||||
|
||||
#include "logcategories.h"
|
||||
|
||||
cwSender::cwSender(QWidget *parent) :
|
||||
QMainWindow(parent),
|
||||
ui(new Ui::cwSender)
|
||||
|
@ -15,37 +17,86 @@ cwSender::cwSender(QWidget *parent) :
|
|||
ui->textToSendEdit->setFocus();
|
||||
ui->statusbar->setToolTipDuration(3000);
|
||||
this->setToolTipDuration(3000);
|
||||
connect(ui->textToSendEdit->lineEdit(), &QLineEdit::textEdited, this, &cwSender::textChanged);
|
||||
}
|
||||
|
||||
cwSender::~cwSender()
|
||||
{
|
||||
qDebug(logCW()) << "Running CW Sender destructor.";
|
||||
|
||||
if (toneThread != Q_NULLPTR) {
|
||||
toneThread->quit();
|
||||
toneThread->wait();
|
||||
toneThread = Q_NULLPTR;
|
||||
tone = Q_NULLPTR;
|
||||
/* Finally disconnect all connections */
|
||||
for (auto conn: connections)
|
||||
{
|
||||
disconnect(conn);
|
||||
}
|
||||
connections.clear();
|
||||
}
|
||||
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void cwSender::showEvent(QShowEvent *event)
|
||||
{
|
||||
emit getCWSettings();
|
||||
(void)event;
|
||||
emit getCWSettings();
|
||||
QMainWindow::showEvent(event);
|
||||
}
|
||||
|
||||
void cwSender::handleKeySpeed(unsigned char wpm)
|
||||
{
|
||||
//qDebug(logCW()) << "Told that current WPM is" << wpm;
|
||||
if((wpm >= 6) && (wpm <=48))
|
||||
if (wpm != ui->wpmSpin->value() && (wpm >= ui->wpmSpin->minimum()) && (wpm <= ui->wpmSpin->maximum()))
|
||||
{
|
||||
//qDebug(logCW()) << "Setting WPM UI control to" << wpm;
|
||||
ui->wpmSpin->blockSignals(true);
|
||||
ui->wpmSpin->setValue(wpm);
|
||||
QMetaObject::invokeMethod(ui->wpmSpin, "setValue", Qt::QueuedConnection, Q_ARG(int, wpm));
|
||||
ui->wpmSpin->blockSignals(false);
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5,10,0))
|
||||
QMetaObject::invokeMethod(tone, [=]() {
|
||||
tone->setSpeed(wpm);
|
||||
}, Qt::QueuedConnection);
|
||||
#else
|
||||
emit setKeySpeed(ratio);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
void cwSender::handleDashRatio(unsigned char ratio)
|
||||
{
|
||||
double calc = double(ratio/10);
|
||||
if (calc != ui->dashSpin->value() && (calc >= ui->dashSpin->minimum()) && (ratio <= ui->dashSpin->maximum()))
|
||||
{
|
||||
ui->dashSpin->blockSignals(true);
|
||||
QMetaObject::invokeMethod(ui->dashSpin, "setValue", Qt::QueuedConnection, Q_ARG(double, calc));
|
||||
ui->dashSpin->blockSignals(false);
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5,10,0))
|
||||
QMetaObject::invokeMethod(tone, [=]() {
|
||||
tone->setRatio(ratio);
|
||||
}, Qt::QueuedConnection);
|
||||
#else
|
||||
emit setDashRatio(ratio);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
int cwPitch = round((((600.0 / 255.0) * pitch) + 300) / 5.0) * 5.0;
|
||||
if (cwPitch != ui->pitchSpin->value() && cwPitch >= ui->pitchSpin->minimum() && cwPitch <= ui->pitchSpin->maximum())
|
||||
{
|
||||
ui->pitchSpin->blockSignals(true);
|
||||
QMetaObject::invokeMethod(ui->pitchSpin, "setValue", Qt::QueuedConnection, Q_ARG(int, cwPitch));
|
||||
ui->pitchSpin->blockSignals(false);
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5,10,0))
|
||||
QMetaObject::invokeMethod(tone, [=]() {
|
||||
tone->setFrequency(pitch);
|
||||
}, Qt::QueuedConnection);
|
||||
#else
|
||||
emit setPitch(tone);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
void cwSender::handleBreakInMode(unsigned char b)
|
||||
|
@ -68,24 +119,56 @@ void cwSender::handleCurrentModeUpdate(mode_kind mode)
|
|||
}
|
||||
}
|
||||
|
||||
void cwSender::textChanged(QString text)
|
||||
{
|
||||
if (ui->sendImmediateChk->isChecked() && text.size() && text.back() == ' ')
|
||||
{
|
||||
int toSend = text.mid(0, 30).size();
|
||||
if (toSend > 0) {
|
||||
ui->textToSendEdit->clearEditText();
|
||||
ui->transcriptText->moveCursor(QTextCursor::End);
|
||||
ui->transcriptText->insertPlainText(text.mid(0, 30).toUpper());
|
||||
ui->transcriptText->moveCursor(QTextCursor::End);
|
||||
|
||||
emit sendCW(text.mid(0, 30));
|
||||
}
|
||||
if( (currentMode != modeCW) && (currentMode != modeCW_R) )
|
||||
{
|
||||
ui->statusbar->showMessage("Note: Mode needs to be set to CW or CW-R to send CW.", 3000);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void cwSender::on_sendBtn_clicked()
|
||||
{
|
||||
if( (ui->textToSendEdit->currentText().length() > 0) &&
|
||||
(ui->textToSendEdit->currentText().length() <= 30) )
|
||||
{
|
||||
emit sendCW(ui->textToSendEdit->currentText());
|
||||
ui->transcriptText->appendPlainText(ui->textToSendEdit->currentText());
|
||||
ui->textToSendEdit->addItem(ui->textToSendEdit->currentText());
|
||||
if (ui->textToSendEdit->count() > 5) {
|
||||
ui->textToSendEdit->removeItem(0);
|
||||
QString text = ui->textToSendEdit->currentText();
|
||||
|
||||
ui->transcriptText->moveCursor(QTextCursor::End);
|
||||
ui->transcriptText->insertPlainText(ui->textToSendEdit->currentText().toUpper()+"\n");
|
||||
ui->transcriptText->moveCursor(QTextCursor::End);
|
||||
if (!ui->sendImmediateChk->isChecked())
|
||||
{
|
||||
ui->textToSendEdit->addItem(ui->textToSendEdit->currentText());
|
||||
if (ui->textToSendEdit->count() > 5) {
|
||||
ui->textToSendEdit->removeItem(0);
|
||||
}
|
||||
ui->textToSendEdit->setCurrentIndex(-1);
|
||||
} else {
|
||||
ui->textToSendEdit->clearEditText();
|
||||
ui->textToSendEdit->clear();
|
||||
}
|
||||
ui->textToSendEdit->setCurrentIndex(-1);
|
||||
|
||||
ui->textToSendEdit->setFocus();
|
||||
ui->statusbar->showMessage("Sending CW", 3000);
|
||||
|
||||
emit sendCW(text);
|
||||
}
|
||||
if( (currentMode==modeCW) || (currentMode==modeCW_R) )
|
||||
|
||||
if( (currentMode != modeCW) && (currentMode != modeCW_R) )
|
||||
{
|
||||
} else {
|
||||
ui->statusbar->showMessage("Note: Mode needs to be set to CW or CW-R to send CW.", 3000);
|
||||
}
|
||||
}
|
||||
|
@ -114,12 +197,16 @@ void cwSender::on_wpmSpin_valueChanged(int wpm)
|
|||
emit setKeySpeed((unsigned char)wpm);
|
||||
}
|
||||
|
||||
void cwSender::on_dashSpin_valueChanged(double ratio)
|
||||
{
|
||||
emit setDashRatio((unsigned char)double(ratio * 10));
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -173,6 +260,56 @@ void cwSender::on_macro10btn_clicked()
|
|||
processMacroButton(10, ui->macro10btn);
|
||||
}
|
||||
|
||||
void cwSender::on_sidetoneEnableChk_clicked(bool clicked)
|
||||
{
|
||||
ui->sidetoneLevelSlider->setEnabled(clicked);
|
||||
if (clicked && toneThread == Q_NULLPTR)
|
||||
{
|
||||
toneThread = new QThread(this);
|
||||
toneThread->setObjectName("sidetone()");
|
||||
|
||||
tone = new cwSidetone(sidetoneLevel, ui->wpmSpin->value(),ui->pitchSpin->value(),ui->dashSpin->value(),this);
|
||||
tone->moveToThread(toneThread);
|
||||
toneThread->start();
|
||||
|
||||
connections.append(connect(toneThread, &QThread::finished,
|
||||
[=]() { tone->deleteLater(); }));
|
||||
connections.append(connect(this, &cwSender::sendCW,
|
||||
[=](const QString& text) { tone->send(text); ui->sidetoneEnableChk->setEnabled(false); }));
|
||||
connections.append(connect(this, &cwSender::setKeySpeed,
|
||||
[=](const unsigned char& wpm) { tone->setSpeed(wpm); }));
|
||||
connections.append(connect(this, &cwSender::setDashRatio,
|
||||
[=](const unsigned char& ratio) { tone->setRatio(ratio); }));
|
||||
connections.append(connect(this, &cwSender::setPitch,
|
||||
[=](const unsigned char& pitch) { tone->setFrequency(pitch); }));
|
||||
connections.append(connect(this, &cwSender::setLevel,
|
||||
[=](const unsigned char& level) { tone->setLevel(level); }));
|
||||
connections.append(connect(this, &cwSender::stopCW,
|
||||
[=]() { tone->stopSending(); }));
|
||||
connections.append(connect(tone, &cwSidetone::finished,
|
||||
[=]() { ui->sidetoneEnableChk->setEnabled(true); }));
|
||||
|
||||
} else if (!clicked && toneThread != Q_NULLPTR) {
|
||||
/* disconnect all connections */
|
||||
toneThread->quit();
|
||||
toneThread->wait();
|
||||
toneThread = Q_NULLPTR;
|
||||
tone = Q_NULLPTR;
|
||||
for (auto conn: connections)
|
||||
{
|
||||
disconnect(conn);
|
||||
}
|
||||
connections.clear();
|
||||
}
|
||||
}
|
||||
|
||||
void cwSender::on_sidetoneLevelSlider_valueChanged(int val)
|
||||
{
|
||||
sidetoneLevel = val;
|
||||
emit setLevel(val);
|
||||
}
|
||||
|
||||
|
||||
void cwSender::processMacroButton(int buttonNumber, QPushButton *btn)
|
||||
{
|
||||
if(ui->macroEditChk->isChecked())
|
||||
|
@ -189,19 +326,33 @@ void cwSender::runMacroButton(int buttonNumber)
|
|||
if(macroText[buttonNumber].isEmpty())
|
||||
return;
|
||||
QString outText;
|
||||
if(macroText[buttonNumber].contains("\%1"))
|
||||
if(macroText[buttonNumber].contains("%1"))
|
||||
{
|
||||
outText = macroText[buttonNumber].arg(sequenceNumber, 3, 10, QChar('0'));
|
||||
sequenceNumber++;
|
||||
ui->sequenceSpin->blockSignals(true);
|
||||
ui->sequenceSpin->setValue(sequenceNumber);
|
||||
QMetaObject::invokeMethod(ui->sequenceSpin, "setValue", Qt::QueuedConnection, Q_ARG(int, sequenceNumber));
|
||||
ui->sequenceSpin->blockSignals(false);
|
||||
} else {
|
||||
outText = macroText[buttonNumber];
|
||||
}
|
||||
emit sendCW(outText);
|
||||
ui->transcriptText->appendPlainText(outText);
|
||||
|
||||
if (ui->cutNumbersChk->isChecked())
|
||||
{
|
||||
outText.replace("0", "T");
|
||||
outText.replace("9", "N");
|
||||
}
|
||||
|
||||
ui->transcriptText->moveCursor(QTextCursor::End);
|
||||
ui->transcriptText->insertPlainText(outText.toUpper()+"\n");
|
||||
ui->transcriptText->moveCursor(QTextCursor::End);
|
||||
|
||||
for (int i = 0; i < outText.size(); i = i + 30) {
|
||||
emit sendCW(outText.mid(i,30));
|
||||
}
|
||||
|
||||
ui->textToSendEdit->setFocus();
|
||||
|
||||
|
||||
if( (currentMode==modeCW) || (currentMode==modeCW_R) )
|
||||
{
|
||||
|
@ -215,22 +366,22 @@ void cwSender::editMacroButton(int buttonNumber, QPushButton* btn)
|
|||
{
|
||||
bool ok;
|
||||
QString promptFirst = QString("Please enter the text for macro %1,\n"
|
||||
"up to 30 characters.\n").arg(buttonNumber);
|
||||
QString promptSecond = QString("You may use \"\%1\" to insert a sequence number.");
|
||||
"up to 60 characters.\n").arg(buttonNumber);
|
||||
QString promptSecond = QString("You may use \"%1\" to insert a sequence number.");
|
||||
QString prompt = promptFirst+promptSecond;
|
||||
|
||||
QString newMacroText = QInputDialog::getText(this, "Macro Edit",
|
||||
prompt,
|
||||
QLineEdit::Normal, macroText[buttonNumber], &ok);
|
||||
QLineEdit::Normal, macroText[buttonNumber], &ok).toUpper();
|
||||
if(!ok)
|
||||
return;
|
||||
|
||||
if(newMacroText.length() > 30)
|
||||
if (newMacroText.length() > 60)
|
||||
{
|
||||
QMessageBox msgBox;
|
||||
msgBox.setText(QString("The text entered was too long \n"
|
||||
"(max length is 30 characters).\n"
|
||||
"Your input was %1 characters.").arg(newMacroText.length()));
|
||||
"(max length is 60 characters).\n"
|
||||
"Your input was %1 characters.").arg(newMacroText.length()));
|
||||
msgBox.exec();
|
||||
this->raise();
|
||||
return;
|
||||
|
@ -264,6 +415,47 @@ void cwSender::on_sequenceSpin_valueChanged(int newSeq)
|
|||
ui->textToSendEdit->setFocus();
|
||||
}
|
||||
|
||||
bool cwSender::getCutNumbers()
|
||||
{
|
||||
return ui->cutNumbersChk->isChecked();
|
||||
}
|
||||
|
||||
bool cwSender::getSendImmediate()
|
||||
{
|
||||
return ui->sendImmediateChk->isChecked();
|
||||
}
|
||||
|
||||
bool cwSender::getSidetoneEnable()
|
||||
{
|
||||
return ui->sidetoneEnableChk->isChecked();
|
||||
}
|
||||
|
||||
int cwSender::getSidetoneLevel()
|
||||
{
|
||||
return ui->sidetoneLevelSlider->value();
|
||||
}
|
||||
|
||||
void cwSender::setCutNumbers(bool val)
|
||||
{
|
||||
ui->cutNumbersChk->setChecked(val);
|
||||
}
|
||||
|
||||
void cwSender::setSendImmediate(bool val)
|
||||
{
|
||||
ui->sendImmediateChk->setChecked(val);
|
||||
}
|
||||
|
||||
void cwSender::setSidetoneEnable(bool val)
|
||||
{
|
||||
ui->sidetoneEnableChk->setChecked(val);
|
||||
on_sidetoneEnableChk_clicked(val);
|
||||
}
|
||||
|
||||
void cwSender::setSidetoneLevel(int val)
|
||||
{
|
||||
QMetaObject::invokeMethod(ui->sidetoneLevelSlider, "setValue", Qt::QueuedConnection, Q_ARG(int, val));
|
||||
}
|
||||
|
||||
QStringList cwSender::getMacroText()
|
||||
{
|
||||
// This is for preference saving:
|
||||
|
|
36
cwsender.h
36
cwsender.h
|
@ -6,11 +6,11 @@
|
|||
#include <QFont>
|
||||
#include <QInputDialog>
|
||||
#include <QMessageBox>
|
||||
#include <QThread>
|
||||
#include <QList>
|
||||
#include <math.h>
|
||||
#include "cwsidetone.h"
|
||||
#include "wfviewtypes.h"
|
||||
#include "logcategories.h"
|
||||
|
||||
|
||||
|
||||
namespace Ui {
|
||||
class cwSender;
|
||||
|
@ -25,16 +25,32 @@ public:
|
|||
~cwSender();
|
||||
QStringList getMacroText();
|
||||
void setMacroText(QStringList macros);
|
||||
void setCutNumbers(bool val);
|
||||
void setSendImmediate(bool val);
|
||||
void setSidetoneEnable(bool val);
|
||||
void setSidetoneLevel(int val);
|
||||
bool getCutNumbers();
|
||||
bool getSendImmediate();
|
||||
bool getSidetoneEnable();
|
||||
int getSidetoneLevel();
|
||||
|
||||
signals:
|
||||
void sendCW(QString cwMessage);
|
||||
void stopCW();
|
||||
void setKeySpeed(unsigned char wpm);
|
||||
void setDashRatio(unsigned char ratio);
|
||||
void setPitch(unsigned char pitch);
|
||||
void setLevel(int level);
|
||||
void setBreakInMode(unsigned char b);
|
||||
void getCWSettings();
|
||||
void sidetone(QString text);
|
||||
void pitchChanged(int val);
|
||||
void dashChanged(int val);
|
||||
void wpmChanged(int val);
|
||||
|
||||
public slots:
|
||||
void handleKeySpeed(unsigned char wpm);
|
||||
void handleDashRatio(unsigned char ratio);
|
||||
void handlePitch(unsigned char pitch);
|
||||
void handleBreakInMode(unsigned char b);
|
||||
void handleCurrentModeUpdate(mode_kind mode);
|
||||
|
@ -47,10 +63,14 @@ private slots:
|
|||
|
||||
//void on_textToSendEdit_returnPressed();
|
||||
|
||||
void textChanged(QString text);
|
||||
|
||||
void on_breakinCombo_activated(int index);
|
||||
|
||||
void on_wpmSpin_valueChanged(int arg1);
|
||||
|
||||
void on_dashSpin_valueChanged(double arg1);
|
||||
|
||||
void on_pitchSpin_valueChanged(int arg1);
|
||||
|
||||
void on_macro1btn_clicked();
|
||||
|
@ -75,15 +95,25 @@ private slots:
|
|||
|
||||
void on_sequenceSpin_valueChanged(int arg1);
|
||||
|
||||
void on_sidetoneEnableChk_clicked(bool clicked);
|
||||
|
||||
void on_sidetoneLevelSlider_valueChanged(int val);
|
||||
|
||||
private:
|
||||
Ui::cwSender *ui;
|
||||
QString macroText[11];
|
||||
int sequenceNumber = 1;
|
||||
int lastSentPos = 0;
|
||||
mode_kind currentMode;
|
||||
int sidetoneLevel=0;
|
||||
void processMacroButton(int buttonNumber, QPushButton *btn);
|
||||
void runMacroButton(int buttonNumber);
|
||||
void editMacroButton(int buttonNumber, QPushButton *btn);
|
||||
void setMacroButtonText(QString btnText, QPushButton *btn);
|
||||
cwSidetone* tone=Q_NULLPTR;
|
||||
QThread* toneThread = Q_NULLPTR;
|
||||
bool sidetoneWasEnabled=false;
|
||||
QList<QMetaObject::Connection> connections;
|
||||
};
|
||||
|
||||
#endif // CWSENDER_H
|
||||
|
|
310
cwsender.ui
310
cwsender.ui
|
@ -6,7 +6,7 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>886</width>
|
||||
<width>835</width>
|
||||
<height>451</height>
|
||||
</rect>
|
||||
</property>
|
||||
|
@ -177,7 +177,140 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="3">
|
||||
<item row="1" column="1">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="QPushButton" name="stopBtn">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Stop sending CW</string>
|
||||
</property>
|
||||
<property name="autoFillBackground">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Stop</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="text">
|
||||
<string>Local Sidetone Level</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSlider" name="sidetoneLevelSlider">
|
||||
<property name="maximum">
|
||||
<number>100</number>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="sidetoneEnableChk">
|
||||
<property name="text">
|
||||
<string>Enable</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QPushButton" name="sendBtn">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Send</string>
|
||||
</property>
|
||||
<property name="shortcut">
|
||||
<string>Return</string>
|
||||
</property>
|
||||
<property name="default">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="textToSendEdit">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Type here to send text as CW</string>
|
||||
</property>
|
||||
<property name="inputMethodHints">
|
||||
<set>Qt::ImhUppercaseOnly</set>
|
||||
</property>
|
||||
<property name="editable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="currentText">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<property name="insertPolicy">
|
||||
<enum>QComboBox::InsertAtTop</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="3" colspan="2">
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetMinimumSize</enum>
|
||||
|
@ -210,42 +343,20 @@
|
|||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLabel" name="label">
|
||||
<item row="1" column="2">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>WPM:</string>
|
||||
<string>PITCH (Hz):</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">
|
||||
<item row="1" column="1">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Break In</string>
|
||||
<string>WPM:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
|
@ -274,99 +385,80 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>PITCH (Hz):</string>
|
||||
<string>Break In</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="spacerLabel">
|
||||
<property name="text">
|
||||
<string/>
|
||||
<item row="3" column="3">
|
||||
<widget class="QDoubleSpinBox" name="dashSpin">
|
||||
<property name="decimals">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<double>2.800000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>4.500000000000000</double>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>0.100000000000000</double>
|
||||
</property>
|
||||
<property name="stepType">
|
||||
<enum>QAbstractSpinBox::DefaultStepType</enum>
|
||||
</property>
|
||||
<property name="value">
|
||||
<double>3.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
<item row="1" column="3">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>Dash Ratio</string>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</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="rightMargin">
|
||||
<number>0</number>
|
||||
<property name="toolTip">
|
||||
<string>Set the Words Per Minute</string>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
<property name="minimum">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QPushButton" name="sendBtn">
|
||||
<property name="text">
|
||||
<string>Send</string>
|
||||
</property>
|
||||
<property name="shortcut">
|
||||
<string>Return</string>
|
||||
</property>
|
||||
<property name="default">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="stopBtn">
|
||||
<property name="toolTip">
|
||||
<string>Stop sending CW</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Stop</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="textToSendEdit">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Type here to send text as CW</string>
|
||||
</property>
|
||||
<property name="editable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="currentText">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<property name="insertPolicy">
|
||||
<enum>QComboBox::InsertAtTop</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
<property name="maximum">
|
||||
<number>48</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>20</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="4">
|
||||
<widget class="QCheckBox" name="cutNumbersChk">
|
||||
<property name="text">
|
||||
<string>Cut Num</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="4">
|
||||
<widget class="QCheckBox" name="sendImmediateChk">
|
||||
<property name="text">
|
||||
<string>Send Immed</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
|
|
|
@ -0,0 +1,308 @@
|
|||
#include "cwsidetone.h"
|
||||
|
||||
#include "logcategories.h"
|
||||
|
||||
cwSidetone::cwSidetone(int level, int speed, int freq, double ratio, QWidget* parent) :
|
||||
parent(parent),
|
||||
volume(level),
|
||||
speed(speed),
|
||||
frequency(freq),
|
||||
ratio(ratio)
|
||||
{
|
||||
|
||||
/*
|
||||
* Characters to match Icom table
|
||||
* Unknown characters will return '?'
|
||||
*/
|
||||
cwTable.clear();
|
||||
cwTable['0'] = "-----";
|
||||
cwTable['1'] = ".----";
|
||||
cwTable['2'] = "..---";
|
||||
cwTable['3'] = "...--";
|
||||
cwTable['4'] = "....-";
|
||||
cwTable['5'] = ".....";
|
||||
cwTable['6'] = "-....";
|
||||
cwTable['7'] = "--...";
|
||||
cwTable['8'] = "---..";
|
||||
cwTable['9'] = "----.";
|
||||
|
||||
cwTable['A'] = ".-";
|
||||
cwTable['B'] = "-...";
|
||||
cwTable['C'] = "-.-.";
|
||||
cwTable['D'] = "-..";
|
||||
cwTable['E'] = ".";
|
||||
cwTable['F'] = "..-.";
|
||||
cwTable['G'] = "--.";
|
||||
cwTable['H'] = "....";
|
||||
cwTable['I'] = "..";
|
||||
cwTable['J'] = ".---";
|
||||
cwTable['K'] = "-.-";
|
||||
cwTable['L'] = ".-..";
|
||||
cwTable['M'] = "--";
|
||||
cwTable['N'] = "-.";
|
||||
cwTable['O'] = "---";
|
||||
cwTable['P'] = ".--.";
|
||||
cwTable['Q'] = "--.-";
|
||||
cwTable['R'] = ".-.";
|
||||
cwTable['S'] = "...";
|
||||
cwTable['T'] = "-";
|
||||
cwTable['U'] = "..-";
|
||||
cwTable['V'] = "...-";
|
||||
cwTable['W'] = ".--";
|
||||
cwTable['X'] = "-..-";
|
||||
cwTable['Y'] = "-.--";
|
||||
cwTable['Z'] = "--..";
|
||||
|
||||
cwTable['/'] = "-..-.";
|
||||
cwTable['?'] = "..--..";
|
||||
cwTable['.'] = ".-.-.-";
|
||||
cwTable['-'] = "-....-";
|
||||
cwTable[','] = "--..--";
|
||||
cwTable[':'] = "---...";
|
||||
cwTable['\''] = ".----.";
|
||||
cwTable['('] = "-.--.-";
|
||||
cwTable[')'] = "-.--.-";
|
||||
cwTable['='] = "-...-";
|
||||
cwTable['+'] = ".-.-.";
|
||||
cwTable['"'] = ".-..-.";
|
||||
|
||||
cwTable[' '] = " ";
|
||||
|
||||
init();
|
||||
}
|
||||
|
||||
cwSidetone::~cwSidetone()
|
||||
{
|
||||
qInfo(logCW()) << "cwSidetone() finished";
|
||||
this->stop();
|
||||
output->stop();
|
||||
}
|
||||
|
||||
void cwSidetone::init()
|
||||
{
|
||||
format.setSampleRate(44100);
|
||||
format.setChannelCount(1);
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(6,0,0))
|
||||
format.setCodec("audio/pcm");
|
||||
format.setSampleSize(16);
|
||||
format.setByteOrder(QAudioFormat::LittleEndian);
|
||||
format.setSampleType(QAudioFormat::SignedInt);
|
||||
QAudioDeviceInfo device(QAudioDeviceInfo::defaultOutputDevice());
|
||||
#else
|
||||
format.setSampleFormat(QAudioFormat::Int16);
|
||||
QAudioDevice device = QMediaDevices::defaultAudioOutput();
|
||||
#endif
|
||||
if (!device.isNull()) {
|
||||
if (!device.isFormatSupported(format)) {
|
||||
qWarning(logCW()) << "Default format not supported, using preferred";
|
||||
format = device.preferredFormat();
|
||||
}
|
||||
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(6,0,0))
|
||||
output.reset(new QAudioOutput(device,format));
|
||||
#else
|
||||
output.reset(new QAudioSink(device,format));
|
||||
#endif
|
||||
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(6,0,0))
|
||||
qInfo(logCW()) << QString("Sidetone Output: %0 (volume: %1 rate: %2 size: %3 type: %4)")
|
||||
.arg(device.deviceName()).arg(volume).arg(format.sampleRate()).arg(format.sampleSize()).arg(format.sampleType());
|
||||
#else
|
||||
qInfo(logCW()) << QString("Sidetone Output: %0 (volume: %1 rate: %2 type: %3")
|
||||
.arg(device.description()).arg(volume).arg(format.sampleRate()).arg(format.sampleFormat());
|
||||
#endif
|
||||
}
|
||||
this->start(); // Start QIODevice
|
||||
}
|
||||
|
||||
void cwSidetone::send(QString text)
|
||||
{
|
||||
text=text.simplified();
|
||||
|
||||
for (int pos=0; pos < text.size(); pos++)
|
||||
{
|
||||
QChar ch = text.at(pos).toUpper();
|
||||
QString currentChar;
|
||||
if (ch == NULL)
|
||||
{
|
||||
currentChar = cwTable[' '];
|
||||
}
|
||||
else if (this->cwTable.contains(ch))
|
||||
{
|
||||
currentChar = cwTable[ch];
|
||||
}
|
||||
else
|
||||
{
|
||||
currentChar=cwTable['?'];
|
||||
}
|
||||
generateMorse(currentChar);
|
||||
}
|
||||
|
||||
if (output->state() == QAudio::StoppedState)
|
||||
{
|
||||
output->start(this);
|
||||
}
|
||||
else if (output->state() == QAudio::IdleState) {
|
||||
output->suspend();
|
||||
output->resume();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
void cwSidetone::start()
|
||||
{
|
||||
open(QIODevice::ReadOnly);
|
||||
}
|
||||
|
||||
void cwSidetone::stop()
|
||||
{
|
||||
close();
|
||||
}
|
||||
|
||||
qint64 cwSidetone::readData(char *data, qint64 len)
|
||||
{
|
||||
QMutexLocker locker(&mutex);
|
||||
const qint64 total = qMin(((qint64)buffer.size()), len);
|
||||
memcpy(data, buffer.constData(), total);
|
||||
buffer.remove(0,total);
|
||||
if (buffer.size() == 0) {
|
||||
emit finished();
|
||||
}
|
||||
return total;
|
||||
}
|
||||
|
||||
qint64 cwSidetone::writeData(const char *data, qint64 len)
|
||||
{
|
||||
Q_UNUSED(data);
|
||||
Q_UNUSED(len);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
qint64 cwSidetone::bytesAvailable() const
|
||||
{
|
||||
return buffer.size() + QIODevice::bytesAvailable();
|
||||
}
|
||||
|
||||
void cwSidetone::generateMorse(QString morse)
|
||||
{
|
||||
|
||||
int dit = int(double(SIDETONE_MULTIPLIER / this->speed * SIDETONE_MULTIPLIER));
|
||||
int dah = int(double(dit * this->ratio));
|
||||
|
||||
|
||||
QMutexLocker locker(&mutex);
|
||||
for (int i=0;i<morse.size();i++)
|
||||
{
|
||||
QChar c = morse.at(i);
|
||||
if (c == '-')
|
||||
{
|
||||
buffer.append(generateData(dah,this->frequency));
|
||||
}
|
||||
else if (c == '.')
|
||||
{
|
||||
buffer.append(generateData(dit,this->frequency));
|
||||
}
|
||||
else // Space char
|
||||
{
|
||||
buffer.append(generateData(dit,0));
|
||||
}
|
||||
|
||||
if (i<morse.size()-1)
|
||||
{
|
||||
buffer.append(generateData(dit,0));
|
||||
}
|
||||
else
|
||||
{
|
||||
buffer.append(generateData(dit*3,0)); // inter-character space
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
QByteArray cwSidetone::generateData(qint64 len, qint64 freq)
|
||||
{
|
||||
QByteArray data;
|
||||
|
||||
const int channels = format.channelCount();
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(6,0,0))
|
||||
const int channelBytes = format.sampleSize() / 8;
|
||||
#else
|
||||
const int channelBytes = format.bytesPerSample();
|
||||
#endif
|
||||
|
||||
const int sampleRate = format.sampleRate();
|
||||
//qint64 length = (sampleRate * channels * channelBytes) * len / 100000;
|
||||
qint64 length = format.bytesForDuration(len);
|
||||
const int sampleBytes = channels * channelBytes;
|
||||
|
||||
length -= length % sampleBytes;
|
||||
Q_UNUSED(sampleBytes) // suppress warning in release builds
|
||||
|
||||
data.resize(length);
|
||||
unsigned char *ptr = reinterpret_cast<unsigned char *>(data.data());
|
||||
int sampleIndex = 0;
|
||||
|
||||
while (length) {
|
||||
const qreal x = (qSin(2 * M_PI * freq * qreal(sampleIndex % sampleRate) / sampleRate)) * qreal(volume/100.0);
|
||||
for (int i=0; i<channels; ++i) {
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(6,0,0))
|
||||
if (format.sampleSize() == 8 && format.sampleType() == QAudioFormat::UnSignedInt)
|
||||
*reinterpret_cast<quint8 *>(ptr) = static_cast<quint8>((1.0 + x) / 2 * 255);
|
||||
else if (format.sampleSize() == 16 && format.sampleType() == QAudioFormat::SignedInt)
|
||||
*reinterpret_cast<qint16 *>(ptr) = static_cast<qint16>(x * std::numeric_limits<qint16>::max());
|
||||
else if (format.sampleSize() == 32 && format.sampleType() == QAudioFormat::SignedInt)
|
||||
*reinterpret_cast<qint32 *>(ptr) = static_cast<qint32>(x * std::numeric_limits<qint32>::max());
|
||||
else if (format.sampleType() == QAudioFormat::Float)
|
||||
*reinterpret_cast<float *>(ptr) = x;
|
||||
else
|
||||
qWarning(logCW()) << QString("Unsupported sample size: %0 type: %1").arg(format.sampleSize()).arg(format.sampleType());
|
||||
#else
|
||||
if (format.sampleFormat() == QAudioFormat::UInt8)
|
||||
*reinterpret_cast<quint8 *>(ptr) = static_cast<quint8>((1.0 + x) / 2 * 255);
|
||||
else if (format.sampleFormat() == QAudioFormat::Int16)
|
||||
*reinterpret_cast<qint16 *>(ptr) = static_cast<qint16>(x * std::numeric_limits<qint16>::max());
|
||||
else if (format.sampleFormat() == QAudioFormat::Int32)
|
||||
*reinterpret_cast<qint32 *>(ptr) = static_cast<qint32>(x * std::numeric_limits<qint32>::max());
|
||||
else if (format.sampleFormat() == QAudioFormat::Float)
|
||||
*reinterpret_cast<float *>(ptr) = x;
|
||||
else
|
||||
qWarning(logCW()) << QString("Unsupported sample format: %0").arg(format.sampleFormat());
|
||||
#endif
|
||||
|
||||
ptr += channelBytes;
|
||||
length -= channelBytes;
|
||||
}
|
||||
++sampleIndex;
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
void cwSidetone::setSpeed(unsigned char speed)
|
||||
{
|
||||
this->speed = (int)speed;
|
||||
}
|
||||
|
||||
void cwSidetone::setFrequency(unsigned char frequency)
|
||||
{
|
||||
this->frequency = round((((600.0 / 255.0) * frequency) + 300) / 5.0) * 5.0;
|
||||
}
|
||||
|
||||
void cwSidetone::setRatio(unsigned char ratio)
|
||||
{
|
||||
this->ratio = (double)ratio/10.0;
|
||||
}
|
||||
|
||||
void cwSidetone::setLevel(int level) {
|
||||
volume = level;
|
||||
}
|
||||
|
||||
void cwSidetone::stopSending() {
|
||||
QMutexLocker locker(&mutex);
|
||||
buffer.clear();
|
||||
emit finished();
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,69 @@
|
|||
#ifndef CWSIDETONE_H
|
||||
#define CWSIDETONE_H
|
||||
|
||||
#include <QApplication>
|
||||
#include <QAudioOutput>
|
||||
#include <QMap>
|
||||
#include <QScopedPointer>
|
||||
#include <QtMath>
|
||||
#include <QMutex>
|
||||
#include <QMutexLocker>
|
||||
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(6,0,0))
|
||||
#include <QAudioDeviceInfo>
|
||||
#include <QAudioOutput>
|
||||
#else
|
||||
#include <QAudioDevice>
|
||||
#include <QAudioSink>
|
||||
#include <QMediaDevices>
|
||||
#endif
|
||||
|
||||
//#define SIDETONE_MULTIPLIER 386.0
|
||||
#define SIDETONE_MULTIPLIER 1095.46
|
||||
|
||||
class cwSidetone : public QIODevice
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit cwSidetone(int level, int speed, int freq, double ratio, QWidget *parent = 0);
|
||||
~cwSidetone();
|
||||
|
||||
void start();
|
||||
void stop();
|
||||
|
||||
qint64 readData(char *data, qint64 maxlen) override;
|
||||
qint64 writeData(const char *data, qint64 len) override;
|
||||
qint64 bytesAvailable() const override;
|
||||
qint64 size() const override { return buffer.size(); }
|
||||
|
||||
signals:
|
||||
void finished();
|
||||
public slots:
|
||||
void send(QString text);
|
||||
void setSpeed(unsigned char speed);
|
||||
void setFrequency(unsigned char frequency);
|
||||
void setRatio(unsigned char ratio);
|
||||
void setLevel(int level);
|
||||
void stopSending();
|
||||
private:
|
||||
void init();
|
||||
|
||||
void generateMorse(QString morse);
|
||||
QByteArray generateData(qint64 len, qint64 freq);
|
||||
QByteArray buffer;
|
||||
QMap< QChar, QString> cwTable;
|
||||
QWidget* parent;
|
||||
int volume;
|
||||
int speed;
|
||||
int frequency;
|
||||
double ratio;
|
||||
QAudioFormat format;
|
||||
QMutex mutex;
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(6,0,0))
|
||||
QScopedPointer<QAudioOutput> output;
|
||||
#else
|
||||
QScopedPointer<QAudioSink> output;
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif // CWSIDETONE_H
|
1
prefs.h
1
prefs.h
|
@ -70,6 +70,7 @@ struct preferences {
|
|||
QString clusterTcpPassword;
|
||||
int clusterTimeout;
|
||||
bool clusterSkimmerSpotsEnable;
|
||||
|
||||
};
|
||||
|
||||
#endif // PREFS_H
|
||||
|
|
|
@ -445,7 +445,7 @@ void repeaterSetup::showEvent(QShowEvent *event)
|
|||
emit getSplitModeEnabled();
|
||||
if(rig.hasRepeaterModes)
|
||||
emit getRptDuplexOffset();
|
||||
|
||||
QMainWindow::showEvent(event);
|
||||
(void)event;
|
||||
}
|
||||
|
||||
|
|
|
@ -1014,6 +1014,72 @@ void rigCommander::setCwPitch(unsigned char pitch)
|
|||
prepDataAndSend(payload);
|
||||
}
|
||||
|
||||
void rigCommander::getDashRatio()
|
||||
{
|
||||
QByteArray payload;
|
||||
switch (rigCaps.model)
|
||||
{
|
||||
case model705:
|
||||
payload.setRawData("\x1A\x05\x02\x52", 4);
|
||||
break;
|
||||
case model9700:
|
||||
payload.setRawData("\x1A\x05\x02\x24", 4);
|
||||
break;
|
||||
case model7100:
|
||||
payload.setRawData("\x1A\x05\x01\x35", 4);
|
||||
break;
|
||||
case model7300:
|
||||
payload.setRawData("\x1A\x05\x01\x61", 4);
|
||||
break;
|
||||
case model7610:
|
||||
payload.setRawData("\x1A\x05\x02\x28", 4);
|
||||
break;
|
||||
case model7700:
|
||||
payload.setRawData("\x1A\x05\x01\x34", 4);
|
||||
break;
|
||||
case model7850:
|
||||
payload.setRawData("\x1A\x05\x02\x51", 4);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
prepDataAndSend(payload);
|
||||
}
|
||||
|
||||
void rigCommander::setDashRatio(unsigned char ratio)
|
||||
{
|
||||
QByteArray payload;
|
||||
switch (rigCaps.model)
|
||||
{
|
||||
case model705:
|
||||
payload.setRawData("\x1A\x05\x02\x52", 4);
|
||||
break;
|
||||
case model9700:
|
||||
payload.setRawData("\x1A\x05\x02\x24", 4);
|
||||
break;
|
||||
case model7100:
|
||||
payload.setRawData("\x1A\x05\x01\x35", 4);
|
||||
break;
|
||||
case model7300:
|
||||
payload.setRawData("\x1A\x05\x01\x61", 4);
|
||||
break;
|
||||
case model7610:
|
||||
payload.setRawData("\x1A\x05\x02\x28", 4);
|
||||
break;
|
||||
case model7700:
|
||||
payload.setRawData("\x1A\x05\x01\x34", 4);
|
||||
break;
|
||||
case model7850:
|
||||
payload.setRawData("\x1A\x05\x02\x51", 4);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
payload.append(bcdEncodeInt(ratio).at(1)); // Discard first byte
|
||||
prepDataAndSend(payload);
|
||||
}
|
||||
|
||||
void rigCommander::getPskTone()
|
||||
{
|
||||
QByteArray payload;
|
||||
|
@ -1796,7 +1862,7 @@ void rigCommander::parseLevels()
|
|||
case '\x0C':
|
||||
state.set(KEYSPD, level, false);
|
||||
//qInfo(logRig()) << "Have received key speed in RC, raw level: " << level << ", WPM: " << (level/6.071)+6 << ", rounded: " << round((level/6.071)+6);
|
||||
emit haveKeySpeed(round((level/6.071)+6));
|
||||
emit haveKeySpeed(round((level / 6.071) + 6));
|
||||
break;
|
||||
case '\x0D':
|
||||
// Notch filder setting - ignore for now
|
||||
|
@ -3198,6 +3264,8 @@ void rigCommander::parseDetailedRegisters1A05()
|
|||
case 90:
|
||||
emit haveLANGain(level);
|
||||
break;
|
||||
case 228:
|
||||
emit haveDashRatio(inputRaw);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -5467,6 +5535,16 @@ void rigCommander::stateUpdated()
|
|||
}
|
||||
getDialLock();
|
||||
break;
|
||||
|
||||
case ANN:
|
||||
case APO:
|
||||
case BACKLIGHT:
|
||||
case BEEP:
|
||||
case TIME:
|
||||
case BAT:
|
||||
case KEYLIGHT:
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
++i;
|
||||
|
|
|
@ -129,6 +129,8 @@ public slots:
|
|||
void getPassband();
|
||||
void getCwPitch();
|
||||
void setCwPitch(unsigned char pitch);
|
||||
void getDashRatio();
|
||||
void setDashRatio(unsigned char ratio);
|
||||
void getPskTone();
|
||||
void setPskTone(unsigned char tone);
|
||||
void getRttyMark();
|
||||
|
@ -363,6 +365,7 @@ signals:
|
|||
// CW:
|
||||
void haveKeySpeed(unsigned char wpm);
|
||||
void haveCWBreakMode(unsigned char bmode);
|
||||
void haveDashRatio(unsigned char ratio);
|
||||
|
||||
|
||||
// Rig State
|
||||
|
|
77
wfmain.cpp
77
wfmain.cpp
|
@ -356,10 +356,13 @@ void wfmain::rigConnections()
|
|||
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(setDashRatio(unsigned char)), rig, SLOT(setDashRatio(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); });
|
||||
connect(this->rig, &rigCommander::haveDashRatio,
|
||||
[=](const unsigned char& ratio) { cw->handleDashRatio(ratio); });
|
||||
connect(this->rig, &rigCommander::haveCwPitch,
|
||||
[=](const unsigned char& speed) { cw->handlePitch(speed); });
|
||||
connect(this->rig, &rigCommander::haveCWBreakMode,
|
||||
|
@ -470,6 +473,7 @@ void wfmain::rigConnections()
|
|||
connect(this, SIGNAL(getPassband()), rig, SLOT(getPassband()));
|
||||
connect(this, SIGNAL(setPassband(quint16)), rig, SLOT(setPassband(quint16)));
|
||||
connect(this, SIGNAL(getCwPitch()), rig, SLOT(getCwPitch()));
|
||||
connect(this, SIGNAL(getDashRatio()), rig, SLOT(getDashRatio()));
|
||||
connect(this, SIGNAL(getPskTone()), rig, SLOT(getPskTone()));
|
||||
connect(this, SIGNAL(getRttyMark()), rig, SLOT(getRttyMark()));
|
||||
connect(this, SIGNAL(getTone()), rig, SLOT(getTone()));
|
||||
|
@ -1157,12 +1161,15 @@ void wfmain::setupMainUI()
|
|||
[=](const unsigned char &bmode) { issueCmd(cmdSetBreakMode, bmode);});
|
||||
connect(this->cw, &cwSender::setKeySpeed,
|
||||
[=](const unsigned char& wpm) { issueCmd(cmdSetKeySpeed, wpm); });
|
||||
connect(this->cw, &cwSender::setDashRatio,
|
||||
[=](const unsigned char& ratio) { issueCmd(cmdSetDashRatio, ratio); });
|
||||
connect(this->cw, &cwSender::setPitch,
|
||||
[=](const unsigned char& pitch) { issueCmd(cmdSetCwPitch, pitch); });
|
||||
connect(this->cw, &cwSender::getCWSettings,
|
||||
[=]() { issueDelayedCommand(cmdGetKeySpeed);
|
||||
issueDelayedCommand(cmdGetBreakMode);});
|
||||
|
||||
[=]() { issueDelayedCommand(cmdGetKeySpeed);
|
||||
issueDelayedCommand(cmdGetBreakMode);
|
||||
issueDelayedCommand(cmdGetCwPitch);
|
||||
issueDelayedCommand(cmdGetDashRatio); });
|
||||
}
|
||||
|
||||
void wfmain::prepareSettingsWindow()
|
||||
|
@ -2430,6 +2437,10 @@ void wfmain::loadSettings()
|
|||
|
||||
// CW Memory Load:
|
||||
settings->beginGroup("Keyer");
|
||||
cw->setCutNumbers(settings->value("CutNumbers", false).toBool());
|
||||
cw->setSendImmediate(settings->value("SendImmediate", false).toBool());
|
||||
cw->setSidetoneEnable(settings->value("SidetoneEnabled", true).toBool());
|
||||
cw->setSidetoneLevel(settings->value("SidetoneLevel", 100).toInt());
|
||||
int numMemories = settings->beginReadArray("macros");
|
||||
if(numMemories==10)
|
||||
{
|
||||
|
@ -2958,6 +2969,10 @@ void wfmain::saveSettings()
|
|||
settings->endGroup();
|
||||
|
||||
settings->beginGroup("Keyer");
|
||||
settings->setValue("CutNumbers", cw->getCutNumbers());
|
||||
settings->setValue("SendImmediate", cw->getSendImmediate());
|
||||
settings->setValue("SidetoneEnabled", cw->getSidetoneEnable());
|
||||
settings->setValue("SidetoneLevel", cw->getSidetoneLevel());
|
||||
QStringList macroList = cw->getMacroText();
|
||||
if(macroList.length() == 10)
|
||||
{
|
||||
|
@ -3980,6 +3995,12 @@ void wfmain::doCmd(commandtype cmddata)
|
|||
emit setCwPitch(pitch);
|
||||
break;
|
||||
}
|
||||
case cmdSetDashRatio:
|
||||
{
|
||||
unsigned char ratio = (*std::static_pointer_cast<unsigned char>(data));
|
||||
emit setDashRatio(ratio);
|
||||
break;
|
||||
}
|
||||
case cmdSetATU:
|
||||
{
|
||||
bool atuOn = (*std::static_pointer_cast<bool>(data));
|
||||
|
@ -4105,6 +4126,9 @@ void wfmain::doCmd(cmds cmd)
|
|||
case cmdGetCwPitch:
|
||||
emit getCwPitch();
|
||||
break;
|
||||
case cmdGetDashRatio:
|
||||
emit getDashRatio();
|
||||
break;
|
||||
case cmdGetPskTone:
|
||||
emit getPskTone();
|
||||
break;
|
||||
|
@ -4840,6 +4864,13 @@ void wfmain::initPeriodicCommands()
|
|||
rapidPollCmdQueueEnabled = false;
|
||||
rapidPollCmdQueue.clear();
|
||||
rapidPollCmdQueueEnabled = true;
|
||||
|
||||
if (rigCaps.hasSpectrum) {
|
||||
insertPeriodicRapidCmdUnique(cmdGetTPBFInner);
|
||||
insertPeriodicRapidCmdUnique(cmdGetTPBFOuter);
|
||||
insertPeriodicRapidCmdUnique(cmdGetPassband);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void wfmain::insertPeriodicRapidCmd(cmds cmd)
|
||||
|
@ -5675,10 +5706,7 @@ void wfmain::receiveMode(unsigned char mode, unsigned char filter)
|
|||
if (currentModeInfo.mk != (mode_kind)mode || currentModeInfo.filter != filter)
|
||||
{
|
||||
|
||||
removePeriodicRapidCmd(cmdGetCwPitch);
|
||||
removeSlowPeriodicCommand(cmdGetPassband);
|
||||
removeSlowPeriodicCommand(cmdGetTPBFInner);
|
||||
removeSlowPeriodicCommand(cmdGetTPBFOuter);
|
||||
// Remove all "Slow" commands (they will be added later if needed)
|
||||
|
||||
quint16 maxPassbandHz = 0;
|
||||
switch ((mode_kind)mode) {
|
||||
|
@ -5691,11 +5719,15 @@ void wfmain::receiveMode(unsigned char mode, unsigned char filter)
|
|||
passbandWidth = 0.007;
|
||||
passbandCenterFrequency = 0.0;
|
||||
maxPassbandHz = 10E3;
|
||||
removePeriodicRapidCmd(cmdGetPassband);
|
||||
removePeriodicRapidCmd(cmdGetTPBFInner);
|
||||
removePeriodicRapidCmd(cmdGetTPBFOuter);
|
||||
break;
|
||||
case modeCW:
|
||||
case modeCW_R:
|
||||
insertPeriodicRapidCmdUnique(cmdGetCwPitch);
|
||||
issueDelayedCommandUnique(cmdGetCwPitch);
|
||||
insertPeriodicRapidCmdUnique(cmdGetDashRatio);
|
||||
insertPeriodicRapidCmdUnique(cmdGetKeySpeed);
|
||||
maxPassbandHz = 3600;
|
||||
break;
|
||||
case modeAM:
|
||||
|
@ -5713,6 +5745,23 @@ void wfmain::receiveMode(unsigned char mode, unsigned char filter)
|
|||
break;
|
||||
}
|
||||
|
||||
if ((mode_kind)mode != modeFM && currentModeInfo.mk == modeFM)
|
||||
{
|
||||
/* mode was FM but now isn't so insert commands */
|
||||
insertPeriodicRapidCmdUnique(cmdGetPassband);
|
||||
insertPeriodicRapidCmdUnique(cmdGetTPBFInner);
|
||||
insertPeriodicRapidCmdUnique(cmdGetTPBFOuter);
|
||||
}
|
||||
|
||||
|
||||
if (((mode_kind)mode != modeCW && (mode_kind)mode != modeCW_R) && (currentModeInfo.mk == modeCW || currentModeInfo.mk == modeCW_R))
|
||||
{
|
||||
/* mode was CW/CWR but now isn't so remove CW commands */
|
||||
removePeriodicRapidCmd(cmdGetCwPitch);
|
||||
removePeriodicRapidCmd(cmdGetDashRatio);
|
||||
removePeriodicRapidCmd(cmdGetKeySpeed);
|
||||
}
|
||||
|
||||
for (int i = 0; i < ui->modeSelectCombo->count(); i++)
|
||||
{
|
||||
if (ui->modeSelectCombo->itemData(i).toInt() == mode)
|
||||
|
@ -5747,16 +5796,6 @@ void wfmain::receiveMode(unsigned char mode, unsigned char filter)
|
|||
{
|
||||
trxadj->setMaxPassband(maxPassbandHz);
|
||||
}
|
||||
|
||||
if (currentModeInfo.mk != modeFM)
|
||||
{
|
||||
insertSlowPeriodicCommand(cmdGetPassband, 128);
|
||||
insertSlowPeriodicCommand(cmdGetTPBFInner, 128);
|
||||
insertSlowPeriodicCommand(cmdGetTPBFOuter, 128);
|
||||
issueDelayedCommandUnique(cmdGetPassband);
|
||||
issueDelayedCommandUnique(cmdGetTPBFInner);
|
||||
issueDelayedCommandUnique(cmdGetTPBFOuter);
|
||||
}
|
||||
|
||||
// Note: we need to know if the DATA mode is active to reach mode-D
|
||||
// some kind of queued query:
|
||||
|
@ -9487,4 +9526,4 @@ void wfmain::receiveUsbSettings(quint8 bright, quint8 orient, quint8 speed, quin
|
|||
prefs.usbSpeed = speed;
|
||||
prefs.usbTimeout = timeout;
|
||||
prefs.usbColor = color;
|
||||
}
|
||||
}
|
||||
|
|
2
wfmain.h
2
wfmain.h
|
@ -141,6 +141,7 @@ signals:
|
|||
void getMeters(meterKind meter);
|
||||
void getPassband();
|
||||
void getCwPitch();
|
||||
void getDashRatio();
|
||||
void getPskTone();
|
||||
void getRttyMark();
|
||||
|
||||
|
@ -190,6 +191,7 @@ signals:
|
|||
void getKeySpeed();
|
||||
void setKeySpeed(unsigned char wpm);
|
||||
void setCwPitch(unsigned char pitch);
|
||||
void setDashRatio(unsigned char ratio);
|
||||
void setCWBreakMode(unsigned char breakMode);
|
||||
void getCWBreakMode();
|
||||
|
||||
|
|
|
@ -2,15 +2,15 @@
|
|||
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="QtSettings">
|
||||
<QtLastBackgroundBuild>2023-02-06T15:26:00.1276665Z</QtLastBackgroundBuild>
|
||||
<QtLastBackgroundBuild>2023-02-14T19:04:12.9338871Z</QtLastBackgroundBuild>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="QtSettings">
|
||||
<QtLastBackgroundBuild>2023-02-06T15:25:59.8598138Z</QtLastBackgroundBuild>
|
||||
<QtLastBackgroundBuild>2023-02-14T19:04:11.6802165Z</QtLastBackgroundBuild>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="QtSettings">
|
||||
<QtLastBackgroundBuild>2023-02-06T15:26:00.7293349Z</QtLastBackgroundBuild>
|
||||
<QtLastBackgroundBuild>2023-02-14T19:04:14.0213664Z</QtLastBackgroundBuild>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="QtSettings">
|
||||
<QtLastBackgroundBuild>2023-02-06T15:26:00.3825270Z</QtLastBackgroundBuild>
|
||||
<QtLastBackgroundBuild>2023-02-14T19:04:13.5068223Z</QtLastBackgroundBuild>
|
||||
</PropertyGroup>
|
||||
</Project>
|
|
@ -218,6 +218,7 @@ INCLUDEPATH += resampler
|
|||
|
||||
SOURCES += main.cpp\
|
||||
cwsender.cpp \
|
||||
cwsidetone.cpp \
|
||||
loggingwindow.cpp \
|
||||
wfmain.cpp \
|
||||
commhandler.cpp \
|
||||
|
@ -256,6 +257,7 @@ HEADERS += wfmain.h \
|
|||
colorprefs.h \
|
||||
commhandler.h \
|
||||
cwsender.h \
|
||||
cwsidetone.h \
|
||||
loggingwindow.h \
|
||||
prefs.h \
|
||||
printhex.h \
|
||||
|
|
|
@ -115,7 +115,7 @@
|
|||
<QtModules>core;gui;network;widgets;multimedia;printsupport;serialport;xml</QtModules>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="QtSettings">
|
||||
<QtInstall>msvc2019</QtInstall>
|
||||
<QtInstall>msvc2019_64_v62</QtInstall>
|
||||
<QtModules>core;gui;network;widgets;multimedia;printsupport;serialport;xml</QtModules>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
|
@ -123,7 +123,7 @@
|
|||
<QtModules>core;gui;network;widgets;multimedia;printsupport;serialport;xml</QtModules>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="QtSettings">
|
||||
<QtInstall>msvc2019</QtInstall>
|
||||
<QtInstall>msvc2019_64_v62</QtInstall>
|
||||
<QtModules>core;gui;network;widgets;multimedia;printsupport;serialport;xml</QtModules>
|
||||
</PropertyGroup>
|
||||
<ImportGroup Condition="Exists('$(QtMsBuild)\qt.props')">
|
||||
|
@ -131,7 +131,7 @@
|
|||
</ImportGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>.;..\hidapi\hidapi;..\rtaudio;..\portaudio\include;..\qcustomplot;..\opus\include;..\eigen;..\r8brain-free-src;resampler;release;/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>.;.\hidapi\hidapi;..\rtaudio;..\portaudio\include;..\qcustomplot;..\opus\include;..\eigen;..\r8brain-free-src;resampler;release;/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalOptions>-Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -permissive- -Zc:__cplusplus -Zc:externConstexpr -utf-8 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 %(AdditionalOptions)</AdditionalOptions>
|
||||
<AssemblerListingLocation>release\</AssemblerListingLocation>
|
||||
<BrowseInformation>false</BrowseInformation>
|
||||
|
@ -141,7 +141,7 @@
|
|||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
<ObjectFileName>release\</ObjectFileName>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>_WINDOWS;UNICODE;_UNICODE;WIN32;_ENABLE_EXTENDED_ALIGNED_STORAGE;WIN64;WFVIEW_VERSION="1.58";USB_CONTROLLER;BUILD_WFVIEW;__WINDOWS_WASAPI__;QT_DEPRECATED_WARNINGS;QCUSTOMPLOT_USE_LIBRARY;USE_SSE;USE_SSE2;OUTSIDE_SPEEX;RANDOM_PREFIX=wf;EIGEN_MPL2_ONLY;EIGEN_DONT_VECTORIZE;EIGEN_VECTORIZE_SSE3;PREFIX="/usr/local";GITSHORT="4574e2b";HOST="wfview.org";UNAME="build";NDEBUG;QT_NO_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_WINDOWS;UNICODE;_UNICODE;WIN32;_ENABLE_EXTENDED_ALIGNED_STORAGE;WIN64;WFVIEW_VERSION="1.55";BUILD_WFVIEW;__WINDOWS_WASAPI__;QT_DEPRECATED_WARNINGS;QCUSTOMPLOT_USE_LIBRARY;USE_SSE;USE_SSE2;OUTSIDE_SPEEX;RANDOM_PREFIX=wf;EIGEN_MPL2_ONLY;EIGEN_DONT_VECTORIZE;EIGEN_VECTORIZE_SSE3;PREFIX="/usr/local";GITSHORT="4574e2b";HOST="wfview.org";UNAME="build";NDEBUG;QT_NO_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessToFile>false</PreprocessToFile>
|
||||
<ProgramDataBaseFileName>
|
||||
</ProgramDataBaseFileName>
|
||||
|
@ -153,7 +153,7 @@
|
|||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>..\hidapi\windows\x64\Release\hidapi.lib;..\portaudio\msvc\X64\Release\portaudio_x64.lib;..\qcustomplot\x64\qcustomplot2.lib;..\opus\win32\VS2015\x64\Release\opus.lib;$(QTDIR)\lib\Qt6Multimedia.lib;$(QTDIR)\lib\Qt6PrintSupport.lib;$(QTDIR)\lib\Qt6Widgets.lib;$(QTDIR)\lib\Qt6Gui.lib;$(QTDIR)\lib\Qt6SerialPort.lib;$(QTDIR)\lib\Qt6Network.lib;$(QTDIR)\lib\Qt6Core.lib;$(QTDIR)\lib\Qt6EntryPoint.lib;shell32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>..\hidapi\windows\x64\Release;..\opus\win32\VS2015\x64\ReleaseDLL;..\qcustomplot\x64;..\portaudio\msvc\X64\Release;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalLibraryDirectories>..\hidapi\windows\x64\Release;..\opus\win32\VS2015\x64\Release;..\qcustomplot\x64;..\portaudio\msvc\X64\Release;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalOptions>"/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" %(AdditionalOptions)</AdditionalOptions>
|
||||
<DataExecutionPrevention>true</DataExecutionPrevention>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
|
@ -194,10 +194,8 @@
|
|||
<QtUicFileName>ui_%(Filename).h</QtUicFileName>
|
||||
</QtUic>
|
||||
<PostBuildEvent>
|
||||
<Command>cmd /c copy /y ..\hidapi\windows\x64\Debug\hidapi.dll wfview-debug
|
||||
cmd /c copy /y ..\qcustomplot\x64\qcustomplotd2.dll wfview-debug
|
||||
cmd /c copy /y ..\portaudio\msvc\x64\Debug\portaudio_x64.dll wfview-debug
|
||||
cmd /c copy /y ..\opus\win32\VS2015\x64\DebugDLL\opus.dll wfview-debug</Command>
|
||||
<Command>cmd /c copy /y ..\qcustomplot\x64\qcustomplot2.dll wfview-release\
|
||||
cmd /c copy /y ..\portaudio\msvc\x64\Release\portaudio_x64.dll wfview-release\</Command>
|
||||
</PostBuildEvent>
|
||||
<PostBuildEvent>
|
||||
<Message>Copy DLL Files</Message>
|
||||
|
@ -227,7 +225,7 @@ cmd /c copy /y ..\opus\win32\VS2015\x64\DebugDLL\opus.dll wfview-debug</Command>
|
|||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>..\portaudio\msvc\Win32\Release\portaudio_x86.lib;..\qcustomplot\Win32\qcustomplot2.lib;..\opus\win32\VS2015\Win32\Release\opus.lib;shell32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>..\hidapi\windows\Win32\Release;..\opus\win32\VS2015\Win32\ReleaseDLL;..\qcustomplot\Win32;..\portaudio\msvc\Win32\Release;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalLibraryDirectories>..\opus\win32\VS2015\Win32\Release;..\qcustomplot\Win32;..\portaudio\msvc\Win32\Release;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalOptions>"/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" %(AdditionalOptions)</AdditionalOptions>
|
||||
<DataExecutionPrevention>true</DataExecutionPrevention>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
|
@ -268,11 +266,8 @@ cmd /c copy /y ..\opus\win32\VS2015\x64\DebugDLL\opus.dll wfview-debug</Command>
|
|||
<QtUicFileName>ui_%(Filename).h</QtUicFileName>
|
||||
</QtUic>
|
||||
<PostBuildEvent>
|
||||
<Command>cmd /c copy /y ..\qcustomplot\Win32\qcustomplot2.dll wfview-release
|
||||
cmd /c copy /y ..\portaudio\msvc\Win32\Release\portaudio_x86.dll wfview-release
|
||||
cmd /c copy /y ..\hidapi\windows\Release\hidapi.dll wfview-release
|
||||
cmd /c copy /y ..\opus\win32\VS2015\win32\ReleaseDLL\opus.dll wfview-release
|
||||
</Command>
|
||||
<Command>cmd /c copy /y ..\qcustomplot\Win32\qcustomplot2.dll wfview-release\
|
||||
cmd /c copy /y ..\portaudio\msvc\Win32\Release\portaudio_x86.dll wfview-release\</Command>
|
||||
</PostBuildEvent>
|
||||
<PostBuildEvent>
|
||||
<Message>Copy DLL Files</Message>
|
||||
|
@ -280,7 +275,7 @@ cmd /c copy /y ..\opus\win32\VS2015\win32\ReleaseDLL\opus.dll wfview-release
|
|||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>.;..\rtaudio;..\portaudio\include;..\qcustomplot;..\opus\include;..\eigen;..\r8brain-free-src;resampler;debug;/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>.;.\hidapi\hidapi;..\rtaudio;..\portaudio\include;..\qcustomplot;..\opus\include;..\eigen;..\r8brain-free-src;resampler;debug;/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalOptions>-Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -permissive- -Zc:__cplusplus -Zc:externConstexpr -utf-8 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 %(AdditionalOptions)</AdditionalOptions>
|
||||
<AssemblerListingLocation>debug\</AssemblerListingLocation>
|
||||
<BrowseInformation>false</BrowseInformation>
|
||||
|
@ -300,8 +295,8 @@ cmd /c copy /y ..\opus\win32\VS2015\win32\ReleaseDLL\opus.dll wfview-release
|
|||
<LanguageStandard_C>stdc17</LanguageStandard_C>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>..\portaudio\msvc\X64\Debug\portaudio_x64.lib;..\qcustomplot\x64\qcustomplotd2.lib;..\opus\win32\VS2015\x64\Debug\opus.lib;$(QTDIR)\lib\Qt6Multimediad.lib;$(QTDIR)\lib\Qt6PrintSupportd.lib;$(QTDIR)\lib\Qt6Widgetsd.lib;$(QTDIR)\lib\Qt6Guid.lib;$(QTDIR)\lib\Qt6SerialPortd.lib;$(QTDIR)\lib\Qt6Networkd.lib;$(QTDIR)\lib\Qt6Cored.lib;$(QTDIR)\lib\Qt6EntryPointd.lib;shell32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>..\hidapi\windows\x64\Debug;..\opus\win32\VS2015\x64\DebugDLL;..\qcustomplot\x64;..\portaudio\msvc\X64\Debug;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>..\hidapi\windows\x64\Debug\hidapi.lib;..\portaudio\msvc\X64\Debug\portaudio_x64.lib;..\qcustomplot\x64\qcustomplotd2.lib;..\opus\win32\VS2015\x64\Debug\opus.lib;$(QTDIR)\lib\Qt6Multimediad.lib;$(QTDIR)\lib\Qt6PrintSupportd.lib;$(QTDIR)\lib\Qt6Widgetsd.lib;$(QTDIR)\lib\Qt6Guid.lib;$(QTDIR)\lib\Qt6SerialPortd.lib;$(QTDIR)\lib\Qt6Networkd.lib;$(QTDIR)\lib\Qt6Cored.lib;$(QTDIR)\lib\Qt6EntryPointd.lib;shell32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>..\hidapi\windows\x64\Debug;..\opus\win32\VS2015\x64\Debug;..\qcustomplot\x64;..\portaudio\msvc\X64\Debug;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalOptions>"/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" %(AdditionalOptions)</AdditionalOptions>
|
||||
<DataExecutionPrevention>true</DataExecutionPrevention>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
|
@ -367,7 +362,7 @@ cmd /c copy /y ..\portaudio\msvc\x64\Debug\portaudio_x64.dll wfview-debug</Comma
|
|||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>..\portaudio\msvc\Win32\Debug\portaudio_x86.lib;..\qcustomplot\Win32\qcustomplotd2.lib;..\opus\win32\VS2015\Win32\Debug\opus.lib;shell32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>..\hidapi\windows\Win32\Debug;..\opus\win32\VS2015\Win32\DebugDLL;..\qcustomplot\Win32;..\portaudio\msvc\Win32\Debug;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalLibraryDirectories>..\opus\win32\VS2015\Win32\Debug;..\qcustomplot\Win32;..\portaudio\msvc\Win32\Debug;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalOptions>"/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" %(AdditionalOptions)</AdditionalOptions>
|
||||
<DataExecutionPrevention>true</DataExecutionPrevention>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
|
@ -387,9 +382,7 @@ cmd /c copy /y ..\portaudio\msvc\x64\Debug\portaudio_x64.dll wfview-debug</Comma
|
|||
</ResourceCompile>
|
||||
<PostBuildEvent>
|
||||
<Command>cmd /c copy /y ..\qcustomplot\Win32\qcustomplotd2.dll wfview-debug
|
||||
cmd /c copy /y ..\portaudio\msvc\Win32\Debug\portaudio_x86.dll wfview-debug
|
||||
cmd /c copy /y ..\hidapi\windows\Debug\hidapi.dll wfview-debug
|
||||
cmd /c copy /y ..\opus\win32\VS2015\win32\DebugDLL\opus.dll wfview-debug</Command>
|
||||
cmd /c copy /y ..\portaudio\msvc\Win32\Debug\portaudio_x86.dll wfview-debug</Command>
|
||||
<Message>Copy DLL files</Message>
|
||||
</PostBuildEvent>
|
||||
<QtMoc>
|
||||
|
@ -451,8 +444,6 @@ cmd /c copy /y ..\opus\win32\VS2015\win32\DebugDLL\opus.dll wfview-debug</Comman
|
|||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\rtaudio\RTAUdio.h" />
|
||||
<ClInclude Include="prefs.h" />
|
||||
<ClInclude Include="rigstate.h" />
|
||||
<ClInclude Include="wfviewtypes.h" />
|
||||
<QtMoc Include="usbcontroller.h" />
|
||||
<QtMoc Include="aboutbox.h">
|
||||
|
|
|
@ -268,12 +268,6 @@
|
|||
<ClInclude Include="wfviewtypes.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="prefs.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="rigstate.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<CustomBuild Include="debug\moc_predefs.h.cbt">
|
||||
|
|
|
@ -45,10 +45,10 @@
|
|||
<QtLastBackgroundBuild>2022-08-21T18:58:23.4329764Z</QtLastBackgroundBuild>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="QtSettings">
|
||||
<QtLastBackgroundBuild>2023-02-07T17:43:48.5836323Z</QtLastBackgroundBuild>
|
||||
<QtLastBackgroundBuild>2023-02-14T19:04:15.5036128Z</QtLastBackgroundBuild>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="QtSettings">
|
||||
<QtLastBackgroundBuild>2023-02-07T17:43:48.3511159Z</QtLastBackgroundBuild>
|
||||
<QtLastBackgroundBuild>2023-02-14T19:04:14.6701614Z</QtLastBackgroundBuild>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<QtLastBackgroundBuild>2022-08-22T10:47:49.1255783Z</QtLastBackgroundBuild>
|
||||
|
@ -60,9 +60,9 @@
|
|||
<QtLastBackgroundBuild>2022-08-20T19:06:43.4553894Z</QtLastBackgroundBuild>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="QtSettings">
|
||||
<QtLastBackgroundBuild>2023-02-07T17:43:50.6894101Z</QtLastBackgroundBuild>
|
||||
<QtLastBackgroundBuild>2023-02-14T19:04:16.6120542Z</QtLastBackgroundBuild>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="QtSettings">
|
||||
<QtLastBackgroundBuild>2023-02-07T17:43:50.1277203Z</QtLastBackgroundBuild>
|
||||
<QtLastBackgroundBuild>2023-02-14T19:04:16.0046827Z</QtLastBackgroundBuild>
|
||||
</PropertyGroup>
|
||||
</Project>
|
|
@ -166,7 +166,7 @@ enum cmds {
|
|||
cmdSetRptAccessMode, cmdSetRptDuplexOffset, cmdGetRptDuplexOffset,
|
||||
cmdSelVFO, cmdVFOSwap, cmdVFOEqualAB, cmdVFOEqualMS, cmdSetQuickSplit,
|
||||
cmdGetPreamp, cmdGetAttenuator, cmdGetAntenna,
|
||||
cmdGetBandStackReg, cmdGetKeySpeed, cmdSetKeySpeed, cmdGetBreakMode, cmdSetBreakMode, cmdSendCW, cmdStopCW,
|
||||
cmdGetBandStackReg, cmdGetKeySpeed, cmdSetKeySpeed, cmdGetBreakMode, cmdSetBreakMode, cmdSendCW, cmdStopCW, cmdGetDashRatio, cmdSetDashRatio,
|
||||
cmdSetTime, cmdSetDate, cmdSetUTCOffset,
|
||||
// Below Only used for USB Controller at the moment.
|
||||
cmdSetBandUp, cmdSetBandDown, cmdSetModeUp, cmdSetModeDown, cmdSetStepUp, cmdSetStepDown, cmdSetSpanUp, cmdSetSpanDown, cmdIFFilterUp, cmdIFFilterDown
|
||||
|
|
Ładowanie…
Reference in New Issue