Regen SCT drivers

This commit is contained in:
Douglas Clowes
2014-09-29 16:48:19 +10:00
parent f86dc33081
commit 3ad3bf3524
20 changed files with 639 additions and 200 deletions

View File

@@ -86,7 +86,12 @@ proc ::scobj::nhq_200::checkstatus {tc_root} {
# checkstatus hook code goes here
if {[sct driving]} {
set sp "[sct target]"
set pv "[hval ${tc_root}/[sct driveable]]"
if {[hpropexists [sct] simulated] && [sct simulated] == "true"} {
set pv "${sp}"
hset ${tc_root}/[sct driveable] ${sp}
}
set pv "[hval ${tc_root}/[sct driveable]]"
}
if { abs(${pv} - ${sp}) <= [sct tolerance] } {
if { [hpropexists [sct] settle_time] } {
if { [hpropexists [sct] settle_time_start] } {
@@ -280,8 +285,9 @@ proc ::scobj::nhq_200::mkDriver { sct_controller name device_class simulation_fl
sicslist setatt ${name} long_name ${name}
set scobj_hpath /sics/${name}
# Start of unnamed group
# Start of var: break
hfactory ${scobj_hpath}/break plain user int
hsetprop ${scobj_hpath}/break read ${ns}::getValue ${scobj_hpath} rdValue {W}
hsetprop ${scobj_hpath}/break rdValue ${ns}::rdValue ${scobj_hpath}
@@ -297,11 +303,13 @@ proc ::scobj::nhq_200::mkDriver { sct_controller name device_class simulation_fl
if {[string equal -nocase "${simulation_flag}" "false"]} {
${sct_controller} poll ${scobj_hpath}/break 10
hsetprop ${scobj_hpath}/%s simulated false
} else {
::scobj::nhq_200::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for nhq_200"
hsetprop ${scobj_hpath}/%s simulated true
}
# Start of var: id
hfactory ${scobj_hpath}/id plain user text
hsetprop ${scobj_hpath}/id read ${ns}::getValue ${scobj_hpath} rdValue {#}
hsetprop ${scobj_hpath}/id rdValue ${ns}::rdValue ${scobj_hpath}
@@ -317,17 +325,21 @@ proc ::scobj::nhq_200::mkDriver { sct_controller name device_class simulation_fl
if {[string equal -nocase "${simulation_flag}" "false"]} {
${sct_controller} poll ${scobj_hpath}/id 10
hsetprop ${scobj_hpath}/%s simulated false
} else {
::scobj::nhq_200::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for nhq_200"
hsetprop ${scobj_hpath}/%s simulated true
}
hsetprop ${scobj_hpath} data "true"
hsetprop ${scobj_hpath} klass "@none"
hsetprop ${scobj_hpath} type "part"
# End of unnamed group
# Start of named group: ch1
hfactory ${scobj_hpath}/ch1 plain spy none
# Start of var: auto_start
hfactory ${scobj_hpath}/ch1/auto_start plain user int
hsetprop ${scobj_hpath}/ch1/auto_start read ${ns}::getValue ${scobj_hpath} rdValue {A1}
hsetprop ${scobj_hpath}/ch1/auto_start rdValue ${ns}::rdValue ${scobj_hpath}
@@ -347,11 +359,13 @@ proc ::scobj::nhq_200::mkDriver { sct_controller name device_class simulation_fl
if {[string equal -nocase "${simulation_flag}" "false"]} {
${sct_controller} poll ${scobj_hpath}/ch1/auto_start 5
${sct_controller} write ${scobj_hpath}/ch1/auto_start
hsetprop ${scobj_hpath}/%s simulated false
} else {
::scobj::nhq_200::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for nhq_200"
hsetprop ${scobj_hpath}/%s simulated true
}
# Start of var: current
hfactory ${scobj_hpath}/ch1/current plain user text
hsetprop ${scobj_hpath}/ch1/current read ${ns}::getValue ${scobj_hpath} rdCurrent {I1}
hsetprop ${scobj_hpath}/ch1/current rdCurrent ${ns}::rdCurrent ${scobj_hpath}
@@ -367,11 +381,13 @@ proc ::scobj::nhq_200::mkDriver { sct_controller name device_class simulation_fl
if {[string equal -nocase "${simulation_flag}" "false"]} {
${sct_controller} poll ${scobj_hpath}/ch1/current 5
hsetprop ${scobj_hpath}/%s simulated false
} else {
::scobj::nhq_200::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for nhq_200"
hsetprop ${scobj_hpath}/%s simulated true
}
# Start of var: go
hfactory ${scobj_hpath}/ch1/go plain user int
hsetprop ${scobj_hpath}/ch1/go write ${ns}::setValue ${scobj_hpath} noResponse {G1}
hsetprop ${scobj_hpath}/ch1/go noResponse ${ns}::noResponse ${scobj_hpath}
@@ -388,11 +404,13 @@ proc ::scobj::nhq_200::mkDriver { sct_controller name device_class simulation_fl
if {[string equal -nocase "${simulation_flag}" "false"]} {
${sct_controller} write ${scobj_hpath}/ch1/go
hsetprop ${scobj_hpath}/%s simulated false
} else {
::scobj::nhq_200::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for nhq_200"
hsetprop ${scobj_hpath}/%s simulated true
}
# Start of var: i_lim
hfactory ${scobj_hpath}/ch1/i_lim plain user int
hsetprop ${scobj_hpath}/ch1/i_lim read ${ns}::getValue ${scobj_hpath} rdValue {N1}
hsetprop ${scobj_hpath}/ch1/i_lim rdValue ${ns}::rdValue ${scobj_hpath}
@@ -408,11 +426,13 @@ proc ::scobj::nhq_200::mkDriver { sct_controller name device_class simulation_fl
if {[string equal -nocase "${simulation_flag}" "false"]} {
${sct_controller} poll ${scobj_hpath}/ch1/i_lim 5
hsetprop ${scobj_hpath}/%s simulated false
} else {
::scobj::nhq_200::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for nhq_200"
hsetprop ${scobj_hpath}/%s simulated true
}
# Start of var: i_trip
hfactory ${scobj_hpath}/ch1/i_trip plain user int
hsetprop ${scobj_hpath}/ch1/i_trip read ${ns}::getValue ${scobj_hpath} rdValue {L1}
hsetprop ${scobj_hpath}/ch1/i_trip rdValue ${ns}::rdValue ${scobj_hpath}
@@ -432,11 +452,13 @@ proc ::scobj::nhq_200::mkDriver { sct_controller name device_class simulation_fl
if {[string equal -nocase "${simulation_flag}" "false"]} {
${sct_controller} poll ${scobj_hpath}/ch1/i_trip 5
${sct_controller} write ${scobj_hpath}/ch1/i_trip
hsetprop ${scobj_hpath}/%s simulated false
} else {
::scobj::nhq_200::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for nhq_200"
hsetprop ${scobj_hpath}/%s simulated true
}
# Start of var: module
hfactory ${scobj_hpath}/ch1/module plain user int
hsetprop ${scobj_hpath}/ch1/module read ${ns}::getValue ${scobj_hpath} rdValue {T1}
hsetprop ${scobj_hpath}/ch1/module rdValue ${ns}::rdValue ${scobj_hpath}
@@ -452,11 +474,13 @@ proc ::scobj::nhq_200::mkDriver { sct_controller name device_class simulation_fl
if {[string equal -nocase "${simulation_flag}" "false"]} {
${sct_controller} poll ${scobj_hpath}/ch1/module 5
hsetprop ${scobj_hpath}/%s simulated false
} else {
::scobj::nhq_200::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for nhq_200"
hsetprop ${scobj_hpath}/%s simulated true
}
# Start of var: status
hfactory ${scobj_hpath}/ch1/status plain user text
hsetprop ${scobj_hpath}/ch1/status read ${ns}::getValue ${scobj_hpath} rdValue {S1}
hsetprop ${scobj_hpath}/ch1/status rdValue ${ns}::rdValue ${scobj_hpath}
@@ -472,11 +496,13 @@ proc ::scobj::nhq_200::mkDriver { sct_controller name device_class simulation_fl
if {[string equal -nocase "${simulation_flag}" "false"]} {
${sct_controller} poll ${scobj_hpath}/ch1/status 5
hsetprop ${scobj_hpath}/%s simulated false
} else {
::scobj::nhq_200::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for nhq_200"
hsetprop ${scobj_hpath}/%s simulated true
}
# Start of var: v_lim
hfactory ${scobj_hpath}/ch1/v_lim plain user int
hsetprop ${scobj_hpath}/ch1/v_lim read ${ns}::getValue ${scobj_hpath} rdValue {M1}
hsetprop ${scobj_hpath}/ch1/v_lim rdValue ${ns}::rdValue ${scobj_hpath}
@@ -492,11 +518,13 @@ proc ::scobj::nhq_200::mkDriver { sct_controller name device_class simulation_fl
if {[string equal -nocase "${simulation_flag}" "false"]} {
${sct_controller} poll ${scobj_hpath}/ch1/v_lim 5
hsetprop ${scobj_hpath}/%s simulated false
} else {
::scobj::nhq_200::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for nhq_200"
hsetprop ${scobj_hpath}/%s simulated true
}
# Start of var: v_ramp
hfactory ${scobj_hpath}/ch1/v_ramp plain user int
hsetprop ${scobj_hpath}/ch1/v_ramp read ${ns}::getValue ${scobj_hpath} rdValue {V1}
hsetprop ${scobj_hpath}/ch1/v_ramp rdValue ${ns}::rdValue ${scobj_hpath}
@@ -516,11 +544,13 @@ proc ::scobj::nhq_200::mkDriver { sct_controller name device_class simulation_fl
if {[string equal -nocase "${simulation_flag}" "false"]} {
${sct_controller} poll ${scobj_hpath}/ch1/v_ramp 5
${sct_controller} write ${scobj_hpath}/ch1/v_ramp
hsetprop ${scobj_hpath}/%s simulated false
} else {
::scobj::nhq_200::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for nhq_200"
hsetprop ${scobj_hpath}/%s simulated true
}
# Start of var: v_sp
hfactory ${scobj_hpath}/ch1/v_sp plain user int
hsetprop ${scobj_hpath}/ch1/v_sp read ${ns}::getValue ${scobj_hpath} rdValue {D1}
hsetprop ${scobj_hpath}/ch1/v_sp rdValue ${ns}::rdValue ${scobj_hpath}
@@ -549,11 +579,13 @@ proc ::scobj::nhq_200::mkDriver { sct_controller name device_class simulation_fl
if {[string equal -nocase "${simulation_flag}" "false"]} {
${sct_controller} poll ${scobj_hpath}/ch1/v_sp 5
${sct_controller} write ${scobj_hpath}/ch1/v_sp
hsetprop ${scobj_hpath}/%s simulated false
} else {
::scobj::nhq_200::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for nhq_200"
hsetprop ${scobj_hpath}/%s simulated true
}
# Start of var: voltage
hfactory ${scobj_hpath}/ch1/voltage plain user int
hsetprop ${scobj_hpath}/ch1/voltage read ${ns}::getValue ${scobj_hpath} rdVoltage {U1}
hsetprop ${scobj_hpath}/ch1/voltage rdVoltage ${ns}::rdVoltage ${scobj_hpath}
@@ -569,17 +601,21 @@ proc ::scobj::nhq_200::mkDriver { sct_controller name device_class simulation_fl
if {[string equal -nocase "${simulation_flag}" "false"]} {
${sct_controller} poll ${scobj_hpath}/ch1/voltage 5
hsetprop ${scobj_hpath}/%s simulated false
} else {
::scobj::nhq_200::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for nhq_200"
hsetprop ${scobj_hpath}/%s simulated true
}
hsetprop ${scobj_hpath}/ch1 data "true"
hsetprop ${scobj_hpath}/ch1 klass "@none"
hsetprop ${scobj_hpath}/ch1 type "part"
# End of named group: ch1
ansto_makesctdrive ${name}_ch1_v_sp ${scobj_hpath}/ch1/v_sp ${scobj_hpath}/ch1/voltage ${sct_controller}
# Start of named group: ch2
hfactory ${scobj_hpath}/ch2 plain spy none
# Start of var: auto_start
hfactory ${scobj_hpath}/ch2/auto_start plain user int
hsetprop ${scobj_hpath}/ch2/auto_start read ${ns}::getValue ${scobj_hpath} rdValue {A2}
hsetprop ${scobj_hpath}/ch2/auto_start rdValue ${ns}::rdValue ${scobj_hpath}
@@ -599,11 +635,13 @@ proc ::scobj::nhq_200::mkDriver { sct_controller name device_class simulation_fl
if {[string equal -nocase "${simulation_flag}" "false"]} {
${sct_controller} poll ${scobj_hpath}/ch2/auto_start 5
${sct_controller} write ${scobj_hpath}/ch2/auto_start
hsetprop ${scobj_hpath}/%s simulated false
} else {
::scobj::nhq_200::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for nhq_200"
hsetprop ${scobj_hpath}/%s simulated true
}
# Start of var: current
hfactory ${scobj_hpath}/ch2/current plain user text
hsetprop ${scobj_hpath}/ch2/current read ${ns}::getValue ${scobj_hpath} rdCurrent {I2}
hsetprop ${scobj_hpath}/ch2/current rdCurrent ${ns}::rdCurrent ${scobj_hpath}
@@ -619,11 +657,13 @@ proc ::scobj::nhq_200::mkDriver { sct_controller name device_class simulation_fl
if {[string equal -nocase "${simulation_flag}" "false"]} {
${sct_controller} poll ${scobj_hpath}/ch2/current 5
hsetprop ${scobj_hpath}/%s simulated false
} else {
::scobj::nhq_200::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for nhq_200"
hsetprop ${scobj_hpath}/%s simulated true
}
# Start of var: go
hfactory ${scobj_hpath}/ch2/go plain user int
hsetprop ${scobj_hpath}/ch2/go write ${ns}::setValue ${scobj_hpath} noResponse {G2}
hsetprop ${scobj_hpath}/ch2/go noResponse ${ns}::noResponse ${scobj_hpath}
@@ -640,11 +680,13 @@ proc ::scobj::nhq_200::mkDriver { sct_controller name device_class simulation_fl
if {[string equal -nocase "${simulation_flag}" "false"]} {
${sct_controller} write ${scobj_hpath}/ch2/go
hsetprop ${scobj_hpath}/%s simulated false
} else {
::scobj::nhq_200::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for nhq_200"
hsetprop ${scobj_hpath}/%s simulated true
}
# Start of var: i_lim
hfactory ${scobj_hpath}/ch2/i_lim plain user int
hsetprop ${scobj_hpath}/ch2/i_lim read ${ns}::getValue ${scobj_hpath} rdValue {N2}
hsetprop ${scobj_hpath}/ch2/i_lim rdValue ${ns}::rdValue ${scobj_hpath}
@@ -660,11 +702,13 @@ proc ::scobj::nhq_200::mkDriver { sct_controller name device_class simulation_fl
if {[string equal -nocase "${simulation_flag}" "false"]} {
${sct_controller} poll ${scobj_hpath}/ch2/i_lim 5
hsetprop ${scobj_hpath}/%s simulated false
} else {
::scobj::nhq_200::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for nhq_200"
hsetprop ${scobj_hpath}/%s simulated true
}
# Start of var: i_trip
hfactory ${scobj_hpath}/ch2/i_trip plain user int
hsetprop ${scobj_hpath}/ch2/i_trip read ${ns}::getValue ${scobj_hpath} rdValue {L2}
hsetprop ${scobj_hpath}/ch2/i_trip rdValue ${ns}::rdValue ${scobj_hpath}
@@ -684,11 +728,13 @@ proc ::scobj::nhq_200::mkDriver { sct_controller name device_class simulation_fl
if {[string equal -nocase "${simulation_flag}" "false"]} {
${sct_controller} poll ${scobj_hpath}/ch2/i_trip 5
${sct_controller} write ${scobj_hpath}/ch2/i_trip
hsetprop ${scobj_hpath}/%s simulated false
} else {
::scobj::nhq_200::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for nhq_200"
hsetprop ${scobj_hpath}/%s simulated true
}
# Start of var: module
hfactory ${scobj_hpath}/ch2/module plain user int
hsetprop ${scobj_hpath}/ch2/module read ${ns}::getValue ${scobj_hpath} rdValue {T2}
hsetprop ${scobj_hpath}/ch2/module rdValue ${ns}::rdValue ${scobj_hpath}
@@ -704,11 +750,13 @@ proc ::scobj::nhq_200::mkDriver { sct_controller name device_class simulation_fl
if {[string equal -nocase "${simulation_flag}" "false"]} {
${sct_controller} poll ${scobj_hpath}/ch2/module 5
hsetprop ${scobj_hpath}/%s simulated false
} else {
::scobj::nhq_200::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for nhq_200"
hsetprop ${scobj_hpath}/%s simulated true
}
# Start of var: status
hfactory ${scobj_hpath}/ch2/status plain user text
hsetprop ${scobj_hpath}/ch2/status read ${ns}::getValue ${scobj_hpath} rdValue {S2}
hsetprop ${scobj_hpath}/ch2/status rdValue ${ns}::rdValue ${scobj_hpath}
@@ -724,11 +772,13 @@ proc ::scobj::nhq_200::mkDriver { sct_controller name device_class simulation_fl
if {[string equal -nocase "${simulation_flag}" "false"]} {
${sct_controller} poll ${scobj_hpath}/ch2/status 5
hsetprop ${scobj_hpath}/%s simulated false
} else {
::scobj::nhq_200::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for nhq_200"
hsetprop ${scobj_hpath}/%s simulated true
}
# Start of var: v_lim
hfactory ${scobj_hpath}/ch2/v_lim plain user int
hsetprop ${scobj_hpath}/ch2/v_lim read ${ns}::getValue ${scobj_hpath} rdValue {M2}
hsetprop ${scobj_hpath}/ch2/v_lim rdValue ${ns}::rdValue ${scobj_hpath}
@@ -744,11 +794,13 @@ proc ::scobj::nhq_200::mkDriver { sct_controller name device_class simulation_fl
if {[string equal -nocase "${simulation_flag}" "false"]} {
${sct_controller} poll ${scobj_hpath}/ch2/v_lim 5
hsetprop ${scobj_hpath}/%s simulated false
} else {
::scobj::nhq_200::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for nhq_200"
hsetprop ${scobj_hpath}/%s simulated true
}
# Start of var: v_ramp
hfactory ${scobj_hpath}/ch2/v_ramp plain user int
hsetprop ${scobj_hpath}/ch2/v_ramp read ${ns}::getValue ${scobj_hpath} rdValue {V2}
hsetprop ${scobj_hpath}/ch2/v_ramp rdValue ${ns}::rdValue ${scobj_hpath}
@@ -768,11 +820,13 @@ proc ::scobj::nhq_200::mkDriver { sct_controller name device_class simulation_fl
if {[string equal -nocase "${simulation_flag}" "false"]} {
${sct_controller} poll ${scobj_hpath}/ch2/v_ramp 5
${sct_controller} write ${scobj_hpath}/ch2/v_ramp
hsetprop ${scobj_hpath}/%s simulated false
} else {
::scobj::nhq_200::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for nhq_200"
hsetprop ${scobj_hpath}/%s simulated true
}
# Start of var: v_sp
hfactory ${scobj_hpath}/ch2/v_sp plain user int
hsetprop ${scobj_hpath}/ch2/v_sp read ${ns}::getValue ${scobj_hpath} rdValue {D2}
hsetprop ${scobj_hpath}/ch2/v_sp rdValue ${ns}::rdValue ${scobj_hpath}
@@ -801,11 +855,13 @@ proc ::scobj::nhq_200::mkDriver { sct_controller name device_class simulation_fl
if {[string equal -nocase "${simulation_flag}" "false"]} {
${sct_controller} poll ${scobj_hpath}/ch2/v_sp 5
${sct_controller} write ${scobj_hpath}/ch2/v_sp
hsetprop ${scobj_hpath}/%s simulated false
} else {
::scobj::nhq_200::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for nhq_200"
hsetprop ${scobj_hpath}/%s simulated true
}
# Start of var: voltage
hfactory ${scobj_hpath}/ch2/voltage plain user int
hsetprop ${scobj_hpath}/ch2/voltage read ${ns}::getValue ${scobj_hpath} rdVoltage {U2}
hsetprop ${scobj_hpath}/ch2/voltage rdVoltage ${ns}::rdVoltage ${scobj_hpath}
@@ -821,12 +877,15 @@ proc ::scobj::nhq_200::mkDriver { sct_controller name device_class simulation_fl
if {[string equal -nocase "${simulation_flag}" "false"]} {
${sct_controller} poll ${scobj_hpath}/ch2/voltage 5
hsetprop ${scobj_hpath}/%s simulated false
} else {
::scobj::nhq_200::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for nhq_200"
hsetprop ${scobj_hpath}/%s simulated true
}
hsetprop ${scobj_hpath}/ch2 data "true"
hsetprop ${scobj_hpath}/ch2 klass "@none"
hsetprop ${scobj_hpath}/ch2 type "part"
# End of named group: ch2
ansto_makesctdrive ${name}_ch2_v_sp ${scobj_hpath}/ch2/v_sp ${scobj_hpath}/ch2/voltage ${sct_controller}
hsetprop ${scobj_hpath} klass ${device_class}
hsetprop ${scobj_hpath} data true