Mach Modules Documentation
Lua Module API Documentation
Loading...
Searching...
No Matches
CommonScreenV02.lua File Reference

Go to the source code of this file.

Functions

CommonScreenV02 RunHooks (hook_name,...)
 Execute registered hook functions for a named event in priority order and return the result.
CommonScreenV02 GetRootElementNames ()
 Return the list of candidate root element names for the current screen layout.
CommonScreenV02 ScreenLoadScript ()
 Execute the screen load script to initialize global state tables, signal library, and screen subsystems.
CommonScreenV02 ScreenUnloadScript ()
 Execute cleanup actions when the screen is unloaded.
CommonScreenV02 UpdateScreenFonts ()
 Update the font face name for all applicable screen controls based on the current formatting settings.
CommonScreenV02 StartUpScript ()
 Execute the startup script to initialize all screen subsystems after the screen loads.
CommonScreenV02 LowPriorityLoop ()
 Execute the low priority loop to update non-critical screen elements periodically.
CommonScreenV02 PLCScript ()
 Execute the PLC script loop updating machine state indicators, spindle load, and axis gauges.
CommonScreenV02 MachStateChanged ()
 Handle a machine state change event and update instance button borders.
CommonScreenV02 MachineCycleStartFinal ()
 Final cycle start validation hook that prevents starting from the Tools or Fixtures tab.
CommonScreenV02 UpdateToolSetters ()
 Update the manual and auto tool setter height DROs with the current setter positions.
CommonScreenV02 InitializeToolLifeManagement ()
 Initialize the Tool Life Management group visibility based on the ToolLifeManagmentEnabled OEM register.
CommonScreenV02 SetTabFontSizes ()
 Set the font point size for all standard tab notebook controls on the screen.
CommonScreenV02 ToolPathExistsInScreen (inst)
 Check whether a toolpath display panel exists in the current screen layout.
CommonScreenV02 GetToolPathName (inst)
 Get the screen object name for the toolpath display panel for a given instance.
CommonScreenV02 GetToolPathGroupName ()
 Get the name of the toolpath group container for the current screen layout.
CommonScreenV02 ToolPathViewTopBtn ()
 Set the toolpath view to the top view.
CommonScreenV02 ToolPathViewBottomBtn ()
 Set the toolpath view to the bottom view.
CommonScreenV02 ToolPathViewLeftBtn ()
 Set the toolpath view to the left-side view.
CommonScreenV02 ToolPathViewRightBtn ()
 Set the toolpath view to the right-side view.
CommonScreenV02 ToolPathViewISOBtn ()
 Set the toolpath view to the ISO (isometric) view.
CommonScreenV02 ToolPathViewDefaultBtn ()
 Set the toolpath view to the default view.
CommonScreenV02 SetToolPathView (view)
 Set the toolpath view for all toolpath panels, toggling to default if the view is already active.
CommonScreenV02 InitializeToolPathDefaultView ()
 Initialize the toolpath default view from the profile and apply it to all toolpath panels.
CommonScreenV02 InitializeToolPathShowMachineBoundaries ()
 Initialize the toolpath machine boundary display based on the ToolPathShowMachineBoundaries OEM parameter.
CommonScreenV02 IsMDIModeActive ()
 Check whether MDI mode is currently active.
CommonScreenV02 ExecuteMDI ()
 Execute the current MDI command string from the MDI dialog.
CommonScreenV02 IsDROModeActive ()
 Check whether DRO mode is currently active.
CommonScreenV02 UpdateStatusGroup ()
 Update the StatusGroup label with the current machine state name.
CommonScreenV02 UpdateGCodeGroup ()
 Update the GCodeSmallGroup and GCodeLargeGroup labels with the current G-code filename.
CommonScreenV02 IsToolPathDisplayLarge ()
 Check whether the toolpath display group is currently in the large size.
CommonScreenV02 SetGCodeDisplayToLastSize ()
 Restore the G-code display to the last saved size (large, small, or extra-large).
CommonScreenV02 HideGCodeDisplayAndToolPath ()
 Hide all G-code display groups and the toolpath display.
CommonScreenV02 GetSmallToolPathGroupHeight ()
 Get the height value for the small toolpath group container.
CommonScreenV02 GetSmallToolPathGroupBgImageName ()
 Get the background image filename for the small toolpath group.
CommonScreenV02 GetSmallToolPathPanelHeight ()
 Get the height value for the small toolpath panel.
CommonScreenV02 GetLargeToolPathGroupHeight ()
 Get the height value for the large toolpath group container.
CommonScreenV02 GetLargeToolPathGroupBgImageName ()
 Get the background image filename for the large toolpath group.
CommonScreenV02 GetLargeToolPathPanelHeight ()
 Get the height value for the large toolpath panel.
CommonScreenV02 GetToolPathPanelCurrentHeight ()
 Get the current toolpath panel height based on the active G-code display size.
CommonScreenV02 SetToolPathDisplaySmall ()
 Set the toolpath display panel to the small size.
CommonScreenV02 SetToolPathDisplayLarge ()
 Set the toolpath display panel to the large size.
CommonScreenV02 InitializeToolPathDisplay ()
 Initialize toolpath display panels for all instances and set the default view.
CommonScreenV02 HideToolPathDisplay ()
 Hide all toolpath display panels on the screen.
CommonScreenV02 ShowToolPathDisplay ()
 Show the toolpath display for the currently selected instance.
CommonScreenV02 ShowToolPathPanelsForSelectedInstance (force)
 Show the toolpath panel for the currently selected instance.
CommonScreenV02 ShowToolPathPanelsForInstance (inst, force)
 Show the toolpath panel for a specific instance, hiding all others.
CommonScreenV02 IsShownToolPathPanelsForInstance (inst)
 Check whether the toolpath panel for a specific instance is currently shown.
CommonScreenV02 IsGCodeDisplaySmallShown ()
 Check whether the small G-code display group is currently shown.
CommonScreenV02 SetGCodeDisplaySmall ()
 Switch the G-code display to the small (collapsed) view with toolpath visible.
CommonScreenV02 IsGCodeDisplayExtraLargeEnabled ()
 Check whether the extra-large G-code view feature is enabled in the profile.
CommonScreenV02 IsGCodeDisplayExtraLargeShown ()
 Check whether the extra-large G-code display is currently shown.
CommonScreenV02 SetGCodeDisplayExtraLarge ()
 Switch the G-code display to the extra-large (full-screen) view with toolpath hidden.
CommonScreenV02 IsGCodeDisplayLargeShown ()
 Check whether the large G-code display group is currently shown.
CommonScreenV02 SetGCodeDisplayLarge ()
 Switch the G-code display to the large (expanded) view with toolpath visible.
CommonScreenV02 SwitchBtn ()
 Toggle the G-code display size between small, large, and extra-large views.
CommonScreenV02 IsInScreenGCodeEditorActive ()
 Check whether the in-screen G-code editor is currently active.
CommonScreenV02 ShowInScreenGCodeEditor ()
 Show the in-screen G-code editor by hiding the G-code display and repositioning the editor.
CommonScreenV02 HideInScreenGCodeEditor ()
 Hide the in-screen G-code editor and restore the previous G-code display size.
CommonScreenV02 GcodeEditInScreenBtn ()
 Handle the GCode in-screen editor button press to open or close the editor.
CommonScreenV02 HideSpindleWarmUpGroup ()
 Hide the spindle warm-up group on the screen.
CommonScreenV02 UpdateSpindleWarmUp ()
 Update the spindle warm-up group with protected error handling.
CommonScreenV02 OperatorPanelInitialization ()
 Initialize operator panel UI controls based on the active operator panel part number.
CommonScreenV02 ShowHideSpindleGroup (groupname, showhide)
 Show or hide a spindle-related group on the screen with forced update.
CommonScreenV02 GetFeedrateDRODecimalCount ()
 Get the configured decimal count for the feedrate DRO.
CommonScreenV02 GetToolDRODecimalCount ()
 Get the configured decimal count for the tool offset DROs.
CommonScreenV02 GetAxisDecimalCount (AxisID)
 Get the configured decimal count for a specific axis position DRO.
CommonScreenV02 UpdateDRODecimalCount ()
 Update feedrate, tool, and axis position DRO format strings based on configured decimal counts.
CommonScreenV02 UpdateOperatorPanelControls ()
 Update operator panel override controls and slider labels based on panel type.
CommonScreenV02 UpdateMPGAxisSelector ()
 Update the MPG axis selector label to display the currently selected MPG axis name.
CommonScreenV02 UpdateHomedStatus ()
 Update the homed status display for all axes that are not currently homed.
CommonScreenV02 UpdateAxisHomeStatus (AxisID, homed)
 Update the foreground color of an axis text label and home button to indicate homed status.
CommonScreenV02 IsAxisEnabledAndShown (AxisID)
 Check whether a specific axis is both enabled and shown for the selected instance.
CommonScreenV02 IsAxisEnabled (AxisID)
 Check whether a specific axis is enabled for the selected instance.
CommonScreenV02 ShowAxis (AxisID)
 Mark a specific axis as shown in the axis visibility state table.
CommonScreenV02 HideAxis (AxisID)
 Mark a specific axis as hidden in the axis visibility state table.
CommonScreenV02 ShowAllAxis ()
 Mark all axes as shown in the axis visibility state table for the selected instance.
CommonScreenV02 ShowAllAxes ()
 Mark all axes as shown in the axis visibility state table (alias for ShowAllAxis).
CommonScreenV02 HideAllAxis ()
 Mark all axes as hidden in the axis visibility state table for the selected instance.
CommonScreenV02 HideAllAxes ()
 Mark all axes as hidden in the axis visibility state table (alias for HideAllAxis).
CommonScreenV02 HideAllOBAxes ()
 Mark all OB (outboard) axes as hidden in the axis visibility state table.
CommonScreenV02 UpdateAxisDROs ()
 Update the X and Y axis position DRO codes to reflect active G68 rotation state.
CommonScreenV02 MachineCoordColors ()
 Switch all coordinate axis position DROs to machine coordinate display mode.
CommonScreenV02 PartCoordColors ()
 Switch all coordinate axis position DROs to part coordinate display mode.
CommonScreenV02 InitializeAxisGaugeMode ()
 Initialize axis gauge mode and gauge data tables for all instances and axes.
CommonScreenV02 GetAxisGaugeMode ()
 Get the current axis gauge display mode for the selected instance.
CommonScreenV02 UpdateAxisGauges ()
 Update all axis load gauges on the screen based on the current gauge mode (torque or velocity).
CommonScreenV02 SetToolLengthVerifyDRO (value)
 Set the value displayed in the ToolLengthVerifyDRO screen control.
CommonScreenV02 SetToolLengthVerifyButton (onoff)
 Set the ToolLengthVerifyBtn background color to indicate verify on or off state.
CommonScreenV02 UnMapFeedrateDROFromMach ()
 Unmap the CurrentVelocityDRO from its Mach4-assigned DRO code.
CommonScreenV02 UpdateFeedrateDROLabels ()
 Update the feedrate velocity DRO, label, and feedrate DRO display based on current machine state.
CommonScreenV02 UpdateSpindleMinMaxSpeed ()
 Update the spindle range label with the current pulley range, min, and max RPM values.
CommonScreenV02 UpdateToolPathExtents ()
 Update the toolpath extents DRO values for all six axes from path register data.
CommonScreenV02 UpdateGCodeLinePercentage ()
 Update the CurrentGcodeDRO format string to include the current G-code line percentage.
CommonScreenV02 UpdateActiveOffsetDisplay ()
 Update the CurentOffsetText label to display the currently active fixture offset string.
CommonScreenV02 UpdateScalingAndRotation ()
 Update axis position DRO codes and scaling/rotation unit labels based on active G68 and G51 state.
