Satellite Module#
SPDX-FileCopyrightText: 2024 DESY and the Constellation authors SPDX-License-Identifier: EUPL-1.2
This module provides the class for a Constellation Satellite.
- class core.satellite.Satellite(name: str, group: str, cmd_port: int, hb_port: int, mon_port: int, interface: list[str])#
Bases:
CommandReceiver
,CHIRPBroadcaster
,MonitoringSender
,HeartbeatSender
,HeartbeatChecker
Base class for a Constellation Satellite.
- do_initializing(config: Configuration) str #
Method for the device-specific code of ‘initializing’ transition.
This should set configuration variables.
- do_interrupting() str #
Interrupt data acquisition and move to Safe state.
Defaults to calling the stop and land handlers.
- do_run(run_identifier: str) str #
The acquisition event loop.
This method will be started by the Satellite and run in a thread. It therefore needs to monitor the self.stop_running Event and close itself down if the Event is set.
NOTE: This method is not inherently thread-safe as it runs in the context of the Satellite and can modify data accessible to the main thread. However, the state machine can effectively act as a lock and prevent competing access to the same objects while in RUNNING state as long as care is taken in the implementation.
The state machine itself uses the RTC model by default (see https://python-statemachine.readthedocs.io/en/latest/processing_model.html?highlight=thread) which should make the transitions themselves safe.
- get_config(_request: CSCP1Message | None = None) tuple[str, Any, dict[str, Any]] #
Get current satellite configuration.
No payload argument.
- get_run_id(_request: CSCP1Message | None = None) tuple[str, Any, dict[str, Any]] #
Get current/last known run identifier.
No payload argument.
- class core.satellite.SatelliteArgumentParser(*args: Any, **kwargs: Any)#
Bases:
ConstellationArgumentParser
Customized Argument parser providing common Satellite options.