Compare commits
10 Commits
Author | SHA1 | Date | |
---|---|---|---|
1e143ea6fa | |||
8b677041e2 | |||
ff787f4497 | |||
7e90d6183c | |||
20e107c7ae | |||
4f9c728e51 | |||
bd3b666f8c | |||
483ebe87ad | |||
24f6a59cf9 | |||
9016d3d992 |
11
CHANGELOG.md
11
CHANGELOG.md
@ -10,6 +10,16 @@ list yields a list of all related PRs for each release.
|
|||||||
|
|
||||||
# [unreleased]
|
# [unreleased]
|
||||||
|
|
||||||
|
# [v2.12.6] 2023-02-14
|
||||||
|
|
||||||
|
## Fixed
|
||||||
|
|
||||||
|
- Fixed GPS processed set output
|
||||||
|
|
||||||
|
## Added
|
||||||
|
|
||||||
|
- Added command to request switcher set from PCDU handler.
|
||||||
|
|
||||||
# [v2.12.5] 2023-02-13
|
# [v2.12.5] 2023-02-13
|
||||||
|
|
||||||
## Added
|
## Added
|
||||||
@ -124,7 +134,6 @@ tmtccmd v4.0.0rc0
|
|||||||
|
|
||||||
## Added
|
## Added
|
||||||
|
|
||||||
- Added command to request switcher set from PCDU handler.
|
|
||||||
- Star Tracker: Add commands to update default datarate.
|
- Star Tracker: Add commands to update default datarate.
|
||||||
|
|
||||||
## Changed
|
## Changed
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
__version__ = "2.12.5"
|
__version__ = "2.12.6"
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
@ -6,7 +6,7 @@ from pathlib import Path
|
|||||||
SW_NAME = "eive-tmtc"
|
SW_NAME = "eive-tmtc"
|
||||||
VERSION_MAJOR = 2
|
VERSION_MAJOR = 2
|
||||||
VERSION_MINOR = 12
|
VERSION_MINOR = 12
|
||||||
VERSION_REVISION = 5
|
VERSION_REVISION = 6
|
||||||
|
|
||||||
EIVE_TMTC_ROOT = Path(__file__).parent
|
EIVE_TMTC_ROOT = Path(__file__).parent
|
||||||
PACKAGE_ROOT = EIVE_TMTC_ROOT.parent
|
PACKAGE_ROOT = EIVE_TMTC_ROOT.parent
|
||||||
|
@ -24,6 +24,7 @@ from eive_tmtc.tmtc.power.tm import (
|
|||||||
handle_pdu_data,
|
handle_pdu_data,
|
||||||
handle_p60_hk_data,
|
handle_p60_hk_data,
|
||||||
handle_acu_hk_data,
|
handle_acu_hk_data,
|
||||||
|
handle_pcdu_hk,
|
||||||
)
|
)
|
||||||
from eive_tmtc.tmtc.acs.imtq import (
|
from eive_tmtc.tmtc.acs.imtq import (
|
||||||
ImtqSetId,
|
ImtqSetId,
|
||||||
@ -110,6 +111,8 @@ def handle_regular_hk_print(
|
|||||||
_LOGGER.info("Service 3 TM: IMTQ handler reply with unknown set id")
|
_LOGGER.info("Service 3 TM: IMTQ handler reply with unknown set id")
|
||||||
elif objb == obj_ids.GPS_CONTROLLER:
|
elif objb == obj_ids.GPS_CONTROLLER:
|
||||||
return handle_gps_data(printer=printer, hk_data=hk_data)
|
return handle_gps_data(printer=printer, hk_data=hk_data)
|
||||||
|
elif objb == obj_ids.PCDU_HANDLER_ID:
|
||||||
|
return handle_pcdu_hk(printer=printer, set_id=set_id, hk_data=hk_data)
|
||||||
elif objb == obj_ids.BPX_HANDLER_ID:
|
elif objb == obj_ids.BPX_HANDLER_ID:
|
||||||
handle_bpx_hk_data(hk_data=hk_data, set_id=set_id, printer=printer)
|
handle_bpx_hk_data(hk_data=hk_data, set_id=set_id, printer=printer)
|
||||||
elif objb == obj_ids.CORE_CONTROLLER_ID:
|
elif objb == obj_ids.CORE_CONTROLLER_ID:
|
||||||
|
@ -668,6 +668,7 @@ def handle_gps_data_processed(pw: PrintWrapper, hk_data: bytes):
|
|||||||
fmt_vec, hk_data[current_idx : current_idx + inc_len_vec]
|
fmt_vec, hk_data[current_idx : current_idx + inc_len_vec]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
current_idx += inc_len_vec
|
||||||
velo = [
|
velo = [
|
||||||
f"{val:8.3f}"
|
f"{val:8.3f}"
|
||||||
for val in struct.unpack(
|
for val in struct.unpack(
|
||||||
@ -679,7 +680,7 @@ def handle_gps_data_processed(pw: PrintWrapper, hk_data: bytes):
|
|||||||
pw.dlog(f"GPS Longitude: {long} [rad]")
|
pw.dlog(f"GPS Longitude: {long} [rad]")
|
||||||
pw.dlog(f"GPS Position: {pos} [m]")
|
pw.dlog(f"GPS Position: {pos} [m]")
|
||||||
pw.dlog(f"GPS Velocity: {velo} [m/s]")
|
pw.dlog(f"GPS Velocity: {velo} [m/s]")
|
||||||
pw.printer.print_validity_buffer(hk_data[current_idx:], num_vars=3)
|
pw.printer.print_validity_buffer(hk_data[current_idx:], num_vars=4)
|
||||||
|
|
||||||
|
|
||||||
def handle_mekf_data(pw: PrintWrapper, hk_data: bytes):
|
def handle_mekf_data(pw: PrintWrapper, hk_data: bytes):
|
||||||
|
@ -52,6 +52,7 @@ class GsInfo:
|
|||||||
class PowerInfo:
|
class PowerInfo:
|
||||||
INFO_CORE = "Core Information"
|
INFO_CORE = "Core Information"
|
||||||
INFO_AUX = "Auxiliary Information"
|
INFO_AUX = "Auxiliary Information"
|
||||||
|
SWITCHER_HK = "Switcher State Information"
|
||||||
INFO_ALL = "All Information"
|
INFO_ALL = "All Information"
|
||||||
REQUEST_SWITCHER_SET = "Request Switcher Information"
|
REQUEST_SWITCHER_SET = "Request Switcher Information"
|
||||||
ENABLE_INFO_HK = "Enable Core Info HK"
|
ENABLE_INFO_HK = "Enable Core Info HK"
|
||||||
@ -102,7 +103,7 @@ class PowerOpCodes:
|
|||||||
|
|
||||||
REBOOT = ["reboot"]
|
REBOOT = ["reboot"]
|
||||||
INFO_CORE = ["info"]
|
INFO_CORE = ["info"]
|
||||||
REQUEST_SWITCHER_SET = ["request_switchers"]
|
SWITCHER_HK = ["switcher_states"]
|
||||||
ENABLE_INFO_HK = ["info_hk_on"]
|
ENABLE_INFO_HK = ["info_hk_on"]
|
||||||
DISABLE_INFO_HK = ["info_hk_off"]
|
DISABLE_INFO_HK = ["info_hk_off"]
|
||||||
INFO_AUX = ["info_aux"]
|
INFO_AUX = ["info_aux"]
|
||||||
|
@ -13,7 +13,6 @@ from eive_tmtc.config.object_ids import (
|
|||||||
ACU_HANDLER_ID,
|
ACU_HANDLER_ID,
|
||||||
PDU_1_HANDLER_ID,
|
PDU_1_HANDLER_ID,
|
||||||
PDU_2_HANDLER_ID,
|
PDU_2_HANDLER_ID,
|
||||||
PCDU_HANDLER_ID,
|
|
||||||
get_object_ids,
|
get_object_ids,
|
||||||
)
|
)
|
||||||
from eive_tmtc.tmtc.power.pdu1 import (
|
from eive_tmtc.tmtc.power.pdu1 import (
|
||||||
@ -29,10 +28,15 @@ from eive_tmtc.tmtc.power.pdu2 import (
|
|||||||
add_pdu2_cmds,
|
add_pdu2_cmds,
|
||||||
)
|
)
|
||||||
from tmtccmd.config import TmtcDefinitionWrapper, OpCodeEntry
|
from tmtccmd.config import TmtcDefinitionWrapper, OpCodeEntry
|
||||||
|
from eive_tmtc.config.object_ids import PCDU_HANDLER_ID
|
||||||
|
|
||||||
from eive_tmtc.tmtc.power.p60dock import P60OpCode, P60Info, p60_dock_req_hk_cmds
|
from eive_tmtc.tmtc.power.p60dock import P60OpCode, P60Info, p60_dock_req_hk_cmds
|
||||||
from eive_tmtc.tmtc.power.acu import add_acu_cmds, acu_req_hk_cmds
|
from eive_tmtc.tmtc.power.acu import add_acu_cmds, acu_req_hk_cmds
|
||||||
from tmtccmd.tc.pus_3_fsfw_hk import create_request_one_diag_command, make_sid
|
from tmtccmd.tc.pus_3_fsfw_hk import (
|
||||||
|
create_request_one_diag_command,
|
||||||
|
make_sid,
|
||||||
|
create_request_one_hk_command,
|
||||||
|
)
|
||||||
from tmtccmd.config.tmtc import tmtc_definitions_provider
|
from tmtccmd.config.tmtc import tmtc_definitions_provider
|
||||||
from tmtccmd.tc import DefaultPusQueueHelper
|
from tmtccmd.tc import DefaultPusQueueHelper
|
||||||
|
|
||||||
@ -41,9 +45,20 @@ class SetId(enum.IntEnum):
|
|||||||
SWITCHER_SET = 0
|
SWITCHER_SET = 0
|
||||||
|
|
||||||
|
|
||||||
|
class PcduSetIds:
|
||||||
|
SWITCHER_SET = 0
|
||||||
|
|
||||||
|
|
||||||
def pack_power_commands(q: DefaultPusQueueHelper, op_code: str):
|
def pack_power_commands(q: DefaultPusQueueHelper, op_code: str):
|
||||||
pdu1_switch_cmds(q, op_code)
|
pdu1_switch_cmds(q, op_code)
|
||||||
pdu2_switch_cmds(q, op_code)
|
pdu2_switch_cmds(q, op_code)
|
||||||
|
if op_code in PowerOpCodes.SWITCHER_HK:
|
||||||
|
q.add_log_cmd("Requesting switcher state HK")
|
||||||
|
q.add_pus_tc(
|
||||||
|
create_request_one_diag_command(
|
||||||
|
make_sid(PCDU_HANDLER_ID, PcduSetIds.SWITCHER_SET)
|
||||||
|
)
|
||||||
|
)
|
||||||
if op_code in PowerOpCodes.INFO_CORE:
|
if op_code in PowerOpCodes.INFO_CORE:
|
||||||
pdu1_req_hk_cmds(q, PowerOpCodes.REQUEST_CORE_HK_ONCE[0])
|
pdu1_req_hk_cmds(q, PowerOpCodes.REQUEST_CORE_HK_ONCE[0])
|
||||||
pdu2_req_hk_cmds(q, PowerOpCodes.REQUEST_CORE_HK_ONCE[0])
|
pdu2_req_hk_cmds(q, PowerOpCodes.REQUEST_CORE_HK_ONCE[0])
|
||||||
@ -73,13 +88,6 @@ def pack_power_commands(q: DefaultPusQueueHelper, op_code: str):
|
|||||||
pack_reset_gnd_wdt_cmd(q, "PDU1", oids[PDU_1_HANDLER_ID])
|
pack_reset_gnd_wdt_cmd(q, "PDU1", oids[PDU_1_HANDLER_ID])
|
||||||
pack_reset_gnd_wdt_cmd(q, "PDU2", oids[PDU_2_HANDLER_ID])
|
pack_reset_gnd_wdt_cmd(q, "PDU2", oids[PDU_2_HANDLER_ID])
|
||||||
q.add_wait_seconds(5.0)
|
q.add_wait_seconds(5.0)
|
||||||
elif op_code in PowerOpCodes.REQUEST_SWITCHER_SET:
|
|
||||||
q.add_log_cmd("PCDU: Requesting Switcher Set")
|
|
||||||
q.add_pus_tc(
|
|
||||||
create_request_one_diag_command(
|
|
||||||
make_sid(PCDU_HANDLER_ID, SetId.SWITCHER_SET)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
if q.empty():
|
if q.empty():
|
||||||
logging.getLogger(__name__).info(
|
logging.getLogger(__name__).info(
|
||||||
f"Queue is empty, no stack for op code {op_code}"
|
f"Queue is empty, no stack for op code {op_code}"
|
||||||
@ -105,10 +113,10 @@ def add_power_cmd_defs(defs: TmtcDefinitionWrapper):
|
|||||||
oce = OpCodeEntry()
|
oce = OpCodeEntry()
|
||||||
add_pdu1_common_defs(oce)
|
add_pdu1_common_defs(oce)
|
||||||
add_pdu2_common_defs(oce)
|
add_pdu2_common_defs(oce)
|
||||||
|
oce.add(keys=PowerOpCodes.SWITCHER_HK, info=PowerInfo.SWITCHER_HK)
|
||||||
oce.add(keys=PowerOpCodes.INFO_ALL, info=PowerInfo.INFO_ALL)
|
oce.add(keys=PowerOpCodes.INFO_ALL, info=PowerInfo.INFO_ALL)
|
||||||
oce.add(keys=PowerOpCodes.INFO_CORE, info=PowerInfo.INFO_CORE)
|
oce.add(keys=PowerOpCodes.INFO_CORE, info=PowerInfo.INFO_CORE)
|
||||||
oce.add(keys=PowerOpCodes.INFO_AUX, info=PowerInfo.INFO_AUX)
|
oce.add(keys=PowerOpCodes.INFO_AUX, info=PowerInfo.INFO_AUX)
|
||||||
oce.add(keys=PowerOpCodes.REQUEST_SWITCHER_SET, info=PowerInfo.REQUEST_SWITCHER_SET)
|
|
||||||
oce.add(keys=PowerOpCodes.RESET_ALL_GND_WDTS, info=PowerInfo.RESET_ALL_GND_WDTS)
|
oce.add(keys=PowerOpCodes.RESET_ALL_GND_WDTS, info=PowerInfo.RESET_ALL_GND_WDTS)
|
||||||
defs.add_service(
|
defs.add_service(
|
||||||
name=CustomServiceList.POWER.value,
|
name=CustomServiceList.POWER.value,
|
||||||
|
@ -7,6 +7,7 @@ from eive_tmtc.tmtc.power.common_power import (
|
|||||||
unpack_array_in_data,
|
unpack_array_in_data,
|
||||||
OBC_ENDIANNESS,
|
OBC_ENDIANNESS,
|
||||||
)
|
)
|
||||||
|
from eive_tmtc.tmtc.power.power import PcduSetIds
|
||||||
from tmtccmd.util import ObjectIdBase
|
from tmtccmd.util import ObjectIdBase
|
||||||
from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
|
from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
|
||||||
from eive_tmtc.pus_tm.defs import PrintWrapper
|
from eive_tmtc.pus_tm.defs import PrintWrapper
|
||||||
@ -554,3 +555,24 @@ def parse_name_list(data: bytes, name_len: int):
|
|||||||
idx += len(name)
|
idx += len(name)
|
||||||
idx += 1
|
idx += 1
|
||||||
return ch_list
|
return ch_list
|
||||||
|
|
||||||
|
|
||||||
|
def handle_pcdu_hk(printer: FsfwTmTcPrinter, set_id: int, hk_data: bytes):
|
||||||
|
pw = PrintWrapper(printer)
|
||||||
|
pw.dlog("Received PCDU HK")
|
||||||
|
if set_id == PcduSetIds.SWITCHER_SET:
|
||||||
|
current_idx = 0
|
||||||
|
pdu1_vals = [hk_data[i] for i in range(len(PDU1_CHANNELS_NAMES))]
|
||||||
|
current_idx += len(PDU1_CHANNELS_NAMES)
|
||||||
|
pdu2_vals = [hk_data[i + current_idx] for i in range(len(PDU2_CHANNELS_NAMES))]
|
||||||
|
current_idx += len(PDU2_CHANNELS_NAMES)
|
||||||
|
p60_stack_val = hk_data[current_idx]
|
||||||
|
current_idx += 1
|
||||||
|
pw.dlog("PDU1 Switcher States")
|
||||||
|
for name, val in zip(PDU1_CHANNELS_NAMES, pdu1_vals):
|
||||||
|
pw.dlog(f"{name.ljust(25)}: {val}")
|
||||||
|
pw.dlog("PDU2 Switcher States")
|
||||||
|
for name, val in zip(PDU2_CHANNELS_NAMES, pdu2_vals):
|
||||||
|
pw.dlog(f"{name.ljust(25)}: {val}")
|
||||||
|
pw.dlog(f"{'P60 Dock 5V Stack'.ljust(25)}: {p60_stack_val}")
|
||||||
|
pw.printer.print_validity_buffer(hk_data[current_idx:], 3)
|
||||||
|
Reference in New Issue
Block a user