CommonScreenV02 UpdateToolOffsetDROColors ()
 Update the ToolLengthDRO and ToolDiameterDRO background colors based on active offset status.
CommonScreenV02 UpdateButtonColors ()
 Update the background colors of multiple screen buttons based on current machine state.
CommonScreenV02 UpdateSoftLimitButton ()
 Update the SoftLimitsBtn background color based on the current soft limits signal state.
CommonScreenV02 UpdateSingleBlockButton ()
 Update the SingleBlockBtn background color based on the current single block state.
CommonScreenV02 UpdateSpindleButtons ()
 Update spindle forward and reverse button states, colors, and labels based on spindle direction.
CommonScreenV02 UpdateSpindleLoadMeter ()
 Update the spindle and sub-spindle load meter gauges from register values.
CommonScreenV02 UpdateMoveToTPPositionBtn ()
 Update the MoveToTPPositionBtn background color based on mouse capture state.
CommonScreenV02 ProcessToolPathMouseDownEvent ()
 Handle a toolpath mouse down event and move the machine to the clicked path position.
CommonScreenV02 MoveToToolPathPosition ()
 Start or stop capturing toolpath mouse positions for move-to-path operations.
CommonScreenV02 CutRecoveryBtn ()
 Toggle cut recovery mode based on the current operator panel pretend state.
CommonScreenV02 OnScreenJogButtonsOn ()
 Enable on-screen jog buttons if the jog inhibit signal is not active.
CommonScreenV02 OnScreenJogButtonsOff ()
 Disable on-screen jog buttons and update the jog buttons group and button color.
CommonScreenV02 OpenToolSetterSelection (FilterToolSetterTypes, OffsetTypes,...)
CommonScreenV02 InitializePLCGroup ()
 Initialize the PLC group controls based on tool changer method and PLC enable settings.
CommonScreenV02 GetAxisPositionGroupTable ()
 Build and return the axis position group layout distribution table for enabled and shown axes.
CommonScreenV02 InitializeAxisPositionGroup ()
 Initialize the axis position group layout, DRO visibility, label text, and button positions for all axes.
CommonScreenV02 InitializeHomeButtons ()
 Initialize the homing button group layout and labels for all enabled axes.
CommonScreenV02 UpdateAuxiliaryButtonNames ()
 Update all auxiliary button labels from the profile and current signal states.
CommonScreenV02 InitializeParkToolGroup ()
 Initialize the Park Tool group visibility and vertical position based on machine type and controls group setting.
CommonScreenV02 InitializeToolSetters ()
 Initialize tool setter UI groups based on configured manual and auto tool setter settings.
CommonScreenV02 InitializeToolPocketButtons ()
 Initialize tool pocket jump buttons for all instances based on tool changer configuration.
CommonScreenV02 UpdateToolPocketButtonLabels ()
 Update the labels and enabled state of tool pocket jump buttons based on current pocket index.
CommonScreenV02 UpdateToolPocketButtonColors ()
 Update the background colors of tool pocket buttons to indicate the currently active pocket or tool.
CommonScreenV02 JumpToToolPocketBtn (pocket_index,...)
CommonScreenV02 JumpToToolPocket (Index, use_confirmation)
CommonScreenV02 PreviousToolPocketSetsBtn ()
 Retreat the tool pocket button index set by 8 and update button labels and colors.
CommonScreenV02 NextToolPocketSetsBtn ()
 Advance the tool pocket button index set by 8 and update button labels and colors.
CommonScreenV02 UpdateZeroButtons ()
 Update the visibility, labels, and mode of Zero axis buttons based on edit mode and machine coordinate state.
CommonScreenV02 ResizeAxisPositionGroupDROs ()
 Force a size refresh on all enabled and shown axis position DROs to trigger a redraw.
CommonScreenV02 UpdateAxisPositionGroup ()
 Update the axis position DRO editor mode and background colors based on edit mode and coordinate state.
CommonScreenV02 EditModeGroupsButtons (Value)
 Enable or disable the groups and controls associated with edit mode.
CommonScreenV02 EditModeOn ()
 Activate edit mode, enabling DRO editing and offset-related UI controls.
CommonScreenV02 EditModeOff (SkipSavingOffsets)
 Deactivate edit mode, restore DRO and button states, and optionally save offsets.
CommonScreenV02 EditModeToggleBtn ()
 Toggle edit mode on or off based on the current edit mode state.
CommonScreenV02 IsEditModeActive ()
 Check whether edit mode is currently active based on the EditModeBtn background color.
CommonScreenV02 EditModeAutoOn ()
 Automatically turn on edit mode if the EditModeAutoOn profile setting is enabled.
CommonScreenV02 EditModeAutoOff ()
 Automatically turn off edit mode if the EditModeAutoOff profile setting is enabled.
CommonScreenV02 GetEditModeButtonText ()
 Get the display text for the edit mode button.
CommonScreenV02 CommonScreenTabEnter (tab)
 Handle a screen tab enter event by running hooks, updating the tab register, and calling machine-specific handler.
CommonScreenV02 ScreenTabEnter (tab)
 Handle a screen tab enter event for the main operation and service tab groups.
CommonScreenV02 CommonScreenTabExit (tab)
 Handle a screen tab exit event by running hooks, updating the tab register, and calling machine-specific handler.
CommonScreenV02 ScreenTabExit (tab)
 Handle a screen tab exit event for the main operation and service tab groups.
CommonScreenV02 CommonScreenPageChanged (tab)
 Handle a screen page changed event by running hooks and updating the tab register.
CommonScreenV02 UpdateCurrentTabRegister ()
 Update the current tab OEM parameter register with the active main window tab index.
CommonScreenV02 RestoreLastServiceTabIndex ()
 Restore the last saved service tab index from the profile.
CommonScreenV02 SaveCurrentServiceTabIndex (tab)
 Save the current service tab index to the profile for later restoration.
CommonScreenV02 GetCurrentTab ()
 Get the currently selected tab index from the main OperationTabs notebook.
CommonScreenV02 ModifyAxisDROPosition (AxisID)
 Entry point from the screen to modify an axis DRO position with protected error handling.
CommonScreenV02 ModifyAxisDROPosition_Screen (value, AxisID,...)
 Handle a DRO position modification event from the screen and return the updated axis position.
CommonScreenV02 GetToolRangeTextString ()
 Get the current value of the tool range text box on the screen.
CommonScreenV02 SetToolRangeTextString (TextString)
 Set the value of the tool range text box on the screen.
CommonScreenV02 UpdateCurrentTime ()
 Update the current time or profile name label on the screen.
CommonScreenV02 ContinuousJogBtn ()
 Set the jog mode to continuous and update button colors accordingly.
CommonScreenV02 IncrementJogBtn ()
 Set the jog mode to increment and update button colors accordingly.
CommonScreenV02 IncrementSelection (INC)
 Highlight the selected increment button and reset all other increment selection buttons.
CommonScreenV02 AxisSelection (AxisID)
 Highlight the selected axis button and reset all other axis selection buttons.
CommonScreenV02 GetTopBarImageNameFullLogo ()
 Get the top bar background image name for single-instance (full logo) configurations.
CommonScreenV02 GetTopBarImageNameMultiInstanceLogo ()
 Get the top bar background image name for multi-instance configurations.

Function Documentation

◆ AxisSelection()

CommonScreenV02 AxisSelection ( AxisID )

Highlight the selected axis button and reset all other axis selection buttons.

Iterates over all coordinate axis selection buttons (X through C) and sets the background color to the "On" color for the matching axis and the "Off" color for all others.

Parameters
AxisID(number) The axis identifier (mc.X_AXIS through mc.MC_MAX_COORD_AXES-1) to select
Note
Documentation generated by AI on 2026-03-03

◆ CommonScreenPageChanged()

CommonScreenV02 CommonScreenPageChanged ( tab )

Handle a screen page changed event by running hooks and updating the tab register.

Executes PreScreenPageChanged, ScreenPageChanged, and PostScreenPageChanged hooks via RunScreenHooks(), updates the current tab register, and calls the machine-specific ScreenPageChanged handler if defined.

Parameters
tab(table) The tab object describing the page that changed
Returns
(boolean) True indicating the event was handled
Note
Documentation generated by AI on 2026-03-03

◆ CommonScreenTabEnter()

CommonScreenV02 CommonScreenTabEnter ( tab )

Handle a screen tab enter event by running hooks, updating the tab register, and calling machine-specific handler.

Executes PreScreenTabEnter, ScreenTabEnter, and PostScreenTabEnter hooks via RunScreenHooks(), updates the current tab register, and calls the machine-specific ScreenTabEnter handler if defined.

Parameters
tab(table) The tab object describing the tab being entered
Returns
(nil) No meaningful primary return value
(boolean) Success flag - true if operation completed successfully
(string) Status message from w.FunctionCompleted()
Note
Documentation generated by AI on 2026-03-03

◆ CommonScreenTabExit()

CommonScreenV02 CommonScreenTabExit ( tab )

Handle a screen tab exit event by running hooks, updating the tab register, and calling machine-specific handler.

Executes PreScreenTabExit, ScreenTabExit, and PostScreenTabExit hooks via RunScreenHooks(), updates the current tab register, and calls the machine-specific ScreenTabExit handler if defined.

Parameters
tab(table) The tab object describing the tab being exited
Returns
(nil) No meaningful primary return value
(boolean) Success flag - true if operation completed successfully
(string) Status message from w.FunctionCompleted()
Note
Documentation generated by AI on 2026-03-03

◆ ContinuousJogBtn()

CommonScreenV02 ContinuousJogBtn ( )

Set the jog mode to continuous and update button colors accordingly.

Sets the ContinuousJogBtn background to the "On" color and the IncrementJogBtn background to the "Off" color to indicate that continuous jog mode is active.

Note
Documentation generated by AI on 2026-03-03

◆ CutRecoveryBtn()

CommonScreenV02 CutRecoveryBtn ( )

Toggle cut recovery mode based on the current operator panel pretend state.

Calls m.screen.CutRecovery() with the inverse of w.PretendCommandsAreFromOperatorPanels() to toggle cut recovery on or off depending on whether operator panel pretend mode is active.

Note
Documentation generated by AI on 2026-03-04

◆ EditModeAutoOff()

CommonScreenV02 EditModeAutoOff ( )

Automatically turn off edit mode if the EditModeAutoOff profile setting is enabled.

Reads the EditModeAutoOff integer from the MachMotion profile section. If the value is 1 and the machine is currently in IDLE state, calls EditModeOff() to disable edit mode.

Returns
(nil) No meaningful primary return value
(boolean) Success flag - true if operation completed successfully
(string) Status message from w.FunctionCompleted()
Note
Documentation generated by AI on 2026-03-03

◆ EditModeAutoOn()

CommonScreenV02 EditModeAutoOn ( )

Automatically turn on edit mode if the EditModeAutoOn profile setting is enabled.

Reads the EditModeAutoOn integer from the MachMotion profile section. If the value is 1 and the machine is currently in IDLE state, calls EditModeOn() to enable edit mode.

Returns
(nil) No meaningful primary return value
(boolean) Success flag - true if operation completed successfully
(string) Status message from w.FunctionCompleted()
Note
Documentation generated by AI on 2026-03-03

◆ EditModeGroupsButtons()

CommonScreenV02 EditModeGroupsButtons ( Value )

Enable or disable the groups and controls associated with edit mode.

Sets the Enabled property on all offset-related screen groups and controls, including probing wizard, tool table, fixture table, edge finder, tool/fixture setter groups, correction, calibration, work shift, head shift, and rotary axis groups. If the rotary axis is enabled, the RotaryAxisGroup is also enabled or disabled accordingly.

Parameters
Value(string) "1" to enable all edit mode groups, "0" to disable them
Note
Documentation generated by AI on 2026-03-04

