|
Mercury2 Hardware Manager
1.0dev
The hardware manager component of the Mercury2 ground station suite.
|
This module contains functions used to build a command's meta-data dictionary. More...
Classes | |
| class | InvalidCommandMetadata |
| class | InvalidCommandAddress |
Functions | |
| def | build_metadata_dict |
| Builds the command meta-data structure for a specific command. More... | |
This module contains functions used to build a command's meta-data dictionary.
This dictionary defines how to reach a specific command, what parameters it accepts, and whether or not it requires an active session to run.
Periodically, a command's meta-data dictionary is loaded by the system state packager which then serializes it and sends it to the user interface. The user interface will use the metadata to build an appropriate form to allow the user to easily execute the command.
| def hwm.command.metadata.build_metadata_dict | ( | command_parameters, | |
| command_id, | |||
| command_handler_name, | |||
requires_active_session = True, |
|||
dangerous = True, |
|||
schedulable = False, |
|||
use_as_initial_value = False |
|||
| ) |
Builds the command meta-data structure for a specific command.
Command handlers use this function to build the command meta-data structures for the commands they service. For the most part, all command meta-data structures must be built using this command. If a command meta-data structure does not conform to this format, an error will be generated by the status packager or the user interface won't be able to construct a form for it.
| May | throw InvalidCommandParameters in the event that the supplied parameter dictionary isn't valid. |
| May | throw InvalidCommandAddress if neither command_handler_name or device_id are set. |
| command_parameters | An array of dictionaries containing the parameters that the command accepts along with any basic restrictions on the parameter value. Currently, the following types and restrictions are supported:
|
If a restriction is left blank, the user interface will use a default value. Unrecognized/unsupported attributes will be ignored (but allowed).
| command_id | The ID of the command. This must be unique per command handler. |
| command_handler_name | The name of the system command handler that the command is located in. This is used by user interface to address user commands to the appropriate handler. If the command is a device command, then this will be the device ID. |
| requires_active_session | Whether or not the command requires an active session to be executed. If the command is a system command, then the command handler must perform its own validations on the session. If the command is a device command, the command parser will make sure that the user has an active session with a pipeline that uses the hardware device before executing the command (and the command handler may perform any additional validations on its own if needed). |
| dangerous | If the command is dangerous, it could possibly dangerously modify the ground station state (e.g. turn of devices, delete sessions, etc.). This flag will cause the user interface to restrict access to the command by default (which can be overridden if desired). |
| schedulable | Indicates that the command can be scheduled using the reservation scheduling service (if the active pipeline supports it). If it can, the user interface will use this to build a form to schedule this command during the reservation process. |
| use_as_initial_value | If set, the user interface will use this command when building the device or system's initial state configuration forms during the reservation process. This can be used, for example, to set the initial frequency that a radio should be tunned to. |