cotinue tm store front end

This commit is contained in:
Robin Müller 2023-02-17 18:35:21 +01:00
parent 7433982f6f
commit 2ef56ae8c4
No known key found for this signature in database
GPG Key ID: 71B58F8A3CDFA9AC
5 changed files with 73 additions and 25 deletions

View File

@ -249,10 +249,11 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path
14004;0x36b4;NO_SD_CARD_ACTIVE;HIGH;No SD card was active. Core controller will attempt to re-initialize a SD card.;bsp_q7s/core/CoreController.h 14004;0x36b4;NO_SD_CARD_ACTIVE;HIGH;No SD card was active. Core controller will attempt to re-initialize a SD card.;bsp_q7s/core/CoreController.h
14005;0x36b5;VERSION_INFO;INFO;P1: Byte 0: Major, Byte 1: Minor, Byte 2: Patch, Byte 3: Has Git Hash P2: First four letters of Git SHA is the last byte of P1 is set.;bsp_q7s/core/CoreController.h 14005;0x36b5;VERSION_INFO;INFO;P1: Byte 0: Major, Byte 1: Minor, Byte 2: Patch, Byte 3: Has Git Hash P2: First four letters of Git SHA is the last byte of P1 is set.;bsp_q7s/core/CoreController.h
14006;0x36b6;CURRENT_IMAGE_INFO;INFO;P1: Current Chip, P2: Current Copy;bsp_q7s/core/CoreController.h 14006;0x36b6;CURRENT_IMAGE_INFO;INFO;P1: Current Chip, P2: Current Copy;bsp_q7s/core/CoreController.h
14100;0x3714;NO_VALID_SENSOR_TEMPERATURE;MEDIUM;;mission/controller/ThermalController.h 14100;0x3714;POSSIBLE_FILE_CORRUPTION;LOW;P1: Result code of TM packet parser. P2: Timestamp of possibly corrupt file as a unix timestamp.;mission/tmtc/PersistentTmStore.h
14101;0x3715;NO_HEALTHY_HEATER_AVAILABLE;MEDIUM;;mission/controller/ThermalController.h 14200;0x3778;NO_VALID_SENSOR_TEMPERATURE;MEDIUM;;mission/controller/ThermalController.h
14102;0x3716;SYRLINKS_OVERHEATING;HIGH;;mission/controller/ThermalController.h 14201;0x3779;NO_HEALTHY_HEATER_AVAILABLE;MEDIUM;;mission/controller/ThermalController.h
14103;0x3717;PLOC_OVERHEATING;HIGH;;mission/controller/ThermalController.h 14202;0x377a;SYRLINKS_OVERHEATING;HIGH;;mission/controller/ThermalController.h
14104;0x3718;OBC_OVERHEATING;HIGH;;mission/controller/ThermalController.h 14203;0x377b;PLOC_OVERHEATING;HIGH;;mission/controller/ThermalController.h
14105;0x3719;HPA_OVERHEATING;HIGH;;mission/controller/ThermalController.h 14204;0x377c;OBC_OVERHEATING;HIGH;;mission/controller/ThermalController.h
14106;0x371a;PLPCDU_OVERHEATING;HIGH;;mission/controller/ThermalController.h 14205;0x377d;HPA_OVERHEATING;HIGH;;mission/controller/ThermalController.h
14206;0x377e;PLPCDU_OVERHEATING;HIGH;;mission/controller/ThermalController.h

1 Event ID (dec) Event ID (hex) Name Severity Description File Path
249 14004 0x36b4 NO_SD_CARD_ACTIVE HIGH No SD card was active. Core controller will attempt to re-initialize a SD card. bsp_q7s/core/CoreController.h
250 14005 0x36b5 VERSION_INFO INFO P1: Byte 0: Major, Byte 1: Minor, Byte 2: Patch, Byte 3: Has Git Hash P2: First four letters of Git SHA is the last byte of P1 is set. bsp_q7s/core/CoreController.h
251 14006 0x36b6 CURRENT_IMAGE_INFO INFO P1: Current Chip, P2: Current Copy bsp_q7s/core/CoreController.h
252 14100 0x3714 NO_VALID_SENSOR_TEMPERATURE POSSIBLE_FILE_CORRUPTION MEDIUM LOW P1: Result code of TM packet parser. P2: Timestamp of possibly corrupt file as a unix timestamp. mission/controller/ThermalController.h mission/tmtc/PersistentTmStore.h
253 14101 14200 0x3715 0x3778 NO_HEALTHY_HEATER_AVAILABLE NO_VALID_SENSOR_TEMPERATURE MEDIUM mission/controller/ThermalController.h
254 14102 14201 0x3716 0x3779 SYRLINKS_OVERHEATING NO_HEALTHY_HEATER_AVAILABLE HIGH MEDIUM mission/controller/ThermalController.h
255 14103 14202 0x3717 0x377a PLOC_OVERHEATING SYRLINKS_OVERHEATING HIGH mission/controller/ThermalController.h
256 14104 14203 0x3718 0x377b OBC_OVERHEATING PLOC_OVERHEATING HIGH mission/controller/ThermalController.h
257 14105 14204 0x3719 0x377c HPA_OVERHEATING OBC_OVERHEATING HIGH mission/controller/ThermalController.h
258 14106 14205 0x371a 0x377d PLPCDU_OVERHEATING HPA_OVERHEATING HIGH mission/controller/ThermalController.h
259 14206 0x377e PLPCDU_OVERHEATING HIGH mission/controller/ThermalController.h