◆ EditModeOff()

CommonScreenV02 EditModeOff ( SkipSavingOffsets )

Deactivate edit mode, restore DRO and button states, and optionally save offsets.

Restores axis position group DROs to read-only mode, resets ToolDiameterDRO and ToolLengthDRO to read colors and editor mode, disables edit mode groups buttons, and optionally saves tool offsets, fixture offsets, and system pound variables. Calls the user-defined UserEditModeOff hook if present.

Parameters
SkipSavingOffsets(boolean|nil) If true, skips saving tool/fixture offsets and system variables. If nil or false, offsets are saved normally.
Returns
(nil) No meaningful primary return value
(boolean) Success flag - true if operation completed successfully, false on hook error
(string) Status message from w.FunctionCompleted() or w.FunctionError()
Note
Documentation generated by AI on 2026-03-04

◆ EditModeOn()

CommonScreenV02 EditModeOn ( )

Activate edit mode, enabling DRO editing and offset-related UI controls.

Validates that the machine is in IDLE state before enabling edit mode. Calls the EditModeControlOn hook if defined, otherwise sets the EditModeBtn to yellow. Switches axis position group DROs to writable mode, enables ToolDiameterDRO and ToolLengthDRO for editing, sets their colors to write colors, enables edit mode groups buttons, and calls the user-defined UserEditModeOn hook if present.

Returns
(nil) No meaningful primary return value
(boolean) Success flag - true if operation completed successfully, false on hook error
(string) Status message from w.FunctionCompleted() or w.FunctionError()
Warning
Machine must be in IDLE state before calling this function
Note
Documentation generated by AI on 2026-03-04

◆ EditModeToggleBtn()

CommonScreenV02 EditModeToggleBtn ( )

Toggle edit mode on or off based on the current edit mode state.

Returns
(nil) No meaningful primary return value
(boolean) Success flag - true if operation completed successfully
(string) Status message from w.FunctionCompleted()
Note
Documentation generated by AI on 2026-03-04

◆ ExecuteMDI()

CommonScreenV02 ExecuteMDI ( )

Execute the current MDI command string from the MDI dialog.

Constructs the MDI G-code string from the MDI dialog handle via ConstructMDIString(), saves it to history, then executes it using mc.mcCntlMdiExecute() on the selected instance. Does nothing if no MDI dialog is open or the string is empty.

Returns
(nil) No meaningful primary return value
(boolean) Success flag - true if operation completed successfully, false on error
(string) Status message from w.FunctionCompleted() or w.FunctionError()
Note
Documentation generated by AI on 2026-03-04

◆ GcodeEditInScreenBtn()

CommonScreenV02 GcodeEditInScreenBtn ( )

Handle the GCode in-screen editor button press to open or close the editor.

Runs the GcodeEdit hook and checks password level 2 before proceeding. Resets the controller via mcCntlReset() before toggling the editor. In single-instance mode, toggles between the editor open and closed states: when opening, calls ShowInScreenGCodeEditor() and loads the current file or creates a new one, runs the OpenGcodeEditor hook, and updates the button label and color; when closing, saves the current file if no filename exists, calls HideInScreenGCodeEditor(), and runs the CloseGcodeEditor hook. In multi-instance mode, delegates to h.DoFunctionNameInst() and runs the PostGcodeEdit hook.

Returns
(nil) No meaningful primary return value
(boolean) Success flag - true if operation completed successfully, false on hook error
(string) Status message from w.FunctionCompleted() or w.FunctionError()
Note
Documentation generated by AI on 2026-03-04

◆ GetAxisDecimalCount()

CommonScreenV02 GetAxisDecimalCount ( AxisID )

Get the configured decimal count for a specific axis position DRO.

Checks the cache for the decimal count value keyed by axis ID. If not cached, reads the axis precision via mc.mcAxisGetPrecision() for the selected instance. Defaults to "4" if the returned value is nil or empty. Caches the result before returning.

Parameters
AxisID(number) The axis identifier (mc.X_AXIS through mc.MC_MAX_AXES-1) to query
Returns
(string) The decimal count string for the specified axis DRO format
Note
Documentation generated by AI on 2026-03-04

◆ GetAxisGaugeMode()

CommonScreenV02 GetAxisGaugeMode ( )

Get the current axis gauge display mode for the selected instance.

Returns
(string) The current gauge mode: "Axis_Torque" or "Axis_Velocity"
Note
Documentation generated by AI on 2026-03-04

◆ GetAxisPositionGroupTable()

CommonScreenV02 GetAxisPositionGroupTable ( )

Build and return the axis position group layout distribution table for enabled and shown axes.

If user.GetAxisPositionGroupTable is defined, delegates to it and returns the result. Otherwise, collects all enabled and shown axis IDs into an ordered list and constructs a distribution parameter table compatible with w.Distribute(), specifying start position, total length, and size/padding constraints for the axis position group.

Returns
(table) Distribution parameter table with keys: 'count', 'order', 'start', 'length', 'constraints'
Note
Documentation generated by AI on 2026-03-04

◆ GetCurrentTab()

CommonScreenV02 GetCurrentTab ( )

Get the currently selected tab index from the main OperationTabs notebook.

Returns
(number) The current tab index as a number
Note
Documentation generated by AI on 2026-03-03

◆ GetEditModeButtonText()

CommonScreenV02 GetEditModeButtonText ( )

Get the display text for the edit mode button.

Returns
(string) The button label text "Edit\nOffsets"
Note
Documentation generated by AI on 2026-03-03

◆ GetFeedrateDRODecimalCount()

CommonScreenV02 GetFeedrateDRODecimalCount ( )

Get the configured decimal count for the feedrate DRO.

Checks the cache for the "DecimalCountFeedrate" value for the selected instance. If not cached, reads the DecimalCountFeedrate preference string from the profile (default "1"), raises an error if the read fails, and caches the result before returning.

Returns
(string) The decimal count string for feedrate DRO format strings
Note
Documentation generated by AI on 2026-03-04

◆ GetLargeToolPathGroupBgImageName()

CommonScreenV02 GetLargeToolPathGroupBgImageName ( )

Get the background image filename for the large toolpath group.

Returns
(string) The background image filename "Large Tool Path Background.png"
Note
Documentation generated by AI on 2026-03-04

◆ GetLargeToolPathGroupHeight()

CommonScreenV02 GetLargeToolPathGroupHeight ( )

Get the height value for the large toolpath group container.

Returns
(string) The height string "714" for the large toolpath group
Note
Documentation generated by AI on 2026-03-04

◆ GetLargeToolPathPanelHeight()

CommonScreenV02 GetLargeToolPathPanelHeight ( )

Get the height value for the large toolpath panel.

Returns
(string) The height string "705" for the large toolpath panel
Note
Documentation generated by AI on 2026-03-04

◆ GetRootElementNames()

CommonScreenV02 GetRootElementNames ( )

Return the list of candidate root element names for the current screen layout.

Builds a default list of root element names: "Main", "Main(1)", "Default", "Default(1)". If user.GetRootElementName is defined, calls it and inserts the result at the front of the list so that user-defined root names take priority.

Returns
(table) Ordered array of root element name strings to search for the screen root
Note
Documentation generated by AI on 2026-03-04

◆ GetSmallToolPathGroupBgImageName()

CommonScreenV02 GetSmallToolPathGroupBgImageName ( )

Get the background image filename for the small toolpath group.

Returns
(string) The background image filename "Small Tool Path Background.png"
Note
Documentation generated by AI on 2026-03-04

◆ GetSmallToolPathGroupHeight()

CommonScreenV02 GetSmallToolPathGroupHeight ( )

Get the height value for the small toolpath group container.

Returns
(string) The height string "560" for the small toolpath group
Note
Documentation generated by AI on 2026-03-04

◆ GetSmallToolPathPanelHeight()

CommonScreenV02 GetSmallToolPathPanelHeight ( )

Get the height value for the small toolpath panel.

Returns
(string) The height string "552" for the small toolpath panel
Note
Documentation generated by AI on 2026-03-04

◆ GetToolDRODecimalCount()

CommonScreenV02 GetToolDRODecimalCount ( )

Get the configured decimal count for the tool offset DROs.

Checks the cache for the "DecimalCountTool" value for the selected instance. If not cached, reads the DecimalCountTool preference string from the profile (default "4"), raises an error if the read fails, and caches the result before returning.

Returns
(string) The decimal count string for tool DRO format strings
Note
Documentation generated by AI on 2026-03-04

◆ GetToolPathGroupName()

CommonScreenV02 GetToolPathGroupName ( )

Get the name of the toolpath group container for the current screen layout.

Returns "LargeToolPathGroup" if that object exists on the screen, otherwise returns the instance-indexed group name "ToolPathGroup_0" for legacy screen layouts.

Returns
(string) The name of the active toolpath group container
Note
Documentation generated by AI on 2026-03-04

◆ GetToolPathName()

CommonScreenV02 GetToolPathName ( inst )

Get the screen object name for the toolpath display panel for a given instance.

If inst is nil, uses the currently selected instance. Returns "ToolPathLarge" if that object exists on the screen, otherwise returns the instance-indexed panel name "ToolPathPanel_{_inst}" for multi-instance screen layouts. Uses caching via w.IsCached() and w.SetCache() to avoid repeated screen object lookups.

Parameters
inst(number|nil) The Mach4 instance handle. If nil, uses the currently selected instance
Returns
(string) The screen object name for the toolpath panel
Note
Documentation generated by AI on 2026-03-04

◆ GetToolPathPanelCurrentHeight()

CommonScreenV02 GetToolPathPanelCurrentHeight ( )

Get the current toolpath panel height based on the active G-code display size.

Returns the large toolpath panel height when the small G-code display is shown, or the small toolpath panel height otherwise.

Returns
(string) The toolpath panel height string for the current display configuration
Note
Documentation generated by AI on 2026-03-04

◆ GetToolRangeTextString()

CommonScreenV02 GetToolRangeTextString ( )

Get the current value of the tool range text box on the screen.

Returns
(string) The current value of the ToolRangeTextBox screen control
Note
Documentation generated by AI on 2026-03-03

◆ GetTopBarImageNameFullLogo()

CommonScreenV02 GetTopBarImageNameFullLogo ( )

Get the top bar background image name for single-instance (full logo) configurations.

Runs the GetTopBarImageNameFullLogo hook to allow machine-specific overrides. If SCREEN_MULTI_PAGE is set, returns the no-logo variant; otherwise returns the standard full logo background image.

Returns
(string) The background image filename for the single-instance top bar
(boolean) Success flag - false if a hook encountered an error
(string) Status message from w.FunctionError() on failure
Note
Documentation generated by AI on 2026-03-03

◆ GetTopBarImageNameMultiInstanceLogo()

CommonScreenV02 GetTopBarImageNameMultiInstanceLogo ( )

Get the top bar background image name for multi-instance configurations.

Runs the GetTopBarImageNameMultiInstanceLogo hook to allow machine-specific overrides. Returns "Top Background MultiInstance.png" if no hook overrides the value.

Returns
(string) The background image filename for the multi-instance top bar
(boolean) Success flag - false if a hook encountered an error
(string) Status message from w.FunctionError() or w.FunctionCompleted()
Note
Documentation generated by AI on 2026-03-03

◆ HideAllAxes()

CommonScreenV02 HideAllAxes ( )

Mark all axes as hidden in the axis visibility state table (alias for HideAllAxis).

Delegates to CommonScreenV02.HideAllAxis() for the currently selected instance.

Note
Documentation generated by AI on 2026-03-04

◆ HideAllAxis()

CommonScreenV02 HideAllAxis ( )

Mark all axes as hidden in the axis visibility state table for the selected instance.

Sets AXIS_IS_SHOWN_INST[_inst][i] to false for all axes from mc.X_AXIS through mc.MC_MAX_AXES - 1 for the currently selected instance.

