Custom Variable Configuration
Introduction :
The Gooey Delta Object can be used to create custom user variables that work with their custom MOP functions. The advantage of using the Gooey Delta Object is that the custom MOP function itself doesn’t have to be modified.
An example Optiscan system configuration is shown below:
The MOP function uses five custom variables:
- width – Width of Target (custom scaler)
- length – Length of Target (custom scaler)
- num_samples – Number of Sample Points (custom scaler)
- output_filename – The name of the output filename (custom string)
- show_plot – Should a plot of the result be shown (custom choice)
The Gooey Delta Variable list looks like this:
These Gooey Delta Variables are accessed in a custom MOP function using:
function [mop, curlink, simdata, errmsg] = custommop(action, mop, curlink, simdata)
%currently, there is no detected error, so there is no error message:
errmsg = ”;
%retrieve the delta variable structure with our variables:
delta_variables = get_deltavariables(mop)
%unmarshall the arguments with the “eval” statement.
%the second argument to “eval” is returned if the first
%argument does not “exist” (i.e. not set with the delta object):
width = eval(‘delta_variables.width’, ’10e-6′);
length = eval(‘delta_variables.length’, ’10e-6′);
output_filename = eval(‘delta_variables.output_filename’, ‘result.mat’);
%1==show plot; 2==dont show
plot
show_plot = eval(‘delta_variables.show_plot’, ‘1’)
%perform the calculations
Adding a MOP Variable :
Step 1 -click the button on the .
Step 2 – click the “MOP Custom Variable” variable from the variable pick list:
Step 3 – choose the type of the custom variable, and then configure (more) it as desired :
The most important thing to configure is the variable’s name. This variable will be accessed using:
delta_variables.width in the custom MOP function.
Step 4 – click the button.
Configuring MOP Variables (scaler | string | choice):
Custom Scaler Configuration :
Type – is the variable real or complex variables.
- Min – the minimum value for the variable.
- Max – the maximum value for the variable.
Custom String Configuration :
Custom Chioce Configuration :
Descriptions – a semicolon separated list of descriptions. There should be a description for each choice. The description for “Yes” as shown in the Gooey Delta Variable Tool tab:
Choices – the choices as shown in the Gooey Delta Variable Tool tab: