add more commecnts in autodevice code
This commit is contained in:
@ -1712,6 +1712,7 @@ proc autodeviceCron {} {
|
|||||||
|
|
||||||
logconfig flush
|
logconfig flush
|
||||||
rack_check_connection
|
rack_check_connection
|
||||||
|
# act is either: "", "plugged", "renew", "rebuild" or "selected on touch display"
|
||||||
set act [silent "" result device action]
|
set act [silent "" result device action]
|
||||||
set now [clock seconds]
|
set now [clock seconds]
|
||||||
if {$act eq "renew"} {
|
if {$act eq "renew"} {
|
||||||
@ -1764,7 +1765,7 @@ clientput "CONFIG $device/$stick/$addons"
|
|||||||
} else {
|
} else {
|
||||||
samenv -q $device/$stick/[join $addons /]
|
samenv -q $device/$stick/[join $addons /]
|
||||||
}
|
}
|
||||||
} elseif {$act ne ""} {
|
} elseif {$act ne ""} { # "plugged" or "selected ontouch display"
|
||||||
set new [silent 0 result device newdevice]
|
set new [silent 0 result device newdevice]
|
||||||
set change_device_to_none 0
|
set change_device_to_none 0
|
||||||
if {$new eq "none"} {
|
if {$new eq "none"} {
|
||||||
@ -1784,12 +1785,14 @@ clientput "CONFIG $device/$stick/$addons"
|
|||||||
clientput "$new plugged, no change"
|
clientput "$new plugged, no change"
|
||||||
device makeitem confirmed $new
|
device makeitem confirmed $new
|
||||||
} else {
|
} else {
|
||||||
|
# new has changed and is not none
|
||||||
if {[result device name] ne "none" && $act eq "plugged"} {
|
if {[result device name] ne "none" && $act eq "plugged"} {
|
||||||
clientlog "unplugged time too short [result device name] -> $new"
|
clientlog "unplugged time too short [result device name] -> $new"
|
||||||
device makeitem confirmed none
|
# this was a quick hack
|
||||||
catch {samenv -q none} msg
|
# device makeitem confirmed none
|
||||||
clientput $msg
|
# catch {samenv -q none} msg
|
||||||
return
|
# clientput $msg
|
||||||
|
# return
|
||||||
} else {
|
} else {
|
||||||
device makeitem confirmed $new
|
device makeitem confirmed $new
|
||||||
clientput "LOAD $new $act"
|
clientput "LOAD $new $act"
|
||||||
@ -1798,7 +1801,7 @@ clientput "CONFIG $device/$stick/$addons"
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
device action ""
|
device action ""
|
||||||
} else {
|
} else { # act == ""
|
||||||
set c2n [silent 0 set change_device_to_none]
|
set c2n [silent 0 set change_device_to_none]
|
||||||
if {$c2n != 0 && $now > $c2n} {
|
if {$c2n != 0 && $now > $c2n} {
|
||||||
set change_device_to_none 0
|
set change_device_to_none 0
|
||||||
|
Reference in New Issue
Block a user