Note
Documentation generated by AI on 2026-03-04

◆ HideAllOBAxes()

CommonScreenV02 HideAllOBAxes ( )

Mark all OB (outboard) axes as hidden in the axis visibility state table.

Sets AXIS_IS_SHOWN_INST[_inst][i] to false for all axes from mc.OB1_AXIS through mc.MC_MAX_AXES - 1 for the currently selected instance.

Note
Documentation generated by AI on 2026-03-04

◆ HideAxis()

CommonScreenV02 HideAxis ( AxisID )

Mark a specific axis as hidden in the axis visibility state table.

Parameters
AxisID(number) The axis identifier (mc.X_AXIS through mc.MC_MAX_AXES-1) to hide
Note
Documentation generated by AI on 2026-03-04

◆ HideGCodeDisplayAndToolPath()

CommonScreenV02 HideGCodeDisplayAndToolPath ( )

Hide all G-code display groups and the toolpath display.

Calls HideToolPathDisplay() to hide the toolpath panel, then hides the GCodeExtraLargeGroup, GCodeLargeGroup, AdvancedLargeGroup, AdvancedSmallGroup, and GCodeSmallGroup screen objects. Calls the MachineHideGCodeDisplayAndToolPath hook if defined.

Note
Documentation generated by AI on 2026-03-04

◆ HideInScreenGCodeEditor()

CommonScreenV02 HideInScreenGCodeEditor ( )

Hide the in-screen G-code editor and restore the previous G-code display size.

Reads the current left position of the GCodeEditor. If it is not already at the hidden position (10000), moves it off-screen by setting Left to "10000" and then calls SetGCodeDisplayToLastSize() to restore the G-code/toolpath view.

Note
Documentation generated by AI on 2026-03-04

◆ HideSpindleWarmUpGroup()

CommonScreenV02 HideSpindleWarmUpGroup ( )

Hide the spindle warm-up group on the screen.

Sets the SpindleWarmUpGroup screen object's Hidden property to "1".

Note
Documentation generated by AI on 2026-03-04

◆ HideToolPathDisplay()

CommonScreenV02 HideToolPathDisplay ( )

Hide all toolpath display panels on the screen.

Returns early if no toolpath exists in the screen. Sets the height of all six toolpath panels (indices 0-5) to 1 pixel and hides them. Also hides the toolpath group for the currently selected instance.

Note
Documentation generated by AI on 2026-03-04

◆ IncrementJogBtn()

CommonScreenV02 IncrementJogBtn ( )

Set the jog mode to increment and update button colors accordingly.

Sets the IncrementJogBtn background to the "On" color and the ContinuousJogBtn background to the "Off" color to indicate that increment jog mode is active.

Note
Documentation generated by AI on 2026-03-03

◆ IncrementSelection()

CommonScreenV02 IncrementSelection ( INC )

Highlight the selected increment button and reset all other increment selection buttons.

Iterates over the standard increment values (1, 10, 100, 1000) and sets the background color to the "On" color for the matching increment and the "Off" color for all others.

Parameters
INC(number) The increment value to select (1, 10, 100, or 1000)
Note
Documentation generated by AI on 2026-03-03

◆ InitializeAxisGaugeMode()

CommonScreenV02 InitializeAxisGaugeMode ( )

Initialize axis gauge mode and gauge data tables for all instances and axes.

Reads the AxisGaugeMode profile setting for each instance (0 = Velocity, 1 = Torque) and populates AXIS_GAUGE_MODE_INST and AXIS_GAUGES_INST with the mode string, motor ID, maximum motor velocity, gauge name, maximum torque, and last percentage for each enabled axis.

Note
Documentation generated by AI on 2026-03-04

◆ InitializeAxisPositionGroup()

CommonScreenV02 InitializeAxisPositionGroup ( )

Initialize the axis position group layout, DRO visibility, label text, and button positions for all axes.

Hides the AxisPositionsGroup during initialization to prevent flicker. Runs the PreInitializeAxisPositionGroup hook and returns early if cancelled. Shows or hides each axis's text label, position DRO, load gauge, zero button, and distance-to-go DRO based on whether the axis is enabled and shown. Sets DRO codes for distance-to-go, unit display settings, and axis label text. Uses w.Distribute() to calculate and apply vertical positions and heights for all visible axis elements. Calls UpdateZeroButtons() and InitializeHomeButtons() after layout. Runs the PostInitializeAxisPositionGroup hook before returning.

Returns
(nil) No meaningful primary return value (via w.FunctionCompleted() call)
(boolean) Success flag - false if a hook encountered an error
(string) Status message from w.FunctionError() or w.FunctionCompleted()
Note
Documentation generated by AI on 2026-03-04

◆ InitializeHomeButtons()

CommonScreenV02 InitializeHomeButtons ( )

Initialize the homing button group layout and labels for all enabled axes.

Uses h.StackableCollection to stack individual axis home buttons (X through OB6) and the HomeAll button vertically inside the HomingGroup container. Counts enabled axes, sets all axis text and home button foreground colors to black, updates each home button label to "Home\n{AxisLetter}", and sets the HomingGroup background image based on the number of enabled axes.

Note
Documentation generated by AI on 2026-03-04

◆ InitializeParkToolGroup()

CommonScreenV02 InitializeParkToolGroup ( )

Initialize the Park Tool group visibility and vertical position based on machine type and controls group setting.

Hides the ParkToolGroup for Lathe control mode; shows it for all other modes. Reads the ShowControlsGroupV2 profile setting and positions the group at Top=776 when controls are hidden, or Top=439 otherwise.

Note
Documentation generated by AI on 2026-03-04

◆ InitializePLCGroup()

CommonScreenV02 InitializePLCGroup ( )

Initialize the PLC group controls based on tool changer method and PLC enable settings.

Reads the ToolChangerMethod OEM parameter to enable or disable the ResetCurrentPocketBtn (enabled only for Auto tool changers). Reads the PLCEnable integer from the MachMotionModbusDevicePLCConfiguration1 profile section and sets the PLCSequenceBtn enabled state accordingly.

Returns
(nil) No meaningful primary return value
(boolean) Success flag - false if the ToolChangerMethod read fails
(string) Status message from w.FunctionError() on failure
Note
Documentation generated by AI on 2026-03-04

◆ InitializeToolLifeManagement()

CommonScreenV02 InitializeToolLifeManagement ( )

Initialize the Tool Life Management group visibility based on the ToolLifeManagmentEnabled OEM register.

Reads the ToolLifeManagmentEnabled OEM register string. If "Yes", shows the TLMGroup screen object; otherwise hides it.

Returns
(nil) No meaningful primary return value
(boolean) Success flag - false if the OEM register read fails
(string) Status message from w.FunctionCompleted() or w.FunctionError()
Note
Documentation generated by AI on 2026-03-04

◆ InitializeToolPathDefaultView()

CommonScreenV02 InitializeToolPathDefaultView ( )

Initialize the toolpath default view from the profile and apply it to all toolpath panels.

Reads the DefaultView string from the MachMotion profile section and maps it to the corresponding mc.MC_TPVIEW_* constant. Sets the Initial View property on both the large and small toolpath panels, then calls SetToolPathView() with MC_TPVIEW_DEFAULT to apply the view.

Note
Documentation generated by AI on 2026-03-04

◆ InitializeToolPathDisplay()

CommonScreenV02 InitializeToolPathDisplay ( )

Initialize toolpath display panels for all instances and set the default view.

In multi-instance mode, assigns each toolpath panel to its corresponding instance (or instance 0 for unconfigured slots) and shows the associated toolpath group panel. In single-instance mode, assigns the toolpath panel to instance 0. Calls InitializeToolPathDefaultView() after setting up all panels.

Note
Documentation generated by AI on 2026-03-04

◆ InitializeToolPathShowMachineBoundaries()

CommonScreenV02 InitializeToolPathShowMachineBoundaries ( )

Initialize the toolpath machine boundary display based on the ToolPathShowMachineBoundaries OEM parameter.

Returns early if no toolpath exists in the screen. Reads the ToolPathShowMachineBoundaries OEM parameter string and calls mc.mcToolPathSetDrawLimits() with 1 if "Yes", or 0 otherwise.

Returns
(nil) No meaningful primary return value
(boolean) Success flag - false if the OEM parameter read fails
(string) Status message from w.FunctionError() on failure
Note
Documentation generated by AI on 2026-03-04

◆ InitializeToolPocketButtons()

CommonScreenV02 InitializeToolPocketButtons ( )

Initialize tool pocket jump buttons for all instances based on tool changer configuration.

For each instance, reads the ToolChangerMethod OEM parameter and sets up the pocket index array (1-8), enabled state, and change type. Calculates the maximum number of tool pockets or tool numbers based on the changer type and updates the JumpToToolPocketText label. Disables buttons beyond the pocket count when the total is 8 or fewer. Calls UpdateToolPocketButtonLabels() and UpdateToolPocketButtonColors() to finalize the display.

Returns
(nil) No meaningful primary return value
(boolean) Success flag - true if operation completed successfully
(string) Status message from w.FunctionCompleted()
Note
Documentation generated by AI on 2026-03-04

◆ InitializeToolSetters()

CommonScreenV02 InitializeToolSetters ( )

Initialize tool setter UI groups based on configured manual and auto tool setter settings.

Reads manual and auto tool setter configurations and shows or hides the corresponding screen groups (ManualToolSetterGroup, ManualFixtureSetterGroup, AutoToolSetterGroup, AutoZFixtureSetterGroup). Validates and sets the selected manual and auto setter names via OEM registers. Detects whether fixture offsets are associated with any setter to control fixture setter group visibility. Also shows or hides the ToolLengthVerify button and DRO based on the ToolLengthVerifyEnabled OEM register.

Returns
(nil) No meaningful primary return value
(boolean) Success flag - true if operation completed successfully, false on error
(string) Status message from w.FunctionCompleted() or w.FunctionError()
Note
Documentation generated by AI on 2026-03-04

◆ IsAxisEnabled()

CommonScreenV02 IsAxisEnabled ( AxisID )

Check whether a specific axis is enabled for the selected instance.

Parameters
AxisID(number) The axis identifier (mc.X_AXIS through mc.MC_MAX_AXES-1) to check
Returns
(boolean) True if the axis is enabled, false otherwise
Note
Documentation generated by AI on 2026-03-04

◆ IsAxisEnabledAndShown()

CommonScreenV02 IsAxisEnabledAndShown ( AxisID )

Check whether a specific axis is both enabled and shown for the selected instance.

Parameters
AxisID(number) The axis identifier (mc.X_AXIS through mc.MC_MAX_AXES-1) to check
Returns
(boolean) True if the axis is both enabled and shown, false otherwise
Note
Documentation generated by AI on 2026-03-04

◆ IsDROModeActive()

CommonScreenV02 IsDROModeActive ( )

Check whether DRO mode is currently active.

This function always returns false. DRO mode is not implemented in the current version.

Returns
(boolean) Always returns false
Note
Documentation generated by AI on 2026-03-04

◆ IsEditModeActive()

CommonScreenV02 IsEditModeActive ( )

Check whether edit mode is currently active based on the EditModeBtn background color.

Returns
(boolean) True if edit mode is active, false if the button is in the Off state
Note
Documentation generated by AI on 2026-03-04

◆ IsGCodeDisplayExtraLargeEnabled()

CommonScreenV02 IsGCodeDisplayExtraLargeEnabled ( )

Check whether the extra-large G-code view feature is enabled in the profile.

Returns false immediately if no toolpath exists in the screen. Otherwise reads the EnableExtraLargeGCodeView integer from the MachMotion profile section and returns true if the value equals 1.

Returns
(boolean) True if the extra-large G-code view is enabled in the profile, false otherwise
Note
Documentation generated by AI on 2026-03-04

