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