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

Go to the source code of this file.

Functions

JetGUIModule MachineCycleStop ()
 Handle cycle stop by disabling the jet abrasive axis and clearing feedhold state flags.
JetGUIModule MachineCycleStopFinal ()
 Handle cycle stop finalization by disabling the jet abrasive axis and clearing state flags.
JetGUIModule MachineFeedHoldFinal ()
 Handle feedhold finalization by turning off jets if the feature is enabled.
JetGUIModule MachineCycleStartFinal ()
 Handle cycle start resumption after feedhold, re-enabling jets with pierce delay sequence.
JetGUIModule FileResumeBtn ()
 Handle the file resume button press by displaying a warning that file resume is disabled.
JetGUIModule LowPriorityLoop ()
 Periodic low-priority loop executed during the screen update cycle.
JetGUIModule StartUpScript ()
 Execute startup initialization tasks for the Jet GUI module.
JetGUIModule IsTurnOffJetsDuringFeedholdEnabled ()
 Check whether the turn-off-jets-during-feedhold feature is enabled in OEM parameters.
JetGUIModule ClearJetsTurnedOffDuringFeedholdFlag ()
 Clear the jets-turned-off-during-feedhold flag by setting it to false.
JetGUIModule SetJetsTurnedOffDuringFeedholdFlag ()
 Set the jets-turned-off-during-feedhold flag to true.
JetGUIModule IsJetsTurnedOffDuringFeedholdFlag ()
 Return the current value of the jets-turned-off-during-feedhold flag.
JetGUIModule ClearJetDelaysActiveFlag ()
 Clear the jet delays active flag by setting it to false.
JetGUIModule SetJetDelaysActiveFlag ()
 Set the jet delays active flag to true.
JetGUIModule IsJetDelaysActiveFlag ()
 Return the current value of the jet delays active flag.
JetGUIModule SpindleSafetyCheck ()
 Verify that the machine is in a safe state before allowing the jets to be started.
JetGUIModule SpindleFWDBtn (use_confirmation)
 Button handler that logs the jets-on press event and delegates to m.SpindleFWD().
JetGUIModule SpindleFWD (use_confirmation)
 Start the waterjet (spindle) in the forward direction by executing the M3 script.
JetGUIModule SpindleStopBtn ()
 Button handler that logs the jets stop press event and delegates to SpindleStop().
JetGUIModule SpindleStop ()
 Stop the waterjet (spindle) by executing the M5 script or cancelling an active delay.
JetGUIModule IsDryRunOn ()
 Check whether dry run mode is currently active for the selected instance.
JetGUIModule SetDryRun (on_off)
 Enable or disable dry run mode for the selected Mach4 instance.
JetGUIModule DryRunToggleBtn ()
 Button handler that logs the dry run press event and delegates to m.DryRunToggle().
JetGUIModule DryRunToggle ()
 Toggle dry run mode on or off for the selected instance.
JetGUIModule StartDryRun ()
 Configure machine state and disable jets when entering dry run mode.
JetGUIModule StopDryRun ()
 Restore machine state and re-enable jets after exiting dry run mode.

Function Documentation

◆ ClearJetDelaysActiveFlag()

JetGUIModule ClearJetDelaysActiveFlag ( )

Clear the jet delays active flag by setting it to false.

Resets the module-level JetDelaysActiveFlag so that feedhold and cycle start handlers no longer treat a delay sequence as in progress. Should be called after all jet delay sequences (pressure, abrasive, pierce) have completed.

Note
Documentation generated by AI on 2026-03-04

◆ ClearJetsTurnedOffDuringFeedholdFlag()

JetGUIModule ClearJetsTurnedOffDuringFeedholdFlag ( )

Clear the jets-turned-off-during-feedhold flag by setting it to false.

Resets the module-level JetsTurnedOffDuringFeedhold flag so that subsequent cycle start handling does not attempt to re-enable jets that were not turned off during feedhold.