◆ IsGCodeDisplayExtraLargeShown()

CommonScreenV02 IsGCodeDisplayExtraLargeShown ( )

Check whether the extra-large G-code display is currently shown.

First checks if the toolpath exists in the screen; returns false if not. Then calls IsGCodeDisplayExtraLargeEnabled() to verify the feature is enabled. If enabled, reads the Hidden property of GCodeExtraLargeGroup and returns true when the value is "0".

Returns
(boolean) True if the extra-large G-code display is currently shown, false otherwise
Note
Documentation generated by AI on 2026-03-04

◆ IsGCodeDisplayLargeShown()

CommonScreenV02 IsGCodeDisplayLargeShown ( )

Check whether the large G-code display group is currently shown.

Reads the Hidden property of the GCodeLargeGroup screen object and returns true if the value is "0" (visible), false otherwise. Returns false early if no toolpath exists in the screen.

Returns
(boolean) True if the large G-code display group is currently shown, false otherwise
Note
Documentation generated by AI on 2026-03-04

◆ IsGCodeDisplaySmallShown()

CommonScreenV02 IsGCodeDisplaySmallShown ( )

Check whether the small G-code display group is currently shown.

Returns false immediately if no toolpath exists in the screen. Otherwise reads the Hidden property of the GCodeSmallGroup screen object and returns true if the value is "0" (visible).

Returns
(boolean) True if the small G-code display group is currently shown, false otherwise
Note
Documentation generated by AI on 2026-03-04

◆ IsInScreenGCodeEditorActive()

CommonScreenV02 IsInScreenGCodeEditorActive ( )

Check whether the in-screen G-code editor is currently active.

Reads the Left property of the GCodeEditor screen object and returns true if it equals "106" (the visible position), false otherwise.

Returns
(boolean) True if the in-screen G-code editor is currently shown, false otherwise
Note
Documentation generated by AI on 2026-03-04

◆ IsMDIModeActive()

CommonScreenV02 IsMDIModeActive ( )

Check whether MDI mode is currently active.

Returns true if the MDI_DIALOG_HANDLE global is not nil, indicating that an MDI dialog is currently open and active.

Returns
(boolean) True if the MDI dialog is open and active, false otherwise
Note
Documentation generated by AI on 2026-03-04

◆ IsShownToolPathPanelsForInstance()

CommonScreenV02 IsShownToolPathPanelsForInstance ( inst )

Check whether the toolpath panel for a specific instance is currently shown.

Parameters
inst(number) The Mach4 instance handle to check
Returns
(boolean) True if the toolpath panel for the given instance is visible, false otherwise
Note
Documentation generated by AI on 2026-03-04

◆ IsToolPathDisplayLarge()

CommonScreenV02 IsToolPathDisplayLarge ( )

Check whether the toolpath display group is currently in the large size.

Compares the current height of the toolpath group to the large toolpath group height value. Returns true if they match, false otherwise.

Returns
(boolean) True if the toolpath display is currently shown in the large size
Note
Documentation generated by AI on 2026-03-04

◆ JumpToToolPocket()

CommonScreenV02 JumpToToolPocket ( Index ,
use_confirmation  )

◆ JumpToToolPocketBtn()

CommonScreenV02 JumpToToolPocketBtn ( pocket_index ,
... )

◆ LowPriorityLoop()

CommonScreenV02 LowPriorityLoop ( )

Execute the low priority loop to update non-critical screen elements periodically.

Called from the low priority screen update cycle. Sequentially updates: feedrate DRO labels and units, scaling/rotation DRO codes (G68/G51), active offset display string, fixture offset monitoring, G-code line percentage, button background colors, spindle min/max speed label, MPG axis selector label, spindle warm-up group, toolpath extents DROs, G-code group filename label, tool pocket button colors, homed status indicators, current time label, retract dialog, and the move-to-toolpath-position button state. Calls MachineScreenLowPriorityLoop if defined.

Note
Documentation generated by AI on 2026-03-04

◆ MachineCoordColors()

CommonScreenV02 MachineCoordColors ( )

Switch all coordinate axis position DROs to machine coordinate display mode.

Sets the OSIG_MACHINE_CORD signal if not already active, updates each coordinate axis DRO foreground color to machine coordinate colors, and sets the DRO code to the machine position register for each axis. Calls UpdateAxisPositionGroup() after updating.

Returns
(nil) No meaningful primary return value
(boolean) Success flag - true if operation completed successfully
(string) Status message from w.FunctionCompleted()
Note
Documentation generated by AI on 2026-03-04

◆ MachineCycleStartFinal()

CommonScreenV02 MachineCycleStartFinal ( )

Final cycle start validation hook that prevents starting from the Tools or Fixtures tab.

Checks all instances to determine the current machine state. If the machine is idle and the active tab in OperationTabs(1) is "Tools" or "Fixtures", displays a warning message and returns false to cancel the cycle start. Otherwise returns true to allow it to proceed.

Returns
(boolean) False if cycle start should be blocked, true if it should proceed
(boolean) Success flag - always true
(string) Status message from w.FunctionCompleted()
Note
Documentation generated by AI on 2026-03-04

◆ MachStateChanged()

CommonScreenV02 MachStateChanged ( )

Handle a machine state change event and update instance button borders.

Calls UpdateInstanceButtonsBoarder() to refresh the border colors of instance selection buttons based on the new machine state.

Returns
(boolean) True indicating the hook should continue processing
(boolean) True indicating no error occurred
(string) Status message from w.FunctionCompleted()
Note
Documentation generated by AI on 2026-03-04

◆ ModifyAxisDROPosition()

CommonScreenV02 ModifyAxisDROPosition ( AxisID )

Entry point from the screen to modify an axis DRO position with protected error handling.

Wraps CommonScreenV02._ModifyAxisDROPosition() in a pcall to catch and display any errors via m.SetWarningMessage(). Reads the current DRO value and passes it to m.ModifyAxisPosition() for the specified axis.

Parameters
AxisID(number) The axis identifier (mc.X_AXIS through mc.MC_MAX_AXES-1) to modify
Note
Documentation generated by AI on 2026-03-03

◆ ModifyAxisDROPosition_Screen()

CommonScreenV02 ModifyAxisDROPosition_Screen ( value ,
AxisID ,
... )

Handle a DRO position modification event from the screen and return the updated axis position.

Called by GUIModule.ScreenDROModify() when the user edits an axis position DRO. Passes the new value to m.ModifyAxisPosition() and then reads back the current axis position via mc.mcAxisGetPos() to return the confirmed position value.

Parameters
value(number) The new position value entered by the user
AxisID(number) The axis identifier (mc.X_AXIS through mc.MC_MAX_AXES-1) to modify
...(any) Additional parameters passed in from GUIModule.ScreenDROModify()
Returns
(number) The current axis position after modification
Note
Documentation generated by AI on 2026-03-03

◆ MoveToToolPathPosition()

CommonScreenV02 MoveToToolPathPosition ( )

Start or stop capturing toolpath mouse positions for move-to-path operations.

If already capturing toolpath mouse positions, stops capturing. Otherwise, validates that the machine is enabled and idle, verifies homing status, and starts capturing toolpath mouse click positions. Displays a warning if the machine is not enabled and idle, or if homing has not been completed.

Returns
(nil) No meaningful primary return value
(boolean) Success flag - true if operation completed successfully, false on error
(string) Status message from w.FunctionCompleted() or w.FunctionError()
Warning
Machine must be enabled and in IDLE state before starting capture mode
Note
Documentation generated by AI on 2026-03-04

◆ NextToolPocketSetsBtn()

CommonScreenV02 NextToolPocketSetsBtn ( )

Advance the tool pocket button index set by 8 and update button labels and colors.

Increments all pocket indices in TOOL_POCKETS_BUTTON_INST by 8. Pockets within the max pocket count are enabled; those beyond it are disabled. Updates button labels and colors after the index shift.

Note
Documentation generated by AI on 2026-03-04

◆ OnScreenJogButtonsOff()

CommonScreenV02 OnScreenJogButtonsOff ( )

Disable on-screen jog buttons and update the jog buttons group and button color.

Sets the JogButtonsGroup enabled state to "0" (disabled) and resets the OnScreenJogButtonsBtn background color to the "Off" color scheme.

Note
Documentation generated by AI on 2026-03-04

◆ OnScreenJogButtonsOn()

CommonScreenV02 OnScreenJogButtonsOn ( )

Enable on-screen jog buttons if the jog inhibit signal is not active.

Checks whether the jog inhibit input signal (mc.ISIG_JOG_INHIBIT) is active. If not inhibited, enables the JogButtonsGroup and sets the OnScreenJogButtonsBtn background to the "On" color. If jog is inhibited, displays a warning message instead.

Note
Documentation generated by AI on 2026-03-04

◆ OpenToolSetterSelection()

CommonScreenV02 OpenToolSetterSelection ( FilterToolSetterTypes ,
OffsetTypes ,
... )

◆ OperatorPanelInitialization()

CommonScreenV02 OperatorPanelInitialization ( )

Initialize operator panel UI controls based on the active operator panel part number.

Detects which operator panel (if any) is configured from the GetConfiguredOperatorPanels() list and updates the screen accordingly. For panels X15-10-01 and X15-12-01, hides the feedrate slider group, shows the feedrate display group, hides the spindle slider group, and configures the RapidOverrideDRO as read-only or editable based on the EnableRRO profile setting. For panel X15-10-04, shows the spindle slider group and sets RapidOverrideDRO to writable. For panels X15-14-21/22/23, sets RapidOverrideDRO to read-only and shows the spindle slider. For panel X15-12-02, sets both FeedrateOverrideDRO and RapidOverrideDRO to read-only. When no panel is active, shows the feedrate slider group, shows spindle group, and maps JogSpeed to the jog rate percentage. All panel configurations disable the JogSpeed screen control when an operator panel is present.

Returns
(nil) No meaningful primary return value
(boolean) Success flag - true if operation completed successfully
(string) Status message from w.FunctionCompleted()
Note
Documentation generated by AI on 2026-03-04

◆ PartCoordColors()

CommonScreenV02 PartCoordColors ( )

Switch all coordinate axis position DROs to part coordinate display mode.

Clears the OSIG_MACHINE_CORD signal if active, updates each coordinate axis DRO foreground color to part coordinate colors, and sets the DRO code to the part position register (with an offset for A/B/C axes that are not configured as rotary axes). Calls UpdateAxisPositionGroup() after updating DRO codes.

Returns
(nil) No meaningful primary return value
(boolean) Success flag - true if operation completed successfully
(string) Status message from w.FunctionCompleted()
Note
Documentation generated by AI on 2026-03-04

◆ PLCScript()

CommonScreenV02 PLCScript ( )

Execute the PLC script loop updating machine state indicators, spindle load, and axis gauges.

Calls the MachineScreenPLCScript hook if defined. Updates the spindle load gauge if either spindle load meter is enabled. Updates operator panel override controls. Manages enable button logic and indicator bar image based on MACH_ENABLED and MACH_STATE transitions, including blinking behavior via BLINK_OBJECT_ACTIVE. In multi-instance mode, also updates per-instance enable buttons with the same blink logic. Updates axis load gauges, the status group label, axis position DRO codes for G68 rotation, and the dwell progress bar.

Note
Documentation generated by AI on 2026-03-04

◆ PreviousToolPocketSetsBtn()

CommonScreenV02 PreviousToolPocketSetsBtn ( )

Retreat the tool pocket button index set by 8 and update button labels and colors.

Decrements all pocket indices in TOOL_POCKETS_BUTTON_INST by 8. All pockets are re-enabled after decrementing. Updates button labels and colors after the index shift.

Note
Documentation generated by AI on 2026-03-04

◆ ProcessToolPathMouseDownEvent()

