change PTT button toggle logic

1.2.0
PianetaRadio 2022-04-09 21:27:04 +02:00 zatwierdzone przez GitHub
rodzic 7539f8d9c6
commit 2e7641f8f4
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 4 dodań i 4 usunięć

Wyświetl plik

@ -420,7 +420,7 @@ void MainWindow::guiUpdate()
//* PTT & Meter //* PTT & Meter
if (rigGet.ptt == RIG_PTT_ON) if (rigGet.ptt == RIG_PTT_ON)
{ {
ui->pushButton_PTT->setChecked(true); //ui->pushButton_PTT->setChecked(true);
if (rigGet.vfoTx == rigGet.vfoSub) ui->label_vfoSub->setStyleSheet("QLabel {background-color: red}"); if (rigGet.vfoTx == rigGet.vfoSub) ui->label_vfoSub->setStyleSheet("QLabel {background-color: red}");
else ui->label_vfoMain->setStyleSheet("QLabel {background-color: red}"); else ui->label_vfoMain->setStyleSheet("QLabel {background-color: red}");
@ -431,7 +431,7 @@ void MainWindow::guiUpdate()
} }
else //RIG_PTT_OFF else //RIG_PTT_OFF
{ {
ui->pushButton_PTT->setChecked(false); //ui->pushButton_PTT->setChecked(false);
if (rigGet.vfoTx == rigGet.vfoSub) ui->label_vfoSub->setStyleSheet("QLabel {}"); if (rigGet.vfoTx == rigGet.vfoSub) ui->label_vfoSub->setStyleSheet("QLabel {}");
else ui->label_vfoMain->setStyleSheet("QLabel {}"); else ui->label_vfoMain->setStyleSheet("QLabel {}");
@ -580,12 +580,12 @@ void MainWindow::on_pushButton_Power_toggled(bool checked)
void MainWindow::on_pushButton_PTT_toggled(bool checked) void MainWindow::on_pushButton_PTT_toggled(bool checked)
{ {
if (checked && !rigGet.ptt) if (checked)
{ {
rigSet.ptt = RIG_PTT_ON; rigSet.ptt = RIG_PTT_ON;
rigCmd.ptt = 1; rigCmd.ptt = 1;
} }
else if (!checked && rigGet.ptt) else //!checked
{ {
rigSet.ptt = RIG_PTT_OFF; rigSet.ptt = RIG_PTT_OFF;
rigCmd.ptt = 1; rigCmd.ptt = 1;