This commit is contained in:
parent
c6b2edf688
commit
f93f713b0e
@ -1,6 +1,7 @@
|
|||||||
"""HK Handling for EIVE OBSW"""
|
"""HK Handling for EIVE OBSW"""
|
||||||
import dataclasses
|
import dataclasses
|
||||||
import logging
|
import logging
|
||||||
|
import base64 # noqa
|
||||||
from typing import List
|
from typing import List
|
||||||
|
|
||||||
from eive_tmtc.tmtc.acs.acs_ctrl import handle_acs_ctrl_hk_data
|
from eive_tmtc.tmtc.acs.acs_ctrl import handle_acs_ctrl_hk_data
|
||||||
@ -70,6 +71,7 @@ def handle_hk_packet(
|
|||||||
hk_data = tm_packet.tm_data[8:]
|
hk_data = tm_packet.tm_data[8:]
|
||||||
|
|
||||||
if named_obj_id in hk_filter.object_ids:
|
if named_obj_id in hk_filter.object_ids:
|
||||||
|
# print(f"PUS TM Base64: {base64.b64encode(raw_tm)}")
|
||||||
handle_regular_hk_print(
|
handle_regular_hk_print(
|
||||||
printer=printer,
|
printer=printer,
|
||||||
object_id=named_obj_id,
|
object_id=named_obj_id,
|
||||||
|
@ -264,14 +264,16 @@ def pack_ploc_supv_commands(p: ServiceProviderParams): # noqa C901
|
|||||||
action_cmd = create_action_cmd(
|
action_cmd = create_action_cmd(
|
||||||
PLOC_SUPV_ID, SupvActionId.GET_BOOT_STATUS_REPORT
|
PLOC_SUPV_ID, SupvActionId.GET_BOOT_STATUS_REPORT
|
||||||
)
|
)
|
||||||
q.add_wait_seconds(2.0)
|
if action_cmd is None:
|
||||||
|
_LOGGER.warning(f"invalid set ID {set_id!r} for PLOC SUPV")
|
||||||
|
return
|
||||||
# Now dump the HK set.
|
# Now dump the HK set.
|
||||||
sid = make_sid(object_id.as_bytes, set_id)
|
sid = make_sid(object_id.as_bytes, set_id)
|
||||||
req_hk = generate_one_hk_command(sid)
|
req_hk = generate_one_hk_command(sid)
|
||||||
|
q.add_pus_tc(action_cmd)
|
||||||
|
q.add_wait_seconds(2.0)
|
||||||
q.add_pus_tc(req_hk)
|
q.add_pus_tc(req_hk)
|
||||||
assert action_cmd is not None
|
assert action_cmd is not None
|
||||||
q.add_pus_tc(action_cmd)
|
|
||||||
elif op_code == OpCode.START_MPSOC:
|
elif op_code == OpCode.START_MPSOC:
|
||||||
q.add_log_cmd("PLOC Supervisor: Start MPSoC")
|
q.add_log_cmd("PLOC Supervisor: Start MPSoC")
|
||||||
command = obyt + struct.pack("!I", SupvActionId.START_MPSOC)
|
command = obyt + struct.pack("!I", SupvActionId.START_MPSOC)
|
||||||
@ -885,14 +887,21 @@ def handle_latchup_status_report(hk_data: bytes):
|
|||||||
current_idx += 1
|
current_idx += 1
|
||||||
time_month = hk_data[current_idx]
|
time_month = hk_data[current_idx]
|
||||||
current_idx += 1
|
current_idx += 1
|
||||||
time_year = hk_data[current_idx]
|
# Is stored as years since 1900.
|
||||||
dt = datetime(
|
time_year = 1900 + hk_data[current_idx]
|
||||||
year=time_year,
|
try:
|
||||||
month=time_month,
|
dt = datetime(
|
||||||
day=time_day,
|
year=time_year,
|
||||||
hour=time_hour,
|
month=time_month,
|
||||||
minute=time_minutes,
|
day=time_day,
|
||||||
second=time_seconds,
|
hour=time_hour,
|
||||||
microsecond=time_ms * 1000,
|
minute=time_minutes,
|
||||||
)
|
second=time_seconds,
|
||||||
print(f"Time Now: {dt}")
|
microsecond=time_ms * 1000,
|
||||||
|
)
|
||||||
|
print(f"Time Now: {dt}")
|
||||||
|
except ValueError:
|
||||||
|
print(
|
||||||
|
f"Time: {time_day}.{time_month}.{time_year}T"
|
||||||
|
f"{time_hour}:{time_minutes}:{time_seconds}.{time_ms}"
|
||||||
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user