Merge branch 'RELEASE-3_1'

Conflicts:
	sics/site_ansto/instrument/bilby/config/chopper/sct_astrium_chopper.tcl
	sics/site_ansto/instrument/config/beamline/sct_he3_polanal.tcl
	sics/site_ansto/instrument/config/environment/isotech_ps.sct
	sics/site_ansto/instrument/config/environment/isotech_ps_sct.tcl
	sics/site_ansto/instrument/config/environment/temperature/julabo_lh45.sct
	sics/site_ansto/instrument/config/environment/temperature/julabo_lh45_gen_sct.tcl
	sics/site_ansto/instrument/config/environment/temperature/ls340_sct.tcl
	sics/site_ansto/instrument/util/gen_sct.py
This commit is contained in:
Douglas Clowes
2014-11-13 13:52:46 +11:00
18 changed files with 678 additions and 307 deletions

View File

@@ -4,42 +4,73 @@ driver he3_polanal = {
protocol = std;
class = instrument;
simulation_group = rfgen_simulation;
make_args = '{has_pol true} {has_anal true}';
group polariser = {
conditional = '[string equal -nocase ${has_pol} "true"]';
type = float;
var spin = {
type = text;
readable = 900;
read_command = 'polariser';
read_function = rdValue;
writeable = 1;
write_command = 'polariser';
check_function = chkWrite;
allowed = "+,-,0"
allowed = "+,-,Refresh"
}
var Amplitude = { type = text; }
var Freq = { type = text; units = 'Hertz'; }
var Phase = { type = text; units = 'Degree'; }
var Time2 = { type = text; units = 'Second'; }
var Field = { type = text; units = 'Oersted'; }
var amplitude = { }
var freq = { units = 'Hertz'; }
var phase = { units = 'Degree'; }
var time2 = { units = 'Second'; }
var field = { units = 'Oersted'; }
var timestamp = { }
}
group polariser_start = {
conditional = '[string equal -nocase ${has_pol} "true"]';
type = float;
var spin = { }
var amplitude = { }
var freq = { units = 'Hertz'; }
var phase = { units = 'Degree'; }
var time2 = { units = 'Second'; }
var field = { units = 'Oersted'; }
var timestamp = { }
}
group analyser = {
conditional = '[string equal -nocase ${has_anal} "true"]';
type = float;
var spin = {
type = text;
readable = 900;
read_command = 'analyser';
read_function = rdValue;
writeable = 1;
write_command = 'analyser';
check_function = chkWrite;
allowed = "+,-,0"
allowed = "+,-,Refresh"
}
var Amplitude = { type = text; }
var Freq = { type = text; units = 'Hertz'; }
var Phase = { type = text; units = 'Degree'; }
var Time2 = { type = text; units = 'Second'; }
var Field = { type = text; units = 'Oersted'; }
var amplitude = { }
var freq = { units = 'Hertz'; }
var phase = { units = 'Degree'; }
var time2 = { units = 'Second'; }
var field = { units = 'Oersted'; }
var timestamp = { }
}
group analyser_start = {
conditional = '[string equal -nocase ${has_anal} "true"]';
type = float;
var spin = { }
var amplitude = { }
var freq = { units = 'Hertz'; }
var phase = { units = 'Degree'; }
var time2 = { units = 'Second'; }
var field = { units = 'Oersted'; }
var timestamp = { }
}
code chkWrite = {%%
[namespace current]::rdValue ${tc_root}
clientput [sct result]
%%}
code rdValue = {%%
@@ -61,25 +92,13 @@ driver he3_polanal = {
set data [lindex ${dlist} 1]
}
set path [pathname [sct]]
if {[llength ${dlist}] > 2} {
set new_value [lindex ${dlist} 2]
if { "${new_value}" == "NaN" } {
set new_value 0
}
hupdateif ${path}/Amplitude "${new_value}"
}
if {[llength ${dlist}] > 3} {
hupdateif ${path}/Freq "[lindex ${dlist} 3]"
}
if {[llength ${dlist}] > 4} {
hupdateif ${path}/Phase "[lindex ${dlist} 4]"
}
if {[llength ${dlist}] > 5} {
hupdateif ${path}/Time2 "[lindex ${dlist} 5]"
}
if {[llength ${dlist}] > 6} {
hupdateif ${path}/Field "[lindex ${dlist} 6]"
}
set timestamp [clock seconds]
[namespace current]::do_update ${path}/amplitude ${dlist} 2
[namespace current]::do_update ${path}/freq ${dlist} 3
[namespace current]::do_update ${path}/phase ${dlist} 4
[namespace current]::do_update ${path}/time2 ${dlist} 5
[namespace current]::do_update ${path}/field ${dlist} 6
hupdateif ${path}/timestamp ${timestamp}
%%}
code setValue = {%%
@@ -87,6 +106,9 @@ driver he3_polanal = {
if {[string equal -nocase [sct target] "refresh"]} {
set cmd "${cmd_str}"
}
if {[string equal -nocase [sct target] "minus"]} {
set cmd "${cmd_str} -"
}
if {[string equal -nocase [sct target] "dn"]} {
set cmd "${cmd_str} -"
}
@@ -96,6 +118,9 @@ driver he3_polanal = {
if {[sct target] == "-" || [sct target] == -1} {
set cmd "${cmd_str} -"
}
if {[string equal -nocase [sct target] "plus"]} {
set cmd "${cmd_str} +"
}
if {[string equal -nocase [sct target] "up"]} {
set cmd "${cmd_str} +"
}
@@ -103,4 +128,26 @@ driver he3_polanal = {
set cmd "${cmd_str} +"
}
%%}
code preamble = {
@TCL
proc do_update { node dlist idx } {
if {[llength ${dlist}] > ${idx}} {
if {![string is double [lindex ${dlist} ${idx}]]} {
hupdateif ${node} 0.0
} else {
hupdateif ${node} [lindex ${dlist} ${idx}]
}
}
}
@END
}
code postamble = {
@TCL
proc stash {node} {
foreach arg {spin amplitude freq phase time2 field timestamp} {
hupdateif ${node}_start/${arg} [hval ${node}/${arg}]
}
}
@END
}
}