more print commands for PCDU

This commit is contained in:
Robin Müller 2021-09-16 14:51:24 +02:00
parent 9d1cae0809
commit 6da94c73d0
3 changed files with 46 additions and 11 deletions

View File

@ -90,6 +90,7 @@ class EiveHookObject(TmTcHookBase):
def get_eive_service_op_code_dict(service_op_code_dict: ServiceOpCodeDictT): def get_eive_service_op_code_dict(service_op_code_dict: ServiceOpCodeDictT):
from pus_tc.pdu1 import Pdu1OpCodes from pus_tc.pdu1 import Pdu1OpCodes
from pus_tc.pdu2 import Pdu2OpCodes from pus_tc.pdu2 import Pdu2OpCodes
from gomspace.gomspace_common import PduOpCodes
from pus_tc.gps import GpsOpCodes from pus_tc.gps import GpsOpCodes
op_code_dict = { op_code_dict = {
'reboot': ('Reboot with Prompt', {OpCodeDictKeys.TIMEOUT: 2.0}), 'reboot': ('Reboot with Prompt', {OpCodeDictKeys.TIMEOUT: 2.0}),
@ -156,8 +157,10 @@ def get_eive_service_op_code_dict(service_op_code_dict: ServiceOpCodeDictT):
"4": ("PDU2: Turn SUS redundant off", {OpCodeDictKeys.TIMEOUT: 2.0}), "4": ("PDU2: Turn SUS redundant off", {OpCodeDictKeys.TIMEOUT: 2.0}),
"5": ("PDU2: Turn reaction wheels on", {OpCodeDictKeys.TIMEOUT: 2.0}), "5": ("PDU2: Turn reaction wheels on", {OpCodeDictKeys.TIMEOUT: 2.0}),
"6": ("PDU2: Turn reaction wheels off", {OpCodeDictKeys.TIMEOUT: 2.0}), "6": ("PDU2: Turn reaction wheels off", {OpCodeDictKeys.TIMEOUT: 2.0}),
Pdu1OpCodes.PRINT_SWITCH_STATE.value: PduOpCodes.PRINT_ALL.value: ("PDU2: Print Info", {OpCodeDictKeys.TIMEOUT: 2.0}),
("PDU1: Print switch states", {OpCodeDictKeys.TIMEOUT: 2.0}) PduOpCodes.PRINT_SWITCH_STATES.value: ("PDU2: Print Switch States", {OpCodeDictKeys.TIMEOUT: 2.0}),
PduOpCodes.PRINT_CURRENTS.value: ("PDU2: Print Currents", {OpCodeDictKeys.TIMEOUT: 2.0}),
PduOpCodes.PRINT_VOLTAGES.value: ("PDU2: Print Voltages", {OpCodeDictKeys.TIMEOUT: 2.0})
} }
service_pdu2_tuple = ("PDU2 Device", op_code_dict_srv_pdu2) service_pdu2_tuple = ("PDU2 Device", op_code_dict_srv_pdu2)

View File

@ -19,7 +19,17 @@ class GomspaceDeviceActionIds(enum.IntEnum):
PARAM_SET = 255 PARAM_SET = 255
WDT_RESET = 9 WDT_RESET = 9
REQUEST_HK_TABLE = 16 REQUEST_HK_TABLE = 16
PRINT_SWITCH_STATE = 17 PRINT_ALL = 32
PRINT_SWITCH_STATES = 33
PRINT_CURRENTS = 34
PRINT_VOLTAGES = 35
class PduOpCodes(enum.Enum):
PRINT_ALL = "32"
PRINT_SWITCH_STATES = "33"
PRINT_CURRENTS = "34"
PRINT_VOLTAGES = "35"
class TableIds: class TableIds:

View File

