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)
debug_message

Debug messages from LinuxCNC.

info_message

Gives messages from GCode. Syntax: (MSG, …) (DEBUG, …) See http://linuxcnc.org/docs/html/gcode/overview.html#gcode:messages for more information.

warn_message

Warning messages from LinuxCNC.

error_message

Error messages from LinuxCNC.

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.

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.