From eb9deae5abd5d6d6f016f7864dc37c9825aabb43 Mon Sep 17 00:00:00 2001 From: "Robin.Mueller" Date: Wed, 30 Dec 2020 23:38:44 +0100 Subject: [PATCH 1/8] core update --- tmtc_core | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmtc_core b/tmtc_core index 33126ea..ed4b25a 160000 --- a/tmtc_core +++ b/tmtc_core @@ -1 +1 @@ -Subproject commit 33126ea4f9d0fd76128da5abcf9823ff71288d7c +Subproject commit ed4b25ab449cae31ac720f52ad43d13b9d7ce4c5 From 6b840eff43440a7b44df1cc089338f600a4a6d88 Mon Sep 17 00:00:00 2001 From: "Jakob.Meier" Date: Sun, 10 Jan 2021 11:42:06 +0100 Subject: [PATCH 2/8] tmp1075 tests --- config/tmtcc_definitions.py | 1 + config/tmtcc_globals.py | 2 + config/tmtcc_object_ids.py | 4 ++ pus_tc/tmtcc_tc_acu.py | 7 +++- pus_tc/tmtcc_tc_packer_hook.py | 4 ++ pus_tc/tmtcc_tc_service200_mode.py | 52 ++++++++++++++++++++++++++ pus_tc/tmtcc_tc_tmp1075.py | 59 ++++++++++++++++++++++++++++++ tmtc_core | 2 +- 8 files changed, 128 insertions(+), 3 deletions(-) create mode 100644 pus_tc/tmtcc_tc_service200_mode.py create mode 100644 pus_tc/tmtcc_tc_tmp1075.py diff --git a/config/tmtcc_definitions.py b/config/tmtcc_definitions.py index d5a4f24..6ce43ca 100644 --- a/config/tmtcc_definitions.py +++ b/config/tmtcc_definitions.py @@ -32,6 +32,7 @@ class ServiceList(enum.Enum): PDU1 = auto() PDU2 = auto() ACU = auto() + TMP1075 = auto() class SerialConfig(enum.Enum): diff --git a/config/tmtcc_globals.py b/config/tmtcc_globals.py index 6595b01..ae272ed 100644 --- a/config/tmtcc_globals.py +++ b/config/tmtcc_globals.py @@ -154,6 +154,8 @@ def add_globals_post_args_parsing(args: argparse.Namespace): service = ServiceList.PDU2 elif service == "acu": service = ServiceList.ACU + elif service == "tmp1075": + service = ServiceList.TMP1075 else: logger.warning("Service not known! Setting standard service 17") service = ServiceList.SERVICE_17 diff --git a/config/tmtcc_object_ids.py b/config/tmtcc_object_ids.py index 434d5e4..2185b6a 100644 --- a/config/tmtcc_object_ids.py +++ b/config/tmtcc_object_ids.py @@ -16,6 +16,8 @@ class ObjectIds(enum.Enum): PDU1_HANDLER_ID = auto() PDU2_HANDLER_ID = auto() ACU_HANDLER_ID = auto() + TMP1075_1_HANDLER_ID = auto() + TMP1075_2_HANDLER_ID = auto() def set_object_ids(object_id_dict: Dict[ObjectIds, bytearray]): @@ -27,5 +29,7 @@ def set_object_ids(object_id_dict: Dict[ObjectIds, bytearray]): o_ids.PDU1_HANDLER_ID: bytearray([0x44, 0x00, 0x00, 0x2]), o_ids.PDU2_HANDLER_ID: bytearray([0x44, 0x00, 0x00, 0x3]), o_ids.ACU_HANDLER_ID: bytearray([0x44, 0x00, 0x00, 0x4]), + o_ids.TMP1075_1_HANDLER_ID: bytearray([0x44, 0x00, 0x00, 0x5]), + o_ids.TMP1075_2_HANDLER_ID: bytearray([0x44, 0x00, 0x00, 0x6]), } ) diff --git a/pus_tc/tmtcc_tc_acu.py b/pus_tc/tmtcc_tc_acu.py index cf38750..18e803e 100644 --- a/pus_tc/tmtcc_tc_acu.py +++ b/pus_tc/tmtcc_tc_acu.py @@ -10,6 +10,8 @@ from tmtc_core.pus_tc.tmtcc_pus_tc_packer import TcQueueT from tmtc_core.pus_tc.tmtcc_pus_tc_base import PusTelecommand from gomspace.gomspace_common import * from pus_tc.tmtcc_tc_p60dock import P60DockConfigTable +from config.tmtcc_object_ids import ObjectIds +from tmtc_core.core.tmtcc_object_id_manager import get_object_id class ACUTestProcedure: @@ -54,7 +56,8 @@ def pack_acu_test_into(object_id: bytearray, tc_queue: TcQueueT) -> TcQueueT: tc_queue.appendleft(("print", "Testing ACU")) tc_queue.appendleft(("print", "P60 Dock: Enabling ACU connected to X1 slot (channel 0)")) - command = pack_set_param_command(g.P60DOCK_HANDLER_ID, P60DockConfigTable.out_en_0.parameter_address, + p60dock_object_id = get_object_id(ObjectIds.P60DOCK_HANDLER_ID) + command = pack_set_param_command(p60dock_object_id, P60DockConfigTable.out_en_0.parameter_address, P60DockConfigTable.out_en_0.parameter_size, Channel.on) command = PusTelecommand(service=8, subservice=128, ssc=23, app_data=command) tc_queue.appendleft(command.pack_command_tuple()) @@ -113,7 +116,7 @@ def pack_acu_test_into(object_id: bytearray, tc_queue: TcQueueT) -> TcQueueT: tc_queue.appendleft(command.pack_command_tuple()) tc_queue.appendleft(("print", "P60 Dock: Turning off ACU")) - command = pack_set_param_command(g.P60DOCK_HANDLER_ID, P60DockConfigTable.out_en_0.parameter_address, + command = pack_set_param_command(p60dock_object_id, P60DockConfigTable.out_en_0.parameter_address, P60DockConfigTable.out_en_0.parameter_size, Channel.off) command = PusTelecommand(service=8, subservice=128, ssc=23, app_data=command) tc_queue.appendleft(command.pack_command_tuple()) diff --git a/pus_tc/tmtcc_tc_packer_hook.py b/pus_tc/tmtcc_tc_packer_hook.py index 5500572..2fced67 100644 --- a/pus_tc/tmtcc_tc_packer_hook.py +++ b/pus_tc/tmtcc_tc_packer_hook.py @@ -19,6 +19,7 @@ from pus_tc.tmtcc_tc_pdu1 import pack_pdu1_test_into from pus_tc.tmtcc_tc_acu import pack_acu_test_into from tmtc_core.core.tmtcc_object_id_manager import get_object_id from config.tmtcc_object_ids import ObjectIds +from pus_tc.tmtcc_tc_tmp1075 import pack_tmp1075_test_into LOGGER = get_logger() @@ -40,6 +41,9 @@ def pack_service_queue_user(service: Union[int, str], op_code: int, service_queu if service == ServiceList.ACU: object_id = get_object_id(ObjectIds.ACU_HANDLER_ID) return pack_acu_test_into(object_id, service_queue) + if service == ServiceList.TMP1075: + object_id = get_object_id(ObjectIds.TMP1075_1_HANDLER_ID) + return pack_tmp1075_test_into(object_id, service_queue) LOGGER.warning("Invalid Service !") diff --git a/pus_tc/tmtcc_tc_service200_mode.py b/pus_tc/tmtcc_tc_service200_mode.py new file mode 100644 index 0000000..2f0641a --- /dev/null +++ b/pus_tc/tmtcc_tc_service200_mode.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +""" +@file tmtcc_tc_service200_mode.py +@brief PUS Service 200: PUS custom service 200: Mode commanding +@author R. Mueller +@date 02.05.2020 +""" +from tmtc_core.pus_tc.tmtcc_pus_tc_base import PusTelecommand +from tmtc_core.pus_tc.tmtcc_pus_tc_packer import TcQueueT +from tmtc_core.core.tmtcc_object_id_manager import get_object_id +from config.tmtcc_object_ids import ObjectIds +import struct + +TEST_DEVICE_ID = get_object_id(ObjectIds.TEST_DEVICE) + + +def pack_service200_test_into(tc_queue: TcQueueT) -> TcQueueT: + tc_queue.appendleft(("print", "Testing Service 200")) + # Object ID: Dummy Device + object_id = TEST_DEVICE_ID + # Set On Mode + tc_queue.appendleft(("print", "Testing Service 200: Set Mode On")) + mode_data = pack_mode_data(object_id, 1, 0) + command = PusTelecommand(service=200, subservice=1, ssc=2000, app_data=mode_data) + tc_queue.appendleft(command.pack_command_tuple()) + # Set Normal mode + tc_queue.appendleft(("print", "Testing Service 200: Set Mode Normal")) + mode_data = pack_mode_data(object_id, 2, 0) + command = PusTelecommand(service=200, subservice=1, ssc=2010, app_data=mode_data) + tc_queue.appendleft(command.pack_command_tuple()) + # Set Raw Mode + tc_queue.appendleft(("print", "Testing Service 200: Set Mode Raw")) + mode_data = pack_mode_data(object_id, 3, 0) + command = PusTelecommand(service=200, subservice=1, ssc=2020, app_data=mode_data) + tc_queue.appendleft(command.pack_command_tuple()) + # Set Off Mode + tc_queue.appendleft(("print", "Testing Service 200: Set Mode Off")) + mode_data = pack_mode_data(object_id, 0, 0) + command = PusTelecommand(service=200, subservice=1, ssc=2030, app_data=mode_data) + tc_queue.appendleft(command.pack_command_tuple()) + tc_queue.appendleft(("export", "log/tmtc_log_service200.txt")) + return tc_queue + + +# Mode 0: Off, Mode 1: Mode On, Mode 2: Mode Normal, Mode 3: Mode Raw +def pack_mode_data(object_id: bytearray, mode_: int, submode_: int) -> bytearray: + # Normal mode + mode = struct.pack(">I", mode_) + # Submode default + submode = struct.pack('B', submode_) + mode_data = object_id + mode + submode + return mode_data diff --git a/pus_tc/tmtcc_tc_tmp1075.py b/pus_tc/tmtcc_tc_tmp1075.py new file mode 100644 index 0000000..53d1c1b --- /dev/null +++ b/pus_tc/tmtcc_tc_tmp1075.py @@ -0,0 +1,59 @@ +# -*- coding: utf-8 -*- +""" +@file tmtcc_tc_tmp1075.py +@brief TMP1075 tests +@author J. Meier +@date 06.01.2021 +""" + +from tmtc_core.pus_tc.tmtcc_pus_tc_packer import TcQueueT +from tmtc_core.pus_tc.tmtcc_pus_tc_base import PusTelecommand +from pus_tc.tmtcc_tc_service200_mode import pack_mode_data + + +class Tmp1075TestProcedure: + """ + @brief Use this class to define the tests to perform for the Tmp1075. + @details Setting all to True will run all tests. + Setting all to False will only run the tests set to True. + """ + all = True + start_adc_conversion = False + get_temp = False + set_mode_normal = False # Setting mode to normal starts continuous temperature reading + set_mode_on = False # If mode is MODE_ON, temperature will only be read on command + + +class Tmp1075ActionIds: + get_temp = bytearray([0x0, 0x0, 0x0, 0x01]) + start_adc_conversion = bytearray([0x0, 0x0, 0x0, 0x02]) + + +def pack_tmp1075_test_into(object_id: bytearray, tc_queue: TcQueueT) -> TcQueueT: + tc_queue.appendleft(("print", "Testing Tmp1075 Temperature Sensor Handler")) + + if Tmp1075TestProcedure.all or Tmp1075TestProcedure.start_adc_conversion: + tc_queue.appendleft(("print", "TMP1075: Starting new temperature conversion")) + command = object_id + Tmp1075ActionIds.start_adc_conversion + command = PusTelecommand(service=8, subservice=128, ssc=23, app_data=command) + tc_queue.appendleft(command.pack_command_tuple()) + + if Tmp1075TestProcedure.all or Tmp1075TestProcedure.get_temp: + tc_queue.appendleft(("print", "TMP1075: Read temperature")) + command = object_id + Tmp1075ActionIds.get_temp + command = PusTelecommand(service=8, subservice=128, ssc=24, app_data=command) + tc_queue.appendleft(command.pack_command_tuple()) + + if Tmp1075TestProcedure.set_mode_normal: + tc_queue.appendleft(("print", "TMP1075:: Set Mode Normal")) + mode_data = pack_mode_data(object_id, 2, 0) + command = PusTelecommand(service=200, subservice=1, ssc=220, app_data=mode_data) + tc_queue.appendleft(command.pack_command_tuple()) + + if Tmp1075TestProcedure.set_mode_on: + tc_queue.appendleft(("print", "TMP1075: Set Mode On")) + mode_data = pack_mode_data(object_id, 1, 0) + command = PusTelecommand(service=200, subservice=1, ssc=221, app_data=mode_data) + tc_queue.appendleft(command.pack_command_tuple()) + + return tc_queue diff --git a/tmtc_core b/tmtc_core index ed4b25a..bdb8d55 160000 --- a/tmtc_core +++ b/tmtc_core @@ -1 +1 @@ -Subproject commit ed4b25ab449cae31ac720f52ad43d13b9d7ce4c5 +Subproject commit bdb8d5533a40c8396dedafc1844fe3645bcf8de3 From 7e64595d1a34732ed5d178cbbae634104634763f Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 13 Jan 2021 22:41:44 +0100 Subject: [PATCH 3/8] updated core --- tmtc_core | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmtc_core b/tmtc_core index bdb8d55..9764bdd 160000 --- a/tmtc_core +++ b/tmtc_core @@ -1 +1 @@ -Subproject commit bdb8d5533a40c8396dedafc1844fe3645bcf8de3 +Subproject commit 9764bddc6f93c09c22f88675909b1d1fd155e4db From be536aca499c8f14cec46622187b048df18bcf9c Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 3 Feb 2021 13:58:55 +0100 Subject: [PATCH 4/8] core update --- tmtc_core | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmtc_core b/tmtc_core index 9764bdd..e06ff9e 160000 --- a/tmtc_core +++ b/tmtc_core @@ -1 +1 @@ -Subproject commit 9764bddc6f93c09c22f88675909b1d1fd155e4db +Subproject commit e06ff9ecdb43a0109ab0244a960995e233448ca6 From a84d125b4be5b88d43738e874c67e71633772306 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 3 Feb 2021 14:14:54 +0100 Subject: [PATCH 5/8] updated to new tmtc core --- config/tmtcc_user_mode_op.py | 4 +- gomspace/gomspace_common.py | 5 +- gomspace/gomspace_pdu_definitions.py | 2 +- pus_tc/tmtcc_tc_acu.py | 25 +++++----- pus_tc/tmtcc_tc_p60dock.py | 74 ++++++++++++++++++---------- pus_tc/tmtcc_tc_packer_hook.py | 11 ++--- pus_tc/tmtcc_tc_pdu1.py | 25 +++++++--- pus_tc/tmtcc_tc_pdu2.py | 37 ++++++++------ pus_tc/tmtcc_tc_service200_mode.py | 13 ++--- pus_tc/tmtcc_tc_tmp1075.py | 12 ++--- pus_tm/tmtcc_pus_hk_handling.py | 2 +- tmtc_core | 2 +- 12 files changed, 124 insertions(+), 88 deletions(-) diff --git a/config/tmtcc_user_mode_op.py b/config/tmtcc_user_mode_op.py index b94ee97..5998a40 100644 --- a/config/tmtcc_user_mode_op.py +++ b/config/tmtcc_user_mode_op.py @@ -6,10 +6,8 @@ import sys from config.tmtcc_definitions import ModeList -from core.tmtc_backend import TmTcHandler -from test.obsw_pus_service_test import run_selected_pus_tests +from tmtc_core.core.tmtcc_backend import TmTcHandler from tmtc_core.utility.tmtcc_logger import get_logger -from utility.tmtcc_binary_uploader import BinaryFileUploader LOGGER = get_logger() diff --git a/gomspace/gomspace_common.py b/gomspace/gomspace_common.py index 7115c46..8aff120 100644 --- a/gomspace/gomspace_common.py +++ b/gomspace/gomspace_common.py @@ -96,7 +96,6 @@ def pack_ping_command(object_id: bytearray, data: bytearray) -> bytearray: data are simply copied by the device and then sent back. """ action_id = GomspaceDeviceActions.PING - command = bytearray() command = object_id + action_id + data return command @@ -107,7 +106,7 @@ def pack_gnd_wdt_reset_command(object_id: bytearray) -> bytearray: """ action_id = GomspaceDeviceActions.WDT_RESET command = bytearray() - command = object_id + action_id + command += object_id + action_id return command @@ -117,5 +116,5 @@ def pack_reboot_command(object_id: bytearray) -> bytearray: """ action_id = GomspaceDeviceActions.REBOOT command = bytearray() - command = object_id + action_id + command += object_id + action_id return command diff --git a/gomspace/gomspace_pdu_definitions.py b/gomspace/gomspace_pdu_definitions.py index 8d8b408..009eb31 100644 --- a/gomspace/gomspace_pdu_definitions.py +++ b/gomspace/gomspace_pdu_definitions.py @@ -13,4 +13,4 @@ class PDUConfigTable: class PDUHkTable: temperature = TableEntry(bytearray([0x00, 0x28]), TableEntry.uint16_size) # Ground WDT value (remaining seconds until reboot) - wdt_gnd_left = TableEntry(bytearray([0x00, 0x80]), TableEntry.uint32_size) \ No newline at end of file + wdt_gnd_left = TableEntry(bytearray([0x00, 0x80]), TableEntry.uint32_size) diff --git a/pus_tc/tmtcc_tc_acu.py b/pus_tc/tmtcc_tc_acu.py index 18e803e..e143e2a 100644 --- a/pus_tc/tmtcc_tc_acu.py +++ b/pus_tc/tmtcc_tc_acu.py @@ -8,6 +8,7 @@ from tmtc_core.pus_tc.tmtcc_pus_tc_packer import TcQueueT from tmtc_core.pus_tc.tmtcc_pus_tc_base import PusTelecommand +from tmtc_core.core.tmtc_core_definitions import QueueCommands from gomspace.gomspace_common import * from pus_tc.tmtcc_tc_p60dock import P60DockConfigTable from config.tmtcc_object_ids import ObjectIds @@ -53,9 +54,9 @@ class ACUHkTable: def pack_acu_test_into(object_id: bytearray, tc_queue: TcQueueT) -> TcQueueT: - tc_queue.appendleft(("print", "Testing ACU")) + tc_queue.appendleft((QueueCommands.PRINT, "Testing ACU")) - tc_queue.appendleft(("print", "P60 Dock: Enabling ACU connected to X1 slot (channel 0)")) + tc_queue.appendleft((QueueCommands.PRINT, "P60 Dock: Enabling ACU connected to X1 slot (channel 0)")) p60dock_object_id = get_object_id(ObjectIds.P60DOCK_HANDLER_ID) command = pack_set_param_command(p60dock_object_id, P60DockConfigTable.out_en_0.parameter_address, P60DockConfigTable.out_en_0.parameter_size, Channel.on) @@ -63,59 +64,59 @@ def pack_acu_test_into(object_id: bytearray, tc_queue: TcQueueT) -> TcQueueT: tc_queue.appendleft(command.pack_command_tuple()) if ACUTestProcedure.all or ACUTestProcedure.reboot: - tc_queue.appendleft(("print", "ACU: Reboot")) + tc_queue.appendleft((QueueCommands.PRINT, "ACU: Reboot")) command = pack_reboot_command(object_id) command = PusTelecommand(service=8, subservice=128, ssc=22, app_data=command) tc_queue.appendleft(command.pack_command_tuple()) if ACUTestProcedure.all or ACUTestProcedure.read_gnd_wdt: - tc_queue.appendleft(("print", "ACU: Reading ground watchdog timer value")) + tc_queue.appendleft((QueueCommands.PRINT, "ACU: Reading ground watchdog timer value")) command = pack_get_param_command(object_id, TableIds.hk, ACUHkTable.wdt_gnd_left.parameter_address, ACUHkTable.wdt_gnd_left.parameter_size) command = PusTelecommand(service=8, subservice=128, ssc=20, app_data=command) tc_queue.appendleft(command.pack_command_tuple()) if ACUTestProcedure.all or ACUTestProcedure.gnd_wdt_reset: - tc_queue.appendleft(("print", "ACU: Testing ground watchdog reset")) + tc_queue.appendleft((QueueCommands.PRINT, "ACU: Testing ground watchdog reset")) command = pack_gnd_wdt_reset_command(object_id) command = PusTelecommand(service=8, subservice=128, ssc=21, app_data=command) tc_queue.appendleft(command.pack_command_tuple()) if ACUTestProcedure.all or ACUTestProcedure.ping: - tc_queue.appendleft(("print", "ACU: Ping Test")) + tc_queue.appendleft((QueueCommands.PRINT, "ACU: Ping Test")) ping_data = bytearray([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) command = pack_ping_command(object_id, ping_data) command = PusTelecommand(service=8, subservice=128, ssc=22, app_data=command) tc_queue.appendleft(command.pack_command_tuple()) if ACUTestProcedure.all or ACUTestProcedure.read_temperature3: - tc_queue.appendleft(("print", "ACU: Reading temperature 3")) + tc_queue.appendleft((QueueCommands.PRINT, "ACU: Reading temperature 3")) command = pack_get_param_command(object_id, TableIds.hk, ACUHkTable.temperature3.parameter_address, ACUHkTable.temperature3.parameter_size) command = PusTelecommand(service=8, subservice=128, ssc=23, app_data=command) tc_queue.appendleft(command.pack_command_tuple()) if ACUTestProcedure.all or ACUTestProcedure.read_vboost: - tc_queue.appendleft(("print", "ACU: Reading vboost value")) + tc_queue.appendleft((QueueCommands.PRINT, "ACU: Reading vboost value")) command = pack_get_param_command(object_id, TableIds.config, ACUConfigTable.vboost.parameter_address, ACUConfigTable.vboost.parameter_size) command = PusTelecommand(service=8, subservice=128, ssc=23, app_data=command) tc_queue.appendleft(command.pack_command_tuple()) if ACUTestProcedure.all or ACUTestProcedure.read_vbat_max_hi: - tc_queue.appendleft(("print", "ACU: Reading vbat_max_hi")) + tc_queue.appendleft((QueueCommands.PRINT, "ACU: Reading vbat_max_hi")) command = pack_get_param_command(object_id, TableIds.config, ACUConfigTable.vbat_max_hi.parameter_address, ACUConfigTable.vbat_max_hi.parameter_size) command = PusTelecommand(service=8, subservice=128, ssc=23, app_data=command) tc_queue.appendleft(command.pack_command_tuple()) if ACUTestProcedure.all or ACUTestProcedure.read_vbat_max_lo: - tc_queue.appendleft(("print", "ACU: Reading vbat_max_lo")) + tc_queue.appendleft((QueueCommands.PRINT, "ACU: Reading vbat_max_lo")) command = pack_get_param_command(object_id, TableIds.config, ACUConfigTable.vbat_max_lo.parameter_address, ACUConfigTable.vbat_max_lo.parameter_size) command = PusTelecommand(service=8, subservice=128, ssc=23, app_data=command) tc_queue.appendleft(command.pack_command_tuple()) if ACUTestProcedure.all or ACUTestProcedure.read_ov_mode: - tc_queue.appendleft(("print", "ACU: Reading ov_mode")) + tc_queue.appendleft((QueueCommands.PRINT, "ACU: Reading ov_mode")) command = pack_get_param_command(object_id, TableIds.config, ACUConfigTable.ov_mode.parameter_address, ACUConfigTable.ov_mode.parameter_size) command = PusTelecommand(service=8, subservice=128, ssc=23, app_data=command) tc_queue.appendleft(command.pack_command_tuple()) - tc_queue.appendleft(("print", "P60 Dock: Turning off ACU")) + tc_queue.appendleft((QueueCommands.PRINT, "P60 Dock: Turning off ACU")) command = pack_set_param_command(p60dock_object_id, P60DockConfigTable.out_en_0.parameter_address, P60DockConfigTable.out_en_0.parameter_size, Channel.off) command = PusTelecommand(service=8, subservice=128, ssc=23, app_data=command) diff --git a/pus_tc/tmtcc_tc_p60dock.py b/pus_tc/tmtcc_tc_p60dock.py index 3b6293e..450f177 100644 --- a/pus_tc/tmtcc_tc_p60dock.py +++ b/pus_tc/tmtcc_tc_p60dock.py @@ -5,7 +5,7 @@ @author J. Meier @date 13.12.2020 """ - +from tmtc_core.core.tmtc_core_definitions import QueueCommands from tmtc_core.pus_tc.tmtcc_pus_tc_packer import TcQueueT from tmtc_core.pus_tc.tmtcc_pus_tc_base import PusTelecommand from gomspace.gomspace_common import * @@ -50,74 +50,86 @@ class P60DockHkTable: def pack_p60dock_test_into(object_id: bytearray, tc_queue: TcQueueT) -> TcQueueT: if P60DockTestProcedure.all or P60DockTestProcedure.reboot: - tc_queue.appendleft(("print", "P60 Dock: Reboot")) + tc_queue.appendleft((QueueCommands.PRINT, "P60 Dock: Reboot")) command = pack_reboot_command(object_id) command = PusTelecommand(service=8, subservice=128, ssc=22, app_data=command) tc_queue.appendleft(command.pack_command_tuple()) if P60DockTestProcedure.all or P60DockTestProcedure.read_gnd_wdt: - tc_queue.appendleft(("print", "P60 Dock: Reading ground watchdog timer value")) - command = pack_get_param_command(object_id, TableIds.hk, P60DockHkTable.wdt_gnd_left.parameter_address, - P60DockHkTable.wdt_gnd_left.parameter_size) + tc_queue.appendleft((QueueCommands.PRINT, "P60 Dock: Reading ground watchdog timer value")) + command = pack_get_param_command( + object_id, TableIds.hk, P60DockHkTable.wdt_gnd_left.parameter_address, + P60DockHkTable.wdt_gnd_left.parameter_size + ) command = PusTelecommand(service=8, subservice=128, ssc=20, app_data=command) tc_queue.appendleft(command.pack_command_tuple()) if P60DockTestProcedure.all or P60DockTestProcedure.gnd_wdt_reset: - tc_queue.appendleft(("print", "P60 Dock: Testing ground watchdog reset")) + tc_queue.appendleft((QueueCommands.PRINT, "P60 Dock: Testing ground watchdog reset")) command = pack_gnd_wdt_reset_command(object_id) command = PusTelecommand(service=8, subservice=128, ssc=21, app_data=command) tc_queue.appendleft(command.pack_command_tuple()) if P60DockTestProcedure.all or P60DockTestProcedure.ping: - tc_queue.appendleft(("print", "P60 Dock: Ping")) + tc_queue.appendleft((QueueCommands.PRINT, "P60 Dock: Ping")) ping_data = bytearray([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) command = pack_ping_command(object_id, ping_data) command = PusTelecommand(service=8, subservice=128, ssc=22, app_data=command) tc_queue.appendleft(command.pack_command_tuple()) if P60DockTestProcedure.all or P60DockTestProcedure.channel_3_off: - tc_queue.appendleft(("print", "P60 Dock: Testing setting output channel 3 off")) + tc_queue.appendleft((QueueCommands.PRINT, "P60 Dock: Testing setting output channel 3 off")) parameter = 0 # set channel off command = pack_set_param_command(object_id, P60DockConfigTable.out_en_3.parameter_address, P60DockConfigTable.out_en_3.parameter_size, parameter) command = PusTelecommand(service=8, subservice=128, ssc=23, app_data=command) tc_queue.appendleft(command.pack_command_tuple()) if P60DockTestProcedure.all or P60DockTestProcedure.read_temperature1: - tc_queue.appendleft(("print", "P60 Dock: Testing temperature reading")) - command = pack_get_param_command(object_id, TableIds.hk, P60DockHkTable.temperature1.parameter_address, - P60DockHkTable.temperature1.parameter_size) + tc_queue.appendleft((QueueCommands.PRINT, "P60 Dock: Testing temperature reading")) + command = pack_get_param_command( + object_id, TableIds.hk, P60DockHkTable.temperature1.parameter_address, + P60DockHkTable.temperature1.parameter_size + ) command = PusTelecommand(service=8, subservice=128, ssc=24, app_data=command) tc_queue.appendleft(command.pack_command_tuple()) if P60DockTestProcedure.all or P60DockTestProcedure.channel_3_on: - tc_queue.appendleft(("print", "P60 Dock: Testing Output Channel 3 state (PDU2)")) + tc_queue.appendleft((QueueCommands.PRINT, + "P60 Dock: Testing Output Channel 3 state (PDU2)")) command = pack_get_param_command(object_id, TableIds.config, P60DockConfigTable.out_en_3.parameter_address, P60DockConfigTable.out_en_3.parameter_size) command = PusTelecommand(service=8, subservice=128, ssc=25, app_data=command) tc_queue.appendleft(command.pack_command_tuple()) if P60DockTestProcedure.all or P60DockTestProcedure.read_cur_lu_lim_0: - tc_queue.appendleft(("print", "P60 Dock: Reading current limit value of output channel 0")) - command = pack_get_param_command(object_id, TableIds.config, P60DockConfigTable.cur_lu_lim_0.parameter_address, - P60DockConfigTable.cur_lu_lim_0.parameter_size) + tc_queue.appendleft((QueueCommands.PRINT, + "P60 Dock: Reading current limit value of output channel 0")) + command = pack_get_param_command( + object_id, TableIds.config, P60DockConfigTable.cur_lu_lim_0.parameter_address, + P60DockConfigTable.cur_lu_lim_0.parameter_size + ) command = PusTelecommand(service=8, subservice=128, ssc=26, app_data=command) tc_queue.appendleft(command.pack_command_tuple()) if P60DockTestProcedure.all or P60DockTestProcedure.channel_3_on: - tc_queue.appendleft(("print", "P60 Dock: Testing setting output channel 3 on")) + tc_queue.appendleft((QueueCommands.PRINT, "P60 Dock: Testing setting output channel 3 on")) parameter = 1 # set channel on command = pack_set_param_command(object_id, P60DockConfigTable.out_en_3.parameter_address, P60DockConfigTable.out_en_3.parameter_size, parameter) command = PusTelecommand(service=8, subservice=128, ssc=27, app_data=command) tc_queue.appendleft(command.pack_command_tuple()) if P60DockTestProcedure.all or P60DockTestProcedure.invalid_table_id_test: - tc_queue.appendleft(("print", "P60 Dock: Testing invalid table id handling")) + tc_queue.appendleft((QueueCommands.PRINT, "P60 Dock: Testing invalid table id handling")) table_id_invalid = 5 - command = pack_get_param_command(object_id, table_id_invalid, P60DockHkTable.temperature1.parameter_address, - P60DockHkTable.temperature1.parameter_size) + command = pack_get_param_command( + object_id, table_id_invalid, P60DockHkTable.temperature1.parameter_address, + P60DockHkTable.temperature1.parameter_size + ) command = PusTelecommand(service=8, subservice=128, ssc=28, app_data=command) tc_queue.appendleft(command.pack_command_tuple()) if P60DockTestProcedure.all or P60DockTestProcedure.invalid_address_test: - tc_queue.appendleft(("print", "P60 Dock: Testing invalid address handling in get param command")) + tc_queue.appendleft((QueueCommands.PRINT, + "P60 Dock: Testing invalid address handling in get param command")) invalid_address = bytearray([0x01, 0xF4]) command = pack_get_param_command(object_id, TableIds.hk, invalid_address, P60DockHkTable.temperature1.parameter_size) command = PusTelecommand(service=8, subservice=128, ssc=29, app_data=command) tc_queue.appendleft(command.pack_command_tuple()) - tc_queue.appendleft(("print", "P60 Dock: Testing invalid address handling in set param command")) + tc_queue.appendleft((QueueCommands.PRINT, + "P60 Dock: Testing invalid address handling in set param command")) invalid_address = bytearray([0x01, 0xF4]) parameter_size = 2 parameter = 1 @@ -125,16 +137,24 @@ def pack_p60dock_test_into(object_id: bytearray, tc_queue: TcQueueT) -> TcQueueT command = PusTelecommand(service=8, subservice=128, ssc=30, app_data=command) tc_queue.appendleft(command.pack_command_tuple()) if P60DockTestProcedure.all or P60DockTestProcedure.invalid_parameter_size_test: - tc_queue.appendleft(("print", "P60 Dock: Testing handling of invalid parameter sizes in get-param command")) + tc_queue.appendleft( + (QueueCommands.PRINT, + "P60 Dock: Testing handling of invalid parameter sizes in get-param command") + ) invalid_size = 5 - command = pack_get_param_command(object_id, TableIds.hk, P60DockHkTable.temperature1.parameter_address, - invalid_size) + command = pack_get_param_command( + object_id, TableIds.hk, P60DockHkTable.temperature1.parameter_address, invalid_size + ) command = PusTelecommand(service=8, subservice=128, ssc=31, app_data=command) tc_queue.appendleft(command.pack_command_tuple()) - tc_queue.appendleft(("print", "P60 Dock: Testing handling of invalid parameter size in set-param command")) + tc_queue.appendleft( + (QueueCommands.PRINT, + "P60 Dock: Testing handling of invalid parameter size in set-param command") + ) parameter = 1 - command = pack_set_param_command(object_id, P60DockConfigTable.out_en_3.parameter_address, invalid_size, - parameter) + command = pack_set_param_command( + object_id, P60DockConfigTable.out_en_3.parameter_address, invalid_size, parameter + ) command = PusTelecommand(service=8, subservice=128, ssc=32, app_data=command) tc_queue.appendleft(command.pack_command_tuple()) diff --git a/pus_tc/tmtcc_tc_packer_hook.py b/pus_tc/tmtcc_tc_packer_hook.py index 2fced67..86f63d6 100644 --- a/pus_tc/tmtcc_tc_packer_hook.py +++ b/pus_tc/tmtcc_tc_packer_hook.py @@ -6,13 +6,12 @@ import os from collections import deque -from typing import Union from config.tmtcc_definitions import ServiceList from tmtc_core.utility.tmtcc_logger import get_logger from tmtc_core.pus_tc.tmtcc_pus_tc_base import TcQueueT -from tmtc_core.pus_tc.tmtcc_tc_service5_event import pack_service5_test_into -from tmtc_core.pus_tc.tmtcc_tc_service17_test import pack_service17_ping_command +from tmtc_core.pus_tc.tmtcc_tc_service_5_event import pack_generic_service5_test_into +from tmtc_core.pus_tc.tmtcc_tc_service_17_test import pack_service17_ping_command from pus_tc.tmtcc_tc_p60dock import pack_p60dock_test_into from pus_tc.tmtcc_tc_pdu2 import pack_pdu2_test_into from pus_tc.tmtcc_tc_pdu1 import pack_pdu1_test_into @@ -24,9 +23,9 @@ from pus_tc.tmtcc_tc_tmp1075 import pack_tmp1075_test_into LOGGER = get_logger() -def pack_service_queue_user(service: Union[int, str], op_code: int, service_queue: TcQueueT): +def pack_service_queue_user(service: ServiceList, op_code: str, service_queue: TcQueueT): if service == ServiceList.SERVICE_5: - return pack_service5_test_into(service_queue) + return pack_generic_service5_test_into(service_queue) if service == ServiceList.SERVICE_17: return service_queue.appendleft(pack_service17_ping_command(ssc=1700).pack_command_tuple()) if service == ServiceList.P60DOCK: @@ -51,6 +50,6 @@ def create_total_tc_queue_user() -> TcQueueT: if not os.path.exists("log"): os.mkdir("log") tc_queue = deque() - pack_service5_test_into(tc_queue) + pack_generic_service5_test_into(tc_queue) tc_queue.appendleft(pack_service17_ping_command(ssc=1700).pack_command_tuple()) return tc_queue diff --git a/pus_tc/tmtcc_tc_pdu1.py b/pus_tc/tmtcc_tc_pdu1.py index 47ee8d7..da0afc4 100644 --- a/pus_tc/tmtcc_tc_pdu1.py +++ b/pus_tc/tmtcc_tc_pdu1.py @@ -8,11 +8,18 @@ from tmtc_core.pus_tc.tmtcc_pus_tc_packer import TcQueueT from tmtc_core.pus_tc.tmtcc_pus_tc_base import PusTelecommand -from gomspace.gomspace_common import * +from tmtc_core.core.tmtcc_object_id_manager import get_object_id +from tmtc_core.core.tmtc_core_definitions import QueueCommands + from pus_tc.tmtcc_tc_p60dock import P60DockConfigTable +from config.tmtcc_object_ids import ObjectIds +from gomspace.gomspace_common import * from gomspace.gomspace_pdu_definitions import * +P60DOCK_HANDLER_ID = get_object_id(ObjectIds.P60DOCK_HANDLER_ID) + + class PDU1TestProcedure: """ @brief Use this class to define the tests to perform for the PDU2. @@ -25,23 +32,25 @@ class PDU1TestProcedure: read_temperature = False -def pack_pdu1_test_into(object_id: bytearray, tc_queue: TcQueueT) -> TcQueueT: - tc_queue.appendleft(("print", "Testing PDU1")) +def pack_pdu1_test_into(object_id: bytearray, tc_queue: TcQueueT): + tc_queue.appendleft((QueueCommands.PRINT, "Testing PDU1")) - tc_queue.appendleft(("print", "P60 Dock: Enabling PDU1")) - command = pack_set_param_command(g.P60DOCK_HANDLER_ID, P60DockConfigTable.out_en_1.parameter_address, - P60DockConfigTable.out_en_1.parameter_size, Channel.on) + tc_queue.appendleft((QueueCommands.PRINT, "P60 Dock: Enabling PDU1")) + command = pack_set_param_command( + P60DOCK_HANDLER_ID, P60DockConfigTable.out_en_1.parameter_address, + P60DockConfigTable.out_en_1.parameter_size, Channel.on + ) command = PusTelecommand(service=8, subservice=128, ssc=23, app_data=command) tc_queue.appendleft(command.pack_command_tuple()) if PDU1TestProcedure.all or PDU1TestProcedure.ping: - tc_queue.appendleft(("print", "PDU1: Ping Test")) + tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Ping Test")) ping_data = bytearray([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) command = pack_ping_command(object_id, ping_data) command = PusTelecommand(service=8, subservice=128, ssc=22, app_data=command) tc_queue.appendleft(command.pack_command_tuple()) if PDU1TestProcedure.all or PDU1TestProcedure.read_temperature: - tc_queue.appendleft(("print", "PDU1: Testing temperature reading")) + tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Testing temperature reading")) command = pack_get_param_command(object_id, TableIds.hk, PDUHkTable.temperature.parameter_address, PDUHkTable.temperature.parameter_size) command = PusTelecommand(service=8, subservice=128, ssc=24, app_data=command) diff --git a/pus_tc/tmtcc_tc_pdu2.py b/pus_tc/tmtcc_tc_pdu2.py index 2243bf4..1f84f9a 100644 --- a/pus_tc/tmtcc_tc_pdu2.py +++ b/pus_tc/tmtcc_tc_pdu2.py @@ -8,10 +8,15 @@ from tmtc_core.pus_tc.tmtcc_pus_tc_packer import TcQueueT from tmtc_core.pus_tc.tmtcc_pus_tc_base import PusTelecommand +from tmtc_core.core.tmtcc_object_id_manager import get_object_id +from tmtc_core.core.tmtc_core_definitions import QueueCommands +from config.tmtcc_object_ids import ObjectIds from gomspace.gomspace_common import * from gomspace.gomspace_pdu_definitions import * from pus_tc.tmtcc_tc_p60dock import P60DockConfigTable +P60DOCK_HANDLER_ID = get_object_id(ObjectIds.P60DOCK_HANDLER_ID) + class PDU2TestProcedure: """ @@ -26,8 +31,9 @@ class PDU2TestProcedure: ping = False channel_2_off = False # TCS Heater read_temperature = False + read_temperature1 = False read_channel_2_state = False # TCS Heater - read_cur_lu_lim_0 = False # OBC + read_cur_lu_lim_0 = False # OBC channel_2_on = False # TCS Heater invalid_table_id_test = False # Test to check if software properly handles invalid table ids invalid_address_test = False # Test to check if software properly handles invalid addresses @@ -35,62 +41,65 @@ class PDU2TestProcedure: def pack_pdu2_test_into(object_id: bytearray, tc_queue: TcQueueT) -> TcQueueT: - tc_queue.appendleft(("print", "Testing PDU2")) + tc_queue.appendleft((QueueCommands.PRINT, "Testing PDU2")) - tc_queue.appendleft(("print", "P60 Dock: Enabling PDU2")) - command = pack_set_param_command(g.P60DOCK_HANDLER_ID, P60DockConfigTable.out_en_3.parameter_address, + tc_queue.appendleft((QueueCommands.PRINT, "P60 Dock: Enabling PDU2")) + command = pack_set_param_command(P60DOCK_HANDLER_ID, P60DockConfigTable.out_en_3.parameter_address, P60DockConfigTable.out_en_3.parameter_size, Channel.on) command = PusTelecommand(service=8, subservice=128, ssc=23, app_data=command) tc_queue.appendleft(command.pack_command_tuple()) if PDU2TestProcedure.all or PDU2TestProcedure.reboot: - tc_queue.appendleft(("print", "PDU2: Reboot")) + tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Reboot")) command = pack_reboot_command(object_id) command = PusTelecommand(service=8, subservice=128, ssc=22, app_data=command) tc_queue.appendleft(command.pack_command_tuple()) if PDU2TestProcedure.all or PDU2TestProcedure.read_gnd_wdt: - tc_queue.appendleft(("print", "PDU2: Reading ground watchdog timer value")) + tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Reading ground watchdog timer value")) command = pack_get_param_command(object_id, TableIds.hk, PDUHkTable.wdt_gnd_left.parameter_address, PDUHkTable.wdt_gnd_left.parameter_size) command = PusTelecommand(service=8, subservice=128, ssc=20, app_data=command) tc_queue.appendleft(command.pack_command_tuple()) if PDU2TestProcedure.all or PDU2TestProcedure.gnd_wdt_reset: - tc_queue.appendleft(("print", "PDU2: Testing ground watchdog reset")) + tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Testing ground watchdog reset")) command = pack_gnd_wdt_reset_command(object_id) command = PusTelecommand(service=8, subservice=128, ssc=21, app_data=command) tc_queue.appendleft(command.pack_command_tuple()) if PDU2TestProcedure.all or PDU2TestProcedure.ping: - tc_queue.appendleft(("print", "PDU2: Ping Test")) + tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Ping Test")) ping_data = bytearray([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) command = pack_ping_command(object_id, ping_data) command = PusTelecommand(service=8, subservice=128, ssc=22, app_data=command) tc_queue.appendleft(command.pack_command_tuple()) if PDU2TestProcedure.all or PDU2TestProcedure.channel_2_on: - tc_queue.appendleft(("print", "PDU2: Testing setting output channel 2 on (TCS Heater)")) + tc_queue.appendleft((QueueCommands.PRINT, + "PDU2: Testing setting output channel 2 on (TCS Heater)")) command = pack_set_param_command(object_id, PDUConfigTable.out_en_2.parameter_address, PDUConfigTable.out_en_2.parameter_size, Channel.on) command = PusTelecommand(service=8, subservice=128, ssc=23, app_data=command) tc_queue.appendleft(command.pack_command_tuple()) if PDU2TestProcedure.all or PDU2TestProcedure.read_temperature1: - tc_queue.appendleft(("print", "PDU2: Testing temperature reading")) + tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Testing temperature reading")) command = pack_get_param_command(object_id, TableIds.hk, PDUHkTable.temperature.parameter_address, PDUHkTable.temperature.parameter_size) command = PusTelecommand(service=8, subservice=128, ssc=24, app_data=command) tc_queue.appendleft(command.pack_command_tuple()) if PDU2TestProcedure.all or PDU2TestProcedure.read_channel_2_state: - tc_queue.appendleft(("print", "PDU2: Reading output channel 2 state (TCS Heater)")) + tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Reading output channel 2 state (TCS Heater)")) command = pack_get_param_command(object_id, TableIds.config, PDUConfigTable.out_en_2.parameter_address, PDUConfigTable.out_en_2.parameter_size) command = PusTelecommand(service=8, subservice=128, ssc=25, app_data=command) tc_queue.appendleft(command.pack_command_tuple()) if PDU2TestProcedure.all or PDU2TestProcedure.read_cur_lu_lim_0: - tc_queue.appendleft(("print", "PDU2: Reading current limit value of output channel 0 (OBC)")) - command = pack_get_param_command(object_id, TableIds.config, PDUConfigTable.cur_lu_lim_0.parameter_address, + tc_queue.appendleft((QueueCommands.PRINT, + "PDU2: Reading current limit value of output channel 0 (OBC)")) + command = pack_get_param_command(object_id, TableIds.config, + PDUConfigTable.cur_lu_lim_0.parameter_address, PDUConfigTable.cur_lu_lim_0.parameter_size) command = PusTelecommand(service=8, subservice=128, ssc=26, app_data=command) tc_queue.appendleft(command.pack_command_tuple()) if PDU2TestProcedure.all or PDU2TestProcedure.channel_2_off: - tc_queue.appendleft(("print", "PDU2: Testing setting output channel 2 off")) + tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Testing setting output channel 2 off")) command = pack_set_param_command(object_id, PDUConfigTable.out_en_2.parameter_address, PDUConfigTable.out_en_2.parameter_size, Channel.off) command = PusTelecommand(service=8, subservice=128, ssc=27, app_data=command) diff --git a/pus_tc/tmtcc_tc_service200_mode.py b/pus_tc/tmtcc_tc_service200_mode.py index 2f0641a..11d81fe 100644 --- a/pus_tc/tmtcc_tc_service200_mode.py +++ b/pus_tc/tmtcc_tc_service200_mode.py @@ -5,6 +5,7 @@ @author R. Mueller @date 02.05.2020 """ +from tmtc_core.core.tmtc_core_definitions import QueueCommands from tmtc_core.pus_tc.tmtcc_pus_tc_base import PusTelecommand from tmtc_core.pus_tc.tmtcc_pus_tc_packer import TcQueueT from tmtc_core.core.tmtcc_object_id_manager import get_object_id @@ -15,30 +16,30 @@ TEST_DEVICE_ID = get_object_id(ObjectIds.TEST_DEVICE) def pack_service200_test_into(tc_queue: TcQueueT) -> TcQueueT: - tc_queue.appendleft(("print", "Testing Service 200")) + tc_queue.appendleft((QueueCommands.PRINT, "Testing Service 200")) # Object ID: Dummy Device object_id = TEST_DEVICE_ID # Set On Mode - tc_queue.appendleft(("print", "Testing Service 200: Set Mode On")) + tc_queue.appendleft((QueueCommands.PRINT, "Testing Service 200: Set Mode On")) mode_data = pack_mode_data(object_id, 1, 0) command = PusTelecommand(service=200, subservice=1, ssc=2000, app_data=mode_data) tc_queue.appendleft(command.pack_command_tuple()) # Set Normal mode - tc_queue.appendleft(("print", "Testing Service 200: Set Mode Normal")) + tc_queue.appendleft((QueueCommands.PRINT, "Testing Service 200: Set Mode Normal")) mode_data = pack_mode_data(object_id, 2, 0) command = PusTelecommand(service=200, subservice=1, ssc=2010, app_data=mode_data) tc_queue.appendleft(command.pack_command_tuple()) # Set Raw Mode - tc_queue.appendleft(("print", "Testing Service 200: Set Mode Raw")) + tc_queue.appendleft((QueueCommands.PRINT, "Testing Service 200: Set Mode Raw")) mode_data = pack_mode_data(object_id, 3, 0) command = PusTelecommand(service=200, subservice=1, ssc=2020, app_data=mode_data) tc_queue.appendleft(command.pack_command_tuple()) # Set Off Mode - tc_queue.appendleft(("print", "Testing Service 200: Set Mode Off")) + tc_queue.appendleft((QueueCommands.PRINT, "Testing Service 200: Set Mode Off")) mode_data = pack_mode_data(object_id, 0, 0) command = PusTelecommand(service=200, subservice=1, ssc=2030, app_data=mode_data) tc_queue.appendleft(command.pack_command_tuple()) - tc_queue.appendleft(("export", "log/tmtc_log_service200.txt")) + tc_queue.appendleft((QueueCommands.EXPORT_LOG, "log/tmtc_log_service200.txt")) return tc_queue diff --git a/pus_tc/tmtcc_tc_tmp1075.py b/pus_tc/tmtcc_tc_tmp1075.py index 53d1c1b..6ce4131 100644 --- a/pus_tc/tmtcc_tc_tmp1075.py +++ b/pus_tc/tmtcc_tc_tmp1075.py @@ -5,7 +5,7 @@ @author J. Meier @date 06.01.2021 """ - +from tmtc_core.core.tmtc_core_definitions import QueueCommands from tmtc_core.pus_tc.tmtcc_pus_tc_packer import TcQueueT from tmtc_core.pus_tc.tmtcc_pus_tc_base import PusTelecommand from pus_tc.tmtcc_tc_service200_mode import pack_mode_data @@ -30,28 +30,28 @@ class Tmp1075ActionIds: def pack_tmp1075_test_into(object_id: bytearray, tc_queue: TcQueueT) -> TcQueueT: - tc_queue.appendleft(("print", "Testing Tmp1075 Temperature Sensor Handler")) + tc_queue.appendleft((QueueCommands.PRINT, "Testing Tmp1075 Temperature Sensor Handler")) if Tmp1075TestProcedure.all or Tmp1075TestProcedure.start_adc_conversion: - tc_queue.appendleft(("print", "TMP1075: Starting new temperature conversion")) + tc_queue.appendleft((QueueCommands.PRINT, "TMP1075: Starting new temperature conversion")) command = object_id + Tmp1075ActionIds.start_adc_conversion command = PusTelecommand(service=8, subservice=128, ssc=23, app_data=command) tc_queue.appendleft(command.pack_command_tuple()) if Tmp1075TestProcedure.all or Tmp1075TestProcedure.get_temp: - tc_queue.appendleft(("print", "TMP1075: Read temperature")) + tc_queue.appendleft((QueueCommands.PRINT, "TMP1075: Read temperature")) command = object_id + Tmp1075ActionIds.get_temp command = PusTelecommand(service=8, subservice=128, ssc=24, app_data=command) tc_queue.appendleft(command.pack_command_tuple()) if Tmp1075TestProcedure.set_mode_normal: - tc_queue.appendleft(("print", "TMP1075:: Set Mode Normal")) + tc_queue.appendleft((QueueCommands.PRINT, "TMP1075:: Set Mode Normal")) mode_data = pack_mode_data(object_id, 2, 0) command = PusTelecommand(service=200, subservice=1, ssc=220, app_data=mode_data) tc_queue.appendleft(command.pack_command_tuple()) if Tmp1075TestProcedure.set_mode_on: - tc_queue.appendleft(("print", "TMP1075: Set Mode On")) + tc_queue.appendleft((QueueCommands.PRINT, "TMP1075: Set Mode On")) mode_data = pack_mode_data(object_id, 1, 0) command = PusTelecommand(service=200, subservice=1, ssc=221, app_data=mode_data) tc_queue.appendleft(command.pack_command_tuple()) diff --git a/pus_tm/tmtcc_pus_hk_handling.py b/pus_tm/tmtcc_pus_hk_handling.py index 4128375..73eede3 100644 --- a/pus_tm/tmtcc_pus_hk_handling.py +++ b/pus_tm/tmtcc_pus_hk_handling.py @@ -6,7 +6,7 @@ """ from typing import Tuple -from tmtc_core.pus_tm.obsw_tm_service_3 import Service3Base +from tmtc_core.pus_tm.tmtcc_pus_service_3 import Service3Base from tmtc_core.utility.tmtcc_logger import get_logger LOGGER = get_logger() diff --git a/tmtc_core b/tmtc_core index e06ff9e..65a192f 160000 --- a/tmtc_core +++ b/tmtc_core @@ -1 +1 @@ -Subproject commit e06ff9ecdb43a0109ab0244a960995e233448ca6 +Subproject commit 65a192fdfc401969f142ffb2101b892137cd705e From 361eb39aa12cf99cc6fd3931dc829d5de6a09b94 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 3 Feb 2021 14:18:00 +0100 Subject: [PATCH 6/8] added init file for gomspace folder --- gomspace/__init__.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 gomspace/__init__.py diff --git a/gomspace/__init__.py b/gomspace/__init__.py new file mode 100644 index 0000000..e69de29 From d9fc5563cebcf9e0ccda9946c613cd16265c5d25 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 9 Feb 2021 12:46:30 +0100 Subject: [PATCH 7/8] updated core develop --- tmtc_core | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmtc_core b/tmtc_core index 65a192f..4b41bf4 160000 --- a/tmtc_core +++ b/tmtc_core @@ -1 +1 @@ -Subproject commit 65a192fdfc401969f142ffb2101b892137cd705e +Subproject commit 4b41bf458e9e724ad395afac537cad98adcba187 From a0280c880bc5e8da0302d97728c9972cc6df3778 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 9 Feb 2021 12:53:44 +0100 Subject: [PATCH 8/8] updated version tag for first release --- config/tmtcc_version.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/config/tmtcc_version.py b/config/tmtcc_version.py index 1a221ce..02f0eac 100644 --- a/config/tmtcc_version.py +++ b/config/tmtcc_version.py @@ -3,8 +3,6 @@ @details Template configuration file. Copy this folder to the TMTC commander root and adapt it to your needs. """ -import tmtc_core.core.tmtcc_version as core - -SW_NAME = core.SW_NAME -SW_VERSION = core.SW_VERSION -SW_SUBVERSION = core.SW_SUBVERSION +SW_NAME = "eive" +SW_VERSION = 1 +SW_SUBVERSION = 1