View File

@ -3,7 +3,7 @@ import os
from eive_tmtc import EIVE_TMTC_ROOT from eive_tmtc import EIVE_TMTC_ROOT
from tmtccmd.fsfw import parse_fsfw_events_csv from tmtccmd.fsfw import parse_fsfw_events_csv
from tmtccmd.pus.s5_event import EventDictT from tmtccmd.pus.s5_fsfw_event import EventDictT
DEFAULT_EVENTS_CSV_PATH = EIVE_TMTC_ROOT / "config/events.csv" DEFAULT_EVENTS_CSV_PATH = EIVE_TMTC_ROOT / "config/events.csv"
__EVENT_DICT = None __EVENT_DICT = None

View File

@ -147,6 +147,11 @@
0x73010002;PL_SUBSYSTEM 0x73010002;PL_SUBSYSTEM
0x73010003;TCS_SUBSYSTEM 0x73010003;TCS_SUBSYSTEM
0x73010004;COM_SUBSYSTEM 0x73010004;COM_SUBSYSTEM
0x73020001;MISC_TM_STORE
0x73020002;OK_TM_STORE
0x73020003;NOT_OK_TM_STORE
0x73020004;HK_TM_STORE
0x73030000;CFDP_TM_STORE
0x73500000;CCSDS_IP_CORE_BRIDGE 0x73500000;CCSDS_IP_CORE_BRIDGE
0x90000003;THERMAL_TEMP_INSERTER 0x90000003;THERMAL_TEMP_INSERTER
0xFFFFFFFF;NO_OBJECT 0xFFFFFFFF;NO_OBJECT

1 0x00005060 P60DOCK_TEST_TASK
147 0x73010002 PL_SUBSYSTEM
148 0x73010003 TCS_SUBSYSTEM
149 0x73010004 COM_SUBSYSTEM
150 0x73020001 MISC_TM_STORE
151 0x73020002 OK_TM_STORE
152 0x73020003 NOT_OK_TM_STORE
153 0x73020004 HK_TM_STORE
154 0x73030000 CFDP_TM_STORE
155 0x73500000 CCSDS_IP_CORE_BRIDGE
156 0x90000003 THERMAL_TEMP_INSERTER
157 0xFFFFFFFF NO_OBJECT

View File