CommonScreenV02 ProcessToolPathMouseDownEvent ( )

Handle a toolpath mouse down event and move the machine to the clicked path position.

Retrieves the left mouse down position from the toolpath display via mcToolPathGetLeftMouseDn, stops capturing mouse positions, optionally shows a confirmation dialog, then executes an MDI G-code string to move the machine to the selected XYZ position using G53 G00 moves. Calls CutRecovery(false) after a successful move.

Returns
(nil) No meaningful primary return value
(boolean) Success flag - true if operation completed successfully, false on error
(string) Status message from w.FunctionCompleted() or w.FunctionError()
Warning
This function executes machine motion. The machine must be homed and enabled.
Note
Documentation generated by AI on 2026-03-04

◆ ResizeAxisPositionGroupDROs()

CommonScreenV02 ResizeAxisPositionGroupDROs ( )

Force a size refresh on all enabled and shown axis position DROs to trigger a redraw.

For each enabled and visible axis, temporarily increments and then restores both the width and height of the position DRO by 1 pixel. This forces the screen to redraw the control, which is useful after font style changes that do not automatically refresh.

Note
Documentation generated by AI on 2026-03-04

◆ RestoreLastServiceTabIndex()

CommonScreenV02 RestoreLastServiceTabIndex ( )

Restore the last saved service tab index from the profile.

Reads the LastServiceTabNumber integer value from the MachMotion profile section and sets the ServiceTabGroup's current tab to that index.

Note
Documentation generated by AI on 2026-03-03

◆ RunHooks()

CommonScreenV02 RunHooks ( hook_name ,
... )

Execute registered hook functions for a named event in priority order and return the result.

Checks three hook locations in order from most specific to most general: user[hook_name], user["User" .. hook_name], and m.screen["Machine" .. hook_name]. Each hook is called via w.pcall() with the forwarded variadic arguments. If a hook raises an error, returns (false, false, error_message, value) immediately. If a hook returns b == false (fatal error), returns (a, false, error_message, value) immediately. If a hook returns a == false (event handled), returns (false, b, completion_message, value) immediately. If no hook handles the event, returns (true, true, status_message, value).

Parameters
hook_name(string) The name of the hook event to run (e.g., "CycleStart", "LoadGCodeFile")
...(any) Variable arguments forwarded to each hook function
Returns
(boolean) False if the event was handled or a fatal error occurred, true to continue processing
(boolean) False if a fatal error occurred, true otherwise
(string) Status or error message describing the hook execution result
(any) Optional value returned by the hook function
Note
Documentation generated by AI on 2026-03-04

◆ SaveCurrentServiceTabIndex()

CommonScreenV02 SaveCurrentServiceTabIndex ( tab )

Save the current service tab index to the profile for later restoration.

Writes the tab index from the provided tab object to the MachMotion profile section under the key "LastServiceTabNumber".

Parameters
tab(table) The tab object containing an 'index' field with the current tab index
Note
Documentation generated by AI on 2026-03-03

◆ ScreenLoadScript()

CommonScreenV02 ScreenLoadScript ( )

Execute the screen load script to initialize global state tables, signal library, and screen subsystems.

Performs all one-time initialization required when the screen first loads. Initializes AXIS_TORQUE_AVERAGE_INST for all instances and axes, sets global state variables (LAST_OPERATION_TAB, DWELL_BAR_IS_SHOWN), and builds per-instance global tables for TOOL_POCKETS_BUTTON, DWELL_ACTIVE, AXIS_GAUGE_MODE, AXIS_GAUGES, FEEDRATE_DRO, and VELOCITY_DRO. Runs one-time DRO precision upgrade, hides OB axes for configured operator panels, initializes screen DROs, axis gauge mode, and unmaps the feedrate DRO from Mach. Restores edit mode button label and color. Remaps RunFromHereBtn for 2000 series controls. Disables button hover. Registers the CreatePreCannedCommands command. Builds a comprehensive signal library (SCREEN_SIG_LIBRARY_INST) for all instances covering machine enable, emergency stop, coordinate mode, dist-to-go, single block, soft limits, tool change, block delete, reverse run, coolant, mist, limit override, dwell, retract, spindle brake, and all 16 auxiliary output signals. Creates the default job file. Calls MachineScreenLoadScript if defined.

Note
Documentation generated by AI on 2026-03-04

◆ ScreenTabEnter()

CommonScreenV02 ScreenTabEnter ( tab )

Handle a screen tab enter event for the main operation and service tab groups.

Responds to tab changes in OperationTabs(1) and ServiceTabGroup(1). For OperationTabs: refreshes edit mode button states, restores GCode display size on the GCode tab, reinitializes the controls group on GCode/Tools/Fixtures tabs, restores the service tab index on the Service tab, enables edit mode groups on Tools/Fixtures tabs if edit mode is active, auto-enables edit mode on Tools/Fixtures if it is not active, and auto-disables edit mode when leaving Tools/Fixtures. For ServiceTabGroup: saves the current service tab index and reinitializes home buttons on the Maintenance tab.

Parameters
tab(table) The tab object containing 'parent', 'label', and 'index' fields
Returns
(nil) No meaningful primary return value
(boolean) Success flag - true if operation completed successfully
(string) Status message from w.FunctionCompleted()
Note
Documentation generated by AI on 2026-03-03

◆ ScreenTabExit()

CommonScreenV02 ScreenTabExit ( tab )

Handle a screen tab exit event for the main operation and service tab groups.

Saves the last operation tab index when exiting a tab in the OperationTabs(1) notebook.

Parameters
tab(table) The tab object containing 'parent' and 'index' fields
Returns
(nil) No meaningful primary return value
(boolean) Success flag - true if operation completed successfully
(string) Status message from w.FunctionCompleted()
Note
Documentation generated by AI on 2026-03-03

◆ ScreenUnloadScript()

CommonScreenV02 ScreenUnloadScript ( )

Execute cleanup actions when the screen is unloaded.

Resets the machine type name label to "Mach" via m.screen.SetMachineTypeNameLabel().

Note
Documentation generated by AI on 2026-03-04

◆ SetGCodeDisplayExtraLarge()

CommonScreenV02 SetGCodeDisplayExtraLarge ( )

Switch the G-code display to the extra-large (full-screen) view with toolpath hidden.

Hides the small G-code, small advanced, and large G-code groups. Shows the advanced large and extra-large G-code groups. Updates the SwitchBtn label to "Collapse/v". Calls HideToolPathDisplay() to remove the toolpath panel. Calls the MachineSetGCodeDisplayExtraLarge hook if defined. Saves the last G-code page size (2) to the profile.

Note
Documentation generated by AI on 2026-03-04

◆ SetGCodeDisplayLarge()

CommonScreenV02 SetGCodeDisplayLarge ( )

Switch the G-code display to the large (expanded) view with toolpath visible.

Hides the extra-large, small G-code, and advanced small groups. Shows the advanced large and G-code large groups. Updates the SwitchBtn label based on whether extra-large view is enabled ("^^/Expand" or "Collapse/v"). Calls ShowToolPathDisplay() and SetToolPathDisplaySmall() to show the toolpath in its smaller form alongside the large G-code view. Calls the MachineSetGCodeDisplayLarge hook if defined. Saves the last G-code page size (0) to the profile.

Note
Documentation generated by AI on 2026-03-04

◆ SetGCodeDisplaySmall()

CommonScreenV02 SetGCodeDisplaySmall ( )

Switch the G-code display to the small (collapsed) view with toolpath visible.

Hides the extra-large, large G-code, and advanced large groups. Shows the advanced small and G-code small groups. Updates the SwitchBtn label to "^/Expand". Calls ShowToolPathDisplay() and SetToolPathDisplayLarge() to show the toolpath in its larger form alongside the small G-code view. Calls the MachineSetGCodeDisplaySmall hook if defined. Saves the last G-code page size (1) to the profile.

Note
Documentation generated by AI on 2026-03-04

◆ SetGCodeDisplayToLastSize()

CommonScreenV02 SetGCodeDisplayToLastSize ( )

Restore the G-code display to the last saved size (large, small, or extra-large).

Returns early if the in-screen G-code editor is active or the extra-large G-code display is shown. Clears the LoadedGCodeFileName label if no file is loaded. Hides the toolpath panel for the selected instance, then reads the LastGCodePageSize profile setting and calls SetGCodeDisplayLarge() (0), SetGCodeDisplayExtraLarge() (2), or SetGCodeDisplaySmall() (1) accordingly.

Note
Documentation generated by AI on 2026-03-04

◆ SetTabFontSizes()

CommonScreenV02 SetTabFontSizes ( )

Set the font point size for all standard tab notebook controls on the screen.

Reads the TabFontSize double from the MachMotion profile section (default 10 if -1). Applies the point size to the OperationsTabs, MachineTabs, MainWindowTabs, and MainWindowTabsWizard screen notebook objects.

Note
Documentation generated by AI on 2026-03-04

◆ SetToolLengthVerifyButton()

CommonScreenV02 SetToolLengthVerifyButton ( onoff )

Set the ToolLengthVerifyBtn background color to indicate verify on or off state.

Parameters
onoff(boolean) True to set the button to the "On" color, false to set it to "Off"
Note
Documentation generated by AI on 2026-03-04

◆ SetToolLengthVerifyDRO()

CommonScreenV02 SetToolLengthVerifyDRO ( value )

Set the value displayed in the ToolLengthVerifyDRO screen control.

Parameters
value(number|string) The value to display in the ToolLengthVerifyDRO
Note
Documentation generated by AI on 2026-03-04

◆ SetToolPathDisplayLarge()

CommonScreenV02 SetToolPathDisplayLarge ( )

Set the toolpath display panel to the large size.

Returns early if no toolpath exists in the screen. Sets the toolpath group height and background image to the large values, then sets the toolpath panel height to the large panel height.

Note
Documentation generated by AI on 2026-03-04

◆ SetToolPathDisplaySmall()

CommonScreenV02 SetToolPathDisplaySmall ( )

Set the toolpath display panel to the small size.

Returns early if no toolpath exists in the screen. Sets the toolpath group height and background image to the small values, then sets the toolpath panel height to the small panel height.

Note
Documentation generated by AI on 2026-03-04

◆ SetToolPathView()

CommonScreenV02 SetToolPathView ( view )

Set the toolpath view for all toolpath panels, toggling to default if the view is already active.

If the current view of the large toolpath panel matches the requested view, first resets both panels to MC_TPVIEW_DEFAULT, then sets both the large and small toolpath panels to the specified view.

Parameters
view(number) The toolpath view constant (e.g., mc.MC_TPVIEW_TOP, mc.MC_TPVIEW_ISO)
Note
Documentation generated by AI on 2026-03-04

◆ SetToolRangeTextString()

CommonScreenV02 SetToolRangeTextString ( TextString )

Set the value of the tool range text box on the screen.

Parameters
TextString(string) The text string to display in the ToolRangeTextBox
Note
Documentation generated by AI on 2026-03-03

◆ ShowAllAxes()

CommonScreenV02 ShowAllAxes ( )

Mark all axes as shown in the axis visibility state table (alias for ShowAllAxis).

Delegates to CommonScreenV02.ShowAllAxis() for the currently selected instance.

Note
Documentation generated by AI on 2026-03-04

◆ ShowAllAxis()

CommonScreenV02 ShowAllAxis ( )

Mark all axes as shown in the axis visibility state table for the selected instance.

Sets AXIS_IS_SHOWN_INST[_inst][i] to true for all axes from mc.X_AXIS through mc.MC_MAX_AXES - 1 for the currently selected instance.

Note
Documentation generated by AI on 2026-03-04

◆ ShowAxis()

CommonScreenV02 ShowAxis ( AxisID )

Mark a specific axis as shown in the axis visibility state table.

