Skip to content

Commit

Permalink
implemented enable/disable transmissions
Browse files Browse the repository at this point in the history
  • Loading branch information
Bambofy committed Jul 27, 2020
1 parent b444a17 commit 19a459f
Show file tree
Hide file tree
Showing 5 changed files with 143 additions and 68 deletions.
2 changes: 1 addition & 1 deletion FOSSAGSCP/include/Interpreter.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
15 changes: 14 additions & 1 deletion FOSSAGSCP/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,8 @@ void MainWindow::on_SatelliteConfig_ADCs_Controller_Set_Button_clicked()





static std::vector<ephemerides_t> g_ephemeridesControllerStack;

void MainWindow::on_Satelliteconfig_ADCs_Ephemerides_DataStack_Push_Button_clicked()
Expand Down Expand Up @@ -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 }


Expand Down Expand Up @@ -1029,4 +1043,3 @@ void MainWindow::on_actionView_Serial_Ports_triggered()
msgBox.exec();
}


2 changes: 2 additions & 0 deletions FOSSAGSCP/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
168 changes: 102 additions & 66 deletions FOSSAGSCP/mainwindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<enum>QTabWidget::Triangular</enum>
</property>
<property name="currentIndex">
<number>0</number>
<number>1</number>
</property>
<property name="elideMode">
<enum>Qt::ElideRight</enum>
Expand Down Expand Up @@ -1749,9 +1749,9 @@ tolerance check:</string>
<property name="geometry">
<rect>
<x>223</x>
<y>0</y>
<y>-596</y>
<width>465</width>
<height>3460</height>
<height>3499</height>
</rect>
</property>
<property name="sizePolicy">
Expand Down Expand Up @@ -2026,69 +2026,6 @@ tolerance check:</string>
</property>
</spacer>
</item>
<item row="10" column="0" colspan="3">
<widget class="QGroupBox" name="transmittingGroupBox">
<property name="title">
<string>Transmission Enable/Disable</string>
</property>
<layout class="QGridLayout" name="gridLayout_17">
<item row="0" column="1">
<widget class="QRadioButton" name="SatelliteConfig_Transmission_Disabled_RadioButton">
<property name="text">
<string>Transmissions Disabled</string>
</property>
<attribute name="buttonGroup">
<string notr="true">transmissionsEnabledDisabledButtonGroup</string>
</attribute>
</widget>
</item>
<item row="1" column="0">
<widget class="QRadioButton" name="SatelliteConfig_Transmission_AutoStatsEnabled_RadioButton">
<property name="text">
<string>Automated Statistics Enabled</string>
</property>
<attribute name="buttonGroup">
<string notr="true">automatedStatisticsEnabledDisabledButtonGroup</string>
</attribute>
</widget>
</item>
<item row="1" column="1">
<widget class="QRadioButton" name="SatelliteConfig_Transmission_AutoStatsDisabled_RadioButton">
<property name="text">
<string>Automated Statistics Disabled</string>
</property>
<attribute name="buttonGroup">
<string notr="true">automatedStatisticsEnabledDisabledButtonGroup</string>
</attribute>
</widget>
</item>
<item row="0" column="0">
<widget class="QRadioButton" name="SatelliteConfig_Transmission_Enabled_RadioButton">
<property name="text">
<string>Transmissions Enabled</string>
</property>
<attribute name="buttonGroup">
<string notr="true">transmissionsEnabledDisabledButtonGroup</string>
</attribute>
</widget>
</item>
<item row="2" column="0">
<widget class="QPushButton" name="SatelliteConfig_Transmission_Send_Button">
<property name="text">
<string>Set</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QPushButton" name="SatelliteConfig_Transmission_Refresh_Button">
<property name="text">
<string>Refresh</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="14" column="0" colspan="3">
<widget class="QGroupBox" name="MPPTGroupBox">
<property name="title">
Expand Down Expand Up @@ -2929,6 +2866,105 @@ Data stack</string>
</layout>
</widget>
</item>
<item row="10" column="0">
<widget class="QGroupBox" name="transmittingGroupBox">
<property name="title">
<string>Transmission Enable/Disable</string>
</property>
<layout class="QGridLayout" name="gridLayout_17">
<item row="2" column="1">
<widget class="QRadioButton" name="SatelliteConfig_Transmission_FSKMandated_Enabled_RadioButton">
<property name="text">
<string>Enabled</string>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QRadioButton" name="SatelliteConfig_Transmission_FSKMandated_Disabled_RadioButton">
<property name="text">
<string>Disabled</string>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QRadioButton" name="SatelliteConfig_Transmission_AutoStatsDisabled_RadioButton">
<property name="text">
<string>Disabled</string>
</property>
<attribute name="buttonGroup">
<string notr="true">automatedStatisticsEnabledDisabledButtonGroup</string>
</attribute>
</widget>
</item>
<item row="0" column="1">
<widget class="QRadioButton" name="SatelliteConfig_Transmission_Enabled_RadioButton">
<property name="text">
<string>Enabled</string>
</property>
<attribute name="buttonGroup">
<string notr="true">transmissionsEnabledDisabledButtonGroup</string>
</attribute>
</widget>
</item>
<item row="3" column="1">
<widget class="QPushButton" name="SatelliteConfig_Transmission_Send_Button">
<property name="text">
<string>Set</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QRadioButton" name="SatelliteConfig_Transmission_Disabled_RadioButton">
<property name="text">
<string>Disabled</string>
</property>
<attribute name="buttonGroup">
<string notr="true">transmissionsEnabledDisabledButtonGroup</string>
</attribute>
</widget>
</item>
<item row="1" column="1">
<widget class="QRadioButton" name="SatelliteConfig_Transmission_AutoStatsEnabled_RadioButton">
<property name="text">
<string>Enabled</string>
</property>
<attribute name="buttonGroup">
<string notr="true">automatedStatisticsEnabledDisabledButtonGroup</string>
</attribute>
</widget>
</item>
<item row="3" column="2">
<widget class="QPushButton" name="SatelliteConfig_Transmission_Refresh_Button">
<property name="text">
<string>Refresh</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_141">
<property name="text">
<string>Transmissions:</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_142">
<property name="text">
<string>Auto. Stats. Transmission:</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_143">
<property name="text">
<string>FSK Mandated for
large packets:</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</widget>
Expand Down
24 changes: 24 additions & 0 deletions FOSSAGSCP/src/Interpreter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit 19a459f

Please sign in to comment.