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
README.md
View file @
e8e3dc36
...
@@ -57,13 +57,13 @@ a git repository. If not, it can be transformed to one using `git init`.
...
@@ -57,13 +57,13 @@ a git repository. If not, it can be transformed to one using `git init`.
cd
obsw
cd
obsw
mkdir
tmtc
mkdir
tmtc
cd
tmtc
cd
tmtc
git submodule add https://git.ksat-stuttgart.de/source/tmtc
_core
.git
git submodule add https://git.ksat-stuttgart.de/source/tmtc
cmd
.git
```
```
Copy the contents of the
`user`
folder inside the
`tmtc
_core
`
folder to the
`tmtc`
folder
Copy the contents of the
`user`
folder inside the
`tmtc
cmd
`
folder to the
`tmtc`
folder
```
sh
```
sh
cd
tmtc
_core
cd
tmtc
cmd
cp
tmtc
_core
/user/
*
.
-r
cp
tmtc
cmd
/user/
*
.
-r
cd
..
cd
..
```
```
...
@@ -85,7 +85,7 @@ in the `.idea` folder.
...
@@ -85,7 +85,7 @@ in the `.idea` folder.
```
sh
```
sh
cd
tmtc
cd
tmtc
cp
tmtc
_core
/runConfigurations/
*
.idea/runConfigurations/
cp
tmtc
cmd
/runConfigurations/
*
.idea/runConfigurations/
```
```
## How to use the TMTC commander
## How to use the TMTC commander
...
...
com_if/tmtcc_com_interface_base.py
View file @
e8e3dc36
...
@@ -9,9 +9,9 @@ Description: Generic Communication Interface. Defines the syntax of the communic
...
@@ -9,9 +9,9 @@ Description: Generic Communication Interface. Defines the syntax of the communic
"""
"""
from
abc
import
abstractmethod
from
abc
import
abstractmethod
from
typing
import
Tuple
from
typing
import
Tuple
from
tmtc
_core
.pus_tm.tmtcc_pus_tm_factory
import
PusTmListT
from
tmtc
cmd
.pus_tm.tmtcc_pus_tm_factory
import
PusTmListT
from
tmtc
_core
.utility.tmtcc_tmtc_printer
import
TmTcPrinter
from
tmtc
cmd
.utility.tmtcc_tmtc_printer
import
TmTcPrinter
from
tmtc
_core
.pus_tc.tmtcc_pus_tc_base
import
PusTcInfoT
from
tmtc
cmd
.pus_tc.tmtcc_pus_tc_base
import
PusTcInfoT
# pylint: disable=useless-return
# pylint: disable=useless-return
...
...
com_if/tmtcc_dummy_com_if.py
View file @
e8e3dc36
...
@@ -7,11 +7,11 @@
...
@@ -7,11 +7,11 @@
"""
"""
from
typing
import
Tuple
from
typing
import
Tuple
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
.pus_tc.tmtcc_pus_tc_base
import
PusTelecommand
,
PusTcInfoT
,
TcDictionaryKeys
from
tmtc
cmd
.pus_tc.tmtcc_pus_tc_base
import
PusTelecommand
,
PusTcInfoT
,
TcDictionaryKeys
from
tmtc
_core
.pus_tm.tmtcc_pus_tm_factory
import
PusTelemetryFactory
from
tmtc
cmd
.pus_tm.tmtcc_pus_tm_factory
import
PusTelemetryFactory
from
tmtc
_core
.pus_tm.tmtcc_tm_service1
import
Service1TmPacked
from
tmtc
cmd
.pus_tm.tmtcc_tm_service1
import
Service1TmPacked
from
tmtc
_core
.utility.tmtcc_logger
import
get_logger
from
tmtc
cmd
.utility.tmtcc_logger
import
get_logger
LOGGER
=
get_logger
()
LOGGER
=
get_logger
()
...
...
com_if/tmtcc_ethernet_com_if.py
View file @
e8e3dc36
...
@@ -11,12 +11,12 @@ import struct
...
@@ -11,12 +11,12 @@ import struct
import
sys
import
sys
from
typing
import
Tuple
from
typing
import
Tuple
from
tmtc
_core
.utility.tmtcc_logger
import
get_logger
from
tmtc
cmd
.utility.tmtcc_logger
import
get_logger
from
tmtc
_core
.com_if.tmtcc_com_interface_base
import
CommunicationInterface
,
PusTmListT
from
tmtc
cmd
.com_if.tmtcc_com_interface_base
import
CommunicationInterface
,
PusTmListT
from
tmtc
_core
.pus_tm.tmtcc_pus_tm_factory
import
PusTelemetryFactory
from
tmtc
cmd
.pus_tm.tmtcc_pus_tm_factory
import
PusTelemetryFactory
from
tmtc
_core
.pus_tc.tmtcc_pus_tc_base
import
PusTcInfoT
from
tmtc
cmd
.pus_tc.tmtcc_pus_tc_base
import
PusTcInfoT
from
tmtc
_core
.utility.tmtcc_tmtc_printer
import
TmTcPrinter
from
tmtc
cmd
.utility.tmtcc_tmtc_printer
import
TmTcPrinter
from
tmtc
_core
.core.definitions
import
ethernet_address_t
from
tmtc
cmd
.core.definitions
import
ethernet_address_t
LOGGER
=
get_logger
()
LOGGER
=
get_logger
()
...
...
com_if/tmtcc_ethernet_utilities.py
View file @
e8e3dc36
...
@@ -4,8 +4,8 @@ import socket
...
@@ -4,8 +4,8 @@ import socket
import
struct
import
struct
from
typing
import
Tuple
from
typing
import
Tuple
from
tmtc
_core
.core.definitions
import
ethernet_address_t
from
tmtc
cmd
.core.definitions
import
ethernet_address_t
from
tmtc
_core
.utility.tmtcc_logger
import
get_logger
from
tmtc
cmd
.utility.tmtcc_logger
import
get_logger
LOGGER
=
get_logger
()
LOGGER
=
get_logger
()
...
...
com_if/tmtcc_qemu_com_if.py
View file @
e8e3dc36
...
@@ -26,12 +26,12 @@ import sys
...
@@ -26,12 +26,12 @@ import sys
import
time
import
time
from
collections
import
deque
from
collections
import
deque
from
threading
import
Thread
from
threading
import
Thread
from
tmtc
_core
.com_if.tmtcc_com_interface_base
import
CommunicationInterface
,
PusTcInfoT
,
PusTmListT
from
tmtc
cmd
.com_if.tmtcc_com_interface_base
import
CommunicationInterface
,
PusTcInfoT
,
PusTmListT
from
tmtc
_core
.pus_tm.tmtcc_pus_tm_factory
import
PusTelemetryFactory
from
tmtc
cmd
.pus_tm.tmtcc_pus_tm_factory
import
PusTelemetryFactory
from
tmtc
_core
.utility.tmtcc_tmtc_printer
import
TmTcPrinter
from
tmtc
cmd
.utility.tmtcc_tmtc_printer
import
TmTcPrinter
from
tmtc
_core
.com_if.tmtcc_serial_com_if
import
SerialComIF
,
SerialCommunicationType
from
tmtc
cmd
.com_if.tmtcc_serial_com_if
import
SerialComIF
,
SerialCommunicationType
from
tmtc
_core
.utility.tmtcc_logger
import
get_logger
from
tmtc
cmd
.utility.tmtcc_logger
import
get_logger
from
tmtc
_core
.utility.dle_encoder
import
encode_dle
,
decode_dle
,
STX_CHAR
,
ETX_CHAR
,
DleErrorCodes
from
tmtc
cmd
.utility.dle_encoder
import
encode_dle
,
decode_dle
,
STX_CHAR
,
ETX_CHAR
,
DleErrorCodes
LOGGER
=
get_logger
()
LOGGER
=
get_logger
()
SERIAL_FRAME_LENGTH
=
256
SERIAL_FRAME_LENGTH
=
256
...
...
com_if/tmtcc_serial_com_if.py
View file @
e8e3dc36
...
@@ -13,12 +13,12 @@ from collections import deque
...
@@ -13,12 +13,12 @@ from collections import deque
import
serial
import
serial
import
serial.tools.list_ports
import
serial.tools.list_ports
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
cmd
.utility.tmtcc_tmtc_printer
import
TmTcPrinter
from
tmtc
_core
.pus_tm.tmtcc_pus_tm_factory
import
PusTelemetryFactory
,
PusTmListT
from
tmtc
cmd
.pus_tm.tmtcc_pus_tm_factory
import
PusTelemetryFactory
,
PusTmListT
from
tmtc
_core
.pus_tc.tmtcc_pus_tc_base
import
PusTcInfoT
from
tmtc
cmd
.pus_tc.tmtcc_pus_tc_base
import
PusTcInfoT
from
tmtc
_core
.utility.tmtcc_logger
import
get_logger
from
tmtc
cmd
.utility.tmtcc_logger
import
get_logger
from
tmtc
_core
.utility.dle_encoder
import
encode_dle
,
decode_dle
,
STX_CHAR
,
ETX_CHAR
,
DleErrorCodes
from
tmtc
cmd
.utility.dle_encoder
import
encode_dle
,
decode_dle
,
STX_CHAR
,
ETX_CHAR
,
DleErrorCodes
LOGGER
=
get_logger
()
LOGGER
=
get_logger
()
...
...
core/backend.py
View file @
e8e3dc36
...
@@ -4,16 +4,16 @@ import sys
...
@@ -4,16 +4,16 @@ import sys
from
collections
import
deque
from
collections
import
deque
from
typing
import
Tuple
,
Union
from
typing
import
Tuple
,
Union
from
tmtc
_core
.core.definitions
import
ComInterfaces
,
CoreGlobalIds
from
tmtc
cmd
.core.definitions
import
ComInterfaces
,
CoreGlobalIds
from
tmtc
_core
.utility.tmtcc_logger
import
get_logger
from
tmtc
cmd
.utility.tmtcc_logger
import
get_logger
from
tmtc
_core
.pus_tc.tmtcc_pus_tc_base
import
PusTcInfo
,
PusTelecommand
from
tmtc
cmd
.pus_tc.tmtcc_pus_tc_base
import
PusTcInfo
,
PusTelecommand
from
tmtc
_core
.sendreceive.tmtcc_single_command_sender_receiver
import
SingleCommandSenderReceiver
from
tmtc
cmd
.sendreceive.tmtcc_single_command_sender_receiver
import
SingleCommandSenderReceiver
from
tmtc
_core
.sendreceive.tmtcc_sequential_sender_receiver
import
SequentialCommandSenderReceiver
from
tmtc
cmd
.sendreceive.tmtcc_sequential_sender_receiver
import
SequentialCommandSenderReceiver
from
tmtc
_core
.sendreceive.tmtcc_tm_listener
import
TmListener
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
cmd
.utility.tmtcc_tmtc_printer
import
TmTcPrinter
from
tmtc
_core
.utility.tmtcc_exit_handler
import
keyboard_interrupt_handler
from
tmtc
cmd
.utility.tmtcc_exit_handler
import
keyboard_interrupt_handler
from
tmtc
_core
.pus_tc.tmtcc_pus_tc_packer
import
ServiceQueuePacker
from
tmtc
cmd
.pus_tc.tmtcc_pus_tc_packer
import
ServiceQueuePacker
from
config.tmtcc_definitions
import
ModeList
,
ServiceList
from
config.tmtcc_definitions
import
ModeList
,
ServiceList
from
config.tmtcc_com_config
import
create_communication_interface_user
from
config.tmtcc_com_config
import
create_communication_interface_user
...
@@ -85,7 +85,7 @@ class TmTcHandler:
...
@@ -85,7 +85,7 @@ class TmTcHandler:
executed_handler
.
start
()
executed_handler
.
start
()
def
initialize
(
self
):
def
initialize
(
self
):
from
tmtc
_core
.core.globals_manager
import
get_global
from
tmtc
cmd
.core.globals_manager
import
get_global
"""
"""
Perform initialization steps which might be necessary after class construction.
Perform initialization steps which might be necessary after class construction.
This has to be called at some point before using the class!
This has to be called at some point before using the class!
...
@@ -157,7 +157,7 @@ class TmTcHandler:
...
@@ -157,7 +157,7 @@ class TmTcHandler:
self
.
mode
=
ModeList
.
PromptMode
self
.
mode
=
ModeList
.
PromptMode
elif
self
.
mode
==
ModeList
.
ServiceTestMode
:
elif
self
.
mode
==
ModeList
.
ServiceTestMode
:
from
tmtc
_core
.core.globals_manager
import
get_global
from
tmtc
cmd
.core.globals_manager
import
get_global
service_queue
=
deque
()
service_queue
=
deque
()
service_queue_packer
=
ServiceQueuePacker
()
service_queue_packer
=
ServiceQueuePacker
()
service_queue_packer
.
pack_service_queue_core
(
service_queue_packer
.
pack_service_queue_core
(
...
...
core/com_if_setup.py
View file @
e8e3dc36
...
@@ -6,23 +6,23 @@
...
@@ -6,23 +6,23 @@
import
sys
import
sys
from
typing
import
Union
from
typing
import
Union
from
tmtc
_core
.core.definitions
import
ComInterfaces
from
tmtc
cmd
.core.definitions
import
ComInterfaces
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
.com_if.tmtcc_dummy_com_if
import
DummyComIF
from
tmtc
cmd
.com_if.tmtcc_dummy_com_if
import
DummyComIF
from
tmtc
_core
.com_if.tmtcc_ethernet_com_if
import
EthernetComIF
from
tmtc
cmd
.com_if.tmtcc_ethernet_com_if
import
EthernetComIF
from
tmtc
_core
.com_if.tmtcc_qemu_com_if
import
QEMUComIF
from
tmtc
cmd
.com_if.tmtcc_qemu_com_if
import
QEMUComIF
from
tmtc
_core
.com_if.tmtcc_serial_com_if
import
SerialCommunicationType
,
SerialComIF
from
tmtc
cmd
.com_if.tmtcc_serial_com_if
import
SerialCommunicationType
,
SerialComIF
from
tmtc
_core
.com_if.tmtcc_serial_utilities
import
determine_com_port
from
tmtc
cmd
.com_if.tmtcc_serial_utilities
import
determine_com_port
from
tmtc
_core
.utility.tmtcc_logger
import
get_logger
from
tmtc
cmd
.utility.tmtcc_logger
import
get_logger
from
tmtc
_core
.utility.tmtcc_tmtc_printer
import
TmTcPrinter
from
tmtc
cmd
.utility.tmtcc_tmtc_printer
import
TmTcPrinter
LOGGER
=
get_logger
()
LOGGER
=
get_logger
()
def
create_communication_interface_default
(
com_if
:
ComInterfaces
,
tmtc_printer
:
TmTcPrinter
)
->
\
def
create_communication_interface_default
(
com_if
:
ComInterfaces
,
tmtc_printer
:
TmTcPrinter
)
->
\
Union
[
CommunicationInterface
,
None
]:
Union
[
CommunicationInterface
,
None
]:
from
tmtc
_core
.core.definitions
import
CoreGlobalIds
from
tmtc
cmd
.core.definitions
import
CoreGlobalIds
from
tmtc
_core
.core.globals_manager
import
get_global
from
tmtc
cmd
.core.globals_manager
import
get_global
"""
"""
Return the desired communication interface object
Return the desired communication interface object
:param tmtc_printer: TmTcPrinter object.
:param tmtc_printer: TmTcPrinter object.
...
...
core/frontend.py
View file @
e8e3dc36
...
@@ -13,11 +13,11 @@ from multiprocessing import Process
...
@@ -13,11 +13,11 @@ from multiprocessing import Process
from
PyQt5.QtWidgets
import
*
from
PyQt5.QtWidgets
import
*
from
PyQt5.QtGui
import
QPixmap
,
QIcon
from
PyQt5.QtGui
import
QPixmap
,
QIcon
from
tmtc
_core
.core.tmtcc_backend
import
TmTcHandler
from
tmtc
cmd
.core.tmtcc_backend
import
TmTcHandler
from
tmtc
_core
.core.tmtccore_definitions
import
ComInterfaces
from
tmtc
cmd
.core.tmtccore_definitions
import
ComInterfaces
from
tmtc
_core
.pus_tc.tmtcc_pus_tc_base
import
PusTelecommand
from
tmtc
cmd
.pus_tc.tmtcc_pus_tc_base
import
PusTelecommand
from
tmtc
_core
.utility.tmtcc_logger
import
get_logger
from
tmtc
cmd
.utility.tmtcc_logger
import
get_logger
from
tmtc
_core
.core.tmtcc_globals_manager
import
get_global
,
update_global
from
tmtc
cmd
.core.tmtcc_globals_manager
import
get_global
,
update_global
from
config.tmtcc_definitions
import
ModeList
,
ServiceList
from
config.tmtcc_definitions
import
ModeList
,
ServiceList
from
config.tmtcc_globals
import
GlobalIds
from
config.tmtcc_globals
import
GlobalIds
...
...
core/globals_manager.py
View file @
e8e3dc36
...
@@ -27,7 +27,7 @@ class GlobalsManager:
...
@@ -27,7 +27,7 @@ class GlobalsManager:
global_param
=
self
.
globals_dict
.
get
(
global_param_key
)
global_param
=
self
.
globals_dict
.
get
(
global_param_key
)
if
global_param
is
None
:
if
global_param
is
None
:
try
:
try
:
from
tmtc
_core
.utility.tmtcc_logger
import
get_logger
from
tmtc
cmd
.utility.tmtcc_logger
import
get_logger
logger
=
get_logger
()
logger
=
get_logger
()
logger
.
error
(
f
"The key
{
global_param_key
}
for this global does not exist in the dictionary!"
)
logger
.
error
(
f
"The key
{
global_param_key
}
for this global does not exist in the dictionary!"
)
...
...
core/hook_base.py
View file @
e8e3dc36
...
@@ -4,12 +4,12 @@ from typing import Union, Dict, Tuple
...
@@ -4,12 +4,12 @@ from typing import Union, Dict, Tuple
class
TmTcHookBase
:
class
TmTcHookBase
:
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
.core.backend
import
TmTcHandler
from
tmtc
cmd
.core.backend
import
TmTcHandler
from
tmtc
_core
.utility.tmtcc_tmtc_printer
import
TmTcPrinter
from
tmtc
cmd
.utility.tmtcc_tmtc_printer
import
TmTcPrinter
from
tmtc
_core
.pus_tm.tmtcc_pus_tm_base
import
PusTelemetry
from
tmtc
cmd
.pus_tm.tmtcc_pus_tm_base
import
PusTelemetry
from
tmtc
_core
.pus_tc.tmtcc_pus_tc_base
import
TcQueueT
from
tmtc
cmd
.pus_tc.tmtcc_pus_tc_base
import
TcQueueT
from
tmtc
_core
.core.definitions
import
ComInterfaces
from
tmtc
cmd
.core.definitions
import
ComInterfaces
from
tmtcc_definitions
import
ModeList
,
ServiceList
from
tmtcc_definitions
import
ModeList
,
ServiceList
def
__init__
(
self
):
def
__init__
(
self
):
...
@@ -17,7 +17,7 @@ class TmTcHookBase:
...
@@ -17,7 +17,7 @@ class TmTcHookBase:
@
abstractmethod
@
abstractmethod
def
get_version
(
self
)
->
Tuple
[
str
,
int
,
int
]:
def
get_version
(
self
)
->
Tuple
[
str
,
int
,
int
]:
from
tmtc
_core
.core.version
import
SW_NAME
,
SW_VERSION
,
SW_SUBVERSION
from
tmtc
cmd
.core.version
import
SW_NAME
,
SW_VERSION
,
SW_SUBVERSION
return
SW_NAME
,
SW_VERSION
,
SW_SUBVERSION
return
SW_NAME
,
SW_VERSION
,
SW_SUBVERSION
@
abstractmethod
@
abstractmethod
...
@@ -30,12 +30,12 @@ class TmTcHookBase:
...
@@ -30,12 +30,12 @@ class TmTcHookBase:
@
abstractmethod
@
abstractmethod
def
add_globals_pre_args_parsing
(
self
,
gui
:
bool
=
False
):
def
add_globals_pre_args_parsing
(
self
,
gui
:
bool
=
False
):
from
tmtc
_core
.defaults.hook_functions
import
default_add_globals_pre_args_parsing
from
tmtc
cmd
.defaults.hook_functions
import
default_add_globals_pre_args_parsing
default_add_globals_pre_args_parsing
(
gui
=
gui
)
default_add_globals_pre_args_parsing
(
gui
=
gui
)
@
abstractmethod
@
abstractmethod
def
add_globals_post_args_parsing
(
self
,
args
:
argparse
.
Namespace
):
def
add_globals_post_args_parsing
(
self
,
args
:
argparse
.
Namespace
):
from
tmtc
_core
.defaults.hook_functions
import
default_add_globals_post_args_parsing
from
tmtc
cmd
.defaults.hook_functions
import
default_add_globals_post_args_parsing
default_add_globals_post_args_parsing
(
args
=
args
)
default_add_globals_post_args_parsing
(
args
=
args
)
@
abstractmethod
@
abstractmethod
...
...
core/object_id_manager.py
View file @
e8e3dc36
import
struct
import
struct
import
sys
import
sys
from
config.tmtcc_object_ids
import
ObjectIds
from
config.tmtcc_object_ids
import
ObjectIds
from
tmtc
_core
.utility.tmtcc_logger
import
get_logger
from
tmtc
cmd
.utility.tmtcc_logger
import
get_logger
logger
=
get_logger
()
logger
=
get_logger
()
...
@@ -52,12 +52,12 @@ class ObjectIdManager:
...
@@ -52,12 +52,12 @@ class ObjectIdManager:
from
config.tmtcc_object_ids
import
set_object_ids
from
config.tmtcc_object_ids
import
set_object_ids
set_object_ids
(
self
.
object_id_dict
)
set_object_ids
(
self
.
object_id_dict
)
except
ImportError
:
except
ImportError
:
from
tmtc
_core
.utility.tmtcc_logger
import
get_logger
from
tmtc
cmd
.utility.tmtcc_logger
import
get_logger
logger
=
get_logger
()
logger
=
get_logger
()
logger
.
error
(
"Could not import set_object_ids"
)
logger
.
error
(
"Could not import set_object_ids"
)
sys
.
exit
(
1
)
sys
.
exit
(
1
)
except
AttributeError
:
except
AttributeError
:
from
tmtc
_core
.utility.tmtcc_logger
import
get_logger
from
tmtc
cmd
.utility.tmtcc_logger
import
get_logger
logger
=
get_logger
()
logger
=
get_logger
()
logger
.
error
(
"Please ensure that the object ID keys are defined as well!"
)
logger
.
error
(
"Please ensure that the object ID keys are defined as well!"
)
sys
.
exit
(
1
)
sys
.
exit
(
1
)
...
...
defaults/hook_functions.py
View file @
e8e3dc36
import
argparse
import
argparse
from
tmtc
_core
.com_if.tmtcc_serial_com_if
import
SerialCommunicationType
from
tmtc
cmd
.com_if.tmtcc_serial_com_if
import
SerialCommunicationType
from
tmtc
_core
.com_if.tmtcc_serial_utilities
import
determine_com_port
from
tmtc
cmd
.com_if.tmtcc_serial_utilities
import
determine_com_port
from
tmtc
_core
.core.definitions
import
CoreGlobalIds
,
ComInterfaces
from
tmtc
cmd
.core.definitions
import
CoreGlobalIds
,
ComInterfaces
from
tmtcc_definitions
import
ModeList
,
ServiceList
from
tmtcc_definitions
import
ModeList
,
ServiceList
def
default_add_globals_pre_args_parsing
(
gui
:
bool
=
False
):
def
default_add_globals_pre_args_parsing
(
gui
:
bool
=
False
):
from
tmtc
_core
.core.globals_manager
import
update_global
from
tmtc
cmd
.core.globals_manager
import
update_global
import
pprint
import
pprint
update_global
(
CoreGlobalIds
.
APID
,
0xef
)
update_global
(
CoreGlobalIds
.
APID
,
0xef
)
...
@@ -48,8 +48,8 @@ def default_add_globals_pre_args_parsing(gui: bool = False):
...
@@ -48,8 +48,8 @@ def default_add_globals_pre_args_parsing(gui: bool = False):
def
default_add_globals_post_args_parsing
(
args
:
argparse
.
Namespace
):
def
default_add_globals_post_args_parsing
(
args
:
argparse
.
Namespace
):
from
tmtc
_core
.core.globals_manager
import
update_global
from
tmtc
cmd
.core.globals_manager
import
update_global
from
tmtc
_core
.utility.tmtcc_logger
import
get_logger
from
tmtc
cmd
.utility.tmtcc_logger
import
get_logger
from
config.tmtcc_definitions
import
ModeList
from
config.tmtcc_definitions
import
ModeList
logger
=
get_logger
()
logger
=
get_logger
()
...
@@ -138,11 +138,11 @@ def default_add_globals_post_args_parsing(args: argparse.Namespace):
...
@@ -138,11 +138,11 @@ def default_add_globals_post_args_parsing(args: argparse.Namespace):
def
default_set_up_ethernet_cfg
():
def
default_set_up_ethernet_cfg
():
from
tmtc
_core
.core.globals_manager
import
update_global
from
tmtc
cmd
.core.globals_manager
import
update_global
update_global
(
CoreGlobalIds
.
USE_ETHERNET
,
True
)
update_global
(
CoreGlobalIds
.
USE_ETHERNET
,
True
)
from
tmtc
_core
.core.globals_manager
import
get_global
from
tmtc
cmd
.core.globals_manager
import
get_global
from
config.tmtcc_definitions
import
EthernetConfig
from
config.tmtcc_definitions
import
EthernetConfig
from
tmtc
_core
.com_if.tmtcc_ethernet_utilities
import
determine_ip_addresses
from
tmtc
cmd
.com_if.tmtcc_ethernet_utilities
import
determine_ip_addresses
ethernet_cfg_dict
=
get_global
(
CoreGlobalIds
.
ETHERNET_CONFIG
)
ethernet_cfg_dict
=
get_global
(
CoreGlobalIds
.
ETHERNET_CONFIG
)
# This will either load the addresses from a JSON file or prompt them from the user.
# This will either load the addresses from a JSON file or prompt them from the user.
send_addr
,
rcv_addr
=
determine_ip_addresses
()
send_addr
,
rcv_addr
=
determine_ip_addresses
()
...
@@ -152,9 +152,9 @@ def default_set_up_ethernet_cfg():
...
@@ -152,9 +152,9 @@ def default_set_up_ethernet_cfg():
def
default_set_up_serial_cfg
(
com_if
:
ComInterfaces
):
def
default_set_up_serial_cfg
(
com_if
:
ComInterfaces
):
from
tmtc
_core
.core.globals_manager
import
update_global
from
tmtc
cmd
.core.globals_manager
import
update_global
update_global
(
CoreGlobalIds
.
USE_SERIAL
,
True
)
update_global
(
CoreGlobalIds
.
USE_SERIAL
,
True
)
from
tmtc
_core
.core.globals_manager
import
get_global
from
tmtc
cmd
.core.globals_manager
import
get_global
from
config.tmtcc_definitions
import
SerialConfig
from
config.tmtcc_definitions
import
SerialConfig
serial_cfg_dict
=
get_global
(
CoreGlobalIds
.
SERIAL_CONFIG
)
serial_cfg_dict
=
get_global
(
CoreGlobalIds
.
SERIAL_CONFIG
)
if
com_if
==
ComInterfaces
.
Serial
:
if
com_if
==
ComInterfaces
.
Serial
:
...
...
pus_tc/tmtcc_pus_tc_base.py
View file @
e8e3dc36
...
@@ -8,8 +8,8 @@ import sys
...
@@ -8,8 +8,8 @@ import sys
from
enum
import
Enum
from
enum
import
Enum
from
typing
import
Dict
,
Union
,
Tuple
,
Deque
from
typing
import
Dict
,
Union
,
Tuple
,
Deque
from
tmtc
_core
.core.definitions
import
QueueCommands
,
CoreGlobalIds
from
tmtc
cmd
.core.definitions
import
QueueCommands
,
CoreGlobalIds
from
tmtc
_core
.utility.tmtcc_logger
import
get_logger
from
tmtc
cmd
.utility.tmtcc_logger
import
get_logger
LOGGER
=
get_logger
()
LOGGER
=
get_logger
()
...
@@ -57,7 +57,7 @@ class PusTelecommand:
...
@@ -57,7 +57,7 @@ class PusTelecommand:
source_id
:
int
=
0
,
version
:
int
=
0
,
apid
:
int
=
-
1
):
source_id
:
int
=
0
,
version
:
int
=
0
,
apid
:
int
=
-
1
):
# To get the correct globally configured APID
# To get the correct globally configured APID
if
apid
==
-
1
:
if
apid
==
-
1
:
from
tmtc
_core
.core.globals_manager
import
get_global
from
tmtc
cmd
.core.globals_manager
import
get_global
apid
=
get_global
(
CoreGlobalIds
.
APID
)
apid
=
get_global
(
CoreGlobalIds
.
APID
)
"""
"""
Initiates a telecommand with the given parameters.
Initiates a telecommand with the given parameters.
...
...
pus_tc/tmtcc_pus_tc_packer.py
View file @
e8e3dc36
...
@@ -9,8 +9,8 @@ This file transfers TC packing to the user application.
...
@@ -9,8 +9,8 @@ This file transfers TC packing to the user application.
import
sys
import
sys
from
config.tmtcc_definitions
import
ServiceList
from
config.tmtcc_definitions
import
ServiceList
from
tmtc
_core
.pus_tc.tmtcc_pus_tc_base
import
TcQueueT
from
tmtc
cmd
.pus_tc.tmtcc_pus_tc_base
import
TcQueueT
from
tmtc
_core
.utility.tmtcc_logger
import
get_logger
from
tmtc
cmd
.utility.tmtcc_logger
import
get_logger
LOGGER
=
get_logger
()
LOGGER
=
get_logger
()
...
...
pus_tc/tmtcc_tc_service_17_test.py
View file @
e8e3dc36
import
enum
import
enum
from
tmtc
_core
.core.definitions
import
QueueCommands
from
tmtc
cmd
.core.definitions
import
QueueCommands
from
tmtc
_core
.pus_tc.tmtcc_pus_tc_base
import
PusTelecommand
,
TcQueueT
from
tmtc
cmd
.pus_tc.tmtcc_pus_tc_base
import
PusTelecommand
,
TcQueueT
class
Srv17Subservices
(
enum
.
IntEnum
):
class
Srv17Subservices
(
enum
.
IntEnum
):
...
...
pus_tc/tmtcc_tc_service_20_parameter.py
View file @
e8e3dc36
from
tmtc
_core
.pus_tc.tmtcc_pus_tc_base
import
PusTelecommand
from
tmtc
cmd
.pus_tc.tmtcc_pus_tc_base
import
PusTelecommand
from
tmtc
_core
.utility.tmtcc_logger
import
get_logger
from
tmtc
cmd
.utility.tmtcc_logger
import
get_logger
logger
=
get_logger
()
logger
=
get_logger
()
...
...
pus_tc/tmtcc_tc_service_3_housekeeping.py
View file @
e8e3dc36
import
enum
import
enum
import
struct
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
Srv3Subservice
(
enum
.
IntEnum
):
class
Srv3Subservice
(
enum
.
IntEnum
):
...
...
pus_tc/tmtcc_tc_service_5_event.py
View file @
e8e3dc36
import
enum
import
enum
from
tmtc
_core
.core.definitions
import
QueueCommands
from
tmtc
cmd
.core.definitions
import
QueueCommands
from
tmtc
_core
.pus_tc.tmtcc_pus_tc_base
import
PusTelecommand
,
TcQueueT
from
tmtc
cmd
.pus_tc.tmtcc_pus_tc_base
import
PusTelecommand
,
TcQueueT
class
Srv5Subservices
(
enum
.
IntEnum
):
class
Srv5Subservices
(
enum
.
IntEnum
):
...
...
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