added OpCode to request PDU1 HK

This commit is contained in:
2022-03-14 09:56:34 +01:00
parent b6360b9c5c
commit 3f1ee29d1f
3 changed files with 39 additions and 17 deletions

View File

@ -5,27 +5,39 @@
"""
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"
# Request HK
REQUEST_HK_ONCE = "16"
TESTS = "32"
class SetIds:
PDU_1 = 0x01
PDU_2 = 0x02
P60_DOCK = 0x03
ACU = 0x04
class PDU1TestProcedure:
@ -151,6 +163,11 @@ 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 == Pdu1OpCodes.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")