|
Mach Modules Documentation
Lua Module API Documentation
|
Go to the source code of this file.
Functions | |
| PlasmaGUIModule | MachineLoadModules () |
| Load all machine-specific modules required by the Plasma GUI. | |
| PlasmaGUIModule | MachineInitializeModules () |
| Initialize all height controller modules for the Plasma GUI. | |
| PlasmaGUIModule | ScreenLoadScript () |
| Execute all screen load initialization tasks for the Plasma GUI module. | |
| PlasmaGUIModule | StartUpScript () |
| Execute all startup configuration tasks for the Plasma GUI screen. | |
| PlasmaGUIModule | LoadHeightControllers () |
| Load the HeightControllers module and create a height controller interface object for each Mach4 instance. | |
| PlasmaGUIModule | HeightControllersInitialization () |
| Execute the Initialization routine on all height controller instances. | |
| PlasmaGUIModule | HeightControllersStartup () |
| Execute the Startup routine on all height controller instances. | |
| PlasmaGUIModule | HeightControllersStartCutRecoveryCuttingRoutine () |
| Invoke the StartCutRecoveryCuttingRoutine on all height controller instances. | |
| PlasmaGUIModule | PLCScript () |
| Execute all PLC scan cycle tasks for the Plasma screen module. | |
| PlasmaGUIModule | MachineSignalScript (sig_id, sig_state, inst) |
| Forward machine signal events to the height controller for the affected instance. | |
| PlasmaGUIModule | MachineCycleStop () |
| Delegate the cycle stop event to the active height controller instance. | |
| PlasmaGUIModule | MachineReset () |
| Delegate the machine reset event to the active height controller instance. | |
| PlasmaGUIModule | MachineCycleStartFinal () |
| Delegate the cycle start final event to the active height controller instance. | |
| PlasmaGUIModule | ConfigureToolSizeEntryMode () |
| Read the ToolSizeEntryMode OEM parameter and apply it by calling SetToolSizeEntryMode. | |
| PlasmaGUIModule | LowPriorityLoop () |
| Delegate the low priority loop processing to the active height controller instance. | |
| PlasmaGUIModule | RetractDialog () |
| Display a modal dialog for the operator to select a retract position or stay in place. | |
| UI | CloseDialog () |
| Save the current radio box selection to the profile and destroy the retract dialog. | |
| UI CloseDialog | ( | ) |
Save the current radio box selection to the profile and destroy the retract dialog.
Reads the currently selected position index from GoToPositionRadioBox, persists it to the Mach4 profile under "MachMotion/LastGoToRetractPositionType", stops the GoToRetractPositionsDialogTimer if running, and then destroys the dialog window. This function is a closure defined inside RetractDialog and operates on the UI table.
| PlasmaGUIModule ConfigureToolSizeEntryMode | ( | ) |
Read the ToolSizeEntryMode OEM parameter and apply it by calling SetToolSizeEntryMode.
Retrieves the ToolSizeEntryMode string value from OEM parameters. If the parameter is found, calls PlasmaGUIModule.SetToolSizeEntryMode with the retrieved value using w.pcall for protected execution. Any error returned from SetToolSizeEntryMode is logged to the Mach4 control log at line 26.
| PlasmaGUIModule HeightControllersInitialization | ( | ) |
Execute the Initialization routine on all height controller instances.
Iterates over all Mach4 instances. For each instance where HC[_inst] exists and is not nil, calls HC[_inst]:Initialization() inside a w.pcall protected call. If the call fails, extracts the error message (from table or string), creates a system global Alarm GMS message with the error description, and returns an error result. Returns success on normal completion.
| PlasmaGUIModule HeightControllersStartCutRecoveryCuttingRoutine | ( | ) |
Invoke the StartCutRecoveryCuttingRoutine on all height controller instances.
Iterates over all Mach4 instances. For each instance where HC[_inst] exists and is not nil, calls HC[_inst]:StartCutRecoveryCuttingRoutine() inside a w.pcall protected call. If the call fails, extracts the error message (from table or string), creates a system global alarm message with the error description, and returns an error result. Returns no explicit success result on completion (no return at end of function for the success path).
| PlasmaGUIModule HeightControllersStartup | ( | ) |
Execute the Startup routine on all height controller instances.
Iterates over all Mach4 instances. For each instance where HC[_inst] exists and is not nil, calls HC[_inst]:Startup() inside a w.pcall protected call. If the call fails, extracts the error message (from table or string), creates a system global Alarm GMS message with the error description, and returns an error result. Returns success on normal completion.
| PlasmaGUIModule LoadHeightControllers | ( | ) |
Load the HeightControllers module and create a height controller interface object for each Mach4 instance.
Clears any previously loaded HeightControllers module from package.loaded, then requires it using w.pcall for protected loading. If loading fails, logs the error and displays a message box. On success, iterates over all Mach4 instances (0 to GetInstanceCount()-1) and calls HC:Create() for each instance in "SCREEN" mode using w.pcall. If object creation fails, displays a message box with the error. On success, stores the returned object in HC[_inst].
| PlasmaGUIModule LowPriorityLoop | ( | ) |
Delegate the low priority loop processing to the active height controller instance.
Retrieves the current unique tool instance (UTI) and, if the height controller object HC[_inst] exists and implements a LowPriorityLoop method, calls it. This function is intended to be called from the screen's low priority loop to allow height controller housekeeping tasks to run at reduced frequency.
| PlasmaGUIModule MachineCycleStartFinal | ( | ) |
Delegate the cycle start final event to the active height controller instance.
Retrieves the current unique tool instance (UTI) and, if the height controller object HC[_inst] exists and implements a CycleStartFinal method, calls it and returns its result. This is called at the final stage of cycle start to allow the height controller to perform any last-moment checks or actions before motion begins.
| PlasmaGUIModule MachineCycleStop | ( | ) |
Delegate the cycle stop event to the active height controller instance.
Retrieves the current unique tool instance (UTI) and, if the height controller object HC[_inst] exists and implements a CycleStop method, calls it. This allows the height controller to perform any necessary actions (such as retracting the torch) when a cycle stop event occurs.
| PlasmaGUIModule MachineInitializeModules | ( | ) |
Initialize all height controller modules for the Plasma GUI.
Delegates to m.HeightControllersInitialization() to run the initialization sequence for all loaded height controller instances. Called during the module initialization phase before startup.
| PlasmaGUIModule MachineLoadModules | ( | ) |
Load all machine-specific modules required by the Plasma GUI.
Delegates to m.LoadHeightControllers() to load and instantiate the HeightControllers module. Called during the machine module load phase before initialization and startup.
| PlasmaGUIModule MachineReset | ( | ) |
Delegate the machine reset event to the active height controller instance.
Retrieves the current unique tool instance (UTI) and, if the height controller object HC[_inst] exists and implements a Reset method, calls it. This allows the height controller to perform any necessary cleanup or state reset when the machine reset event occurs.
| PlasmaGUIModule MachineSignalScript | ( | sig_id | , |
| sig_state | , | ||
| inst | ) |
Forward machine signal events to the height controller for the affected instance.
Resolves the unique tool instance index from the provided inst handle using w.GetUTI(). If the height controller HC[_inst] exists and implements a SignalScript method, calls it with the signal ID and signal state so the height controller can respond to I/O signal changes.
| sig_id | (number) The signal identifier that changed state |
| sig_state | (boolean) The new state of the signal (true = active, false = inactive) |
| inst | (number) The Mach4 instance handle associated with the signal event |
| PlasmaGUIModule PLCScript | ( | ) |
Execute all PLC scan cycle tasks for the Plasma screen module.
Called on every PLC scan cycle. Performs the following tasks in order:
| PlasmaGUIModule RetractDialog | ( | ) |
Display a modal dialog for the operator to select a retract position or stay in place.
Creates and shows a wxDialog with a radio box listing all configured go-to positions (from w.GetConfiguredGoToPositions()) and Move/Stay buttons. The last selected position index is persisted to the Mach4 profile and restored on open. A repeating 200ms timer monitors for Mach shutdown or stop events; if detected, closes the dialog and sets the result to "Do Not Move". The Move button closes the dialog with the selected position name. The Stay button sets the result to "Do Not Move" and closes the dialog. The selected position name is written back to the RetractDialog OEM register by the caller (IsRetractActive).
| PlasmaGUIModule ScreenLoadScript | ( | ) |
Execute all screen load initialization tasks for the Plasma GUI module.
Performs the following operations during screen load:
| PlasmaGUIModule StartUpScript | ( | ) |
Execute all startup configuration tasks for the Plasma GUI screen.
Performs the following startup operations in order: