|
Mach Modules Documentation
Lua Module API Documentation
|
Go to the source code of this file.
Functions | |
| LoadMachineModule (MachineModule) | |
| Load a Mach4 machine module and configure global directory paths. | |
| ZeroBraneLoadScreen (MachineModule) | |
| Initialize and load a Mach4 machine module for ZeroBrane Studio development environment. | |
| LoadMachineModule | ( | MachineModule | ) |
Load a Mach4 machine module and configure global directory paths.
Retrieves the current Mach4 instance and resolves the machine directory, profile name, and M-code directory, storing them as global variables (MachDirectory, MachProfileName, MCodeDirectory). Appends the Modules directory to package.path to allow require() to locate module files with .lua and .mcc extensions. The specified machine module is then force-reloaded by clearing its package.loaded cache entry before requiring it, ensuring a fresh load. This function is designed to be globally accessible so that CommonGUIModule.LoadAllModules() can call it to reload modules without restarting Mach4.
| MachineModule | (string) The name of the machine module to load (e.g., "MillGUIModule"). This must match a file in the Mach4 Modules directory |
| ZeroBraneLoadScreen | ( | MachineModule | ) |
Initialize and load a Mach4 machine module for ZeroBrane Studio development environment.
Sets up the Mach4 directory paths and loads the specified machine module for use in ZeroBrane Studio. If no module name is provided, defaults to "MillGUIModule". After loading the machine module via LoadMachineModule(), this function calls m.CommonScreenLoadScript() to initialize the screen, then attempts to set the ControlScreenStyle OEM register to "3". Any failure to set the screen version register is logged via mc.mcCntlLog() but does not halt execution.
| MachineModule | (string|nil) The name of the machine module to load (e.g., "MillGUIModule"). If nil, defaults to "MillGUIModule" |