Notifications Plugin

Plugin to handle error and status notifications.

Supports evaluating arbitrary python expressions placed in gcode DEBUG statements.

example.ngc
#1 = 12.345

; this will set my_label's text to the value of variable #1
(DEBUG, EVAL[vcp.getWidget{"my_label"}.setText{'%4.2f' % #1}])

; this will change the text color of my_label to red
(DEBUG, EVAL[vcp.getWidget{"my_label"}.setStyleSheet{"color: red"}])
class qtpyvcp.plugins.notifications.Notifications(enabled=True, mode='native', max_messages=5, persistent=True, **kwargs)[source]

Notification data plugin

Parameters:
  • enabled (bool, optional) – Enable or disable notification popups (Default = True)
  • mode (str, optional) – native or dbus (Default = ‘native’)
  • max_messages (int, optional) –
  • persistent (bool, optional) – Save notifications on shutdown (Default = True)
timerEvent(event)[source]

Called every 200ms to poll error channel

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.

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.