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

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.

Function Documentation

◆ LoadMachineModule()

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.

Parameters
MachineModule(string) The name of the machine module to load (e.g., "MillGUIModule"). This must match a file in the Mach4 Modules directory
Note
Sets the following globals: MachDirectory, MachProfileName, MCodeDirectory, m
Documentation generated by AI on 2026-03-03

◆ ZeroBraneLoadScreen()

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.

Parameters
MachineModule(string|nil) The name of the machine module to load (e.g., "MillGUIModule"). If nil, defaults to "MillGUIModule"
Note
This function is intended for use in ZeroBrane Studio development workflows only, not for production screen loading
See also
LoadMachineModule() for the underlying module loading implementation
Note
Documentation generated by AI on 2026-03-03