jinks_core.runner¶
Runner module where widgets are called and combined.
Classes
|
Execute |
|
Widget related information for runtime. |
Exceptions
Runner error. |
|
Runtime widget error. |
|
Widget Master-Slave error. |
- exception jinks_core.runner.JinksWidgetError¶
Bases:
JinksErrorRuntime widget error.
- exception jinks_core.runner.JinksWidgetMasterSlaveError¶
Bases:
JinksErrorWidget Master-Slave error.
- exception jinks_core.runner.JinksRunnerError¶
Bases:
JinksErrorRunner error.
- class jinks_core.runner.RunningWidget(*args, obj, data_group_master, **kwargs)¶
Bases:
ConfigurationWidgetWidget related information for runtime.
- output_data: Any | None = None¶
- display_image: Image | None = None¶
- __init__(*args, obj, data_group_master, **kwargs)¶
- obj: WidgetProtocol¶
- data_group_master: RunningWidget | None¶
- static from_configuration_widget(configuration_widget, obj, data_group_master)¶
Create a :py:class`RunningWidget` instance from an instanced parent class :py:class`ConfigurationWidget`.
- Return type:
- property has_data_method: bool¶
Checks if the widget object has a data method.
- async get_data(extra_arguments, keep_previous=False)¶
Get the widget data by executing the data method if it exists.
- Parameters:
extra_arguments (
dict[str,Any])keep_previous (
bool) – Keep the previously successful data request.
- Return type:
None
- async get_display(extra_arguments)¶
Get the widget image by executing the display method.
- Parameters:
extra_arguments (
dict[str,Any])- Return type:
None
- static filter_args(func, filtered_args)¶
Filter unrequired arguments.
- Return type:
dict[str,Any]
- async static run_sync_async(fn, *args, **kwargs)¶
Run synchronous or asynchronous methods asynchronously.
- Return type:
TypeVar(R)
- class jinks_core.runner.Runner(arguments, configuration, device, display, widgets, image2display)¶
Bases:
objectExecute
WidgetTemplate.data()andWidgetTemplate.display()and send final image to display.- inited_display: DisplayProtocol | None = None¶
- __init__(arguments, configuration, device, display, widgets, image2display)¶
- arguments: Namespace¶
- configuration: Configuration¶
- device: type[DeviceProtocol]¶
- display: type[DisplayProtocol]¶
- requested_widgets: dict[str, type[WidgetProtocol]]¶
- image2display: Image2Display¶
- running_widgets: list[RunningWidget]¶
- static init_running_widgets(config_widgets, widget_objects)¶
Prepare widgets to run.
- Return type:
list[RunningWidget]
- init_display()¶
Instantiate the device and display classes.
- Return type:
None
- refresh(target_time, get_all_data=False)¶
Refresh screen.
- Return type:
None
- partial_refresh(target_time, get_all_data=False)¶
Refresh screen partially.
- Return type:
None
- static turn_image(image, rotate, invert)¶
Convert the final image for the display by rotating and/or inverting if required.
- Return type:
Image
- get_image(target_time, get_all_data=False)¶
Get the image for the target_time.
- Return type:
Image
- run_data(target_time, get_all=False)¶
Run all available widget data methods asynchronously.
- Return type:
None
- get_data_widgets(timestamp, get_all=False)¶
Filter through widgets to get the ones that require to run data.
- Return type:
Generator[RunningWidget,None,None]
- run_display()¶
Run all widget display methods asynchronously.
- Return type:
Image
- draw_widget_error(width, height)¶
Draw a widget error image.
- Return type:
Image