Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
source
TMTC COMMANDER CORE
Commits
e8e3dc36
Commit
e8e3dc36
authored
Feb 21, 2021
by
Robin Mueller
Browse files
renamed tmtc_core to tmtccmd
parent
483cec7f
Changes
44
Hide whitespace changes
Inline
Side-by-side
pus_tc/tmtcc_tc_service_8_functional_cmd.py
View file @
e8e3dc36
import
enum
import
struct
from
tmtc
_core
.pus_tc.tmtcc_pus_tc_base
import
PusTelecommand
from
tmtc
cmd
.pus_tc.tmtcc_pus_tc_base
import
PusTelecommand
class
Srv8Subservices
(
enum
.
IntEnum
):
...
...
pus_tm/tmtcc_pus_service2.py
View file @
e8e3dc36
"""
@brief Base class for implementation of PUS Service 2 handling.
"""
from
tmtc
_core
.pus_tm.tmtcc_pus_tm_base
import
PusTelemetry
from
tmtc
cmd
.pus_tm.tmtcc_pus_tm_base
import
PusTelemetry
class
Service2TM
(
PusTelemetry
):
...
...
pus_tm/tmtcc_pus_service200.py
View file @
e8e3dc36
...
...
@@ -3,7 +3,7 @@
"""
import
struct
from
tmtc
_core
.pus_tm.tmtcc_pus_tm_base
import
PusTelemetry
from
tmtc
cmd
.pus_tm.tmtcc_pus_tm_base
import
PusTelemetry
class
Service200TM
(
PusTelemetry
):
...
...
pus_tm/tmtcc_pus_service_20.py
View file @
e8e3dc36
import
os
import
struct
from
tmtc
_core
.pus_tm.tmtcc_pus_tm_base
import
PusTelemetry
,
TmDictionaryKeys
,
PusTmInfoT
from
tmtc
_core
.utility.tmtcc_logger
import
get_logger
from
tmtc
cmd
.pus_tm.tmtcc_pus_tm_base
import
PusTelemetry
,
TmDictionaryKeys
,
PusTmInfoT
from
tmtc
cmd
.utility.tmtcc_logger
import
get_logger
logger
=
get_logger
()
...
...
pus_tm/tmtcc_pus_service_3.py
View file @
e8e3dc36
...
...
@@ -6,9 +6,9 @@ Description: Deserialize Housekeeping TM
Author: R. Mueller
"""
from
tmtc
_core
.pus_tm.tmtcc_pus_tm_base
import
PusTelemetry
from
tmtc
_core
.pus_tm.tmtcc_tm_service3_base
import
Service3Base
from
tmtc
_core
.utility.tmtcc_logger
import
get_logger
from
tmtc
cmd
.pus_tm.tmtcc_pus_tm_base
import
PusTelemetry
from
tmtc
cmd
.pus_tm.tmtcc_tm_service3_base
import
Service3Base
from
tmtc
cmd
.utility.tmtcc_logger
import
get_logger
from
typing
import
Type
import
struct
...
...
@@ -31,7 +31,7 @@ class Service3TM(Service3Base):
STRUCTURE_REPORT_FIXED_HEADER_SIZE
=
MINIMAL_PACKET_SIZE
+
7
def
__init__
(
self
,
byte_array
:
bytearray
):
from
tmtc
_core
.core.object_id_manager
import
get_key_from_raw_object_id
from
tmtc
cmd
.core.object_id_manager
import
get_key_from_raw_object_id
super
().
__init__
(
byte_array
)
if
len
(
self
.
_tm_data
)
<
8
:
warning
=
"Service3TM: handle_filling_definition_arrays: Invalid Service 3 packet,"
\
...
...
pus_tm/tmtcc_pus_service_8.py
View file @
e8e3dc36
...
...
@@ -3,9 +3,9 @@
"""
import
struct
from
tmtc
_core
.pus_tm.tmtcc_pus_tm_base
import
PusTelemetry
from
tmtc
_core
.core.object_id_manager
import
get_key_from_raw_object_id
from
tmtc
_core
.utility.tmtcc_logger
import
get_logger
from
tmtc
cmd
.pus_tm.tmtcc_pus_tm_base
import
PusTelemetry
from
tmtc
cmd
.core.object_id_manager
import
get_key_from_raw_object_id
from
tmtc
cmd
.utility.tmtcc_logger
import
get_logger
from
config.tmtcc_object_ids
import
ObjectIds
logger
=
get_logger
()
...
...
pus_tm/tmtcc_pus_tm_base.py
View file @
e8e3dc36
import
math
import
time
from
tmtc
_core
.utility.tmtcc_logger
import
get_logger
from
tmtc
cmd
.utility.tmtcc_logger
import
get_logger
import
datetime
from
enum
import
Enum
,
auto
...
...
pus_tm/tmtcc_pus_tm_creator.py
View file @
e8e3dc36
...
...
@@ -3,8 +3,8 @@ This module creates the class required to generate PUS telemetry packets.
"""
import
crcmod
from
tmtc
_core
.pus_tm.tmtcc_pus_tm_base
import
PusTelemetry
,
PusTelemetryTimestamp
from
tmtc
_core
.utility.tmtcc_logger
import
get_logger
from
tmtc
cmd
.pus_tm.tmtcc_pus_tm_base
import
PusTelemetry
,
PusTelemetryTimestamp
from
tmtc
cmd
.utility.tmtcc_logger
import
get_logger
LOGGER
=
get_logger
()
...
...
pus_tm/tmtcc_pus_tm_factory.py
View file @
e8e3dc36
# -*- coding: utf-8 -*-
from
typing
import
Deque
,
List
,
Tuple
,
Union
from
tmtc
_core
.pus_tm.tmtcc_pus_tm_base
import
PusTelemetry
,
PusTmInfoT
from
tmtc
_core
.utility.tmtcc_logger
import
get_logger
from
tmtc
cmd
.pus_tm.tmtcc_pus_tm_base
import
PusTelemetry
,
PusTmInfoT
from
tmtc
cmd
.utility.tmtcc_logger
import
get_logger
# This function is implemented by the user
from
pus_tm.tmtcc_pus_tm_factory_hook
import
tm_user_factory_hook
...
...
pus_tm/tmtcc_tm_service1.py
View file @
e8e3dc36
...
...
@@ -8,9 +8,9 @@ Author: R. Mueller
import
struct
from
typing
import
Dict
from
tmtc
_core
.pus_tm.tmtcc_pus_tm_base
import
PusTelemetry
,
TmDictionaryKeys
from
tmtc
_core
.pus_tm.tmtcc_pus_tm_creator
import
PusTelemetryCreator
from
tmtc
_core
.utility.tmtcc_logger
import
get_logger
from
tmtc
cmd
.pus_tm.tmtcc_pus_tm_base
import
PusTelemetry
,
TmDictionaryKeys
from
tmtc
cmd
.pus_tm.tmtcc_pus_tm_creator
import
PusTelemetryCreator
from
tmtc
cmd
.utility.tmtcc_logger
import
get_logger
LOGGER
=
get_logger
()
PusPacketInfoService1T
=
Dict
[
TmDictionaryKeys
,
any
]
...
...
pus_tm/tmtcc_tm_service17.py
View file @
e8e3dc36
from
tmtc
_core
.pus_tm.tmtcc_pus_tm_base
import
PusTelemetry
from
tmtc
cmd
.pus_tm.tmtcc_pus_tm_base
import
PusTelemetry
class
Service17TM
(
PusTelemetry
):
...
...
pus_tm/tmtcc_tm_service3_base.py
View file @
e8e3dc36
from
tmtc
_core
.pus_tm.tmtcc_pus_tm_base
import
PusTelemetry
from
tmtc
cmd
.pus_tm.tmtcc_pus_tm_base
import
PusTelemetry
class
Service3Base
(
PusTelemetry
):
...
...
pus_tm/tmtcc_tm_service5.py
View file @
e8e3dc36
...
...
@@ -6,8 +6,8 @@ Description: Deserialize PUS Event Report
Author: R. Mueller
"""
from
tmtc
_core
.pus_tm.tmtcc_pus_tm_base
import
PusTelemetry
,
TmDictionaryKeys
from
tmtc
_core
.pus_tm.tmtcc_pus_tm_factory
import
PusTmInfoT
from
tmtc
cmd
.pus_tm.tmtcc_pus_tm_base
import
PusTelemetry
,
TmDictionaryKeys
from
tmtc
cmd
.pus_tm.tmtcc_pus_tm_factory
import
PusTmInfoT
import
struct
...
...
runConfigurations/tmtcc_Single_Command_UDP.xml
View file @
e8e3dc36
...
...
@@ -12,7 +12,7 @@
<option
name=
"ADD_CONTENT_ROOTS"
value=
"true"
/>
<option
name=
"ADD_SOURCE_ROOTS"
value=
"true"
/>
<EXTENSION
ID=
"PythonCoverageRunConfigurationExtension"
runner=
"coverage.py"
/>
<option
name=
"SCRIPT_NAME"
value=
"$PROJECT_DIR$/tmtc
_core
/tmtcc_runner.py"
/>
<option
name=
"SCRIPT_NAME"
value=
"$PROJECT_DIR$/tmtc
cmd
/tmtcc_runner.py"
/>
<option
name=
"PARAMETERS"
value=
"-m 2 -c 2 --boardIP=127.0.0.1"
/>
<option
name=
"SHOW_COMMAND_LINE"
value=
"false"
/>
<option
name=
"EMULATE_TERMINAL"
value=
"false"
/>
...
...
sendreceive/tmtcc_command_sender_receiver.py
View file @
e8e3dc36
...
...
@@ -13,15 +13,15 @@ if the first reply has not been received.
"""
import
time
from
tmtc
_core
.com_if.tmtcc_com_interface_base
import
CommunicationInterface
from
tmtc
_core
.core.definitions
import
QueueCommands
,
CoreGlobalIds
from
tmtc
_core
.utility.tmtcc_tmtc_printer
import
TmTcPrinter
from
tmtc
_core
.utility.tmtcc_logger
import
get_logger
from
tmtc
cmd
.com_if.tmtcc_com_interface_base
import
CommunicationInterface
from
tmtc
cmd
.core.definitions
import
QueueCommands
,
CoreGlobalIds
from
tmtc
cmd
.utility.tmtcc_tmtc_printer
import
TmTcPrinter
from
tmtc
cmd
.utility.tmtcc_logger
import
get_logger
from
tmtc
_core
.sendreceive.tmtcc_tm_listener
import
TmListener
from
tmtc
_core
.pus_tc.tmtcc_pus_tc_base
import
TcQueueEntryT
from
tmtc
_core
.pus_tm.tmtcc_pus_tm_factory
import
PusTmQueueT
from
tmtc
_core
.core.globals_manager
import
get_global
from
tmtc
cmd
.sendreceive.tmtcc_tm_listener
import
TmListener
from
tmtc
cmd
.pus_tc.tmtcc_pus_tc_base
import
TcQueueEntryT
from
tmtc
cmd
.pus_tm.tmtcc_pus_tm_factory
import
PusTmQueueT
from
tmtc
cmd
.core.globals_manager
import
get_global
LOGGER
=
get_logger
()
...
...
@@ -199,7 +199,7 @@ class CommandSenderReceiver:
if
self
.
_start_time
!=
0
:
self
.
_elapsed_time
=
time
.
time
()
-
self
.
_start_time
if
self
.
_elapsed_time
>=
self
.
_tm_timeout
*
self
.
_tc_send_timeout_factor
:
from
tmtc
_core
.core.globals_manager
import
get_global
from
tmtc
cmd
.core.globals_manager
import
get_global
if
get_global
(
CoreGlobalIds
.
RESEND_TC
):
LOGGER
.
info
(
"CommandSenderReceiver: Timeout, sending TC again !"
)
self
.
_com_interface
.
send_telecommand
(
self
.
_last_tc
,
self
.
_last_tc_info
)
...
...
sendreceive/tmtcc_multiple_commands_sender_receiver.py
View file @
e8e3dc36
...
...
@@ -7,13 +7,13 @@ import time
from
typing
import
Union
,
Deque
from
collections
import
deque
from
tmtc
_core
.core.definitions
import
CoreGlobalIds
from
tmtc
_core
.sendreceive.tmtcc_sequential_sender_receiver
import
SequentialCommandSenderReceiver
from
tmtc
_core
.com_if.tmtcc_com_interface_base
import
CommunicationInterface
from
tmtc
_core
.utility.tmtcc_tmtc_printer
import
TmTcPrinter
from
tmtc
_core
.core.globals_manager
import
get_global
from
tmtc
_core
.sendreceive.tmtcc_tm_listener
import
TmListener
from
tmtc
_core
.utility.tmtcc_tmtc_printer
import
get_logger
from
tmtc
cmd
.core.definitions
import
CoreGlobalIds
from
tmtc
cmd
.sendreceive.tmtcc_sequential_sender_receiver
import
SequentialCommandSenderReceiver
from
tmtc
cmd
.com_if.tmtcc_com_interface_base
import
CommunicationInterface
from
tmtc
cmd
.utility.tmtcc_tmtc_printer
import
TmTcPrinter
from
tmtc
cmd
.core.globals_manager
import
get_global
from
tmtc
cmd
.sendreceive.tmtcc_tm_listener
import
TmListener
from
tmtc
cmd
.utility.tmtcc_tmtc_printer
import
get_logger
LOGGER
=
get_logger
()
...
...
sendreceive/tmtcc_sequential_sender_receiver.py
View file @
e8e3dc36
...
...
@@ -7,12 +7,12 @@
import
sys
import
time
from
tmtc
_core
.sendreceive.tmtcc_command_sender_receiver
import
CommandSenderReceiver
from
tmtc
_core
.sendreceive.tmtcc_tm_listener
import
TmListener
from
tmtc
_core
.com_if.tmtcc_com_interface_base
import
CommunicationInterface
from
tmtc
_core
.utility.tmtcc_tmtc_printer
import
TmTcPrinter
from
tmtc
_core
.utility.tmtcc_logger
import
get_logger
from
tmtc
_core
.pus_tc.tmtcc_pus_tc_base
import
TcQueueT
from
tmtc
cmd
.sendreceive.tmtcc_command_sender_receiver
import
CommandSenderReceiver
from
tmtc
cmd
.sendreceive.tmtcc_tm_listener
import
TmListener
from
tmtc
cmd
.com_if.tmtcc_com_interface_base
import
CommunicationInterface
from
tmtc
cmd
.utility.tmtcc_tmtc_printer
import
TmTcPrinter
from
tmtc
cmd
.utility.tmtcc_logger
import
get_logger
from
tmtc
cmd
.pus_tc.tmtcc_pus_tc_base
import
TcQueueT
LOGGER
=
get_logger
()
...
...
sendreceive/tmtcc_single_command_sender_receiver.py
View file @
e8e3dc36
...
...
@@ -8,15 +8,15 @@
Used to send single tcs and listen for replies after that
"""
from
tmtc
_core
.sendreceive.tmtcc_command_sender_receiver
import
CommandSenderReceiver
from
tmtc
_core
.sendreceive.tmtcc_tm_listener
import
TmListener
from
tmtc
cmd
.sendreceive.tmtcc_command_sender_receiver
import
CommandSenderReceiver
from
tmtc
cmd
.sendreceive.tmtcc_tm_listener
import
TmListener
from
tmtc
_core
.com_if.tmtcc_com_interface_base
import
CommunicationInterface
from
tmtc
cmd
.com_if.tmtcc_com_interface_base
import
CommunicationInterface
from
tmtc
_core
.utility.tmtcc_tmtc_printer
import
TmTcPrinter
from
tmtc
_core
.utility.tmtcc_logger
import
get_logger
from
tmtc
cmd
.utility.tmtcc_tmtc_printer
import
TmTcPrinter
from
tmtc
cmd
.utility.tmtcc_logger
import
get_logger
from
tmtc
_core
.pus_tc.tmtcc_pus_tc_base
import
PusTcTupleT
from
tmtc
cmd
.pus_tc.tmtcc_pus_tc_base
import
PusTcTupleT
logger
=
get_logger
()
...
...
sendreceive/tmtcc_tm_listener.py
View file @
e8e3dc36
...
...
@@ -10,9 +10,9 @@ import threading
from
collections
import
deque
from
enum
import
Enum
from
tmtc
_core
.utility.tmtcc_logger
import
get_logger
from
tmtc
_core
.com_if.tmtcc_com_interface_base
import
CommunicationInterface
from
tmtc
_core
.pus_tm.tmtcc_pus_tm_factory
import
PusTmQueueT
,
PusTmInfoQueueT
from
tmtc
cmd
.utility.tmtcc_logger
import
get_logger
from
tmtc
cmd
.com_if.tmtcc_com_interface_base
import
CommunicationInterface
from
tmtc
cmd
.pus_tm.tmtcc_pus_tm_factory
import
PusTmQueueT
,
PusTmInfoQueueT
LOGGER
=
get_logger
()
...
...
@@ -226,8 +226,8 @@ class TmListener:
time
.
sleep
(
0.05
)
# the timeout value can be set by special TC queue entries if wiretapping_packet handling
# takes longer, but it is reset here to the global value
from
tmtc
_core
.core.globals_manager
import
get_global
from
tmtc
_core
.core.definitions
import
CoreGlobalIds
from
tmtc
cmd
.core.globals_manager
import
get_global
from
tmtc
cmd
.core.definitions
import
CoreGlobalIds
if
self
.
__tm_timeout
is
not
get_global
(
CoreGlobalIds
.
TM_TIMEOUT
):
self
.
__tm_timeout
=
get_global
(
CoreGlobalIds
.
TM_TIMEOUT
)
return
True
...
...
tmtcc
_runner
.py
→
tmtcc
md
.py
View file @
e8e3dc36
...
...
@@ -10,10 +10,10 @@
import
sys
from
typing
import
Tuple
from
tmtc
_core
.core.hook_base
import
TmTcHookBase
from
tmtc
_core
.core.definitions
import
CoreGlobalIds
from
tmtc
_core
.utility.tmtcc_core_args_parser
import
parse_input_arguments
from
tmtc
_core
.utility.tmtcc_logger
import
set_tmtc_logger
,
get_logger
from
tmtc
cmd
.core.hook_base
import
TmTcHookBase
from
tmtc
cmd
.core.definitions
import
CoreGlobalIds
from
tmtc
cmd
.utility.tmtcc_core_args_parser
import
parse_input_arguments
from
tmtc
cmd
.utility.tmtcc_logger
import
set_tmtc_logger
,
get_logger
logger
=
get_logger
()
...
...
@@ -29,7 +29,7 @@ def initialize_tmtc_commander(hook_object: TmTcHookBase):
Example for a simple main function content to use the command line mode:
hook_obj = MyCustomHookClass()
initialize_tmtc
_core
(hook_obj)
initialize_tmtc
cmd
(hook_obj)
run_tmtc_client(False)
:param: hook_base: Instantiation of a custom hook object. The TMTC core will call the various
...
...
@@ -47,7 +47,7 @@ def run_tmtc_commander(use_gui: bool, reduced_printout: bool = False):
Example for a simple main function content to use the command line mode:
hook_obj = MyCustomHookClass()
initialize_tmtc
_core
(hook_obj)
initialize_tmtc
cmd
(hook_obj)
run_tmtc_client(False)
:param use_gui: Specify whether the GUI is used or not
...
...
@@ -62,8 +62,8 @@ def run_tmtc_commander(use_gui: bool, reduced_printout: bool = False):
def
assign_tmtc_commander_hooks
(
hook_object
:
TmTcHookBase
):
from
tmtc
_core
.core.globals_manager
import
update_global
from
tmtc
_core
.core.definitions
import
CoreGlobalIds
from
tmtc
cmd
.core.globals_manager
import
update_global
from
tmtc
cmd
.core.definitions
import
CoreGlobalIds
if
hook_object
is
None
:
logger
.
error
(
"Passed hook base object handle is invalid. Terminating.."
)
...
...
@@ -81,9 +81,9 @@ def assign_tmtc_commander_hooks(hook_object: TmTcHookBase):
def
set_up_tmtc_commander
(
use_gui
:
bool
,
reduced_printout
:
bool
):
from
tmtc
_core
.core.globals_manager
import
get_global
from
tmtc
_core
.core.definitions
import
CoreGlobalIds
from
tmtc
_core
.core.hook_base
import
TmTcHookBase
from
tmtc
cmd
.core.globals_manager
import
get_global
from
tmtc
cmd
.core.definitions
import
CoreGlobalIds
from
tmtc
cmd
.core.hook_base
import
TmTcHookBase
from
typing
import
cast
set_tmtc_logger
()
...
...
@@ -120,7 +120,7 @@ def handle_init_printout(use_gui: bool, version_tuple: Tuple[str, int, int]):
def
handle_cli_args_and_globals
():
from
typing
import
cast
from
tmtc
_core
.core.globals_manager
import
get_global
from
tmtc
cmd
.core.globals_manager
import
get_global
hook_obj
=
cast
(
TmTcHookBase
,
get_global
(
CoreGlobalIds
.
TMTC_HOOK
))
logger
.
info
(
"Setting up pre-globals.."
)
...
...
@@ -134,8 +134,8 @@ def handle_cli_args_and_globals():
def
start_tmtc_commander_cli
():
from
tmtc
_core
.core.backend
import
TmTcHandler
from
tmtc
_core
.core.globals_manager
import
get_global
from
tmtc
cmd
.core.backend
import
TmTcHandler
from
tmtc
cmd
.core.globals_manager
import
get_global
service
=
get_global
(
CoreGlobalIds
.
SERVICE
)
op_code
=
get_global
(
CoreGlobalIds
.
OP_CODE
)
# The global variables are set by the argument parser.
...
...
@@ -147,8 +147,8 @@ def start_tmtc_commander_cli():
def
start_tmtc_commander_qt_gui
():
from
tmtc
_core
.core.frontend
import
TmTcFrontend
from
tmtc
_core
.core.globals_manager
import
get_global
from
tmtc
cmd
.core.frontend
import
TmTcFrontend
from
tmtc
cmd
.core.globals_manager
import
get_global
try
:
from
PyQt5.QtWidgets
import
QApplication
except
ImportError
:
...
...
Prev
1
2
3
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment