# vim: ts=8 sts=2 sw=2 expandtab autoindent smartindent nocindent # http://neutron.ansto.gov.au/Bragg/proposal/reactor.jsp?type=ALL # Power: 19.198232; CNS Out: 29.26; TG123: 1; CG123: 1; TG4: 3 driver reactor_status = { protocol = std; class = NXsource; simulation_group = opal_simulation; group = { group_property 'data' = 'true'; group_property 'control' = 'true'; var status = { type = text; priv = spy; readable = 30; read_command = 'GET /Bragg/proposal/reactor.jsp?type=ALL'; read_function = rdAll; fetch_function = getState; data = false; control = false; } var power = { type = float; priv = spy; mutable = true; property klass = source;} var cns_out = { type = float; priv = spy; mutable = true; property klass = source;} var tg123 = { type = float; priv = spy; mutable = true; property klass = source;} var cg123 = { type = float; priv = spy; mutable = true; property klass = source;} var tg4 = { type = float; priv = spy; mutable = true; property klass = source;} } code read_function rdValue = { } code Write_function setPoint = { } code mkDriver = { } code read_function rdAll = { @ set data [lindex [split [string trim ${data}] "\r\n"] end] @ if {${data} != [sct oldval]} { @ foreach {n v} [regexp -all -inline {[A-Z][A-Za-z0-9 ]+|[0-9][0-9.]*} ${data}] { @ switch $n { @ "Power" { hset ${tc_root}/power $v } @ "CNS Out" { hset ${tc_root}/cns_out $v } @ "TG123" { hset ${tc_root}/tg123 $v } @ "CG123" { hset ${tc_root}/cg123 $v } @ "TG4" { hset ${tc_root}/tg4 $v } @ } @ } @ } } }