From ff4e3b2b6165db9e89f5f66a4418e65dfc025f44 Mon Sep 17 00:00:00 2001 From: "Robin.Mueller" <robin.mueller.m@gmail.com> Date: Tue, 17 Mar 2020 20:20:41 +0100 Subject: [PATCH] introduced pep conventions for naming --- .../OBSW_TmTcClient_GPS0_Serial.xml | 2 +- .../OBSW_TmTcClient_GPS1_Serial.xml | 2 +- .../runConfigurations/OBSW_TmTcClient_GUI.xml | 2 +- .../OBSW_TmTcClient_Help.xml | 2 +- .../OBSW_TmTcClient_Service_17_Serial_.xml | 2 +- .../OBSW_TmTcClient_Service_2_Serial.xml | 2 +- .../OBSW_TmTcClient_Service_3_Serial_.xml | 2 +- .../OBSW_TmTcClient_Service_8_Serial.xml | 2 +- .../OBSW_TmTcClient_Service_9_Serial.xml | 2 +- .../OBSW_TmTcClient_Software_Serial.xml | 2 +- .../OBSW_TmTcClient_Test.xml | 2 +- .../OBSW_TmTcClient_Unit_Test_Serial.xml | 2 +- .../runConfigurations/OBSW_UdpClient_GPS0.xml | 2 +- .../runConfigurations/OBSW_UdpClient_GPS1.xml | 2 +- .../OBSW_UdpClient_Listener__Mode.xml | 2 +- .../OBSW_UdpClient_Service_17_Test.xml | 2 +- .../OBSW_UdpClient_Service_200_UDP.xml | 2 +- .../OBSW_UdpClient_Service_2_Test.xml | 2 +- .../OBSW_UdpClient_Service_3.xml | 2 +- .../OBSW_UdpClient_Service_8.xml | 2 +- .../OBSW_UdpClient_Service_Dummy.xml | 2 +- .../OBSW_UdpClient_Single_Command.xml | 2 +- .../OBSW_UdpClient_Software_Testmode.xml | 2 +- .../OBSW_UdpClient_Unit_Test.xml | 2 +- .../OBSW_UdpClient_Unit_Test_STM32.xml | 2 +- OBSW_TmTcClient.py | 183 ---------------- README.md | 6 +- config/OBSW_Config.py | 4 +- obsw_tmtc_client.py | 197 ++++++++++++++++++ 29 files changed, 227 insertions(+), 213 deletions(-) delete mode 100644 OBSW_TmTcClient.py create mode 100644 obsw_tmtc_client.py diff --git a/.idea/runConfigurations/OBSW_TmTcClient_GPS0_Serial.xml b/.idea/runConfigurations/OBSW_TmTcClient_GPS0_Serial.xml index 09af589..55ec921 100644 --- a/.idea/runConfigurations/OBSW_TmTcClient_GPS0_Serial.xml +++ b/.idea/runConfigurations/OBSW_TmTcClient_GPS0_Serial.xml @@ -12,7 +12,7 @@ <option name="ADD_CONTENT_ROOTS" value="true" /> <option name="ADD_SOURCE_ROOTS" value="true" /> <EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" /> - <option name="SCRIPT_NAME" value="$PROJECT_DIR$/OBSW_TmTcClient.py" /> + <option name="SCRIPT_NAME" value="C:\Users\Robin\NoSyncDokumente\sourceobsw\tmtc\obsw_tmtc_client.py" /> <option name="PARAMETERS" value="-m 3 -s GPS0 -c 1 --hk -p" /> <option name="SHOW_COMMAND_LINE" value="false" /> <option name="EMULATE_TERMINAL" value="true" /> diff --git a/.idea/runConfigurations/OBSW_TmTcClient_GPS1_Serial.xml b/.idea/runConfigurations/OBSW_TmTcClient_GPS1_Serial.xml index efc9a7f..122ed72 100644 --- a/.idea/runConfigurations/OBSW_TmTcClient_GPS1_Serial.xml +++ b/.idea/runConfigurations/OBSW_TmTcClient_GPS1_Serial.xml @@ -12,7 +12,7 @@ <option name="ADD_CONTENT_ROOTS" value="true" /> <option name="ADD_SOURCE_ROOTS" value="true" /> <EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" /> - <option name="SCRIPT_NAME" value="$PROJECT_DIR$/../../../../../../../Robin/NoSyncDokumente/sourceobsw/tmtc/OBSW_TmTcClient.py" /> + <option name="SCRIPT_NAME" value="$PROJECT_DIR$/obsw_tmtc_client.py" /> <option name="PARAMETERS" value="-m 3 -s GPS1 -c 1" /> <option name="SHOW_COMMAND_LINE" value="false" /> <option name="EMULATE_TERMINAL" value="true" /> diff --git a/.idea/runConfigurations/OBSW_TmTcClient_GUI.xml b/.idea/runConfigurations/OBSW_TmTcClient_GUI.xml index 1e2ad1a..1c3f526 100644 --- a/.idea/runConfigurations/OBSW_TmTcClient_GUI.xml +++ b/.idea/runConfigurations/OBSW_TmTcClient_GUI.xml @@ -12,7 +12,7 @@ <option name="ADD_CONTENT_ROOTS" value="true" /> <option name="ADD_SOURCE_ROOTS" value="true" /> <EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" /> - <option name="SCRIPT_NAME" value="$PROJECT_DIR$/OBSW_TmTcClient.py" /> + <option name="SCRIPT_NAME" value="C:\Users\Robin\NoSyncDokumente\sourceobsw\tmtc\obsw_tmtc_client.py" /> <option name="PARAMETERS" value="-m 0" /> <option name="SHOW_COMMAND_LINE" value="false" /> <option name="EMULATE_TERMINAL" value="false" /> diff --git a/.idea/runConfigurations/OBSW_TmTcClient_Help.xml b/.idea/runConfigurations/OBSW_TmTcClient_Help.xml index ee7dfab..0568677 100644 --- a/.idea/runConfigurations/OBSW_TmTcClient_Help.xml +++ b/.idea/runConfigurations/OBSW_TmTcClient_Help.xml @@ -12,7 +12,7 @@ <option name="ADD_CONTENT_ROOTS" value="true" /> <option name="ADD_SOURCE_ROOTS" value="true" /> <EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" /> - <option name="SCRIPT_NAME" value="C:\Users\Robin\NoSyncDokumente\sourceobsw\tmtc\OBSW_TmTcClient.py" /> + <option name="SCRIPT_NAME" value="C:\Users\Robin\NoSyncDokumente\sourceobsw\tmtc\obsw_tmtc_client.py" /> <option name="PARAMETERS" value="-h" /> <option name="SHOW_COMMAND_LINE" value="false" /> <option name="EMULATE_TERMINAL" value="false" /> diff --git a/.idea/runConfigurations/OBSW_TmTcClient_Service_17_Serial_.xml b/.idea/runConfigurations/OBSW_TmTcClient_Service_17_Serial_.xml index 8a29e3d..ff8bcaf 100644 --- a/.idea/runConfigurations/OBSW_TmTcClient_Service_17_Serial_.xml +++ b/.idea/runConfigurations/OBSW_TmTcClient_Service_17_Serial_.xml @@ -12,7 +12,7 @@ <option name="ADD_CONTENT_ROOTS" value="true" /> <option name="ADD_SOURCE_ROOTS" value="true" /> <EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" /> - <option name="SCRIPT_NAME" value="$PROJECT_DIR$/OBSW_TmTcClient.py" /> + <option name="SCRIPT_NAME" value="C:\Users\Robin\NoSyncDokumente\sourceobsw\tmtc\obsw_tmtc_client.py" /> <option name="PARAMETERS" value="-m 3 -s 17 -p -c 1" /> <option name="SHOW_COMMAND_LINE" value="false" /> <option name="EMULATE_TERMINAL" value="true" /> diff --git a/.idea/runConfigurations/OBSW_TmTcClient_Service_2_Serial.xml b/.idea/runConfigurations/OBSW_TmTcClient_Service_2_Serial.xml index caaa02f..c32ca7a 100644 --- a/.idea/runConfigurations/OBSW_TmTcClient_Service_2_Serial.xml +++ b/.idea/runConfigurations/OBSW_TmTcClient_Service_2_Serial.xml @@ -12,7 +12,7 @@ <option name="ADD_CONTENT_ROOTS" value="true" /> <option name="ADD_SOURCE_ROOTS" value="true" /> <EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" /> - <option name="SCRIPT_NAME" value="$PROJECT_DIR$/../../../../../../../Robin/NoSyncDokumente/sourceobsw/tmtc/OBSW_TmTcClient.py" /> + <option name="SCRIPT_NAME" value="$PROJECT_DIR$/obsw_tmtc_client.py" /> <option name="PARAMETERS" value="-m 3 -s 2 -p -c 1" /> <option name="SHOW_COMMAND_LINE" value="false" /> <option name="EMULATE_TERMINAL" value="false" /> diff --git a/.idea/runConfigurations/OBSW_TmTcClient_Service_3_Serial_.xml b/.idea/runConfigurations/OBSW_TmTcClient_Service_3_Serial_.xml index b2d2671..889e53d 100644 --- a/.idea/runConfigurations/OBSW_TmTcClient_Service_3_Serial_.xml +++ b/.idea/runConfigurations/OBSW_TmTcClient_Service_3_Serial_.xml @@ -12,7 +12,7 @@ <option name="ADD_CONTENT_ROOTS" value="true" /> <option name="ADD_SOURCE_ROOTS" value="true" /> <EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" /> - <option name="SCRIPT_NAME" value="$PROJECT_DIR$/OBSW_TmTcClient.py" /> + <option name="SCRIPT_NAME" value="C:\Users\Robin\NoSyncDokumente\sourceobsw\tmtc\obsw_tmtc_client.py" /> <option name="PARAMETERS" value="-m 3 -s 3 -p -c 1 -t 4 --hk" /> <option name="SHOW_COMMAND_LINE" value="false" /> <option name="EMULATE_TERMINAL" value="false" /> diff --git a/.idea/runConfigurations/OBSW_TmTcClient_Service_8_Serial.xml b/.idea/runConfigurations/OBSW_TmTcClient_Service_8_Serial.xml index 5d938cd..f1df18f 100644 --- a/.idea/runConfigurations/OBSW_TmTcClient_Service_8_Serial.xml +++ b/.idea/runConfigurations/OBSW_TmTcClient_Service_8_Serial.xml @@ -12,7 +12,7 @@ <option name="ADD_CONTENT_ROOTS" value="true" /> <option name="ADD_SOURCE_ROOTS" value="true" /> <EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" /> - <option name="SCRIPT_NAME" value="$PROJECT_DIR$/../../../../../../../Robin/NoSyncDokumente/sourceobsw/tmtc/OBSW_TmTcClient.py" /> + <option name="SCRIPT_NAME" value="$PROJECT_DIR$/obsw_tmtc_client.py" /> <option name="PARAMETERS" value="-m 3 -s 8 -p -c 1" /> <option name="SHOW_COMMAND_LINE" value="false" /> <option name="EMULATE_TERMINAL" value="true" /> diff --git a/.idea/runConfigurations/OBSW_TmTcClient_Service_9_Serial.xml b/.idea/runConfigurations/OBSW_TmTcClient_Service_9_Serial.xml index 07b9832..e608c4b 100644 --- a/.idea/runConfigurations/OBSW_TmTcClient_Service_9_Serial.xml +++ b/.idea/runConfigurations/OBSW_TmTcClient_Service_9_Serial.xml @@ -12,7 +12,7 @@ <option name="ADD_CONTENT_ROOTS" value="true" /> <option name="ADD_SOURCE_ROOTS" value="true" /> <EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" /> - <option name="SCRIPT_NAME" value="$PROJECT_DIR$/OBSW_TmTcClient.py" /> + <option name="SCRIPT_NAME" value="C:\Users\Robin\NoSyncDokumente\sourceobsw\tmtc\obsw_tmtc_client.py" /> <option name="PARAMETERS" value="-m 3 -s 9 -p -c 1" /> <option name="SHOW_COMMAND_LINE" value="false" /> <option name="EMULATE_TERMINAL" value="true" /> diff --git a/.idea/runConfigurations/OBSW_TmTcClient_Software_Serial.xml b/.idea/runConfigurations/OBSW_TmTcClient_Software_Serial.xml index 1d7176c..1fad219 100644 --- a/.idea/runConfigurations/OBSW_TmTcClient_Software_Serial.xml +++ b/.idea/runConfigurations/OBSW_TmTcClient_Software_Serial.xml @@ -12,7 +12,7 @@ <option name="ADD_CONTENT_ROOTS" value="true" /> <option name="ADD_SOURCE_ROOTS" value="true" /> <EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" /> - <option name="SCRIPT_NAME" value="$PROJECT_DIR$/OBSW_TmTcClient.py" /> + <option name="SCRIPT_NAME" value="C:\Users\Robin\NoSyncDokumente\sourceobsw\tmtc\obsw_tmtc_client.py" /> <option name="PARAMETERS" value="-m 4 -p -c 1 --hk -t 5" /> <option name="SHOW_COMMAND_LINE" value="false" /> <option name="EMULATE_TERMINAL" value="false" /> diff --git a/.idea/runConfigurations/OBSW_TmTcClient_Test.xml b/.idea/runConfigurations/OBSW_TmTcClient_Test.xml index 7524486..5962769 100644 --- a/.idea/runConfigurations/OBSW_TmTcClient_Test.xml +++ b/.idea/runConfigurations/OBSW_TmTcClient_Test.xml @@ -12,7 +12,7 @@ <option name="ADD_CONTENT_ROOTS" value="true" /> <option name="ADD_SOURCE_ROOTS" value="true" /> <EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" /> - <option name="SCRIPT_NAME" value="$PROJECT_DIR$/OBSW_TmTcClient.py" /> + <option name="SCRIPT_NAME" value="C:\Users\Robin\NoSyncDokumente\sourceobsw\tmtc\obsw_tmtc_client.py" /> <option name="PARAMETERS" value="-h" /> <option name="SHOW_COMMAND_LINE" value="false" /> <option name="EMULATE_TERMINAL" value="false" /> diff --git a/.idea/runConfigurations/OBSW_TmTcClient_Unit_Test_Serial.xml b/.idea/runConfigurations/OBSW_TmTcClient_Unit_Test_Serial.xml index 90e8e4e..1a7ced3 100644 --- a/.idea/runConfigurations/OBSW_TmTcClient_Unit_Test_Serial.xml +++ b/.idea/runConfigurations/OBSW_TmTcClient_Unit_Test_Serial.xml @@ -12,7 +12,7 @@ <option name="ADD_CONTENT_ROOTS" value="true" /> <option name="ADD_SOURCE_ROOTS" value="true" /> <EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" /> - <option name="SCRIPT_NAME" value="$PROJECT_DIR$/OBSW_TmTcClient.py" /> + <option name="SCRIPT_NAME" value="C:\Users\Robin\NoSyncDokumente\sourceobsw\tmtc\obsw_tmtc_client.py" /> <option name="PARAMETERS" value="-m 5 -c 1 --hk" /> <option name="SHOW_COMMAND_LINE" value="false" /> <option name="EMULATE_TERMINAL" value="true" /> diff --git a/.idea/runConfigurations/OBSW_UdpClient_GPS0.xml b/.idea/runConfigurations/OBSW_UdpClient_GPS0.xml index 4c547c3..7410c2f 100644 --- a/.idea/runConfigurations/OBSW_UdpClient_GPS0.xml +++ b/.idea/runConfigurations/OBSW_UdpClient_GPS0.xml @@ -12,7 +12,7 @@ <option name="ADD_CONTENT_ROOTS" value="true" /> <option name="ADD_SOURCE_ROOTS" value="true" /> <EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" /> - <option name="SCRIPT_NAME" value="C:\Users\Robin\NoSyncDokumente\sourceobsw\tmtc\OBSW_TmTcClient.py" /> + <option name="SCRIPT_NAME" value="C:\Users\Robin\NoSyncDokumente\sourceobsw\tmtc\obsw_tmtc_client.py" /> <option name="PARAMETERS" value="-m 3 -s GPS0" /> <option name="SHOW_COMMAND_LINE" value="false" /> <option name="EMULATE_TERMINAL" value="true" /> diff --git a/.idea/runConfigurations/OBSW_UdpClient_GPS1.xml b/.idea/runConfigurations/OBSW_UdpClient_GPS1.xml index b1caeed..8ea3117 100644 --- a/.idea/runConfigurations/OBSW_UdpClient_GPS1.xml +++ b/.idea/runConfigurations/OBSW_UdpClient_GPS1.xml @@ -12,7 +12,7 @@ <option name="ADD_CONTENT_ROOTS" value="true" /> <option name="ADD_SOURCE_ROOTS" value="true" /> <EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" /> - <option name="SCRIPT_NAME" value="C:\Users\Robin\NoSyncDokumente\sourceobsw\tmtc\OBSW_TmTcClient.py" /> + <option name="SCRIPT_NAME" value="C:\Users\Robin\NoSyncDokumente\sourceobsw\tmtc\obsw_tmtc_client.py" /> <option name="PARAMETERS" value="-m 3 -s GPS1 -p" /> <option name="SHOW_COMMAND_LINE" value="false" /> <option name="EMULATE_TERMINAL" value="true" /> diff --git a/.idea/runConfigurations/OBSW_UdpClient_Listener__Mode.xml b/.idea/runConfigurations/OBSW_UdpClient_Listener__Mode.xml index 1868c22..5a86a1e 100644 --- a/.idea/runConfigurations/OBSW_UdpClient_Listener__Mode.xml +++ b/.idea/runConfigurations/OBSW_UdpClient_Listener__Mode.xml @@ -12,7 +12,7 @@ <option name="ADD_CONTENT_ROOTS" value="true" /> <option name="ADD_SOURCE_ROOTS" value="true" /> <EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" /> - <option name="SCRIPT_NAME" value="C:\Users\Robin\NoSyncDokumente\sourceobsw\tmtc\OBSW_TmTcClient.py" /> + <option name="SCRIPT_NAME" value="C:\Users\Robin\NoSyncDokumente\sourceobsw\tmtc\obsw_tmtc_client.py" /> <option name="PARAMETERS" value="-m 1 --hk" /> <option name="SHOW_COMMAND_LINE" value="false" /> <option name="EMULATE_TERMINAL" value="false" /> diff --git a/.idea/runConfigurations/OBSW_UdpClient_Service_17_Test.xml b/.idea/runConfigurations/OBSW_UdpClient_Service_17_Test.xml index f986218..b882acf 100644 --- a/.idea/runConfigurations/OBSW_UdpClient_Service_17_Test.xml +++ b/.idea/runConfigurations/OBSW_UdpClient_Service_17_Test.xml @@ -12,7 +12,7 @@ <option name="ADD_CONTENT_ROOTS" value="true" /> <option name="ADD_SOURCE_ROOTS" value="true" /> <EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" /> - <option name="SCRIPT_NAME" value="$PROJECT_DIR$/OBSW_TmTcClient.py" /> + <option name="SCRIPT_NAME" value="C:\Users\Robin\NoSyncDokumente\sourceobsw\tmtc\obsw_tmtc_client.py" /> <option name="PARAMETERS" value="-m 3 -s 17 -p -t 5" /> <option name="SHOW_COMMAND_LINE" value="false" /> <option name="EMULATE_TERMINAL" value="true" /> diff --git a/.idea/runConfigurations/OBSW_UdpClient_Service_200_UDP.xml b/.idea/runConfigurations/OBSW_UdpClient_Service_200_UDP.xml index e82c31b..499ee35 100644 --- a/.idea/runConfigurations/OBSW_UdpClient_Service_200_UDP.xml +++ b/.idea/runConfigurations/OBSW_UdpClient_Service_200_UDP.xml @@ -12,7 +12,7 @@ <option name="ADD_CONTENT_ROOTS" value="true" /> <option name="ADD_SOURCE_ROOTS" value="true" /> <EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" /> - <option name="SCRIPT_NAME" value="C:\Users\Robin\NoSyncDokumente\sourceobsw\tmtc\OBSW_TmTcClient.py" /> + <option name="SCRIPT_NAME" value="C:\Users\Robin\NoSyncDokumente\sourceobsw\tmtc\obsw_tmtc_client.py" /> <option name="PARAMETERS" value="-m 3 -s 200 -p" /> <option name="SHOW_COMMAND_LINE" value="false" /> <option name="EMULATE_TERMINAL" value="true" /> diff --git a/.idea/runConfigurations/OBSW_UdpClient_Service_2_Test.xml b/.idea/runConfigurations/OBSW_UdpClient_Service_2_Test.xml index 3dddeac..921369f 100644 --- a/.idea/runConfigurations/OBSW_UdpClient_Service_2_Test.xml +++ b/.idea/runConfigurations/OBSW_UdpClient_Service_2_Test.xml @@ -12,7 +12,7 @@ <option name="ADD_CONTENT_ROOTS" value="true" /> <option name="ADD_SOURCE_ROOTS" value="true" /> <EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" /> - <option name="SCRIPT_NAME" value="C:\Users\Robin\NoSyncDokumente\sourceobsw\tmtc\OBSW_TmTcClient.py" /> + <option name="SCRIPT_NAME" value="C:\Users\Robin\NoSyncDokumente\sourceobsw\tmtc\obsw_tmtc_client.py" /> <option name="PARAMETERS" value="-m 3 -s 2 -p" /> <option name="SHOW_COMMAND_LINE" value="false" /> <option name="EMULATE_TERMINAL" value="false" /> diff --git a/.idea/runConfigurations/OBSW_UdpClient_Service_3.xml b/.idea/runConfigurations/OBSW_UdpClient_Service_3.xml index 22cb0b2..cc78036 100644 --- a/.idea/runConfigurations/OBSW_UdpClient_Service_3.xml +++ b/.idea/runConfigurations/OBSW_UdpClient_Service_3.xml @@ -12,7 +12,7 @@ <option name="ADD_CONTENT_ROOTS" value="true" /> <option name="ADD_SOURCE_ROOTS" value="true" /> <EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" /> - <option name="SCRIPT_NAME" value="$PROJECT_DIR$/OBSW_TmTcClient.py" /> + <option name="SCRIPT_NAME" value="C:\Users\Robin\NoSyncDokumente\sourceobsw\tmtc\obsw_tmtc_client.py" /> <option name="PARAMETERS" value="-m 3 -s 3 -p --hk" /> <option name="SHOW_COMMAND_LINE" value="false" /> <option name="EMULATE_TERMINAL" value="true" /> diff --git a/.idea/runConfigurations/OBSW_UdpClient_Service_8.xml b/.idea/runConfigurations/OBSW_UdpClient_Service_8.xml index 62daaad..1be681f 100644 --- a/.idea/runConfigurations/OBSW_UdpClient_Service_8.xml +++ b/.idea/runConfigurations/OBSW_UdpClient_Service_8.xml @@ -12,7 +12,7 @@ <option name="ADD_CONTENT_ROOTS" value="true" /> <option name="ADD_SOURCE_ROOTS" value="true" /> <EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" /> - <option name="SCRIPT_NAME" value="C:\Users\Robin\NoSyncDokumente\sourceobsw\tmtc\OBSW_TmTcClient.py" /> + <option name="SCRIPT_NAME" value="C:\Users\Robin\NoSyncDokumente\sourceobsw\tmtc\obsw_tmtc_client.py" /> <option name="PARAMETERS" value="-m 3 -s 8 -p" /> <option name="SHOW_COMMAND_LINE" value="false" /> <option name="EMULATE_TERMINAL" value="true" /> diff --git a/.idea/runConfigurations/OBSW_UdpClient_Service_Dummy.xml b/.idea/runConfigurations/OBSW_UdpClient_Service_Dummy.xml index 60ef124..fd420b5 100644 --- a/.idea/runConfigurations/OBSW_UdpClient_Service_Dummy.xml +++ b/.idea/runConfigurations/OBSW_UdpClient_Service_Dummy.xml @@ -12,7 +12,7 @@ <option name="ADD_CONTENT_ROOTS" value="true" /> <option name="ADD_SOURCE_ROOTS" value="true" /> <EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" /> - <option name="SCRIPT_NAME" value="C:\Users\Robin\NoSyncDokumente\sourceobsw\tmtc\OBSW_TmTcClient.py" /> + <option name="SCRIPT_NAME" value="C:\Users\Robin\NoSyncDokumente\sourceobsw\tmtc\obsw_tmtc_client.py" /> <option name="PARAMETERS" value="-m 3 -s Dummy -p" /> <option name="SHOW_COMMAND_LINE" value="false" /> <option name="EMULATE_TERMINAL" value="true" /> diff --git a/.idea/runConfigurations/OBSW_UdpClient_Single_Command.xml b/.idea/runConfigurations/OBSW_UdpClient_Single_Command.xml index 919cb5f..9a5d03e 100644 --- a/.idea/runConfigurations/OBSW_UdpClient_Single_Command.xml +++ b/.idea/runConfigurations/OBSW_UdpClient_Single_Command.xml @@ -12,7 +12,7 @@ <option name="ADD_CONTENT_ROOTS" value="true" /> <option name="ADD_SOURCE_ROOTS" value="true" /> <EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" /> - <option name="SCRIPT_NAME" value="C:\Users\Robin\NoSyncDokumente\sourceobsw\tmtc\OBSW_TmTcClient.py" /> + <option name="SCRIPT_NAME" value="C:\Users\Robin\NoSyncDokumente\sourceobsw\tmtc\obsw_tmtc_client.py" /> <option name="PARAMETERS" value="-m 2 -p" /> <option name="SHOW_COMMAND_LINE" value="false" /> <option name="EMULATE_TERMINAL" value="false" /> diff --git a/.idea/runConfigurations/OBSW_UdpClient_Software_Testmode.xml b/.idea/runConfigurations/OBSW_UdpClient_Software_Testmode.xml index 7b3249a..7342a05 100644 --- a/.idea/runConfigurations/OBSW_UdpClient_Software_Testmode.xml +++ b/.idea/runConfigurations/OBSW_UdpClient_Software_Testmode.xml @@ -12,7 +12,7 @@ <option name="ADD_CONTENT_ROOTS" value="true" /> <option name="ADD_SOURCE_ROOTS" value="true" /> <EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" /> - <option name="SCRIPT_NAME" value="C:\Users\Robin\NoSyncDokumente\sourceobsw\tmtc\OBSW_TmTcClient.py" /> + <option name="SCRIPT_NAME" value="C:\Users\Robin\NoSyncDokumente\sourceobsw\tmtc\obsw_tmtc_client.py" /> <option name="PARAMETERS" value="-m 4 -p" /> <option name="SHOW_COMMAND_LINE" value="false" /> <option name="EMULATE_TERMINAL" value="false" /> diff --git a/.idea/runConfigurations/OBSW_UdpClient_Unit_Test.xml b/.idea/runConfigurations/OBSW_UdpClient_Unit_Test.xml index 02fa79a..04e8ecf 100644 --- a/.idea/runConfigurations/OBSW_UdpClient_Unit_Test.xml +++ b/.idea/runConfigurations/OBSW_UdpClient_Unit_Test.xml @@ -12,7 +12,7 @@ <option name="ADD_CONTENT_ROOTS" value="true" /> <option name="ADD_SOURCE_ROOTS" value="true" /> <EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" /> - <option name="SCRIPT_NAME" value="C:\Users\Robin\NoSyncDokumente\sourceobsw\tmtc\OBSW_TmTcClient.py" /> + <option name="SCRIPT_NAME" value="C:\Users\Robin\NoSyncDokumente\sourceobsw\tmtc\obsw_tmtc_client.py" /> <option name="PARAMETERS" value="-m 5 -p" /> <option name="SHOW_COMMAND_LINE" value="false" /> <option name="EMULATE_TERMINAL" value="true" /> diff --git a/.idea/runConfigurations/OBSW_UdpClient_Unit_Test_STM32.xml b/.idea/runConfigurations/OBSW_UdpClient_Unit_Test_STM32.xml index ccb99db..b87037e 100644 --- a/.idea/runConfigurations/OBSW_UdpClient_Unit_Test_STM32.xml +++ b/.idea/runConfigurations/OBSW_UdpClient_Unit_Test_STM32.xml @@ -12,7 +12,7 @@ <option name="ADD_CONTENT_ROOTS" value="true" /> <option name="ADD_SOURCE_ROOTS" value="true" /> <EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" /> - <option name="SCRIPT_NAME" value="C:\Users\Robin\NoSyncDokumente\sourceobsw\tmtc\OBSW_TmTcClient.py" /> + <option name="SCRIPT_NAME" value="C:\Users\Robin\NoSyncDokumente\sourceobsw\tmtc\obsw_tmtc_client.py" /> <option name="PARAMETERS" value="-m 5 -p -t 7" /> <option name="SHOW_COMMAND_LINE" value="false" /> <option name="EMULATE_TERMINAL" value="true" /> diff --git a/OBSW_TmTcClient.py b/OBSW_TmTcClient.py deleted file mode 100644 index 72cec1f..0000000 --- a/OBSW_TmTcClient.py +++ /dev/null @@ -1,183 +0,0 @@ -#!/usr/bin/env python3 -""" -@file - OBSW_TmTcClient.py -@date - 01.11.2019 -@brief - This client was developed by KSat for the SOURCE project to test the on-board software. - It can be used to to send and receive TMTC packets and TMTC sequences. -@manual - Manual installation of crcmod might be needed - 1. Install pip if it is not installed yet - 2. Install crcmod and all other reqiored packages: - Command: pip install crcmod - or use IDE (interpreter settings -> pip in PyCharm) - - The script can be used by specifying command line parameters. Please run this script with the -h flag - or without any command line parameters to display options. GUI is work-in-progress - It might be necessary to set board or PC IP address if using ethernet communication. - Default values should work normally though. Use higher timeout value (-t Parameter) for STM32 - - Example command to test service 17, - assuming no set client IP (set manually to PC IP Address if necessary) and default board IP 169.254.1.38: - OBSW_TmTcClient.py -m 3 -s 17 - Example to run Unit Test: - OBSW_TmTcClient.py -m 5 - Example to test service 17 with HK output and serial communication: - OBSW_TmTcClient.py -m 3 -s 17 --hk -c 1 - Get command line help: - OBSW_TmTcClient.py -h - - There are four different Modes: - 0. GUI Mode: Experimental mode, also called if no input parameter are specified - 1. Listener Mode: Only Listen for incoming TM packets - 2. SingleCommandMode: Send Single Command repeatedly until answer is received, - only listen after that - 3. ServiceTestMode: Send all Telecommands belonging to a certain service - and scan for replies for each telecommand. Listen after that - 4. SoftwareTestMode: Send all services and perform reply scanning like mode 3. - Listen after that - 5. Unit Test Mode: Performs a unit test which returns a simple OK or NOT OK. This mode - has the capability to send TCs in bursts, where applicable - - If there are problems receiving packets with Ethernet Communication, - use the tool Wireshark to track ethernet communication - for UDP echo packets (requests and response). - If the packets appear, there might be a problematic firewall setting. - Please ensure that python.exe UDP packets are not blocked in advanced firewall settings - and create a rule to allow packets from port 2008. - -@author: - S. Gaisser, J. Meier, R. Mueller -""" -import atexit -from collections import deque -import unittest -import logging - -from test import OBSW_PusServiceTest -from config import OBSW_Config as g -from config.OBSW_Config import setGlobals -from tc.OBSW_TcPacker import PUSTelecommand, createTotalTcQueue, serviceTestSelect -from sendreceive.OBSW_SingleCommandSenderReceiver import SingleCommandSenderReceiver -from sendreceive.OBSW_SequentialSenderReceiver import SequentialCommandSenderReceiver -from sendreceive.OBSW_TmListener import TmListener -from utility.OBSW_ArgParser import parseInputArguments -from utility.OBSW_TmTcPrinter import TmTcPrinter, TmTcPrinterT -from comIF.OBSW_Ethernet_ComIF import EthernetComIF -from comIF.OBSW_Serial_ComIF import SerialComIF -from gui.OBSW_TmtcGUI import TmTcGUI -from gui.OBSW_BackendTest import TmTcBackend -from utility.OBSW_ExitHandler import keyboardInterruptHandler -from comIF.OBSW_ComInterface import ComIF_T - - -def main(): - args = parseInputArguments() - setGlobals(args) - tmtcPrinter = TmTcPrinter(g.displayMode, g.printToFile, True) - tmListener = 0 - communicationInterface = 0 - if g.modeId == g.ModeList.GUIMode: - backend = TmTcBackend() - backend.start() - GUI = TmTcGUI() - GUI.start() - backend.join() - GUI.join() - print("Both processes have closed") - exit() - else: - communicationInterface = setCommunicationInterface(tmtcPrinter) - atexit.register(keyboardInterruptHandler, comInterface=communicationInterface) - tmListener = TmListener( - comInterface=communicationInterface, tmTimeout=g.tmTimeout, tcTimeoutFactor=g.tcSendTimeoutFactor) - tmListener.start() - if g.modeId == g.ModeList.ListenerMode: - print("Listening for packages...") - elif g.modeId == g.ModeList.SingleCommandMode: - pusPacketTuple = commandPreparation() - SenderAndReceiver = SingleCommandSenderReceiver( - comInterface=communicationInterface, tmtcPrinter=tmtcPrinter, tmListener=tmListener, - pusPacketTuple=pusPacketTuple, tmTimeout=g.tmTimeout, tcTimeoutFactor=g.tcSendTimeoutFactor, - doPrintToFile=g.printToFile) - SenderAndReceiver.sendSingleTcAndReceiveTm() - - elif g.modeId == g.ModeList.ServiceTestMode: - serviceQueue = deque() - SenderAndReceiver = SequentialCommandSenderReceiver( - comInterface=communicationInterface, tmtcPrinter=tmtcPrinter, tmTimeout=g.tmTimeout, - tcQueue=serviceTestSelect(g.service, serviceQueue), tcTimeoutFactor=g.tcSendTimeoutFactor, - doPrintToFile=g.printToFile, tmListener=tmListener) - SenderAndReceiver.sendQueueTcAndReceiveTmSequentially() - - elif g.modeId == g.ModeList.SoftwareTestMode: - allTcQueue = createTotalTcQueue() - SenderAndReceiver = SequentialCommandSenderReceiver( - comInterface=communicationInterface, tmtcPrinter=tmtcPrinter, tmTimeout=g.tmTimeout, - tcQueue=allTcQueue, tcTimeoutFactor=g.tcSendTimeoutFactor, doPrintToFile=g.printToFile, - tmListener=tmListener) - SenderAndReceiver.sendQueueTcAndReceiveTmSequentially() - - elif g.modeId == g.ModeList.UnitTest: - """ - Set up test suite and run it with runner. Verbosity specifies detail level - """ - g.tmListener = tmListener - g.comInterface = communicationInterface - g.tmtcPrinter = tmtcPrinter - # noinspection PyTypeChecker - suite = unittest.TestLoader().loadTestsFromModule(OBSW_PusServiceTest) - unittest.TextTestRunner(verbosity=2).run(suite) - - else: - print("Unknown Mode, Configuration error !") - exit() - # At some later point, the program will run permanently and be able to take commands. For now - # we put a permanent loop here so the program doesnt exit automatically (TM Listener is daemonic) - while True: - pass - - -# Prepare command for single command testing -def commandPreparation(): - # Direct command which triggers an additional step reply and one completion reply - # Single Command Testing - command = PUSTelecommand(service=17, subservice=1, SSC=21) - # command.print() - # file = bytearray([1, 2, 3, 4, 5]) - # command = PUSTelecommand(service=23, subservice=1, SSC=21, data=file) - # command.packCommandTuple() - return command.packCommandTuple() - - -def setCommunicationInterface(tmtcPrinter: TmTcPrinterT) -> ComIF_T: - """ - Return the desired communication interface object - :param tmtcPrinter: TmTcPrinter object. - :return: CommunicationInterface object - """ - try: - if g.comIF == g.ComIF.Ethernet: - communicationInterface = EthernetComIF( - tmtcPrinter=tmtcPrinter, tmTimeout=g.tmTimeout, tcTimeoutFactor=g.tcSendTimeoutFactor, - sendAddress=g.sendAddress, receiveAddress=g.recAddress) - else: - comPort = g.comPort - baudRate = 115200 - g.serialTimeout = 0.05 - communicationInterface = SerialComIF(tmtcPrinter=tmtcPrinter, comPort=comPort, baudRate=baudRate, - serialTimeout=g.serialTimeout) - # else: - # pass - return communicationInterface - except (IOError, OSError): - print("Error setting up communication interface") - logging.exception("Error") - exit() - - -if __name__ == "__main__": - main() - diff --git a/README.md b/README.md index bb3eef2..b9484bc 100644 --- a/README.md +++ b/README.md @@ -21,16 +21,16 @@ Default values should work normally though. Example command to test service 17, assuming no set client IP (set manually to PC IP Address if necessary) and default board IP 169.254.1.38: ```shell script -OBSW_TmTcClient.py -m 3 -s 17 +obsw_tmtc_client.py -m 3 -s 17 ``` Example to run Unit Test: ```shell script -OBSW_TmTcClient.py -m 5 +obsw_tmtc_client.py -m 5 ``` Example to test service 3 with serial communication, printing all housekeeping packets, and exporting to a log file. COM port needs to be typed in manually (or set with --COM \<COM PORT>): ```shell script -OBSW_TmTcClient.py -m 3 -s 3 -p --hk -c +obsw_tmtc_client.py -m 3 -s 3 -p --hk -c ``` ## Modes diff --git a/config/OBSW_Config.py b/config/OBSW_Config.py index b980e55..06d0df5 100644 --- a/config/OBSW_Config.py +++ b/config/OBSW_Config.py @@ -60,7 +60,7 @@ displayMode = "long" comIF = 0 # COM Port for serial communication comPort = 'COM0' -serialTimeout = 0.01 +serial_timeout = 0.01 # Time related tmTimeout = 10 tcSendTimeoutFactor = 2.0 @@ -84,7 +84,7 @@ tmtcPrinter = None # noinspection PyUnusedLocal def setGlobals(args): - global recAddress, sendAddress, scriptMode, modeId, service, displayMode, comIF, comPort, serialTimeout + global recAddress, sendAddress, scriptMode, modeId, service, displayMode, comIF, comPort, serial_timeout global tmTimeout, tcSendTimeoutFactor, printToFile, printHkData, printRawTmData if args.mode == 0: print("GUI mode not implemented yet !") diff --git a/obsw_tmtc_client.py b/obsw_tmtc_client.py new file mode 100644 index 0000000..dcac207 --- /dev/null +++ b/obsw_tmtc_client.py @@ -0,0 +1,197 @@ +#!/usr/bin/env python3 +""" +@file + obsw_tmtc_client.py +@date + 01.11.2019 +@brief + This client was developed by KSat for the SOURCE project to test the on-board software. + It can be used to to send and receive TMTC packets and TMTC sequences. +@manual +Manual installation of crcmod might be needed + 1. Install pip if it is not installed yet + 2. Install crcmod and all other reqiored packages: + Command: pip install crcmod + or use IDE (interpreter settings -> pip in PyCharm) + +The script can be used by specifying command line parameters. +Please run this script with the -h flag or without any command line parameters to display options. +GUI is work-in-progress +It might be necessary to set board or PC IP address if using ethernet communication. +Default values should work normally though. Use higher timeout value (-t Parameter) for STM32 + +Example command to test service 17, +assuming no set client IP (set manually to PC IP Address if necessary) +and default board IP 169.254.1.38: + obsw_tmtc_client.py -m 3 -s 17 +Example to run Unit Test: + obsw_tmtc_client.py -m 5 +Example to test service 17 with HK output and serial communication: + obsw_tmtc_client.py -m 3 -s 17 --hk -c 1 +Get command line help: + obsw_tmtc_client.py -h + +There are four different Modes: + 0. GUI Mode: Experimental mode, also called if no input parameter are specified + 1. Listener Mode: Only Listen for incoming TM packets + 2. SingleCommandMode: Send Single Command repeatedly until answer is received, + only listen after that + 3. ServiceTestMode: Send all Telecommands belonging to a certain service + and scan for replies for each telecommand. Listen after that + 4. SoftwareTestMode: Send all services and perform reply scanning like mode 3. + Listen after that + 5. Unit Test Mode: Performs a unit test which returns a simple OK or NOT OK. This mode + has the capability to send TCs in bursts, where applicable + +If there are problems receiving packets with Ethernet Communication, +use the tool Wireshark to track ethernet communication +for UDP echo packets (requests and response). +If the packets appear, there might be a problematic firewall setting. +Please ensure that python.exe UDP packets are not blocked in advanced firewall settings +and create a rule to allow packets from port 2008. + +@author: + S. Gaisser, J. Meier, R. Mueller +""" +import atexit +import unittest +import logging +import sys +from collections import deque + +from test import OBSW_PusServiceTest +from config import OBSW_Config as g +from config.OBSW_Config import setGlobals +from tc.OBSW_TcPacker import PUSTelecommand, createTotalTcQueue, serviceTestSelect + +from sendreceive.OBSW_SingleCommandSenderReceiver import SingleCommandSenderReceiver +from sendreceive.OBSW_SequentialSenderReceiver import SequentialCommandSenderReceiver +from sendreceive.OBSW_TmListener import TmListener + +from utility.OBSW_ArgParser import parseInputArguments +from utility.OBSW_TmTcPrinter import TmTcPrinter, TmTcPrinterT +from utility.OBSW_ExitHandler import keyboardInterruptHandler + +from comIF.OBSW_Ethernet_ComIF import EthernetComIF +from comIF.OBSW_Serial_ComIF import SerialComIF +from comIF.OBSW_ComInterface import ComIF_T + +from gui.OBSW_TmtcGUI import TmTcGUI +from gui.OBSW_BackendTest import TmTcBackend + + +def main(): + """ + Runs the TMTC client, depending on input arguments + :return: + """ + args = parseInputArguments() + setGlobals(args) + tmtc_printer = TmTcPrinter(g.displayMode, g.printToFile, True) + if g.modeId == g.ModeList.GUIMode: + backend = TmTcBackend() + backend.start() + gui = TmTcGUI() + gui.start() + backend.join() + gui.join() + print("Both processes have closed") + sys.exit() + else: + communication_interface = set_communication_interface(tmtc_printer) + atexit.register(keyboardInterruptHandler, comInterface=communication_interface) + tm_listener = TmListener( + comInterface=communication_interface, tmTimeout=g.tmTimeout, + tcTimeoutFactor=g.tcSendTimeoutFactor) + tm_listener.start() + if g.modeId == g.ModeList.ListenerMode: + print("Listening for packages...") + elif g.modeId == g.ModeList.SingleCommandMode: + pus_packet_tuple = command_preparation() + sender_and_receiver = SingleCommandSenderReceiver( + comInterface=communication_interface, tmtcPrinter=tmtc_printer, tmListener=tm_listener, + pusPacketTuple=pus_packet_tuple, tmTimeout=g.tmTimeout, + tcTimeoutFactor=g.tcSendTimeoutFactor, doPrintToFile=g.printToFile) + sender_and_receiver.sendSingleTcAndReceiveTm() + + elif g.modeId == g.ModeList.ServiceTestMode: + service_queue = deque() + sender_and_receiver = SequentialCommandSenderReceiver( + comInterface=communication_interface, tmtcPrinter=tmtc_printer, tmTimeout=g.tmTimeout, + tcQueue=serviceTestSelect(g.service, service_queue), + tcTimeoutFactor=g.tcSendTimeoutFactor, doPrintToFile=g.printToFile, + tmListener=tm_listener) + sender_and_receiver.sendQueueTcAndReceiveTmSequentially() + + elif g.modeId == g.ModeList.SoftwareTestMode: + all_tc_queue = createTotalTcQueue() + sender_and_receiver = SequentialCommandSenderReceiver( + comInterface=communication_interface, tmtcPrinter=tmtc_printer, tmTimeout=g.tmTimeout, + tcQueue=all_tc_queue, tcTimeoutFactor=g.tcSendTimeoutFactor, + doPrintToFile=g.printToFile, tmListener=tm_listener) + sender_and_receiver.sendQueueTcAndReceiveTmSequentially() + + elif g.modeId == g.ModeList.UnitTest: + # Set up test suite and run it with runner. Verbosity specifies detail level + g.tmListener = tm_listener + g.comInterface = communication_interface + g.tmtcPrinter = tmtc_printer + # noinspection PyTypeChecker + suite = unittest.TestLoader().loadTestsFromModule(OBSW_PusServiceTest) + unittest.TextTestRunner(verbosity=2).run(suite) + + else: + print("Unknown Mode, Configuration error !") + sys.exit() + # At some later point, the program will run permanently and be able to take commands. + # For now we put a permanent loop here so the program + # doesn't exit automatically (TM Listener is daemonic) + while True: + pass + + +def command_preparation(): + """ + Prepare command for single command testing + :return: + """ + # Direct command which triggers an additional step reply and one completion reply + # Single Command Testing + command = PUSTelecommand(service=17, subservice=1, SSC=21) + # command.print() + # file = bytearray([1, 2, 3, 4, 5]) + # command = PUSTelecommand(service=23, subservice=1, SSC=21, data=file) + # command.packCommandTuple() + return command.packCommandTuple() + + +def set_communication_interface(tmtc_printer: TmTcPrinterT) -> ComIF_T: + """ + Return the desired communication interface object + :param tmtc_printer: TmTcPrinter object. + :return: CommunicationInterface object + """ + try: + if g.comIF == g.ComIF.Ethernet: + communication_interface = EthernetComIF( + tmtcPrinter=tmtc_printer, tmTimeout=g.tmTimeout, + tcTimeoutFactor=g.tcSendTimeoutFactor, sendAddress=g.sendAddress, + receiveAddress=g.recAddress) + else: + com_port = g.comPort + baud_rate = 115200 + g.serial_timeout = 0.05 + communication_interface = SerialComIF( + tmtcPrinter=tmtc_printer, comPort=com_port, baudRate=baud_rate, + serialTimeout=g.serial_timeout) + # else: + # pass + return communication_interface + except (IOError, OSError): + print("Error setting up communication interface") + logging.exception("Error") + sys.exit() + + +if __name__ == "__main__": + main() -- GitLab