Base Plugins

class qtpyvcp.plugins.base_plugins.Plugin[source]

QtPyVCP Plugin base class.

initialise()[source]

Initialize the plugin.

This method is called after the main event loop has started. Any timers or threads used by the plugin should be started here.

This method should set self._initialized to true if successfully.

postGuiInitialise(main_window)[source]

Initialize the plugin after mainwindow is shown.

This method is called after the main window is shown. :param main_window: the VCPMainWindow object. :type main_window: VCPMainWindow

This method should set self._postGuiInitialized to true if successfully.

terminate()[source]

Terminate the plugin.

This is called right before the main event loop exits. Any cleanup of the plugin should be done here, such as saving persistent data.

class qtpyvcp.plugins.base_plugins.DataPlugin[source]

DataPlugin.

getChannel(url)[source]

Get data channel from URL.

Parameters:

url (str) – The URL of the channel to get.

Returns:

(chan_obj, chan_exp)

Return type:

tuple

setLogLevel(level)[source]

Set plugin log level.

Parameters:

level (str, int) – Log level (DEBUG | INFO | ERROR | CRITICAL)

class qtpyvcp.plugins.base_plugins.DataChannel(fget=None, fset=None, fstr=None, data=None, settable=False, doc=None)[source]
getValue(*args, **kwargs)[source]

Channel data getter method.

getString(*args, **kwargs)[source]

Channel data getter method.

setValue(value)[source]

Channel data setter method.

notify(slot, *args, **kwargs)[source]

Connect slot to this channel, and hand back the connection.

The returned object is the callback actually connected to the signal, which is not slot itself – it is wrapped for QObject-lifetime safety, and for the string/getter variants it is a fresh closure. So the caller cannot undo the connection with disconnect(slot) later. Returning the wrapper gives subscribers something to pass to unnotify() when they need to stop listening, e.g. a DRO whose reference type changes and must drop the channel it no longer shows.

unnotify(callback)[source]

Undo a notify(), given the callback that call returned.

Tolerates a callback that is already disconnected or whose owner Qt object has gone, so callers can tear down unconditionally.

onValueChanged(slot, *args, **kwargs)

Connect slot to this channel, and hand back the connection.

The returned object is the callback actually connected to the signal, which is not slot itself – it is wrapped for QObject-lifetime safety, and for the string/getter variants it is a fresh closure. So the caller cannot undo the connection with disconnect(slot) later. Returning the wrapper gives subscribers something to pass to unnotify() when they need to stop listening, e.g. a DRO whose reference type changes and must drop the channel it no longer shows.