Parameters
AxisID(number) The axis identifier (mc.X_AXIS through mc.MC_MAX_AXES-1) to show
Note
Documentation generated by AI on 2026-03-04

◆ ShowHideSpindleGroup()

CommonScreenV02 ShowHideSpindleGroup ( groupname ,
showhide  )

Show or hide a spindle-related group on the screen with forced update.

Sets the Hidden property of the specified group to the given show/hide value, passing the force flag as true to ensure the property change is applied even if the value appears unchanged.

Parameters
groupname(string) The name of the screen group object to show or hide
showhide(string) "0" to show the group, "1" to hide it
Note
Documentation generated by AI on 2026-03-04

◆ ShowInScreenGCodeEditor()

CommonScreenV02 ShowInScreenGCodeEditor ( )

Show the in-screen G-code editor by hiding the G-code display and repositioning the editor.

Calls HideGCodeDisplayAndToolPath() to hide the toolpath and G-code groups, then moves the GCodeEditor control to Left position "106" to bring it into view.

Note
Documentation generated by AI on 2026-03-04

◆ ShowToolPathDisplay()

CommonScreenV02 ShowToolPathDisplay ( )

Show the toolpath display for the currently selected instance.

Returns early if no toolpath exists in the screen. Otherwise delegates to ShowToolPathPanelsForSelectedInstance() with force set to false.

Note
Documentation generated by AI on 2026-03-04

◆ ShowToolPathPanelsForInstance()

CommonScreenV02 ShowToolPathPanelsForInstance ( inst ,
force  )

Show the toolpath panel for a specific instance, hiding all others.

Skips if the in-screen G-code editor is active or the extra-large G-code view is shown. Unhides the toolpath group for the given instance, yields once, hides all other toolpath panels, then shows and resizes the panel for the specified instance. Does nothing if the panel is already shown and force is false.

Parameters
inst(number) The Mach4 instance handle whose toolpath panel should be shown
force(boolean|nil) If true, forces the panel to refresh even if already visible. Defaults to false
Note
Documentation generated by AI on 2026-03-04

◆ ShowToolPathPanelsForSelectedInstance()

CommonScreenV02 ShowToolPathPanelsForSelectedInstance ( force )

Show the toolpath panel for the currently selected instance.

Delegates to ShowToolPathPanelsForInstance() using the currently selected instance without forcing a refresh.

Note
Documentation generated by AI on 2026-03-04

◆ StartUpScript()

CommonScreenV02 StartUpScript ( )

Execute the startup script to initialize all screen subsystems after the screen loads.

Performs a comprehensive one-time initialization sequence including: toolpath line widths, instance button layout, toolpath display, diagnostics info, G-code display size, notebook tab mapping, controls group, park tool group, part coordinate colors, tool pocket buttons, screen layout, tab font sizes, in-screen G-code editor visibility, tool range text, tool setters, spindle warm-up group, toolpath machine boundaries, manual mode button state, spindle and sub-spindle load meter settings, spindle brake button state, G-code line percentage format, PLC group, operator panel initialization, spindle/feedrate override slider maximums, auxiliary button names, DRO decimal count, Mach directory label, edit mode groups, axis position group, rotary axis, and emergency stop notification. Calls MachineScreenStartupScript if defined.

Note
Documentation generated by AI on 2026-03-04

◆ SwitchBtn()

CommonScreenV02 SwitchBtn ( )

Toggle the G-code display size between small, large, and extra-large views.

If the small G-code display is currently shown, switches to the large view. If the large display is shown and extra-large view is enabled, switches to extra-large. Otherwise, collapses to the small view. Logs the action via w.OperatorLog().

Returns
(nil) No meaningful primary return value
(boolean) Success flag - true if operation completed successfully
(string) Status message from w.FunctionCompleted()
Note
Documentation generated by AI on 2026-03-04

◆ ToolPathExistsInScreen()

CommonScreenV02 ToolPathExistsInScreen ( inst )

Check whether a toolpath display panel exists in the current screen layout.

Uses the cache keyed by "ToolPathExistsInScreen" and instance index to avoid repeated lookups. If not cached, calls m.screen.GetToolPathName() and checks whether the resulting object exists via h.IsObject().

Parameters
inst(number|nil) The Mach4 instance handle. If nil, uses the currently selected instance
Returns
(boolean) True if a toolpath panel exists in the screen, false otherwise
Note
Documentation generated by AI on 2026-03-04

◆ ToolPathViewBottomBtn()

CommonScreenV02 ToolPathViewBottomBtn ( )

Set the toolpath view to the bottom view.

Calls CommonScreenV02.SetToolPathView() with mc.MC_TPVIEW_BOTTOM.

Note
Documentation generated by AI on 2026-03-04

◆ ToolPathViewDefaultBtn()

CommonScreenV02 ToolPathViewDefaultBtn ( )

Set the toolpath view to the default view.

Calls CommonScreenV02.SetToolPathView() with mc.MC_TPVIEW_DEFAULT.

Note
Documentation generated by AI on 2026-03-04

◆ ToolPathViewISOBtn()

CommonScreenV02 ToolPathViewISOBtn ( )

Set the toolpath view to the ISO (isometric) view.

Calls CommonScreenV02.SetToolPathView() with mc.MC_TPVIEW_ISO.

Note
Documentation generated by AI on 2026-03-04

◆ ToolPathViewLeftBtn()

CommonScreenV02 ToolPathViewLeftBtn ( )

Set the toolpath view to the left-side view.

Calls CommonScreenV02.SetToolPathView() with mc.MC_TPVIEW_LEFT.

Note
Documentation generated by AI on 2026-03-04

◆ ToolPathViewRightBtn()

CommonScreenV02 ToolPathViewRightBtn ( )

Set the toolpath view to the right-side view.

Calls CommonScreenV02.SetToolPathView() with mc.MC_TPVIEW_RIGHT.

Note
Documentation generated by AI on 2026-03-04

◆ ToolPathViewTopBtn()

CommonScreenV02 ToolPathViewTopBtn ( )

Set the toolpath view to the top view.

Calls CommonScreenV02.SetToolPathView() with mc.MC_TPVIEW_TOP.

Note
Documentation generated by AI on 2026-03-04

◆ UnMapFeedrateDROFromMach()

CommonScreenV02 UnMapFeedrateDROFromMach ( )

Unmap the CurrentVelocityDRO from its Mach4-assigned DRO code.

Sets the DRO Code property of the CurrentVelocityDRO to an empty string with the force flag set to true, disconnecting it from automatic Mach4 register updates so that the screen script can control its value directly.

Note
Documentation generated by AI on 2026-03-04

◆ UpdateActiveOffsetDisplay()

CommonScreenV02 UpdateActiveOffsetDisplay ( )

Update the CurentOffsetText label to display the currently active fixture offset string.

Reads ACTIVE_FIXTURE_OFFSET_INDEX_INST for the selected instance and formats the fixture offset as "G54" through "G59" for indices 1-6, or "G54.1 P{n}" for extended offsets beyond index 6.

Note
Documentation generated by AI on 2026-03-04

◆ UpdateAuxiliaryButtonNames()

CommonScreenV02 UpdateAuxiliaryButtonNames ( )

Update all auxiliary button labels from the profile and current signal states.

For each auxiliary button (1 through AUX_BTN_QUANTITY), reads the off and on label text from the MachMotion profile. If the corresponding output signal is valid and active, applies the on-label; otherwise applies the off-label. If the signal handle is not configured, the off-label is applied unconditionally.

Note
Documentation generated by AI on 2026-03-04

◆ UpdateAxisDROs()

CommonScreenV02 UpdateAxisDROs ( )

Update the X and Y axis position DRO codes to reflect active G68 rotation state.

When G68 rotation is active for the selected instance, switches XPosDRO and YPosDRO to use the G68 rotated position codes (DRO_G68_X_POS / DRO_G68_Y_POS). When rotation is inactive, restores the standard axis position codes (DRO_AXIS_POS_X / DRO_AXIS_POS_Y). Only updates DRO codes when a change is detected. Does nothing when machine coordinates are active.

Note
Documentation generated by AI on 2026-03-04

◆ UpdateAxisGauges()

CommonScreenV02 UpdateAxisGauges ( )

Update all axis load gauges on the screen based on the current gauge mode (torque or velocity).

Reads the current axis gauge mode for the selected instance. In "Axis_Torque" mode, calls m.MotionController[_inst].GetLoadPercent() for each enabled axis, averages the result using AXIS_TORQUE_AVERAGE_INST, and updates the gauge if the value changed by more than 1%. In "Axis_Velocity" mode, reads the motor velocity via mc.mcMotorGetVel() and calculates the percentage relative to the motor's maximum velocity. Skips update if the value has not changed by more than 1% since the last update.

Note
Documentation generated by AI on 2026-03-04

◆ UpdateAxisHomeStatus()

CommonScreenV02 UpdateAxisHomeStatus ( AxisID ,
homed  )

Update the foreground color of an axis text label and home button to indicate homed status.

When homed is true, sets the axis text label and home button foreground to black. When homed is false, alternates the axis text label color between red and yellow based on the BLINK_OBJECT_SLOW_ACTIVE blink state to create a visual alert.

Parameters
AxisID(number) The axis identifier (mc.X_AXIS through mc.MC_MAX_AXES-1)
homed(boolean) True if the axis is homed, false if not homed
Note
Documentation generated by AI on 2026-03-04

◆ UpdateAxisPositionGroup()

CommonScreenV02 UpdateAxisPositionGroup ( )

Update the axis position DRO editor mode and background colors based on edit mode and coordinate state.

Switches all coordinate axis position DROs (X through C) between writable mode (Editor "1", write background colors) when edit mode is active and machine coordinates are off, and read-only mode (Editor "3", part coordinate background colors) otherwise. Also calls UpdateZeroButtons() and w.FunctionCompleted() after updating.

Returns
(nil) No meaningful primary return value (via w.FunctionCompleted() call)
Note
Documentation generated by AI on 2026-03-04

◆ UpdateButtonColors()

CommonScreenV02 UpdateButtonColors ( )

Update the background colors of multiple screen buttons based on current machine state.

Refreshes the visual state of the following buttons using current machine conditions: ManualModeBtn (based on m.ManualModeIsActive()), GoToPositionBtn (based on GOTO_POSITION_MODE), RunFromHereBtn (based on m.IsFileResumeActive()), MSTLockBtn (based on MSTLock OEM register), DryRunBtn (based on m.IsDryRunOn()), JogFollowBtn (based on mc.mcToolPathGetFollowMode()), DisplayModeBtn (based on mc.mcToolPathGetDrawLimits()), and M1OptionalStopBtn (based on mc.mcCntlGetOptionalStop()). Each button uses the standard ColorScheme Button On/Off backgrounds.

Note
Documentation generated by AI on 2026-03-04

◆ UpdateCurrentTabRegister()

CommonScreenV02 UpdateCurrentTabRegister ( )

Update the current tab OEM parameter register with the active main window tab index.

Reads the current tab from GetCurrentTab() and writes it to the CurrentTabMainWindowTabs OEM parameter using w.SetOEMParamValue().

Returns
(nil) No meaningful primary return value
(boolean) Success flag - false if the OEM parameter write fails
(string) Status message from w.FunctionError() on failure
Note
Documentation generated by AI on 2026-03-03

◆ UpdateCurrentTime()

CommonScreenV02 UpdateCurrentTime ( )

Update the current time or profile name label on the screen.

In multi-instance mode, displays the profile name for the selected instance instead of the current time. In single-instance mode, displays the current date and time formatted as "DayOfWeek, Month DD, HH:MM:SS".

Note
Documentation generated by AI on 2026-03-03

◆ UpdateDRODecimalCount()

CommonScreenV02 UpdateDRODecimalCount ( )