@ -15,7 +15,10 @@ from gomspace.gomspace_pdu_definitions import *
class Pdu2OpCodes(enum.Enum): class Pdu2OpCodes(enum.Enum):
ACS_SIDE_B_ON = "1" ACS_SIDE_B_ON = "1"
ACS_SIDE_B_OFF = "2" ACS_SIDE_B_OFF = "2"
PRINT_SWITCH_STATE = "17" SUS_REDUNDANT_ON = "3"
SUS_REDUNDANT_OFF = "4"
RW_ON = "5"
RW_OFF = "6"
class PDU2TestProcedure: class PDU2TestProcedure:
@ -59,31 +62,50 @@ def pack_pdu2_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code: str)
) )
tc_queue.appendleft(command.pack_command_tuple()) tc_queue.appendleft(command.pack_command_tuple())
return tc_queue return tc_queue
if op_code == "3": if op_code == Pdu2OpCodes.SUS_REDUNDANT_ON.value:
tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Turn SUS redundant on")) tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Turn SUS redundant on"))
command = pack_set_param_command(object_id, PDUConfigTable.out_en_4.parameter_address, command = pack_set_param_command(object_id, PDUConfigTable.out_en_4.parameter_address,
PDUConfigTable.out_en_4.parameter_size, Channel.on) PDUConfigTable.out_en_4.parameter_size, Channel.on)
tc_queue.appendleft(command.pack_command_tuple()) tc_queue.appendleft(command.pack_command_tuple())
if op_code == "4": if op_code == Pdu2OpCodes.SUS_REDUNDANT_OFF.value:
tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Turn SUS redundant off")) tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Turn SUS redundant off"))
command = pack_set_param_command(object_id, PDUConfigTable.out_en_4.parameter_address, command = pack_set_param_command(object_id, PDUConfigTable.out_en_4.parameter_address,
PDUConfigTable.out_en_4.parameter_size, Channel.off) PDUConfigTable.out_en_4.parameter_size, Channel.off)
tc_queue.appendleft(command.pack_command_tuple()) tc_queue.appendleft(command.pack_command_tuple())
if op_code == "5": if op_code == Pdu2OpCodes.RW_ON.value:
tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Turn reaction wheels on")) tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Turn reaction wheels on"))
command = pack_set_param_command( command = pack_set_param_command(
object_id, PDUConfigTable.out_en_2.parameter_address, PDUConfigTable.out_en_2.parameter_size, Channel.on object_id, PDUConfigTable.out_en_2.parameter_address,
PDUConfigTable.out_en_2.parameter_size, Channel.on
) )
tc_queue.appendleft(command.pack_command_tuple()) tc_queue.appendleft(command.pack_command_tuple())
if op_code == "6": if op_code == Pdu2OpCodes.RW_OFF.value:
tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Turn reaction wheels off")) tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Turn reaction wheels off"))
command = pack_set_param_command(object_id, PDUConfigTable.out_en_2.parameter_address, command = pack_set_param_command(object_id, PDUConfigTable.out_en_2.parameter_address,
PDUConfigTable.out_en_2.parameter_size, Channel.off) PDUConfigTable.out_en_2.parameter_size, Channel.off)
tc_queue.appendleft(command.pack_command_tuple()) tc_queue.appendleft(command.pack_command_tuple())
if op_code == Pdu2OpCodes.PRINT_SWITCH_STATE.value: if op_code == PduOpCodes.PRINT_ALL.value:
tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Print Info"))
command = generate_action_command(
object_id=object_id, action_id=GomspaceDeviceActionIds.PRINT_ALL
)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == PduOpCodes.PRINT_SWITCH_STATES.value:
tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Print Switch Status")) tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Print Switch Status"))
command = generate_action_command( command = generate_action_command(
object_id=object_id, action_id=GomspaceDeviceActionIds.PRINT_SWITCH_STATE object_id=object_id, action_id=GomspaceDeviceActionIds.PRINT_SWITCH_STATES
)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == PduOpCodes.PRINT_CURRENTS:
tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Print Currents"))
command = generate_action_command(
object_id=object_id, action_id=GomspaceDeviceActionIds.PRINT_CURRENTS
)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == PduOpCodes.PRINT_VOLTAGES:
tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Print Voltages"))
command = generate_action_command(
object_id=object_id, action_id=GomspaceDeviceActionIds.PRINT_VOLTAGES
) )
tc_queue.appendleft(command.pack_command_tuple()) tc_queue.appendleft(command.pack_command_tuple())