From fe7ef9ada898c17f0c4523dc5f0194fe1bba68e7 Mon Sep 17 00:00:00 2001 From: Mitchell Winkle Date: Thu, 15 Dec 2022 16:46:48 -0500 Subject: [PATCH] minor updates --- picokeyer.cpp | 15 ++++++--------- picokeyer.h | 3 +-- picokeyer.ui | 39 +++++++++++++++++---------------------- 3 files changed, 24 insertions(+), 33 deletions(-) diff --git a/picokeyer.cpp b/picokeyer.cpp index 078766a..7afad5d 100644 --- a/picokeyer.cpp +++ b/picokeyer.cpp @@ -46,8 +46,8 @@ void PicoKeyer::on_lineEdit_returnPressed() for(int i = 0; i < out.length(); i++) { sport->putChar(out.at(i).toLatin1()); } - ui->plainTextEdit->appendPlainText("SENDING: "); ui->plainTextEdit->moveCursor(QTextCursor::End); + ui->plainTextEdit->appendPlainText("SENDING: "); sport->putChar('\r'); sport->flush(); } @@ -66,6 +66,8 @@ void PicoKeyer::connectToKeyer() ui->plainTextEdit->moveCursor(QTextCursor::End); } }); + s_sport = s.value("serialPort", "ttyUSB0").toString(); + s.setValue("serialPort", s_sport); sport->setPortName(s_sport); if(sport->open(QIODevice::ReadWrite)) { ui->plainTextEdit->appendPlainText("SERIAL PORT " + s_sport + " OPENED"); @@ -150,7 +152,7 @@ void PicoKeyer::on_timeout() if(inbytes.length() > 0) { //qDebug()<<"inbytes:"<", "AR").replace("+", "KN"); inbytes.clear(); ui->plainTextEdit->insertPlainText(out); ui->plainTextEdit->moveCursor(QTextCursor::End); @@ -177,15 +179,10 @@ void PicoKeyer::on_updateConversationButton_clicked() ui->plainTextEdit->moveCursor(QTextCursor::End); } -void PicoKeyer::on_wpmDial_sliderReleased() +void PicoKeyer::on_wpmDial_valueChanged(int value) { // send the new value to the keyer as WPM i_wpm = ui->wpmDial->value(); setNewWPM(); - wpmLabel->setText(QString::number(i_wpm) + " WPM"); -} - -void PicoKeyer::on_wpmDial_valueChanged(int value) -{ - wpmLabel->setText(QString::number(value) + " WPM"); + wpmLabel->setText(QString::number(i_wpm) + " W"); } diff --git a/picokeyer.h b/picokeyer.h index c30754f..447deb1 100644 --- a/picokeyer.h +++ b/picokeyer.h @@ -31,7 +31,6 @@ private slots: void connectToKeyer(); void setNewWPM(); void on_updateConversationButton_clicked(); - void on_wpmDial_sliderReleased(); void on_wpmDial_valueChanged(int value); private: @@ -45,6 +44,6 @@ private slots: int i_interval = 2000; int i_baudRate = 115200; int i_wpm = 20; - QString s_sport = "COM3"; + QString s_sport = "ttyUSB0"; }; #endif // PICOKEYER_H diff --git a/picokeyer.ui b/picokeyer.ui index b120389..3b86643 100644 --- a/picokeyer.ui +++ b/picokeyer.ui @@ -76,31 +76,13 @@ padding:3px 3px; 3 - - - Drag the slider to set the Words Per Minute value - - - 5 - + 60 - - 15 - - - Qt::Horizontal - - - QSlider::NoTicks - - - 5 - - + @@ -122,7 +104,7 @@ padding:3px 3px; - + @@ -145,6 +127,19 @@ padding:3px 3px; + + + + Qt::Vertical + + + + 20 + 40 + + + + @@ -175,7 +170,7 @@ padding:3px 3px; 0 0 505 - 21 + 26