Update feedrate, tool, and axis position DRO format strings based on configured decimal counts.

Sets the format string for FeedrateDRO and CurrentVelocityDRO using the feedrate decimal count, ToolDiameterDRO and ToolLengthDRO using the tool decimal count, and all axis position, distance-to-go, and offset DROs using each axis's configured precision value.

Note
Documentation generated by AI on 2026-03-04

◆ UpdateFeedrateDROLabels()

CommonScreenV02 UpdateFeedrateDROLabels ( )

Update the feedrate velocity DRO, label, and feedrate DRO display based on current machine state.

Determines the current feedrate mode (units/min or units/rev) from the active modal group 5 value and the machine control mode (Mill or Lathe). Calculates the current blended velocity and converts it for the velocity DRO. Updates CurrentVelocityDRO and CurrentVelocityText only when values change. If the feedrate override (FRO) is not 100%, updates the FeedrateDRO show units and display strings to reflect the actual commanded feedrate. Caches last FRO and feedrate to avoid redundant screen updates.

Note
Documentation generated by AI on 2026-03-04

◆ UpdateGCodeGroup()

CommonScreenV02 UpdateGCodeGroup ( )

Update the GCodeSmallGroup and GCodeLargeGroup labels with the current G-code filename.

Reads the current G-code filename via mc.mcCntlGetGcodeFileName() and updates both the GCodeSmallGroup and GCodeLargeGroup label properties with the formatted string "GCode File: {filename}".

Note
Documentation generated by AI on 2026-03-04

◆ UpdateGCodeLinePercentage()

CommonScreenV02 UpdateGCodeLinePercentage ( )

Update the CurrentGcodeDRO format string to include the current G-code line percentage.

If GCODE_LINE_PERCENTAGE is "Yes" and a G-code file is loaded, calculates the percentage of the current line relative to the total line count and updates the DRO format string to display both the line number and percentage. If no file is loaded, displays 0%.

Note
Documentation generated by AI on 2026-03-04

◆ UpdateHomedStatus()

CommonScreenV02 UpdateHomedStatus ( )

Update the homed status display for all axes that are not currently homed.

Iterates over all axes for the selected instance. For each axis that is not homed (AXIS_IS_HOMED_INST[_inst][AxisID] == false) and is enabled and shown, calls UpdateAxisHomeStatus() to apply the unhomed visual indicator.

Note
Documentation generated by AI on 2026-03-04

◆ UpdateMoveToTPPositionBtn()

CommonScreenV02 UpdateMoveToTPPositionBtn ( )

Update the MoveToTPPositionBtn background color based on mouse capture state.

Sets the MoveToTPPositionBtn "Button Color" property to BTN_COLOR_ON when the system is currently capturing toolpath mouse positions, or BTN_COLOR_OFF otherwise.

Note
Documentation generated by AI on 2026-03-04

◆ UpdateMPGAxisSelector()

CommonScreenV02 UpdateMPGAxisSelector ( )

Update the MPG axis selector label to display the currently selected MPG axis name.

Reads the current MPG axis selection for MPG index 0 via mc.mcMpgGetAxis(). If the axis is negative (invalid), resets it to 0. Maps the axis index to a display string from the AxisSelectorArray and updates the Mpg1SelectedAxisText label.

Note
Documentation generated by AI on 2026-03-04

◆ UpdateOperatorPanelControls()

CommonScreenV02 UpdateOperatorPanelControls ( )

Update operator panel override controls and slider labels based on panel type.

If an operator panel is active (OPERATOR_PANEL_STATUS == true), reads the jog rate continuous value from the MachMotion register and updates the JogSpeed DRO. Otherwise, reads the current feedrate override (FRO), rapid override (RRO), and spindle override from the selected instance and updates the FeedOVSliderText, RapidOVSliderText, and SpindleOVSliderText labels with formatted percentage strings.

Note
Documentation generated by AI on 2026-03-04

◆ UpdateScalingAndRotation()

CommonScreenV02 UpdateScalingAndRotation ( )

Update axis position DRO codes and scaling/rotation unit labels based on active G68 and G51 state.

Reads the current G68 rotation angle and per-axis G51 scale factors. When rotation or scaling changes, updates the G68 and G51 active flags and string representations. For each coordinate axis (X through C): switches the position DRO code between G68 and standard codes when rotation is active, updates rotary axis unit display strings ("(deg)"), and updates inch and metric display label strings with rotation and scaling annotations. Runs the UpdateScalingAndRotation and UpdateScalingAndRotationFinal screen hooks.

Returns
(nil) No meaningful primary return value
(boolean) Success flag - false if a hook encountered an error
(string) Status message from w.FunctionError() or hook completion message
Note
Documentation generated by AI on 2026-03-04

◆ UpdateScreenFonts()

CommonScreenV02 UpdateScreenFonts ( )

Update the font face name for all applicable screen controls based on the current formatting settings.

Iterates over all child controls of Main(1) excluding a set of ignored buttons. For each control that has a Font property and a non-empty font string, reads the current font object, then rebuilds it using the appropriate face name based on control type: FontNameButton for buttons, FontNameDRO for DROs, FontNameGCode for G-code list controls, and FontName for all other types. If the font weight is bold, switches to FontNameBold and sets the weight to FontWeightSemiBold before applying the updated font string.

Note
Documentation generated by AI on 2026-03-04

◆ UpdateSingleBlockButton()

CommonScreenV02 UpdateSingleBlockButton ( )

Update the SingleBlockBtn background color based on the current single block state.

Reads the single block state via mc.mcCntlGetSingleBlock() for the selected instance and sets the SingleBlockBtn background to the "On" color if single block is active, or "Off" color if inactive.

Note
Documentation generated by AI on 2026-03-04

◆ UpdateSoftLimitButton()

CommonScreenV02 UpdateSoftLimitButton ( )

Update the SoftLimitsBtn background color based on the current soft limits signal state.

Reads the OSIG_SOFTLIMITS_ON signal state for the selected instance and sets the SoftLimitsBtn background to the "On" color if soft limits are enabled, or "Off" color otherwise.

Note
Documentation generated by AI on 2026-03-04

◆ UpdateSpindleButtons()

CommonScreenV02 UpdateSpindleButtons ( )

Update spindle forward and reverse button states, colors, and labels based on spindle direction.

Reads the last spindle direction and delay state from m.LastSpindleDirection and m.LastSpindleDelayActive. Updates SpindleFWDBtn and SpindleREVBtn labels, enabled states, and background colors to reflect the current spindle state. Handles spindle brake activation when the spindle stops if SpindleBrakeEnabled is set. Calls UserSpindleInterLock if defined to optionally disable spindle buttons. Uses color coding: yellow for delay active, red for running, grey/off for stopped or disabled.

Note
Documentation generated by AI on 2026-03-04

◆ UpdateSpindleLoadMeter()

CommonScreenV02 UpdateSpindleLoadMeter ( )

Update the spindle and sub-spindle load meter gauges from register values.

If the spindle load meter is enabled, reads the register value from SPINDLE_LOAD_METER_DEVICE/SPINDLE_LOAD_METER_REGISTER and converts it to a percentage using the configured input scale min/max. Updates LoadGauge, SpindleLoadDRO, LoadText, and SpindleLoadText if the value has changed by more than 0.1. If the sub-spindle load meter is enabled, performs the same calculation for SubLoadGauge using the sub-spindle scale and register settings.

Note
Documentation generated by AI on 2026-03-04

◆ UpdateSpindleMinMaxSpeed()

CommonScreenV02 UpdateSpindleMinMaxSpeed ( )

Update the spindle range label with the current pulley range, min, and max RPM values.

Reads the current spindle pulley range and its associated min and max RPM values via the mc.mcSpindle API and formats them into the SpindleRangeMinMaxText label as "Range: {range} ({min}-{max}) RPM".

Note
Documentation generated by AI on 2026-03-04

◆ UpdateSpindleWarmUp()

CommonScreenV02 UpdateSpindleWarmUp ( )

Update the spindle warm-up group with protected error handling.

Wraps CommonScreenV02._UpdateSpindleWarmUp() in a w.pcall() to catch and log any errors via w.FunctionError(). This is the safe entry point for the periodic spindle warm-up state update called from the low priority loop.

Note
Documentation generated by AI on 2026-03-04

◆ UpdateStatusGroup()

CommonScreenV02 UpdateStatusGroup ( )

Update the StatusGroup label with the current machine state name.

Formats the StatusGroup label as "State: {MACH_STATE_NAME}" using the current localized "State" string and the global MACH_STATE_NAME value.

Note
Documentation generated by AI on 2026-03-04

◆ UpdateToolOffsetDROColors()

CommonScreenV02 UpdateToolOffsetDROColors ( )

Update the ToolLengthDRO and ToolDiameterDRO background colors based on active offset status.

For the ToolLengthDRO: reads the current tool length offset and wear, compares the active offset to the displayed DRO value, and sets the color to Active (green) when offset is non-zero and matches, Inconsistent (yellow) when offset is non-zero but does not match, Inactive (dark) when offset is zero and edit mode is off, or Write (blue) when edit mode is active. Applies the same three-state logic (Active/Inconsistent/Inactive/Write) to the ToolDiameterDRO using the current tool diameter offset and wear values.

Note
Documentation generated by AI on 2026-03-04

◆ UpdateToolPathExtents()

CommonScreenV02 UpdateToolPathExtents ( )

Update the toolpath extents DRO values for all six axes from path register data.

If a G-code file is loaded, reads the PathXmin/PathXmax through PathZmax registers from the "core/inst" device. If the ToolPathFileLimits OEM parameter is "Part Coordinates", subtracts the fixture origin offset from the register values before displaying. If no file is loaded, sets all min and max DRO values to zero.

Note
Documentation generated by AI on 2026-03-04

◆ UpdateToolPocketButtonColors()

CommonScreenV02 UpdateToolPocketButtonColors ( )

Update the background colors of tool pocket buttons to indicate the currently active pocket or tool.

Reads the current tool pocket or tool number from TOOL_POCKETS_BUTTON_INST based on the tool changer type (Auto uses pocket number, otherwise uses tool number). Updates the JumpToToolPocketGroup label with the current pocket or tool number, and highlights the button matching the current pocket with the "On" color while setting all others to the "Off" color.

Note
Documentation generated by AI on 2026-03-04

◆ UpdateToolPocketButtonLabels()

CommonScreenV02 UpdateToolPocketButtonLabels ( )

Update the labels and enabled state of tool pocket jump buttons based on current pocket index.

Sets each button label to the pocket number at the corresponding index, enables buttons for valid pockets, and disables buttons for indices beyond the max pocket count. Also enables or disables the NextToolPocketSets and PreviousToolPocketSets navigation buttons based on whether additional pages exist.

Note
Documentation generated by AI on 2026-03-04

◆ UpdateToolSetters()

CommonScreenV02 UpdateToolSetters ( )

Update the manual and auto tool setter height DROs with the current setter positions.

Reads the configured manual tool setter name via w.GetToolSetterManualName(). If a valid name is returned, reads the setter position via w.GetToolSetterPosition() and updates the ManualToolSetterHeightDRO. Repeats the same process for the auto tool setter name and the AutoToolSetterHeightDRO.

Note
Documentation generated by AI on 2026-03-04

◆ UpdateZeroButtons()

CommonScreenV02 UpdateZeroButtons ( )

Update the visibility, labels, and mode of Zero axis buttons based on edit mode and machine coordinate state.

For each axis, shows or hides the axis text label and Zero button depending on whether the axis is enabled and shown, whether edit mode is active, and whether machine coordinates are active. Lathe X-axis and OB axes above MC_MAX_COORD_AXES are never shown as Zero buttons. Sets the button font to Arial Black and updates each button label to "Zero\n{AxisLetter}".

Note
Documentation generated by AI on 2026-03-04