From 78aa990f715700c5bc0177442dbc81923a87c9ca Mon Sep 17 00:00:00 2001 From: l_samenv Date: Fri, 26 May 2023 11:12:25 +0200 Subject: [PATCH] fix bug in cummunication with seaman do not use quotes around args in "seaman / arg1 arg2" --- tcl/drivers/hepump.tcl | 2 +- tcl/ori7.config | 2 +- tcl/seamancom.tcl | 20 +++++++++++++++++--- tcl/startup/helium.tcl | 4 ++-- tcl/startup/sea_man.tcl | 15 ++++++++------- 5 files changed, 29 insertions(+), 14 deletions(-) diff --git a/tcl/drivers/hepump.tcl b/tcl/drivers/hepump.tcl index 082418a..cdb9bd7 100644 --- a/tcl/drivers/hepump.tcl +++ b/tcl/drivers/hepump.tcl @@ -177,7 +177,7 @@ proc hepump::read {} { sct health_cnt [expr [sct health_cnt] + 1] if {[sct health_cnt] == 10} { if {$health > 100} {set health 100} - catch {prep0 / "pump_health_update [result instrument] [format %.0f $health]"} msg + catch {prep0 / pump_health_update [result instrument] [format %.0f $health]} msg } } } else { diff --git a/tcl/ori7.config b/tcl/ori7.config index bf39b3b..c0cb78f 100644 --- a/tcl/ori7.config +++ b/tcl/ori7.config @@ -10,7 +10,7 @@ makenv tt -driver [lsdriver] { } tt set/limit 310 makeCCU4 ori7 nv n2 he -hupdate /nv/set 1.6 +hupdate /nv/set 0.6 nv ctrl/prop_o 0.05 nv ctrl/prop_c 0.03 diff --git a/tcl/seamancom.tcl b/tcl/seamancom.tcl index 799dbf3..081876c 100644 --- a/tcl/seamancom.tcl +++ b/tcl/seamancom.tcl @@ -292,7 +292,7 @@ proc book_this {caller args} { } } foreach instr [array names ilist] { - $instr / "disconnect_from $caller $ilist($instr)" + $instr / disconnect_from $caller $ilist($instr) } } @@ -306,7 +306,7 @@ proc book_confirm {caller args} { busy_list_add $item $caller lappend rlist [list $item $caller [silent "" result device_list $caller]] } - $caller / "reconnect_or_set_busy $rlist" + $caller / reconnect_or_set_busy $rlist } proc show_item {item} { @@ -343,7 +343,7 @@ proc show {{key ""}} { } lappend table($ins) $item } - + set result "Instrument Device Connections Requests\n" append result "----------------------------------------------------------------------\n" foreach instr [lsort [array names table]] { @@ -394,6 +394,8 @@ namespace eval inst_select { clientput "REORDER web_ports" + set home /home/l_samenv + foreach itm [web_ports items] { web_ports deleteitem $itm } @@ -462,6 +464,17 @@ proc mainGroup {} { Group ports "ports" } +proc refresh {} { + foreach instr [instr_list items] { + clientlog "$instr" + catch { + $instr / save_samenv + } msg + clientput $msg + } +} + + publish book_this User publish book_request User publish book_confirm User @@ -479,3 +492,4 @@ publish rack_not_available_for Spy publish free_instruments Spy publish move_rack_to Spy +publish refresh Spy diff --git a/tcl/startup/helium.tcl b/tcl/startup/helium.tcl index c5cd680..16024b3 100644 --- a/tcl/startup/helium.tcl +++ b/tcl/startup/helium.tcl @@ -26,9 +26,9 @@ proc helium_update {p instrument label value} { # Usage example: _lev updatescript /lev "helium_update prep0v dmc dmc_vessel" catch { if {[silent "" sct geterror] eq ""} { - $p / "helium_instr_update $instrument $label $value" + $p / helium_instr_update $instrument $label $value } else { - $p / "helium_instr_update $instrument $label none" + $p / helium_instr_update $instrument $label none } } } diff --git a/tcl/startup/sea_man.tcl b/tcl/startup/sea_man.tcl index 425aba6..0d6097d 100644 --- a/tcl/startup/sea_man.tcl +++ b/tcl/startup/sea_man.tcl @@ -116,7 +116,7 @@ proc disconnect_from {caller args} { } if {[llength $confirm] != 0} { if {$caller ne "0"} { - seaman / "book_confirm $caller $confirm" + seaman / book_confirm $caller $confirm } } if {$answer eq ""} { @@ -133,7 +133,8 @@ proc save_samenv {{dev ""}} { if {$dev eq ""} { set dev [samenv name] } - seaman / "samenv_list makeitem [result instrument] $dev" + seaman / samenv_list makeitem [result instrument] $dev + seaman / rack_list makeitem [rack] [result instrument] } publishLazy save_samenv @@ -169,7 +170,7 @@ proc request_items {device} { lappend items $hostport } } - seaman / "book_request [result instrument] [info hostname]:$serverport $device $items" + seaman / book_request [result instrument] [info hostname]:$serverport $device $items set ts_status "Checking serial connections ..." } @@ -199,7 +200,7 @@ proc reconnect_object {obj {value 0}} { } } if {[is_mobile_port $hostport]} { - seaman / "book_request [result instrument] [info hostname]:$serverport PARTIAL $hostport" + seaman / book_request [result instrument] [info hostname]:$serverport PARTIAL $hostport set ts_status "Checking serial connection ..." } } @@ -249,14 +250,14 @@ proc remote_disconnect {args} { foreach {item instr} $args { set disconnect_time($item) [DoubleTime] } - seaman / "book_this [result instrument] $args" + seaman / book_this [result instrument] $args } proc forced_disconnect {item {value 0}} { global disconnect_time if {$value} { catch {unset disconnect_time($item)} - seaman / "book_confirm [result instrument] $item" + seaman / book_confirm [result instrument] $item } else { return 0 } @@ -264,7 +265,7 @@ proc forced_disconnect {item {value 0}} { proc remote_device_none {instrument {value 0}} { global disconnect_time - seaman / "device_none_on $instrument" + seaman / device_none_on $instrument set disconnect_time(0) [DoubleTime] }