Compare commits

...

23 Commits

Author SHA1 Message Date
d652c4663b and a new patch release 2023-01-12 17:12:16 +01:00
677a0d70cc well this is annoying 2023-01-12 17:11:16 +01:00
0390995773 small changelog bump 2023-01-12 16:21:47 +01:00
bb66d15d1f bump changelog 2023-01-12 16:19:14 +01:00
1be338b272 bump eive-tmtc to v2.1.0 2023-01-12 16:17:14 +01:00
5f3180dbc8 bump tmtccmd 2023-01-12 15:48:49 +01:00
b018784a11 use v4.0.0 alpha release 2023-01-12 14:19:08 +01:00
7c5f21e83c that should be all required API 2023-01-12 14:18:18 +01:00
9d42005816 Merge branch 'main' of https://egit.irs.uni-stuttgart.de/eive/eive-tmtc 2023-01-12 14:11:59 +01:00
ecae444ee3 some refactoring for PCDU cmds 2023-01-12 14:11:30 +01:00
a994e87f8a update changelog 2023-01-12 08:57:27 +01:00
87607aa681 small refactoring 2023-01-11 14:28:45 +01:00
7d2c639f01 small refactoring 2023-01-11 14:23:03 +01:00
d48e86f5fe unify core module 2023-01-11 14:19:47 +01:00
efa778c0e8 Merge branch 'main' of https://egit.irs.uni-stuttgart.de/eive/eive-tmtc 2023-01-11 14:17:02 +01:00
1de02aab77 move core module 2023-01-11 14:16:52 +01:00
b032defa7c bump changelog 2023-01-10 15:39:55 +01:00
ef6a1bb263 make it easier to add seq files 2023-01-10 15:37:15 +01:00
40831064d6 update seq file dict 2023-01-10 15:27:45 +01:00
dcd881bc14 bump changelog 2023-01-10 14:03:32 +01:00
ee2c4bb4c3 add reboot cmds for PCDU modules 2023-01-10 14:03:10 +01:00
c4dbf3d8be improve syrlinks commanding a bit 2023-01-10 10:27:00 +01:00
a7326b95c4 improve ploc mpsoc commanding 2023-01-10 09:56:18 +01:00
17 changed files with 341 additions and 137 deletions

View File

@@ -8,9 +8,18 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/).
The [milestone](https://egit.irs.uni-stuttgart.de/eive/eive-obsw/milestones)
list yields a list of all related PRs for each release.
# [unreleased]
# [v2.1.1] 12.01.2023
- Handle ACS CTRL HK sets
- Typo in `setup.cfg`, missing version prefix `v` for `tmtccmd`
# [v2.1.0] 12.01.2023
- Various refactoring and tweaks to allow easier integration into `eive-mib`.
- Handle ACS CTRL HK sets.
- Add reboot commands for PCDU modules.
- Extend MPSoC commands.
- Starting from now, more regular releases, especially on breaking changes. This is because
this is now also a library with dependents.
# [v2.0.2] 01.12.2022

View File

@@ -2,10 +2,10 @@ from pathlib import Path
SW_NAME = "eive-tmtc"
VERSION_MAJOR = 2
VERSION_MINOR = 0
VERSION_REVISION = 2
VERSION_MINOR = 1
VERSION_REVISION = 1
__version__ = "2.0.2"
__version__ = "2.1.1"
EIVE_TMTC_ROOT = Path(__file__).parent
PACKAGE_ROOT = EIVE_TMTC_ROOT.parent

View File

@@ -29,8 +29,21 @@ class OpCodes:
OFF = "off"
ON = "on"
NORMAL = "nml"
STANDBY = "standby"
STANDBY = "set_tx_standby"
SET_CW = "set_tx_carrier_wave"
MODULATION = "modulation"
HK_RX_REGS = "hk_rx_regs"
HK_TX_REGS = "hk_tx_regs"
TX_STATUS = "tx_status"
RX_STATUS = "rx_status"
class Info:
HK_RX_REGS = "Request RX register set"
HK_TX_REGS = "Request TX register set"
TX_STATUS = "Read TX status (always read in normal mode)"
RX_STATUS = "Read RX status (always read in normal mode)"
SET_CW = "Set TX carrier wave"
class CommandIds:
@@ -59,13 +72,15 @@ def add_syrlinks_cmds(defs: TmtcDefinitionWrapper):
oce.add(OpCodes.NORMAL, "Syrlinks Handler: Set mode normal")
oce.add(OpCodes.STANDBY, "Syrlinks Handler: Set TX standby")
oce.add(OpCodes.MODULATION, "Syrlinks Handler: Set TX modulation")
oce.add("5", "Syrlinks Handler: Set TX carrier wave")
oce.add("6", "Syrlinks Handler: Read TX status")
oce.add(OpCodes.HK_RX_REGS, Info.HK_RX_REGS)
oce.add(OpCodes.HK_TX_REGS, Info.HK_TX_REGS)
oce.add(OpCodes.SET_CW, Info.SET_CW)
oce.add(OpCodes.TX_STATUS, Info.TX_STATUS)
oce.add(OpCodes.RX_STATUS, Info.RX_STATUS)
oce.add("7", "Syrlinks Handler: Read TX waveform")
oce.add("8", "Syrlinks Handler: Read TX AGC value high byte")
oce.add("9", "Syrlinks Handler: Read TX AGC value low byte")
oce.add("12", "Syrlinks Handler: Write LCL config")
oce.add("13", "Syrlinks Handler: Read RX status registers")
oce.add("14", "Syrlinks Handler: Read LCL config register")
oce.add("15", "Syrlinks Handler: Set waveform OQPSK")
oce.add("16", "Syrlinks Handler: Set waveform BPSK")
@@ -79,41 +94,42 @@ def pack_syrlinks_command(
object_id: ObjectIdU32, q: DefaultPusQueueHelper, op_code: str
):
obyt = object_id.as_bytes
prefix = "Syrlinks"
q.add_log_cmd(f"Testing Syrlinks with object id: {object_id.as_hex_string}")
if op_code == OpCodes.OFF:
q.add_log_cmd("Syrlinks: Set mode off")
q.add_log_cmd(f"{prefix}: Set mode off")
data = pack_mode_data(obyt, Modes.OFF, 0)
q.add_pus_tc(PusTelecommand(service=200, subservice=1, app_data=data))
if op_code == OpCodes.ON:
q.add_log_cmd("Syrlinks: Set mode on")
q.add_log_cmd(f"{prefix}: Set mode on")
data = pack_mode_data(obyt, Modes.ON, 0)
q.add_pus_tc(PusTelecommand(service=200, subservice=1, app_data=data))
if op_code == OpCodes.NORMAL:
q.add_log_cmd("Syrlinks: Mode Normal")
q.add_log_cmd(f"{prefix}: Mode Normal")
data = pack_mode_data(obyt, Modes.NORMAL, 0)
q.add_pus_tc(PusTelecommand(service=200, subservice=1, app_data=data))
if op_code == OpCodes.STANDBY:
q.add_log_cmd("syrlinks: Set TX mode standby")
q.add_log_cmd(f"{prefix}: Set TX mode standby")
data = obyt + struct.pack("!I", CommandIds.SET_TX_MODE_STANDBY)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data))
if op_code == OpCodes.MODULATION:
q.add_log_cmd("syrlinks: Set TX mode modulation")
q.add_log_cmd(f"{prefix}: Set TX mode modulation")
data = obyt + struct.pack("!I", CommandIds.SET_TX_MODE_MODULATION)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data))
if op_code == "5":
q.add_log_cmd("syrlinks: Set TX mode CW")
if op_code in OpCodes.SET_CW:
q.add_log_cmd(f"{prefix}: {Info.SET_CW}")
data = obyt + struct.pack("!I", CommandIds.SET_TX_MODE_CW)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data))
if op_code == "6":
q.add_log_cmd("Syrlinks: Get RX Registers")
if op_code in OpCodes.HK_RX_REGS:
q.add_log_cmd(f"{prefix}: {Info.HK_RX_REGS}")
sid = make_sid(obyt, SetIds.RX_REGISTERS_DATASET)
q.add_pus_tc(generate_one_hk_command(sid))
if op_code == "7":
q.add_log_cmd("Syrlinks: Get TX Registers")
if op_code in OpCodes.HK_TX_REGS:
q.add_log_cmd(f"{prefix}: {Info.HK_TX_REGS}")
sid = make_sid(obyt, SetIds.TX_REGISTERS_DATASET)
q.add_pus_tc(generate_one_hk_command(sid))
if op_code == "8":
q.add_log_cmd("Syrlinks: Read TX status")
if op_code in OpCodes.TX_STATUS:
q.add_log_cmd(f"{prefix}: {Info.TX_STATUS}")
command = obyt + struct.pack("!I", CommandIds.READ_TX_STATUS)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
if op_code == "9":

