kopia lustrzana https://gitlab.com/eliggett/wfview
Various fixes
rodzic
6f1d4e24b7
commit
fd6d132fd3
83
cwsender.cpp
83
cwsender.cpp
|
@ -26,17 +26,15 @@ cwSender::~cwSender()
|
|||
|
||||
void cwSender::showEvent(QShowEvent *event)
|
||||
{
|
||||
(void)event;
|
||||
emit getCWSettings();
|
||||
QMainWindow::showEvent(event);
|
||||
(void)event;
|
||||
}
|
||||
|
||||
void cwSender::handleKeySpeed(unsigned char wpm)
|
||||
{
|
||||
//qDebug(logCW()) << "Told that current WPM is" << wpm;
|
||||
if ((wpm >= 6) && (wpm <= 48))
|
||||
{
|
||||
//qDebug(logCW()) << "Setting WPM UI control to" << wpm;
|
||||
ui->wpmSpin->blockSignals(true);
|
||||
ui->wpmSpin->setValue(wpm);
|
||||
ui->wpmSpin->blockSignals(false);
|
||||
|
@ -45,19 +43,23 @@ void cwSender::handleKeySpeed(unsigned char wpm)
|
|||
|
||||
void cwSender::handleDashRatio(unsigned char ratio)
|
||||
{
|
||||
if ((ratio >= 28) && (ratio <= 45))
|
||||
double calc = double(ratio/10);
|
||||
if ((calc >= 2.8) && (ratio <= 4.5))
|
||||
{
|
||||
ui->dashSpin->blockSignals(true);
|
||||
ui->dashSpin->setValue(double(ratio/10));
|
||||
ui->dashSpin->setValue(calc);
|
||||
ui->dashSpin->blockSignals(false);
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
if (cwPitch >= 300 && cwPitch <= 900)
|
||||
{
|
||||
ui->pitchSpin->blockSignals(true);
|
||||
ui->pitchSpin->setValue(cwPitch);
|
||||
ui->pitchSpin->blockSignals(false);
|
||||
}
|
||||
}
|
||||
|
||||
void cwSender::handleBreakInMode(unsigned char b)
|
||||
|
@ -82,16 +84,16 @@ void cwSender::handleCurrentModeUpdate(mode_kind mode)
|
|||
|
||||
void cwSender::textChanged(QString text)
|
||||
{
|
||||
if (ui->sendImmediateChk->isChecked())
|
||||
if (ui->sendImmediateChk->isChecked() && text.size() && text.back() == ' ')
|
||||
{
|
||||
if (text.back() == ' ')
|
||||
{
|
||||
int toSend = text.mid(0, 30).size();
|
||||
if (toSend > 0) {
|
||||
emit sendCW(text.mid(0, 30));
|
||||
ui->transcriptText->appendPlainText(text.mid(0, 30));
|
||||
ui->textToSendEdit->clearEditText();
|
||||
}
|
||||
int toSend = text.mid(0, 30).size();
|
||||
if (toSend > 0) {
|
||||
emit sendCW(text.mid(0, 30));
|
||||
ui->textToSendEdit->clearEditText();
|
||||
|
||||
ui->transcriptText->moveCursor(QTextCursor::End);
|
||||
ui->transcriptText->insertPlainText(text.mid(0, 30).toUpper());
|
||||
ui->transcriptText->moveCursor(QTextCursor::End);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -102,12 +104,22 @@ void cwSender::on_sendBtn_clicked()
|
|||
(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);
|
||||
|
||||
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);
|
||||
}
|
||||
|
@ -242,7 +254,10 @@ void cwSender::runMacroButton(int buttonNumber)
|
|||
emit sendCW(outText.mid(i,30));
|
||||
}
|
||||
|
||||
ui->transcriptText->appendPlainText(outText);
|
||||
ui->transcriptText->moveCursor(QTextCursor::End);
|
||||
ui->transcriptText->insertPlainText(outText.toUpper()+"\n");
|
||||
ui->transcriptText->moveCursor(QTextCursor::End);
|
||||
|
||||
ui->textToSendEdit->setFocus();
|
||||
|
||||
|
||||
|
@ -264,7 +279,7 @@ void cwSender::editMacroButton(int buttonNumber, QPushButton* btn)
|
|||
|
||||
QString newMacroText = QInputDialog::getText(this, "Macro Edit",
|
||||
prompt,
|
||||
QLineEdit::Normal, macroText[buttonNumber], &ok);
|
||||
QLineEdit::Normal, macroText[buttonNumber], &ok).toUpper();
|
||||
if(!ok)
|
||||
return;
|
||||
|
||||
|
@ -307,6 +322,26 @@ void cwSender::on_sequenceSpin_valueChanged(int newSeq)
|
|||
ui->textToSendEdit->setFocus();
|
||||
}
|
||||
|
||||
bool cwSender::getCutNumbers()
|
||||
{
|
||||
return ui->cutNumbersChk->isChecked();
|
||||
}
|
||||
|
||||
bool cwSender::getSendImmediate()
|
||||
{
|
||||
return ui->sendImmediateChk->isChecked();
|
||||
}
|
||||
|
||||
void cwSender::setCutNumbers(bool val)
|
||||
{
|
||||
ui->cutNumbersChk->setChecked(val);
|
||||
}
|
||||
|
||||
void cwSender::setSendImmediate(bool val)
|
||||
{
|
||||
ui->sendImmediateChk->setChecked(val);
|
||||
}
|
||||
|
||||
QStringList cwSender::getMacroText()
|
||||
{
|
||||
// This is for preference saving:
|
||||
|
|
|
@ -25,6 +25,11 @@ public:
|
|||
~cwSender();
|
||||
QStringList getMacroText();
|
||||
void setMacroText(QStringList macros);
|
||||
void setCutNumbers(bool val);
|
||||
void setSendImmediate(bool val);
|
||||
bool getCutNumbers();
|
||||
bool getSendImmediate();
|
||||
|
||||
signals:
|
||||
void sendCW(QString cwMessage);
|
||||
void stopCW();
|
||||
|
|
11
cwsender.ui
11
cwsender.ui
|
@ -6,7 +6,7 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>822</width>
|
||||
<width>835</width>
|
||||
<height>451</height>
|
||||
</rect>
|
||||
</property>
|
||||
|
@ -246,6 +246,9 @@
|
|||
<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>
|
||||
|
@ -348,6 +351,9 @@
|
|||
</item>
|
||||
<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>
|
||||
|
@ -357,6 +363,9 @@
|
|||
<property name="singleStep">
|
||||
<double>0.100000000000000</double>
|
||||
</property>
|
||||
<property name="stepType">
|
||||
<enum>QAbstractSpinBox::DefaultStepType</enum>
|
||||
</property>
|
||||
<property name="value">
|
||||
<double>3.000000000000000</double>
|
||||
</property>
|
||||
|
|
1
prefs.h
1
prefs.h
|
@ -70,6 +70,7 @@ struct preferences {
|
|||
QString clusterTcpPassword;
|
||||
int clusterTimeout;
|
||||
bool clusterSkimmerSpotsEnable;
|
||||
|
||||
};
|
||||
|
||||
#endif // PREFS_H
|
||||
|
|
|
@ -2437,6 +2437,8 @@ void wfmain::loadSettings()
|
|||
|
||||
// CW Memory Load:
|
||||
settings->beginGroup("Keyer");
|
||||
cw->setCutNumbers(settings->value("CutNumbers", false).toBool());
|
||||
cw->setSendImmediate(settings->value("SendImmediate", false).toBool());
|
||||
int numMemories = settings->beginReadArray("macros");
|
||||
if(numMemories==10)
|
||||
{
|
||||
|
@ -2965,6 +2967,8 @@ void wfmain::saveSettings()
|
|||
settings->endGroup();
|
||||
|
||||
settings->beginGroup("Keyer");
|
||||
settings->setValue("CutNumbers", cw->getCutNumbers());
|
||||
settings->setValue("SendImmediate", cw->getSendImmediate());
|
||||
QStringList macroList = cw->getMacroText();
|
||||
if(macroList.length() == 10)
|
||||
{
|
||||
|
@ -9503,4 +9507,4 @@ void wfmain::receiveUsbSettings(quint8 bright, quint8 orient, quint8 speed, quin
|
|||
prefs.usbSpeed = speed;
|
||||
prefs.usbTimeout = timeout;
|
||||
prefs.usbColor = color;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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>
|
|
@ -45,10 +45,10 @@
|
|||
<QtLastBackgroundBuild>2022-08-21T18:58:23.4329764Z</QtLastBackgroundBuild>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="QtSettings">
|
||||
<QtLastBackgroundBuild>2023-02-14T17:48:26.0594274Z</QtLastBackgroundBuild>
|
||||
<QtLastBackgroundBuild>2023-02-14T19:04:15.5036128Z</QtLastBackgroundBuild>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="QtSettings">
|
||||
<QtLastBackgroundBuild>2023-02-14T17:48:25.7629768Z</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-14T17:48:27.5731249Z</QtLastBackgroundBuild>
|
||||
<QtLastBackgroundBuild>2023-02-14T19:04:16.6120542Z</QtLastBackgroundBuild>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="QtSettings">
|
||||
<QtLastBackgroundBuild>2023-02-14T17:48:27.1219605Z</QtLastBackgroundBuild>
|
||||
<QtLastBackgroundBuild>2023-02-14T19:04:16.0046827Z</QtLastBackgroundBuild>
|
||||
</PropertyGroup>
|
||||
</Project>
|
Ładowanie…
Reference in New Issue