DishMode Model
This model enforces the legal transitions when a command is triggered. It assesses the current state of the device to decide if the requested state is a nearby node to allow or reject a command.
- class DishModeModel[source]
Representation of the mode transition diagram, depicting commanded transitions.
- is_command_allowed(cmd_name, dish_mode=None, component_manager=None, progress_callback=None)[source]
Determine if requested tango command is allowed based on current dish mode.
This method is used by the executor to evaluate the command pre-condition after it’s taken off the queue. To ensure the evaluation is always performed using an updated component state (and not the old state used when the command is queued), the component manager should be passed for the enqueue operation. In testing scenarios for example, the function can be evoked directly with the dishmode parameter.
NOTE: Though the function signature has only one required argument, it still needs either the dish_mode or component_manager passed to it to perform the evaluation.
- Parameters:
cmd_name – the requested command
dish_mode – the current dishMode reported by the component state
component_manager – the component manager containing the component state
progress_callback – progress_callback function to report progress
- Raises:
TypeError – when no dish_mode or component_manager is provided to function call
- Returns:
boolean indicating the function execution is allowed