Skip to content
Snippets Groups Projects
Commit 71afde90 authored by Gino Tosti's avatar Gino Tosti
Browse files

added check on set input values

parent 347dad64
No related branches found
No related tags found
No related merge requests found
......@@ -416,7 +416,26 @@ public class ${Assembly}BaseImpl extends TCSHardwareDeviceImpl implements ${Asse
}
@Override
public void ${x.SetSheet["Name of command"][$idx]}($($y[$type][4]) arg0) throws IllegalParameterErrorEx,INACTErrorEx {
baciH.set$(($y[$type][4]).capitalize())ValSync(${x.SetSheet["Short name"][$idx]},arg0);
#if str($x.SetSheet["Alarm high"][$idx]) !="nan" and str($x.SetSheet["Alarm high"][$idx]).strip() !="NA" and str($x.SetSheet["Alarm high"][$idx]).strip() !="" and $y[$type][1] != "S"
#if $type[0]=="I" or $type[0]=="U"
$y[$type][4] maxval=str($x.SetSheet["Alarm high"][$idx]).split(".")[0];
#else
$y[$type][4] maxval=$x.SetSheet["Alarm high"][$idx];
#end if
#end if
#if str($x.SetSheet["Alarm low"][$idx]).strip() !="nan" and str($x.SetSheet["Alarm low"][$idx]).strip() !="NA" and str($x.SetSheet["Alarm low"][$idx]).strip() !="" and $y[$type][1] != "S"
#if $type[0]=="I" or $type[0]=="U"
$y[$type][4] minval=str($x.SetSheet["Alarm low"][$idx]).split(".")[0];
#else
$y[$type][4] minval=$x.SetSheet["Alarm low"][$idx];
#end if
#end if
if (arg0>=minval && arg0<=maxval){
baciH.set$(($y[$type][4]).capitalize())ValSync(${x.SetSheet["Short name"][$idx]},arg0);
} else {
m_logger.log(Level.SEVERE, "Value outside range for:"+"$x.SetSheet["Short name"][$idx]");
throws new IllegalParameterErrorEx();
}
}
#end if
......
......@@ -107,8 +107,9 @@
#else
units=""
#end if
min_timer_trig="0"
#if $y[$type][1] != 's'
#if $y[$type][1] != "S"
min_delta_trig="0"
min_step="1"
#end if
......
File added
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment