Ceed Viewer side App
Ceed starts a second process when it runs an actual experiment and all the shapes and their intensities that are ultimately displayed on the projector are displayed in this second process, full-screen.
This module is the Ceed app that the second process runs. It shares most of the
same configuration as the main CeedApp
, but the GUI
is very simple because it only plays the shapes and forwards any keyboard
interactions to the main Ceed process.
- class ceed.view.main.CeedViewApp(**kwargs)
Bases:
base_kivy_app.app.BaseKivyApp
The app which runs the GUI in the second Ceed process.
- external_function_plugin_package: str = ''
Same as
external_function_plugin_package
.
- external_stage_plugin_package: str = ''
Same as
external_stage_plugin_package
.
- view_controller: ceed.view.controller.ViewSideViewControllerBase = None
Same as
view_controller
.
- ceed_data: ceed.storage.controller.CeedDataWriterBase = None
Same as
ceed_data
.
- data_serializer: ceed.storage.controller.DataSerializerBase = None
Same as
data_serializer
.
- function_factory: ceed.function.FunctionFactoryBase = None
Same as
function_factory
.
- shape_factory: ceed.shape.CeedPaintCanvasBehavior = None
Same as
shape_factory
.
- stage_factory: ceed.stage.StageFactoryBase = None
Same as
stage_factory
.
- init_load()
Creates any config files and adds
data_path
to the kivy resource PATH when the app is instantiated.
- get_display_canvas()
Gets the canvas of the widget to which all the shapes graphics will be added.
- build()
Similar to App’s build, but it takes the root widget if provided and if
inspect
is True, it activates kivy’s inspector.- Parameters
root – The root widget instance.
- Returns
The root widget
- get_root_pixels()
Returns all the pixels values of the widget containing the shapes, as well as the size of that widget.
This is how you can save an image of whatever is currently displayed on screen.
- on_start()
Event handler for the on_start event which is fired after initialization (after build() has been called) but before the application has started running.
- ask_cannot_close(*largs, **kwargs)
Called by kivy when the user tries to close the app. It only closes if this returns False.
This is only used when the app is started with
run_app()
orrun_app_async()
.
- handle_exception(exception, exc_info=None, event=None, obj=None, level='error', *largs)
Should be called whenever an exception is caught in the app.
If the app is started with
run_app()
orrun_app_async()
, this is called if kivy encounters an error. Similarly,app_error()
,app_error_async()
, andreport_exception_in_app()
call this on the app upon an exception.It logs the message to the logger using
get_logger()
.- Parameters
- exception: string or exception object
The caught exception (i.e. the
e
inexcept Exception as e
)- exc_info: stack trace
If not None, the return value of
sys.exc_info()
or a stringified version of it. It is used to log the stack trace.- level: string
The log level to use on the message. Can be
'error'
,'exception'
(with the same meaning), or any other python log level.
- get_logger()
Returns the logger to use in
handle_exception()
to log messages.Defaults to returning the Kivy Logger.
- ceed.view.main.run_app()
The function that starts the GUI and runs
CeedViewApp
.This is the entry point for the main script.
- class ceed.view.main.ViewRootWidget(**kwargs)
Bases:
ceed.view.view_widgets.ViewRootFocusBehavior
,kivy.uix.widget.Widget
The widget that is the root kivy widget in the app.