Mercury2 Hardware Manager  1.0dev
The hardware manager component of the Mercury2 ground station suite.
 All Classes Namespaces Functions Variables Pages
hwm.core.initialization Namespace Reference

Initializes the Hardware Manager application. More...

Functions

def initialize
 Initializes the Mercury2 Hardware Manager. More...
 
def initial_setup
 Performs initial setup operations, such as copying default configuration files, if needed. More...
 
def _announce_start
 Announces the application start to the console and application logs. More...
 
def _setup_schedule_manager
 Initializes the schedule manager. More...
 
def _setup_command_system
 Sets up the command system. More...
 
def _setup_network_listeners
 Initializes the various network listeners used by the hardware manager. More...
 
def _setup_configuration
 Sets up the HWM configuration class. More...
 
def _setup_logs
 Sets up the logger. More...
 

Detailed Description

Initializes the Hardware Manager application.

This module contains the methods responsible for initializing and starting the Hardware Manager. This entails setting up the application state and starting the reactor loop.

Function Documentation

def hwm.core.initialization._announce_start ( )
private

Announces the application start to the console and application logs.

def hwm.core.initialization._setup_command_system ( )
private

Sets up the command system.

This function sets up the CommandParser class which is responsible for parsing, validating, and executing commands (either from the network or internal scripts). It also, consequently, initializes the permission system which updates and exposes user command execution permissions.

Returns
Returns a reference to the new CommandParser instance.
def hwm.core.initialization._setup_configuration ( )
private

Sets up the HWM configuration class.

This function initializes the HWM configuration class (a singleton) by loading the required configuration files into it and validating the loaded configuration against the configuration schema (which defines which options are required and any formatting constraints).

Exceptions
Maypass on ConfigInvalid exceptions if the loaded configuration set is invalid or incomplete.
def hwm.core.initialization._setup_logs ( )
private

Sets up the logger.

Note
All log messages >= INFO are sent to the console, as well as the log file.
def hwm.core.initialization._setup_network_listeners (   command_parser,
  session_coordinator 
)
private

Initializes the various network listeners used by the hardware manager.

This method initializes the network listeners required to accept ground station commands and relay pipeline data streams.

Parameters
command_parserAn instance of CommandParser which will be used to handle commands received over the network.
session_coordinatorA SessionCoordinator instance that will be passed to the pipeline protocol factories which will allow them to associate connections with existing sessions.
def hwm.core.initialization._setup_schedule_manager ( )
private

Initializes the schedule manager.

This function initializes the schedule manager based on the location of the schedule (either local or remote).

Returns
Returns an instance to the new ScheduleManager instance.
def hwm.core.initialization.initial_setup ( )

Performs initial setup operations, such as copying default configuration files, if needed.

This function performs various initial setup procedures such as copying the default configuration files, and setting up the application system directories.

Note
This function only needs to be called once right after the hardware manager is installed. Any subsequent calls will only copy files that don't already exist on the system (to prevent custom configuration files from being overridden).
def hwm.core.initialization.initialize ( )

Initializes the Mercury2 Hardware Manager.

This method sets up the hardware manager by initializing the required resources (e.g. pipeline manager, schedule manager, configuration, etc.) and starting the event reactor. This is the main entry location for the hardware manager.

Note
Any unhandled errors that occur before the event reactor is started will cause the program to exit.