update to newer tmtccmd
This commit is contained in:
21
common.py
21
common.py
@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user