Regen sct drivers after refactoring

This commit is contained in:
Douglas Clowes
2014-09-29 15:38:32 +10:00
parent 814c8741c3
commit 29650b420c
20 changed files with 1014 additions and 322 deletions

View File

@@ -213,6 +213,7 @@ proc ::scobj::tank::mkDriver { sct_controller name device_class simulation_flag
set scobj_hpath /sics/${name}
hfactory ${scobj_hpath}/pos plain spy float
hsetprop ${scobj_hpath}/pos read ${ns}::getValue ${scobj_hpath} read_pos {MG _TPH}
hsetprop ${scobj_hpath}/pos read_pos ${ns}::read_pos ${scobj_hpath}
@@ -226,20 +227,18 @@ proc ::scobj::tank::mkDriver { sct_controller name device_class simulation_flag
hsetprop ${scobj_hpath}/pos type "part"
hsetprop ${scobj_hpath}/pos nxalias "${name}_pos"
hsetprop ${scobj_hpath} data "true"
hsetprop ${scobj_hpath} klass "@none"
hsetprop ${scobj_hpath} type "part"
if {[string equal -nocase "${simulation_flag}" "false"]} {
${sct_controller} poll ${scobj_hpath}/pos 1
} else {
::scobj::tank::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for tank"
}
hsetprop ${scobj_hpath} data "true"
hsetprop ${scobj_hpath} klass "@none"
hsetprop ${scobj_hpath} type "part"
hfactory ${scobj_hpath}/limits plain spy none
hsetprop ${scobj_hpath}/limits data "true"
hsetprop ${scobj_hpath}/limits klass "@none"
hsetprop ${scobj_hpath}/limits type "part"
hfactory ${scobj_hpath}/limits/forward plain user text
hsetprop ${scobj_hpath}/limits/forward read ${ns}::getValue ${scobj_hpath} read_switch {MG _LFH}
@@ -254,6 +253,13 @@ proc ::scobj::tank::mkDriver { sct_controller name device_class simulation_flag
hsetprop ${scobj_hpath}/limits/forward type "part"
hsetprop ${scobj_hpath}/limits/forward nxalias "${name}_limits_forward"
if {[string equal -nocase "${simulation_flag}" "false"]} {
${sct_controller} poll ${scobj_hpath}/limits/forward 1
} else {
::scobj::tank::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for tank"
}
hfactory ${scobj_hpath}/limits/reverse plain user text
hsetprop ${scobj_hpath}/limits/reverse read ${ns}::getValue ${scobj_hpath} read_switch {MG _LRH}
hsetprop ${scobj_hpath}/limits/reverse read_switch ${ns}::read_switch ${scobj_hpath}
@@ -268,16 +274,16 @@ proc ::scobj::tank::mkDriver { sct_controller name device_class simulation_flag
hsetprop ${scobj_hpath}/limits/reverse nxalias "${name}_limits_reverse"
if {[string equal -nocase "${simulation_flag}" "false"]} {
${sct_controller} poll ${scobj_hpath}/limits/forward 1
${sct_controller} poll ${scobj_hpath}/limits/reverse 1
} else {
::scobj::tank::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for tank"
}
hsetprop ${scobj_hpath}/limits data "true"
hsetprop ${scobj_hpath}/limits klass "@none"
hsetprop ${scobj_hpath}/limits type "part"
hfactory ${scobj_hpath}/switches plain spy none
hsetprop ${scobj_hpath}/switches data "true"
hsetprop ${scobj_hpath}/switches klass "@none"
hsetprop ${scobj_hpath}/switches type "part"
hfactory ${scobj_hpath}/switches/forward plain user text
hsetprop ${scobj_hpath}/switches/forward read ${ns}::getValue ${scobj_hpath} read_switch {MG @IN[5]}
@@ -292,6 +298,13 @@ proc ::scobj::tank::mkDriver { sct_controller name device_class simulation_flag
hsetprop ${scobj_hpath}/switches/forward type "part"
hsetprop ${scobj_hpath}/switches/forward nxalias "${name}_switches_forward"
if {[string equal -nocase "${simulation_flag}" "false"]} {
${sct_controller} poll ${scobj_hpath}/switches/forward 1
} else {
::scobj::tank::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for tank"
}
hfactory ${scobj_hpath}/switches/reverse plain user text
hsetprop ${scobj_hpath}/switches/reverse read ${ns}::getValue ${scobj_hpath} read_switch {MG @IN[6]}
hsetprop ${scobj_hpath}/switches/reverse read_switch ${ns}::read_switch ${scobj_hpath}
@@ -306,11 +319,13 @@ proc ::scobj::tank::mkDriver { sct_controller name device_class simulation_flag
hsetprop ${scobj_hpath}/switches/reverse nxalias "${name}_switches_reverse"
if {[string equal -nocase "${simulation_flag}" "false"]} {
${sct_controller} poll ${scobj_hpath}/switches/forward 1
${sct_controller} poll ${scobj_hpath}/switches/reverse 1
} else {
::scobj::tank::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for tank"
}
hsetprop ${scobj_hpath}/switches data "true"
hsetprop ${scobj_hpath}/switches klass "@none"
hsetprop ${scobj_hpath}/switches type "part"
hsetprop ${scobj_hpath} klass ${device_class}
hsetprop ${scobj_hpath} data true
hsetprop ${scobj_hpath} debug_threshold 5