Merge remote-tracking branch 'origin/develop' into mueller/acu-hk

This commit is contained in:
Robin Müller 2022-05-23 18:34:44 +02:00
commit 3586b541c1
3 changed files with 26 additions and 32 deletions

View File

@ -79,7 +79,7 @@ HEATER_7_HPA = bytes([0x60, 0x00, 0x00, 0x07])
# RTDs
RTD_0_PLOC_HSPD = bytes([0x44, 0x42, 0x00, 0x16])
RTD_1_PLOC_MISSIONBRD= bytes([0x44, 0x42, 0x00, 0x17])
RTD_1_PLOC_MISSIONBRD = bytes([0x44, 0x42, 0x00, 0x17])
RTD_2_4K_CAM = bytes([0x44, 0x42, 0x00, 0x18])
RTD_3_DAC_HSPD = bytes([0x44, 0x42, 0x00, 0x19])
RTD_4_STR = bytes([0x44, 0x42, 0x00, 0x20])

View File

@ -2,7 +2,11 @@ from typing import Optional
from config.definitions import CustomServiceList
from spacepackets.ecss import PusTelecommand
from tmtccmd.config import ServiceOpCodeDictT, add_op_code_entry, add_service_op_code_entry
from tmtccmd.config import (
ServiceOpCodeDictT,
add_op_code_entry,
add_service_op_code_entry,
)
from tmtccmd.tc.definitions import TcQueueT
from tmtccmd.utility import ObjectId
from tmtccmd.tc.pus_200_fsfw_modes import Modes, pack_mode_data, Subservices
@ -25,7 +29,7 @@ RTD_IDS = [
oids.RTD_12_ACU,
oids.RTD_13_PLPCDU_HSPD,
oids.RTD_14_TCS_BRD,
oids.RTD_15_IMTQ
oids.RTD_15_IMTQ,
]
@ -43,26 +47,14 @@ class Info:
def specify_rtd_cmds(cmd_dict: ServiceOpCodeDictT):
op_code_dict = dict()
add_op_code_entry(
op_code_dict=op_code_dict,
keys=OpCodes.ON,
info=Info.ON
)
add_op_code_entry(
op_code_dict=op_code_dict,
keys=OpCodes.NORMAL,
info=Info.NORMAL
)
add_op_code_entry(
op_code_dict=op_code_dict,
keys=OpCodes.OFF,
info=Info.OFF
)
add_op_code_entry(op_code_dict=op_code_dict, keys=OpCodes.ON, info=Info.ON)
add_op_code_entry(op_code_dict=op_code_dict, keys=OpCodes.NORMAL, info=Info.NORMAL)
add_op_code_entry(op_code_dict=op_code_dict, keys=OpCodes.OFF, info=Info.OFF)
add_service_op_code_entry(
srv_op_code_dict=cmd_dict,
op_code_entry=op_code_dict,
name=CustomServiceList.RTD.value,
info="RTD commands"
info="RTD commands",
)
@ -75,27 +67,27 @@ def pack_rtd_commands(op_code: str, object_id: Optional[ObjectId], tc_queue: TcQ
object_id_dict = get_object_ids()
object_id = object_id_dict.get(RTD_IDS[tgt_rtd_idx])
if op_code in OpCodes.ON:
app_data = pack_mode_data(object_id=object_id.as_bytes, mode=Modes.ON, submode=0)
app_data = pack_mode_data(
object_id=object_id.as_bytes, mode=Modes.ON, submode=0
)
cmd = PusTelecommand(
service=200,
subservice=Subservices.TC_MODE_COMMAND,
app_data=app_data
service=200, subservice=Subservices.TC_MODE_COMMAND, app_data=app_data
)
tc_queue.appendleft(cmd.pack_command_tuple())
if op_code in OpCodes.NORMAL:
app_data = pack_mode_data(object_id=object_id.as_bytes, mode=Modes.NORMAL, submode=0)
app_data = pack_mode_data(
object_id=object_id.as_bytes, mode=Modes.NORMAL, submode=0
)
cmd = PusTelecommand(
service=200,
subservice=Subservices.TC_MODE_COMMAND,
app_data=app_data
service=200, subservice=Subservices.TC_MODE_COMMAND, app_data=app_data
)
tc_queue.appendleft(cmd.pack_command_tuple())
if op_code in OpCodes.OFF:
app_data = pack_mode_data(object_id=object_id.as_bytes, mode=Modes.OFF, submode=0)
app_data = pack_mode_data(
object_id=object_id.as_bytes, mode=Modes.OFF, submode=0
)
cmd = PusTelecommand(
service=200,
subservice=Subservices.TC_MODE_COMMAND,
app_data=app_data
service=200, subservice=Subservices.TC_MODE_COMMAND, app_data=app_data
)
tc_queue.appendleft(cmd.pack_command_tuple())

View File

@ -116,7 +116,9 @@ def pack_service_queue_user(
object_id=object_id, tc_queue=service_queue, op_code=op_code
)
if service == CustomServiceList.RTD.value:
return pack_rtd_commands(object_id=None, tc_queue=service_queue, op_code=op_code)
return pack_rtd_commands(
object_id=None, tc_queue=service_queue, op_code=op_code
)
if service == CustomServiceList.PDU1.value:
object_id = obj_id_man.get(PDU_1_HANDLER_ID)
return pack_pdu1_commands(