papi.plugin.base_classes package

Submodules

papi.plugin.base_classes.PaPISubWindow module

Contributors: Stefan Ruppin

class papi.plugin.base_classes.PaPISubWindow.PaPISubWindow(parent=None)[source]

Bases: PyQt5.QtWidgets.QMdiSubWindow

contextMenuEvent(QContextMenuEvent)[source]
disableInteraction()[source]
enableInteraction()[source]
isInteractionAllowed()[source]
mouseMoveEvent(QMouseEvent)[source]

papi.plugin.base_classes.ParameterWindow module

class papi.plugin.base_classes.ParameterWindow.ParameterWindow(dplugin, api, pl_win_name='', parent=None)[source]

Bases: PyQt5.QtWidgets.QMainWindow

data_changed_parameter_model(index, n)[source]

This function is called when a dparameter value is changed by editing the ‘value’-column.

Parameters:
  • index – Index of current changed dparameter
  • n – None
Returns:

show_paramters(para_list)[source]

Shows the list of parameters and values in the parameter window :param para_list: :return:

papi.plugin.base_classes.base_ownProcess module

Contributors: <Stefan Ruppin

class papi.plugin.base_classes.base_ownProcess.base_ownProcess[source]

Bases: papi.plugin.base_classes.base_plugin.base_plugin

This plugin base should be used by a plugin if should run in an own process. It is not possible to create a widget which is displayed in the graphical interface of PaPI.

pl_set_event_trigger_mode(mode)[source]

Enables the plugin developer to set the event_trigger_mode. This meas that when set to TRUE, the plugin is set to be event triggered which means that the cb_execute function will only be called when a new event (newData) arrives.

default will mean the default value for the specific plugin type.

Parameters:mode – True, False, or ‘default’
Returns:

papi.plugin.base_classes.base_plugin module

Contributors: Stefan Ruppin Sven Knuth

class papi.plugin.base_classes.base_plugin.base_plugin[source]

Bases: papi.yapsy.IPlugin.IPlugin

This class is used as basis class for all other plugin bases

cb_execute(Data=None, block_name=None, plugin_uname=None)[source]

Called by the PaPI framework when new date can be processed.

Parameters:
  • Data – Contains a hash with an array for every key.
  • block_name – Block of the plugin to which the signal belongs
  • plugin_uname – Plugin which sent this data.
Returns:

cb_get_plugin_configuration()[source]

Returns the plugin specific configuration.

Returns:
cb_pause()[source]

Called when the plugin should pause.

Returns:
cb_plugin_meta_updated()[source]

Function which is called when ever the meta information were updated.

Returns:
cb_quit()[source]

Called when the plugin should quit. Must be implemented !

Returns:
cb_resume()[source]

Called when the plugin should resume.

Returns:
cb_set_parameter(parameter_name, parameter_value)[source]

Called when a parameter was changed. This function is called with the parameter name and its current value.

Parameters:
  • parameter_name – Name of parameter
  • parameter_value – New value of the parameter
Returns:

pl_create_DBlock(block_name)[source]

Creates a DBlock for use in a PaPI Plugin.

Parameters:block_name (str) – Name of the block
Returns:DBlock Object or None in case of error
pl_create_DEvent(event_name)[source]

Creates a DEvent for use in a PaPI Plugin

Parameters:event_name (str) – Name of the event
Returns:DEvent object or None in case of error
pl_create_DParameter(parameter_name, default_value=0, regex=None, optional_object_to_store=None)[source]

Creates a DParameter for use in a PaPI Plugin

Parameters:
  • parameter_name (str) – Name of parameter
  • default_value – Default value for GUI to display
  • regex – Regex string for GUI to filter user inputs
  • optional_object_to_store – optional object to store within parameter object
Returns:

DParameter object or None in case of error

pl_create_DSignal(signal_uname, display_name=None)[source]

Creates a DSignal for use in a PaPI Plugin.

Parameters:
  • signal_uname (str) – unique name of the signal (unique in block context)
  • display_name (str) – Name to display (alias) of the signal
Returns:

DSignal Object or None in case of error

pl_emit_event(data, event)[source]

This function is used by plugins to emit a specific event.

Parameters:
  • data – New value provided by the DEvent
  • event – DEvent which should be emitted.
Returns:

pl_get_config_element(field_name, sub_field=None, castHandler=None)[source]

Methods enables the user to get a field value of the current configuration. If the field_name exists, the ‘value’ part will be returned. If sub_field is given, return the sub_field instead of ‘value’

