New SCEX commands #103

Merged
muellerr merged 21 commits from irini into main 2022-07-13 15:34:00 +02:00
40 changed files with 56 additions and 50 deletions
Showing only changes of commit 87d539d46e - Show all commits

View File

@ -4,11 +4,10 @@ from config.definitions import SPACE_PACKET_IDS
from tmtccmd import TmTcCfgHookBase, CcsdsTmtcBackend
from tmtccmd.com_if import ComInterface
from tmtccmd.config import TmTcDefWrapper
from tmtccmd.utility.retval import RetvalDictT
from tmtccmd.utility.obj_id import ObjectIdDictT
from config.retvals import get_retval_dict
from pus_tc.cmd_definitions import get_eive_service_op_code_dict
from tmtccmd.util import ObjectIdDictT, RetvalDictT
class EiveHookObject(TmTcCfgHookBase):

View File

@ -4,7 +4,7 @@
it to your needs.
"""
import os.path
from tmtccmd.utility.obj_id import ObjectIdDictT
from tmtccmd.util.obj_id import ObjectIdDictT
from tmtccmd.fsfw import parse_fsfw_objects_csv
from tmtccmd.logging import get_console_logger

2
deps/spacepackets vendored

@ -1 +1 @@
Subproject commit 5317f4c384321b5b5d8832f51c530fa91d3b2ae5
Subproject commit 3618d98a43fe9e4b76948f221e6f2142dfc8d225

2
deps/tmtccmd vendored

@ -1 +1 @@
Subproject commit 02b30ad935cc35a4f2de6844fea84fd29e680eec
Subproject commit b0dde5e6907a56055a5a88039bfa718744c455bc

View File

@ -12,7 +12,7 @@ from typing import Union
from spacepackets.ecss import PusTelecommand
from tmtccmd.tc.pus_8_funccmd import generate_action_command
from tmtccmd.utility import ObjectIdU32
from tmtccmd.util import ObjectIdU32
class GomspaceDeviceActionIds(enum.IntEnum):

View File

@ -20,7 +20,7 @@ from gomspace.gomspace_common import Info as GsInfo
from config.object_ids import ACU_HANDLER_ID
from pus_tc.devs.p60dock import P60DockConfigTable
from tmtccmd.tc.pus_8_funccmd import generate_action_command
from tmtccmd.utility import ObjectIdU32
from tmtccmd.util import ObjectIdU32
class ACUConfigTable:

View File

@ -9,7 +9,7 @@ import struct
from spacepackets.ecss.tc import PusTelecommand
from tmtccmd.tc import QueueHelper
from tmtccmd.utility import ObjectIdU32
from tmtccmd.util import ObjectIdU32
class CommandIds:

View File

@ -9,7 +9,7 @@ from config.definitions import CustomServiceList
from config.object_ids import get_object_ids
from tmtccmd.config import TmTcDefWrapper, OpCodeEntry
from tmtccmd.tc import QueueHelper
from tmtccmd.utility.obj_id import ObjectIdU32
from tmtccmd.util.obj_id import ObjectIdU32
from tmtccmd.tc.pus_201_fsfw_health import (
pack_set_health_cmd_data,
FsfwHealth,

View File

@ -15,7 +15,7 @@ from tmtccmd.tc.pus_3_fsfw_hk import (
generate_one_hk_command,
)
from tmtccmd.tc.pus_200_fsfw_modes import pack_mode_data, Modes
from tmtccmd.utility import ObjectIdU32
from tmtccmd.util import ObjectIdU32
class ImtqSetIds:

View File

@ -10,7 +10,7 @@ import struct
from spacepackets.ecss.tc import PusTelecommand
from tmtccmd.tc import QueueHelper
from tmtccmd.utility import ObjectIdU32
from tmtccmd.util import ObjectIdU32
class ActionIds:

View File

@ -12,7 +12,7 @@ import enum
from tmtccmd.logging import get_console_logger
from spacepackets.ecss.tc import PusTelecommand
from tmtccmd.tc import QueueHelper
from tmtccmd.utility import ObjectIdU32
from tmtccmd.util import ObjectIdU32
from utility.input_helper import InputHelper
from tmtccmd.tc.pus_200_fsfw_modes import pack_mode_data, Modes

View File

@ -12,7 +12,7 @@ from spacepackets.ecss.tc import PusTelecommand
from tmtccmd.logging import get_console_logger
from tmtccmd.tc import QueueHelper
from tmtccmd.tc.pus_200_fsfw_modes import pack_mode_data, Modes
from tmtccmd.utility import ObjectIdU32
from tmtccmd.util import ObjectIdU32
from utility.input_helper import InputHelper
LOGGER = get_console_logger()

View File

@ -14,7 +14,7 @@ from pus_tc.service_200_mode import pack_mode_data, Modes
from tmtccmd.config import TmTcDefWrapper, OpCodeEntry
from tmtccmd.tc import QueueHelper
from tmtccmd.tc.pus_3_fsfw_hk import generate_one_hk_command, make_sid
from tmtccmd.utility import ObjectIdU32
from tmtccmd.util import ObjectIdU32
class SetIds:

View File

@ -6,7 +6,7 @@ from spacepackets.ecss import PusTelecommand
from tmtccmd.config import TmTcDefWrapper, OpCodeEntry
from tmtccmd.tc import QueueHelper
from tmtccmd.utility import ObjectIdU32
from tmtccmd.util import ObjectIdU32
from tmtccmd.tc.pus_200_fsfw_modes import Modes, pack_mode_data, Subservices
import config.object_ids as oids
from config.object_ids import get_object_ids

View File

@ -12,7 +12,7 @@ from tmtccmd.tc.pus_200_fsfw_modes import pack_mode_data, Modes
from tmtccmd.logging import get_console_logger
from tmtccmd.tc import QueueHelper
from tmtccmd.utility import ObjectIdU32
from tmtccmd.util import ObjectIdU32
from utility.input_helper import InputHelper

View File

@ -12,7 +12,7 @@ import struct
from spacepackets.ecss.tc import PusTelecommand
from tmtccmd.tc import QueueHelper
from tmtccmd.utility import ObjectIdU32
from tmtccmd.util import ObjectIdU32
class Commands:

View File

@ -11,7 +11,7 @@ from spacepackets.ecss.tc import PusTelecommand
from tmtccmd.tc.pus_200_fsfw_modes import pack_mode_data, Modes
import struct
from tmtccmd.utility import ObjectIdU32
from tmtccmd.util import ObjectIdU32
class SetIds:

View File

@ -9,7 +9,7 @@ from spacepackets.ecss.tc import PusTelecommand
from pus_tc.service_200_mode import pack_mode_data
from tmtccmd.tc import QueueHelper
from tmtccmd.tc.pus_200_fsfw_modes import Modes
from tmtccmd.utility import ObjectIdU32
from tmtccmd.util import ObjectIdU32
class Tmp1075TestProcedure:

View File

@ -5,7 +5,6 @@ from typing import cast
from pus_tc.devs.rtd import pack_rtd_commands
from pus_tc.devs.scex import pack_scex_cmds
from pus_tc.system.controllers import pack_cmd_ctrl_to_prompted_mode, get_object_from_op_code
from tmtccmd.utility import ObjectIdU32
from tmtccmd import DefaultProcedureInfo
from tmtccmd.config import CoreServiceList
from tmtccmd.logging import get_console_logger
@ -69,6 +68,7 @@ from config.object_ids import (
get_object_ids,
)
import config.object_ids as oids
from tmtccmd.util import ObjectIdU32
LOGGER = get_console_logger()

View File

@ -1,6 +1,6 @@
from tmtccmd.tc import QueueHelper
from tmtccmd.tc.pus_200_fsfw_modes import Modes
from tmtccmd.utility import ObjectIdU32
from tmtccmd.util import ObjectIdU32
from .common import command_mode
import config.object_ids as obj_ids

View File

@ -7,7 +7,7 @@ from pus_tc.devs.star_tracker import StarTrackerActionIds
from gomspace.gomspace_common import GomspaceDeviceActionIds
from tmtccmd.logging import get_console_logger
from tmtccmd.tm import Service8FsfwTm
from tmtccmd.utility.tmtc_printer import FsfwTmTcPrinter
from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
LOGGER = get_console_logger()

View File

@ -1,4 +1,4 @@
from tmtccmd.utility.tmtc_printer import FsfwTmTcPrinter
from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
class PrintWrapper:

View File

@ -2,7 +2,7 @@ import struct
from pus_tc.devs.bpx_batt import BpxSetIds
from pus_tm.defs import PrintWrapper
from tmtccmd.utility.tmtc_printer import FsfwTmTcPrinter
from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
def handle_bpx_hk_data(printer: FsfwTmTcPrinter, set_id: int, hk_data: bytes):

View File

@ -1,7 +1,7 @@
import struct
from pus_tm.defs import PrintWrapper
from tmtccmd.utility.tmtc_printer import FsfwTmTcPrinter
from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
def handle_gps_data(printer: FsfwTmTcPrinter, hk_data: bytes):

View File

@ -1,8 +1,8 @@
import struct
from pus_tm.defs import PrintWrapper
from tmtccmd.utility import ObjectIdU32
from tmtccmd.utility.tmtc_printer import FsfwTmTcPrinter
from tmtccmd.util import ObjectIdU32
from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
from pus_tc.devs.gyros import L3gGyroSetIds, AdisGyroSetIds
import config.object_ids as obj_ids

View File

@ -1,7 +1,7 @@
import struct
from pus_tm.defs import PrintWrapper
from tmtccmd.utility.tmtc_printer import FsfwTmTcPrinter
from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
def handle_eng_set(printer: FsfwTmTcPrinter, hk_data: bytes):

View File

@ -2,8 +2,8 @@ import struct
from pus_tm.defs import PrintWrapper
from pus_tc.devs.mgms import MgmRm3100SetIds, MgmLis3SetIds
from tmtccmd.utility import ObjectIdU32
from tmtccmd.utility.tmtc_printer import FsfwTmTcPrinter
from tmtccmd.util import ObjectIdU32
from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
import config.object_ids as obj_ids

View File

@ -1,7 +1,7 @@
import struct
from typing import List, Tuple
from tmtccmd.utility.tmtc_printer import FsfwTmTcPrinter
from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
from pus_tm.defs import PrintWrapper
from gomspace.gomspace_common import SetIds

View File

@ -1,7 +1,7 @@
import struct
from pus_tm.defs import PrintWrapper
from tmtccmd.utility.tmtc_printer import FsfwTmTcPrinter
from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
from pus_tc.devs.plpcdu import SetIds

View File

@ -1,7 +1,7 @@
import struct
from pus_tm.defs import PrintWrapper
from tmtccmd.utility.tmtc_printer import FsfwTmTcPrinter
from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
from pus_tc.devs.rad_sensor import SetIds

View File

@ -1,7 +1,7 @@
import struct
from pus_tm.defs import PrintWrapper, FsfwTmTcPrinter
from tmtccmd.utility.obj_id import ObjectIdU32
from tmtccmd.util.obj_id import ObjectIdU32
def handle_rw_hk_data(

View File

@ -2,8 +2,8 @@ import struct
from pus_tm.defs import PrintWrapper
from pus_tc.devs.sus import SetIds
from tmtccmd.utility import ObjectIdU32
from tmtccmd.utility.tmtc_printer import FsfwTmTcPrinter
from tmtccmd.util import ObjectIdU32
from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
def handle_sus_hk(

View File

@ -2,7 +2,7 @@ import struct
from pus_tm.defs import PrintWrapper
from pus_tc.devs.syrlinks_hk_handler import SetIds
from tmtccmd.utility.tmtc_printer import FsfwTmTcPrinter
from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
def handle_syrlinks_hk_data(printer: FsfwTmTcPrinter, set_id: int, hk_data: bytes):

View File

@ -5,7 +5,7 @@ from 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.util.tmtc_printer import FsfwTmTcPrinter
from tmtccmd.fsfw import parse_fsfw_events_csv, EventDictT, EventInfo

View File

@ -8,7 +8,7 @@ from tmtccmd.logging.pus import RawTmtcTimedLogWrapper
from tmtccmd.pus import VerificationWrapper
from tmtccmd.tm import Service20FsfwTm, Service200FsfwTm
from tmtccmd.tm.pus_17_test import Service17TmExtended
from tmtccmd.utility.tmtc_printer import FsfwTmTcPrinter
from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
from .event_handler import handle_event_packet
from .verification_handler import handle_service_1_packet

View File

@ -9,7 +9,7 @@ from tmtccmd.tm.pus_3_fsfw_hk import (
HkContentType,
Service3FsfwTm,
)
from tmtccmd.utility.obj_id import ObjectIdU32, ObjectIdDictT
from tmtccmd.util.obj_id import ObjectIdU32, ObjectIdDictT
from tmtccmd.logging import get_console_logger
from pus_tm.devs.bpx_bat import handle_bpx_hk_data

View File

@ -2,7 +2,7 @@ import struct
from pus_tm.defs import PrintWrapper
from pus_tc.system.core import SetIds
from tmtccmd.utility.tmtc_printer import FsfwTmTcPrinter
from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
def handle_core_hk_data(printer: FsfwTmTcPrinter, set_id: int, hk_data: bytes):

View File

@ -3,8 +3,8 @@ import struct
from pus_tm.defs import PrintWrapper
from pus_tm.tcp_server_objects import *
from tmtccmd.utility import ObjectIdU32
from tmtccmd.utility.tmtc_printer import FsfwTmTcPrinter
from tmtccmd.util import ObjectIdU32
from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
class SetIds(enum.IntEnum):

View File

@ -4,7 +4,7 @@ import json
import base64
from tmtccmd.logging import get_console_logger
from tmtccmd.utility.obj_id import ObjectIdU32
from tmtccmd.util.obj_id import ObjectIdU32
from dle_encoder import DleEncoder
LOGGER = get_console_logger()

View File

@ -4,6 +4,9 @@ import sys
import time
import traceback
from tmtccmd.util import FileSeqCountProvider, PusFileSeqCountProvider
from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
try:
import spacepackets
except ImportError as error:
@ -35,10 +38,8 @@ from tmtccmd.logging.pus import (
)
from tmtccmd.pus import VerificationWrapper
from tmtccmd.tm import SpecificApidHandlerBase, GenericApidHandlerBase, CcsdsTmHandler
from tmtccmd.utility.tmtc_printer import FsfwTmTcPrinter
from tmtccmd.core import BackendRequest
from tmtccmd.logging import get_current_time_string
from tmtccmd.pus import FileSeqCountProvider
from tmtccmd.tc import (
ProcedureHelper,
FeedWrapper,
@ -88,23 +89,25 @@ class TcHandler(TcHandlerBase):
pus_verificator: PusVerificator,
file_logger: logging.Logger,
raw_logger: RawTmtcTimedLogWrapper,
gui: bool
):
super().__init__()
self.seq_count_provider = seq_count_provider
self.pus_verificator = pus_verificator
self.file_logger = file_logger
self.raw_logger = raw_logger
self.gui = gui
def feed_cb(self, info: ProcedureHelper, wrapper: FeedWrapper):
if info.proc_type == TcProcedureType.DEFAULT:
handle_default_procedure(info.to_def_procedure(), wrapper)
handle_default_procedure(info.to_def_procedure(), wrapper, self.gui)
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()
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 = PUS_APID
# Add TC after Sequence Count stamping
@ -148,17 +151,19 @@ def setup_tmtc(
verificator: PusVerificator,
printer: FsfwTmTcPrinter,
raw_logger: RawTmtcTimedLogWrapper,
gui: bool
) -> (CcsdsTmHandler, TcHandler):
verification_wrapper = VerificationWrapper(verificator, LOGGER, printer.file_logger)
pus_handler = PusHandler(verification_wrapper, printer, raw_logger)
ccsds_handler = CcsdsTmHandler(generic_handler=UnknownApidHandler(None))
ccsds_handler.add_apid_handler(pus_handler)
seq_count_provider = FileSeqCountProvider()
seq_count_provider = PusFileSeqCountProvider()
tc_handler = TcHandler(
seq_count_provider=seq_count_provider,
pus_verificator=verificator,
file_logger=printer.file_logger,
raw_logger=raw_logger,
gui=gui
)
return ccsds_handler, tc_handler
@ -185,7 +190,9 @@ def main():
printer = FsfwTmTcPrinter(tmtc_logger.logger)
raw_logger = RawTmtcTimedLogWrapper(when=TimedLogWhen.PER_HOUR, interval=2)
pus_verificator = PusVerificator()
ccsds_handler, tc_handler = setup_tmtc(pus_verificator, printer, raw_logger)
ccsds_handler, tc_handler = setup_tmtc(
pus_verificator, printer, raw_logger, setup_wrapper.params.use_gui
)
tmtccmd.setup(setup_wrapper)
tmtc_backend = setup_backend(