diff --git a/.gitignore b/.gitignore
index 50cba5f..ec6e113 100644
--- a/.gitignore
+++ b/.gitignore
@@ -13,3 +13,5 @@ log
/lib
/lib64
/share
+
+/venv
diff --git a/.idea/runConfigurations/PLOC_SUPV_Test.xml b/.idea/runConfigurations/PLOC_SUPV_Test.xml
new file mode 100644
index 0000000..843dd32
--- /dev/null
+++ b/.idea/runConfigurations/PLOC_SUPV_Test.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations/RW1_Test.xml b/.idea/runConfigurations/RW1_Test.xml
new file mode 100644
index 0000000..c013f3d
--- /dev/null
+++ b/.idea/runConfigurations/RW1_Test.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations/RW2_Test_.xml b/.idea/runConfigurations/RW2_Test_.xml
new file mode 100644
index 0000000..cd2434f
--- /dev/null
+++ b/.idea/runConfigurations/RW2_Test_.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations/RW3_Test_.xml b/.idea/runConfigurations/RW3_Test_.xml
new file mode 100644
index 0000000..6c98750
--- /dev/null
+++ b/.idea/runConfigurations/RW3_Test_.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations/RW4_Test_.xml b/.idea/runConfigurations/RW4_Test_.xml
new file mode 100644
index 0000000..e48dc3b
--- /dev/null
+++ b/.idea/runConfigurations/RW4_Test_.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations/tmtcc_Service_200_UDP.xml b/.idea/runConfigurations/tmtcc_Service_200_UDP.xml
index cec9e03..526925e 100644
--- a/.idea/runConfigurations/tmtcc_Service_200_UDP.xml
+++ b/.idea/runConfigurations/tmtcc_Service_200_UDP.xml
@@ -13,7 +13,7 @@
-
+
diff --git a/.idea/runConfigurations/tmtcclient_Heater_Test_UDP.xml b/.idea/runConfigurations/tmtcclient_Heater_Test_UDP.xml
new file mode 100644
index 0000000..a5895ff
--- /dev/null
+++ b/.idea/runConfigurations/tmtcclient_Heater_Test_UDP.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations/tmtcclient_IMTQ_Command_Dipole.xml b/.idea/runConfigurations/tmtcclient_IMTQ_Command_Dipole.xml
new file mode 100644
index 0000000..e532c40
--- /dev/null
+++ b/.idea/runConfigurations/tmtcclient_IMTQ_Command_Dipole.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations/tmtcclient_IMTQ_Get_Commanded_Dipole.xml b/.idea/runConfigurations/tmtcclient_IMTQ_Get_Commanded_Dipole.xml
new file mode 100644
index 0000000..7da3192
--- /dev/null
+++ b/.idea/runConfigurations/tmtcclient_IMTQ_Get_Commanded_Dipole.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations/tmtcclient_IMTQ_Neg_X_Test.xml b/.idea/runConfigurations/tmtcclient_IMTQ_Neg_X_Test.xml
new file mode 100644
index 0000000..ae172c6
--- /dev/null
+++ b/.idea/runConfigurations/tmtcclient_IMTQ_Neg_X_Test.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations/tmtcclient_IMTQ_Neg_Y_Test.xml b/.idea/runConfigurations/tmtcclient_IMTQ_Neg_Y_Test.xml
new file mode 100644
index 0000000..7a9c86d
--- /dev/null
+++ b/.idea/runConfigurations/tmtcclient_IMTQ_Neg_Y_Test.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations/tmtcclient_IMTQ_Neg_Z_Test.xml b/.idea/runConfigurations/tmtcclient_IMTQ_Neg_Z_Test.xml
new file mode 100644
index 0000000..5319fbe
--- /dev/null
+++ b/.idea/runConfigurations/tmtcclient_IMTQ_Neg_Z_Test.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations/tmtcclient_IMTQ_Pos_X_Test.xml b/.idea/runConfigurations/tmtcclient_IMTQ_Pos_X_Test.xml
new file mode 100644
index 0000000..2e73364
--- /dev/null
+++ b/.idea/runConfigurations/tmtcclient_IMTQ_Pos_X_Test.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations/tmtcclient_IMTQ_Pos_Y_Test.xml b/.idea/runConfigurations/tmtcclient_IMTQ_Pos_Y_Test.xml
new file mode 100644
index 0000000..d3a129d
--- /dev/null
+++ b/.idea/runConfigurations/tmtcclient_IMTQ_Pos_Y_Test.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations/tmtcclient_IMTQ_Pos_Z_Test.xml b/.idea/runConfigurations/tmtcclient_IMTQ_Pos_Z_Test.xml
new file mode 100644
index 0000000..73fcd50
--- /dev/null
+++ b/.idea/runConfigurations/tmtcclient_IMTQ_Pos_Z_Test.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations/tmtcclient_IMTQ_Test_UDP.xml b/.idea/runConfigurations/tmtcclient_IMTQ_Test_UDP.xml
new file mode 100644
index 0000000..6413dc4
--- /dev/null
+++ b/.idea/runConfigurations/tmtcclient_IMTQ_Test_UDP.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations/tmtcclient_PLOC_Test_UDP_Flatsat.xml b/.idea/runConfigurations/tmtcclient_PLOC_Test_UDP_Flatsat.xml
new file mode 100644
index 0000000..81d46a6
--- /dev/null
+++ b/.idea/runConfigurations/tmtcclient_PLOC_Test_UDP_Flatsat.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations/tmtcclient_PLOC_Test_UDP_Local.xml b/.idea/runConfigurations/tmtcclient_PLOC_Test_UDP_Local.xml
new file mode 100644
index 0000000..409787b
--- /dev/null
+++ b/.idea/runConfigurations/tmtcclient_PLOC_Test_UDP_Local.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations/tmtcclient_S_A_Deployment_Test_UDP.xml b/.idea/runConfigurations/tmtcclient_S_A_Deployment_Test_UDP.xml
new file mode 100644
index 0000000..bd78fc6
--- /dev/null
+++ b/.idea/runConfigurations/tmtcclient_S_A_Deployment_Test_UDP.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations/tmtcclient_Syrlinks_Test_UDP.xml b/.idea/runConfigurations/tmtcclient_Syrlinks_Test_UDP.xml
new file mode 100644
index 0000000..d3eb8eb
--- /dev/null
+++ b/.idea/runConfigurations/tmtcclient_Syrlinks_Test_UDP.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations/tmtcclient_TMP1075_1_Dock_Test_UDP.xml b/.idea/runConfigurations/tmtcclient_TMP1075_1_Dock_Test_UDP.xml
new file mode 100644
index 0000000..2670a02
--- /dev/null
+++ b/.idea/runConfigurations/tmtcclient_TMP1075_1_Dock_Test_UDP.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations/tmtcclient_TMP1075_2_Dock_Test_UDP.xml b/.idea/runConfigurations/tmtcclient_TMP1075_2_Dock_Test_UDP.xml
new file mode 100644
index 0000000..d1043e9
--- /dev/null
+++ b/.idea/runConfigurations/tmtcclient_TMP1075_2_Dock_Test_UDP.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/config/custom_mode_op.py b/config/custom_mode_op.py
index a82797b..159e350 100644
--- a/config/custom_mode_op.py
+++ b/config/custom_mode_op.py
@@ -6,9 +6,9 @@
import enum
from tmtccmd.core.backend import TmTcHandler
-from tmtccmd.utility.logger import get_logger
+from tmtccmd.utility.logger import get_console_logger
-LOGGER = get_logger()
+LOGGER = get_console_logger()
class CustomModeList(enum.IntEnum):
diff --git a/config/definitions.py b/config/definitions.py
index 75b7b21..771eb06 100644
--- a/config/definitions.py
+++ b/config/definitions.py
@@ -23,3 +23,9 @@ class CustomServiceList(enum.Enum):
PLOC = "ploc"
PCDU = "pcdu",
SA_DEPLYOMENT = "sa_depl"
+ REACTION_WHEEL_1 = "reaction_wheel_1"
+ REACTION_WHEEL_2 = "reaction_wheel_2"
+ REACTION_WHEEL_3 = "reaction_wheel_3"
+ REACTION_WHEEL_4 = "reaction_wheel_4"
+ RAD_SENSOR = "rad_sensor"
+ PLOC_SUPV = "ploc_supv"
diff --git a/config/globals_config.py b/config/globals_config.py
index b8274bb..3fc9b35 100644
--- a/config/globals_config.py
+++ b/config/globals_config.py
@@ -14,9 +14,9 @@ from config.custom_mode_op import CustomModeList
from tmtccmd.config.definitions import CoreComInterfaces
from tmtccmd.config.globals import set_default_globals_pre_args_parsing, \
set_default_globals_post_args_parsing
-from tmtccmd.utility.logger import get_logger
+from tmtccmd.utility.logger import get_console_logger
-LOGGER = get_logger()
+LOGGER = get_console_logger()
class CustomGlobalIds(enum.Enum):
diff --git a/config/hook_implementations.py b/config/hook_implementations.py
index 3b0e2ac..52fa233 100644
--- a/config/hook_implementations.py
+++ b/config/hook_implementations.py
@@ -2,14 +2,15 @@ import argparse
from typing import Union, Dict, Tuple
from tmtccmd.config.definitions import ServiceOpCodeDictT
-from tmtccmd.pus_tm.service_3_base import Service3Base
+from tmtccmd.tm.service_3_base import Service3Base
from tmtccmd.ecss.tm import PusTelemetry
-from tmtccmd.pus_tc.definitions import TcQueueT
+from tmtccmd.tc.definitions import TcQueueT
from tmtccmd.com_if.com_interface_base import CommunicationInterface
from tmtccmd.core.backend import TmTcHandler
from tmtccmd.config.hook import TmTcHookBase
from tmtccmd.utility.tmtc_printer import TmTcPrinter
from tmtccmd.config.globals import OpCodeDictKeys
+from config.object_ids import RW1_ID
from config.definitions import CustomServiceList
@@ -63,15 +64,54 @@ class EiveHookObject(TmTcHookBase):
}
service_imtq_tuple = ("IMTQ Device", op_code_dict_srv_imtq)
+ op_code_dict_srv_rw = {
+ "0": ("Reaction Wheel: Run all commands", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "1": ("Reaction Wheel: Set speed", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "2": ("Reaction Wheel: Set mode on", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "3": ("Reaction Wheel: Set mode normal", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "4": ("Reaction Wheel: Set mode off", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "5": ("Reaction Wheel: Send get-telemetry-command", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ }
+ service_rw_tuple = ("Reaction Wheel", op_code_dict_srv_rw)
+
+ op_code_dict_srv_rad_sensor = {
+ "0": ("Radiation Sensor: Set mode on", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "1": ("Radiation Sensor: Set mode normal", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "2": ("Radiation Sensor: Set mode off", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ }
+ service_rad_sensor_tuple = ("Radiation Sensor", op_code_dict_srv_rad_sensor)
+
+ op_code_dict_srv_ploc_supv = {
+ "0": ("PLOC Supervisor: Set mode on", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "1": ("PLOC Supervisor: Set mode normal", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "2": ("PLOC Supervisor: Set mode off", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "3": ("PLOC Supervisor: Get HK Report", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "4": ("PLOC Supervisor: Restart MPSoC", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "5": ("PLOC Supervisor: Start MPSoC", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "6": ("PLOC Supervisor: Shutdown MPSoC", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "7": ("PLOC Supervisor: Select MPSoC boot image", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "8": ("PLOC Supervisor: Set max restart tries", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "9": ("PLOC Supervisor: Reset MPSoC", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "10": ("PLOC Supervisor: Set time reference", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "11": ("PLOC Supervisor: Set boot timeout", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "12": ("PLOC Supervisor: Disable Hk", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ }
+ service_ploc_supv_tuple = ("PLOC Supervisor", op_code_dict_srv_ploc_supv)
+
service_op_code_dict[CustomServiceList.ACU.value] = service_acu_tuple
service_op_code_dict[CustomServiceList.TMP1075_1.value] = service_tmp1075_1_tuple
service_op_code_dict[CustomServiceList.TMP1075_2.value] = service_tmp1075_2_tuple
service_op_code_dict[CustomServiceList.P60DOCK.value] = service_p60_tuple
service_op_code_dict[CustomServiceList.PDU1.value] = service_pdu1_tuple
service_op_code_dict[CustomServiceList.PDU1.value] = service_pdu2_tuple
- service_op_code_dict[CustomServiceList.PDU1.value] = service_pdu2_tuple
service_op_code_dict[CustomServiceList.HEATER.value] = service_heater_tuple
service_op_code_dict[CustomServiceList.IMTQ.value] = service_imtq_tuple
+ service_op_code_dict[CustomServiceList.REACTION_WHEEL_1.value] = service_rw_tuple
+ service_op_code_dict[CustomServiceList.REACTION_WHEEL_2.value] = service_rw_tuple
+ service_op_code_dict[CustomServiceList.REACTION_WHEEL_3.value] = service_rw_tuple
+ service_op_code_dict[CustomServiceList.REACTION_WHEEL_4.value] = service_rw_tuple
+ service_op_code_dict[CustomServiceList.RAD_SENSOR.value] = service_rad_sensor_tuple
+ service_op_code_dict[CustomServiceList.PLOC_SUPV.value] = service_ploc_supv_tuple
return service_op_code_dict
def get_json_config_file_path(self) -> str:
@@ -98,7 +138,7 @@ class EiveHookObject(TmTcHookBase):
from tmtccmd.config.com_if import create_communication_interface_default
return create_communication_interface_default(
com_if_key=com_if_key, tmtc_printer=tmtc_printer,
- json_cfg_path=self.get_json_config_file_path()
+ json_cfg_path=self.get_json_config_file_path(), space_packet_id=0x0865
)
def perform_mode_operation(self, tmtc_backend: TmTcHandler, mode: int):
@@ -134,3 +174,12 @@ class EiveHookObject(TmTcHookBase):
return handle_user_hk_packet(
object_id=object_id, set_id=set_id, hk_data=hk_data, service3_packet=service3_packet
)
+
+ @staticmethod
+ def handle_service_5_event(
+ object_id: bytes, event_id: int, param_1: int, param_2: int
+ ) -> str:
+ if object_id == RW1_ID:
+ if event_id == 1:
+ return ""
+ return ""
diff --git a/config/object_ids.py b/config/object_ids.py
index 3dd4c29..5d6b3e7 100644
--- a/config/object_ids.py
+++ b/config/object_ids.py
@@ -6,19 +6,26 @@
from typing import Dict
PUS_SERVICE_17_ID = bytes([0x53, 0x00, 0x00, 0x17])
-TEST_DEVICE_ID = bytes([0x44, 0x00, 0xAF, 0xFE])
-P60_DOCK_HANDLER = bytes([0x44, 0x00, 0x00, 0x1])
-PDU_1_HANDLER_ID = bytes([0x44, 0x00, 0x00, 0x2])
-PDU_2_HANDLER_ID = bytes([0x44, 0x00, 0x00, 0x3])
-ACU_HANDLER_ID = bytes([0x44, 0x00, 0x00, 0x4])
-TMP_1075_1_HANDLER_ID = bytes([0x44, 0x00, 0x00, 0x5])
-TMP_1075_2_HANDLER_ID = bytes([0x44, 0x00, 0x00, 0x6])
-HEATER_ID = bytes([0x54, 0x00, 0x00, 0x1])
-PCDU_HANDLER_ID = bytes([0x44, 0x00, 0x10, 0x00])
-SOLAR_ARRAY_DEPLOYMENT_ID = bytes([0x44, 0x00, 0x10, 0x01])
-SYRLINKS_HANDLER = bytes([0x44, 0x00, 0x10, 0x02])
-IMTQ_HANDLER_ID = bytearray([0x44, 0x00, 0x00, 0x14])
-PLOC_ID = bytearray([0x44, 0x00, 0x00, 0x15])
+TEST_DEVICE_ID = bytes([0x54, 0x00, 0xAF, 0xFE])
+P60_DOCK_HANDLER = bytes([0x44, 0x25, 0x00, 0x00])
+PDU_1_HANDLER_ID = bytes([0x44, 0x25, 0x00, 0x01])
+PDU_2_HANDLER_ID = bytes([0x44, 0x25, 0x00, 0x02])
+ACU_HANDLER_ID = bytes([0x44, 0x25, 0x00, 0x03])
+TMP_1075_1_HANDLER_ID = bytes([0x44, 0x42, 0x00, 0x04])
+TMP_1075_2_HANDLER_ID = bytes([0x44, 0x42, 0x00, 0x05])
+HEATER_ID = bytes([0x44, 0x41, 0x00, 0xA4])
+PCDU_HANDLER_ID = bytes([0x44, 0x20, 0x00, 0xA1])
+SOLAR_ARRAY_DEPLOYMENT_ID = bytes([0x44, 0x41, 0x10, 0xA2])
+SYRLINKS_HANDLER = bytes([0x44, 0x53, 0x00, 0xA3])
+IMTQ_HANDLER_ID = bytes([0x44, 0x14, 0x00, 0x14])
+PLOC_MPSOC_ID = bytes([0x44, 0x33, 0x00, 0x15])
+RW1_ID = bytes([0x44, 0x12, 0x00, 0x1])
+RW2_ID = bytes([0x44, 0x12, 0x00, 0x2])
+RW3_ID = bytes([0x44, 0x12, 0x00, 0x3])
+RW4_ID = bytes([0x44, 0x12, 0x00, 0x4])
+START_TRACKER_ID = bytes([0x44, 0x13, 0x00, 0x1])
+RAD_SENSOR_ID = bytes([0x44, 0x32, 0x00, 0xA5])
+PLOC_SUPV_ID = bytes([0x44, 0x33, 0x00, 0x16])
def get_object_ids() -> Dict[bytes, list]:
@@ -34,5 +41,11 @@ def get_object_ids() -> Dict[bytes, list]:
HEATER_ID: "Heater",
PCDU_HANDLER_ID: "PCDU",
SOLAR_ARRAY_DEPLOYMENT_ID: "Solar Array Deployment",
+ RW1_ID: "Reaction Wheel 1",
+ RW2_ID: "Reaction Wheel 2",
+ RW3_ID: "Reaction Wheel 3",
+ RW4_ID: "Reaction Wheel 4",
+ RAD_SENSOR_ID: "Radiation Sensor",
+ PLOC_SUPV_ID: "PLOC Supervisor",
})
return object_id_dict
diff --git a/config/version.py b/config/version.py
index ef8fd1f..e1d7641 100644
--- a/config/version.py
+++ b/config/version.py
@@ -1,4 +1,6 @@
SW_NAME = "eive"
VERSION_MAJOR = 1
-VERSION_MINOR = 6
-VERSION_SUBMINOR = 1
+VERSION_MINOR = 7
+VERSION_SUBMINOR = 0
+
+__version__ = "1.7.0"
diff --git a/lint.py b/lint.py
new file mode 100755
index 0000000..f0f66f0
--- /dev/null
+++ b/lint.py
@@ -0,0 +1,15 @@
+#!/usr/bin/env python3
+import os
+import sys
+
+
+def main():
+ status = os.system("flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics")
+ if os.WEXITSTATUS(status) != 0:
+ print("Flake8 linter errors")
+ sys.exit(0)
+ os.system("flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics")
+
+
+if __name__ == "__main__":
+ main()
diff --git a/pus_tc/acu.py b/pus_tc/acu.py
index 969e0fb..9e06242 100644
--- a/pus_tc/acu.py
+++ b/pus_tc/acu.py
@@ -6,7 +6,7 @@
@date 21.12.2020
"""
-from tmtccmd.pus_tc.packer import TcQueueT
+from tmtccmd.tc.packer import TcQueueT
from tmtccmd.ecss.tc import PusTelecommand
from tmtccmd.config.definitions import QueueCommands
from gomspace.gomspace_common import *
diff --git a/pus_tc/heater.py b/pus_tc/heater.py
index 51a247f..18adf80 100644
--- a/pus_tc/heater.py
+++ b/pus_tc/heater.py
@@ -6,7 +6,7 @@
@date 30.01.2021
"""
from tmtccmd.config.definitions import QueueCommands
-from tmtccmd.pus_tc.packer import TcQueueT
+from tmtccmd.tc.packer import TcQueueT
from tmtccmd.ecss.tc import PusTelecommand
diff --git a/pus_tc/imtq.py b/pus_tc/imtq.py
index c6bee28..943157c 100644
--- a/pus_tc/imtq.py
+++ b/pus_tc/imtq.py
@@ -7,26 +7,9 @@
"""
from tmtccmd.config.definitions import QueueCommands
-from tmtccmd.pus_tc.packer import TcQueueT
+from tmtccmd.tc.packer import TcQueueT
from tmtccmd.ecss.tc import PusTelecommand
-from tmtccmd.pus_tc.service_3_housekeeping import make_sid, generate_one_hk_command
-
-
-class ImtqTestProcedure:
- """
- @brief Use this class to define the tests to perform for the IMTQ Handler.
- @details Setting all to True will run all tests.
- Setting all to False will only run the tests set to True.
- """
- all = False
- command_dipole = False
- get_commanded_dipole = False
- positive_x_test = True
- negative_x_test = False
- positive_y_test = False
- negative_y_test = False
- positive_z_test = False
- negative_z_test = False
+from tmtccmd.tc.service_3_housekeeping import make_sid, generate_one_hk_command
class ImtqSetIds:
@@ -178,7 +161,7 @@ def pack_imtq_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code: str)
def pack_dipole_command(object_id: bytearray, x_dipole: int, y_dipole: int, z_dipole: int, duration: int) -> bytearray:
""" This function packs the command causing the ISIS IMTQ to generate a dipole.
- @param object_id The object id of the gomspace device handler.
+ @param object_id The object id of the IMTQ handler.
@param x_dipole The dipole of the x coil in 10^-4*Am^2 (max. 2000)
@param y_dipole The dipole of the y coil in 10^-4*Am^2 (max. 2000)
@param z_dipole The dipole of the z coil in 10^-4*Am^2 (max. 2000)
diff --git a/pus_tc/p60dock.py b/pus_tc/p60dock.py
index e269047..9b1bef8 100644
--- a/pus_tc/p60dock.py
+++ b/pus_tc/p60dock.py
@@ -6,7 +6,7 @@
@date 13.12.2020
"""
from tmtccmd.config.definitions import QueueCommands
-from tmtccmd.pus_tc.packer import TcQueueT
+from tmtccmd.tc.packer import TcQueueT
from tmtccmd.ecss.tc import PusTelecommand
from gomspace.gomspace_common import *
diff --git a/pus_tc/pdu1.py b/pus_tc/pdu1.py
index 0130040..fc52e65 100644
--- a/pus_tc/pdu1.py
+++ b/pus_tc/pdu1.py
@@ -7,7 +7,7 @@
"""
from tmtccmd.config.definitions import QueueCommands
-from tmtccmd.pus_tc.packer import TcQueueT
+from tmtccmd.tc.packer import TcQueueT
from tmtccmd.ecss.tc import PusTelecommand
from gomspace.gomspace_common import *
from pus_tc.p60dock import P60DockConfigTable
diff --git a/pus_tc/pdu2.py b/pus_tc/pdu2.py
index e6e8080..2beede5 100644
--- a/pus_tc/pdu2.py
+++ b/pus_tc/pdu2.py
@@ -6,7 +6,7 @@
@date 17.12.2020
"""
from tmtccmd.config.definitions import QueueCommands
-from tmtccmd.pus_tc.packer import TcQueueT
+from tmtccmd.tc.packer import TcQueueT
from tmtccmd.ecss.tc import PusTelecommand
from gomspace.gomspace_common import *
from gomspace.gomspace_pdu_definitions import *
diff --git a/pus_tc/ploc.py b/pus_tc/ploc_mpsoc.py
similarity index 87%
rename from pus_tc/ploc.py
rename to pus_tc/ploc_mpsoc.py
index b8d593a..d7a2977 100644
--- a/pus_tc/ploc.py
+++ b/pus_tc/ploc_mpsoc.py
@@ -1,15 +1,16 @@
# -*- coding: utf-8 -*-
"""
-@file ploc.py
-@brief TMP1075 tests
+@file ploc_mpsoc.py
+@brief Tests for commanding the MPSoC of the PLOC.
+ The MPSoC is programmed by the ILH.
@author J. Meier
-@date 06.01.2021
+@date 06.03.2021
"""
import struct
from tmtccmd.config.definitions import QueueCommands
-from tmtccmd.pus_tc.packer import TcQueueT
+from tmtccmd.tc.packer import TcQueueT
from tmtccmd.ecss.tc import PusTelecommand
@@ -33,10 +34,10 @@ class PlocReplyIds:
tm_mem_read_report = 6
-def pack_ploc_test_into(object_id: bytearray, tc_queue: TcQueueT) -> TcQueueT:
+def pack_ploc_mpsoc_test_into(object_id: bytearray, tc_queue: TcQueueT) -> TcQueueT:
tc_queue.appendleft(
(QueueCommands.PRINT,
- "Testing PLOC Handler with object id: 0x" + object_id.hex())
+ "Testing PLOC MPSoC with object id: 0x" + object_id.hex())
)
if PlocTestProcedure.all or PlocTestProcedure.test_tc_mem_write:
diff --git a/pus_tc/ploc_supervisor.py b/pus_tc/ploc_supervisor.py
new file mode 100644
index 0000000..a1e8523
--- /dev/null
+++ b/pus_tc/ploc_supervisor.py
@@ -0,0 +1,114 @@
+# -*- coding: utf-8 -*-
+"""
+@file ploc_supervisor.py
+@brief Tests for commanding the supervisor of the PLOC.
+ The supervisor is programmed by Thales.
+@author J. Meier
+@date 10.07.2021
+"""
+import struct
+
+from tmtccmd.config.definitions import QueueCommands
+
+from tmtccmd.tc.packer import TcQueueT
+from tmtccmd.ecss.tc import PusTelecommand
+
+
+class SupvActionIds:
+ HK_REPORT = 1
+ RESTART_MPSOC = 2
+ START_MPSOC = 3
+ SHUTWOWN_MPSOC = 4
+ SEL_MPSOC_BOOT_IMAGE = 5
+ SET_BOOT_TIMEOUT = 6
+ SET_MAX_RESTART_TRIES = 7
+ RESET_MPSOC = 8
+ SET_TIME_REF = 9
+ DISABLE_HK = 10
+
+
+class SupvHkIds:
+ HK_REPORT = 52
+
+
+def pack_ploc_supv_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code: str) -> TcQueueT:
+ tc_queue.appendleft(
+ (QueueCommands.PRINT,
+ "Testing PLOC Supervisor with object id: 0x" + object_id.hex())
+ )
+
+ if op_code == "3":
+ tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: TC Get Hk Report"))
+ command = object_id + struct.pack('!I', SupvActionIds.HK_REPORT)
+ command = PusTelecommand(service=8, subservice=128, ssc=20, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ elif op_code == "4":
+ tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Restart MPSoC"))
+ command = object_id + struct.pack('!I', SupvActionIds.RESTART_MPSOC)
+ command = PusTelecommand(service=8, subservice=128, ssc=21, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ elif op_code == "5":
+ tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Start MPSoC"))
+ command = object_id + struct.pack('!I', SupvActionIds.START_MPSOC)
+ command = PusTelecommand(service=8, subservice=128, ssc=22, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ elif op_code == "6":
+ tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Shutdown MPSoC"))
+ command = object_id + struct.pack('!I', SupvActionIds.SHUTWOWN_MPSOC)
+ command = PusTelecommand(service=8, subservice=128, ssc=23, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ elif op_code == "7":
+ tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Select MPSoC boot image"))
+ mem = int(input("MEM (NVM0 - 0 or NVM1 - 1):"))
+ bp0 = int(input("BP0 (0 or 1):"))
+ bp1 = int(input("BP1 (0 or 1):"))
+ bp2 = int(input("BP2 (0 or 1):"))
+ command = pack_sel_boot_image_cmd(object_id, mem, bp0, bp1, bp2)
+ command = PusTelecommand(service=8, subservice=128, ssc=24, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ elif op_code == "8":
+ tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Set max restart tries"))
+ restart_tries = int(input("Set maximum restart tries:"))
+ command = object_id + struct.pack('!I', SupvActionIds.SET_MAX_RESTART_TRIES) + struct.pack('!B', restart_tries)
+ command = PusTelecommand(service=8, subservice=128, ssc=25, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ elif op_code == "9":
+ tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Reset MPSoC"))
+ command = object_id + struct.pack('!I', SupvActionIds.RESET_MPSOC)
+ command = PusTelecommand(service=8, subservice=128, ssc=26, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ elif op_code == "10":
+ tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Set time reference"))
+ command = object_id + struct.pack('!I', SupvActionIds.SET_TIME_REF)
+ command = PusTelecommand(service=8, subservice=128, ssc=27, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ elif op_code == "11":
+ tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Set boot timeout"))
+ boot_timeout = int(input("Specify boot timeout [ms]:"))
+ command = object_id + struct.pack('!I', SupvActionIds.SET_BOOT_TIMEOUT) + struct.pack('!I', boot_timeout)
+ command = PusTelecommand(service=8, subservice=128, ssc=28, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ elif op_code == "12":
+ tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Disable HK"))
+ command = object_id + struct.pack('!I', SupvActionIds.DISABLE_HK)
+ command = PusTelecommand(service=8, subservice=128, ssc=28, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+
+ return tc_queue
+
+
+def pack_sel_boot_image_cmd(object_id: bytearray, mem: int, bp0: int, bp1: int, bp2: int) -> bytearray:
+ """ This function can be used to generate the command to select the image from which the MPSoC will boot
+ @param object_id The object id of the PLOC supervisor handler.
+ @param mem The memory from which the MPSoC shall boot (NVM0 - 0, NVM1 - 1)
+ @param bp0 Partition pin 0
+ @param bp1 Partition pin 1
+ @param bp2 Partition pin 2
+ """
+ command = bytearray()
+ command = object_id + struct.pack('!I', SupvActionIds.SEL_MPSOC_BOOT_IMAGE)
+ command = command + struct.pack('!B', mem)
+ command = command + struct.pack('!B', bp0)
+ command = command + struct.pack('!B', bp1)
+ command = command + struct.pack('!B', bp2)
+ return command
diff --git a/pus_tc/rad_sensor.py b/pus_tc/rad_sensor.py
new file mode 100644
index 0000000..a462c13
--- /dev/null
+++ b/pus_tc/rad_sensor.py
@@ -0,0 +1,38 @@
+# -*- coding: utf-8 -*-
+"""
+@file rad_sensor.py
+@brief Tests for the radiation sensor handler
+@author J. Meier
+@date 01.07.2021
+"""
+import struct
+from tmtccmd.config.definitions import QueueCommands
+
+from tmtccmd.tc.packer import TcQueueT
+from tmtccmd.ecss.tc import PusTelecommand
+from pus_tc.service_200_mode import pack_mode_data
+
+
+def pack_rad_sensor_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code: str) -> TcQueueT:
+ tc_queue.appendleft(
+ (QueueCommands.PRINT,
+ "Testing radiation sensor handler with object id: 0x" + object_id.hex())
+ )
+
+ if op_code == "0":
+ tc_queue.appendleft((QueueCommands.PRINT, "Rad sensor: Switch to mode on"))
+ mode_data = pack_mode_data(object_id, 1, 0)
+ command = PusTelecommand(service=200, subservice=1, ssc=41, app_data=mode_data)
+ tc_queue.appendleft(command.pack_command_tuple())
+
+ if op_code == "1":
+ tc_queue.appendleft((QueueCommands.PRINT, "Rad sensor: Switch to mode normal"))
+ mode_data = pack_mode_data(object_id, 2, 0)
+ command = PusTelecommand(service=200, subservice=1, ssc=42, app_data=mode_data)
+ tc_queue.appendleft(command.pack_command_tuple())
+
+ if op_code == "2":
+ tc_queue.appendleft((QueueCommands.PRINT, "Rad sensor: Switch to mode off"))
+ mode_data = pack_mode_data(object_id, 0, 0)
+ command = PusTelecommand(service=200, subservice=1, ssc=42, app_data=mode_data)
+ tc_queue.appendleft(command.pack_command_tuple())
\ No newline at end of file
diff --git a/pus_tc/reaction_wheels.py b/pus_tc/reaction_wheels.py
new file mode 100644
index 0000000..0c48491
--- /dev/null
+++ b/pus_tc/reaction_wheels.py
@@ -0,0 +1,93 @@
+# -*- coding: utf-8 -*-
+"""
+@file reaction_wheels.py
+@brief Tests for the reaction wheel handler
+@author J. Meier
+@date 20.06.2021
+"""
+import struct
+from tmtccmd.config.definitions import QueueCommands
+
+from tmtccmd.tc.packer import TcQueueT
+from tmtccmd.ecss.tc import PusTelecommand
+from pus_tc.service_200_mode import pack_mode_data
+
+
+class RwSetIds:
+ STATUS_SET_ID = 4
+ TEMPERATURE_SET_ID = 8
+
+
+class RwCommandIds:
+ RESET_MCU = bytearray([0x0, 0x0, 0x0, 0x01])
+ # Reads status information from reaction wheel into dataset with id 4
+ GET_RW_STATUS = bytearray([0x0, 0x0, 0x0, 0x04])
+ INIT_RW_CONTROLLER = bytearray([0x0, 0x0, 0x0, 0x05])
+ SET_SPEED = bytearray([0x0, 0x0, 0x0, 0x06])
+ # Reads temperature from reaction wheel into dataset with id 8
+ GET_TEMPERATURE = bytearray([0x0, 0x0, 0x0, 0x08])
+ GET_TM = bytearray([0x0, 0x0, 0x0, 0x09])
+
+
+class SpeedDefinitions:
+ RPM_100 = 1000
+ RPM_5000 = 5000
+
+
+class RampTime:
+ MS_1000 = 1000
+
+
+def pack_single_rw_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code: str) -> TcQueueT:
+ tc_queue.appendleft(
+ (QueueCommands.PRINT,
+ "Testing reaction wheel handler with object id: 0x" + object_id.hex())
+ )
+
+ if op_code == "0" or op_code == "1":
+ speed = int(input("Specify speed [0.1 RPM]: "))
+ ramp_time = int(input("Specify ramp time [ms]: "))
+ tc_queue.appendleft((QueueCommands.PRINT, "Reaction Wheel: Set speed"))
+ command = pack_set_speed_command(object_id, speed, ramp_time)
+ command = PusTelecommand(service=8, subservice=128, ssc=40, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+
+ if op_code == "2":
+ tc_queue.appendleft((QueueCommands.PRINT, "Reaction Wheel: Switch to mode on"))
+ mode_data = pack_mode_data(object_id, 1, 0)
+ command = PusTelecommand(service=200, subservice=1, ssc=41, app_data=mode_data)
+ tc_queue.appendleft(command.pack_command_tuple())
+
+ if op_code == "3":
+ tc_queue.appendleft((QueueCommands.PRINT, "Reaction Wheel: Switch to mode normal"))
+ mode_data = pack_mode_data(object_id, 2, 0)
+ command = PusTelecommand(service=200, subservice=1, ssc=42, app_data=mode_data)
+ tc_queue.appendleft(command.pack_command_tuple())
+
+ if op_code == "4":
+ tc_queue.appendleft((QueueCommands.PRINT, "Reaction Wheel: Switch to mode off"))
+ mode_data = pack_mode_data(object_id, 0, 0)
+ command = PusTelecommand(service=200, subservice=1, ssc=43, app_data=mode_data)
+ tc_queue.appendleft(command.pack_command_tuple())
+
+ if op_code == "5":
+ tc_queue.appendleft((QueueCommands.PRINT, "Reaction Wheel: Send get-telemetry-command"))
+ command = object_id + RwCommandIds.GET_TM
+ command = PusTelecommand(service=8, subservice=128, ssc=44, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ return tc_queue
+
+
+def pack_set_speed_command(object_id: bytearray, speed: int, ramp_time: int) -> bytearray:
+ """ With this function a command is packed to set the speed of a reaction wheel
+ @param object_id The object id of the reaction wheel handler.
+ @param speed Valid speeds are [-65000, -1000] and [1000, 65000]. Values are specified in 0.1 * RPM
+ @param ramp_time The time after which the reaction wheel will reached the commanded speed. Valid times are
+ 10 - 10000 ms
+ """
+ command_id = RwCommandIds.SET_SPEED
+ command = bytearray()
+ command = object_id + command_id
+ command = command + struct.pack('!i', speed)
+ command = command + ramp_time.to_bytes(length=2, byteorder='big')
+ return command
diff --git a/pus_tc/service_200_mode.py b/pus_tc/service_200_mode.py
index c49f5e0..4bc8cdb 100644
--- a/pus_tc/service_200_mode.py
+++ b/pus_tc/service_200_mode.py
@@ -7,8 +7,8 @@
"""
from tmtccmd.config.definitions import QueueCommands
from tmtccmd.ecss.tc import PusTelecommand
-from tmtccmd.pus_tc.packer import TcQueueT
-from tmtccmd.pus_tc.service_200_mode import pack_mode_data
+from tmtccmd.tc.packer import TcQueueT
+from tmtccmd.tc.service_200_mode import pack_mode_data
from config.object_ids import TEST_DEVICE_ID
TEST_DEVICE_OBJ_ID = TEST_DEVICE_ID
diff --git a/pus_tc/solar_array_deployment.py b/pus_tc/solar_array_deployment.py
index 6b63cae..f6a9b69 100644
--- a/pus_tc/solar_array_deployment.py
+++ b/pus_tc/solar_array_deployment.py
@@ -6,8 +6,8 @@
@date 15.02.2021
"""
from tmtccmd.config.definitions import QueueCommands
-from tmtccmd.pus_tc.definitions import TcQueueT
-from tmtccmd.pus_tc.packer import PusTelecommand
+from tmtccmd.tc.definitions import TcQueueT
+from tmtccmd.tc.packer import PusTelecommand
class ActionIds:
diff --git a/pus_tc/syrlinks_hk_handler.py b/pus_tc/syrlinks_hk_handler.py
index b3b8be7..bbdb0c2 100644
--- a/pus_tc/syrlinks_hk_handler.py
+++ b/pus_tc/syrlinks_hk_handler.py
@@ -7,8 +7,8 @@
"""
from tmtccmd.config.definitions import QueueCommands
-from tmtccmd.pus_tc.definitions import TcQueueT
-from tmtccmd.pus_tc.service_3_housekeeping import make_sid, generate_one_hk_command
+from tmtccmd.tc.definitions import TcQueueT
+from tmtccmd.tc.service_3_housekeeping import make_sid, generate_one_hk_command
class SetIds:
diff --git a/pus_tc/tc_packer_hook.py b/pus_tc/tc_packer_hook.py
index 41b572b..80d893f 100644
--- a/pus_tc/tc_packer_hook.py
+++ b/pus_tc/tc_packer_hook.py
@@ -9,25 +9,30 @@ from collections import deque
from typing import Union
from tmtccmd.config.definitions import CoreServiceList
-from tmtccmd.utility.logger import get_logger
-from tmtccmd.pus_tc.definitions import TcQueueT
-from tmtccmd.pus_tc.service_5_event import pack_generic_service5_test_into
-from tmtccmd.pus_tc.service_17_test import pack_service17_ping_command
+from tmtccmd.utility.logger import get_console_logger
+from tmtccmd.tc.definitions import TcQueueT
+from tmtccmd.tc.service_5_event import pack_generic_service5_test_into
+from tmtccmd.tc.service_17_test import pack_service17_ping_command
+from pus_tc.service_200_mode import pack_service200_test_into
from pus_tc.p60dock import pack_p60dock_test_into
from pus_tc.pdu2 import pack_pdu2_test_into
from pus_tc.pdu1 import pack_pdu1_test_into
from pus_tc.acu import pack_acu_test_into
from pus_tc.imtq import pack_imtq_test_into
from pus_tc.tmp1075 import pack_tmp1075_test_into
-from pus_tc.ploc import pack_ploc_test_into
+from pus_tc.ploc_mpsoc import pack_ploc_mpsoc_test_into
+from pus_tc.ploc_supervisor import pack_ploc_supv_test_into
from pus_tc.heater import pack_heater_test_into
+from pus_tc.reaction_wheels import pack_single_rw_test_into
+from pus_tc.rad_sensor import pack_rad_sensor_test_into
from config.definitions import CustomServiceList
from config.object_ids import P60_DOCK_HANDLER, PDU_1_HANDLER_ID, PDU_2_HANDLER_ID, ACU_HANDLER_ID, \
- TMP_1075_1_HANDLER_ID, TMP_1075_2_HANDLER_ID, HEATER_ID, IMTQ_HANDLER_ID, PLOC_ID
+ TMP_1075_1_HANDLER_ID, TMP_1075_2_HANDLER_ID, HEATER_ID, IMTQ_HANDLER_ID, PLOC_MPSOC_ID, RW1_ID, RW2_ID, RW3_ID, RW4_ID, \
+ RAD_SENSOR_ID, PLOC_SUPV_ID
-LOGGER = get_logger()
+LOGGER = get_console_logger()
def pack_service_queue_user(service: Union[str, int], op_code: str, service_queue: TcQueueT):
@@ -35,6 +40,8 @@ def pack_service_queue_user(service: Union[str, int], op_code: str, service_queu
return pack_generic_service5_test_into(tc_queue=service_queue)
if service == CoreServiceList.SERVICE_17.value:
return service_queue.appendleft(pack_service17_ping_command(ssc=1700).pack_command_tuple())
+ if service == CoreServiceList.SERVICE_200.value:
+ return pack_service200_test_into(tc_queue=service_queue)
if service == CustomServiceList.P60DOCK.value:
object_id = P60_DOCK_HANDLER
return pack_p60dock_test_into(object_id=object_id, tc_queue=service_queue)
@@ -66,8 +73,26 @@ def pack_service_queue_user(service: Union[str, int], op_code: str, service_queu
object_id = IMTQ_HANDLER_ID
return pack_imtq_test_into(object_id=object_id, tc_queue=service_queue, op_code=op_code)
if service == CustomServiceList.PLOC.value:
- object_id = PLOC_ID
- return pack_ploc_test_into(object_id=object_id, tc_queue=service_queue)
+ object_id = PLOC_MPSOC_ID
+ return pack_ploc_mpsoc_test_into(object_id=object_id, tc_queue=service_queue)
+ if service == CustomServiceList.REACTION_WHEEL_1.value:
+ object_id = RW1_ID
+ return pack_single_rw_test_into(object_id=object_id, tc_queue=service_queue, op_code=op_code)
+ if service == CustomServiceList.REACTION_WHEEL_2.value:
+ object_id = RW2_ID
+ return pack_single_rw_test_into(object_id=object_id, tc_queue=service_queue, op_code=op_code)
+ if service == CustomServiceList.REACTION_WHEEL_3.value:
+ object_id = RW3_ID
+ return pack_single_rw_test_into(object_id=object_id, tc_queue=service_queue, op_code=op_code)
+ if service == CustomServiceList.REACTION_WHEEL_4.value:
+ object_id = RW4_ID
+ return pack_single_rw_test_into(object_id=object_id, tc_queue=service_queue, op_code=op_code)
+ if service == CustomServiceList.RAD_SENSOR.value:
+ object_id = RAD_SENSOR_ID
+ return pack_rad_sensor_test_into(object_id=object_id, tc_queue=service_queue, op_code=op_code)
+ if service == CustomServiceList.PLOC_SUPV.value:
+ object_id = PLOC_SUPV_ID
+ return pack_ploc_supv_test_into(object_id=object_id, tc_queue=service_queue, op_code=op_code)
LOGGER.warning("Invalid Service !")
diff --git a/pus_tc/tmp1075.py b/pus_tc/tmp1075.py
index b7ae123..48b2d65 100644
--- a/pus_tc/tmp1075.py
+++ b/pus_tc/tmp1075.py
@@ -7,7 +7,7 @@
"""
from tmtccmd.config.definitions import QueueCommands
-from tmtccmd.pus_tc.packer import TcQueueT
+from tmtccmd.tc.packer import TcQueueT
from tmtccmd.ecss.tc import PusTelecommand
from pus_tc.service_200_mode import pack_mode_data
diff --git a/pus_tm/factory_hook.py b/pus_tm/factory_hook.py
index ab2b264..559b212 100644
--- a/pus_tm/factory_hook.py
+++ b/pus_tm/factory_hook.py
@@ -3,19 +3,19 @@
@details Template configuration file. Copy this folder to the TMTC commander root and adapt
it to your needs.
"""
-from tmtccmd.pus_tm.service_8_functional_cmd import Service8TM
+from tmtccmd.tm.service_8_functional_cmd import Service8TM
from tmtccmd.ecss.tm import PusTelemetry
-from tmtccmd.utility.logger import get_logger
+from tmtccmd.utility.logger import get_console_logger
-from tmtccmd.pus_tm.service_1_verification import Service1TM
-from tmtccmd.pus_tm.service_3_housekeeping import Service3TM
-from tmtccmd.pus_tm.service_5_event import Service5TM
-from tmtccmd.pus_tm.service_17_test import Service17TM
+from tmtccmd.tm.service_1_verification import Service1TM
+from tmtccmd.tm.service_3_housekeeping import Service3TM
+from tmtccmd.tm.service_5_event import Service5TM
+from tmtccmd.tm.service_17_test import Service17TM
from tmtccmd.utility.tmtc_printer import TmTcPrinter
from config.definitions import PUS_APID
-LOGGER = get_logger()
+LOGGER = get_console_logger()
def ccsds_tm_handler(apid: int, raw_tm_packet: bytearray, tmtc_printer: TmTcPrinter) -> None:
diff --git a/pus_tm/hk_handling.py b/pus_tm/hk_handling.py
index f093ae7..f81a042 100644
--- a/pus_tm/hk_handling.py
+++ b/pus_tm/hk_handling.py
@@ -7,12 +7,12 @@
import struct
from typing import Tuple
-from tmtccmd.pus_tm.service_3_housekeeping import Service3Base
-from tmtccmd.utility.logger import get_logger
+from tmtccmd.tm.service_3_housekeeping import Service3Base
+from tmtccmd.utility.logger import get_console_logger
from pus_tc.syrlinks_hk_handler import SetIds
from pus_tc.imtq import ImtqSetIds
from config.object_ids import SYRLINKS_HANDLER, IMTQ_HANDLER_ID
-LOGGER = get_logger()
+LOGGER = get_console_logger()
def handle_user_hk_packet(object_id: bytes, set_id: int, hk_data: bytearray,
diff --git a/pus_tm/service_8_hook.py b/pus_tm/service_8_hook.py
index 6b491c0..4d50c4a 100644
--- a/pus_tm/service_8_hook.py
+++ b/pus_tm/service_8_hook.py
@@ -2,7 +2,7 @@ import struct
from typing import Tuple
from config.object_ids import *
from pus_tc.imtq import ImtqActionIds
-from pus_tc.ploc import PlocReplyIds
+from pus_tc.ploc_mpsoc import PlocReplyIds
def user_analyze_service_8_data(
@@ -30,7 +30,7 @@ def user_analyze_service_8_data(
content_list = [data_string]
elif object_id == IMTQ_HANDLER_ID:
return handle_imtq_replies(action_id, custom_data)
- elif object_id == PLOC_ID:
+ elif object_id == PLOC_MPSOC_ID:
return handle_ploc_replies(action_id, custom_data)
else:
header_list = []
diff --git a/tmtc_client_cli.py b/tmtc_client_cli.py
index 283376e..d3f5b15 100644
--- a/tmtc_client_cli.py
+++ b/tmtc_client_cli.py
@@ -29,6 +29,7 @@ limitations under the License.
import sys
from config.hook_implementations import EiveHookObject
+from config.version import __version__
from config.definitions import PUS_APID
from pus_tm.factory_hook import ccsds_tm_handler
try:
@@ -45,6 +46,7 @@ except ImportError as error:
def main():
hook_obj = EiveHookObject()
+ print(f"-- eive tmtc version {__version__}")
initialize_tmtc_commander(hook_object=hook_obj)
ccsds_handler = CcsdsTmHandler()
ccsds_handler.add_tm_handler(apid=PUS_APID, pus_tm_handler=ccsds_tm_handler, max_queue_len=50)
diff --git a/tmtc_client_gui.py b/tmtc_client_gui.py
index 1d44dd2..ddcfa07 100644
--- a/tmtc_client_gui.py
+++ b/tmtc_client_gui.py
@@ -1,6 +1,6 @@
#!/usr/bin/python3
"""
-@brief TMTC Commander entry point for GUI mode.
+@brief TMTC Commander entry point for command line mode.
@details
This client was developed by KSat for the SOURCE project to test the on-board software but
has evolved into a more generic tool for satellite developers to perform TMTC (Telemetry and Telecommand)
@@ -26,14 +26,32 @@ limitations under the License.
@author R. Mueller
"""
+import sys
+
from config.hook_implementations import EiveHookObject
-from tmtccmd.runner import initialize_tmtc_commander, run_tmtc_commander
+from config.version import __version__
+from config.definitions import PUS_APID
+from pus_tm.factory_hook import ccsds_tm_handler
+try:
+ from tmtccmd.runner import initialize_tmtc_commander, run_tmtc_commander, add_ccsds_handler
+ from tmtccmd.ccsds.handler import CcsdsTmHandler
+except ImportError as error:
+ run_tmtc_commander = None
+ initialize_tmtc_commander = None
+ print(error)
+ print("Python tmtccmd submodule could not be imported")
+ print("Install with \"cd tmtccmd && python3 -m pip install -e .\" for interactive installation")
+ sys.exit(0)
def main():
hook_obj = EiveHookObject()
+ print(f"-- eive tmtc version {__version__}")
initialize_tmtc_commander(hook_object=hook_obj)
- run_tmtc_commander(True)
+ ccsds_handler = CcsdsTmHandler()
+ ccsds_handler.add_tm_handler(apid=PUS_APID, pus_tm_handler=ccsds_tm_handler, max_queue_len=50)
+ add_ccsds_handler(ccsds_handler)
+ run_tmtc_commander(use_gui=True)
if __name__ == "__main__":
diff --git a/tmtccmd b/tmtccmd
index b4358a1..1e23485 160000
--- a/tmtccmd
+++ b/tmtccmd
@@ -1 +1 @@
-Subproject commit b4358a15fd945a9e0103a707b2a2dc56c458b24a
+Subproject commit 1e234851ecc08bee1765804e347efe5785b4486e