From 19a459f3fdf134822d09b69bb3efc013f8b9c6c9 Mon Sep 17 00:00:00 2001 From: Bambofy Date: Mon, 27 Jul 2020 09:14:13 +0100 Subject: [PATCH] implemented enable/disable transmissions --- FOSSAGSCP/include/Interpreter.h | 2 +- FOSSAGSCP/mainwindow.cpp | 15 ++- FOSSAGSCP/mainwindow.h | 2 + FOSSAGSCP/mainwindow.ui | 168 +++++++++++++++++++------------- FOSSAGSCP/src/Interpreter.cpp | 24 +++++ 5 files changed, 143 insertions(+), 68 deletions(-) diff --git a/FOSSAGSCP/include/Interpreter.h b/FOSSAGSCP/include/Interpreter.h index 53fb77e..499e4a2 100644 --- a/FOSSAGSCP/include/Interpreter.h +++ b/FOSSAGSCP/include/Interpreter.h @@ -95,7 +95,7 @@ class Interpreter : public QObject IGroundStationSerialMessage* Create_CMD_Deploy(); IGroundStationSerialMessage* Create_CMD_Restart(); IGroundStationSerialMessage *Create_CMD_Wipe_EEPROM(char flags); - IGroundStationSerialMessage* Create_CMD_Set_Transmit_Enable(); + IGroundStationSerialMessage* Create_CMD_Set_Transmit_Enable(char transmitEnabled, char autoStatsEnabled, char fskMandatedEnabled); IGroundStationSerialMessage* Create_CMD_Set_Callsign(); IGroundStationSerialMessage* Create_CMD_Set_SF_Mode(); IGroundStationSerialMessage* Create_CMD_Set_MPPT_Mode(); diff --git a/FOSSAGSCP/mainwindow.cpp b/FOSSAGSCP/mainwindow.cpp index 1dc5e47..eff611b 100644 --- a/FOSSAGSCP/mainwindow.cpp +++ b/FOSSAGSCP/mainwindow.cpp @@ -427,6 +427,8 @@ void MainWindow::on_SatelliteConfig_ADCs_Controller_Set_Button_clicked() + + static std::vector g_ephemeridesControllerStack; void MainWindow::on_Satelliteconfig_ADCs_Ephemerides_DataStack_Push_Button_clicked() @@ -489,6 +491,18 @@ void MainWindow::on_EEPROM_Control_Wipe_Button_clicked() this->SendSerialData(msg); } +void MainWindow::on_SatelliteConfig_Transmission_Send_Button_clicked() +{ + // fossasat-2. + char transmitEnabled = ui->SatelliteConfig_Transmission_Enabled_RadioButton->isChecked(); + char automatedStatsTransmissionEnabled = ui->SatelliteConfig_Transmission_AutoStatsEnabled_RadioButton->isChecked(); + char FSKMandatedForLargePacketsEnabled = ui->SatelliteConfig_Transmission_FSKMandated_Enabled_RadioButton->isChecked(); + + IGroundStationSerialMessage* msg = m_interpreter->Create_CMD_Set_Transmit_Enable(transmitEnabled, automatedStatsTransmissionEnabled, FSKMandatedForLargePacketsEnabled); + this->SendSerialData(msg); +} + + #define SatelliteControlsTab_End } @@ -1029,4 +1043,3 @@ void MainWindow::on_actionView_Serial_Ports_triggered() msgBox.exec(); } - diff --git a/FOSSAGSCP/mainwindow.h b/FOSSAGSCP/mainwindow.h index 1ce2f92..9689d15 100644 --- a/FOSSAGSCP/mainwindow.h +++ b/FOSSAGSCP/mainwindow.h @@ -98,6 +98,8 @@ private slots: void on_EEPROM_Control_Wipe_Button_clicked(); + void on_SatelliteConfig_Transmission_Send_Button_clicked(); + private: Ui::MainWindow *ui; // this pointer is private and only available in mainwindow.h diff --git a/FOSSAGSCP/mainwindow.ui b/FOSSAGSCP/mainwindow.ui index b266235..e374254 100644 --- a/FOSSAGSCP/mainwindow.ui +++ b/FOSSAGSCP/mainwindow.ui @@ -33,7 +33,7 @@ QTabWidget::Triangular - 0 + 1 Qt::ElideRight @@ -1749,9 +1749,9 @@ tolerance check: 223 - 0 + -596 465 - 3460 + 3499 @@ -2026,69 +2026,6 @@ tolerance check: - - - - Transmission Enable/Disable - - - - - - Transmissions Disabled - - - transmissionsEnabledDisabledButtonGroup - - - - - - - Automated Statistics Enabled - - - automatedStatisticsEnabledDisabledButtonGroup - - - - - - - Automated Statistics Disabled - - - automatedStatisticsEnabledDisabledButtonGroup - - - - - - - Transmissions Enabled - - - transmissionsEnabledDisabledButtonGroup - - - - - - - Set - - - - - - - Refresh - - - - - - @@ -2929,6 +2866,105 @@ Data stack + + + + Transmission Enable/Disable + + + + + + Enabled + + + + + + + Disabled + + + + + + + Disabled + + + automatedStatisticsEnabledDisabledButtonGroup + + + + + + + Enabled + + + transmissionsEnabledDisabledButtonGroup + + + + + + + Set + + + + + + + Disabled + + + transmissionsEnabledDisabledButtonGroup + + + + + + + Enabled + + + automatedStatisticsEnabledDisabledButtonGroup + + + + + + + Refresh + + + + + + + Transmissions: + + + + + + + Auto. Stats. Transmission: + + + + + + + FSK Mandated for +large packets: + + + + + + diff --git a/FOSSAGSCP/src/Interpreter.cpp b/FOSSAGSCP/src/Interpreter.cpp index db4dab1..6fe3a98 100644 --- a/FOSSAGSCP/src/Interpreter.cpp +++ b/FOSSAGSCP/src/Interpreter.cpp @@ -372,6 +372,30 @@ IGroundStationSerialMessage *Interpreter::Create_CMD_Wipe_EEPROM(char flags) return msg; } +IGroundStationSerialMessage *Interpreter::Create_CMD_Set_Transmit_Enable(char transmitEnabled, char autoStatsEnabled, char fskMandatedEnabled) +{ + IGroundStationSerialMessage* msg; + + if (m_satVersion == VERSION_1B) + { + char optData[1]; + optData[0] = transmitEnabled; + + this->Create_GroundStationSerialMessage(FCPI_FRAME_OP, CMD_SET_TRANSMIT_ENABLE, 1, optData); + } + else if (m_satVersion == VERSION_2) + { + char optData[3]; + optData[0] = transmitEnabled; + optData[1] = autoStatsEnabled; + optData[2] = fskMandatedEnabled; + + this->Create_GroundStationSerialMessage(FCPI_FRAME_OP, CMD_WIPE_EEPROM, 3, optData); + } + + return msg; +} + IGroundStationSerialMessage *Interpreter::Create_CMD_Camera_Capture(char pictureSlot, char lightMode, char pictureSize, char brightness, char saturation, char specialFilter, char contrast) { char optData[4];