View File

@@ -37,7 +37,7 @@ from eive_tmtc.tmtc.acs.reaction_wheels import (
from eive_tmtc.pus_tc.devs.rad_sensor import pack_rad_sensor_test_into
from eive_tmtc.tmtc.payload.ploc_memory_dumper import pack_ploc_memory_dumper_cmd
from eive_tmtc.pus_tc.devs.ccsds_handler import pack_ccsds_handler_test
from eive_tmtc.pus_tc.system.core import pack_core_commands
from eive_tmtc.tmtc.core import pack_core_commands
from eive_tmtc.pus_tc.devs.star_tracker import pack_star_tracker_commands
from eive_tmtc.pus_tc.devs.syrlinks_hk_handler import pack_syrlinks_command
from eive_tmtc.pus_tc.devs.gps import pack_gps_command

View File

@@ -21,8 +21,8 @@ from tmtccmd.tc.pus_3_fsfw_hk import *
import eive_tmtc.config.object_ids as oids
from eive_tmtc.pus_tc.system.tcs import OpCodes as TcsOpCodes
from eive_tmtc.pus_tc.devs.bpx_batt import BpxSetIds
from eive_tmtc.pus_tc.system.core import SetIds as CoreSetIds
from eive_tmtc.tmtc.power.common_power import SetIds as GsSetIds
from eive_tmtc.tmtc.core import SetIds as CoreSetIds
from eive_tmtc.tmtc.power.common_power import SetId as GsSetIds
from eive_tmtc.pus_tc.devs.rad_sensor import SetIds as RadSetIds
from eive_tmtc.pus_tc.devs.mgms import MgmLis3SetIds as MgmLis3SetIds_0_2
from eive_tmtc.pus_tc.devs.mgms import MgmRm3100SetIds as MgmRm3100SetIds_1_3

View File

@@ -32,7 +32,7 @@ from eive_tmtc.tmtc.acs.imtq import (
handle_raw_mtm_measurement,
)
from eive_tmtc.pus_tm.defs import FsfwTmTcPrinter
from eive_tmtc.pus_tm.system.core import handle_core_hk_data
from eive_tmtc.tmtc.core import handle_core_hk_data
from eive_tmtc.pus_tm.devs.mgms import handle_mgm_hk_data
import eive_tmtc.config.object_ids as obj_ids

View File

@@ -1,21 +0,0 @@
import struct
from eive_tmtc.pus_tm.defs import PrintWrapper
from eive_tmtc.pus_tc.system.core import SetIds
from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
def handle_core_hk_data(printer: FsfwTmTcPrinter, set_id: int, hk_data: bytes):
if set_id == SetIds.HK:
pw = PrintWrapper(printer)
fmt_str = "!fff"
inc_len = struct.calcsize(fmt_str)
(temperature, ps_voltage, pl_voltage) = struct.unpack(
fmt_str, hk_data[0 : 0 + inc_len]
)
printout = (
f"Chip Temperature [°C] {temperature} | PS Voltage [mV] {ps_voltage} | "
f"PL Voltage [mV] {pl_voltage}"
)
pw.dlog(printout)
printer.print_validity_buffer(validity_buffer=hk_data[inc_len:], num_vars=3)

View File

@@ -1,4 +1,7 @@
import enum
import struct
from eive_tmtc.pus_tm.defs import PrintWrapper
from eive_tmtc.config.definitions import CustomServiceList
from spacepackets.ecss import PusTelecommand
@@ -10,7 +13,7 @@ from tmtccmd.logging import get_console_logger
from tmtccmd.tc.pus_3_fsfw_hk import make_sid, generate_one_hk_command
from tmtccmd.config.tmtc import OpCodeEntry, tmtc_definitions_provider
from eive_tmtc.config.object_ids import CORE_CONTROLLER_ID
from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
LOGGER = get_console_logger()
@@ -141,7 +144,7 @@ def add_core_controller_definitions(defs: TmtcDefinitionWrapper):
def pack_core_commands(q: DefaultPusQueueHelper, op_code: str):
if op_code in OpCodes.REBOOT_XSC:
reboot_self, chip_select, copy_select = determine_reboot_params()
perform_reboot_cmd(
add_xsc_reboot_cmd(
q=q,
reboot_self=reboot_self,
chip=chip_select,
@@ -149,30 +152,26 @@ def pack_core_commands(q: DefaultPusQueueHelper, op_code: str):
)
if op_code in OpCodes.REBOOT_FULL:
q.add_log_cmd(f"Core Command: {Info.REBOOT_FULL}")
q.add_pus_tc(
make_fsfw_action_cmd(
object_id=CORE_CONTROLLER_ID, action_id=ActionIds.FULL_REBOOT
)
)
q.add_pus_tc(create_full_reboot_cmds())
if op_code in OpCodes.XSC_REBOOT_SELF:
perform_reboot_cmd(q=q, reboot_self=True)
add_xsc_reboot_cmd(q=q, reboot_self=True)
if op_code in OpCodes.XSC_REBOOT_0_0:
perform_reboot_cmd(
add_xsc_reboot_cmd(
q=q, reboot_self=False, chip=Chip.CHIP_0, copy=Copy.COPY_0_NOM
)
if op_code in OpCodes.XSC_REBOOT_0_1:
perform_reboot_cmd(
add_xsc_reboot_cmd(
q=q,
reboot_self=False,
chip=Chip.CHIP_0,
copy=Copy.COPY_1_GOLD,
)
if op_code in OpCodes.XSC_REBOOT_1_0:
perform_reboot_cmd(
add_xsc_reboot_cmd(
q=q, reboot_self=False, chip=Chip.CHIP_1, copy=Copy.COPY_0_NOM
)
if op_code in OpCodes.XSC_REBOOT_1_1:
perform_reboot_cmd(
add_xsc_reboot_cmd(
q=q,
reboot_self=False,
chip=Chip.CHIP_1,
@@ -268,6 +267,12 @@ def reset_specific_boot_counter(q: DefaultPusQueueHelper, chip: int, copy: int):
)
def create_full_reboot_cmds() -> PusTelecommand:
return make_fsfw_action_cmd(
object_id=CORE_CONTROLLER_ID, action_id=ActionIds.FULL_REBOOT
)
def determine_reboot_params() -> (bool, Chip, Copy):
chip_select = -1
copy_select = -1
@@ -311,25 +316,47 @@ def pack_obsw_update_cmd(action_id: int) -> PusTelecommand:
)
def perform_reboot_cmd(
def add_xsc_reboot_cmd(
q: DefaultPusQueueHelper,
reboot_self: bool,
chip: Chip = Chip.NONE,
copy: Copy = Copy.NONE,
):
tc_data = bytearray()
if reboot_self:
q.add_log_cmd("Packing reboot command for current image")
else:
q.add_log_cmd(f"Packing reboot command for chip {chip} and copy {copy}")
q.add_pus_tc(create_xsc_reboot_cmds(reboot_self, chip, copy))
def create_xsc_reboot_cmds(
reboot_self: bool,
chip: Chip = Chip.NONE,
copy: Copy = Copy.NONE,
) -> PusTelecommand:
tc_data = bytearray()
if reboot_self:
tc_data.append(True)
else:
tc_data.append(False)
tc_data.append(chip)
tc_data.append(copy)
q.add_log_cmd(f"Packing reboot command for chip {chip} and copy {copy}")
q.add_pus_tc(
make_fsfw_action_cmd(
object_id=CORE_CONTROLLER_ID,
action_id=ActionIds.XSC_REBOOT,
user_data=tc_data,
)
return make_fsfw_action_cmd(
object_id=CORE_CONTROLLER_ID, action_id=ActionIds.XSC_REBOOT, user_data=tc_data
)
def handle_core_hk_data(printer: FsfwTmTcPrinter, set_id: int, hk_data: bytes):
if set_id == SetIds.HK:
pw = PrintWrapper(printer)
fmt_str = "!fff"
inc_len = struct.calcsize(fmt_str)
(temperature, ps_voltage, pl_voltage) = struct.unpack(
fmt_str, hk_data[0 : 0 + inc_len]
)
printout = (
f"Chip Temperature [°C] {temperature} | PS Voltage [mV] {ps_voltage} | "
f"PL Voltage [mV] {pl_voltage}"
)
pw.dlog(printout)
printer.print_validity_buffer(validity_buffer=hk_data[inc_len:], num_vars=3)

View File

@@ -23,6 +23,7 @@ from tmtccmd.tc.decorator import ServiceProviderParams
from eive_tmtc.utility.input_helper import InputHelper
from tmtccmd.tc.pus_200_fsfw_modes import pack_mode_data, Modes
LOGGER = get_console_logger()
MANUAL_INPUT = "1"
@@ -37,12 +38,15 @@ mpsoc_file_dict = {
"2": ["0:/flash", "0:/flash"],
}
sequence_file_dict = {
SEQ_FILE_NAMES = ["0:/EM16/231", "0:/EQ04/E-75", "0:/EQ01/E130"]
SEQ_FILE_DICT = {
MANUAL_INPUT: ["manual input", ""],
"2": ["0:/EM16/231", "0:/EM16/231"],
"3": ["0:/EQ04/E-75", "0:/EQ04/E-75"],
"2": [f"16QRM On Carrier 200 MBd ({SEQ_FILE_NAMES[0]})", f"{SEQ_FILE_NAMES[0]}"],
"3": [f"QPSK On Carrier 780 MBd ({SEQ_FILE_NAMES[1]})", f"{SEQ_FILE_NAMES[1]}"],
"4": [f"Maximum Bandwidth QPSK ({SEQ_FILE_NAMES[2]})", f"{SEQ_FILE_NAMES[2]}"],
}
CARRIAGE_RETURN = 0xD
@@ -70,6 +74,10 @@ class OpCodes:
NORMAL = ["normal"]
VERIFY_BOOT = ["verify_boot"]
MODE_REPLAY = ["mode_replay"]
MODE_IDLE = ["mode_idle"]
REPLAY_WRITE_SEQ = ["replay_write"]
DOWNLINK_PWR_ON = ["downlink_pwr_on"]
REPLAY_START = ["replay_start"]
class Info:
@@ -78,6 +86,10 @@ class Info:
NORMAL = "Normal"
VERIFY_BOOT = "Verify boot by reading 0xdeadbeef from DEADBEEF address"
MODE_REPLAY = "Switch to REPLAY mode"
MODE_IDLE = "Switch to IDLE mode"
REPLAY_WRITE_SEQ = "Replay write sequence"
DOWNLINK_PWR_ON = "Downlink Power On"
REPLAY_START = "Replay Start"
class MemAddresses(enum.IntEnum):
@@ -99,15 +111,15 @@ def add_ploc_mpsoc_cmds(defs: TmtcDefinitionWrapper):
oce.add("4", "Ploc MPSoC: Memory read")
oce.add("5", "Ploc MPSoC: Flash write")
oce.add("6", "Ploc MPSoC: Flash delete")
oce.add("7", "Ploc MPSoC: Replay start")
oce.add(OpCodes.REPLAY_START, Info.REPLAY_START)
oce.add("8", "Ploc MPSoC: Replay stop")
oce.add("9", "Ploc MPSoC: Downlink pwr on")
oce.add(OpCodes.DOWNLINK_PWR_ON, Info.DOWNLINK_PWR_ON)
oce.add("10", "Ploc MPSoC: Downlink pwr off")
oce.add("11", "Ploc MPSoC: Replay write sequence")
oce.add(OpCodes.REPLAY_WRITE_SEQ, Info.REPLAY_WRITE_SEQ)
oce.add("12", "Ploc MPSoC: OBSW reset sequence count")
oce.add(OpCodes.VERIFY_BOOT, "Ploc MPSoC: Read DEADBEEF address")
oce.add(OpCodes.MODE_REPLAY, Info.MODE_REPLAY)
oce.add("15", "Ploc MPSoC: Mode IDLE")
oce.add(OpCodes.MODE_IDLE, Info.MODE_IDLE)
oce.add("16", "Ploc MPSoC: Tc cam command send")
oce.add("17", "Ploc MPSoC: Set UART TX tristate")
oce.add("18", "Ploc MPSoC: Relesase UART TX")
@@ -118,22 +130,22 @@ def add_ploc_mpsoc_cmds(defs: TmtcDefinitionWrapper):
def pack_ploc_mpsoc_commands(p: ServiceProviderParams):
object_id = get_object_ids().get(PLOC_MPSOC_ID)
q = p.queue_helper
prefix = "PLOC SUPV:"
prefix = "PLOC MPSoC"
op_code = p.op_code
q.add_log_cmd(
f"Generate command for PLOC MPSoC with object id: {object_id.as_hex_string}"
)
obyt = object_id.as_bytes
if op_code in OpCodes.OFF:
q.add_log_cmd(f"{prefix} {Info.OFF}")
q.add_log_cmd(f"{prefix}: {Info.OFF}")
command = pack_mode_data(obyt, Modes.OFF, 0)
q.add_pus_tc(PusTelecommand(service=200, subservice=1, app_data=command))
if op_code in OpCodes.ON:
q.add_log_cmd(f"{prefix} {Info.ON}")
q.add_log_cmd(f"{prefix}: {Info.ON}")
data = pack_mode_data(obyt, Modes.ON, 0)
q.add_pus_tc(PusTelecommand(service=200, subservice=1, app_data=data))
if op_code in OpCodes.NORMAL:
q.add_log_cmd(f"{prefix} {Info.NORMAL}")
q.add_log_cmd(f"{prefix}: {Info.NORMAL}")
data = pack_mode_data(object_id.as_bytes, Modes.NORMAL, 0)
q.add_pus_tc(PusTelecommand(service=200, subservice=1, app_data=data))
if op_code == "3":
@@ -160,24 +172,24 @@ def pack_ploc_mpsoc_commands(p: ServiceProviderParams):
q.add_log_cmd("PLOC MPSoC: Flash delete")
data = prepare_flash_delete_cmd(object_id.as_bytes)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data))
if op_code == "7":
q.add_log_cmd("PLOC MPSoC: Replay start")
if op_code in OpCodes.REPLAY_START:
q.add_log_cmd(f"{prefix}: {Info.REPLAY_START}")
data = prepare_replay_start_cmd(object_id.as_bytes)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data))
if op_code == "8":
q.add_log_cmd("PLOC MPSoC: Replay stop")
data = object_id.as_bytes + struct.pack("!I", CommandIds.TC_REPLAY_STOP)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data))
if op_code == "9":
q.add_log_cmd("PLOC MPSoC: Downlink pwr on")
if op_code in OpCodes.DOWNLINK_PWR_ON:
q.add_log_cmd(f"{prefix}: {OpCodes.DOWNLINK_PWR_ON}")
data = prepare_downlink_pwr_on_cmd(object_id.as_bytes)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data))
if op_code == "10":
q.add_log_cmd("PLOC MPSoC: Downlink pwr off")
data = object_id.as_bytes + struct.pack("!I", CommandIds.TC_DOWNLINK_PWR_OFF)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data))
if op_code == "11":
q.add_log_cmd("PLOC MPSoC: Replay write sequence")
if op_code in OpCodes.REPLAY_WRITE_SEQ:
q.add_log_cmd(f"{prefix}: {Info.REPLAY_WRITE_SEQ}")
data = prepare_replay_write_sequence_cmd(object_id.as_bytes)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data))
if op_code == "12":
@@ -194,11 +206,11 @@ def pack_ploc_mpsoc_commands(p: ServiceProviderParams):
+ struct.pack("!H", num_words)
)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data))
if op_code == "14":
if op_code in OpCodes.MODE_REPLAY:
q.add_log_cmd("PLOC MPSoC: Tc mode replay")
data = object_id.as_bytes + struct.pack("!I", CommandIds.TC_MODE_REPLAY)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data))
if op_code == "15":
if op_code in OpCodes.MODE_IDLE:
q.add_log_cmd("PLOC MPSoC: Tc mode idle")
data = object_id.as_bytes + struct.pack("!I", CommandIds.TC_MODE_IDLE)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data))
@@ -335,10 +347,10 @@ def get_mpsoc_file() -> str:
def get_sequence_file() -> str:
LOGGER.info("Specify sequence file")
input_helper = InputHelper(sequence_file_dict)
input_helper = InputHelper(SEQ_FILE_DICT)
key = input_helper.get_key()
if key == MANUAL_INPUT:
file = input("Ploc MPSoC: Specify absolute name file: ")
else:
file = sequence_file_dict[key][1]
file = SEQ_FILE_DICT[key][1]
return file