Note
Documentation generated by AI on 2026-03-03

◆ DryRunToggle()

JetGUIModule DryRunToggle ( )

Toggle dry run mode on or off for the selected instance.

Verifies that the machine is not in manual mode before toggling. Reads the current dry run state via m.IsDryRunOn() and passes the inverse to m.SetDryRun() to toggle it. Returns an error if the machine is in manual mode or if the mode check fails.

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

◆ DryRunToggleBtn()

JetGUIModule DryRunToggleBtn ( )

Button handler that logs the dry run press event and delegates to m.DryRunToggle().

Writes an operator log entry for the dry run button press, then calls m.DryRunToggle() to perform the actual toggle logic. The return value of m.DryRunToggle() is passed through to the caller.

Returns
(...) Return values passed through from m.DryRunToggle()
Note
Documentation generated by AI on 2026-03-03

◆ FileResumeBtn()

JetGUIModule FileResumeBtn ( )

Handle the file resume button press by displaying a warning that file resume is disabled.

Logs the button press to the operator log and displays a warning message informing the operator that file resume is not supported on jet machines. No resume action is performed.

Note
Documentation generated by AI on 2026-03-04

◆ IsDryRunOn()

JetGUIModule IsDryRunOn ( )

Check whether dry run mode is currently active for the selected instance.

Reads the 'DryRun' OEM parameter string for the currently selected instance and returns true if its value equals "Yes".

Returns
(boolean) True if dry run mode is active, false otherwise
Note
Documentation generated by AI on 2026-03-03

◆ IsJetDelaysActiveFlag()

JetGUIModule IsJetDelaysActiveFlag ( )

Return the current value of the jet delays active flag.

Returns
(boolean) True if jet delays are currently active, false otherwise
Note
Documentation generated by AI on 2026-03-04

◆ IsJetsTurnedOffDuringFeedholdFlag()

JetGUIModule IsJetsTurnedOffDuringFeedholdFlag ( )

Return the current value of the jets-turned-off-during-feedhold flag.

Returns
(boolean) True if jets were turned off during a feedhold, false otherwise
Note
Documentation generated by AI on 2026-03-03

◆ IsTurnOffJetsDuringFeedholdEnabled()

JetGUIModule IsTurnOffJetsDuringFeedholdEnabled ( )

Check whether the turn-off-jets-during-feedhold feature is enabled in OEM parameters.

Reads the 'JetsTurnOffJetsDuringFeedhold' OEM parameter string and returns true if its value equals "Yes".

Returns
(boolean) True if jets should be turned off during feedhold, false otherwise
Note
Documentation generated by AI on 2026-03-03

◆ LowPriorityLoop()

JetGUIModule LowPriorityLoop ( )

Periodic low-priority loop executed during the screen update cycle.

Called repeatedly at low priority during normal machine operation. Updates the tool offset DRO background colors to reflect whether a tool length offset is currently active.

Note
Documentation generated by AI on 2026-03-03

◆ MachineCycleStartFinal()

JetGUIModule MachineCycleStartFinal ( )

Handle cycle start resumption after feedhold, re-enabling jets with pierce delay sequence.

Called as the final step of a cycle start event. If the turn-off-jets-during-feedhold feature is enabled, checks whether jets were turned off during a prior feedhold and whether the machine is transitioning into a run state (MC_STATE_FRUN or higher) without dry run active. If all conditions are met, resets the cycle-start pressed flag to prevent premature cancellation, then executes the full jet re-enable sequence: sets pressure on, waits for the pressure delay, enables abrasive, waits for the abrasive delay, and finally waits for the pierce delay. A dwell progress bar is displayed if the total delay exceeds 100ms. Clears the feedhold flag on completion.

Returns
(boolean) Always true as the primary return value
(boolean) Success flag - always true
(string) Status message from w.FunctionCompleted()
Warning
Resets the cycle-start pressed flag internally; do not call outside of the cycle-start hook chain
Note
Documentation generated by AI on 2026-03-03

