diff --git a/.gitignore b/.gitignore
index 59c8d29..9e397a4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,5 +5,7 @@ __pycache__
log
/gps_log.txt
/config/*.json
-tmtc_conf.json
+
+/scex_conf.json
+/tmtc_conf.json
/seqcnt.txt
diff --git a/.run/ACU.run.xml b/.run/ACU.run.xml
index a06fadc..92b80ba 100644
--- a/.run/ACU.run.xml
+++ b/.run/ACU.run.xml
@@ -13,7 +13,7 @@
-
+
diff --git a/.run/BPX.run.xml b/.run/BPX.run.xml
index 0c16575..ece69a3 100644
--- a/.run/BPX.run.xml
+++ b/.run/BPX.run.xml
@@ -13,7 +13,7 @@
-
+
diff --git a/.run/BPX_Request_HK.run.xml b/.run/BPX_Request_HK.run.xml
index 9bf2f0f..2af5d78 100644
--- a/.run/BPX_Request_HK.run.xml
+++ b/.run/BPX_Request_HK.run.xml
@@ -13,7 +13,7 @@
-
+
diff --git a/.run/BPX_Reset_Reboot_Counter.run.xml b/.run/BPX_Reset_Reboot_Counter.run.xml
index dcde73c..4f1ec75 100644
--- a/.run/BPX_Reset_Reboot_Counter.run.xml
+++ b/.run/BPX_Reset_Reboot_Counter.run.xml
@@ -13,7 +13,7 @@
-
+
diff --git a/.run/IMTQ_Get_Commanded_Dipole.run.xml b/.run/IMTQ_Get_Commanded_Dipole.run.xml
index 31c691d..789e88f 100644
--- a/.run/IMTQ_Get_Commanded_Dipole.run.xml
+++ b/.run/IMTQ_Get_Commanded_Dipole.run.xml
@@ -13,7 +13,7 @@
-
+
diff --git a/.run/IMTQ_Neg_X_Test.run.xml b/.run/IMTQ_Neg_X_Test.run.xml
index 0c880f6..1330fa2 100644
--- a/.run/IMTQ_Neg_X_Test.run.xml
+++ b/.run/IMTQ_Neg_X_Test.run.xml
@@ -13,7 +13,7 @@
-
+
diff --git a/.run/IMTQ_Neg_Y_Test.run.xml b/.run/IMTQ_Neg_Y_Test.run.xml
index 45f9c31..3f98518 100644
--- a/.run/IMTQ_Neg_Y_Test.run.xml
+++ b/.run/IMTQ_Neg_Y_Test.run.xml
@@ -13,7 +13,7 @@
-
+
diff --git a/.run/IMTQ_Neg_Z_Test.run.xml b/.run/IMTQ_Neg_Z_Test.run.xml
index 0749ef0..8af92f6 100644
--- a/.run/IMTQ_Neg_Z_Test.run.xml
+++ b/.run/IMTQ_Neg_Z_Test.run.xml
@@ -13,7 +13,7 @@
-
+
diff --git a/.run/IMTQ_Pos_X_Test.run.xml b/.run/IMTQ_Pos_X_Test.run.xml
index 58721eb..63ab5f4 100644
--- a/.run/IMTQ_Pos_X_Test.run.xml
+++ b/.run/IMTQ_Pos_X_Test.run.xml
@@ -13,7 +13,7 @@
-
+
diff --git a/.run/IMTQ_Pos_Y_Test.run.xml b/.run/IMTQ_Pos_Y_Test.run.xml
index d2aa90e..3226197 100644
--- a/.run/IMTQ_Pos_Y_Test.run.xml
+++ b/.run/IMTQ_Pos_Y_Test.run.xml
@@ -13,7 +13,7 @@
-
+
diff --git a/.run/IMTQ_Pos_Z_Test.run.xml b/.run/IMTQ_Pos_Z_Test.run.xml
index 7eb9d31..0961704 100644
--- a/.run/IMTQ_Pos_Z_Test.run.xml
+++ b/.run/IMTQ_Pos_Z_Test.run.xml
@@ -13,7 +13,7 @@
-
+
diff --git a/.run/IMTQ_Test_UDP.run.xml b/.run/IMTQ_Test_UDP.run.xml
index 5040f94..06b2555 100644
--- a/.run/IMTQ_Test_UDP.run.xml
+++ b/.run/IMTQ_Test_UDP.run.xml
@@ -13,7 +13,7 @@
-
+
diff --git a/.run/PDU1_Commanding.run.xml b/.run/PDU1_Commanding.run.xml
index ac97659..0611495 100644
--- a/.run/PDU1_Commanding.run.xml
+++ b/.run/PDU1_Commanding.run.xml
@@ -13,7 +13,7 @@
-
+
diff --git a/.run/PDU2_Commanding.run.xml b/.run/PDU2_Commanding.run.xml
index f776fb4..4615b19 100644
--- a/.run/PDU2_Commanding.run.xml
+++ b/.run/PDU2_Commanding.run.xml
@@ -13,7 +13,7 @@
-
+
diff --git a/.run/PLOC_MPSoC.run.xml b/.run/PLOC_MPSoC.run.xml
index 042424e..73f952b 100644
--- a/.run/PLOC_MPSoC.run.xml
+++ b/.run/PLOC_MPSoC.run.xml
@@ -13,7 +13,7 @@
-
+
diff --git a/.run/PLOC_SUPV.run.xml b/.run/PLOC_SUPV.run.xml
index a79bac5..62c49bb 100644
--- a/.run/PLOC_SUPV.run.xml
+++ b/.run/PLOC_SUPV.run.xml
@@ -13,7 +13,7 @@
-
+
diff --git a/.run/Ping_Command.run.xml b/.run/Ping_Command.run.xml
index 7d27656..3c63959 100644
--- a/.run/Ping_Command.run.xml
+++ b/.run/Ping_Command.run.xml
@@ -13,7 +13,7 @@
-
+
diff --git a/.run/RW1_Test.run.xml b/.run/RW1_Test.run.xml
index 74e1e3f..317430b 100644
--- a/.run/RW1_Test.run.xml
+++ b/.run/RW1_Test.run.xml
@@ -13,7 +13,7 @@
-
+
diff --git a/.run/RW2_Test_.run.xml b/.run/RW2_Test_.run.xml
index f7cf645..aa5efc1 100644
--- a/.run/RW2_Test_.run.xml
+++ b/.run/RW2_Test_.run.xml
@@ -13,7 +13,7 @@
-
+
diff --git a/.run/RW3_Test_.run.xml b/.run/RW3_Test_.run.xml
index 0d533da..4eaa954 100644
--- a/.run/RW3_Test_.run.xml
+++ b/.run/RW3_Test_.run.xml
@@ -13,7 +13,7 @@
-
+
diff --git a/.run/RW4_Test_.run.xml b/.run/RW4_Test_.run.xml
index 09da147..7e1bd8d 100644
--- a/.run/RW4_Test_.run.xml
+++ b/.run/RW4_Test_.run.xml
@@ -13,7 +13,7 @@
-
+
diff --git a/.run/Reboot_0_0.run.xml b/.run/Reboot_0_0.run.xml
index 2a7ce9c..0d694a6 100644
--- a/.run/Reboot_0_0.run.xml
+++ b/.run/Reboot_0_0.run.xml
@@ -13,7 +13,7 @@
-
+
diff --git a/.run/Reboot_0_1.run.xml b/.run/Reboot_0_1.run.xml
index 8b60d30..4caf0e3 100644
--- a/.run/Reboot_0_1.run.xml
+++ b/.run/Reboot_0_1.run.xml
@@ -13,7 +13,7 @@
-
+
diff --git a/.run/Reboot_1_0.run.xml b/.run/Reboot_1_0.run.xml
index 8def215..a187704 100644
--- a/.run/Reboot_1_0.run.xml
+++ b/.run/Reboot_1_0.run.xml
@@ -13,7 +13,7 @@
-
+
diff --git a/.run/Reboot_1_1.run.xml b/.run/Reboot_1_1.run.xml
index f88678a..1d1cbfa 100644
--- a/.run/Reboot_1_1.run.xml
+++ b/.run/Reboot_1_1.run.xml
@@ -13,7 +13,7 @@
-
+
diff --git a/.run/Reboot_Prompt.run.xml b/.run/Reboot_Prompt.run.xml
index d2155e4..cc63d12 100644
--- a/.run/Reboot_Prompt.run.xml
+++ b/.run/Reboot_Prompt.run.xml
@@ -13,7 +13,7 @@
-
+
diff --git a/.run/Reboot_Self.run.xml b/.run/Reboot_Self.run.xml
index 76cd68f..2389759 100644
--- a/.run/Reboot_Self.run.xml
+++ b/.run/Reboot_Self.run.xml
@@ -13,7 +13,7 @@
-
+
diff --git a/.run/SCEX .run.xml b/.run/SCEX .run.xml
new file mode 100644
index 0000000..af5d790
--- /dev/null
+++ b/.run/SCEX .run.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.run/SCEX Ping.run.xml b/.run/SCEX Ping.run.xml
new file mode 100644
index 0000000..0231b50
--- /dev/null
+++ b/.run/SCEX Ping.run.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.run/SCEX oneCell.run.xml b/.run/SCEX oneCell.run.xml
new file mode 100644
index 0000000..b3ea03f
--- /dev/null
+++ b/.run/SCEX oneCell.run.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.run/Star_Tracker.run.xml b/.run/Star_Tracker.run.xml
index 5593ce3..c29dffa 100644
--- a/.run/Star_Tracker.run.xml
+++ b/.run/Star_Tracker.run.xml
@@ -13,7 +13,7 @@
-
+
diff --git a/.run/Syrlinks.run.xml b/.run/Syrlinks.run.xml
index 16acc4b..faf34bd 100644
--- a/.run/Syrlinks.run.xml
+++ b/.run/Syrlinks.run.xml
@@ -13,7 +13,7 @@
-
+
diff --git a/.run/_IMTQ_Command_Dipole.run.xml b/.run/_IMTQ_Command_Dipole.run.xml
index 2719dda..665ec2a 100644
--- a/.run/_IMTQ_Command_Dipole.run.xml
+++ b/.run/_IMTQ_Command_Dipole.run.xml
@@ -13,7 +13,7 @@
-
+
diff --git a/.run/tmtcc_Service_2.run.xml b/.run/tmtcc_Service_2.run.xml
index b1b3d09..1f3c415 100644
--- a/.run/tmtcc_Service_2.run.xml
+++ b/.run/tmtcc_Service_2.run.xml
@@ -13,7 +13,7 @@
-
+
diff --git a/.run/tmtcc_Service_200.run.xml b/.run/tmtcc_Service_200.run.xml
index aba0bbc..199f141 100644
--- a/.run/tmtcc_Service_200.run.xml
+++ b/.run/tmtcc_Service_200.run.xml
@@ -13,7 +13,7 @@
-
+
diff --git a/.run/tmtcc_Service_8.run.xml b/.run/tmtcc_Service_8.run.xml
index 8adf555..adba1d1 100644
--- a/.run/tmtcc_Service_8.run.xml
+++ b/.run/tmtcc_Service_8.run.xml
@@ -13,7 +13,7 @@
-
+
diff --git a/config/definitions.py b/config/definitions.py
index c12a6d2..acd37ac 100644
--- a/config/definitions.py
+++ b/config/definitions.py
@@ -50,3 +50,4 @@ class CustomServiceList(enum.Enum):
RTD = "rtd"
TVTTESTPROCEDURE = "tvtestproc"
CONTROLLERS = "controllers"
+ SCEX = "scex"
diff --git a/config/events.csv b/config/events.csv
index 3f7b74f..cd0116d 100644
--- a/config/events.csv
+++ b/config/events.csv
@@ -128,6 +128,8 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path
12402;0x3072;INVALID_FAR;HIGH;Read invalid FAR from PDEC after startup;linux/obc/PdecHandler.h
12403;0x3073;CARRIER_LOCK;INFO;Carrier lock detected;linux/obc/PdecHandler.h
12404;0x3074;BIT_LOCK_PDEC;INFO;Bit lock detected (data valid);linux/obc/PdecHandler.h
+12405;0x3075;LOST_CARRIER_LOCK_PDEC;INFO;Lost carrier lock;linux/obc/PdecHandler.h
+12406;0x3076;LOST_BIT_LOCK_PDEC;INFO;Lost bit lock;linux/obc/PdecHandler.h
12500;0x30d4;IMAGE_UPLOAD_FAILED;LOW;Image upload failed;linux/devices/startracker/StrHelper.h
12501;0x30d5;IMAGE_DOWNLOAD_FAILED;LOW;Image download failed;linux/devices/startracker/StrHelper.h
12502;0x30d6;IMAGE_UPLOAD_SUCCESSFUL;LOW;Uploading image to star tracker was successfulop;linux/devices/startracker/StrHelper.h
@@ -206,3 +208,4 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path
13701;0x3585;REBOOT_SW;MEDIUM; Software reboot occurred. Can also be a systemd reboot. P1: Current Chip, P2: Current Copy;bsp_q7s/core/CoreController.h
13702;0x3586;REBOOT_MECHANISM_TRIGGERED;MEDIUM;The reboot mechanism was triggered. P1: First 16 bits: Last Chip, Last 16 bits: Last Copy, P2: Each byte is the respective reboot count for the slots;bsp_q7s/core/CoreController.h
13703;0x3587;REBOOT_HW;MEDIUM;;bsp_q7s/core/CoreController.h
+13800;0x35e8;EXPERIMENT_TIMEDOUT;LOW;;mission/devices/devicedefinitions/ScexDefinitions.h
diff --git a/config/hook.py b/config/hook.py
index af55692..fbca91f 100644
--- a/config/hook.py
+++ b/config/hook.py
@@ -4,11 +4,10 @@ from config.definitions import SPACE_PACKET_IDS
from tmtccmd import TmTcCfgHookBase, CcsdsTmtcBackend
from tmtccmd.com_if import ComInterface
from tmtccmd.config import TmTcDefWrapper
-from tmtccmd.utility.retval import RetvalDictT
-from tmtccmd.utility.obj_id import ObjectIdDictT
from config.retvals import get_retval_dict
from pus_tc.cmd_definitions import get_eive_service_op_code_dict
+from tmtccmd.util import ObjectIdDictT, RetvalDictT
class EiveHookObject(TmTcCfgHookBase):
diff --git a/config/object_ids.py b/config/object_ids.py
index 826da95..98da0c9 100644
--- a/config/object_ids.py
+++ b/config/object_ids.py
@@ -4,7 +4,7 @@
it to your needs.
"""
import os.path
-from tmtccmd.utility.obj_id import ObjectIdDictT
+from tmtccmd.util.obj_id import ObjectIdDictT
from tmtccmd.fsfw import parse_fsfw_objects_csv
from tmtccmd.logging import get_console_logger
@@ -25,6 +25,7 @@ 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])
BPX_HANDLER_ID = bytes([0x44, 0x26, 0x00, 0x00])
+SCEX_HANDLER_ID = bytes([0x44, 0x33, 0x00, 0x32])
# Thermal Object IDs
THERMAL_CONTROLLER_ID = bytes([0x43, 0x40, 0x00, 0x01])
diff --git a/config/objects.csv b/config/objects.csv
index 09a9658..098b0b0 100644
--- a/config/objects.csv
+++ b/config/objects.csv
@@ -46,6 +46,7 @@
0x44330015;PLOC_MPSOC_HANDLER
0x44330016;PLOC_SUPERVISOR_HANDLER
0x44330017;PLOC_SUPERVISOR_HELPER
+0x44330032;SCEX
0x444100A2;SOLAR_ARRAY_DEPL_HANDLER
0x444100A4;HEATER_HANDLER
0x44420004;TMP1075_HANDLER_1
@@ -69,6 +70,7 @@
0x445300A3;SYRLINKS_HK_HANDLER
0x49000000;ARDUINO_COM_IF
0x49010005;GPIO_IF
+0x49010006;SCEX_UART_READER
0x49020004;SPI_MAIN_COM_IF
0x49020005;SPI_RW_COM_IF
0x49020006;SPI_RTD_COM_IF
diff --git a/deps/spacepackets b/deps/spacepackets
index 5317f4c..0fce08f 160000
--- a/deps/spacepackets
+++ b/deps/spacepackets
@@ -1 +1 @@
-Subproject commit 5317f4c384321b5b5d8832f51c530fa91d3b2ae5
+Subproject commit 0fce08fa9a37b50096198ea563ed22fc0447e1b4
diff --git a/deps/tmtccmd b/deps/tmtccmd
index a0afee4..598aecb 160000
--- a/deps/tmtccmd
+++ b/deps/tmtccmd
@@ -1 +1 @@
-Subproject commit a0afee42dd743888a3cb38952f45c0678a0fbcf3
+Subproject commit 598aecbcae8a2d194f17ea27fd6a274b114a83c0
diff --git a/gomspace/gomspace_common.py b/gomspace/gomspace_common.py
index aa859ff..2c90c47 100644
--- a/gomspace/gomspace_common.py
+++ b/gomspace/gomspace_common.py
@@ -12,7 +12,7 @@ from typing import Union
from spacepackets.ecss import PusTelecommand
from tmtccmd.tc.pus_8_funccmd import generate_action_command
-from tmtccmd.utility import ObjectIdU32
+from tmtccmd.util import ObjectIdU32
class GomspaceDeviceActionIds(enum.IntEnum):
diff --git a/pus_tc/cmd_definitions.py b/pus_tc/cmd_definitions.py
index 3a3ad36..f68b383 100644
--- a/pus_tc/cmd_definitions.py
+++ b/pus_tc/cmd_definitions.py
@@ -1,3 +1,4 @@
+from pus_tc.devs.scex import add_scex_cmds
from pus_tc.system.proc import add_proc_cmds
from pus_tc.devs.gps import add_gps_cmds
@@ -35,8 +36,9 @@ def get_eive_service_op_code_dict() -> TmTcDefWrapper:
add_ccsds_cmds(defs=def_wrapper)
add_pdec_cmds(defs=def_wrapper)
add_heater_cmds(defs=def_wrapper)
- add_tmp_sens_cmds(defs=def_wrapper)
- add_proc_cmds(defs=def_wrapper)
+ add_tmp_sens_cmds(def_wrapper)
+ add_proc_cmds(def_wrapper)
+ add_scex_cmds(def_wrapper)
return def_wrapper
diff --git a/pus_tc/devs/acu.py b/pus_tc/devs/acu.py
index dae5d7f..b21947e 100644
--- a/pus_tc/devs/acu.py
+++ b/pus_tc/devs/acu.py
@@ -20,7 +20,7 @@ from gomspace.gomspace_common import Info as GsInfo
from config.object_ids import ACU_HANDLER_ID
from pus_tc.devs.p60dock import P60DockConfigTable
from tmtccmd.tc.pus_8_funccmd import generate_action_command
-from tmtccmd.utility import ObjectIdU32
+from tmtccmd.util import ObjectIdU32
class ACUConfigTable:
diff --git a/pus_tc/devs/ccsds_handler.py b/pus_tc/devs/ccsds_handler.py
index 5983bae..97e6771 100644
--- a/pus_tc/devs/ccsds_handler.py
+++ b/pus_tc/devs/ccsds_handler.py
@@ -9,7 +9,7 @@ import struct
from spacepackets.ecss.tc import PusTelecommand
from tmtccmd.tc import QueueHelper
-from tmtccmd.utility import ObjectIdU32
+from tmtccmd.util import ObjectIdU32
class CommandIds:
diff --git a/pus_tc/devs/heater.py b/pus_tc/devs/heater.py
index e2317fb..a183d24 100644
--- a/pus_tc/devs/heater.py
+++ b/pus_tc/devs/heater.py
@@ -9,7 +9,7 @@ from config.definitions import CustomServiceList
from config.object_ids import get_object_ids
from tmtccmd.config import TmTcDefWrapper, OpCodeEntry
from tmtccmd.tc import QueueHelper
-from tmtccmd.utility.obj_id import ObjectIdU32
+from tmtccmd.util.obj_id import ObjectIdU32
from tmtccmd.tc.pus_201_fsfw_health import (
pack_set_health_cmd_data,
FsfwHealth,
diff --git a/pus_tc/devs/imtq.py b/pus_tc/devs/imtq.py
index d8c0661..da38e2a 100644
--- a/pus_tc/devs/imtq.py
+++ b/pus_tc/devs/imtq.py
@@ -15,7 +15,7 @@ from tmtccmd.tc.pus_3_fsfw_hk import (
generate_one_hk_command,
)
from tmtccmd.tc.pus_200_fsfw_modes import pack_mode_data, Modes
-from tmtccmd.utility import ObjectIdU32
+from tmtccmd.util import ObjectIdU32
class ImtqSetIds:
diff --git a/pus_tc/devs/ploc_memory_dumper.py b/pus_tc/devs/ploc_memory_dumper.py
index 6b89119..45df816 100644
--- a/pus_tc/devs/ploc_memory_dumper.py
+++ b/pus_tc/devs/ploc_memory_dumper.py
@@ -10,7 +10,7 @@ import struct
from spacepackets.ecss.tc import PusTelecommand
from tmtccmd.tc import QueueHelper
-from tmtccmd.utility import ObjectIdU32
+from tmtccmd.util import ObjectIdU32
class ActionIds:
diff --git a/pus_tc/devs/ploc_mpsoc.py b/pus_tc/devs/ploc_mpsoc.py
index 57e2175..b678b11 100644
--- a/pus_tc/devs/ploc_mpsoc.py
+++ b/pus_tc/devs/ploc_mpsoc.py
@@ -12,7 +12,7 @@ import enum
from tmtccmd.logging import get_console_logger
from spacepackets.ecss.tc import PusTelecommand
from tmtccmd.tc import QueueHelper
-from tmtccmd.utility import ObjectIdU32
+from tmtccmd.util import ObjectIdU32
from utility.input_helper import InputHelper
from tmtccmd.tc.pus_200_fsfw_modes import pack_mode_data, Modes
diff --git a/pus_tc/devs/ploc_supervisor.py b/pus_tc/devs/ploc_supervisor.py
index a608aea..0d33f6e 100644
--- a/pus_tc/devs/ploc_supervisor.py
+++ b/pus_tc/devs/ploc_supervisor.py
@@ -12,7 +12,7 @@ from spacepackets.ecss.tc import PusTelecommand
from tmtccmd.logging import get_console_logger
from tmtccmd.tc import QueueHelper
from tmtccmd.tc.pus_200_fsfw_modes import pack_mode_data, Modes
-from tmtccmd.utility import ObjectIdU32
+from tmtccmd.util import ObjectIdU32
from utility.input_helper import InputHelper
LOGGER = get_console_logger()
diff --git a/pus_tc/devs/rad_sensor.py b/pus_tc/devs/rad_sensor.py
index 898062a..ea56332 100644
--- a/pus_tc/devs/rad_sensor.py
+++ b/pus_tc/devs/rad_sensor.py
@@ -14,7 +14,7 @@ from pus_tc.service_200_mode import pack_mode_data, Modes
from tmtccmd.config import TmTcDefWrapper, OpCodeEntry
from tmtccmd.tc import QueueHelper
from tmtccmd.tc.pus_3_fsfw_hk import generate_one_hk_command, make_sid
-from tmtccmd.utility import ObjectIdU32
+from tmtccmd.util import ObjectIdU32
class SetIds:
diff --git a/pus_tc/devs/rtd.py b/pus_tc/devs/rtd.py
index 27e5862..99a9d7a 100644
--- a/pus_tc/devs/rtd.py
+++ b/pus_tc/devs/rtd.py
@@ -6,7 +6,7 @@ from spacepackets.ecss import PusTelecommand
from tmtccmd.config import TmTcDefWrapper, OpCodeEntry
from tmtccmd.tc import QueueHelper
-from tmtccmd.utility import ObjectIdU32
+from tmtccmd.util import ObjectIdU32
from tmtccmd.tc.pus_200_fsfw_modes import Modes, pack_mode_data, Subservices
import config.object_ids as oids
from config.object_ids import get_object_ids
diff --git a/pus_tc/devs/scex.py b/pus_tc/devs/scex.py
new file mode 100644
index 0000000..e9c47f3
--- /dev/null
+++ b/pus_tc/devs/scex.py
@@ -0,0 +1,169 @@
+import enum
+import json
+
+from config.definitions import CustomServiceList
+from tmtccmd.tc import QueueHelper
+from tmtccmd.tc.pus_8_funccmd import generate_action_command
+from tmtccmd.config import OpCodeEntry, TmTcDefWrapper
+from config.object_ids import SCEX_HANDLER_ID
+
+
+USE_SCEX_CONF_FILE = True
+
+
+class OpCodes:
+ PING = ["0", "ping"]
+ ION_CMD = ["1", "ion"]
+ TEMP_CMD = ["2", "temp"]
+ EXP_STATUS_CMD = ["3", "expstatus"]
+
+ ONE_CELLS_CMD = ["4", "onecell"]
+ ALL_CELLS_CMD = ["5", "allcells"]
+ FRAM = ["6", "fram"]
+
+
+class ActionIds(enum.IntEnum):
+ PING = 7
+ ION_CMD = 4
+ TEMP_CMD = 3
+ EXP_STATUS_CMD = 2
+
+ ONE_CELLS_CMD = 6
+ ALL_CELLS_CMD = 5
+ FRAM = 1
+
+
+class Info:
+ PING = "Send Ping command"
+ ION_CMD = "Read Ion"
+ TEMP_CMD = "Read Temperature"
+ EXP_STATUS_CMD = "Read Experiment Status"
+
+ ONE_CELLS_CMD = "One Cell"
+ ALL_CELLS_CMD = "All Cells"
+ FRAM = "Read FRAM"
+
+
+def add_scex_cmds(defs: TmTcDefWrapper):
+ oce = OpCodeEntry()
+ oce.add(keys=OpCodes.PING, info=Info.PING)
+ oce.add(keys=OpCodes.ION_CMD, info=Info.ION_CMD)
+ oce.add(keys=OpCodes.TEMP_CMD, info=Info.TEMP_CMD)
+ oce.add(keys=OpCodes.EXP_STATUS_CMD, info=Info.EXP_STATUS_CMD)
+ oce.add(keys=OpCodes.ONE_CELLS_CMD, info=Info.ONE_CELLS_CMD)
+
+ oce.add(keys=OpCodes.ALL_CELLS_CMD, info=Info.ALL_CELLS_CMD)
+ oce.add(keys=OpCodes.FRAM, info=Info.FRAM)
+
+ defs.add_service(
+ name=CustomServiceList.SCEX.value,
+ info="SCEX Device",
+ op_code_entry=oce
+ )
+
+
+def pack_scex_cmds(q: QueueHelper, op_code: str):
+ if op_code in OpCodes.PING:
+ q.add_log_cmd(Info.PING)
+ app_data = bytes([0])
+ q.add_pus_tc(generate_action_command(SCEX_HANDLER_ID, ActionIds.PING, app_data))
+ if op_code in OpCodes.ION_CMD:
+ q.add_log_cmd(Info.ION_CMD)
+ app_data = bytes([0])
+ q.add_pus_tc(generate_action_command(SCEX_HANDLER_ID, ActionIds.ION_CMD, app_data))
+
+ if op_code in OpCodes.TEMP_CMD:
+ q.add_log_cmd(Info.TEMP_CMD)
+ app_data = bytes([0])
+ q.add_pus_tc(generate_action_command(SCEX_HANDLER_ID, ActionIds.TEMP_CMD, app_data))
+
+ if op_code in OpCodes.EXP_STATUS_CMD:
+ q.add_log_cmd(Info.EXP_STATUS_CMD)
+ app_data = bytes([0])
+ q.add_pus_tc(generate_action_command(SCEX_HANDLER_ID, ActionIds.EXP_STATUS_CMD, app_data))
+
+ # one cell
+ if op_code in OpCodes.ONE_CELLS_CMD:
+ q.add_log_cmd(Info.ONE_CELLS_CMD)
+ app_data = bytearray()
+
+ # cell number
+ cn = 0
+ while True:
+ cell_select = input("Which solar cell should be measured? (1-10): ")
+ if not cell_select.isdigit():
+ print("Invalid cell number. Try again.")
+ continue
+ cell_select = int(cell_select)
+ if cell_select < 1 or cell_select > 10:
+ print(
+ f"Invalid cell number {cell_select}, "
+ f"Please enter a valid number: "
+ )
+ continue
+ cn = cell_select - 1
+ break
+
+ if USE_SCEX_CONF_FILE:
+ with open("template/scex_conf.json") as json_file:
+ json_data = json.load(json_file)
+ first_dac = json_data["first_dac"]
+ last_dac = json_data["last_dac"]
+ res_switch1 = json_data["res_switch1"]
+ res_switch2 = json_data["res_switch2"]
+ dac_weight1 = json_data["dac_weight1"]
+ dac_weight2 = json_data["dac_weight2"]
+ dac_weight3 = json_data["dac_weight3"]
+
+ # in app_data
+ # app_data.extend(struct.pack("!H", first_dac))
+ append_16_bit_val(packet=app_data, val=first_dac[cn])
+ append_16_bit_val(packet=app_data, val=last_dac[cn])
+ append_16_bit_val(packet=app_data, val=res_switch1[cn])
+ append_16_bit_val(packet=app_data, val=res_switch2[cn])
+
+ app_data.append(dac_weight1[cn])
+ app_data.append(dac_weight2[cn])
+ app_data.append(dac_weight3[cn])
+
+ q.add_pus_tc(generate_action_command(SCEX_HANDLER_ID, ActionIds.ONE_CELLS_CMD, app_data))
+
+ if op_code in OpCodes.ALL_CELLS_CMD:
+ q.add_log_cmd(Info.ALL_CELLS_CMD)
+ app_data = bytearray()
+
+ # cell number
+ cn = 0
+ if USE_SCEX_CONF_FILE:
+ with open("template/scex_conf.json") as json_file:
+ json_data = json.load(json_file)
+ first_dac = json_data["first_dac"]
+ last_dac = json_data["last_dac"]
+ res_switch1 = json_data["res_switch1"]
+ res_switch2 = json_data["res_switch2"]
+ dac_weight1 = json_data["dac_weight1"]
+ dac_weight2 = json_data["dac_weight2"]
+ dac_weight3 = json_data["dac_weight3"]
+
+ # in app_data
+ # app_data.extend(struct.pack("!H", first_dac))
+ append_16_bit_val(packet=app_data, val=first_dac[cn])
+ append_16_bit_val(packet=app_data, val=last_dac[cn])
+ append_16_bit_val(packet=app_data, val=res_switch1[cn])
+ append_16_bit_val(packet=app_data, val=res_switch2[cn])
+
+ app_data.append(dac_weight1[cn])
+ app_data.append(dac_weight2[cn])
+ app_data.append(dac_weight3[cn])
+
+ q.add_pus_tc(generate_action_command(SCEX_HANDLER_ID, ActionIds.ALL_CELLS_CMD, app_data))
+
+ if op_code in OpCodes.FRAM:
+ q.add_log_cmd(Info.FRAM)
+ app_data = bytes([0])
+ q.add_pus_tc(generate_action_command(SCEX_HANDLER_ID, ActionIds.FRAM, app_data))
+
+
+def append_16_bit_val(packet: bytearray, val: int):
+ packet.append((val >> 8) & 0xFF)
+ packet.append(val & 0xFF)
diff --git a/pus_tc/devs/star_tracker.py b/pus_tc/devs/star_tracker.py
index 382ac18..7c2ff11 100644
--- a/pus_tc/devs/star_tracker.py
+++ b/pus_tc/devs/star_tracker.py
@@ -12,7 +12,7 @@ from tmtccmd.tc.pus_200_fsfw_modes import pack_mode_data, Modes
from tmtccmd.logging import get_console_logger
from tmtccmd.tc import QueueHelper
-from tmtccmd.utility import ObjectIdU32
+from tmtccmd.util import ObjectIdU32
from utility.input_helper import InputHelper
diff --git a/pus_tc/devs/str_img_helper.py b/pus_tc/devs/str_img_helper.py
index b53c42b..cfde090 100644
--- a/pus_tc/devs/str_img_helper.py
+++ b/pus_tc/devs/str_img_helper.py
@@ -12,7 +12,7 @@ import struct
from spacepackets.ecss.tc import PusTelecommand
from tmtccmd.tc import QueueHelper
-from tmtccmd.utility import ObjectIdU32
+from tmtccmd.util import ObjectIdU32
class Commands:
diff --git a/pus_tc/devs/syrlinks_hk_handler.py b/pus_tc/devs/syrlinks_hk_handler.py
index 287a620..b7210aa 100644
--- a/pus_tc/devs/syrlinks_hk_handler.py
+++ b/pus_tc/devs/syrlinks_hk_handler.py
@@ -11,7 +11,7 @@ from spacepackets.ecss.tc import PusTelecommand
from tmtccmd.tc.pus_200_fsfw_modes import pack_mode_data, Modes
import struct
-from tmtccmd.utility import ObjectIdU32
+from tmtccmd.util import ObjectIdU32
class SetIds:
diff --git a/pus_tc/devs/tmp1075.py b/pus_tc/devs/tmp1075.py
index 59d7208..849fd2b 100644
--- a/pus_tc/devs/tmp1075.py
+++ b/pus_tc/devs/tmp1075.py
@@ -9,7 +9,7 @@ from spacepackets.ecss.tc import PusTelecommand
from pus_tc.service_200_mode import pack_mode_data
from tmtccmd.tc import QueueHelper
from tmtccmd.tc.pus_200_fsfw_modes import Modes
-from tmtccmd.utility import ObjectIdU32
+from tmtccmd.util import ObjectIdU32
class Tmp1075TestProcedure:
diff --git a/pus_tc/procedure_packer.py b/pus_tc/procedure_packer.py
index a4c6b8a..f168141 100644
--- a/pus_tc/procedure_packer.py
+++ b/pus_tc/procedure_packer.py
@@ -1,6 +1,10 @@
"""Hook function which packs telecommands based on service and operation code string
"""
+from typing import cast
+
from pus_tc.devs.rtd import pack_rtd_commands
+from pus_tc.devs.scex import pack_scex_cmds
+from pus_tc.system.controllers import pack_cmd_ctrl_to_prompted_mode, get_object_from_op_code
from tmtccmd import DefaultProcedureInfo
from tmtccmd.config import CoreServiceList
from tmtccmd.logging import get_console_logger
@@ -64,11 +68,12 @@ from config.object_ids import (
get_object_ids,
)
import config.object_ids as oids
+from tmtccmd.util import ObjectIdU32
LOGGER = get_console_logger()
-def handle_default_procedure(info: DefaultProcedureInfo, wrapper: FeedWrapper):
+def handle_default_procedure(info: DefaultProcedureInfo, wrapper: FeedWrapper, gui: bool):
queue_helper = wrapper.queue_helper
service = info.service
op_code = info.op_code
@@ -80,28 +85,28 @@ def handle_default_procedure(info: DefaultProcedureInfo, wrapper: FeedWrapper):
if service == CoreServiceList.SERVICE_200.value:
return pack_service200_test_into(q=queue_helper)
if service == CustomServiceList.P60DOCK.value:
- object_id = obj_id_man.get(P60_DOCK_HANDLER)
+ object_id = cast(ObjectIdU32, obj_id_man.get(P60_DOCK_HANDLER))
return pack_p60dock_cmds(object_id=object_id, q=queue_helper, op_code=op_code)
if service == CustomServiceList.RTD.value:
return pack_rtd_commands(object_id=None, q=queue_helper, op_code=op_code)
if service == CustomServiceList.PDU1.value:
- object_id = obj_id_man.get(PDU_1_HANDLER_ID)
+ object_id = cast(ObjectIdU32, obj_id_man.get(PDU_1_HANDLER_ID))
return pack_pdu1_commands(object_id=object_id, q=queue_helper, op_code=op_code)
if service == CustomServiceList.PDU2.value:
- object_id = obj_id_man.get(PDU_2_HANDLER_ID)
+ object_id = cast(ObjectIdU32, obj_id_man.get(PDU_2_HANDLER_ID))
return pack_pdu2_commands(object_id=object_id, q=queue_helper, op_code=op_code)
if service == CustomServiceList.ACU.value:
- object_id = obj_id_man.get(ACU_HANDLER_ID)
+ object_id = cast(ObjectIdU32, obj_id_man.get(ACU_HANDLER_ID))
return pack_acu_commands(object_id=object_id, q=queue_helper, op_code=op_code)
if service == CustomServiceList.BPX_BATTERY.value:
return pack_bpx_commands(q=queue_helper, op_code=op_code)
if service == CustomServiceList.TMP1075_1.value:
- object_id = obj_id_man.get(TMP_1075_1_HANDLER_ID)
+ object_id = cast(ObjectIdU32, obj_id_man.get(TMP_1075_1_HANDLER_ID))
return pack_tmp1075_test_into(
object_id=object_id, q=queue_helper, op_code=op_code
)
if service == CustomServiceList.TMP1075_2.value:
- object_id = obj_id_man.get(TMP_1075_2_HANDLER_ID)
+ object_id = cast(ObjectIdU32, obj_id_man.get(TMP_1075_2_HANDLER_ID))
return pack_tmp1075_test_into(
object_id=object_id, q=queue_helper, op_code=op_code
)
@@ -109,10 +114,10 @@ def handle_default_procedure(info: DefaultProcedureInfo, wrapper: FeedWrapper):
object_id = HEATER_ID
return pack_heater_cmds(object_id=object_id, q=queue_helper, op_code=op_code)
if service == CustomServiceList.IMTQ.value:
- object_id = obj_id_man.get(IMTQ_HANDLER_ID)
+ object_id = cast(ObjectIdU32, obj_id_man.get(IMTQ_HANDLER_ID))
return pack_imtq_test_into(object_id=object_id, q=queue_helper, op_code=op_code)
if service == CustomServiceList.PLOC_MPSOC.value:
- object_id = obj_id_man.get(PLOC_MPSOC_ID)
+ object_id = cast(ObjectIdU32, obj_id_man.get(PLOC_MPSOC_ID))
return pack_ploc_mpsoc_commands(
object_id=object_id, q=queue_helper, op_code=op_code
)
@@ -133,29 +138,29 @@ def handle_default_procedure(info: DefaultProcedureInfo, wrapper: FeedWrapper):
object_id=RW4_ID, rw_idx=4, q=queue_helper, op_code=op_code
)
if service == CustomServiceList.RAD_SENSOR.value:
- object_id = obj_id_man.get(RAD_SENSOR_ID)
+ object_id = cast(ObjectIdU32, obj_id_man.get(RAD_SENSOR_ID))
return pack_rad_sensor_test_into(
object_id=object_id, q=queue_helper, op_code=op_code
)
if service == CustomServiceList.PLOC_SUPV.value:
- object_id = obj_id_man.get(PLOC_SUPV_ID)
+ object_id = cast(ObjectIdU32, obj_id_man.get(PLOC_SUPV_ID))
return pack_ploc_supv_commands(
object_id=object_id, q=queue_helper, op_code=op_code
)
if service == CustomServiceList.STAR_TRACKER.value:
- object_id = obj_id_man.get(STAR_TRACKER_ID)
+ object_id = cast(ObjectIdU32, obj_id_man.get(STAR_TRACKER_ID))
return pack_star_tracker_commands(
object_id=object_id, q=queue_helper, op_code=op_code
)
if service == CustomServiceList.STR_IMG_HELPER.value:
- object_id = obj_id_man.get(STR_IMG_HELPER_ID)
+ object_id = cast(ObjectIdU32, obj_id_man.get(STR_IMG_HELPER_ID))
return pack_str_img_helper_command(
object_id=object_id, q=queue_helper, op_code=op_code
)
if service == CustomServiceList.CORE.value:
return pack_core_commands(q=queue_helper, op_code=op_code)
if service == CustomServiceList.PLOC_MEMORY_DUMPER.value:
- object_id = obj_id_man.get(PLOC_MEMORY_DUMPER_ID)
+ object_id = cast(ObjectIdU32, obj_id_man.get(PLOC_MEMORY_DUMPER_ID))
return pack_ploc_memory_dumper_cmd(
object_id=object_id, q=queue_helper, op_code=op_code
)
@@ -194,5 +199,13 @@ def handle_default_procedure(info: DefaultProcedureInfo, wrapper: FeedWrapper):
if service == CustomServiceList.TIME.value:
return pack_set_current_time_ascii_command(q=queue_helper)
if service == CustomServiceList.RW_ASSEMBLY.value:
- return pack_rw_ass_cmds(q=queue_helper, object_id=RW_ASSEMBLY, op_code=op_code)
+ return pack_rw_ass_cmds(
+ q=queue_helper, object_id=RW_ASSEMBLY, op_code=op_code
+ )
+ if service == CustomServiceList.CONTROLLERS.value:
+ return pack_cmd_ctrl_to_prompted_mode(
+ q=queue_helper, object_id=get_object_from_op_code(op_code), gui=gui
+ )
+ if service == CustomServiceList.SCEX.value:
+ return pack_scex_cmds(q=queue_helper, op_code=op_code)
LOGGER.warning(f"Invalid Service {service}")
diff --git a/pus_tc/system/controllers.py b/pus_tc/system/controllers.py
index 4078641..76c81bb 100644
--- a/pus_tc/system/controllers.py
+++ b/pus_tc/system/controllers.py
@@ -1,6 +1,6 @@
from tmtccmd.tc import QueueHelper
from tmtccmd.tc.pus_200_fsfw_modes import Modes
-from tmtccmd.utility import ObjectIdU32
+from tmtccmd.util import ObjectIdU32
from .common import command_mode
import config.object_ids as obj_ids
diff --git a/pus_tm/action_reply_handler.py b/pus_tm/action_reply_handler.py
index b56cc3e..009efc2 100644
--- a/pus_tm/action_reply_handler.py
+++ b/pus_tm/action_reply_handler.py
@@ -7,7 +7,7 @@ from pus_tc.devs.star_tracker import StarTrackerActionIds
from gomspace.gomspace_common import GomspaceDeviceActionIds
from tmtccmd.logging import get_console_logger
from tmtccmd.tm import Service8FsfwTm
-from tmtccmd.utility.tmtc_printer import FsfwTmTcPrinter
+from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
LOGGER = get_console_logger()
diff --git a/pus_tm/defs.py b/pus_tm/defs.py
index 218e2d0..e5e6d14 100644
--- a/pus_tm/defs.py
+++ b/pus_tm/defs.py
@@ -1,4 +1,4 @@
-from tmtccmd.utility.tmtc_printer import FsfwTmTcPrinter
+from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
class PrintWrapper:
diff --git a/pus_tm/devs/bpx_bat.py b/pus_tm/devs/bpx_bat.py
index eb27286..abbe93e 100644
--- a/pus_tm/devs/bpx_bat.py
+++ b/pus_tm/devs/bpx_bat.py
@@ -2,7 +2,7 @@ import struct
from pus_tc.devs.bpx_batt import BpxSetIds
from pus_tm.defs import PrintWrapper
-from tmtccmd.utility.tmtc_printer import FsfwTmTcPrinter
+from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
def handle_bpx_hk_data(printer: FsfwTmTcPrinter, set_id: int, hk_data: bytes):
diff --git a/pus_tm/devs/gps.py b/pus_tm/devs/gps.py
index 070a7d6..0f421cb 100644
--- a/pus_tm/devs/gps.py
+++ b/pus_tm/devs/gps.py
@@ -1,7 +1,7 @@
import struct
from pus_tm.defs import PrintWrapper
-from tmtccmd.utility.tmtc_printer import FsfwTmTcPrinter
+from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
def handle_gps_data(printer: FsfwTmTcPrinter, hk_data: bytes):
diff --git a/pus_tm/devs/gyros.py b/pus_tm/devs/gyros.py
index 48af1b1..bebfcda 100644
--- a/pus_tm/devs/gyros.py
+++ b/pus_tm/devs/gyros.py
@@ -1,8 +1,8 @@
import struct
from pus_tm.defs import PrintWrapper
-from tmtccmd.utility import ObjectIdU32
-from tmtccmd.utility.tmtc_printer import FsfwTmTcPrinter
+from tmtccmd.util import ObjectIdU32
+from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
from pus_tc.devs.gyros import L3gGyroSetIds, AdisGyroSetIds
import config.object_ids as obj_ids
diff --git a/pus_tm/devs/imtq_mgt.py b/pus_tm/devs/imtq_mgt.py
index 6a3aae4..347e675 100644
--- a/pus_tm/devs/imtq_mgt.py
+++ b/pus_tm/devs/imtq_mgt.py
@@ -1,7 +1,7 @@
import struct
from pus_tm.defs import PrintWrapper
-from tmtccmd.utility.tmtc_printer import FsfwTmTcPrinter
+from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
def handle_eng_set(printer: FsfwTmTcPrinter, hk_data: bytes):
diff --git a/pus_tm/devs/mgms.py b/pus_tm/devs/mgms.py
index 2e0380e..b4cc122 100644
--- a/pus_tm/devs/mgms.py
+++ b/pus_tm/devs/mgms.py
@@ -2,8 +2,8 @@ import struct
from pus_tm.defs import PrintWrapper
from pus_tc.devs.mgms import MgmRm3100SetIds, MgmLis3SetIds
-from tmtccmd.utility import ObjectIdU32
-from tmtccmd.utility.tmtc_printer import FsfwTmTcPrinter
+from tmtccmd.util import ObjectIdU32
+from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
import config.object_ids as obj_ids
diff --git a/pus_tm/devs/pcdu.py b/pus_tm/devs/pcdu.py
index 068f4fd..dd5f8e4 100644
--- a/pus_tm/devs/pcdu.py
+++ b/pus_tm/devs/pcdu.py
@@ -1,7 +1,7 @@
import struct
from typing import List, Tuple
-from tmtccmd.utility.tmtc_printer import FsfwTmTcPrinter
+from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
from pus_tm.defs import PrintWrapper
from gomspace.gomspace_common import SetIds
diff --git a/pus_tm/devs/plpcdu.py b/pus_tm/devs/plpcdu.py
index 33eb3ca..f9ed50a 100644
--- a/pus_tm/devs/plpcdu.py
+++ b/pus_tm/devs/plpcdu.py
@@ -1,7 +1,7 @@
import struct
from pus_tm.defs import PrintWrapper
-from tmtccmd.utility.tmtc_printer import FsfwTmTcPrinter
+from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
from pus_tc.devs.plpcdu import SetIds
diff --git a/pus_tm/devs/rad_sensor.py b/pus_tm/devs/rad_sensor.py
index de0e65d..a2673ff 100644
--- a/pus_tm/devs/rad_sensor.py
+++ b/pus_tm/devs/rad_sensor.py
@@ -1,7 +1,7 @@
import struct
from pus_tm.defs import PrintWrapper
-from tmtccmd.utility.tmtc_printer import FsfwTmTcPrinter
+from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
from pus_tc.devs.rad_sensor import SetIds
diff --git a/pus_tm/devs/reaction_wheels.py b/pus_tm/devs/reaction_wheels.py
index 2597357..6e072f5 100644
--- a/pus_tm/devs/reaction_wheels.py
+++ b/pus_tm/devs/reaction_wheels.py
@@ -1,7 +1,7 @@
import struct
from pus_tm.defs import PrintWrapper, FsfwTmTcPrinter
-from tmtccmd.utility.obj_id import ObjectIdU32
+from tmtccmd.util.obj_id import ObjectIdU32
def handle_rw_hk_data(
diff --git a/pus_tm/devs/sus.py b/pus_tm/devs/sus.py
index c3a323a..f733954 100644
--- a/pus_tm/devs/sus.py
+++ b/pus_tm/devs/sus.py
@@ -2,8 +2,8 @@ import struct
from pus_tm.defs import PrintWrapper
from pus_tc.devs.sus import SetIds
-from tmtccmd.utility import ObjectIdU32
-from tmtccmd.utility.tmtc_printer import FsfwTmTcPrinter
+from tmtccmd.util import ObjectIdU32
+from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
def handle_sus_hk(
diff --git a/pus_tm/devs/syrlinks.py b/pus_tm/devs/syrlinks.py
index 3c82f7a..f0c9b58 100644
--- a/pus_tm/devs/syrlinks.py
+++ b/pus_tm/devs/syrlinks.py
@@ -2,7 +2,7 @@ import struct
from pus_tm.defs import PrintWrapper
from pus_tc.devs.syrlinks_hk_handler import SetIds
-from tmtccmd.utility.tmtc_printer import FsfwTmTcPrinter
+from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
def handle_syrlinks_hk_data(printer: FsfwTmTcPrinter, set_id: int, hk_data: bytes):
diff --git a/pus_tm/event_handler.py b/pus_tm/event_handler.py
index 2af9e77..f460659 100644
--- a/pus_tm/event_handler.py
+++ b/pus_tm/event_handler.py
@@ -5,7 +5,7 @@ from config.object_ids import get_object_ids
from tmtccmd.tm import Service5Tm
from tmtccmd.logging import get_console_logger
-from tmtccmd.utility.tmtc_printer import FsfwTmTcPrinter
+from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
from tmtccmd.fsfw import parse_fsfw_events_csv, EventDictT, EventInfo
diff --git a/pus_tm/factory_hook.py b/pus_tm/factory_hook.py
index e3b4f30..1ccdc7a 100644
--- a/pus_tm/factory_hook.py
+++ b/pus_tm/factory_hook.py
@@ -8,7 +8,7 @@ from tmtccmd.logging.pus import RawTmtcTimedLogWrapper
from tmtccmd.pus import VerificationWrapper
from tmtccmd.tm import Service20FsfwTm, Service200FsfwTm
from tmtccmd.tm.pus_17_test import Service17TmExtended
-from tmtccmd.utility.tmtc_printer import FsfwTmTcPrinter
+from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
from .event_handler import handle_event_packet
from .verification_handler import handle_service_1_packet
diff --git a/pus_tm/hk_handling.py b/pus_tm/hk_handling.py
index 904475b..7b19a11 100644
--- a/pus_tm/hk_handling.py
+++ b/pus_tm/hk_handling.py
@@ -9,7 +9,7 @@ from tmtccmd.tm.pus_3_fsfw_hk import (
HkContentType,
Service3FsfwTm,
)
-from tmtccmd.utility.obj_id import ObjectIdU32, ObjectIdDictT
+from tmtccmd.util.obj_id import ObjectIdU32, ObjectIdDictT
from tmtccmd.logging import get_console_logger
from pus_tm.devs.bpx_bat import handle_bpx_hk_data
diff --git a/pus_tm/system/core.py b/pus_tm/system/core.py
index 883d044..f4e65a3 100644
--- a/pus_tm/system/core.py
+++ b/pus_tm/system/core.py
@@ -2,7 +2,7 @@ import struct
from pus_tm.defs import PrintWrapper
from pus_tc.system.core import SetIds
-from tmtccmd.utility.tmtc_printer import FsfwTmTcPrinter
+from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
def handle_core_hk_data(printer: FsfwTmTcPrinter, set_id: int, hk_data: bytes):
diff --git a/pus_tm/system/tcs.py b/pus_tm/system/tcs.py
index 50ccd2c..27d4583 100644
--- a/pus_tm/system/tcs.py
+++ b/pus_tm/system/tcs.py
@@ -3,8 +3,8 @@ import struct
from pus_tm.defs import PrintWrapper
from pus_tm.tcp_server_objects import *
-from tmtccmd.utility import ObjectIdU32
-from tmtccmd.utility.tmtc_printer import FsfwTmTcPrinter
+from tmtccmd.util import ObjectIdU32
+from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
class SetIds(enum.IntEnum):
diff --git a/pus_tm/tm_tcp_server.py b/pus_tm/tm_tcp_server.py
index 4d3f243..f2a7e02 100644
--- a/pus_tm/tm_tcp_server.py
+++ b/pus_tm/tm_tcp_server.py
@@ -4,7 +4,7 @@ import json
import base64
from tmtccmd.logging import get_console_logger
-from tmtccmd.utility.obj_id import ObjectIdU32
+from tmtccmd.util.obj_id import ObjectIdU32
from dle_encoder import DleEncoder
LOGGER = get_console_logger()
diff --git a/template/scex_conf.json b/template/scex_conf.json
new file mode 100644
index 0000000..f30d4a2
--- /dev/null
+++ b/template/scex_conf.json
@@ -0,0 +1,9 @@
+{
+ "first_dac": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
+ "last_dac": [40000, 40000, 40000, 40000, 40000, 40000, 40000, 40000, 40000, 40000],
+ "res_switch1": [8000, 8000, 8000, 7000, 8000, 8000, 8000, 8000, 8000, 8000],
+ "res_switch2": [15650, 15650, 15650, 13400, 15650, 13400, 13400, 13400, 13400, 13400],
+ "dac_weight1": [35, 35, 35, 35, 35, 37, 37, 37, 37, 37],
+ "dac_weight2": [30, 30, 30, 50, 30, 28, 28, 28, 28, 28],
+ "dac_weight3": [35, 35, 35, 35, 35, 35, 35, 35, 35, 35]
+}
\ No newline at end of file
diff --git a/tmtcc.py b/tmtcc.py
old mode 100644
new mode 100755
index cafd65d..0a7727d
--- a/tmtcc.py
+++ b/tmtcc.py
@@ -27,6 +27,8 @@ except ImportError as error:
from spacepackets.ecss import PusVerificator
from tmtccmd import get_console_logger, TcHandlerBase, BackendBase
from tmtccmd.com_if import ComInterface
+from tmtccmd.util import FileSeqCountProvider, PusFileSeqCountProvider
+from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
from tmtccmd.logging.pus import (
RawTmtcTimedLogWrapper,
@@ -35,10 +37,8 @@ from tmtccmd.logging.pus import (
)
from tmtccmd.pus import VerificationWrapper
from tmtccmd.tm import SpecificApidHandlerBase, GenericApidHandlerBase, CcsdsTmHandler
-from tmtccmd.utility.tmtc_printer import FsfwTmTcPrinter
from tmtccmd.core import BackendRequest
from tmtccmd.logging import get_current_time_string
-from tmtccmd.pus import FileSeqCountProvider
from tmtccmd.tc import (
ProcedureHelper,
FeedWrapper,
@@ -88,23 +88,25 @@ class TcHandler(TcHandlerBase):
pus_verificator: PusVerificator,
file_logger: logging.Logger,
raw_logger: RawTmtcTimedLogWrapper,
+ gui: bool
):
super().__init__()
self.seq_count_provider = seq_count_provider
self.pus_verificator = pus_verificator
self.file_logger = file_logger
self.raw_logger = raw_logger
+ self.gui = gui
def feed_cb(self, info: ProcedureHelper, wrapper: FeedWrapper):
if info.proc_type == TcProcedureType.DEFAULT:
- handle_default_procedure(info.to_def_procedure(), wrapper)
+ handle_default_procedure(info.to_def_procedure(), wrapper, self.gui)
def send_cb(self, entry_helper: QueueEntryHelper, com_if: ComInterface):
if entry_helper.is_tc:
if entry_helper.entry_type == TcQueueEntryType.PUS_TC:
pus_tc_wrapper = entry_helper.to_pus_tc_entry()
pus_tc_wrapper.pus_tc.seq_count = (
- self.seq_count_provider.next_seq_count()
+ self.seq_count_provider.get_and_increment()
)
pus_tc_wrapper.pus_tc.apid = PUS_APID
# Add TC after Sequence Count stamping
@@ -148,17 +150,19 @@ def setup_tmtc(
verificator: PusVerificator,
printer: FsfwTmTcPrinter,
raw_logger: RawTmtcTimedLogWrapper,
+ gui: bool
) -> (CcsdsTmHandler, TcHandler):
verification_wrapper = VerificationWrapper(verificator, LOGGER, printer.file_logger)
pus_handler = PusHandler(verification_wrapper, printer, raw_logger)
ccsds_handler = CcsdsTmHandler(generic_handler=UnknownApidHandler(None))
ccsds_handler.add_apid_handler(pus_handler)
- seq_count_provider = FileSeqCountProvider()
+ seq_count_provider = PusFileSeqCountProvider()
tc_handler = TcHandler(
seq_count_provider=seq_count_provider,
pus_verificator=verificator,
file_logger=printer.file_logger,
raw_logger=raw_logger,
+ gui=gui
)
return ccsds_handler, tc_handler
@@ -185,7 +189,9 @@ def main():
printer = FsfwTmTcPrinter(tmtc_logger.logger)
raw_logger = RawTmtcTimedLogWrapper(when=TimedLogWhen.PER_HOUR, interval=2)
pus_verificator = PusVerificator()
- ccsds_handler, tc_handler = setup_tmtc(pus_verificator, printer, raw_logger)
+ ccsds_handler, tc_handler = setup_tmtc(
+ pus_verificator, printer, raw_logger, setup_wrapper.params.use_gui
+ )
tmtccmd.setup(setup_wrapper)
tmtc_backend = setup_backend(