some more cleaning and set ID updates
This commit is contained in:
parent
195d5343bc
commit
9171f23d93
@ -31,17 +31,6 @@ class GomspaceDeviceActionIds(enum.IntEnum):
|
||||
PRINT_LATCHUPS = 33
|
||||
|
||||
|
||||
class SetIds:
|
||||
PDU_1_CORE = 1
|
||||
PDU_1_AUX = 2
|
||||
PDU_2_CORE = 3
|
||||
PDU_2_AUX = 4
|
||||
P60_CORE = 5
|
||||
P60_AUX = 6
|
||||
ACU_CORE = 7
|
||||
ACU_AUX = 8
|
||||
|
||||
|
||||
class ParamTypes(enum.Enum):
|
||||
U8 = 0
|
||||
U16 = 1
|
||||
|
@ -22,15 +22,13 @@ import config.object_ids as oids
|
||||
from pus_tc.system.tcs import OpCodes as TcsOpCodes
|
||||
from pus_tc.devs.bpx_batt import BpxSetIds
|
||||
from pus_tc.system.core import SetIds as CoreSetIds
|
||||
from gomspace.gomspace_common import SetIds as GsSetIds
|
||||
from tmtc.power.common_power import SetIds as GsSetIds
|
||||
from pus_tc.devs.rad_sensor import SetIds as RadSetIds
|
||||
from pus_tc.devs.mgms import MgmLis3SetIds as MgmLis3SetIds_0_2
|
||||
from pus_tc.devs.mgms import MgmRm3100SetIds as MgmRm3100SetIds_1_3
|
||||
from pus_tc.devs.gyros import AdisGyroSetIds as AdisGyroSetIds_0_2
|
||||
from pus_tc.devs.gyros import L3gGyroSetIds as L3gGyroSetIds_1_3
|
||||
from pus_tc.devs.syrlinks_hk_handler import OpCodes as SyrlinksOpCodes
|
||||
from pus_tc.devs.syrlinks_hk_handler import SetIds as SyrlinksSetIds
|
||||
from pus_tc.devs.star_tracker import OpCodes as StrOpCodes
|
||||
from pus_tc.devs.gps import SetIds as GpsSetIds
|
||||
from pus_tc.devs.imtq import ImtqSetIds
|
||||
from pus_tc.devs.sus import SetIds
|
||||
@ -247,14 +245,14 @@ def pack_proc_commands(q: DefaultPusQueueHelper, op_code: str):
|
||||
if op_code in OpCodes.PCDU_FT:
|
||||
key = KAI.PCDU_FT[0]
|
||||
pcdu_pairs = [
|
||||
(oids.P60_DOCK_HANDLER, GsSetIds.P60_CORE),
|
||||
(oids.PDU_1_HANDLER_ID, GsSetIds.PDU_1_CORE),
|
||||
(oids.PDU_2_HANDLER_ID, GsSetIds.PDU_2_CORE),
|
||||
(oids.ACU_HANDLER_ID, GsSetIds.ACU_CORE),
|
||||
(oids.P60_DOCK_HANDLER, GsSetIds.P60_AUX),
|
||||
(oids.PDU_1_HANDLER_ID, GsSetIds.PDU_1_AUX),
|
||||
(oids.PDU_2_HANDLER_ID, GsSetIds.PDU_2_AUX),
|
||||
(oids.ACU_HANDLER_ID, GsSetIds.ACU_AUX),
|
||||
(oids.P60_DOCK_HANDLER, GsSetIds.CORE),
|
||||
(oids.PDU_1_HANDLER_ID, GsSetIds.CORE),
|
||||
(oids.PDU_2_HANDLER_ID, GsSetIds.CORE),
|
||||
(oids.ACU_HANDLER_ID, GsSetIds.CORE),
|
||||
(oids.P60_DOCK_HANDLER, GsSetIds.AUX),
|
||||
(oids.PDU_1_HANDLER_ID, GsSetIds.AUX),
|
||||
(oids.PDU_2_HANDLER_ID, GsSetIds.AUX),
|
||||
(oids.ACU_HANDLER_ID, GsSetIds.AUX),
|
||||
]
|
||||
|
||||
diag_list = [
|
||||
@ -587,10 +585,10 @@ def pack_proc_commands(q: DefaultPusQueueHelper, op_code: str):
|
||||
]
|
||||
# HK listening
|
||||
pack_generic_hk_listening_cmds(
|
||||
tc_queue=tc_queue,
|
||||
q=q,
|
||||
proc_key=key,
|
||||
sid_list=sid_list,
|
||||
diag=False,
|
||||
diag_list=[False],
|
||||
cfg=GenericHkListeningCfg.default(),
|
||||
)
|
||||
if op_code in OpCodes.STR_FT:
|
||||
@ -726,7 +724,7 @@ def enable_listen_to_hk_for_x_seconds(
|
||||
):
|
||||
q.add_log_cmd(f"Enabling periodic HK for {device}")
|
||||
cmd_tuple = enable_periodic_hk_command_with_interval(
|
||||
diag=diag, sid=sid, interval_seconds=interval_seconds, ssc=0
|
||||
diag=diag, sid=sid, interval_seconds=interval_seconds
|
||||
)
|
||||
for cmd in cmd_tuple:
|
||||
q.add_pus_tc(cmd)
|
||||
|
@ -10,6 +10,7 @@ from tmtc.power.common_power import (
|
||||
add_gomspace_cmd_defs,
|
||||
req_hk_cmds,
|
||||
pack_common_power_cmds,
|
||||
SetIds,
|
||||
)
|
||||
from tmtccmd.config import TmtcDefinitionWrapper, OpCodeEntry
|
||||
from tmtccmd.config.tmtc import tmtc_definitions_provider
|
||||
@ -67,9 +68,7 @@ def pack_acu_commands(object_id: ObjectIdU32, q: DefaultPusQueueHelper, op_code:
|
||||
|
||||
|
||||
def acu_req_hk_cmds(q: DefaultPusQueueHelper, op_code: str):
|
||||
req_hk_cmds(
|
||||
"ACU", q, op_code, ACU_HANDLER_ID, [gs.SetIds.ACU_CORE, gs.SetIds.ACU_AUX]
|
||||
)
|
||||
req_hk_cmds("ACU", q, op_code, ACU_HANDLER_ID, [SetIds.CORE, SetIds.AUX])
|
||||
|
||||
|
||||
class ACUTestProcedure:
|
||||
|
@ -16,6 +16,8 @@ from tmtccmd.tc.pus_3_fsfw_hk import (
|
||||
make_sid,
|
||||
generate_one_diag_command,
|
||||
generate_one_hk_command,
|
||||
enable_periodic_hk_command_with_interval,
|
||||
disable_periodic_hk_command,
|
||||
)
|
||||
from tmtccmd.tc.pus_8_funccmd import make_fsfw_action_cmd
|
||||
from tmtccmd.util import ObjectIdU32, ObjectIdBase
|
||||
@ -104,12 +106,27 @@ class PowerOpCodes:
|
||||
PRINT_LATCHUPS = ["print_latchups"]
|
||||
|
||||
|
||||
class SetIds:
|
||||
CORE = 1
|
||||
AUX = 2
|
||||
CONFIG = 3
|
||||
|
||||
|
||||
def pack_common_power_cmds(
|
||||
prefix: str, object_id: ObjectIdU32, q: DefaultPusQueueHelper, op_code: str
|
||||
):
|
||||
objb = object_id.as_bytes
|
||||
if op_code in PowerOpCodes.ENABLE_INFO_HK:
|
||||
pass
|
||||
interval = float(input("Specify HK interval in floating point seconds: "))
|
||||
q.add_log_cmd(f"{prefix}: {PowerInfo.ENABLE_INFO_HK} with interval {interval}")
|
||||
cmds = enable_periodic_hk_command_with_interval(
|
||||
True, make_sid(objb, SetIds.CORE), interval
|
||||
)
|
||||
for cmd in cmds:
|
||||
q.add_pus_tc(cmd)
|
||||
if op_code in PowerOpCodes.DISABLE_INFO_HK:
|
||||
q.add_log_cmd(f"{prefix}: {PowerInfo.DISABLE_INFO_HK}")
|
||||
q.add_pus_tc(disable_periodic_hk_command(True, make_sid(objb, SetIds.CORE)))
|
||||
|
||||
|
||||
def pack_common_gomspace_cmds(
|
||||
|
@ -66,7 +66,7 @@ class PDU1TestProcedure:
|
||||
def pack_pdu1_commands(object_id: ObjectIdU32, q: DefaultPusQueueHelper, op_code: str):
|
||||
q.add_log_cmd("Commanding PDU1")
|
||||
objb = object_id.as_bytes
|
||||
pdu1_cmds(q, op_code)
|
||||
pdu1_switch_cmds(q, op_code)
|
||||
pdu1_req_hk_cmds(q, op_code)
|
||||
pack_common_power_cmds("PDU1", object_id, q, op_code)
|
||||
pack_common_gomspace_cmds("PDU1", object_id, q, op_code)
|
||||
@ -100,7 +100,7 @@ def info_off_pdu1(base: str) -> str:
|
||||
return "PDU1: " + base + " off"
|
||||
|
||||
|
||||
def pdu1_cmds(q: DefaultPusQueueHelper, op_code: str):
|
||||
def pdu1_switch_cmds(q: DefaultPusQueueHelper, op_code: str):
|
||||
if op_code in PowerOpCodes.TCS_ON:
|
||||
tcs_on_cmd(q)
|
||||
elif op_code in PowerOpCodes.TCS_OFF:
|
||||
|
@ -14,7 +14,7 @@ from config.object_ids import (
|
||||
)
|
||||
from tmtc.power.pdu1 import (
|
||||
pdu1_req_hk_cmds,
|
||||
pdu1_cmds,
|
||||
pdu1_switch_cmds,
|
||||
add_pdu1_common_defs,
|
||||
add_pdu1_cmds,
|
||||
)
|
||||
@ -37,7 +37,7 @@ LOGGER = get_console_logger()
|
||||
|
||||
|
||||
def pack_power_commands(q: DefaultPusQueueHelper, op_code: str):
|
||||
pdu1_cmds(q, op_code)
|
||||
pdu1_switch_cmds(q, op_code)
|
||||
pdu2_cmds(q, op_code)
|
||||
if op_code in PowerOpCodes.INFO_CORE:
|
||||
pdu1_req_hk_cmds(q, PowerOpCodes.REQUEST_CORE_HK_ONCE[0])
|
||||
|
@ -1,10 +1,11 @@
|
||||
import struct
|
||||
from typing import List, Tuple
|
||||
|
||||
from tmtc.power.common_power import SetIds
|
||||
from tmtccmd.util import ObjectIdBase
|
||||
from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
|
||||
from pus_tm.defs import PrintWrapper
|
||||
from gomspace.gomspace_common import SetIds, GomspaceDeviceActionIds
|
||||
from gomspace.gomspace_common import GomspaceDeviceActionIds
|
||||
from config.object_ids import (
|
||||
PDU_1_HANDLER_ID,
|
||||
PDU_2_HANDLER_ID,
|
||||
|
Loading…
Reference in New Issue
Block a user