Skip to content

Commit

Permalink
update docs and deprecated globals module
Browse files Browse the repository at this point in the history
  • Loading branch information
robamu committed May 5, 2024
1 parent 751e11f commit dab9c6b
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 70 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Starting from v4.0.0, this project adheres to [Semantic Versioning](http://semve
- Renamed `add_default_procedure_arguments` to `add_tree_commanding_arguments`.
- Renamed `TcProcedureType.DEFAULT` to `TcProcedureType.TREE_COMMANDING`.
- Replaced `TelemetryListT` by `List[bytes]`.
- Renamed `TcpSpacePacketsComIF` to `TcpSpacePacketsClient`.
- Renamed `TcpSpacePacketsComIF` to `TcpSpacepacketsClient`.
- Renamed `UdpComIF` to `UdpClient`.

## Removed
Expand Down
12 changes: 5 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,20 @@ used either as a command line tool or as a GUI tool which requires a PyQt6 insta
packets and [CCSDS Space Packets](https://public.ccsds.org/Pubs/133x0b2e1.pdf).
This library uses the [spacepackets](https://github.com/us-irs/py-spacepackets) library for most
packet implementations.
- Support for both CLI and GUI usage
- Support for both CLI and GUI usage.
- Flexibility in the way to specify telecommands to send and how to handle incoming telemetry.
This is done by requiring the user to specify callbacks for both TC specification and TM handling.
- One-Queue Mode for simple command sequences and Multi-Queue for more complex command sequences
- Listener mode to only listen to incoming telemetry
- One-Queue Mode for simple command sequences and Multi-Queue for more complex command sequences.
- Listener mode to only listen to incoming telemetry.
- Some components are tailored towards usage with the
[Flight Software Framework (FSFW)](https://absatsw.irs.uni-stuttgart.de/index.html) and the
[sat-rs framework](https://absatsw.irs.uni-stuttgart.de/sat-rs.html)

The framework currently supports the following communication interfaces:
The framework currently supports the following communication interfaces (among others):

1. TCP/IP with UDP and TCP. The TCP interface currently only supports sending CCSDS space packets
and is able to parse those packets from the received data stream.
2. Serial Communication with a transport layer using either [COBS](https://pypi.org/project/cobs/)
encoded packets or DLE as a simple [ASCII based transport layer](https://pypi.org/project/dle-encoder/).
3. QEMU, using a virtual serial interface
2. Serial Communication with a transport layer using [COBS](https://pypi.org/project/cobs/).

It is also possible to supply custom interfaces.

Expand Down
10 changes: 0 additions & 10 deletions docs/api/config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,3 @@ Objects Submodule
:members:
:undoc-members:
:show-inheritance:

Global Module [deprecated]
-----------------------------

This module is deprecated, and usage is discouraged.

.. automodule:: tmtccmd.config.globals
:members:
:undoc-members:
:show-inheritance:
21 changes: 9 additions & 12 deletions docs/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ the TMTC commander
The first way assumes that the OBSW can be run on a host computer and starts a TPC/IP
server internally. The TMTC commander can then be used to send telecommands via the TCP/IP
interface. The second way assumes that the OBSW is run on an external microcontroller.
Here, the serial interface is used to send telecommands. Other ways like sending TMTCs
Here, the serial interface is used to send telecommands. Other ways like sending TMTCs
via Ethernet to a microcontroller running a TCP/IP server are possible as well.

.. _`SOURCE`: https://www.ksat-stuttgart.de/en/our-missions/source/
Expand All @@ -33,25 +33,22 @@ Features
more information and examples.
- Special support for `Packet Utilisation Standard (PUS)`_ packets and `CCSDS Space Packets`_.
This library uses the `spacepackets`_ library for most packet implementations.
- Support for both CLI and GUI usage
- Support for both CLI and GUI usage.
- Flexibility in the way to specify telecommands to send and how to handle incoming telemetry.
This is done by requiring the user to specify callbacks for both TC specification and TM handling.
- One-Queue Mode for simple command sequences and Multi-Queue for more complex command sequences
- Listener mode to only listen to incoming telemetry
- Basic logger components which can be used to store sent Telecommands and incoming Telemetry
in files
- One-Queue Mode for simple command sequences and Multi-Queue for more complex command sequences.
- Listener mode to only listen to incoming telemetry.
- Some components are tailored towards usage with the
`Flight Software Framework (FSFW) <https://egit.irs.uni-stuttgart.de/fsfw/fsfw/>`_.
`Flight Software Framework (FSFW) <https://absatsw.irs.uni-stuttgart.de/projects/fsfw/>`_ and the
`sat-rs library <https://absatsw.irs.uni-stuttgart.de/projects/sat-rs/>`_.

This framework also has a communication interface abstraction which allows to exchange TMTC through
different channels. The framework currently supports the following communication interfaces:
different channels. The framework currently supports (among others) the following communication
interfaces:

1. TCP/IP with the :py:class:`tmtccmd.com.udp.UdpComIF` and :py:class:`tmtccmd.com.tcp.TcpSpacePacketsComIF`.
1. TCP/IP with the :py:class:`tmtccmd.com.udp.UdpClient` and :py:class:`tmtccmd.com.tcp.TcpSpacepacketsClient`.
2. Serial Communication with `COBS <https://pypi.org/project/cobs/>`_ encoded packets by using the
:py:class:`tmtccmd.com.serial_cobs.SerialCobsComIF`.
3. The `DLE ASCII based transport layer <https://pypi.org/project/dle-encoder/>`_ by using the
:py:class:`tmtccmd.com.serial_dle.SerialDleComIF`.
4. QEMU, using a virtual serial interface.

It is also possible to supply custom interfaces.

Expand Down
8 changes: 4 additions & 4 deletions tmtccmd/com/tcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import threading
import select
from collections import deque
from typing import List, Optional, Sequence
from typing import Any, List, Optional, Sequence

from spacepackets.ccsds.spacepacket import parse_space_packets, PacketId

Expand All @@ -27,7 +27,7 @@ class TcpCommunicationType(enum.Enum):
SPACE_PACKETS = 0


class TcpSpacePacketsClient(ComInterface):
class TcpSpacepacketsClient(ComInterface):
"""Communication interface for TCP communication. This particular interface expects
raw space packets to be sent via TCP and uses a list of passed packet IDs to parse for them.
"""
Expand Down Expand Up @@ -74,10 +74,10 @@ def __del__(self):
except IOError:
_LOGGER.warning("Could not close TCP communication interface!")

def initialize(self, args: any = None) -> any:
def initialize(self, args: Any = None):
pass

def open(self, args: any = None):
def open(self, args: Any = None):
if self.is_open():
return
self.__thread_kill_signal.clear()
Expand Down
4 changes: 2 additions & 2 deletions tmtccmd/config/com.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from tmtccmd.com.ser_utils import determine_com_port, determine_baud_rate
from tmtccmd.com.tcpip_utils import TcpIpType, EthAddr
from tmtccmd.com.udp import UdpClient
from tmtccmd.com.tcp import TcpSpacePacketsClient
from tmtccmd.com.tcp import TcpSpacepacketsClient

_LOGGER = logging.getLogger(__name__)

Expand Down Expand Up @@ -219,7 +219,7 @@ def create_default_tcpip_interface(tcpip_cfg: TcpipCfg) -> Optional[ComInterface
)
elif tcpip_cfg.com_if_key == CoreComInterfaces.TCP.value:
assert tcpip_cfg.space_packet_ids is not None
communication_interface = TcpSpacePacketsClient(
communication_interface = TcpSpacepacketsClient(
com_if_id=tcpip_cfg.com_if_key,
space_packet_ids=tcpip_cfg.space_packet_ids,
inner_thread_delay=0.5,
Expand Down
36 changes: 2 additions & 34 deletions tmtccmd/config/globals.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,10 @@
import pprint

from deprecated.sphinx import deprecated
from spacepackets.ecss.conf import (
set_default_tc_apid,
set_default_tm_apid,
)

from tmtccmd.core.globals_manager import update_global, get_global
from tmtccmd.core.globals_manager import update_global
from tmtccmd.config.defs import (
CoreModeList,
CoreServiceList,
CORE_COM_IF_DICT,
CoreComInterfaces,
ComIfDictT,
)
from tmtccmd.config.tmtc import TmtcDefinitionWrapper

Expand Down Expand Up @@ -63,27 +55,6 @@ class CoreGlobalIds(enum.IntEnum):
END = 300


@deprecated(version="6.0.0rc0", reason="globals module deprecated")
def set_json_cfg_path(json_cfg_path: str):
update_global(CoreGlobalIds.JSON_CFG_PATH, json_cfg_path)


@deprecated(version="6.0.0rc0", reason="globals module deprecated")
def get_json_cfg_path() -> str:
return get_global(CoreGlobalIds.JSON_CFG_PATH)


@deprecated(version="6.0.0rc0", reason="globals module deprecated")
def set_glob_com_if_dict(custom_com_if_dict: ComIfDictT):
CORE_COM_IF_DICT.update(custom_com_if_dict)
update_global(CoreGlobalIds.COM_IF_DICT, CORE_COM_IF_DICT)


@deprecated(version="6.0.0rc0", reason="globals module deprecated")
def get_glob_com_if_dict() -> ComIfDictT:
return get_global(CoreGlobalIds.COM_IF_DICT)


@deprecated(version="6.0.0rc0", reason="globals module deprecated")
def set_default_globals_pre_args_parsing(
apid: int,
Expand All @@ -96,17 +67,14 @@ def set_default_globals_pre_args_parsing(
):
if custom_com_if_dict is None:
custom_com_if_dict = dict()
set_default_tc_apid(tc_apid=apid)
set_default_tm_apid(tm_apid=apid)
update_global(CoreGlobalIds.COM_IF, com_if_id)
update_global(CoreGlobalIds.TC_SEND_TIMEOUT_FACTOR, tc_send_timeout_factor)
update_global(CoreGlobalIds.TM_TIMEOUT, tm_timeout)
update_global(CoreGlobalIds.DISPLAY_MODE, display_mode)
update_global(CoreGlobalIds.PRINT_TO_FILE, print_to_file)
update_global(CoreGlobalIds.CURRENT_SERVICE, CoreServiceList.SERVICE_17.value)
update_global(CoreGlobalIds.CURRENT_SERVICE, 17)
update_global(CoreGlobalIds.SERIAL_CONFIG, dict())
update_global(CoreGlobalIds.ETHERNET_CONFIG, dict())
set_glob_com_if_dict(custom_com_if_dict=custom_com_if_dict)
pp = pprint.PrettyPrinter()
update_global(CoreGlobalIds.PRETTY_PRINTER, pp)
update_global(CoreGlobalIds.TM_LISTENER_HANDLE, None)
Expand Down

0 comments on commit dab9c6b

Please sign in to comment.