◆ MachineCycleStop()

JetGUIModule MachineCycleStop ( )

Handle cycle stop by disabling the jet abrasive axis and clearing feedhold state flags.

Called when a cycle stop is issued. Clears the jets-turned-off-during-feedhold flag via ClearJetsTurnedOffDuringFeedholdFlag() and disables the jet abrasive axis output via aux.SetJetAbrasiveAxis(false).

Returns
(boolean) Always true as the primary return value
(boolean) Success flag - always true
(string) Status message from w.FunctionCompleted()
Note
Documentation generated by AI on 2026-03-03

◆ MachineCycleStopFinal()

JetGUIModule MachineCycleStopFinal ( )

Handle cycle stop finalization by disabling the jet abrasive axis and clearing state flags.

Called as the final step when a cycle stop is issued. Clears the jets-turned-off-during-feedhold flag and disables the jet abrasive axis output via aux.SetJetAbrasiveAxis(false). If the spindle (jets) is currently on, also disables abrasive (with purge delay) and pressure.

Returns
(boolean) Always true as the primary return value
(boolean) Success flag - always true
(string) Status message from w.FunctionCompleted()
Note
Documentation generated by AI on 2026-03-03

◆ MachineFeedHoldFinal()

JetGUIModule MachineFeedHoldFinal ( )

Handle feedhold finalization by turning off jets if the feature is enabled.

Called as the final step when the machine enters feedhold. If the turn-off-jets-during-feedhold feature is enabled and the spindle (jets) is currently running, sets the feedhold flag via SetJetsTurnedOffDuringFeedholdFlag(), then disables abrasive (with purge delay) and pressure in sequence.

Returns
(boolean) Always true as the primary return value
(boolean) Success flag - always true
(string) Status message from w.FunctionCompleted()
Note
Documentation generated by AI on 2026-03-03

◆ SetDryRun()

JetGUIModule SetDryRun ( on_off )

Enable or disable dry run mode for the selected Mach4 instance.

Checks that the machine is not in manual mode before applying the change. If on_off is true, sets the 'DryRun' OEM parameter to "Yes" and calls m.StartDryRun() via w.Protected(). If on_off is false, sets the parameter to "No" and calls m.StopDryRun() via w.Protected(). Returns an error if the manual mode check fails or if the machine is currently in manual mode.

Parameters
on_off(boolean) True to enable dry run mode, false to disable it
Returns
(nil) No 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-03

◆ SetJetDelaysActiveFlag()

JetGUIModule SetJetDelaysActiveFlag ( )

Set the jet delays active flag to true.

Marks that a jet delay sequence (pressure, abrasive, or pierce delay) is currently in progress. This flag is checked by MachineFeedHoldFinal() and MachineCycleStartFinal() to prevent conflicting jet state changes while delays are executing.

Note
Documentation generated by AI on 2026-03-04

◆ SetJetsTurnedOffDuringFeedholdFlag()

JetGUIModule SetJetsTurnedOffDuringFeedholdFlag ( )

Set the jets-turned-off-during-feedhold flag to true.

Marks that the jets were turned off as a result of entering feedhold, so that MachineCycleStartFinal() can re-enable them with the proper pierce delay sequence on resume.

Note
Documentation generated by AI on 2026-03-03

◆ SpindleFWD()

JetGUIModule SpindleFWD ( use_confirmation )

Start the waterjet (spindle) in the forward direction by executing the M3 script.

Updates stop status, then performs a safety check via m.SpindleSafetyCheck(). Runs all registered 'SpindleFWD' hooks; returns early if a hook cancels the operation. Checks the MSTLock register and skips the command if the lock is active. Verifies that no spindle delay is already running (SpindleDelayActive). If use_confirmation is true, displays a cycle-start confirmation dialog before proceeding. When the machine is enabled, executes the m3.mcs private script to start the jets. Displays a warning if the machine is not enabled.

