Compare commits
11 Commits
eedb45e4f3
...
d188b10f64
Author | SHA1 | Date | |
---|---|---|---|
![]() |
d188b10f64 | ||
![]() |
20fc1ab392 | ||
![]() |
2251c8cbf4 | ||
60e938a896 | |||
fd0afdbd4d | |||
7898dc2c16 | |||
3f1ee29d1f | |||
b6360b9c5c | |||
ce26794812 | |||
02b1103014 | |||
![]() |
826528b715 |
2
.idea/runConfigurations/tmtcc_Service_17.xml
generated
2
.idea/runConfigurations/tmtcc_Service_17.xml
generated
@@ -13,7 +13,7 @@
|
||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
|
||||
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtccli.py" />
|
||||
<option name="PARAMETERS" value="-s 17 -o 0 -t 3 -l" />
|
||||
<option name="PARAMETERS" value="-s 17 -l" />
|
||||
<option name="SHOW_COMMAND_LINE" value="false" />
|
||||
<option name="EMULATE_TERMINAL" value="true" />
|
||||
<option name="MODULE_MODE" value="false" />
|
||||
|
@@ -20,10 +20,21 @@ class GomspaceDeviceActionIds(enum.IntEnum):
|
||||
WDT_RESET = 9
|
||||
REQUEST_HK_TABLE = 16
|
||||
PRINT_SWITCH_V_I = 32
|
||||
PRINT_LATCHUPS = 33
|
||||
|
||||
|
||||
class GomspaceOpCodes(enum.Enum):
|
||||
PRINT_SWITCH_V_I = "32"
|
||||
# Request HK
|
||||
REQUEST_HK_ONCE = "128"
|
||||
PRINT_SWITCH_V_I = "129"
|
||||
PRINT_LATCHUPS = "130"
|
||||
|
||||
|
||||
class SetIds:
|
||||
PDU_1 = 0x01
|
||||
PDU_2 = 0x02
|
||||
P60_DOCK = 0x03
|
||||
ACU = 0x04
|
||||
|
||||
|
||||
class TableIds:
|
||||
|
@@ -83,6 +83,11 @@ def add_core_controller_definitions(cmd_dict: ServiceOpCodeDictT):
|
||||
keys=OpCodes.RESET_REBOOT_COUNTER_11,
|
||||
info="Reset reboot counter 1 1",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=od,
|
||||
keys=OpCodes.GET_HK,
|
||||
info="Request housekeeping set",
|
||||
)
|
||||
add_service_op_code_entry(
|
||||
srv_op_code_dict=cmd_dict,
|
||||
name=CustomServiceList.CORE.value,
|
||||
@@ -182,11 +187,21 @@ def add_pcdu_cmds(cmd_dict: ServiceOpCodeDictT):
|
||||
keys=P60OpCodes.STACK_5V_OFF.value,
|
||||
info="P60 Dock: Turn stack 5V off",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=GomspaceOpCodes.REQUEST_HK_ONCE.value,
|
||||
info="P60 Dock: Request HK once",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=GomspaceOpCodes.PRINT_SWITCH_V_I.value,
|
||||
info="P60 Dock: Print Switches, Voltages, Currents",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=GomspaceOpCodes.PRINT_LATCHUPS.value,
|
||||
info="P60 Dock: Print Latchups",
|
||||
)
|
||||
add_service_op_code_entry(
|
||||
srv_op_code_dict=cmd_dict,
|
||||
name=CustomServiceList.P60DOCK.value,
|
||||
@@ -195,7 +210,6 @@ def add_pcdu_cmds(cmd_dict: ServiceOpCodeDictT):
|
||||
)
|
||||
|
||||
op_code_dict = dict()
|
||||
add_op_code_entry(op_code_dict=op_code_dict, keys="0", info="PDU1 Tests")
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=Pdu1OpCodes.TCS_BOARD_ON.value,
|
||||
@@ -266,11 +280,24 @@ def add_pcdu_cmds(cmd_dict: ServiceOpCodeDictT):
|
||||
keys=Pdu1OpCodes.SCEX_OFF.value,
|
||||
info="PDU1: Turn Solar Cell Experiment off",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=GomspaceOpCodes.REQUEST_HK_ONCE.value,
|
||||
info="PDU1: Request HK once",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=GomspaceOpCodes.PRINT_SWITCH_V_I.value,
|
||||
info="PDU1: Print Switches, Voltages, Currents",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=GomspaceOpCodes.PRINT_LATCHUPS.value,
|
||||
info="PDU1: Print Latchups",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict, keys=Pdu1OpCodes.TESTS.value, info="PDU1 Tests"
|
||||
)
|
||||
add_service_op_code_entry(
|
||||
srv_op_code_dict=cmd_dict,
|
||||
name=CustomServiceList.PDU1.value,
|
||||
@@ -323,9 +350,8 @@ def add_pcdu_cmds(cmd_dict: ServiceOpCodeDictT):
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=Pdu2OpCodes.Q7S_OFF.value,
|
||||
info="Q7S Off",
|
||||
options={OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
keys=GomspaceOpCodes.REQUEST_HK_ONCE.value,
|
||||
info="PDU2: Request HK once",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
@@ -333,7 +359,11 @@ def add_pcdu_cmds(cmd_dict: ServiceOpCodeDictT):
|
||||
info="PDU2: Print Switches, Voltages, Currents",
|
||||
options={OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
)
|
||||
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=GomspaceOpCodes.PRINT_LATCHUPS.value,
|
||||
info="PDU2: Print Latchups",
|
||||
)
|
||||
add_service_op_code_entry(
|
||||
srv_op_code_dict=cmd_dict,
|
||||
name="pdu2",
|
||||
@@ -515,49 +545,52 @@ def add_ploc_cmds(cmd_dict: ServiceOpCodeDictT):
|
||||
|
||||
def add_system_cmds(cmd_dict: ServiceOpCodeDictT):
|
||||
from pus_tc.system.acs import AcsOpCodes
|
||||
default_opts = generate_op_code_options(enter_listener_mode=False, custom_timeout=8.0)
|
||||
|
||||
default_opts = generate_op_code_options(
|
||||
enter_listener_mode=False, custom_timeout=8.0
|
||||
)
|
||||
op_code_dict = dict()
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=AcsOpCodes.ACS_ASS_A_SIDE,
|
||||
info="Switch to ACS board A side",
|
||||
options=default_opts
|
||||
options=default_opts,
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=AcsOpCodes.ACS_ASS_B_SIDE,
|
||||
info="Switch to ACS board B side",
|
||||
options=default_opts
|
||||
options=default_opts,
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=AcsOpCodes.ACS_ASS_DUAL_MODE,
|
||||
info="Switch to ACS board dual mode",
|
||||
options=default_opts
|
||||
options=default_opts,
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=AcsOpCodes.ACS_ASS_A_ON,
|
||||
info="Switch ACS board A side on",
|
||||
options=default_opts
|
||||
options=default_opts,
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=AcsOpCodes.ACS_ASS_B_ON,
|
||||
info="Switch ACS board B side on",
|
||||
options=default_opts
|
||||
options=default_opts,
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=AcsOpCodes.ACS_ASS_DUAL_ON,
|
||||
info="Switch ACS board dual mode on",
|
||||
options=default_opts
|
||||
options=default_opts,
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=AcsOpCodes.ACS_ASS_OFF,
|
||||
info="Switch off ACS board",
|
||||
options=default_opts
|
||||
options=default_opts,
|
||||
)
|
||||
add_service_op_code_entry(
|
||||
srv_op_code_dict=cmd_dict,
|
||||
|
@@ -7,7 +7,9 @@
|
||||
"""
|
||||
from tmtccmd.config.definitions import QueueCommands
|
||||
from tmtccmd.tc.packer import TcQueueT
|
||||
from tmtccmd.tc.service_3_housekeeping import generate_one_hk_command, make_sid
|
||||
from gomspace.gomspace_common import *
|
||||
from config.object_ids import P60_DOCK_HANDLER
|
||||
|
||||
|
||||
class P60OpCodes(enum.Enum):
|
||||
@@ -110,6 +112,11 @@ def pack_p60dock_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code: st
|
||||
Channel.off,
|
||||
)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
if op_code == GomspaceOpCodes.REQUEST_HK_ONCE.value:
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "P60 Dock: Requesting HK Table Once"))
|
||||
hk_sid = make_sid(object_id=P60_DOCK_HANDLER, set_id=SetIds.P60_DOCK)
|
||||
command = generate_one_hk_command(sid=hk_sid, ssc=0)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
if op_code == GomspaceOpCodes.PRINT_SWITCH_V_I.value:
|
||||
tc_queue.appendleft(
|
||||
(QueueCommands.PRINT, "P60 Dock: Print Switches, Voltages, Currents")
|
||||
@@ -118,7 +125,14 @@ def pack_p60dock_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code: st
|
||||
object_id=object_id, action_id=GomspaceDeviceActionIds.PRINT_SWITCH_V_I
|
||||
)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
return
|
||||
if op_code == GomspaceOpCodes.PRINT_LATCHUPS.value:
|
||||
tc_queue.appendleft(
|
||||
(QueueCommands.PRINT, "P60 Dock: Print Latchups")
|
||||
)
|
||||
command = generate_action_command(
|
||||
object_id=object_id, action_id=GomspaceDeviceActionIds.PRINT_LATCHUPS
|
||||
)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
if P60DockTestProcedure.all or P60DockTestProcedure.reboot:
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "P60 Dock: Reboot"))
|
||||
command = pack_reboot_command(object_id)
|
||||
|
@@ -5,27 +5,30 @@
|
||||
"""
|
||||
from tmtccmd.config.definitions import QueueCommands
|
||||
from tmtccmd.tc.packer import TcQueueT
|
||||
from tmtccmd.tc.service_3_housekeeping import generate_one_hk_command, make_sid
|
||||
from gomspace.gomspace_common import *
|
||||
from gomspace.gomspace_pdu_definitions import *
|
||||
from config.object_ids import PDU_1_HANDLER_ID
|
||||
|
||||
|
||||
class Pdu1OpCodes(enum.Enum):
|
||||
TESTS = "0"
|
||||
TCS_BOARD_ON = "1"
|
||||
TCS_BOARD_OFF = "2"
|
||||
STAR_TRACKER_ON = "3"
|
||||
STAR_TRACKER_OFF = "4"
|
||||
SUS_NOMINAL_ON = "5"
|
||||
SUS_NOMINAL_OFF = "6"
|
||||
ACS_A_SIDE_ON = "7"
|
||||
ACS_A_SIDE_OFF = "8"
|
||||
SYRLINKS_ON = "9"
|
||||
SYRLINKS_OFF = "10"
|
||||
MGT_ON = "11"
|
||||
MGT_OFF = "12"
|
||||
TCS_BOARD_ON = "0"
|
||||
TCS_BOARD_OFF = "1"
|
||||
STAR_TRACKER_ON = "2"
|
||||
STAR_TRACKER_OFF = "3"
|
||||
SUS_NOMINAL_ON = "4"
|
||||
SUS_NOMINAL_OFF = "5"
|
||||
ACS_A_SIDE_ON = "6"
|
||||
ACS_A_SIDE_OFF = "7"
|
||||
SYRLINKS_ON = "8"
|
||||
SYRLINKS_OFF = "9"
|
||||
MGT_ON = "10"
|
||||
MGT_OFF = "11"
|
||||
# Solar Cell Experiment
|
||||
SCEX_ON = "13"
|
||||
SCEX_OFF = "14"
|
||||
SCEX_ON = "12"
|
||||
SCEX_OFF = "13"
|
||||
|
||||
TESTS = "32"
|
||||
|
||||
|
||||
class PDU1TestProcedure:
|
||||
@@ -53,7 +56,7 @@ def pack_pdu1_commands(object_id: bytearray, tc_queue: TcQueueT, op_code: str):
|
||||
command = pack_set_param_command(
|
||||
object_id,
|
||||
PDUConfigTable.out_en_0.parameter_address,
|
||||
PDUConfigTable.out_en_2.parameter_size,
|
||||
PDUConfigTable.out_en_0.parameter_size,
|
||||
Channel.on,
|
||||
)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
@@ -62,7 +65,7 @@ def pack_pdu1_commands(object_id: bytearray, tc_queue: TcQueueT, op_code: str):
|
||||
command = pack_set_param_command(
|
||||
object_id,
|
||||
PDUConfigTable.out_en_0.parameter_address,
|
||||
PDUConfigTable.out_en_2.parameter_size,
|
||||
PDUConfigTable.out_en_0.parameter_size,
|
||||
Channel.off,
|
||||
)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
@@ -151,14 +154,6 @@ def pack_pdu1_commands(object_id: bytearray, tc_queue: TcQueueT, op_code: str):
|
||||
Channel.off,
|
||||
)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
if op_code == GomspaceOpCodes.PRINT_SWITCH_V_I.value:
|
||||
tc_queue.appendleft(
|
||||
(QueueCommands.PRINT, "PDU1: Print Switches, Voltages, Currents")
|
||||
)
|
||||
command = generate_action_command(
|
||||
object_id=object_id, action_id=GomspaceDeviceActionIds.PRINT_SWITCH_V_I
|
||||
)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
if op_code == Pdu1OpCodes.SYRLINKS_ON.value:
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Turn Syrlinks on"))
|
||||
command = pack_set_param_command(
|
||||
@@ -195,6 +190,27 @@ def pack_pdu1_commands(object_id: bytearray, tc_queue: TcQueueT, op_code: str):
|
||||
Channel.off,
|
||||
)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
if op_code == GomspaceOpCodes.REQUEST_HK_ONCE.value:
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Requesting HK Table Once"))
|
||||
hk_sid = make_sid(object_id=PDU_1_HANDLER_ID, set_id=SetIds.PDU_1)
|
||||
command = generate_one_hk_command(sid=hk_sid, ssc=0)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
if op_code == GomspaceOpCodes.PRINT_SWITCH_V_I.value:
|
||||
tc_queue.appendleft(
|
||||
(QueueCommands.PRINT, "PDU1: Print Switches, Voltages, Currents")
|
||||
)
|
||||
command = generate_action_command(
|
||||
object_id=object_id, action_id=GomspaceDeviceActionIds.PRINT_SWITCH_V_I
|
||||
)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
if op_code == GomspaceOpCodes.PRINT_LATCHUPS.value:
|
||||
tc_queue.appendleft(
|
||||
(QueueCommands.PRINT, "PDU1: Print Latchups")
|
||||
)
|
||||
command = generate_action_command(
|
||||
object_id=object_id, action_id=GomspaceDeviceActionIds.PRINT_LATCHUPS
|
||||
)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
if PDU1TestProcedure.all or PDU1TestProcedure.ping:
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Ping Test"))
|
||||
ping_data = bytearray([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
|
||||
|
@@ -8,8 +8,10 @@
|
||||
"""
|
||||
from tmtccmd.config.definitions import QueueCommands
|
||||
from tmtccmd.tc.packer import TcQueueT
|
||||
from tmtccmd.tc.service_3_housekeeping import generate_one_hk_command, make_sid
|
||||
from gomspace.gomspace_common import *
|
||||
from gomspace.gomspace_pdu_definitions import *
|
||||
from config.object_ids import PDU_2_HANDLER_ID
|
||||
|
||||
|
||||
class Pdu2OpCodes(enum.Enum):
|
||||
@@ -20,7 +22,7 @@ class Pdu2OpCodes(enum.Enum):
|
||||
RW_ON = "5"
|
||||
RW_OFF = "6"
|
||||
# There is not really a point of the on command, the SW can not be commanded if the OBC is off
|
||||
Q7S_OFF = "7"
|
||||
Q7S_OFF = "32"
|
||||
|
||||
|
||||
class PDU2TestProcedure:
|
||||
@@ -118,6 +120,11 @@ def pack_pdu2_commands(object_id: bytearray, tc_queue: TcQueueT, op_code: str):
|
||||
Channel.off,
|
||||
)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
if op_code == GomspaceOpCodes.REQUEST_HK_ONCE.value:
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Requesting HK Table Once"))
|
||||
hk_sid = make_sid(object_id=PDU_2_HANDLER_ID, set_id=SetIds.PDU_2)
|
||||
command = generate_one_hk_command(sid=hk_sid, ssc=0)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
if op_code == GomspaceOpCodes.PRINT_SWITCH_V_I.value:
|
||||
tc_queue.appendleft(
|
||||
(QueueCommands.PRINT, "PDU2: Print Switches, Currents, Voltahes")
|
||||
@@ -126,7 +133,14 @@ def pack_pdu2_commands(object_id: bytearray, tc_queue: TcQueueT, op_code: str):
|
||||
object_id=object_id, action_id=GomspaceDeviceActionIds.PRINT_SWITCH_V_I
|
||||
)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
|
||||
if op_code == GomspaceOpCodes.PRINT_LATCHUPS.value:
|
||||
tc_queue.appendleft(
|
||||
(QueueCommands.PRINT, "PDU2: Print Latchups")
|
||||
)
|
||||
command = generate_action_command(
|
||||
object_id=object_id, action_id=GomspaceDeviceActionIds.PRINT_LATCHUPS
|
||||
)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
if PDU2TestProcedure.all or PDU2TestProcedure.reboot:
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Reboot"))
|
||||
command = pack_reboot_command(object_id)
|
||||
|
@@ -82,14 +82,14 @@ def pack_pl_pcdu_commands(tc_queue: TcQueueT, op_code: str):
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "Switching PL PCDU on"))
|
||||
mode_data = pack_mode_data(object_id=PL_PCDU_ID, mode=Modes.ON, submode=0)
|
||||
mode_cmd = PusTelecommand(
|
||||
service=200, subservice=Subservices.SWITCH_MODE, app_data=mode_data
|
||||
service=200, subservice=Subservices.COMMAND_MODE_COMMAND, app_data=mode_data
|
||||
)
|
||||
tc_queue.appendleft(mode_cmd.pack_command_tuple())
|
||||
if op_code in OpCodes.SWITCH_OFF:
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "Switching PL PCDU off"))
|
||||
mode_data = pack_mode_data(object_id=PL_PCDU_ID, mode=Modes.OFF, submode=0)
|
||||
mode_cmd = PusTelecommand(
|
||||
service=200, subservice=Subservices.SWITCH_MODE, app_data=mode_data
|
||||
service=200, subservice=Subservices.COMMAND_MODE_COMMAND, app_data=mode_data
|
||||
)
|
||||
tc_queue.appendleft(mode_cmd.pack_command_tuple())
|
||||
if op_code in OpCodes.SWITCH_ADC_NORMAL:
|
||||
@@ -100,7 +100,7 @@ def pack_pl_pcdu_commands(tc_queue: TcQueueT, op_code: str):
|
||||
object_id=PL_PCDU_ID, mode=Modes.NORMAL, submode=Submodes.ADC_ON
|
||||
)
|
||||
mode_cmd = PusTelecommand(
|
||||
service=200, subservice=Subservices.SWITCH_MODE, app_data=mode_data
|
||||
service=200, subservice=Subservices.COMMAND_MODE_COMMAND, app_data=mode_data
|
||||
)
|
||||
tc_queue.appendleft(mode_cmd.pack_command_tuple())
|
||||
if op_code in OpCodes.SWITCH_ALL_NORMAL:
|
||||
@@ -114,7 +114,7 @@ def pack_pl_pcdu_commands(tc_queue: TcQueueT, op_code: str):
|
||||
object_id=PL_PCDU_ID, mode=Modes.NORMAL, submode=Submodes.ALL_ON
|
||||
)
|
||||
mode_cmd = PusTelecommand(
|
||||
service=200, subservice=Subservices.SWITCH_MODE, app_data=mode_data
|
||||
service=200, subservice=Subservices.COMMAND_MODE_COMMAND, app_data=mode_data
|
||||
)
|
||||
tc_queue.appendleft(mode_cmd.pack_command_tuple())
|
||||
if op_code in OpCodes.UPDATE_DRO_TO_X8_WAIT:
|
||||
|
@@ -26,32 +26,44 @@ def pack_acs_command(tc_queue: TcQueueT, op_code: str):
|
||||
tc_queue.appendleft(
|
||||
(QueueCommands.PRINT, "Switching to ACS board assembly A side")
|
||||
)
|
||||
command_acs_board(mode=Modes.NORMAL, submode=AcsBoardSubmodes.A_SIDE, tc_queue=tc_queue)
|
||||
command_acs_board(
|
||||
mode=Modes.NORMAL, submode=AcsBoardSubmodes.A_SIDE, tc_queue=tc_queue
|
||||
)
|
||||
if op_code in AcsOpCodes.ACS_ASS_B_SIDE:
|
||||
tc_queue.appendleft(
|
||||
(QueueCommands.PRINT, "Switching to ACS board assembly B side")
|
||||
)
|
||||
command_acs_board(mode=Modes.NORMAL, submode=AcsBoardSubmodes.B_SIDE, tc_queue=tc_queue)
|
||||
command_acs_board(
|
||||
mode=Modes.NORMAL, submode=AcsBoardSubmodes.B_SIDE, tc_queue=tc_queue
|
||||
)
|
||||
if op_code in AcsOpCodes.ACS_ASS_DUAL_MODE:
|
||||
tc_queue.appendleft(
|
||||
(QueueCommands.PRINT, "Switching to ACS board assembly dual mode")
|
||||
)
|
||||
command_acs_board(mode=Modes.NORMAL, submode=AcsBoardSubmodes.DUAL_SIDE, tc_queue=tc_queue)
|
||||
command_acs_board(
|
||||
mode=Modes.NORMAL, submode=AcsBoardSubmodes.DUAL_SIDE, tc_queue=tc_queue
|
||||
)
|
||||
if op_code in AcsOpCodes.ACS_ASS_A_ON:
|
||||
tc_queue.appendleft(
|
||||
(QueueCommands.PRINT, "Switching ACS board assembly A side on")
|
||||
)
|
||||
command_acs_board(mode=Modes.ON, submode=AcsBoardSubmodes.A_SIDE, tc_queue=tc_queue)
|
||||
command_acs_board(
|
||||
mode=Modes.ON, submode=AcsBoardSubmodes.A_SIDE, tc_queue=tc_queue
|
||||
)
|
||||
if op_code in AcsOpCodes.ACS_ASS_B_ON:
|
||||
tc_queue.appendleft(
|
||||
(QueueCommands.PRINT, "Switching ACS board assembly B side on")
|
||||
)
|
||||
command_acs_board(mode=Modes.ON, submode=AcsBoardSubmodes.B_SIDE, tc_queue=tc_queue)
|
||||
command_acs_board(
|
||||
mode=Modes.ON, submode=AcsBoardSubmodes.B_SIDE, tc_queue=tc_queue
|
||||
)
|
||||
if op_code in AcsOpCodes.ACS_ASS_DUAL_ON:
|
||||
tc_queue.appendleft(
|
||||
(QueueCommands.PRINT, "Switching ACS board assembly dual side on")
|
||||
)
|
||||
command_acs_board(mode=Modes.ON, submode=AcsBoardSubmodes.B_SIDE, tc_queue=tc_queue)
|
||||
command_acs_board(
|
||||
mode=Modes.ON, submode=AcsBoardSubmodes.B_SIDE, tc_queue=tc_queue
|
||||
)
|
||||
if op_code in AcsOpCodes.ACS_ASS_OFF:
|
||||
tc_queue.appendleft(
|
||||
(QueueCommands.PRINT, "Switching to ACS board assembly off")
|
||||
|
@@ -4,6 +4,7 @@ from tmtccmd.config.definitions import QueueCommands
|
||||
from tmtccmd.tc.definitions import TcQueueT
|
||||
from tmtccmd.tc.service_8_functional_cmd import generate_action_command
|
||||
from tmtccmd.utility.logger import get_console_logger
|
||||
from tmtccmd.tc.service_3_housekeeping import make_sid, generate_one_hk_command
|
||||
from config.object_ids import CORE_CONTROLLER_ID
|
||||
|
||||
LOGGER = get_console_logger()
|
||||
@@ -21,6 +22,10 @@ class ActionIds(enum.IntEnum):
|
||||
REBOOT = 32
|
||||
|
||||
|
||||
class SetIds(enum.IntEnum):
|
||||
HK = 5
|
||||
|
||||
|
||||
class OpCodes:
|
||||
REBOOT = ["0", "reboot"]
|
||||
REBOOT_SELF = ["1", "reboot_self"]
|
||||
@@ -36,6 +41,7 @@ class OpCodes:
|
||||
RESET_REBOOT_COUNTER_10 = ["11", "rbh-reset-10"]
|
||||
RESET_REBOOT_COUNTER_11 = ["12", "rbh-reset-11"]
|
||||
SET_MAX_REBOOT_CNT = ["13", "rbh-max-cnt"]
|
||||
GET_HK = ["14", "get-hk"]
|
||||
|
||||
|
||||
class Chip(enum.IntEnum):
|
||||
@@ -124,6 +130,11 @@ def pack_core_commands(tc_queue: TcQueueT, op_code: str):
|
||||
generate_action_command(
|
||||
object_id=CORE_CONTROLLER_ID, action_id=ActionIds.RESET_REBOOT_COUNTER_11
|
||||
)
|
||||
elif op_code in OpCodes.GET_HK:
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "Requesting housekeeping set"))
|
||||
sid = make_sid(object_id=CORE_CONTROLLER_ID, set_id=SetIds.HK)
|
||||
command = generate_one_hk_command(sid, 201)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
|
||||
|
||||
def determine_reboot_params() -> (bool, Chip, Copy):
|
||||
|
@@ -15,6 +15,7 @@ from config.object_ids import (
|
||||
GPS_HANDLER_0_ID,
|
||||
GPS_HANDLER_1_ID,
|
||||
BPX_HANDLER_ID,
|
||||
CORE_CONTROLLER_ID,
|
||||
)
|
||||
|
||||
LOGGER = get_console_logger()
|
||||
@@ -42,6 +43,8 @@ def handle_user_hk_packet(
|
||||
return handle_gps_data(hk_data=hk_data)
|
||||
elif object_id == BPX_HANDLER_ID:
|
||||
return handle_bpx_hk_data(hk_data=hk_data, set_id=set_id)
|
||||
elif object_id == CORE_CONTROLLER_ID:
|
||||
return handle_core_hk_data(hk_data=hk_data, set_id=set_id)
|
||||
else:
|
||||
LOGGER.info("Service 3 TM: Parsing for this SID has not been implemented.")
|
||||
return HkReplyUnpacked()
|
||||
@@ -339,3 +342,16 @@ def handle_bpx_hk_data(hk_data: bytes, set_id: int) -> HkReplyUnpacked:
|
||||
reply.content_list = [battheat_mode, battheat_low, battheat_high]
|
||||
reply.validity_buffer = hk_data[3:]
|
||||
return reply
|
||||
|
||||
|
||||
def handle_core_hk_data(hk_data: bytes, set_id: int) -> HkReplyUnpacked:
|
||||
reply = HkReplyUnpacked()
|
||||
reply.header_list = ["Chip Temperature [°C]", "PS Voltage [mV]", "PL Voltage [mV]"]
|
||||
temperature = struct.unpack("!f", hk_data[0:4])
|
||||
ps_voltage = struct.unpack("!f", hk_data[4:8])
|
||||
pl_voltage = struct.unpack("!f", hk_data[8:12])
|
||||
tx_agc_value = struct.unpack("!H", hk_data[2:4])
|
||||
reply.content_list = [temperature, ps_voltage, pl_voltage]
|
||||
reply.validity_buffer = hk_data[12:]
|
||||
reply.num_of_vars = 3
|
||||
return reply
|
||||
|
2
tmtccmd
2
tmtccmd
Submodule tmtccmd updated: 1aeb44e37f...a31723786f
Reference in New Issue
Block a user