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 30 additions and 22 deletions
Showing only changes of commit 3f29dff606 - Show all commits

View File

@ -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=)

View File

@ -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,7 +15,9 @@ 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" PRINT_SWITCH_STATE = "17"
@ -40,7 +39,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 +47,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 +57,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"))

View File

@ -43,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:

View File

@ -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)