Rework switch / Voltage / Current commands #23
2
.idea/runConfigurations/P60_Dock_Commanding.xml
generated
2
.idea/runConfigurations/P60_Dock_Commanding.xml
generated
@ -1,5 +1,5 @@
|
|||||||
<component name="ProjectRunConfigurationManager">
|
<component name="ProjectRunConfigurationManager">
|
||||||
<configuration default="false" name="P60 Dock Commanding" type="PythonConfigurationType" factoryName="Python" folderName="Devices">
|
<configuration default="false" name="P60 Dock Commanding" type="PythonConfigurationType" factoryName="Python" folderName="Core">
|
||||||
<module name="tmtc" />
|
<module name="tmtc" />
|
||||||
<option name="INTERPRETER_OPTIONS" value="" />
|
<option name="INTERPRETER_OPTIONS" value="" />
|
||||||
<option name="PARENT_ENVS" value="true" />
|
<option name="PARENT_ENVS" value="true" />
|
||||||
|
@ -90,6 +90,8 @@ 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 pus_tc.p60dock import P60OpCodes
|
||||||
|
from gomspace.gomspace_common import GomspaceOpCodes
|
||||||
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}),
|
||||||
@ -125,8 +127,12 @@ def get_eive_service_op_code_dict(service_op_code_dict: ServiceOpCodeDictT):
|
|||||||
|
|
||||||
op_code_dict_srv_p60 = {
|
op_code_dict_srv_p60 = {
|
||||||
"0": ("P60 Tests", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
"0": ("P60 Tests", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||||
"1": ("P60 Dock: Turn stack 3V3 on", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
P60OpCodes.STACK_3V3_ON.value:
|
||||||
"2": ("P60 Dock: Turn stack 3V3 off", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
("P60 Dock: Turn stack 3V3 on", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||||
|
P60OpCodes.STACK_3V3_OFF.value:
|
||||||
|
("P60 Dock: Turn stack 3V3 off", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||||
|
GomspaceOpCodes.PRINT_SWITCH_V_I.value:
|
||||||
|
("P60 Dock: Print Switches, Voltages, Currents", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||||
}
|
}
|
||||||
service_p60_tuple = ("P60 Device", op_code_dict_srv_p60)
|
service_p60_tuple = ("P60 Device", op_code_dict_srv_p60)
|
||||||
|
|
||||||
@ -135,29 +141,37 @@ def get_eive_service_op_code_dict(service_op_code_dict: ServiceOpCodeDictT):
|
|||||||
Pdu1OpCodes.STAR_TRACKER_ON.value:
|
Pdu1OpCodes.STAR_TRACKER_ON.value:
|
||||||
("PDU1: Turn star tracker on", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
("PDU1: Turn star tracker on", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||||
"2": ("PDU1: Get switch state of star tracker", {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:
|
Pdu1OpCodes.STAR_TRACKER_OFF.value:
|
||||||
("PDU1: Turn star tracker off", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
("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:
|
Pdu1OpCodes.ACS_A_SIDE_ON.value:
|
||||||
("PDU1: Turn ACS Side A on", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
("PDU1: Turn ACS Side A on", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||||
Pdu1OpCodes.ACS_A_SIDE_OFF.value:
|
Pdu1OpCodes.ACS_A_SIDE_OFF.value:
|
||||||
("PDU1: Turn ACS Side A off", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
("PDU1: Turn ACS Side A off", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||||
Pdu1OpCodes.PRINT_SWITCH_STATE.value:
|
GomspaceOpCodes.PRINT_SWITCH_V_I.value:
|
||||||
("PDU1: Print switch states", {OpCodeDictKeys.TIMEOUT: 2.0})
|
("PDU1: Print Switches, Voltages, Currents", {OpCodeDictKeys.TIMEOUT: 2.0})
|
||||||
}
|
}
|
||||||
service_pdu1_tuple = ("PDU1 Device", op_code_dict_srv_pdu1)
|
service_pdu1_tuple = ("PDU1 Device", op_code_dict_srv_pdu1)
|
||||||
|
|
||||||
op_code_dict_srv_pdu2 = {
|
op_code_dict_srv_pdu2 = {
|
||||||
"0": ("PDU2 Tests", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
"0": ("PDU2 Tests", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||||
"1": ("PDU2: Turn ACS Side A on", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
Pdu2OpCodes.ACS_SIDE_B_ON.value:
|
||||||
"2": ("PDU2: Turn ACS Side A off", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
("PDU2: Turn ACS Side B on", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||||
"3": ("PDU2: Turn SUS redundant on", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
Pdu2OpCodes.ACS_SIDE_B_OFF.value:
|
||||||
"4": ("PDU2: Turn SUS redundant off", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
("PDU2: Turn ACS Side B off", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||||
"5": ("PDU2: Turn reaction wheels on", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
Pdu2OpCodes.SUS_REDUNDANT_ON.value:
|
||||||
"6": ("PDU2: Turn reaction wheels off", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
("PDU2: Turn SUS redundant on", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||||
Pdu1OpCodes.PRINT_SWITCH_STATE.value:
|
Pdu2OpCodes.SUS_REDUNDANT_OFF.value:
|
||||||
("PDU1: Print switch states", {OpCodeDictKeys.TIMEOUT: 2.0})
|
("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}),
|
||||||
|
GomspaceOpCodes.PRINT_SWITCH_V_I.value:
|
||||||
|
("PDU1: Print Switches, Voltages, Currents", {OpCodeDictKeys.TIMEOUT: 2.0})
|
||||||
}
|
}
|
||||||
service_pdu2_tuple = ("PDU2 Device", op_code_dict_srv_pdu2)
|
service_pdu2_tuple = ("PDU2 Device", op_code_dict_srv_pdu2)
|
||||||
|
|
||||||
|
@ -19,7 +19,11 @@ 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_SWITCH_V_I = 32
|
||||||
|
|
||||||
|
|
||||||
|
class GomspaceOpCodes(enum.Enum):
|
||||||
|
PRINT_SWITCH_V_I = "32"
|
||||||
|
|
||||||
|
|
||||||
class TableIds:
|
class TableIds:
|
||||||
|
@ -4,22 +4,29 @@ from tmtccmd.pus.service_list import PusServices
|
|||||||
from tmtccmd.tc.service_200_mode import pack_mode_data, Modes
|
from tmtccmd.tc.service_200_mode import pack_mode_data, Modes
|
||||||
from tmtccmd.tc.packer import PusTelecommand
|
from tmtccmd.tc.packer import PusTelecommand
|
||||||
from config.object_ids import MGM_0_HANDLER_ID, MGM_1_HANDLER_ID, MGM_2_HANDLER_ID, MGM_3_HANDLER_ID
|
from config.object_ids import MGM_0_HANDLER_ID, MGM_1_HANDLER_ID, MGM_2_HANDLER_ID, MGM_3_HANDLER_ID
|
||||||
|
from pus_tc.pdu1 import pack_pdu1_commands, Pdu1OpCodes
|
||||||
|
from pus_tc.pdu2 import pack_pdu2_commands, Pdu2OpCodes
|
||||||
|
|
||||||
|
|
||||||
class AcsOpCodes(enum.Enum):
|
class AcsOpCodes(enum.Enum):
|
||||||
|
ALL_ON = "0"
|
||||||
|
ALL_OFF = "1"
|
||||||
|
POWER_CYCLE = "2"
|
||||||
# Switch on A side
|
# Switch on A side
|
||||||
ON_MGM_0 = "0"
|
ON_MGM_0 = "12"
|
||||||
ON_MGM_1 = "1"
|
ON_MGM_1 = "13"
|
||||||
ON_GYRO_0 = "2"
|
ON_GYRO_0 = "14"
|
||||||
ON_GYRO_1 = "3"
|
ON_GYRO_1 = "15"
|
||||||
# Switch on B side
|
# Switch on B side
|
||||||
ON_MGM_2 = "4"
|
ON_MGM_2 = "16"
|
||||||
ON_MGM_3 = "5"
|
ON_MGM_3 = "17"
|
||||||
ON_GYRO_2 = "6"
|
ON_GYRO_2 = "18"
|
||||||
ON_GYRO_3 = "7"
|
ON_GYRO_3 = "19"
|
||||||
|
|
||||||
|
|
||||||
def pack_acs_command(tc_queue: TcQueueT, op_code: str):
|
def pack_acs_command(tc_queue: TcQueueT, op_code: str):
|
||||||
|
if op_code == AcsOpCodes.ALL_ON:
|
||||||
|
pass
|
||||||
if op_code == AcsOpCodes.ON_MGM_0.value:
|
if op_code == AcsOpCodes.ON_MGM_0.value:
|
||||||
app_data = pack_mode_data(object_id=MGM_0_HANDLER_ID, mode=Modes.ON, submode=0)
|
app_data = pack_mode_data(object_id=MGM_0_HANDLER_ID, mode=Modes.ON, submode=0)
|
||||||
# return PusTelecommand(service=PusServices.SERVICE_200_MODE, subservice=)
|
# return PusTelecommand(service=PusServices.SERVICE_200_MODE, subservice=)
|
@ -7,10 +7,15 @@
|
|||||||
"""
|
"""
|
||||||
from tmtccmd.config.definitions import QueueCommands
|
from tmtccmd.config.definitions import QueueCommands
|
||||||
from tmtccmd.tc.packer import TcQueueT
|
from tmtccmd.tc.packer import TcQueueT
|
||||||
from tmtccmd.ecss.tc import PusTelecommand
|
|
||||||
from gomspace.gomspace_common import *
|
from gomspace.gomspace_common import *
|
||||||
|
|
||||||
|
|
||||||
|
class P60OpCodes(enum.Enum):
|
||||||
|
TEST = "0"
|
||||||
|
STACK_3V3_ON = "1"
|
||||||
|
STACK_3V3_OFF = "2"
|
||||||
|
|
||||||
|
|
||||||
class P60DockTestProcedure:
|
class P60DockTestProcedure:
|
||||||
"""
|
"""
|
||||||
@brief Use this class to define the tests to perform for the P60Dock.
|
@brief Use this class to define the tests to perform for the P60Dock.
|
||||||
@ -57,27 +62,30 @@ class P60DockHkTable:
|
|||||||
wdt_gnd_left = TableEntry(bytearray([0x00, 0xA8]), TableEntry.uint32_size)
|
wdt_gnd_left = TableEntry(bytearray([0x00, 0xA8]), TableEntry.uint32_size)
|
||||||
|
|
||||||
|
|
||||||
def pack_p60dock_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code: str) -> TcQueueT:
|
def pack_p60dock_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code: str):
|
||||||
|
if op_code == P60OpCodes.STACK_3V3_ON.value:
|
||||||
if op_code == "1":
|
|
||||||
tc_queue.appendleft((QueueCommands.PRINT, "P60 Dock: Turning stack 3V3 on"))
|
tc_queue.appendleft((QueueCommands.PRINT, "P60 Dock: Turning stack 3V3 on"))
|
||||||
command = pack_set_param_command(
|
command = pack_set_param_command(
|
||||||
object_id, P60DockConfigTable.out_en_9.parameter_address,
|
object_id, P60DockConfigTable.out_en_9.parameter_address,
|
||||||
P60DockConfigTable.out_en_9.parameter_size, Channel.on
|
P60DockConfigTable.out_en_9.parameter_size, Channel.on
|
||||||
)
|
)
|
||||||
# command = PusTelecommand(service=8, subservice=128, ssc=20, app_data=command)
|
|
||||||
tc_queue.appendleft(command.pack_command_tuple())
|
tc_queue.appendleft(command.pack_command_tuple())
|
||||||
return tc_queue
|
return
|
||||||
if op_code == "2":
|
if op_code == P60OpCodes.STACK_3V3_OFF.value:
|
||||||
tc_queue.appendleft((QueueCommands.PRINT, "P60 Dock: Turning stack 3V3 off"))
|
tc_queue.appendleft((QueueCommands.PRINT, "P60 Dock: Turning stack 3V3 off"))
|
||||||
command = pack_set_param_command(
|
command = pack_set_param_command(
|
||||||
object_id, P60DockConfigTable.out_en_9.parameter_address,
|
object_id, P60DockConfigTable.out_en_9.parameter_address,
|
||||||
P60DockConfigTable.out_en_9.parameter_size, Channel.off
|
P60DockConfigTable.out_en_9.parameter_size, Channel.off
|
||||||
)
|
)
|
||||||
# command = PusTelecommand(service=8, subservice=128, ssc=20, app_data=command)
|
|
||||||
tc_queue.appendleft(command.pack_command_tuple())
|
tc_queue.appendleft(command.pack_command_tuple())
|
||||||
return tc_queue
|
return
|
||||||
|
if op_code == GomspaceOpCodes.PRINT_SWITCH_V_I.value:
|
||||||
|
tc_queue.appendleft((QueueCommands.PRINT, "P60 Dock: 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())
|
||||||
|
return
|
||||||
if P60DockTestProcedure.all or P60DockTestProcedure.reboot:
|
if P60DockTestProcedure.all or P60DockTestProcedure.reboot:
|
||||||
tc_queue.appendleft((QueueCommands.PRINT, "P60 Dock: Reboot"))
|
tc_queue.appendleft((QueueCommands.PRINT, "P60 Dock: Reboot"))
|
||||||
command = pack_reboot_command(object_id)
|
command = pack_reboot_command(object_id)
|
||||||
|
@ -1,8 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
"""
|
"""PDU2 is mounted on the X4 slot of the P60 dock
|
||||||
@file tmtcc_tc_pdu1.py
|
|
||||||
@brief PDU2 tests
|
|
||||||
@details PDU2 is mounted on the X4 slot of the P60 dock
|
|
||||||
@author J. Meier
|
@author J. Meier
|
||||||
@date 17.12.2020
|
@date 17.12.2020
|
||||||
"""
|
"""
|
||||||
@ -18,10 +15,11 @@ from gomspace.gomspace_pdu_definitions import *
|
|||||||
|
|
||||||
class Pdu1OpCodes(enum.Enum):
|
class Pdu1OpCodes(enum.Enum):
|
||||||
STAR_TRACKER_ON = "1"
|
STAR_TRACKER_ON = "1"
|
||||||
|
SUS_NOMINAL_ON = "3"
|
||||||
STAR_TRACKER_OFF = "4"
|
STAR_TRACKER_OFF = "4"
|
||||||
|
SUS_NOMINAL_OFF = "5"
|
||||||
ACS_A_SIDE_ON = "6"
|
ACS_A_SIDE_ON = "6"
|
||||||
ACS_A_SIDE_OFF = "7"
|
ACS_A_SIDE_OFF = "7"
|
||||||
PRINT_SWITCH_STATE = "17"
|
|
||||||
|
|
||||||
|
|
||||||
class PDU1TestProcedure:
|
class PDU1TestProcedure:
|
||||||
@ -40,7 +38,7 @@ class PDU1TestProcedure:
|
|||||||
turn_channel_3_off = False
|
turn_channel_3_off = False
|
||||||
|
|
||||||
|
|
||||||
def pack_pdu1_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code: str):
|
def pack_pdu1_commands(object_id: bytearray, tc_queue: TcQueueT, op_code: str):
|
||||||
tc_queue.appendleft((QueueCommands.PRINT, "Commanding PDU1"))
|
tc_queue.appendleft((QueueCommands.PRINT, "Commanding PDU1"))
|
||||||
|
|
||||||
if op_code == Pdu1OpCodes.STAR_TRACKER_ON.value:
|
if op_code == Pdu1OpCodes.STAR_TRACKER_ON.value:
|
||||||
@ -48,7 +46,7 @@ def pack_pdu1_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code: str):
|
|||||||
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.on)
|
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 == "3":
|
if op_code == Pdu1OpCodes.SUS_NOMINAL_ON.value:
|
||||||
tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Turn SUS nominal on"))
|
tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Turn SUS nominal 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)
|
||||||
@ -58,10 +56,12 @@ def pack_pdu1_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code: str):
|
|||||||
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 == "5":
|
if op_code == Pdu1OpCodes.SUS_NOMINAL_OFF.value:
|
||||||
tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Turn SUS nominal off"))
|
tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Turn SUS nominal off"))
|
||||||
command = pack_set_param_command(object_id, PDUConfigTable.out_en_4.parameter_address,
|
command = pack_set_param_command(
|
||||||
PDUConfigTable.out_en_4.parameter_size, Channel.off)
|
object_id, PDUConfigTable.out_en_4.parameter_address,
|
||||||
|
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 == Pdu1OpCodes.ACS_A_SIDE_ON.value:
|
if op_code == Pdu1OpCodes.ACS_A_SIDE_ON.value:
|
||||||
tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Turn ACS Side A on"))
|
tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Turn ACS Side A on"))
|
||||||
@ -77,26 +77,26 @@ def pack_pdu1_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code: str):
|
|||||||
PDUConfigTable.out_en_7.parameter_size, Channel.off
|
PDUConfigTable.out_en_7.parameter_size, Channel.off
|
||||||
)
|
)
|
||||||
tc_queue.appendleft(command.pack_command_tuple())
|
tc_queue.appendleft(command.pack_command_tuple())
|
||||||
if op_code == Pdu1OpCodes.PRINT_SWITCH_STATE.value:
|
if op_code == Pdu1OpCodes.SUS_NOMINAL_ON.value:
|
||||||
tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Print Switch Status"))
|
|
||||||
command = generate_action_command(
|
|
||||||
object_id=object_id, action_id=GomspaceDeviceActionIds.PRINT_SWITCH_STATE
|
|
||||||
)
|
|
||||||
tc_queue.appendleft(command.pack_command_tuple())
|
|
||||||
if op_code == "8":
|
|
||||||
tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Turn SUS nominal on"))
|
tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Turn SUS nominal on"))
|
||||||
command = pack_set_param_command(
|
command = pack_set_param_command(
|
||||||
object_id, PDUConfigTable.out_en_4.parameter_address,
|
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 == "9":
|
if op_code == Pdu1OpCodes.SUS_NOMINAL_OFF.value:
|
||||||
tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Turn SUS nominal off"))
|
tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Turn SUS nominal off"))
|
||||||
command = pack_set_param_command(
|
command = pack_set_param_command(
|
||||||
object_id, PDUConfigTable.out_en_4.parameter_address,
|
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 == 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 PDU1TestProcedure.all or PDU1TestProcedure.ping:
|
if PDU1TestProcedure.all or PDU1TestProcedure.ping:
|
||||||
tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Ping Test"))
|
tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Ping Test"))
|
||||||
|
@ -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:
|
||||||
@ -40,7 +43,7 @@ class PDU2TestProcedure:
|
|||||||
request_hk_table = False
|
request_hk_table = False
|
||||||
|
|
||||||
|
|
||||||
def pack_pdu2_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code: str) -> TcQueueT:
|
def pack_pdu2_commands(object_id: bytearray, tc_queue: TcQueueT, op_code: str) -> TcQueueT:
|
||||||
tc_queue.appendleft((QueueCommands.PRINT, "Testing PDU2"))
|
tc_queue.appendleft((QueueCommands.PRINT, "Testing PDU2"))
|
||||||
|
|
||||||
if op_code == Pdu2OpCodes.ACS_SIDE_B_ON.value:
|
if op_code == Pdu2OpCodes.ACS_SIDE_B_ON.value:
|
||||||
@ -59,31 +62,32 @@ 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 == GomspaceOpCodes.PRINT_SWITCH_V_I.value:
|
||||||
tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Print Switch Status"))
|
tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Print Switches, Currents, Voltahes"))
|
||||||
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_V_I
|
||||||
)
|
)
|
||||||
tc_queue.appendleft(command.pack_command_tuple())
|
tc_queue.appendleft(command.pack_command_tuple())
|
||||||
|
|
||||||
|
@ -12,8 +12,8 @@ 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.service_200_mode import pack_service200_test_into
|
||||||
from pus_tc.p60dock import pack_p60dock_test_into
|
from pus_tc.p60dock import pack_p60dock_test_into
|
||||||
from pus_tc.pdu2 import pack_pdu2_test_into
|
from pus_tc.pdu2 import pack_pdu2_commands
|
||||||
from pus_tc.pdu1 import pack_pdu1_test_into
|
from pus_tc.pdu1 import pack_pdu1_commands
|
||||||
from pus_tc.acu import pack_acu_test_into
|
from pus_tc.acu import pack_acu_test_into
|
||||||
from pus_tc.imtq import pack_imtq_test_into
|
from pus_tc.imtq import pack_imtq_test_into
|
||||||
from pus_tc.tmp1075 import pack_tmp1075_test_into
|
from pus_tc.tmp1075 import pack_tmp1075_test_into
|
||||||
@ -50,10 +50,10 @@ def pack_service_queue_user(service: Union[str, int], op_code: str, service_queu
|
|||||||
return pack_p60dock_test_into(object_id=object_id, tc_queue=service_queue, op_code=op_code)
|
return pack_p60dock_test_into(object_id=object_id, tc_queue=service_queue, op_code=op_code)
|
||||||
if service == CustomServiceList.PDU1.value:
|
if service == CustomServiceList.PDU1.value:
|
||||||
object_id = PDU_1_HANDLER_ID
|
object_id = PDU_1_HANDLER_ID
|
||||||
return pack_pdu1_test_into(object_id=object_id, tc_queue=service_queue, op_code=op_code)
|
return pack_pdu1_commands(object_id=object_id, tc_queue=service_queue, op_code=op_code)
|
||||||
if service == CustomServiceList.PDU2.value:
|
if service == CustomServiceList.PDU2.value:
|
||||||
object_id = PDU_2_HANDLER_ID
|
object_id = PDU_2_HANDLER_ID
|
||||||
return pack_pdu2_test_into(object_id=object_id, tc_queue=service_queue, op_code=op_code)
|
return pack_pdu2_commands(object_id=object_id, tc_queue=service_queue, op_code=op_code)
|
||||||
if service == CustomServiceList.ACU.value:
|
if service == CustomServiceList.ACU.value:
|
||||||
object_id = ACU_HANDLER_ID
|
object_id = ACU_HANDLER_ID
|
||||||
return pack_acu_test_into(object_id=object_id, tc_queue=service_queue)
|
return pack_acu_test_into(object_id=object_id, tc_queue=service_queue)
|
||||||
|
Loading…
Reference in New Issue
Block a user