From e2015bd09587895eb1b68bef92bf8e9cdff240e2 Mon Sep 17 00:00:00 2001 From: l_samenv Date: Tue, 15 Oct 2024 15:20:29 +0200 Subject: [PATCH] add more commecnts in autodevice code --- tcl/seacom.tcl | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/tcl/seacom.tcl b/tcl/seacom.tcl index cd1c0da..c52db71 100644 --- a/tcl/seacom.tcl +++ b/tcl/seacom.tcl @@ -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