|
Mach Modules Documentation
Lua Module API Documentation
|
Go to the source code of this file.
Functions | |
| CommonShapeCuttingScreenV02 | ProcessToolPathMouseDownEvent () |
| Handle a left mouse button down event on the tool path display. | |
| CommonShapeCuttingScreenV02 | MoveToToolPathPosition () |
| Initiate the Move To Tool Path Position workflow. | |
| CommonShapeCuttingScreenV02 | ProcessMoveToTPPathPosition (mouse_pos) |
| Process a tool path mouse click to move the machine to the selected path position. | |
| CommonShapeCuttingScreenV02 | MoveToToolPathStart () |
| Initiate the Move To Tool Path Start workflow. | |
| CommonShapeCuttingScreenV02 | ProcessMoveToTPPathStart (mouse_pos) |
| Process a tool path mouse click to move the machine to the start of the nearest cut. | |
| CommonShapeCuttingScreenV02 | UpdateMoveToTPPositionBtn () |
| Update the visual state of the Move To Tool Path Position and Start buttons. | |
| CommonShapeCuttingScreenV02 | CutRecoveryBtn () |
| Handle the Cut Recovery button press from the screen. | |
| CommonShapeCuttingScreenV02 | CutRecovery (use_confirmation, mouse_pos) |
| Execute a cut recovery operation with protected error handling. | |
| CommonShapeCuttingScreenV02 | RotatePoint (x, y, angle) |
| Rotate a 2D point around the origin by a given angle. | |
| CommonShapeCuttingScreenV02 | PauseAfterCutToggle () |
| Toggle the Pause After Cut feature on or off. | |
| CommonShapeCuttingScreenV02 | IsPauseAfterCutEnabled () |
| Check whether the Pause After Cut feature is enabled. | |
| CommonShapeCuttingScreenV02 | OpenShapeLibrary () |
| Open the Shape Library browser dialog. | |
| CommonShapeCuttingScreenV02 | CommonShapeCuttingCreatePreCannedCommands () |
| Register pre-canned commands for common shape cutting screen functionality. | |
| CommonShapeCuttingScreenV02 CommonShapeCuttingCreatePreCannedCommands | ( | ) |
Register pre-canned commands for common shape cutting screen functionality.
Creates and registers a set of standard commands used by shape cutting screens (Jet, Plasma, etc.). Each command is registered with an action option, optional feedback option, and button labels. The following commands are registered:
| CommonShapeCuttingScreenV02 CutRecovery | ( | use_confirmation | , |
| mouse_pos | ) |
Execute a cut recovery operation with protected error handling.
Wraps the internal _CutRecovery function in a protected call via w.pcall() to catch any Lua errors that occur during the recovery process. If an error is raised, it is forwarded to w.FunctionError(). This is the safe public entry point for cut recovery.
| use_confirmation | (boolean) If true (or not explicitly false), shows a Cycle Start confirmation dialog before moving. Pass false to skip confirmation. |
| mouse_pos | (table|nil) Optional table containing machine and part coordinates from a tool path mouse click event. If nil, uses the current machine position. |
| CommonShapeCuttingScreenV02 CutRecoveryBtn | ( | ) |
Handle the Cut Recovery button press from the screen.
Determines whether commands are being issued from operator panels using w.PretendCommandsAreFromOperatorPanels(), then invokes the cut recovery operation with the inverted result as the use_confirmation flag. When not pretending to be operator panel commands, confirmation will be requested from the user.
| CommonShapeCuttingScreenV02 IsPauseAfterCutEnabled | ( | ) |
Check whether the Pause After Cut feature is enabled.
Reads the "PauseAfterCutEnabled" OEM parameter and returns true if its value is "Yes".
| CommonShapeCuttingScreenV02 MoveToToolPathPosition | ( | ) |
Initiate the Move To Tool Path Position workflow.
This is the first half of a two-step operation. When called:
| CommonShapeCuttingScreenV02 MoveToToolPathStart | ( | ) |
Initiate the Move To Tool Path Start workflow.
This is the first half of a two-step operation. When called:
| CommonShapeCuttingScreenV02 OpenShapeLibrary | ( | ) |
Open the Shape Library browser dialog.
Unloads any cached version of the ShapeLibraryMain module before reloading it, ensuring the latest version is always used. Then launches the main shape browser UI.
| CommonShapeCuttingScreenV02 PauseAfterCutToggle | ( | ) |
Toggle the Pause After Cut feature on or off.
If Pause After Cut is currently enabled, disables it by setting the "PauseAfterCutEnabled" OEM parameter to "No". If it is currently disabled, enables it by setting the parameter to "Yes".
| CommonShapeCuttingScreenV02 ProcessMoveToTPPathPosition | ( | mouse_pos | ) |
Process a tool path mouse click to move the machine to the selected path position.
This is the second half of the Move To Tool Path Position workflow, called after the user clicks on the tool path display. Validates that the mouse_pos argument is a table, then optionally shows a Cycle Start confirmation dialog. If confirmed (or confirmation is skipped), delegates to m.screen.CutRecovery() with the mouse position to perform the repositioning move.
| mouse_pos | (table) Table with "machine" and "part" sub-tables indexed by axis constant, containing the machine and part coordinates of the mouse click on the tool path display |
| CommonShapeCuttingScreenV02 ProcessMoveToTPPathStart | ( | mouse_pos | ) |
Process a tool path mouse click to move the machine to the start of the nearest cut.
This is the second half of the Move To Tool Path Start workflow, called after the user clicks on the tool path display. It performs the following steps:
| mouse_pos | (table) Table with "machine" and "part" sub-tables indexed by axis constant, containing the machine and part coordinates of the mouse click on the tool path display |
| CommonShapeCuttingScreenV02 ProcessToolPathMouseDownEvent | ( | ) |
Handle a left mouse button down event on the tool path display.
This function is called when the user clicks on the tool path display during a Move To Position or Move To Start workflow. It performs the following steps:
| CommonShapeCuttingScreenV02 RotatePoint | ( | x | , |
| y | , | ||
| angle | ) |
Rotate a 2D point around the origin by a given angle.
Rotates the point (x, y) around the origin (0, 0) by the specified number of degrees. The angle sign is automatically inverted before conversion to radians, so a positive input angle produces a clockwise rotation in standard screen coordinates.
| x | (number) The X coordinate of the point to rotate |
| y | (number) The Y coordinate of the point to rotate |
| angle | (number) The rotation angle in degrees (sign is inverted internally) |
| CommonShapeCuttingScreenV02 UpdateMoveToTPPositionBtn | ( | ) |
Update the visual state of the Move To Tool Path Position and Start buttons.
Sets the button color of "MoveToTPPositionBtn" to BTN_COLOR_ON when MoveToTPPathPositionIsActive is true and tool path mouse capture is active, otherwise sets it to BTN_COLOR_OFF. Applies the same logic to "MoveToTPStartBtn" using the MoveToTPPathStartIsActive flag. This function should be called on screen update cycles.