Merge pull request 'TMTC Update' (#25) from mueller/tmtc-update into develop

Reviewed-on: #25
This commit is contained in:
Jakob Meier 2021-10-06 17:48:49 +02:00
commit 1a17658288
25 changed files with 71 additions and 26 deletions

3
.gitmodules vendored
View File

@ -2,3 +2,6 @@
path = tmtccmd path = tmtccmd
url = https://github.com/robamu-org/tmtccmd.git url = https://github.com/robamu-org/tmtccmd.git
[submodule "spacepackets"]
path = spacepackets
url = https://github.com/robamu-org/py-spacepackets.git

View File

@ -0,0 +1,18 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Unittests in spacepackets" type="tests" factoryName="Unittests">
<module name="tmtc" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/spacepackets/tests" />
<option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="_new_pattern" value="&quot;&quot;" />
<option name="_new_additionalArguments" value="&quot;&quot;" />
<option name="_new_target" value="&quot;$PROJECT_DIR$/spacepackets/tests&quot;" />
<option name="_new_targetType" value="&quot;PATH&quot;" />
<method v="2" />
</configuration>
</component>

View File

@ -0,0 +1,18 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Unittests in tmtccmd" type="tests" factoryName="Unittests">
<module name="tmtc" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/tmtccmd/src" />
<option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="_new_pattern" value="&quot;&quot;" />
<option name="_new_additionalArguments" value="&quot;&quot;" />
<option name="_new_target" value="&quot;$PROJECT_DIR$/tmtccmd/src/tests&quot;" />
<option name="_new_targetType" value="&quot;PATH&quot;" />
<method v="2" />
</configuration>
</component>

View File

@ -3,7 +3,7 @@
@details Template configuration file. Copy this folder to the TMTC commander root and adapt @details Template configuration file. Copy this folder to the TMTC commander root and adapt
it to your needs. it to your needs.
""" """
from tmtccmd.ecss.tc import PusTelecommand from spacepackets.ecss.tc import PusTelecommand
def command_preparation_hook() -> PusTelecommand: def command_preparation_hook() -> PusTelecommand:

View File

@ -26,7 +26,7 @@ class CustomGlobalIds(enum.Enum):
def set_globals_pre_args_parsing(gui: bool = False): def set_globals_pre_args_parsing(gui: bool = False):
set_default_globals_pre_args_parsing( set_default_globals_pre_args_parsing(
gui=gui, apid=PUS_APID, com_if_id=CoreComInterfaces.TCPIP_UDP.value) gui=gui, tc_apid=PUS_APID, tm_apid=PUS_APID, com_if_id=CoreComInterfaces.TCPIP_UDP.value)
def add_globals_post_args_parsing(args: argparse.Namespace, json_cfg_path: str): def add_globals_post_args_parsing(args: argparse.Namespace, json_cfg_path: str):

View File

@ -44,7 +44,7 @@ class EiveHookObject(TmTcHookBase):
from tmtccmd.config.com_if import create_communication_interface_default from tmtccmd.config.com_if import create_communication_interface_default
return create_communication_interface_default( return create_communication_interface_default(
com_if_key=com_if_key, tmtc_printer=tmtc_printer, com_if_key=com_if_key, tmtc_printer=tmtc_printer,
json_cfg_path=self.get_json_config_file_path(), space_packet_id=0x0865 json_cfg_path=self.get_json_config_file_path(), space_packet_ids=(0x0865,)
) )
def perform_mode_operation(self, tmtc_backend: TmTcHandler, mode: int): def perform_mode_operation(self, tmtc_backend: TmTcHandler, mode: int):

View File

@ -1,6 +1,7 @@
import enum import enum
from tmtccmd.tc.definitions import TcQueueT from tmtccmd.tc.definitions import TcQueueT
from tmtccmd.pus.service_list import PusServices from spacepackets.ecss.definitions import PusServices
from tmtccmd.tc.service_200_mode import pack_mode_data, Modes from tmtccmd.tc.service_200_mode import pack_mode_data, Modes
from tmtccmd.tc.packer import PusTelecommand from tmtccmd.tc.packer import PusTelecommand
from config.object_ids import MGM_0_HANDLER_ID, MGM_1_HANDLER_ID, MGM_2_HANDLER_ID, MGM_3_HANDLER_ID from config.object_ids import MGM_0_HANDLER_ID, MGM_1_HANDLER_ID, MGM_2_HANDLER_ID, MGM_3_HANDLER_ID

View File

@ -7,7 +7,7 @@
""" """
from tmtccmd.config.definitions import QueueCommands from tmtccmd.config.definitions import QueueCommands
from tmtccmd.tc.packer import TcQueueT from tmtccmd.tc.packer import TcQueueT
from tmtccmd.ecss.tc import PusTelecommand from spacepackets.ecss.tc import PusTelecommand
class SwitchNumbers: class SwitchNumbers:

View File

@ -8,7 +8,7 @@
from tmtccmd.config.definitions import QueueCommands from tmtccmd.config.definitions import QueueCommands
from tmtccmd.tc.packer import TcQueueT from tmtccmd.tc.packer import TcQueueT
from tmtccmd.ecss.tc import PusTelecommand from spacepackets.ecss.tc import PusTelecommand
from tmtccmd.tc.service_3_housekeeping import make_sid, generate_one_hk_command from tmtccmd.tc.service_3_housekeeping import make_sid, generate_one_hk_command

View File

@ -7,7 +7,7 @@ import enum
from tmtccmd.config.definitions import QueueCommands from tmtccmd.config.definitions import QueueCommands
from tmtccmd.tc.packer import TcQueueT from tmtccmd.tc.packer import TcQueueT
from tmtccmd.ecss.tc import PusTelecommand from spacepackets.ecss.tc import PusTelecommand
from gomspace.gomspace_common import * from gomspace.gomspace_common import *
from pus_tc.p60dock import P60DockConfigTable from pus_tc.p60dock import P60DockConfigTable
from gomspace.gomspace_pdu_definitions import * from gomspace.gomspace_pdu_definitions import *

View File

@ -11,7 +11,7 @@ import struct
from tmtccmd.config.definitions import QueueCommands from tmtccmd.config.definitions import QueueCommands
from tmtccmd.tc.packer import TcQueueT from tmtccmd.tc.packer import TcQueueT
from tmtccmd.ecss.tc import PusTelecommand from spacepackets.ecss.tc import PusTelecommand
class ActionIds: class ActionIds:

View File

@ -11,7 +11,7 @@ import struct
from tmtccmd.config.definitions import QueueCommands from tmtccmd.config.definitions import QueueCommands
from tmtccmd.tc.packer import TcQueueT from tmtccmd.tc.packer import TcQueueT
from tmtccmd.ecss.tc import PusTelecommand from spacepackets.ecss.tc import PusTelecommand
class PlocTestProcedure: class PlocTestProcedure:

View File

@ -11,7 +11,7 @@ import struct
from tmtccmd.config.definitions import QueueCommands from tmtccmd.config.definitions import QueueCommands
from tmtccmd.tc.packer import TcQueueT from tmtccmd.tc.packer import TcQueueT
from tmtccmd.ecss.tc import PusTelecommand from spacepackets.ecss.tc import PusTelecommand
from tmtccmd.utility.logger import get_console_logger from tmtccmd.utility.logger import get_console_logger
LOGGER = get_console_logger() LOGGER = get_console_logger()

View File

@ -12,7 +12,7 @@ import struct
from tmtccmd.config.definitions import QueueCommands from tmtccmd.config.definitions import QueueCommands
from tmtccmd.tc.packer import TcQueueT from tmtccmd.tc.packer import TcQueueT
from tmtccmd.ecss.tc import PusTelecommand from spacepackets.ecss.tc import PusTelecommand
latchup_id_dict = { latchup_id_dict = {

View File

@ -9,7 +9,7 @@ import struct
from tmtccmd.config.definitions import QueueCommands from tmtccmd.config.definitions import QueueCommands
from tmtccmd.tc.packer import TcQueueT from tmtccmd.tc.packer import TcQueueT
from tmtccmd.ecss.tc import PusTelecommand from spacepackets.ecss.tc import PusTelecommand
from pus_tc.service_200_mode import pack_mode_data from pus_tc.service_200_mode import pack_mode_data

View File

@ -9,7 +9,7 @@ import struct
from tmtccmd.config.definitions import QueueCommands from tmtccmd.config.definitions import QueueCommands
from tmtccmd.tc.packer import TcQueueT from tmtccmd.tc.packer import TcQueueT
from tmtccmd.ecss.tc import PusTelecommand from spacepackets.ecss.tc import PusTelecommand
from pus_tc.service_200_mode import pack_mode_data from pus_tc.service_200_mode import pack_mode_data

View File

@ -6,7 +6,7 @@
@date 02.05.2020 @date 02.05.2020
""" """
from tmtccmd.config.definitions import QueueCommands from tmtccmd.config.definitions import QueueCommands
from tmtccmd.ecss.tc import PusTelecommand from spacepackets.ecss.tc import PusTelecommand
from tmtccmd.tc.packer import TcQueueT from tmtccmd.tc.packer import TcQueueT
from tmtccmd.tc.service_200_mode import pack_mode_data from tmtccmd.tc.service_200_mode import pack_mode_data
from config.object_ids import TEST_DEVICE_ID from config.object_ids import TEST_DEVICE_ID

View File

@ -10,7 +10,7 @@ import struct
from tmtccmd.config.definitions import QueueCommands from tmtccmd.config.definitions import QueueCommands
from tmtccmd.tc.packer import TcQueueT from tmtccmd.tc.packer import TcQueueT
from tmtccmd.ecss.tc import PusTelecommand from spacepackets.ecss.tc import PusTelecommand
class StarTrackerActionIds: class StarTrackerActionIds:

View File

@ -8,7 +8,7 @@ from tmtccmd.config.definitions import CoreServiceList
from tmtccmd.utility.logger import get_console_logger from tmtccmd.utility.logger import get_console_logger
from tmtccmd.tc.definitions import TcQueueT from tmtccmd.tc.definitions import TcQueueT
from tmtccmd.tc.service_5_event import pack_generic_service5_test_into from tmtccmd.tc.service_5_event import pack_generic_service5_test_into
from tmtccmd.tc.service_17_test import pack_service17_ping_command from tmtccmd.pus.service_17_test import pack_service_17_ping_command
from pus_tc.service_200_mode import pack_service200_test_into from pus_tc.service_200_mode import pack_service200_test_into
from pus_tc.p60dock import pack_p60dock_test_into from pus_tc.p60dock import pack_p60dock_test_into
@ -42,7 +42,7 @@ def pack_service_queue_user(service: Union[str, int], op_code: str, service_queu
if service == CoreServiceList.SERVICE_5.value: if service == CoreServiceList.SERVICE_5.value:
return pack_generic_service5_test_into(tc_queue=service_queue) return pack_generic_service5_test_into(tc_queue=service_queue)
if service == CoreServiceList.SERVICE_17.value: if service == CoreServiceList.SERVICE_17.value:
return service_queue.appendleft(pack_service17_ping_command(ssc=1700).pack_command_tuple()) return service_queue.appendleft(pack_service_17_ping_command(ssc=1700).pack_command_tuple())
if service == CoreServiceList.SERVICE_200.value: if service == CoreServiceList.SERVICE_200.value:
return pack_service200_test_into(tc_queue=service_queue) return pack_service200_test_into(tc_queue=service_queue)
if service == CustomServiceList.P60DOCK.value: if service == CustomServiceList.P60DOCK.value:
@ -125,5 +125,5 @@ def create_total_tc_queue_user() -> TcQueueT:
os.mkdir("log") os.mkdir("log")
tc_queue = deque() tc_queue = deque()
pack_generic_service5_test_into(tc_queue) pack_generic_service5_test_into(tc_queue)
tc_queue.appendleft(pack_service17_ping_command(ssc=1700).pack_command_tuple()) tc_queue.appendleft(pack_service_17_ping_command(ssc=1700).pack_command_tuple())
return tc_queue return tc_queue

View File

@ -8,7 +8,7 @@
from tmtccmd.config.definitions import QueueCommands from tmtccmd.config.definitions import QueueCommands
from tmtccmd.tc.packer import TcQueueT from tmtccmd.tc.packer import TcQueueT
from tmtccmd.ecss.tc import PusTelecommand from spacepackets.ecss.tc import PusTelecommand
from pus_tc.service_200_mode import pack_mode_data from pus_tc.service_200_mode import pack_mode_data

View File

@ -4,13 +4,13 @@
it to your needs. it to your needs.
""" """
from tmtccmd.tm.service_8_functional_cmd import Service8TM from tmtccmd.tm.service_8_functional_cmd import Service8TM
from tmtccmd.ecss.tm import PusTelemetry from spacepackets.ecss.tm import PusTelemetry
from tmtccmd.utility.logger import get_console_logger from tmtccmd.utility.logger import get_console_logger
from tmtccmd.tm.service_1_verification import Service1TM from tmtccmd.pus.service_1_verification import Service1TMExtended
from tmtccmd.pus.service_17_test import Service17TMExtended
from tmtccmd.tm.service_3_housekeeping import Service3TM from tmtccmd.tm.service_3_housekeeping import Service3TM
from tmtccmd.tm.service_5_event import Service5TM from tmtccmd.tm.service_5_event import Service5TM
from tmtccmd.tm.service_17_test import Service17TM
from tmtccmd.utility.tmtc_printer import TmTcPrinter from tmtccmd.utility.tmtc_printer import TmTcPrinter
from config.definitions import PUS_APID from config.definitions import PUS_APID
@ -27,7 +27,7 @@ def pus_factory_hook(raw_tm_packet: bytearray, tmtc_printer: TmTcPrinter):
service_type = raw_tm_packet[7] service_type = raw_tm_packet[7]
tm_packet = None tm_packet = None
if service_type == 1: if service_type == 1:
tm_packet = Service1TM.unpack(raw_telemetry=raw_tm_packet) tm_packet = Service1TMExtended.unpack(raw_telemetry=raw_tm_packet)
if service_type == 3: if service_type == 3:
tm_packet = Service3TM.unpack(raw_telemetry=raw_tm_packet, custom_hk_handling=False) tm_packet = Service3TM.unpack(raw_telemetry=raw_tm_packet, custom_hk_handling=False)
if service_type == 5: if service_type == 5:
@ -35,7 +35,7 @@ def pus_factory_hook(raw_tm_packet: bytearray, tmtc_printer: TmTcPrinter):
if service_type == 8: if service_type == 8:
tm_packet = Service8TM.unpack(raw_telemetry=raw_tm_packet) tm_packet = Service8TM.unpack(raw_telemetry=raw_tm_packet)
if service_type == 17: if service_type == 17:
tm_packet = Service17TM.unpack(raw_telemetry=raw_tm_packet) tm_packet = Service17TMExtended.unpack(raw_telemetry=raw_tm_packet)
if tm_packet is None: if tm_packet is None:
LOGGER.info(f'The service {service_type} is not implemented in Telemetry Factory') LOGGER.info(f'The service {service_type} is not implemented in Telemetry Factory')
tm_packet = PusTelemetry.unpack(raw_telemetry=raw_tm_packet) tm_packet = PusTelemetry.unpack(raw_telemetry=raw_tm_packet)

1
spacepackets Submodule

@ -0,0 +1 @@
Subproject commit b5068ceb033b6a857d463d6d91aa8cbdf07913e9

View File

@ -35,6 +35,7 @@ from pus_tm.factory_hook import ccsds_tm_handler
try: try:
from tmtccmd.runner import initialize_tmtc_commander, run_tmtc_commander, add_ccsds_handler from tmtccmd.runner import initialize_tmtc_commander, run_tmtc_commander, add_ccsds_handler
from tmtccmd.ccsds.handler import CcsdsTmHandler from tmtccmd.ccsds.handler import CcsdsTmHandler
import spacepackets
except ImportError as error: except ImportError as error:
run_tmtc_commander = None run_tmtc_commander = None
initialize_tmtc_commander = None initialize_tmtc_commander = None
@ -46,7 +47,8 @@ except ImportError as error:
def main(): def main():
hook_obj = EiveHookObject() hook_obj = EiveHookObject()
print(f"-- eive tmtc version {__version__}") print(f'-- eive tmtc version {__version__} --')
print(f'-- spacepackets version {spacepackets.__version__} --')
initialize_tmtc_commander(hook_object=hook_obj) initialize_tmtc_commander(hook_object=hook_obj)
ccsds_handler = CcsdsTmHandler() ccsds_handler = CcsdsTmHandler()
ccsds_handler.add_tm_handler(apid=PUS_APID, pus_tm_handler=ccsds_tm_handler, max_queue_len=50) ccsds_handler.add_tm_handler(apid=PUS_APID, pus_tm_handler=ccsds_tm_handler, max_queue_len=50)

View File

@ -35,6 +35,7 @@ from pus_tm.factory_hook import ccsds_tm_handler
try: try:
from tmtccmd.runner import initialize_tmtc_commander, run_tmtc_commander, add_ccsds_handler from tmtccmd.runner import initialize_tmtc_commander, run_tmtc_commander, add_ccsds_handler
from tmtccmd.ccsds.handler import CcsdsTmHandler from tmtccmd.ccsds.handler import CcsdsTmHandler
import spacepackets
except ImportError as error: except ImportError as error:
run_tmtc_commander = None run_tmtc_commander = None
initialize_tmtc_commander = None initialize_tmtc_commander = None
@ -47,6 +48,7 @@ except ImportError as error:
def main(): def main():
hook_obj = EiveHookObject() hook_obj = EiveHookObject()
print(f"-- eive tmtc version {__version__}") print(f"-- eive tmtc version {__version__}")
print(f'-- spacepackets version {spacepackets.__version__} --')
initialize_tmtc_commander(hook_object=hook_obj) initialize_tmtc_commander(hook_object=hook_obj)
ccsds_handler = CcsdsTmHandler() ccsds_handler = CcsdsTmHandler()
ccsds_handler.add_tm_handler(apid=PUS_APID, pus_tm_handler=ccsds_tm_handler, max_queue_len=50) ccsds_handler.add_tm_handler(apid=PUS_APID, pus_tm_handler=ccsds_tm_handler, max_queue_len=50)

@ -1 +1 @@
Subproject commit 6e6e5d56a0155f00508c8da506acc6891431ff2c Subproject commit a7299e7a68936ce7fa1fdf004a6c2dd2c8073711