Parameters
use_confirmation(boolean) If true, prompts the operator to confirm via cycle start dialog before starting the jets
Returns
(nil) No 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-03

◆ SpindleFWDBtn()

JetGUIModule SpindleFWDBtn ( use_confirmation )

Button handler that logs the jets-on press event and delegates to m.SpindleFWD().

Writes an operator log entry for the jets-on button press, then calls m.SpindleFWD() passing the use_confirmation flag through to control whether a confirmation dialog is shown before starting the jets.

Parameters
use_confirmation(boolean) If true, a cycle-start confirmation dialog is shown before starting the jets
Note
Documentation generated by AI on 2026-03-03

◆ SpindleSafetyCheck()

JetGUIModule SpindleSafetyCheck ( )

Verify that the machine is in a safe state before allowing the jets to be started.

Retrieves the current GMS alarm and GMS warning states. If either is active, displays a warning dialog instructing the operator to clear alarms and warnings by pressing Reset, and returns a failure status. If both states are clear, returns success.

Returns
(boolean|nil) True if machine is safe to start jets, false or nil if alarms/warnings are present
(boolean) Success flag - true if check completed without errors
(string) Status message from w.FunctionCompleted() or w.FunctionError()
Note
Documentation generated by AI on 2026-03-03

◆ SpindleStop()

JetGUIModule SpindleStop ( )

Stop the waterjet (spindle) by executing the M5 script or cancelling an active delay.

Updates stop status, then runs all registered 'SpindleStop' hooks. If any hook cancels the operation, returns early. Checks the MSTLock register and skips the stop command if the lock is active. Cancels any active spindle warm-up sequence by writing -1 to the 'SpindleWarmUpActive' register. If a spindle delay is currently active (SpindleDelayActive == 1), disables the jet abrasive axis and sets spindle direction to MC_SPINDLE_OFF directly. Otherwise, executes the m5.mcs private script to perform the full stop sequence.

Returns
(nil) No 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-03

◆ SpindleStopBtn()

JetGUIModule SpindleStopBtn ( )

Button handler that logs the jets stop press event and delegates to SpindleStop().

Writes an operator log entry for the jets stop button press, then calls JetGUIModule.SpindleStop() to perform the actual stop sequence.

Note
Documentation generated by AI on 2026-03-03

◆ StartDryRun()

JetGUIModule StartDryRun ( )

Configure machine state and disable jets when entering dry run mode.

Reads the configured dry run feedrate override from the 'JetsDryRunFeedrateOverride' OEM parameter, capping it at the profile's maximum FRO if necessary. Stores the current FRO value into 'JetsDryRunPreFeedrateOverride' so it can be restored later by StopDryRun(). Sets the active FRO to the dry run value, then disables both jets pressure and abrasive outputs.

Note
Documentation generated by AI on 2026-03-03

◆ StartUpScript()

JetGUIModule StartUpScript ( )

Execute startup initialization tasks for the Jet GUI module.

Called once during screen load. Adds tool path colors to the tool table via m.AddToolPathColorsToToolTable() to ensure the tool path display is correctly configured at startup.

Note
Documentation generated by AI on 2026-03-03

◆ StopDryRun()

JetGUIModule StopDryRun ( )

Restore machine state and re-enable jets after exiting dry run mode.

Restores the feedrate override (FRO) to the value stored before dry run was activated. If the spindle (jets) is currently on and the 'JetsDryRunPauseForPierceDelay' OEM parameter is set to "Yes", the FRO is temporarily set to 0 and the full pierce delay sequence is executed (pressure delay, abrasive delay, pierce delay) before restoring the FRO. A dwell progress bar is displayed if the total delay exceeds 100ms. If the pause option is not enabled, jets pressure and abrasive are simply re-enabled without delay.

Note
Documentation generated by AI on 2026-03-03