smaller tweaks
This commit is contained in:
parent
aabfcf83ac
commit
d97eb7334b
@ -18,7 +18,7 @@ from tmtccmd.tc import service_provider
|
||||
from tmtccmd.tc.decorator import ServiceProviderParams
|
||||
from dateutil.parser import parse
|
||||
|
||||
from spacepackets.ecss import PusService
|
||||
from spacepackets.ecss import PusService # noqa
|
||||
from spacepackets.ecss.tc import PusTelecommand
|
||||
from spacepackets.ecss.pus_15_tm_storage import Subservice
|
||||
from tmtccmd.util import ObjectIdU32
|
||||
@ -26,12 +26,12 @@ from tmtccmd.util import ObjectIdU32
|
||||
|
||||
class OpCode:
|
||||
DUMP = "dump"
|
||||
DELETE = "delete"
|
||||
DELETE_UP_TO = "delete_up_to"
|
||||
|
||||
|
||||
class Info:
|
||||
DUMP = "Dump Telemetry Packets"
|
||||
DELETE = "Delete Telemetry Packets"
|
||||
DELETE_UP_TO = "Delete Telemetry Packets"
|
||||
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
@ -41,13 +41,13 @@ _LOGGER = logging.getLogger(__name__)
|
||||
def pack_tm_store_commands(p: ServiceProviderParams):
|
||||
q = p.queue_helper
|
||||
o = p.op_code
|
||||
if o == OpCode.DELETE:
|
||||
if o == OpCode.DELETE_UP_TO:
|
||||
obj_id, store_string = store_select_prompt()
|
||||
app_data = bytearray(obj_id.as_bytes)
|
||||
delete_up_to_time = time_prompt()
|
||||
end_stamp = int(math.floor(delete_up_to_time.timestamp()))
|
||||
app_data.extend(struct.pack("!I", end_stamp))
|
||||
q.add_log_cmd(Info.DELETE)
|
||||
q.add_log_cmd(Info.DELETE_UP_TO)
|
||||
q.add_log_cmd(f"Selected Store: {obj_id}")
|
||||
q.add_log_cmd(f"Deletion up to time {delete_up_to_time}")
|
||||
print(
|
||||
@ -64,7 +64,7 @@ def pack_tm_store_commands(p: ServiceProviderParams):
|
||||
@tmtc_definitions_provider
|
||||
def add_persistent_tm_store_cmd_defs(defs: TmtcDefinitionWrapper):
|
||||
oce = OpCodeEntry()
|
||||
oce.add(keys=OpCode.DELETE, info=Info.DELETE)
|
||||
oce.add(keys=OpCode.DELETE_UP_TO, info=Info.DELETE_UP_TO)
|
||||
oce.add(keys=OpCode.DUMP, info=Info.DUMP)
|
||||
defs.add_service(
|
||||
CustomServiceList.TM_STORE, "Persistent TM Store", op_code_entry=oce
|
||||
|
Loading…
Reference in New Issue
Block a user