- Use App Designer to add necessary UI components (buttons, sliders, UIAxes, etc.) for both modes.
- Use “startupFcn(app)” to set up hardware connections, potentially storing the connection as a property of the app.
- Define a property to track the current mode ('manual' or 'automated').
- Use UI components (switches, buttons) to allow the user to change modes, adjusting UI elements and functionality accordingly.
- Link UI component callbacks (e.g., sliders for linear stages) directly to hardware control functions.
- Trigger automated sequences with a button, using a loop or timer for task execution. Ensure mechanisms are in place for safe stopping and mode switching.
- Update UIAxes or similar components with real-time data or results from the hardware.
- Implement “CloseRequestFcn” to properly close hardware connections and clean up resources when the app closes.
- https://www.mathworks.com/help/matlab/creating_guis/app-designer-startup-function.html
- https://www.mathworks.com/help/matlab/ref/matlab.ui.figureappd-properties.html