View File

@@ -278,7 +278,13 @@ def pack_ploc_supv_commands(p: ServiceProviderParams):
if key not in FACTORY_RESET_OPS:
print("Key invalid!")
break
q.add_pus_tc(make_fsfw_action_cmd(object_id=PLOC_SUPV_ID, action_id=SupvActionIds.FACTORY_RESET, user_data=bytes([key])))
q.add_pus_tc(
make_fsfw_action_cmd(
object_id=PLOC_SUPV_ID,
action_id=SupvActionIds.FACTORY_RESET,
user_data=bytes([key]),
)
)
if op_code == "8":
q.add_log_cmd("PLOC Supervisor: Set max restart tries")
restart_tries = int(input("Specify maximum restart tries: "))

View File

@@ -12,7 +12,7 @@ from eive_tmtc.tmtc.power.common_power import (
add_gomspace_cmd_defs,
req_hk_cmds,
pack_common_power_cmds,
SetIds,
SetId,
OBC_ENDIANNESS,
unpack_array_in_data,
)
@@ -72,7 +72,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, [SetIds.CORE, SetIds.AUX])
req_hk_cmds("ACU", q, op_code, ACU_HANDLER_ID, [SetId.CORE, SetId.AUX])
class ACUTestProcedure:

View File

@@ -10,6 +10,7 @@ from eive_tmtc.gomspace.gomspace_common import (
pack_request_config_command,
pack_gnd_wdt_reset_command,
ParamTypes,
pack_reboot_command,
)
from eive_tmtc.gomspace.gomspace_pdu_definitions import OUT_ENABLE_LIST
from spacepackets.ecss import PusTelecommand
@@ -33,6 +34,7 @@ class GomspaceOpCodes:
RESET_GND_WATCHDOG = ["reset_gnd_wdt"]
SAVE_TABLE_DEFAULT = ["save_table_default"]
LOAD_TABLE = ["load_table"]
REBOOT = ["reboot"]
REQUEST_CONFIG_TABLE = ["cfg_table"]
@@ -44,6 +46,7 @@ class GsInfo:
SAVE_TABLE = "Save table non-volatile (file)"
SAVE_TABLE_DEFAULT = "Save table non-volatile (default)"
LOAD_TABLE = "Load Table"
REBOOT = "Reboot PCDU module"
class PowerInfo:
@@ -96,6 +99,7 @@ class PowerOpCodes:
PL_CAM_ON = ["cam_on"]
PL_CAM_OFF = ["cam_off"]
REBOOT = ["reboot"]
INFO_CORE = ["info"]
ENABLE_INFO_HK = ["info_hk_on"]
DISABLE_INFO_HK = ["info_hk_off"]
@@ -109,7 +113,7 @@ class PowerOpCodes:
PRINT_LATCHUPS = ["print_latchups"]
class SetIds:
class SetId:
CORE = 1
AUX = 2
CONFIG = 3
@@ -123,13 +127,13 @@ def pack_common_power_cmds(
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
True, make_sid(objb, SetId.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)))
q.add_pus_tc(disable_periodic_hk_command(True, make_sid(objb, SetId.CORE)))
def pack_common_gomspace_cmds(
@@ -143,6 +147,9 @@ def pack_common_gomspace_cmds(
object_id=objb, action_id=GomspaceDeviceActionIds.PRINT_SWITCH_V_I
)
)
if op_code in PowerOpCodes.REBOOT:
q.add_log_cmd(f"{prefix}: {GsInfo.REBOOT}")
q.add_pus_tc(pack_reboot_command(object_id))
if op_code in PowerOpCodes.PRINT_LATCHUPS:
q.add_log_cmd(f"{prefix}: {PowerInfo.PRINT_LATCHUPS}")
q.add_pus_tc(
@@ -266,12 +273,14 @@ def generic_on_cmd(
object_id: bytes, q: DefaultPusQueueHelper, info_str: str, out_idx: int
):
q.add_log_cmd(info_str + " on")
q.add_pus_tc(
pack_set_u8_param_command(
object_id,
OUT_ENABLE_LIST[out_idx].parameter_address,
Channel.on,
)
q.add_pus_tc(create_generic_on_cmd(object_id, out_idx))
def create_generic_on_cmd(object_id: bytes, out_idx: int):
return pack_set_u8_param_command(
object_id,
OUT_ENABLE_LIST[out_idx].parameter_address,
Channel.on,
)
@@ -279,12 +288,14 @@ def generic_off_cmd(
object_id: bytes, q: DefaultPusQueueHelper, info_str: str, out_idx: int
):
q.add_log_cmd(info_str + " off")
q.add_pus_tc(
pack_set_u8_param_command(
object_id,
OUT_ENABLE_LIST[out_idx].parameter_address,
Channel.off,
)
q.add_pus_tc(create_generic_off_cmd(object_id, out_idx))
def create_generic_off_cmd(object_id: bytes, out_idx: int):
return pack_set_u8_param_command(
object_id,
OUT_ENABLE_LIST[out_idx].parameter_address,
Channel.off,
)
@@ -306,6 +317,7 @@ def add_gomspace_cmd_defs(oce: OpCodeEntry):
)
oce.add(keys=PowerOpCodes.PRINT_LATCHUPS, info=PowerInfo.PRINT_LATCHUPS)
oce.add(keys=GomspaceOpCodes.GET_PARAM, info=GsInfo.GET_PARAMETER)
oce.add(keys=GomspaceOpCodes.REBOOT, info=GsInfo.REBOOT)
oce.add(keys=GomspaceOpCodes.SET_INTEGER_PARAM, info=GsInfo.SET_PARAMETER)
oce.add(keys=GomspaceOpCodes.REQUEST_CONFIG_TABLE, info=GsInfo.REQUEST_CONFIG_TABLE)
oce.add(keys=GomspaceOpCodes.SAVE_TABLE, info=GsInfo.SAVE_TABLE)

View File

@@ -9,7 +9,7 @@ from eive_tmtc.tmtc.power.common_power import (
pack_common_gomspace_cmds,
req_hk_cmds,
pack_common_power_cmds,
SetIds,
SetId,
)
from tmtccmd.tc import DefaultPusQueueHelper
from eive_tmtc.gomspace.gomspace_common import (
@@ -238,4 +238,4 @@ def pack_p60dock_cmds(object_id: ObjectIdU32, q: DefaultPusQueueHelper, op_code:
def p60_dock_req_hk_cmds(q: DefaultPusQueueHelper, op_code: str):
req_hk_cmds("P60 Dock", q, op_code, P60_DOCK_HANDLER, [SetIds.CORE, SetIds.AUX])
req_hk_cmds("P60 Dock", q, op_code, P60_DOCK_HANDLER, [SetId.CORE, SetId.AUX])

View File

@@ -12,12 +12,14 @@ from eive_tmtc.tmtc.power.common_power import (
generic_on_cmd,
generic_off_cmd,
add_gomspace_cmd_defs,
create_generic_on_cmd,
create_generic_off_cmd,
pack_common_power_cmds,
GomspaceOpCodes,
GsInfo,
PowerInfo,
add_common_power_defs,
SetIds,
SetId,
)
from eive_tmtc.gomspace.gomspace_common import *
@@ -89,7 +91,7 @@ def pack_pdu1_commands(object_id: ObjectIdU32, q: DefaultPusQueueHelper, op_code
def pdu1_req_hk_cmds(q: DefaultPusQueueHelper, op_code: str):
req_hk_cmds("PDU1", q, op_code, PDU_1_HANDLER_ID, [SetIds.CORE, SetIds.AUX])
req_hk_cmds("PDU1", q, op_code, PDU_1_HANDLER_ID, [SetId.CORE, SetId.AUX])
def info_on_pdu1(base: str) -> str:
@@ -173,65 +175,148 @@ def add_pdu1_cmds(defs: TmtcDefinitionWrapper):
)
PDU1_DICT = {
Pdu1ChIndex.TCS: Pdu1InfoBase.TCS,
Pdu1ChIndex.STR: Pdu1InfoBase.STR,
Pdu1ChIndex.SYRLINKS: Pdu1InfoBase.SYRLINKS,
Pdu1ChIndex.MGT: Pdu1InfoBase.MGT,
Pdu1ChIndex.SCEX: Pdu1InfoBase.SCEX,
Pdu1ChIndex.ACS_A: Pdu1InfoBase.ACS_A,
Pdu1ChIndex.SUS_N: Pdu1InfoBase.SUS_N,
}
def pdu1_on_cmd(idx: Pdu1ChIndex, q: DefaultPusQueueHelper):
generic_on_cmd(PDU_1_HANDLER_ID, q, PDU1_DICT[idx], idx)
def pdu1_off_cmd(idx: Pdu1ChIndex, q: DefaultPusQueueHelper):
generic_off_cmd(PDU_1_HANDLER_ID, q, PDU1_DICT[idx], idx)
def tcs_on_cmd(q: DefaultPusQueueHelper):
generic_on_cmd(PDU_1_HANDLER_ID, q, Pdu1InfoBase.TCS, Pdu1ChIndex.TCS)
pdu1_on_cmd(Pdu1ChIndex.TCS, q)
def create_tcs_on_cmd() -> PusTelecommand:
return create_generic_on_cmd(PDU_1_HANDLER_ID, Pdu1ChIndex.TCS)
def tcs_off_cmd(q: DefaultPusQueueHelper):
generic_off_cmd(PDU_1_HANDLER_ID, q, Pdu1InfoBase.TCS, Pdu1ChIndex.TCS)
pdu1_off_cmd(Pdu1ChIndex.TCS, q)
def create_tcs_off_cmd() -> PusTelecommand:
return create_generic_off_cmd(PDU_1_HANDLER_ID, Pdu1ChIndex.TCS)
def syrlinks_on_cmd(q: DefaultPusQueueHelper):
generic_on_cmd(PDU_1_HANDLER_ID, q, Pdu1InfoBase.SYRLINKS, Pdu1ChIndex.SYRLINKS)
pdu1_on_cmd(Pdu1ChIndex.SYRLINKS, q)
def create_syrlinks_on_cmd() -> PusTelecommand:
return create_generic_on_cmd(PDU_1_HANDLER_ID, Pdu1ChIndex.SYRLINKS)
def syrlinks_off_cmd(q: DefaultPusQueueHelper):
generic_off_cmd(PDU_1_HANDLER_ID, q, Pdu1InfoBase.SYRLINKS, Pdu1ChIndex.SYRLINKS)
pdu1_off_cmd(Pdu1ChIndex.SYRLINKS, q)
def create_syrlinks_off_cmd() -> PusTelecommand:
return create_generic_off_cmd(PDU_1_HANDLER_ID, Pdu1ChIndex.SYRLINKS)
def startracker_on_cmd(q: DefaultPusQueueHelper):
generic_on_cmd(PDU_1_HANDLER_ID, q, Pdu1InfoBase.STR, Pdu1ChIndex.STR)
pdu1_on_cmd(Pdu1ChIndex.STR, q)
def create_startracker_on_cmd() -> PusTelecommand:
return create_generic_on_cmd(PDU_1_HANDLER_ID, Pdu1ChIndex.STR)
def startracker_off_cmd(q: DefaultPusQueueHelper):
generic_off_cmd(PDU_1_HANDLER_ID, q, Pdu1InfoBase.STR, Pdu1ChIndex.STR)
pdu1_on_cmd(Pdu1ChIndex.STR, q)
def create_startracker_off_cmd() -> PusTelecommand:
return create_generic_off_cmd(PDU_1_HANDLER_ID, Pdu1ChIndex.STR)
def mgt_on_cmd(q: DefaultPusQueueHelper):
generic_on_cmd(PDU_1_HANDLER_ID, q, Pdu1InfoBase.MGT, Pdu1ChIndex.MGT)
pdu1_on_cmd(Pdu1ChIndex.MGT, q)
def create_mgt_on_cmd() -> PusTelecommand:
return create_generic_on_cmd(PDU_1_HANDLER_ID, Pdu1ChIndex.MGT)
def mgt_off_cmd(q: DefaultPusQueueHelper):
generic_off_cmd(PDU_1_HANDLER_ID, q, Pdu1InfoBase.MGT, Pdu1ChIndex.MGT)
pdu1_off_cmd(Pdu1ChIndex.MGT, q)
def create_mgt_off_cmd() -> PusTelecommand:
return create_generic_on_cmd(PDU_1_HANDLER_ID, Pdu1ChIndex.MGT)
def sun_sensor_nominal_on_cmd(q: DefaultPusQueueHelper):
generic_on_cmd(PDU_1_HANDLER_ID, q, Pdu1InfoBase.SUS_N, Pdu1ChIndex.SUS_N)
pdu1_on_cmd(Pdu1ChIndex.SUS_N, q)
def create_sun_sensor_nominal_on_cmd() -> PusTelecommand:
return create_generic_on_cmd(PDU_1_HANDLER_ID, Pdu1ChIndex.SUS_N)
def sun_sensor_nominal_off_cmd(q: DefaultPusQueueHelper):
generic_off_cmd(PDU_1_HANDLER_ID, q, Pdu1InfoBase.SUS_N, Pdu1ChIndex.SUS_N)
pdu1_off_cmd(Pdu1ChIndex.SUS_N, q)
def create_sun_sensor_nominal_off_cmd() -> PusTelecommand:
return create_generic_off_cmd(PDU_1_HANDLER_ID, Pdu1ChIndex.SUS_N)
def solar_cell_experiment_on_cmd(q: DefaultPusQueueHelper):
generic_on_cmd(PDU_1_HANDLER_ID, q, Pdu1InfoBase.SCEX, Pdu1ChIndex.SCEX)
pdu1_on_cmd(Pdu1ChIndex.SCEX, q)
def create_solar_cell_experiment_on_cmd() -> PusTelecommand:
return create_generic_on_cmd(PDU_1_HANDLER_ID, Pdu1ChIndex.SCEX)
def solar_cell_experiment_off_cmd(q: DefaultPusQueueHelper):
generic_off_cmd(PDU_1_HANDLER_ID, q, Pdu1InfoBase.SCEX, Pdu1ChIndex.SCEX)
pdu1_off_cmd(Pdu1ChIndex.SCEX, q)
def create_solar_cell_experiment_off_cmd() -> PusTelecommand:
return create_generic_off_cmd(PDU_1_HANDLER_ID, Pdu1ChIndex.SCEX)
def ploc_on_cmd(q: DefaultPusQueueHelper):
generic_on_cmd(PDU_1_HANDLER_ID, q, Pdu1InfoBase.PLOC, Pdu1ChIndex.PLOC)
pdu1_on_cmd(Pdu1ChIndex.PLOC, q)
def create_ploc_on_cmd() -> PusTelecommand:
return create_generic_on_cmd(PDU_1_HANDLER_ID, Pdu1ChIndex.PLOC)
def ploc_off_cmd(q: DefaultPusQueueHelper):
generic_off_cmd(PDU_1_HANDLER_ID, q, Pdu1InfoBase.PLOC, Pdu1ChIndex.PLOC)
pdu1_off_cmd(Pdu1ChIndex.PLOC, q)
def create_ploc_off_cmd() -> PusTelecommand:
return create_generic_off_cmd(PDU_1_HANDLER_ID, Pdu1ChIndex.PLOC)
def acs_board_a_on_cmd(q: DefaultPusQueueHelper):
generic_on_cmd(PDU_1_HANDLER_ID, q, Pdu1InfoBase.ACS_A, Pdu1ChIndex.ACS_A)
pdu1_on_cmd(Pdu1ChIndex.ACS_A, q)
def create_acs_board_a_on_cmd() -> PusTelecommand:
return create_generic_on_cmd(PDU_1_HANDLER_ID, Pdu1ChIndex.ACS_A)
def acs_board_a_off_cmd(q: DefaultPusQueueHelper):
generic_on_cmd(PDU_1_HANDLER_ID, q, Pdu1InfoBase.ACS_A, Pdu1ChIndex.ACS_A)
pdu1_off_cmd(Pdu1ChIndex.ACS_A, q)
def create_acs_board_a_off_cmd() -> PusTelecommand:
return create_generic_off_cmd(PDU_1_HANDLER_ID, Pdu1ChIndex.ACS_A)

View File

@@ -15,7 +15,9 @@ from eive_tmtc.tmtc.power.common_power import (
generic_off_cmd,
add_gomspace_cmd_defs,
pack_common_power_cmds,
SetIds,
create_generic_on_cmd,
create_generic_off_cmd,
SetId,
add_common_power_defs,
)
from eive_tmtc.gomspace.gomspace_common import *
@@ -238,7 +240,7 @@ def add_pdu2_common_defs(oce: OpCodeEntry):
def pdu2_req_hk_cmds(q: DefaultPusQueueHelper, op_code: str):
req_hk_cmds("PDU2", q, op_code, PDU_2_HANDLER_ID, [SetIds.CORE, SetIds.AUX])
req_hk_cmds("PDU2", q, op_code, PDU_2_HANDLER_ID, [SetId.CORE, SetId.AUX])
def pl_pcdu_bat_nom_on_cmd(q: DefaultPusQueueHelper):
@@ -257,61 +259,117 @@ def reaction_wheel_on_cmd(q: DefaultPusQueueHelper):
generic_on_cmd(PDU_2_HANDLER_ID, q, Pdu2InfoBase.RW, Pdu2ChIndex.RW)
def create_reaction_wheel_on_cmd() -> PusTelecommand:
return create_generic_on_cmd(PDU_2_HANDLER_ID, Pdu2ChIndex.RW)
def reaction_wheel_off_cmd(q: DefaultPusQueueHelper):
generic_off_cmd(PDU_2_HANDLER_ID, q, Pdu2InfoBase.RW, Pdu2ChIndex.RW)
def create_reaction_wheel_off_cmd() -> PusTelecommand:
return create_generic_off_cmd(PDU_2_HANDLER_ID, Pdu2ChIndex.RW)
def heater_on_cmd(q: DefaultPusQueueHelper):
generic_on_cmd(PDU_2_HANDLER_ID, q, Pdu2InfoBase.HEATER, Pdu2ChIndex.HEATER)
def create_heater_on_cmd() -> PusTelecommand:
return create_generic_on_cmd(PDU_2_HANDLER_ID, Pdu2ChIndex.HEATER)
def heater_off_cmd(q: DefaultPusQueueHelper):
generic_off_cmd(PDU_2_HANDLER_ID, q, Pdu2InfoBase.HEATER, Pdu2ChIndex.HEATER)
def create_heater_off_cmd() -> PusTelecommand:
return create_generic_on_cmd(PDU_2_HANDLER_ID, Pdu2ChIndex.HEATER)
def sus_red_on_cmd(q: DefaultPusQueueHelper):
generic_on_cmd(PDU_2_HANDLER_ID, q, Pdu2InfoBase.SUS_R, Pdu2ChIndex.SUS_R)
def create_sus_red_on_cmd() -> PusTelecommand:
return create_generic_on_cmd(PDU_2_HANDLER_ID, Pdu2ChIndex.SUS_R)
def sus_red_off_cmd(q: DefaultPusQueueHelper):
generic_off_cmd(PDU_2_HANDLER_ID, q, Pdu2InfoBase.SUS_R, Pdu2ChIndex.SUS_R)
def create_sus_red_off_cmd() -> PusTelecommand:
return create_generic_off_cmd(PDU_2_HANDLER_ID, Pdu2ChIndex.SUS_R)
def solar_array_deployment_on_cmd(q: DefaultPusQueueHelper):
generic_on_cmd(
PDU_2_HANDLER_ID, q, Pdu2InfoBase.SOLAR_ARRAY_DEPL, Pdu2ChIndex.SOLAR_ARRAY_DEPL
)
def create_solar_array_deployment_on_cmd() -> PusTelecommand:
return create_generic_on_cmd(PDU_2_HANDLER_ID, Pdu2ChIndex.SOLAR_ARRAY_DEPL)
def solar_array_deployment_off_cmd(q: DefaultPusQueueHelper):
generic_off_cmd(
PDU_2_HANDLER_ID, q, Pdu2InfoBase.SOLAR_ARRAY_DEPL, Pdu2ChIndex.SOLAR_ARRAY_DEPL
)
def create_solar_array_deployment_off_cmd() -> PusTelecommand:
return create_generic_off_cmd(PDU_2_HANDLER_ID, Pdu2ChIndex.SOLAR_ARRAY_DEPL)
def pl_pcdu_bat_red_on_cmd(q: DefaultPusQueueHelper):
generic_on_cmd(
PDU_2_HANDLER_ID, q, Pdu2InfoBase.PL_PCDU_BAT_RED, Pdu2ChIndex.PL_PCDU_BAT_RED
)
def create_pl_pcdu_bat_red_on_cmd() -> PusTelecommand:
return create_generic_on_cmd(PDU_2_HANDLER_ID, Pdu2ChIndex.PL_PCDU_BAT_RED)
def pl_pcdu_bat_red_off_cmd(q: DefaultPusQueueHelper):
generic_off_cmd(
PDU_2_HANDLER_ID, q, Pdu2InfoBase.PL_PCDU_BAT_RED, Pdu2ChIndex.PL_PCDU_BAT_RED
)
def create_pl_pcdu_bat_red_off_cmd() -> PusTelecommand:
return create_generic_off_cmd(PDU_2_HANDLER_ID, Pdu2ChIndex.PL_PCDU_BAT_RED)
def acs_board_b_side_on_cmd(q: DefaultPusQueueHelper):
generic_on_cmd(PDU_2_HANDLER_ID, q, Pdu2InfoBase.ACS_B, Pdu2ChIndex.ACS_B)
def create_acs_board_b_side_on_cmd() -> PusTelecommand:
return create_generic_on_cmd(PDU_2_HANDLER_ID, Pdu2ChIndex.ACS_B)
def acs_board_b_side_off_cmd(q: DefaultPusQueueHelper):
generic_off_cmd(PDU_2_HANDLER_ID, q, Pdu2InfoBase.ACS_B, Pdu2ChIndex.ACS_B)
def create_acs_board_b_side_off_cmd() -> PusTelecommand:
return create_generic_off_cmd(PDU_2_HANDLER_ID, Pdu2ChIndex.ACS_B)
def payload_camera_on_cmd(q: DefaultPusQueueHelper):
generic_on_cmd(PDU_2_HANDLER_ID, q, Pdu2InfoBase.PL_CAM, Pdu2ChIndex.PL_CAM)
def create_payload_camera_on_cmd() -> PusTelecommand:
return create_generic_on_cmd(PDU_2_HANDLER_ID, Pdu2ChIndex.PL_CAM)
def payload_camera_off_cmd(q: DefaultPusQueueHelper):
generic_off_cmd(PDU_2_HANDLER_ID, q, Pdu2InfoBase.PL_CAM, Pdu2ChIndex.PL_CAM)
def create_payload_camera_off_cmd() -> PusTelecommand:
return create_generic_on_cmd(PDU_2_HANDLER_ID, Pdu2ChIndex.PL_CAM)

View File

@@ -3,7 +3,7 @@ from typing import List, Tuple
from eive_tmtc.tmtc.power.acu import acu_config_table_handler
from eive_tmtc.tmtc.power.common_power import (
SetIds,
SetId,
unpack_array_in_data,
OBC_ENDIANNESS,
)
@@ -151,7 +151,7 @@ def handle_pdu_data(
pw = PrintWrapper(printer=printer)
current_idx = 0
priv_idx = pdu_idx - 1
if set_id == SetIds.AUX or set_id == SetIds.AUX:
if set_id == SetId.AUX or set_id == SetId.AUX:
fmt_str = "!hhBBBIIH"
inc_len = struct.calcsize(fmt_str)
(
@@ -188,7 +188,7 @@ def handle_pdu_data(
wdt.print()
pw.dlog(f"PDU Device Types: 0:FRAM|1:ADC|2:ADC|3:TempSens|4,5,6,7:Reserved")
dev_parser.print(pw=pw)
if set_id == SetIds.CORE or set_id == SetIds.CORE:
if set_id == SetId.CORE or set_id == SetId.CORE:
pw.dlog(f"Received PDU HK from PDU {pdu_idx}")
current_list = []
for idx in range(len(PDU1_CHANNELS_NAMES)):
@@ -229,7 +229,7 @@ def handle_pdu_data(
def handle_p60_hk_data(printer: FsfwTmTcPrinter, set_id: int, hk_data: bytes):
pw = PrintWrapper(printer=printer)
if set_id == SetIds.CORE:
if set_id == SetId.CORE:
pw.dlog("Received P60 Core HK. Voltages in mV, currents in mA")
current_idx = 0
current_list = []
@@ -276,7 +276,7 @@ def handle_p60_hk_data(printer: FsfwTmTcPrinter, set_id: int, hk_data: bytes):
pw.dlog(temps)
pw.dlog(batt_info)
printer.print_validity_buffer(validity_buffer=hk_data[current_idx:], num_vars=9)
if set_id == SetIds.AUX:
if set_id == SetId.AUX:
pw.dlog("Received P60 AUX HK. Voltages in mV, currents in mA")
current_idx = 0
latchup_list = []
@@ -355,7 +355,7 @@ def gen_six_entry_u16_list(hk_data: bytes, current_idx: int) -> Tuple[int, List[
def handle_acu_hk_data(printer: FsfwTmTcPrinter, set_id: int, hk_data: bytes):
pw = PrintWrapper(printer=printer)
if set_id == SetIds.CORE:
if set_id == SetId.CORE:
mppt_mode = hk_data[0]
current_idx = 1
current_idx, currents = gen_six_entry_u16_list(
@@ -399,7 +399,7 @@ def handle_acu_hk_data(printer: FsfwTmTcPrinter, set_id: int, hk_data: bytes):
printer.print_validity_buffer(
validity_buffer=hk_data[current_idx:], num_vars=12
)
if set_id == SetIds.AUX:
if set_id == SetId.AUX:
current_idx = 0
fmt_str = "!BBB"
inc_len = struct.calcsize(fmt_str)

View File

@@ -27,7 +27,7 @@ classifiers =
[options]
install_requires =
tmtccmd @ git+https://github.com/robamu-org/tmtccmd@v3.0.0
tmtccmd @ git+https://github.com/robamu-org/tmtccmd@v4.0.0a1
packages = find:
python_requires = >=3.8
include_package_data = True