-
Notifications
You must be signed in to change notification settings - Fork 7
The commands substructure
aortega255 edited this page Jul 22, 2020
·
1 revision
This structure is meant to give human-friendly aliases to serial functions. That way, the GUI can reference more intuitive commands like ‘LightsOn’, instead of a string of binary numbers. All of the commands ended up implemented as anonymous functions to give them more flexibility and reduce the need of multiple similar commands (for example, to prevent having a command to turn on LED 1 and a different one to turn on LED 2). All of the commands take the state variable app as the first input, and some of them might have more than one input. All of the following commands need to be specified for each hardware device in order to have full compatibility:
- LightsOff(app). This command should specify the serial string to send to the device in order to turn all light sources off at the same time. For example, for ninjaNIRS the command would be [2 255 bin2dec('11000010') 0].
- LightsOn(app). This command should specify the serial string to send to the device in order to turn all light sources on at the same time. If the light sources have several intensity levels, the expected behavior of this command is to turn them all at their default intensity. For example, if a source is set as short separation, this command will turn it on at low power. Or if an optode is set as “detector only”, this command should not turn its LED on.
- SourceNOn(app,N,L). This command turns all wavelengths on source N to the level specified by L. How L is specified needs to be calculated depending on the power levels permitted by the specific hardware.
- SourceNOff(app,N). This command turns all wavelengths on light source N off.
- SourceNIndL(app,N,L). This command is used to control the level of each wavelength of a light source individually. L needs to be 1xw vector where w is the number of wavelengths in the light source. Each element specifies the desired light level for the respective wavelength. The wavelengths in vector L should be ordered by shorter to longer wavelengths.
- Start(app). This is the command that will start the acquisition of the serial device.
- Stop(app). This is the command that will stop the acquisition of the serial device. No other commands will be invoked in the current version of ninjaGUI.