Rework switch / Voltage / Current commands #23

Merged
meierj merged 8 commits from mueller/rework-switch-cmds into develop 2021-09-24 17:29:04 +02:00
4 changed files with 32 additions and 51 deletions
Showing only changes of commit f3a2e755fd - Show all commits

View File

@ -136,31 +136,37 @@ def get_eive_service_op_code_dict(service_op_code_dict: ServiceOpCodeDictT):
Pdu1OpCodes.STAR_TRACKER_ON.value:
("PDU1: Turn star tracker on", {OpCodeDictKeys.TIMEOUT: 2.0}),
"2": ("PDU1: Get switch state of star tracker", {OpCodeDictKeys.TIMEOUT: 2.0}),
"3": ("PDU1: Turn SUS nominal on", {OpCodeDictKeys.TIMEOUT: 2.0}),
Pdu1OpCodes.SUS_NOMINAL_ON.value:
("PDU1: Turn SUS nominal on", {OpCodeDictKeys.TIMEOUT: 2.0}),
Pdu1OpCodes.STAR_TRACKER_OFF.value:
("PDU1: Turn star tracker off", {OpCodeDictKeys.TIMEOUT: 2.0}),
"5": ("PDU1: Turn SUS nominal off", {OpCodeDictKeys.TIMEOUT: 2.0}),
Pdu1OpCodes.SUS_NOMINAL_OFF.value:
("PDU1: Turn SUS nominal off", {OpCodeDictKeys.TIMEOUT: 2.0}),
Pdu1OpCodes.ACS_A_SIDE_ON.value:
("PDU1: Turn ACS Side A on", {OpCodeDictKeys.TIMEOUT: 2.0}),
Pdu1OpCodes.ACS_A_SIDE_OFF.value:
("PDU1: Turn ACS Side A off", {OpCodeDictKeys.TIMEOUT: 2.0}),
Pdu1OpCodes.PRINT_SWITCH_STATE.value:
("PDU1: Print switch states", {OpCodeDictKeys.TIMEOUT: 2.0})
PduOpCodes.PRINT_HK_TABLE.value:
("PDU1: Print Info", {OpCodeDictKeys.TIMEOUT: 2.0})
}
service_pdu1_tuple = ("PDU1 Device", op_code_dict_srv_pdu1)
op_code_dict_srv_pdu2 = {
"0": ("PDU2 Tests", {OpCodeDictKeys.TIMEOUT: 2.0}),
"1": ("PDU2: Turn ACS Side B on", {OpCodeDictKeys.TIMEOUT: 2.0}),
"2": ("PDU2: Turn ACS Side B off", {OpCodeDictKeys.TIMEOUT: 2.0}),
"3": ("PDU2: Turn SUS redundant on", {OpCodeDictKeys.TIMEOUT: 2.0}),
"4": ("PDU2: Turn SUS redundant off", {OpCodeDictKeys.TIMEOUT: 2.0}),
"5": ("PDU2: Turn reaction wheels on", {OpCodeDictKeys.TIMEOUT: 2.0}),
"6": ("PDU2: Turn reaction wheels off", {OpCodeDictKeys.TIMEOUT: 2.0}),
PduOpCodes.PRINT_ALL.value: ("PDU2: Print Info", {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})
Pdu2OpCodes.ACS_SIDE_B_ON.value:
("PDU2: Turn ACS Side B on", {OpCodeDictKeys.TIMEOUT: 2.0}),
Pdu2OpCodes.ACS_SIDE_B_OFF.value:
("PDU2: Turn ACS Side B off", {OpCodeDictKeys.TIMEOUT: 2.0}),
Pdu2OpCodes.SUS_REDUNDANT_ON.value:
("PDU2: Turn SUS redundant on", {OpCodeDictKeys.TIMEOUT: 2.0}),
Pdu2OpCodes.SUS_REDUNDANT_OFF.value:
("PDU2: Turn SUS redundant off", {OpCodeDictKeys.TIMEOUT: 2.0}),
Pdu2OpCodes.RW_ON.value:
("PDU2: Turn reaction wheels on", {OpCodeDictKeys.TIMEOUT: 2.0}),
Pdu2OpCodes.RW_OFF.value:
("PDU2: Turn reaction wheels off", {OpCodeDictKeys.TIMEOUT: 2.0}),
PduOpCodes.PRINT_HK_TABLE.value:
("PDU1: Print Info", {OpCodeDictKeys.TIMEOUT: 2.0})
}
service_pdu2_tuple = ("PDU2 Device", op_code_dict_srv_pdu2)

View File

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

View File

@ -20,7 +20,6 @@ class Pdu1OpCodes(enum.Enum):
SUS_NOMINAL_OFF = "5"
ACS_A_SIDE_ON = "6"
ACS_A_SIDE_OFF = "7"
PRINT_SWITCH_STATE = "17"
class PDU1TestProcedure:
@ -78,26 +77,26 @@ def pack_pdu1_commands(object_id: bytearray, tc_queue: TcQueueT, op_code: str):
PDUConfigTable.out_en_7.parameter_size, Channel.off
)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == Pdu1OpCodes.PRINT_SWITCH_STATE.value:
tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Print Switch Status"))
command = generate_action_command(
object_id=object_id, action_id=GomspaceDeviceActionIds.PRINT_SWITCH_STATES
)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "8":
if op_code == Pdu1OpCodes.SUS_NOMINAL_ON.value:
tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Turn SUS nominal on"))
command = pack_set_param_command(
object_id, PDUConfigTable.out_en_4.parameter_address,
PDUConfigTable.out_en_4.parameter_size, Channel.on
)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "9":
if op_code == Pdu1OpCodes.SUS_NOMINAL_OFF.value:
tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Turn SUS nominal off"))
command = pack_set_param_command(
object_id, PDUConfigTable.out_en_4.parameter_address,
PDUConfigTable.out_en_4.parameter_size, Channel.off
)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == PduOpCodes.PRINT_HK_TABLE.value:
tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Print Info"))
command = generate_action_command(
object_id=object_id, action_id=GomspaceDeviceActionIds.PRINT_HK_TABLE
)
tc_queue.appendleft(command.pack_command_tuple())
if PDU1TestProcedure.all or PDU1TestProcedure.ping:
tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Ping Test"))

View File

@ -84,28 +84,10 @@ def pack_pdu2_commands(object_id: bytearray, tc_queue: TcQueueT, op_code: str) -
command = pack_set_param_command(object_id, PDUConfigTable.out_en_2.parameter_address,
PDUConfigTable.out_en_2.parameter_size, Channel.off)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == PduOpCodes.PRINT_ALL.value:
if op_code == PduOpCodes.PRINT_HK_TABLE.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"))
command = generate_action_command(
object_id=object_id, action_id=GomspaceDeviceActionIds.PRINT_SWITCH_STATES
)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == PduOpCodes.PRINT_CURRENTS.value:
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.value:
tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Print Voltages"))
command = generate_action_command(
object_id=object_id, action_id=GomspaceDeviceActionIds.PRINT_VOLTAGES
object_id=object_id, action_id=GomspaceDeviceActionIds.PRINT_HK_TABLE
)
tc_queue.appendleft(command.pack_command_tuple())