@ -14,9 +14,6 @@ from tmtccmd.tc.decorator import (
route_to_registered_service_handlers, route_to_registered_service_handlers,
ServiceProviderParams, ServiceProviderParams,
) )
from tmtccmd.tc.pus_5_event import (
pack_generic_service_5_test_into,
)
from eive_tmtc.tmtc.misc.s200_test import pack_service_200_test_into from eive_tmtc.tmtc.misc.s200_test import pack_service_200_test_into
from eive_tmtc.tmtc.power.p60dock import pack_p60dock_cmds from eive_tmtc.tmtc.power.p60dock import pack_p60dock_cmds
@ -83,8 +80,6 @@ def handle_default_procedure(
service = info.service service = info.service
op_code = info.op_code op_code = info.op_code
obj_id_man = get_object_ids() obj_id_man = get_object_ids()
if service == CoreServiceList.SERVICE_5.value:
return pack_generic_service_5_test_into(q=queue_helper)
if service == CoreServiceList.SERVICE_200.value: if service == CoreServiceList.SERVICE_200.value:
return pack_service_200_test_into(q=queue_helper) return pack_service_200_test_into(q=queue_helper)
if service == CustomServiceList.P60DOCK.value: if service == CustomServiceList.P60DOCK.value:

View File

@ -1,5 +1,14 @@
import logging
import struct import struct
from eive_tmtc.config.object_ids import (
HK_TM_STORE,
MISC_TM_STORE,
OK_TM_STORE,
NOT_OK_TM_STORE,
CFDP_TM_STORE,
get_object_ids,
)
from eive_tmtc.config.definitions import CustomServiceList from eive_tmtc.config.definitions import CustomServiceList
from tmtccmd.config import TmtcDefinitionWrapper from tmtccmd.config import TmtcDefinitionWrapper
from tmtccmd.config.tmtc import tmtc_definitions_provider, OpCodeEntry from tmtccmd.config.tmtc import tmtc_definitions_provider, OpCodeEntry
@ -7,6 +16,11 @@ from tmtccmd.tc import service_provider
from tmtccmd.tc.decorator import ServiceProviderParams from tmtccmd.tc.decorator import ServiceProviderParams
from dateutil.parser import parse from dateutil.parser import parse
from spacepackets.ecss import PusService
from spacepackets.ecss.tc import PusTelecommand
from spacepackets.ecss.pus_15_tm_storage import Subservice
from tmtccmd.util import ObjectIdU32
class OpCode: class OpCode:
DUMP = "dump" DUMP = "dump"
@ -18,28 +32,33 @@ class Info:
DELETE = "Delete Telemetry Packets" DELETE = "Delete Telemetry Packets"
_LOGGER = logging.getLogger(__name__)
@service_provider(CustomServiceList.TM_STORE) @service_provider(CustomServiceList.TM_STORE)
def pack_tm_store_commands(p: ServiceProviderParams): def pack_tm_store_commands(p: ServiceProviderParams):
q = p.queue_helper q = p.queue_helper
o = p.op_code o = p.op_code
if o == OpCode.DELETE: if o == OpCode.DELETE:
q.add_log_cmd(Info.DELETE) q.add_log_cmd(Info.DELETE)
delete_start_time = parse( delete_up_to_time = parse(
input( input(
"Please enter delete start time in UTC ISO format (YYYY-MM-DDThh:mm:ssZ" "Please enter delete end time in any format supported by dateutil.parser.parse\n"
"Recommended format: UTC ISO format YYYY-MM-DDThh:mm:ssZ: "
) )
) )
delete_end_time = parse( print(f"Parsed timestamp: {delete_up_to_time}")
input( end_stamp = delete_up_to_time.timestamp()
"Please enter delete end time in UTC ISO format (YYYY-MM-DDThh:mm:ssZ" obj_id = store_select_prompt()
) app_data = bytearray(obj_id.as_bytes)
)
start_stamp = delete_start_time.timestamp()
end_stamp = delete_end_time.timestamp()
app_data = bytearray(struct.pack("!I", start_stamp))
app_data.extend(struct.pack("!I", end_stamp)) app_data.extend(struct.pack("!I", end_stamp))
# q.add_pus_tc(
pass print(
PusTelecommand(
service=15, subservice=Subservice.DELETE_UP_TO, app_data=app_data
)
)
# )
elif o == OpCode.DUMP: elif o == OpCode.DUMP:
q.add_log_cmd(Info.DUMP) q.add_log_cmd(Info.DUMP)
pass pass
@ -53,3 +72,31 @@ def add_persistent_tm_store_cmd_defs(defs: TmtcDefinitionWrapper):
defs.add_service( defs.add_service(
CustomServiceList.TM_STORE, "Persistent TM Store", op_code_entry=oce CustomServiceList.TM_STORE, "Persistent TM Store", op_code_entry=oce
) )
STORE_DICT = {
OK_TM_STORE: "OK Store (Verification)",
NOT_OK_TM_STORE: "NOT OK Store (Events, Verification Failures..)",
MISC_TM_STORE: "Miscellaneous Store",
HK_TM_STORE: "HK TM Store",
CFDP_TM_STORE: "CFDP TM Store",
}
def store_select_prompt() -> ObjectIdU32:
obj_id_dict = get_object_ids()
print("Available TM stores:")
idx_to_obj_id = dict()
for idx, (k, v) in enumerate(STORE_DICT.items()):
idx_to_obj_id.update({idx: k})
print(f"{idx}: {v}")
while True:
target_index = int(
input("Please enter the target store for the TM store transaction: ")
)
obj_id_raw = idx_to_obj_id.get(target_index)
if obj_id_raw is None:
_LOGGER.warning("Invalid index. Try again")
continue
break
return obj_id_dict.get(obj_id_raw)