|
Mach Modules Documentation
Lua Module API Documentation
|
Go to the source code of this file.
Functions | |
| AzureLabelModule | ScreenLoad () |
| Initialize the AzureLabelModule during Mach4 screen load. | |
| AzureLabelModule | InitializeAPI () |
| Initialize the Azure label REST API backend. | |
| AzureLabelModule | GetLabels () |
| Retrieve all available Azure label templates as an ID-keyed table. | |
| AzureLabelModule | SelectLabel () |
| Display a dialog allowing the operator to select an Azure label template. | |
| UI | DestroyGauge () |
| Destroy the label picker dialog and release its resources. | |
| AzureLabelModule | SelectCurrentLabel (UI) |
| Pre-select the currently active label in the label picker UI choice control. | |
| AzureLabelModule | SendLabelData () |
| Send label data to the Azure label printing API. | |
| AzureLabelModule | GetTemplate () |
| Retrieve the data fields of the current Azure label template from the API. | |
| AzureLabelModule | CreateTemplate (temp_tbl, lbl_tbl) |
| Populate a ready data table with label field values using a template definition. | |
| AzureLabelModule | GetLabelID () |
| Get the currently selected Azure label ID from the machine profile. | |
| AzureLabelModule | CreatePreCannedCommands () |
| Register all AzureLabelModule commands with the Mach4 command system. | |
| MotionController CreatePreCannedCommands | ( | ) |
Register all AzureLabelModule commands with the Mach4 command system.
Create pre-canned user commands for the motion controller.
Creates and registers the pre-canned Mach4 commands associated with the AzureLabelModule. Currently registers the "Select Label" command, which opens a dialog for the operator to choose the active Azure label template. This function is intended to be called during screen load via the CommandRegistrar.
Base implementation that creates the generic commands applicable to all motion controllers by calling CreateGenericCommands(). Subclasses such as RapidPath override this to register additional controller-specific commands (motor disconnect, FDC capture, slave sync, etc.) while also calling this base method via self:CreateGenericCommands().
| AzureLabelModule CreateTemplate | ( | temp_tbl | , |
| lbl_tbl | ) |
Populate a ready data table with label field values using a template definition.
Iterates over the provided label data table and maps matching fields into the ready data table using the template definition as a schema. Only fields whose keys match a name entry in temp_tbl are written. The "templateId" key is explicitly excluded from processing. Field values are converted to strings before being written into the output table.
| ready_tbl | (table) The output table to populate with matched label data fields |
| temp_tbl | (table) Array of template field definition tables, each containing a "name" key |
| lbl_tbl | (table) Table of label data key-value pairs to map into the template |
| GCACaller UI DestroyGauge | ( | ) |
Destroy the label picker dialog and release its resources.
Destroy the GCACaller Array UI dialog and release associated resources.
Destroy the GCACaller progress bar dialog and release associated resources.
Destroy the GCode Search dialog and release its reference.
Destroy the quantity entry dialog and release its reference.
Calls Destroy() on the dialog window to free all associated wx resources and sets the dialog reference to nil. This function is assigned as a closure capturing the UI table and is called by both the close button handler and the EVT_CLOSE_WINDOW event handler.
Calls Destroy() on QUI.QtyDialog to free the wx dialog window and sets QUI.QtyDialog to nil to prevent dangling references.
Calls Destroy() on self.UI.m_Dialog1 to free the wx dialog and sets self.UI.m_Dialog1 to nil to prevent dangling references.
Destroys the wxWidgets Dialog1 progress bar window used during the MirrorX G-code adaptation operation and sets GCACaller.DI to nil, releasing all resources. This function is stored as a closure on GCACaller.DI and is called automatically when the adaptation process completes or is canceled by the operator.
Destroys the wxWidgets Dialog1 progress bar window used during the MirrorY G-code adaptation operation and sets GCACaller.DI to nil, releasing all resources. This function is stored as a closure on GCACaller.DI and is called automatically when the adaptation process completes or is canceled by the operator.
Destroys the wxWidgets Dialog1 progress bar window used during the Rotate G-code adaptation operation and sets GCACaller.DI to nil, releasing all resources. This function is stored as a closure on GCACaller.DI and is called automatically when the adaptation process completes or is canceled by the operator.
Destroys the wxWidgets Dialog1 progress bar window used during the Array G-code adaptation operation and sets GCACaller.DI to nil, releasing all resources. This function is stored as a closure on GCACaller.DI and is called automatically when the adaptation process completes or is canceled by the operator.
Destroys the wxWidgets ArrayDialog window and sets GCACaller.UI to nil, releasing all UI resources associated with the array configuration dialog. This function is stored as a closure on GCACaller.UI and should be called when the array dialog is no longer needed.
| AzureLabelModule GetLabelID | ( | ) |
Get the currently selected Azure label ID from the machine profile.
Reads the label ID stored in the "AzureLabelData" section of the Mach4 machine INI profile under the key "LabelID". Returns 0 if no label ID has been saved.
| AzureLabelModule GetLabels | ( | ) |
Retrieve all available Azure label templates as an ID-keyed table.
Initializes the API if not already initialized, then calls the API's GetIDs() method to retrieve all label definitions. The raw array response is transformed into a table keyed by label ID with the label name as the value, making lookups by ID efficient.
| AzureLabelModule GetTemplate | ( | ) |
Retrieve the data fields of the current Azure label template from the API.
Initializes the API if not already initialized, then fetches the template definition for the currently selected label ID. The label ID is stripped of any trailing ".0" decimal notation before being sent to the API. Returns only the "dataFields" portion of the template response.
| AzureLabelModule InitializeAPI | ( | ) |
Initialize the Azure label REST API backend.
Loads the mRESTData module and configures the AzureLabel backend with the provided URL and current Mach4 instance. If the API has already been initialized, this function returns immediately without reinitializing. The Modules/Addons directory is appended to package.path before requiring the module to ensure it can be located. Uses w.pcall() for protected loading and raises an error via w.Error() if the require fails.
| url | (string|nil) The Azure label API endpoint URL. If nil, uses AzureLabelModule.URL |
| AzureLabelModule ScreenLoad | ( | ) |
Initialize the AzureLabelModule during Mach4 screen load.
Registers the CreatePreCannedCommands function with the CommandRegistrar so that Azure label commands are available in Mach4. Reads the saved label ID from the machine profile and, if no label ID has been stored, retrieves the default label ID from the "AzureLabelDefaultLabelID" OEM parameter and writes it to the profile for future use.
| AzureLabelModule SelectCurrentLabel | ( | UI | ) |
Pre-select the currently active label in the label picker UI choice control.
Reads the saved label ID from the Mach4 machine profile and finds the corresponding label name in the provided labels table. If a valid saved label ID is found, the matching entry in the wxChoice control is selected automatically. If the saved ID is 0 or nil, no selection is made.
| labels | (table) Table mapping label IDs (keys) to label name strings (values) |
| UI | (table) The UI state table containing the m_choice wxChoice control |
| AzureLabelModule SelectLabel | ( | ) |
Display a dialog allowing the operator to select an Azure label template.
Fetches all available labels from the API and presents them in a wxChoice control within a standard dialog. The previously saved label ID is pre-selected. When the operator clicks Save, the chosen label ID is written to the Mach4 machine profile under "AzureLabelData/labelID". The dialog position and size are managed via w.Formatting staged dialog helpers.
| AzureLabelModule SendLabelData | ( | ) |
Send label data to the Azure label printing API.
Initializes the API if not already initialized, then builds and transmits a complete label print request. If the provided table does not include a "templateId", the currently selected label ID is used automatically. The function fetches the label template, maps the provided data fields using CreateTemplate(), and structures the payload with a "readyData" source type before calling the underlying API send method.
| lbl_tbl | (table) Table of label field key-value pairs to print. May optionally include a "templateId" key to override the default label ID |