Set auto by default on startup - as per Paolo

r3679 | dcl | 2012-07-26 15:45:13 +1000 (Thu, 26 Jul 2012) | 1 line
This commit is contained in:
Douglas Clowes
2012-07-26 15:45:13 +10:00
parent 8da55b8784
commit d6ad841174

View File

@@ -175,7 +175,7 @@ debug_log "rdState $tc_root state=$my_state, version=$my_model"
hsetprop $tc_root/itc500_state my_status "[sct result]" hsetprop $tc_root/itc500_state my_status "[sct result]"
set my_status "[SplitReply [hgetprop $tc_root/itc500_state my_status]]" set my_status "[SplitReply [hgetprop $tc_root/itc500_state my_status]]"
debug_log "rdState my_status=$my_status" debug_log "rdState my_status=$my_status"
set rslt [scan $my_status "X%dA%dC%dS%dH%dL%d" the_x the_a the_c the_s the_h the_l] set rslt [scan "$my_status" "X%dA%dC%dS%dH%dL%d" the_x the_a the_c the_s the_h the_l]
debug_log "rdState $tc_root status($rslt)= X$the_x A$the_a C$the_c S[format %02d $the_s] H$the_h L$the_l" debug_log "rdState $tc_root status($rslt)= X$the_x A$the_a C$the_c S[format %02d $the_s] H$the_h L$the_l"
set auto 0 set auto 0
if {[hval $tc_root/heater_auto] > 0} { if {[hval $tc_root/heater_auto] > 0} {
@@ -199,7 +199,7 @@ debug_log "rdState $tc_root status($rslt)= X$the_x A$the_a C$the_c S[format %02d
set nextState read set nextState read
} elseif {$my_state == "STATE_C"} { } elseif {$my_state == "STATE_C"} {
set my_status "[SplitReply [hgetprop $tc_root/itc500_state my_status]]" set my_status "[SplitReply [hgetprop $tc_root/itc500_state my_status]]"
set rslt [scan $my_status "X%dA%dC%dS%dH%dL%d" the_x the_a the_c the_s the_h the_l] set rslt [scan "$my_status" "X%dA%dC%dS%dH%dL%d" the_x the_a the_c the_s the_h the_l]
set auto 0 set auto 0
if {[hval $tc_root/heater_auto] > 0} { if {[hval $tc_root/heater_auto] > 0} {
set auto [expr {$auto + 1}] set auto [expr {$auto + 1}]
@@ -240,7 +240,7 @@ debug_log "rdState $tc_root status($rslt)= X$the_x A$the_a C$the_c S[format %02d
if { $nextState == "" } { if { $nextState == "" } {
set my_status "[SplitReply [hgetprop $tc_root/itc500_state my_status]]" set my_status "[SplitReply [hgetprop $tc_root/itc500_state my_status]]"
debug_log "rdState my_status=$my_status" debug_log "rdState my_status=$my_status"
set rslt [scan $my_status "X%dA%dC%dS%dH%dL%d" the_x the_a the_c the_s the_h the_l] set rslt [scan "$my_status" "X%dA%dC%dS%dH%dL%d" the_x the_a the_c the_s the_h the_l]
debug_log "rdState $tc_root status($rslt)= X$the_x A$the_a C$the_c S[format %02d $the_s] H$the_h L$the_l" debug_log "rdState $tc_root status($rslt)= X$the_x A$the_a C$the_c S[format %02d $the_s] H$the_h L$the_l"
set my_driving [SplitReply [hgetprop $tc_root/setpoint driving]] set my_driving [SplitReply [hgetprop $tc_root/setpoint driving]]
debug_log "rdState $tc_root: driving=$my_driving" debug_log "rdState $tc_root: driving=$my_driving"
@@ -283,6 +283,7 @@ debug_log "rdState driving $tc_root finished at $temp in ($lotemp, $hitemp)"
} }
} catch_message ]} { } catch_message ]} {
debug_log "rdState error: $catch_message" debug_log "rdState error: $catch_message"
set nextState idle
} }
debug_log "rdState returns: $nextState" debug_log "rdState returns: $nextState"
return $nextState return $nextState
@@ -397,12 +398,12 @@ debug_log "halt $tc_root"
hfactory $scobj_hpath/heater_auto plain user int hfactory $scobj_hpath/heater_auto plain user int
hsetprop $scobj_hpath/heater_auto values 0,1 hsetprop $scobj_hpath/heater_auto values 0,1
hsetprop $scobj_hpath/heater_auto oldval 0 hsetprop $scobj_hpath/heater_auto oldval 0
hset $scobj_hpath/heater_auto 0 hset $scobj_hpath/heater_auto 1
hfactory $scobj_hpath/cooler_auto plain user int hfactory $scobj_hpath/cooler_auto plain user int
hsetprop $scobj_hpath/cooler_auto values 0,1 hsetprop $scobj_hpath/cooler_auto values 0,1
hsetprop $scobj_hpath/cooler_auto oldval 0 hsetprop $scobj_hpath/cooler_auto oldval 0
hset $scobj_hpath/cooler_auto 0 hset $scobj_hpath/cooler_auto 1
hfactory $scobj_hpath/apply_tolerance plain user int hfactory $scobj_hpath/apply_tolerance plain user int
hsetprop $scobj_hpath/apply_tolerance values 0,1 hsetprop $scobj_hpath/apply_tolerance values 0,1
@@ -526,8 +527,8 @@ debug_log "halt $tc_root"
proc add_itc500 {name IP port {_tol 5.0} {addr "@1"} } { proc add_itc500 {name IP port {_tol 5.0} {addr "@1"} } {
set fd [open "/tmp/itc500.log" a] set fd [open "/tmp/itc500.log" a]
if {[SplitReply [environment_simulation]]=="false"} { if {[SplitReply [environment_simulation]]=="false"} {
puts $fd "makesctcontroller sct_itc500 oxford ${IP}:$port" puts $fd "makesctcontroller sct_itc500 oxford ${IP}:$port \"\r\""
makesctcontroller sct_itc500 oxford ${IP}:$port makesctcontroller sct_itc500 oxford ${IP}:$port "\r"
} }
puts $fd "mk_sct_oxford_itc500 sct_itc500 environment $name $_tol $addr" puts $fd "mk_sct_oxford_itc500 sct_itc500 environment $name $_tol $addr"
mk_sct_oxford_itc500 sct_itc500 environment $name $_tol $addr mk_sct_oxford_itc500 sct_itc500 environment $name $_tol $addr