Designer Engine API
-
class
metavision_designer_engine.
CombinedFilter
Abstract class implementing wrappers for a filter component which is both a producer and a consumer.
-
set_name
(self: metavision_designer_engine.CombinedFilter, name: str) → None Sets the name of the component
- Parameters
name (str) – Name to set
-
-
class
metavision_designer_engine.
Controller
(self: metavision_designer_engine.Controller, parallel_threads: bool = True) → None The Controller manages a filtering chain.
The controller is in charge of managing all the elements constituting an application. It will manage the filters, their buffers, and the parallel execution of the simulation across time. All the filters used in the chain should be added to one controller object which will assure that every filter is updated in the right order to make a valid simulation.
- Parameters
parallel_threads (bool, optional) – Defines if simulation should run in a single or multi threads (default : True)
-
class
RenderingMode
(self: metavision_designer_engine.Controller.RenderingMode, value: int) → None Members:
WallClock
SimulationClock
SlowestClock
-
property
name
-
property
-
class
SyncMode
(self: metavision_designer_engine.Controller.SyncMode, value: int) → None Members:
CameraTiming
SliceTiming
-
property
name
-
property
-
add_component
(*args, **kwargs) Overloaded function.
add_component(self: metavision_designer_engine.Controller, component: Metavision::CombinedFilter, name: str = ‘’) -> None
Adds a CombinedFilter to the controller
- Parameters
component (CombinedFilter) – Producer object
name (string, optional) – Name of this component (default : “”)
add_component(self: metavision_designer_engine.Controller, component: Metavision::Consumer, name: str = ‘’) -> None
Adds a Consumer to the controller
- Parameters
component (Consumer) – Consumer object
name (string, optional) – Name of this component (default : “”)
add_component(self: metavision_designer_engine.Controller, component: metavision_designer_engine.Producer, name: str = ‘’) -> None
Adds a Producer to the controller
- Parameters
component (Producer) – Producer object
name (string, optional) – Name of this component (default : “”)
-
add_device_interface
(self: metavision_designer_engine.Controller, device_interface: metavision_designer_engine.DeviceInterface) → None Adds a device interface to get events from
- Parameters
device_interface (DeviceInterface) – Instance of a DeviceInterface
-
add_renderer
(self: metavision_designer_engine.Controller, renderer: metavision_designer_engine.Renderer, mode: metavision_designer_engine.Controller.RenderingMode, fps: float) → None Adds a Renderer to the controller
- Parameters
renderer (Renderer) – Renderer to add to the pipeline
mode (RenderingMode) – Rendering mode associated to the renderer
fps (float) – Frame per second desired for the renderer. The value is interpreted according to the given mode
-
are_producers_done
(self: metavision_designer_engine.Controller) → bool Returns the status of the producers
- Returns
True if all producers have no more events to produce
- Return type
bool
-
enable_rendering
(self: metavision_designer_engine.Controller, enable: bool) → None Enables or disables all registered renderers
- Parameters
enable (bool) – If True, enables rendering
-
enable_sparse_rendering
(self: metavision_designer_engine.Controller, enable: bool) → None Enables or disables sparse image generation (for supported filters)
- Parameters
enable (bool) – If True, enable sparse rendering
-
get_batch_duration
(self: metavision_designer_engine.Controller) → int Gets the currently used batch duration
- Returns
Current batch duration (in us)
- Return type
int
-
get_last_key_pressed
(self: metavision_designer_engine.Controller) → int Returns the last keyboard event received in the window
- Returns
Last key event
- Return type
-
get_slice_duration
(self: metavision_designer_engine.Controller) → int Gets the currently used slice duration
- Returns
Current slice duration (in us)
- Return type
int
-
get_sync_mode
(self: metavision_designer_engine.Controller) → metavision_designer_engine.Controller.SyncMode Gets tue currently used sync_mode
Returns: SyncMode: Current sync mode
-
get_time
(self: metavision_designer_engine.Controller) → int Returns the current timestamp of the Controller
- Returns
Current timestamp (in us)
- Return type
int
-
is_done
(self: metavision_designer_engine.Controller) → bool Convenient method, to return status of both producers and pipeline
- Returns
True if is_pipeline_empty() and are_producers_done() returns True
- Return type
bool
-
is_pipeline_empty
(self: metavision_designer_engine.Controller) → bool Returns the pipeline status
- Returns
True if there are no events in the Controller pipeline
- Return type
bool
-
print_stats
(self: metavision_designer_engine.Controller, print_addresses: bool = False) → None Prints pipeline statistics about time usage
- Parameters
print_addresses (bool) – If True, print filters addresses (default : False)
-
process_ui_events
(self: metavision_designer_engine.Controller) → None Indicates to the controller to ask the user interface to process the UI events if any
-
run
(*args, **kwargs) Overloaded function.
run(self: metavision_designer_engine.Controller, max_dt: int, end_time: int, sync: bool) -> float
- end_time (int): Run function returns as soon as ‘dt’ + the timestamp of the last simulation step
is after end_time
sync (bool): If true, function won’t return before end_time is reached in the sync mode set
- Returns
Execution time (in seconds)
- Return type
int
run(self: metavision_designer_engine.Controller) -> float
Runs one batch of simulation from the last simulated timestamp up to last simulated timestamp plus batch duration If the batch duration has not been set, the loop will end after one slice. The slice size is either the one provided at the controller construction or the default value: ‘DEFAULT_TIME_SLICE’ The sync mode is the one set with ‘set_sync_mode’ method
- Returns
Execution time (in seconds)
- Return type
int
run(self: metavision_designer_engine.Controller, sync: bool) -> float
Runs one batch of simulation from the last simulated timestamp up to last simulated timestamp plus batch duration. If the batch duration has not been set, the loop will end after one slice. The slice size is either the one provided at the controller construction or the default value: ‘DEFAULT_TIME_SLICE’
- Parameters
sync (bool) – If true, function won’t return before end_time is reached in the sync mode set
- Returns
Execution time (in seconds)
- Return type
int
-
set_batch_duration
(self: metavision_designer_engine.Controller, batch_duration: int) → None Sets the desired batch duration
- Parameters
batch_duration (int) – Batch duration (in us)
-
set_slice_duration
(self: metavision_designer_engine.Controller, slice_duration: int) → None Sets the desired slice duration
- Parameters
slice_duration (int) – Slice duration (in us)
-
set_sync_mode
(self: metavision_designer_engine.Controller, sync_mode: metavision_designer_engine.Controller.SyncMode) → None Sets the desired synchronization mode
- Parameters
sync_mode (SyncMode) – Can be one of the Controller.SyncMode value
-
class
metavision_designer_engine.
DeviceInterface
Abstract class implementing the basic interface needed to be recognized as a device interface component.
This interface allows the controller to periodically poll some hardware device.
- Parameters
polling_interval (float) – Polling interval in seconds.
-
set_name
(self: metavision_designer_engine.DeviceInterface, name: str) → None Sets the name of the DeviceInterface
- Parameters
name (str) – Name to set
-
class
metavision_designer_engine.
KeyboardEvent
Commodity class exposing the Symbol enum.
KeyboardEvent.Symbol enum defines key symbols that can be retrieved from Controller.get_last_key_pressed().
-
class
Symbol
(self: metavision_designer_engine.KeyboardEvent.Symbol, value: int) → None Members:
Alt
Backspace
Backtab
Ctrl
Down
End
Enter
Escape
F1
F10
F11
F12
F2
F3
F4
F5
F6
F7
F8
F9
Home
Insert
Left
Page_up
Page_down
Pause
Print
Return
Right
Shift
Space
Suppr
Tab
Up
-
property
name
-
property
-
class
-
class
metavision_designer_engine.
Renderer
Abstract class implementing the basic interface needed to be recognized as a component able to render some data. This interface allows the controller to perform real time rendering at given frame rates considering wall clock time instead of simulation time.
-
set_name
(self: metavision_designer_engine.Renderer, name: str) → None Sets the renderer’s name attribute
- Parameters
name (str) – Name to set on the renderer
-