Parameters:
  • field_name (basestring) – Name of the field to return value from.
  • sub_field (basestring) – Name of the sub_field to return value instead of ‘value’ field.
Returns:

None if field does not exist or cfg is none, otherwise return field value (as basestring).

pl_get_current_config()[source]

Used to get the current configuration. This will make a deepcopy of the config dict and return it. So, the result can be changed without affection the ‘real’ plugin configuration which is saved to files or used for future starts of this (saved) plugin. :return: deepcopy of _config dict

pl_get_current_config_ref()[source]

Used to get the current configuration, enables you to change it directly! Changes done to this config reference will be saved within the plugin. This config will be used when saving the plugin in a papi_config to a file (e.g. xml) and will be reused on reload.

Returns:link/ref configuration dict (NO COPY)
pl_get_dplugin_info()[source]

Getter for the dplugin info object of type DPlugin

Returns:DPlugin Object
pl_get_plugin_path()[source]
pl_send_delete_block(block)[source]

Used to inform the PaPI framework that a single DBlock was deleted.

Parameters:block – Block which should be deleted.
Returns:
pl_send_delete_parameter(parameter)[source]

Used to inform the PaPI framework that a single DParameter was deleted.

Parameters:parameter – DParameter which should be deleted.
Returns:
pl_send_new_block_list(blocks)[source]

Used to inform the PaPI framework about all DBlocks provided by this plugins.

Parameters:blocks – List of DBlocks
Returns:
pl_send_new_data(block_name, time_line, data)[source]

This function is called by plugins to send new data for a single block.

Parameters:
  • block_name – Name of the block
  • time_line – A time vector
  • data – Data containing the values in a hash array of signal names as key.
Returns:

pl_send_new_event_list(events)[source]

Used to inform the PaPI framework about all DEvents provided by this plugins.

Parameters:events – List of DEvents
Returns:
pl_send_new_parameter_list(parameters)[source]

Used to inform the PaPI framework about all DParameters provided by this plugins.

Parameters:parameters – List of DParameters
Returns:
pl_set_config_element(field_name, value)[source]

Setter function used to set fields in the plugin configuration. It will modify the ‘value’ field of the field with name field_name.

Parameters:
  • field_name (basestring) – Name of the field to change value of.
  • value
Returns:

True, if field got changed in _config. False, if not.

papi.plugin.base_classes.base_visual module

Contributors: Stefan Ruppin

class papi.plugin.base_classes.base_visual.base_visual[source]

Bases: papi.plugin.base_classes.base_plugin.base_plugin

This class is used by all plugins which are not running in an own process. They are all executed the gui process.

cb_new_parameter_info(dparameter_object)[source]

Will be called to notify a plugin that a new parameter subscription was done and will give information about the init values :param dparameter_object: DParameter :return:

pl_create_control_context_menu()[source]

This function will create the general PaPI Control context menu to be used in Plugins.

Returns:QMenu
pl_get_widget()[source]

Getter method to get widget of plugin

Returns:QWidget
pl_set_widget_for_internal_usage(widget)[source]

Will take QWidget and will place it in the subwindow

Gets called by plugin developer!

Parameters:widget (QWidget) – QWidget
Returns:

papi.plugin.base_classes.dpp_base module

Contributors: <Stefan Ruppin

class papi.plugin.base_classes.dpp_base.dpp_base[source]

Bases: papi.plugin.base_classes.base_ownProcess.base_ownProcess

This kind of plugin is to process data provided by other plugins.

cb_initialize_plugin()[source]

Callback function to be implemented by the plugin developer for the init phase of a plugin

Returns:

papi.plugin.base_classes.iop_base module

Contributors: <Stefan Ruppin

class papi.plugin.base_classes.iop_base.iop_base[source]

Bases: papi.plugin.base_classes.base_ownProcess.base_ownProcess

This plugin is used to create an interface to different data sources.

cb_initialize_plugin()[source]

Callback function to be implemented by the plugin developer for the init phase of a plugin

Returns:

papi.plugin.base_classes.vip_base module

Contributors: Stefan Ruppin

class papi.plugin.base_classes.vip_base.vip_base[source]

Bases: papi.plugin.base_classes.base_visual.base_visual

Base class to inherent from when creation a visual plugin for th gui

cb_initialize_plugin()[source]

Callback function to be implemented by the plugin developer for the init phase of a plugin

Returns:

Module contents