Regen SCT drivers
This commit is contained in:
@@ -89,7 +89,12 @@ proc ::scobj::huber_pilot::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] } {
|
||||
@@ -301,9 +306,10 @@ proc ::scobj::huber_pilot::mkDriver { sct_controller name device_class simulatio
|
||||
|
||||
set scobj_hpath /sics/${name}
|
||||
|
||||
# Start of named group: Loop1
|
||||
hfactory ${scobj_hpath}/Loop1 plain spy none
|
||||
|
||||
|
||||
# Start of var: sensor_int
|
||||
hfactory ${scobj_hpath}/Loop1/sensor_int plain user float
|
||||
hsetprop ${scobj_hpath}/Loop1/sensor_int read ${ns}::getValue ${scobj_hpath} rdTemp {01}
|
||||
hsetprop ${scobj_hpath}/Loop1/sensor_int rdTemp ${ns}::rdTemp ${scobj_hpath}
|
||||
@@ -321,11 +327,13 @@ proc ::scobj::huber_pilot::mkDriver { sct_controller name device_class simulatio
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/Loop1/sensor_int 1
|
||||
hsetprop ${scobj_hpath}/%s simulated false
|
||||
} else {
|
||||
::scobj::huber_pilot::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for huber_pilot"
|
||||
hsetprop ${scobj_hpath}/%s simulated true
|
||||
}
|
||||
|
||||
|
||||
# Start of var: setpoint
|
||||
hfactory ${scobj_hpath}/Loop1/setpoint plain user float
|
||||
hsetprop ${scobj_hpath}/Loop1/setpoint read ${ns}::getValue ${scobj_hpath} rdTemp {00}
|
||||
hsetprop ${scobj_hpath}/Loop1/setpoint rdTemp ${ns}::rdTemp ${scobj_hpath}
|
||||
@@ -356,11 +364,13 @@ proc ::scobj::huber_pilot::mkDriver { sct_controller name device_class simulatio
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/Loop1/setpoint 1
|
||||
${sct_controller} write ${scobj_hpath}/Loop1/setpoint
|
||||
hsetprop ${scobj_hpath}/%s simulated false
|
||||
} else {
|
||||
::scobj::huber_pilot::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for huber_pilot"
|
||||
hsetprop ${scobj_hpath}/%s simulated true
|
||||
}
|
||||
|
||||
|
||||
# Start of var: vMaxSP
|
||||
hfactory ${scobj_hpath}/Loop1/vMaxSP plain user float
|
||||
hsetprop ${scobj_hpath}/Loop1/vMaxSP read ${ns}::getValue ${scobj_hpath} rdTemp {31}
|
||||
hsetprop ${scobj_hpath}/Loop1/vMaxSP rdTemp ${ns}::rdTemp ${scobj_hpath}
|
||||
@@ -376,11 +386,13 @@ proc ::scobj::huber_pilot::mkDriver { sct_controller name device_class simulatio
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/Loop1/vMaxSP 1
|
||||
hsetprop ${scobj_hpath}/%s simulated false
|
||||
} else {
|
||||
::scobj::huber_pilot::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for huber_pilot"
|
||||
hsetprop ${scobj_hpath}/%s simulated true
|
||||
}
|
||||
|
||||
|
||||
# Start of var: vMinSP
|
||||
hfactory ${scobj_hpath}/Loop1/vMinSP plain user float
|
||||
hsetprop ${scobj_hpath}/Loop1/vMinSP read ${ns}::getValue ${scobj_hpath} rdTemp {30}
|
||||
hsetprop ${scobj_hpath}/Loop1/vMinSP rdTemp ${ns}::rdTemp ${scobj_hpath}
|
||||
@@ -396,11 +408,13 @@ proc ::scobj::huber_pilot::mkDriver { sct_controller name device_class simulatio
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/Loop1/vMinSP 1
|
||||
hsetprop ${scobj_hpath}/%s simulated false
|
||||
} else {
|
||||
::scobj::huber_pilot::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for huber_pilot"
|
||||
hsetprop ${scobj_hpath}/%s simulated true
|
||||
}
|
||||
|
||||
|
||||
# Start of var: vTE
|
||||
hfactory ${scobj_hpath}/Loop1/vTE plain user float
|
||||
hsetprop ${scobj_hpath}/Loop1/vTE read ${ns}::getValue ${scobj_hpath} rdTemp {07}
|
||||
hsetprop ${scobj_hpath}/Loop1/vTE rdTemp ${ns}::rdTemp ${scobj_hpath}
|
||||
@@ -418,11 +432,13 @@ proc ::scobj::huber_pilot::mkDriver { sct_controller name device_class simulatio
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/Loop1/vTE 1
|
||||
hsetprop ${scobj_hpath}/%s simulated false
|
||||
} else {
|
||||
::scobj::huber_pilot::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for huber_pilot"
|
||||
hsetprop ${scobj_hpath}/%s simulated true
|
||||
}
|
||||
|
||||
|
||||
# Start of var: vTmpActive
|
||||
hfactory ${scobj_hpath}/Loop1/vTmpActive plain user int
|
||||
hsetprop ${scobj_hpath}/Loop1/vTmpActive read ${ns}::getValue ${scobj_hpath} rdStatus {14}
|
||||
hsetprop ${scobj_hpath}/Loop1/vTmpActive rdStatus ${ns}::rdStatus ${scobj_hpath}
|
||||
@@ -438,11 +454,13 @@ proc ::scobj::huber_pilot::mkDriver { sct_controller name device_class simulatio
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/Loop1/vTmpActive 1
|
||||
hsetprop ${scobj_hpath}/%s simulated false
|
||||
} else {
|
||||
::scobj::huber_pilot::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for huber_pilot"
|
||||
hsetprop ${scobj_hpath}/%s simulated true
|
||||
}
|
||||
|
||||
|
||||
# Start of var: vTmpMode
|
||||
hfactory ${scobj_hpath}/Loop1/vTmpMode plain user int
|
||||
hsetprop ${scobj_hpath}/Loop1/vTmpMode read ${ns}::getValue ${scobj_hpath} rdStatus {13}
|
||||
hsetprop ${scobj_hpath}/Loop1/vTmpMode rdStatus ${ns}::rdStatus ${scobj_hpath}
|
||||
@@ -458,12 +476,15 @@ proc ::scobj::huber_pilot::mkDriver { sct_controller name device_class simulatio
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/Loop1/vTmpMode 1
|
||||
hsetprop ${scobj_hpath}/%s simulated false
|
||||
} else {
|
||||
::scobj::huber_pilot::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for huber_pilot"
|
||||
hsetprop ${scobj_hpath}/%s simulated true
|
||||
}
|
||||
hsetprop ${scobj_hpath}/Loop1 data "true"
|
||||
hsetprop ${scobj_hpath}/Loop1 klass "@none"
|
||||
hsetprop ${scobj_hpath}/Loop1 type "part"
|
||||
# End of named group: Loop1
|
||||
ansto_makesctdrive ${name}_Loop1_setpoint ${scobj_hpath}/Loop1/setpoint ${scobj_hpath}/Loop1/sensor_int ${sct_controller}
|
||||
hsetprop ${scobj_hpath} klass ${device_class}
|
||||
hsetprop ${scobj_hpath} data true
|
||||
|
||||
Reference in New Issue
Block a user