update to newer tmtccmd

This commit is contained in:
Robin Müller 2022-07-27 14:40:25 +02:00
parent 1f3e04bde4
commit 4a90841282
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814
7 changed files with 22 additions and 23 deletions

View File

@ -3,6 +3,8 @@ import sys
from tmtccmd.com_if import ComInterface
from tmtccmd.logging import get_current_time_string
from tmtccmd.util import FileSeqCountProvider, PusFileSeqCountProvider
from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
try:
import spacepackets
@ -29,17 +31,16 @@ from common_tmtc.pus_tc.service_3_housekeeping import pack_service_3_commands_in
from common_tmtc.pus_tc.service_8_func_cmd import pack_service_8_commands_into
from examples.tmtcc import EXAMPLE_APID
from tmtccmd import TcHandlerBase, get_console_logger, TmTcCfgHookBase, BackendBase
from tmtccmd.pus import VerificationWrapper, FileSeqCountProvider
from tmtccmd.pus import VerificationWrapper
from tmtccmd.tc import (
ProcedureHelper,
FeedWrapper,
TcProcedureType,
QueueEntryHelper,
TcQueueEntryType,
TcQueueEntryType, SendCbParams,
)
from tmtccmd.tc.pus_5_event import pack_generic_service_5_test_into
from tmtccmd.tm import SpecificApidHandlerBase, CcsdsTmHandler
from tmtccmd.utility.tmtc_printer import FsfwTmTcPrinter
from tmtccmd.logging.pus import RawTmtcTimedLogWrapper
from tmtccmd.config import CoreServiceList, SetupWrapper, SetupParams, ArgParserWrapper
from common_tmtc.config import __version__
@ -117,12 +118,12 @@ class TcHandler(TcHandlerBase):
)
LOGGER.warning("Invalid Service !")
def send_cb(self, entry_helper: QueueEntryHelper, com_if: ComInterface):
if entry_helper.is_tc:
if entry_helper.entry_type == TcQueueEntryType.PUS_TC:
pus_tc_wrapper = entry_helper.to_pus_tc_entry()
def send_cb(self, params: SendCbParams):
if params.entry.is_tc:
if params.entry.entry_type == TcQueueEntryType.PUS_TC:
pus_tc_wrapper = params.entry.to_pus_tc_entry()
pus_tc_wrapper.pus_tc.seq_count = (
self.seq_count_provider.next_seq_count()
self.seq_count_provider.get_and_increment()
)
pus_tc_wrapper.pus_tc.apid = EXAMPLE_APID
# Add TC after Sequence Count stamping
@ -134,7 +135,7 @@ class TcHandler(TcHandlerBase):
self.file_logger.info(
f"{get_current_time_string(True)}: {tc_info_string}"
)
com_if.send(raw_tc)
params.com_if.send(raw_tc)
def queue_finished_cb(self, info: ProcedureHelper):
if info is not None and info.proc_type == TcQueueEntryType.PUS_TC:
@ -174,7 +175,7 @@ def setup_tmtc_handlers(
file_logger=printer.file_logger,
raw_logger=raw_logger,
pus_verificator=verif_wrapper.pus_verificator,
seq_count_provider=FileSeqCountProvider(),
seq_count_provider=PusFileSeqCountProvider(),
)
return ccsds_handler, tc_handler

View File

@ -4,7 +4,7 @@ from typing import Optional
from tmtccmd import BackendBase
from tmtccmd.com_if import ComInterface
from tmtccmd.config import TmTcCfgHookBase, TmTcDefWrapper, default_json_path
from tmtccmd.utility import ObjectIdDictT, RetvalDictT
from tmtccmd.util import ObjectIdDictT, RetvalDictT
class CommonFsfwHookBase(TmTcCfgHookBase):

View File

@ -7,7 +7,7 @@ import os
from tmtccmd.fsfw import parse_fsfw_objects_csv
from tmtccmd.logging import get_console_logger
from tmtccmd.utility.obj_id import ObjectIdDictT
from tmtccmd.util.obj_id import ObjectIdDictT
LOGGER = get_console_logger()
DEFAULT_OBJECTS_CSV_PATH = "config/objects.csv"

View File

@ -1,7 +1,7 @@
from tmtccmd.logging import get_console_logger
from tmtccmd.tm import Service8FsfwTm
from tmtccmd.utility.obj_id import ObjectIdDictT
from tmtccmd.utility.tmtc_printer import FsfwTmTcPrinter
from tmtccmd.util import ObjectIdDictT
from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
LOGGER = get_console_logger()

View File

@ -5,9 +5,8 @@ from common_tmtc.config.object_ids import get_object_ids
from tmtccmd.tm import Service5Tm
from tmtccmd.logging import get_console_logger
from tmtccmd.utility.tmtc_printer import FsfwTmTcPrinter
from tmtccmd.fsfw import parse_fsfw_events_csv, EventDictT, EventInfo
from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
LOGGER = get_console_logger()
DEFAULT_EVENTS_CSV_PATH = "config/events.csv"
@ -40,8 +39,8 @@ def handle_event_packet(
obj_ids = get_object_ids()
obj_id_obj = obj_ids.get(tm.reporter_id.as_bytes)
if obj_id_obj is None:
LOGGER.warning(f"Object ID 0x{tm.reporter_id.as_string} has no name")
obj_name = tm.reporter_id.as_string
LOGGER.warning(f"Object ID 0x{tm.reporter_id.name} has no name")
obj_name = tm.reporter_id.name
else:
obj_name = obj_id_obj.name
generic_event_string = (

View File

@ -5,7 +5,6 @@
"""
from spacepackets.ecss.tm import PusTelemetry
from spacepackets.util import PrintFormats
from spacepackets.ccsds.spacepacket import PacketTypes
from tmtccmd.logging.pus import RawTmtcTimedLogWrapper
from tmtccmd.pus import VerificationWrapper
@ -13,7 +12,6 @@ from tmtccmd.tm.pus_17_test import Service17TmExtended
from tmtccmd.tm.pus_2_rawcmd import Service2Tm
from tmtccmd.tm.pus_20_fsfw_parameters import Service20FsfwTm
from tmtccmd.tm.pus_200_fsfw_modes import Service200FsfwTm
from tmtccmd.utility.tmtc_printer import FsfwTmTcPrinter
from tmtccmd.logging import get_console_logger
from common_tmtc.config.object_ids import get_object_ids
@ -21,6 +19,7 @@ from common_tmtc.pus_tm.action_reply_handling import handle_action_reply
from common_tmtc.pus_tm.event_handler import handle_event_packet
from common_tmtc.pus_tm.verification_handler import handle_service_1_packet
from common_tmtc.pus_tm.hk_handling import handle_hk_packet
from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
LOGGER = get_console_logger()

View File

@ -5,11 +5,11 @@ from typing import Tuple
from tmtccmd.tm import Service3FsfwTm
from tmtccmd.tm.pus_3_hk_base import HkContentType, Service3Base
from tmtccmd.utility.obj_id import ObjectIdDictT, ObjectId
from tmtccmd.utility.tmtc_printer import FsfwTmTcPrinter
from tmtccmd.logging import get_console_logger
from common_tmtc.config.object_ids import TEST_DEVICE_0_ID, TEST_DEVICE_1_ID
from tmtccmd.util import ObjectIdDictT, ObjectIdU32
from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
LOGGER = get_console_logger()
@ -43,7 +43,7 @@ def handle_hk_packet(
def handle_regular_hk_print(
printer: FsfwTmTcPrinter,
object_id: ObjectId,
object_id: ObjectIdU32,
hk_packet: Service3Base,
hk_data: bytes,
):