3He chnage to float and timestamp in seconds
This commit is contained in:
@ -8,7 +8,7 @@ driver he3_polanal = {
|
|||||||
|
|
||||||
group polariser = {
|
group polariser = {
|
||||||
conditional = '[string equal -nocase ${has_pol} "true"]';
|
conditional = '[string equal -nocase ${has_pol} "true"]';
|
||||||
type = text;
|
type = float;
|
||||||
var spin = {
|
var spin = {
|
||||||
readable = 900;
|
readable = 900;
|
||||||
read_command = 'polariser';
|
read_command = 'polariser';
|
||||||
@ -27,7 +27,7 @@ driver he3_polanal = {
|
|||||||
}
|
}
|
||||||
group polariser_start = {
|
group polariser_start = {
|
||||||
conditional = '[string equal -nocase ${has_pol} "true"]';
|
conditional = '[string equal -nocase ${has_pol} "true"]';
|
||||||
type = text;
|
type = float;
|
||||||
var spin = { }
|
var spin = { }
|
||||||
var amplitude = { }
|
var amplitude = { }
|
||||||
var freq = { units = 'Hertz'; }
|
var freq = { units = 'Hertz'; }
|
||||||
@ -39,7 +39,7 @@ driver he3_polanal = {
|
|||||||
|
|
||||||
group analyser = {
|
group analyser = {
|
||||||
conditional = '[string equal -nocase ${has_anal} "true"]';
|
conditional = '[string equal -nocase ${has_anal} "true"]';
|
||||||
type = text;
|
type = float;
|
||||||
var spin = {
|
var spin = {
|
||||||
readable = 900;
|
readable = 900;
|
||||||
read_command = 'analyser';
|
read_command = 'analyser';
|
||||||
@ -58,7 +58,7 @@ driver he3_polanal = {
|
|||||||
}
|
}
|
||||||
group analyser_start = {
|
group analyser_start = {
|
||||||
conditional = '[string equal -nocase ${has_anal} "true"]';
|
conditional = '[string equal -nocase ${has_anal} "true"]';
|
||||||
type = text;
|
type = float;
|
||||||
var spin = { }
|
var spin = { }
|
||||||
var amplitude = { }
|
var amplitude = { }
|
||||||
var freq = { units = 'Hertz'; }
|
var freq = { units = 'Hertz'; }
|
||||||
@ -92,27 +92,13 @@ driver he3_polanal = {
|
|||||||
set data [lindex ${dlist} 1]
|
set data [lindex ${dlist} 1]
|
||||||
}
|
}
|
||||||
set path [pathname [sct]]
|
set path [pathname [sct]]
|
||||||
set timestamp [clock format [clock seconds] -format "%T"]
|
set timestamp [clock seconds]
|
||||||
if {[llength ${dlist}] > 2} {
|
[namespace current]::do_update ${path}/amplitude ${dlist} 2
|
||||||
set new_value [lindex ${dlist} 2]
|
[namespace current]::do_update ${path}/freq ${dlist} 3
|
||||||
if { "${new_value}" == "NaN" } {
|
[namespace current]::do_update ${path}/phase ${dlist} 4
|
||||||
set new_value 0
|
[namespace current]::do_update ${path}/time2 ${dlist} 5
|
||||||
}
|
[namespace current]::do_update ${path}/field ${dlist} 6
|
||||||
hupdateif ${path}/amplitude "${new_value}"
|
hupdateif ${path}/timestamp ${timestamp}
|
||||||
}
|
|
||||||
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]"
|
|
||||||
}
|
|
||||||
hupdateif ${path}/timestamp "${timestamp}"
|
|
||||||
%%}
|
%%}
|
||||||
|
|
||||||
code setValue = {%%
|
code setValue = {%%
|
||||||
@ -142,6 +128,19 @@ driver he3_polanal = {
|
|||||||
set cmd "${cmd_str} +"
|
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 = {
|
code postamble = {
|
||||||
@TCL
|
@TCL
|
||||||
proc stash {node} {
|
proc stash {node} {
|
||||||
|
Reference in New Issue
Block a user