add some more ACS devices
All checks were successful
EIVE/-/pipeline/pr-main This commit looks good

This commit is contained in:
Robin Müller 2023-11-29 17:27:24 +01:00
parent 1660e27ec1
commit 3da1c2c262
Signed by: muellerr
GPG Key ID: A649FB78196E3849
5 changed files with 128 additions and 45 deletions

View File

@ -9,9 +9,16 @@ from tmtccmd.util import ObjectIdDictT, RetvalDictT
from eive_tmtc.config.definitions import SPACE_PACKET_IDS from eive_tmtc.config.definitions import SPACE_PACKET_IDS
from eive_tmtc.config.retvals import get_retval_dict from eive_tmtc.config.retvals import get_retval_dict
from eive_tmtc.tmtc.acs.acs_board import create_acs_board_node
from eive_tmtc.tmtc.acs.acs_ctrl import create_acs_ctrl_node from eive_tmtc.tmtc.acs.acs_ctrl import create_acs_ctrl_node
from eive_tmtc.tmtc.acs.gps import create_gnss_node from eive_tmtc.tmtc.acs.gps import create_gnss_node
from eive_tmtc.tmtc.acs.gyros import create_gyros_node
from eive_tmtc.tmtc.acs.imtq import create_mgt_node from eive_tmtc.tmtc.acs.imtq import create_mgt_node
from eive_tmtc.tmtc.acs.mgms import create_mgms_node
from eive_tmtc.tmtc.acs.reaction_wheels import (
create_reaction_wheel_assembly_node,
create_reaction_wheels_nodes,
)
from eive_tmtc.tmtc.acs.star_tracker import create_str_node from eive_tmtc.tmtc.acs.star_tracker import create_str_node
from eive_tmtc.tmtc.acs.subsystem import create_acs_subsystem_node from eive_tmtc.tmtc.acs.subsystem import create_acs_subsystem_node
from eive_tmtc.tmtc.com.ccsds_handler import create_ccsds_node from eive_tmtc.tmtc.com.ccsds_handler import create_ccsds_node
@ -24,12 +31,12 @@ from eive_tmtc.tmtc.payload.ploc_supervisor import create_ploc_supv_node
from eive_tmtc.tmtc.payload.plpcdu import create_pl_pcdu_node from eive_tmtc.tmtc.payload.plpcdu import create_pl_pcdu_node
from eive_tmtc.tmtc.payload.scex import create_scex_node from eive_tmtc.tmtc.payload.scex import create_scex_node
from eive_tmtc.tmtc.payload.subsystem import create_payload_subsystem_node from eive_tmtc.tmtc.payload.subsystem import create_payload_subsystem_node
from eive_tmtc.tmtc.power.p60dock import create_p60_dock_node
from eive_tmtc.tmtc.power.power import create_power_node
from eive_tmtc.tmtc.power.acu import create_acu_node from eive_tmtc.tmtc.power.acu import create_acu_node
from eive_tmtc.tmtc.power.bpx_batt import create_bpx_batt_node
from eive_tmtc.tmtc.power.p60dock import create_p60_dock_node
from eive_tmtc.tmtc.power.pdu1 import create_pdu1_node from eive_tmtc.tmtc.power.pdu1 import create_pdu1_node
from eive_tmtc.tmtc.power.pdu2 import create_pdu2_node from eive_tmtc.tmtc.power.pdu2 import create_pdu2_node
from eive_tmtc.tmtc.power.bpx_batt import create_bpx_batt_node from eive_tmtc.tmtc.power.power import create_power_node
from eive_tmtc.tmtc.power.pwr_ctrl import create_pwr_ctrl_node from eive_tmtc.tmtc.power.pwr_ctrl import create_pwr_ctrl_node
from eive_tmtc.tmtc.power.subsystem import create_eps_subsystem_node from eive_tmtc.tmtc.power.subsystem import create_eps_subsystem_node
from eive_tmtc.tmtc.system import create_system_node from eive_tmtc.tmtc.system import create_system_node
@ -49,40 +56,16 @@ class EiveHookObject(HookBase):
def get_command_definitions(self) -> CmdTreeNode: def get_command_definitions(self) -> CmdTreeNode:
root_node = CmdTreeNode.root_node() root_node = CmdTreeNode.root_node()
mode_node = CmdTreeNode("mode", "Mode Commands")
hk_node = CmdTreeNode("hk", "HK Commands")
action_node = CmdTreeNode("action", "Action Commands")
param_node = CmdTreeNode("params", "Parameter Commands")
health_node = CmdTreeNode("health", "Health Commands")
dev_node = CmdTreeNode("dev", "Device Commands")
dev_node.add_child(hk_node)
dev_node.add_child(mode_node)
dev_node.add_child(health_node)
dev_node.add_child(param_node)
# Not strictly necessary, but I do not know a single device which does not have actions..
dev_node.add_child(action_node)
assy_node = CmdTreeNode("assy", "Assembly Commands")
assy_node.add_child(mode_node)
acs_node = create_acs_subsystem_node() acs_node = create_acs_subsystem_node()
acs_brd_assy_node = CmdTreeNode("acs_brd_assy", "ACS Board Assembly") acs_brd_assy_node = create_acs_board_node()
acs_brd_assy_node.add_child(mode_node) acs_brd_assy_node.add_child(create_mgms_node())
mgm_devs = CmdTreeNode("mgm_devs", "MGM Devices") acs_brd_assy_node.add_child(create_gyros_node())
gyro_devs = CmdTreeNode("gyro_devs", "Gyro Devices")
acs_brd_assy_node.add_child(mgm_devs)
acs_brd_assy_node.add_child(gyro_devs)
acs_ctrl = create_acs_ctrl_node() acs_ctrl = create_acs_ctrl_node()
rw_list = create_reaction_wheels_nodes()
rws = CmdTreeNode("rws", "Reaction Wheel Devices") rws = CmdTreeNode("rws", "Reaction Wheel Devices")
rw_assy = CmdTreeNode("rw_assy", "Reaction Wheel Assembly") for rw in rw_list:
rw_1 = CmdTreeNode("rw_1", "Reaction Wheel 1") rws.add_child(rw)
rw_2 = CmdTreeNode("rw_2", "Reaction Wheel 2") rws.add_child(create_reaction_wheel_assembly_node())
rw_3 = CmdTreeNode("rw_3", "Reaction Wheel 3")
rw_4 = CmdTreeNode("rw_4", "Reaction Wheel 4")
rws.add_child(rw_assy)
rws.add_child(rw_1)
rws.add_child(rw_2)
rws.add_child(rw_3)
rws.add_child(rw_4)
star_tracker = create_str_node() star_tracker = create_str_node()
star_tracker_img_helper = CmdTreeNode( star_tracker_img_helper = CmdTreeNode(
"str_img_helper", "Star Tracker Image Helper" "str_img_helper", "Star Tracker Image Helper"
@ -92,7 +75,6 @@ class EiveHookObject(HookBase):
acs_node.add_child(acs_brd_assy_node) acs_node.add_child(acs_brd_assy_node)
acs_node.add_child(acs_ctrl) acs_node.add_child(acs_ctrl)
acs_node.add_child(mode_node)
acs_node.add_child(rws) acs_node.add_child(rws)
acs_node.add_child(create_mgt_node()) acs_node.add_child(create_mgt_node())
acs_node.add_child(star_tracker) acs_node.add_child(star_tracker)

View File

@ -1,6 +1,7 @@
import enum import enum
from tmtccmd.config.tmtc import ( from tmtccmd.config.tmtc import (
CmdTreeNode,
OpCodeEntry, OpCodeEntry,
TmtcDefinitionWrapper, TmtcDefinitionWrapper,
tmtc_definitions_provider, tmtc_definitions_provider,
@ -88,6 +89,53 @@ def pack_acs_command(q: DefaultPusQueueHelper, cmd_str: str):
) )
def create_acs_board_node() -> CmdTreeNode:
node = CmdTreeNode("acs_brd", "ACS Board", hide_children_which_are_leaves=True)
node.add_child(
CmdTreeNode(
AcsOpCodes.ACS_ASS_A_SIDE[0],
"Switch to ACS board A side",
)
)
node.add_child(
CmdTreeNode(
AcsOpCodes.ACS_ASS_B_SIDE[0],
"Switch to ACS board B side",
)
)
node.add_child(
CmdTreeNode(
AcsOpCodes.ACS_ASS_DUAL_MODE[0],
"Switch to ACS board dual mode",
)
)
node.add_child(
CmdTreeNode(
AcsOpCodes.ACS_ASS_A_ON[0],
"Switch ACS board A side on",
)
)
node.add_child(
CmdTreeNode(
AcsOpCodes.ACS_ASS_B_ON[0],
"Switch ACS board B side on",
)
)
node.add_child(
CmdTreeNode(
AcsOpCodes.ACS_ASS_DUAL_ON[0],
"Switch ACS board dual mode on",
)
)
node.add_child(
CmdTreeNode(
AcsOpCodes.ACS_ASS_OFF[0],
"Switch off ACS board",
)
)
return node
@tmtc_definitions_provider @tmtc_definitions_provider
def add_acs_board_cmds(defs: TmtcDefinitionWrapper): def add_acs_board_cmds(defs: TmtcDefinitionWrapper):
oce = OpCodeEntry() oce = OpCodeEntry()

View File

@ -3,6 +3,7 @@ import logging
import struct import struct
from spacepackets.ecss import PusTelecommand from spacepackets.ecss import PusTelecommand
from tmtccmd.config import CmdTreeNode
from tmtccmd.tmtc import DefaultPusQueueHelper from tmtccmd.tmtc import DefaultPusQueueHelper
from tmtccmd.pus.s201_fsfw_health import pack_set_health_cmd_data, FsfwHealth from tmtccmd.pus.s201_fsfw_health import pack_set_health_cmd_data, FsfwHealth
from tmtccmd.pus.s201_fsfw_health import Subservice from tmtccmd.pus.s201_fsfw_health import Subservice
@ -177,6 +178,16 @@ def handle_l3g_gyro_hk(
pw.dlog(f"Temperature {temp} °C") pw.dlog(f"Temperature {temp} °C")
def create_gyros_node() -> CmdTreeNode:
node = CmdTreeNode("gyros", "Gyroscope devices")
node.add_child(CmdTreeNode(OpCode.CORE_HK, "Request Core HK"))
node.add_child(CmdTreeNode(OpCode.CFG_HK, "Request CFG HK"))
node.add_child(CmdTreeNode(OpCode.NML, "Normal Mode"))
node.add_child(CmdTreeNode(OpCode.OFF, "Off Mode"))
node.add_child(CmdTreeNode(OpCode.SET_FAULTY, "Set Faulty"))
return node
@tmtc_definitions_provider @tmtc_definitions_provider
def add_gyr_cmd_defs(defs: TmtcDefinitionWrapper): def add_gyr_cmd_defs(defs: TmtcDefinitionWrapper):
oce = OpCodeEntry() oce = OpCodeEntry()

View File

@ -2,7 +2,7 @@ import enum
import struct import struct
from eive_tmtc.config.definitions import CustomServiceList from eive_tmtc.config.definitions import CustomServiceList
from tmtccmd.config import OpCodeEntry from tmtccmd.config import CmdTreeNode, OpCodeEntry
import eive_tmtc.config.object_ids as obj_ids import eive_tmtc.config.object_ids as obj_ids
from eive_tmtc.config.object_ids import ( from eive_tmtc.config.object_ids import (
@ -107,6 +107,13 @@ def handle_mgm_rm3100_hk_data(
) )
def create_mgms_node() -> CmdTreeNode:
node = CmdTreeNode("mgms", "Magnetometer devices")
node.add_child(CmdTreeNode(OpCode.NORMAL, "Normal Mode"))
node.add_child(CmdTreeNode(OpCode.OFF, "Off Mode"))
return node
@tmtc_definitions_provider @tmtc_definitions_provider
def add_mgm_cmd_defs(defs: TmtcDefinitionWrapper): def add_mgm_cmd_defs(defs: TmtcDefinitionWrapper):
oce = OpCodeEntry() oce = OpCodeEntry()

View File

@ -10,7 +10,7 @@ from typing import List
from eive_tmtc.pus_tm.defs import PrintWrapper from eive_tmtc.pus_tm.defs import PrintWrapper
from eive_tmtc.config.object_ids import RW1_ID, RW2_ID, RW3_ID, RW4_ID from eive_tmtc.config.object_ids import RW1_ID, RW2_ID, RW3_ID, RW4_ID
from tmtccmd.config import TmtcDefinitionWrapper, OpCodeEntry from tmtccmd.config import CmdTreeNode, TmtcDefinitionWrapper, OpCodeEntry
from tmtccmd.config.tmtc import tmtc_definitions_provider from tmtccmd.config.tmtc import tmtc_definitions_provider
from tmtccmd.tmtc import DefaultPusQueueHelper from tmtccmd.tmtc import DefaultPusQueueHelper
from tmtccmd.pus.tc.s3_fsfw_hk import ( from tmtccmd.pus.tc.s3_fsfw_hk import (
@ -53,11 +53,11 @@ class InfoDev:
class OpCodesAss: class OpCodesAss:
ON = ["0", "on"] ON = "on"
NML = ["1", "nml"] NML = "nml"
OFF = ["2", "off"] OFF = "off"
ALL_SPEED_UP = ["3", "speed_up"] ALL_SPEED_UP = "speed_up"
ALL_SPEED_OFF = ["4", "speed_off"] ALL_SPEED_OFF = "speed_off"
class ActionId: class ActionId:
@ -99,6 +99,41 @@ class RampTime:
MS_1000 = 1000 MS_1000 = 1000
def create_reaction_wheels_nodes() -> List[CmdTreeNode]:
nodes = []
for i in range(4):
next_node = CmdTreeNode(
f"rw_{i}", f"Reaction Wheel {i}", hide_children_which_are_leaves=True
)
next_node.add_child(CmdTreeNode(InfoDev.SPEED, OpCodesDev.SPEED))
next_node.add_child(CmdTreeNode(InfoDev.ON, OpCodesDev.ON))
next_node.add_child(CmdTreeNode(InfoDev.OFF, OpCodesDev.OFF))
next_node.add_child(CmdTreeNode(InfoDev.NML, OpCodesDev.NML))
next_node.add_child(CmdTreeNode(InfoDev.REQ_TM, OpCodesDev.REQ_TM))
next_node.add_child(CmdTreeNode(InfoDev.GET_STATUS, OpCodesDev.GET_STATUS))
next_node.add_child(CmdTreeNode(InfoDev.GET_TM, OpCodesDev.GET_TM))
next_node.add_child(
CmdTreeNode(InfoDev.ENABLE_STATUS_HK, OpCodesDev.ENABLE_STATUS_HK)
)
next_node.add_child(
CmdTreeNode(InfoDev.DISABLE_STATUS_HK, OpCodesDev.DISABLE_STATUS_HK)
)
nodes.append(next_node)
return nodes
def create_reaction_wheel_assembly_node() -> CmdTreeNode:
node = CmdTreeNode(
"rw_assy", "Reaction Wheels Assembly", hide_children_which_are_leaves=True
)
node.add_child(CmdTreeNode(InfoAss.ON, OpCodesAss.ON))
node.add_child(CmdTreeNode(InfoAss.NML, OpCodesAss.NML))
node.add_child(CmdTreeNode(InfoAss.OFF, OpCodesAss.OFF))
node.add_child(CmdTreeNode(InfoAss.ALL_SPEED_UP, OpCodesAss.ALL_SPEED_UP))
node.add_child(CmdTreeNode(InfoAss.ALL_SPEED_OFF, OpCodesAss.ALL_SPEED_OFF))
return node
@tmtc_definitions_provider @tmtc_definitions_provider
def add_rw_cmds(defs: TmtcDefinitionWrapper): def add_rw_cmds(defs: TmtcDefinitionWrapper):
oce = OpCodeEntry() oce = OpCodeEntry()
@ -182,14 +217,14 @@ def create_single_rw_cmd( # noqa C901: Complexity is okay here.
q.add_pus_tc( q.add_pus_tc(
create_action_cmd(object_id=object_id, action_id=ActionId.REQUEST_TM) create_action_cmd(object_id=object_id, action_id=ActionId.REQUEST_TM)
) )
if cmd_str in OpCodesDev.GET_STATUS: if cmd_str == OpCodesDev.GET_STATUS:
q.add_log_cmd(f"RW {rw_idx}: {InfoDev.GET_STATUS}") q.add_log_cmd(f"RW {rw_idx}: {InfoDev.GET_STATUS}")
q.add_pus_tc( q.add_pus_tc(
generate_one_diag_command( generate_one_diag_command(
sid=make_sid(object_id=object_id, set_id=RwSetId.STATUS_SET_ID) sid=make_sid(object_id=object_id, set_id=RwSetId.STATUS_SET_ID)
) )
) )
if cmd_str in OpCodesDev.ENABLE_STATUS_HK: if cmd_str == OpCodesDev.ENABLE_STATUS_HK:
q.add_log_cmd(f"RW {rw_idx}: {InfoDev.ENABLE_STATUS_HK}") q.add_log_cmd(f"RW {rw_idx}: {InfoDev.ENABLE_STATUS_HK}")
interval = float(input("Please enter HK interval in floating point seconds: ")) interval = float(input("Please enter HK interval in floating point seconds: "))
cmds = enable_periodic_hk_command_with_interval( cmds = enable_periodic_hk_command_with_interval(
@ -197,7 +232,7 @@ def create_single_rw_cmd( # noqa C901: Complexity is okay here.
) )
for cmd in cmds: for cmd in cmds:
q.add_pus_tc(cmd) q.add_pus_tc(cmd)
if cmd_str in OpCodesDev.DISABLE_STATUS_HK: if cmd_str == OpCodesDev.DISABLE_STATUS_HK:
q.add_log_cmd(f"RW {rw_idx}: {InfoDev.DISABLE_STATUS_HK}") q.add_log_cmd(f"RW {rw_idx}: {InfoDev.DISABLE_STATUS_HK}")
q.add_pus_tc( q.add_pus_tc(
disable_periodic_hk_command( disable_periodic_hk_command(