New sicsconfig.ini file configuration editor.

Updated wombat sics_config.ini and gen_sct.py
Generated new tcl files from sct templates and
modified some old sct_*.tcl drivers.

TODO
sct_keithley_2700.tcl
magneticField/sct_oxford_labview.tcl
magneticField/sct_bruker_BEC1.tcl
temperature/sct_watlow_st4.tcl
temperature/sct_oxford_mercury.tcl
temperature/sct_mercury_pres.tcl
temperature/sct_julabo_lh45.tcl
temperature/sct_lakeshore_340.tcl
temperature/sct_julabo_lh45_gen.tcl
temperature/sct_watlow_rm.tcl
temperature/sct_eurotherm_2000.tcl
temperature/sct_lakeshore_336.tcl
temperature/sct_watlow_pm.tcl
temperature/sct_oxford_itc.tcl
temperature/sct_lakeshore_370.tcl
temperature/west400.tcl
This commit is contained in:
Ferdi Franceschini
2014-06-30 09:08:19 +10:00
parent c960a3bb2d
commit e971cd8b64
25 changed files with 782 additions and 344 deletions

View File

@@ -495,7 +495,7 @@ publish OxfordSetHTemp user
publish OxfordSetDTemp user
publish OxfordSetHS user
proc add_oxmag { name IP PORT {interval 5} } {
proc add_oxford_labview { name IP PORT {interval 5} } {
::scobj::magnetic::mkMagnetic [subst {
name $name
IP $IP
@@ -504,11 +504,83 @@ proc add_oxmag { name IP PORT {interval 5} } {
interval $interval
}]
}
if { [ info exists ::config_dict ] && [ dict get $::config_dict 12tmagnet enabled ] } {
set IP [dict get $::config_dict 12tmagnet ip]
set PORT [dict get $::config_dict 12tmagnet port]
set NAME [dict get $::config_dict 12tmagnet name]
puts "MAGNET: add_oxmag $NAME $IP $PORT"
add_oxmag $NAME $IP $PORT
# NEW START
namespace eval ::scobj::oxford_labview {
set debug_threshold 5
}
proc ::scobj::oxford_labview::sics_log {debug_level debug_string} {
set catch_status [ catch {
set debug_threshold ${::scobj::oxford_labview::debug_threshold}
if {${debug_level} >= ${debug_threshold}} {
sicslog "::scobj::oxford_labview::${debug_string}"
}
} catch_message ]
}
proc ::scobj::oxford_labview::read_config {} {
set catch_status [ catch {
set ns "::scobj::oxford_labview"
dict for {k v} $::config_dict {
if { [dict exists $v "implementation"] } {
set name [dict get $v name]
set enabled [string tolower [dict get $v "enabled"]]
set implementation [dict get $v "implementation"]
set v [dict get $::config_dict $implementation]
if { [dict get $v "driver"] == "oxford_labview" } {
if { $enabled == "true" || $enabled == "always" } {
if { ![string equal -nocase [SplitReply [environment_simulation]] "false"] } {
set asyncqueue "null"
${ns}::sics_log 9 "[environment_simulation] => using null asyncqueue"
} elseif { [dict exists $v "asyncqueue"] } {
set asyncqueue [dict get $v "asyncqueue"]
} else {
if { [dict exists $v "asyncprotocol"] } {
set asyncprotocol [dict get $v "asyncprotocol"]
} else {
set asyncprotocol ${name}_protocol
MakeAsyncProtocol ${asyncprotocol}
if { [dict exists $v "terminator"] } {
${asyncprotocol} sendterminator "[dict get $v "terminator"]"
${asyncprotocol} replyterminator "[dict get $v "terminator"]"
}
}
set asyncqueue ${name}_queue
set IP [dict get $v ip]
set PORT [dict get $v port]
MakeAsyncQueue ${asyncqueue} ${asyncprotocol} ${IP} ${PORT}
if { [dict exists $v "timeout"] } {
${asyncqueue} timeout "[dict get $v "timeout"]"
}
}
set arg_list [list]
foreach arg {interval} {
if {[dict exists $v $arg]} {
lappend arg_list "[dict get $v $arg]"
} else {
${ns}::sics_log 9 "Missing configuration value $arg"
error "Missing configuration value $arg"
}
}
add_oxford_labview ${name} "aqadapter" ${asyncqueue} {*}$arg_list
}
}
}
}
} catch_message ]
handle_exception ${catch_status} ${catch_message}
}
if { [info exists ::config_dict] } {
::scobj::oxford_labview::read_config
} else {
::scobj::oxford_labview::sics_log 5 "No config dict"
}
# NEW END
#OLD START
# if { [ info exists ::config_dict ] && [ dict get $::config_dict 12tmagnet enabled ] } {
# set IP [dict get $::config_dict 12tmagnet ip]
# set PORT [dict get $::config_dict 12tmagnet port]
# set NAME [dict get $::config_dict 12tmagnet name]
# puts "MAGNET: add_oxmag $NAME $IP $PORT"
# add_oxmag $NAME $IP $PORT
# }
#OLD END