Kramer Electronics SP-14 User Manual
Page 21

used to convert the numeric value into a string and hides the numbers from the user. Note
that the get string function may return a different string for a particular value on separate
occasions.
3.3.5.3.1 Example scenario
To demonstrate how all the functions are interrelated and work together, the following
sections present pseudo code showing how the API is intended to be used and is used within
our own user interface software both in firmware and on a PC.
3.3.5.3.2 Connect to unit
The query function needs only be call once per connection.
boolean succ;
int qfuncs;
succ = queryAll(paramID => avPar_contrast, result => qfuncs);
if succ then
test qfuncs for min, max, value, e2val
else
Process Error
end if
3.3.5.3.3 Availability Check
The availability function needs to be tested before editing a parameter.
boolean succ;
int avail;
succ = checkAvail(paramID => avPar_contrast, result => avail);
if succ then
if avail then
activate UI control
else
display not available or grey out GUI control
end if
else
Process Error
end if
3.3.5.3.4 Initiating UI Control for Editing
Having established the parameter is available and the user selects the parameter for editing
the user interface needs to obtain the range and current value.
int qfuncs; -- obtained on connection
boolean succ;
int min;
int max;
int val;
int valAvail;
string st;
succ = get(paramID => avPar_contrast,
attribute => avParamAttr_min,
value => min);
if succ then
succ = get(paramID => avPar_contrast,
attribute => avParamAttr_max,
value => max);