Modified some older drivers to use the tcl dict code from gen_sct.py

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 13:47:03 +10:00
parent 7960cb73a0
commit 4f397350cb
3 changed files with 46 additions and 17 deletions

View File

@@ -504,7 +504,7 @@ proc add_oxford_labview { name IP PORT {interval 5} } {
interval $interval
}]
}
# NEW START
namespace eval ::scobj::oxford_labview {
set debug_threshold 5
}
@@ -516,17 +516,30 @@ proc ::scobj::oxford_labview::sics_log {debug_level debug_string} {
}
} catch_message ]
}
clientput "file evaluation of sct_lakeshore_336.tcl"
::scobj::lakeshore_336::sics_log 9 "file evaluation of sct_lakeshore_336.tcl"
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"] } {
if { !([dict exists $v "name"] && [dict exists $v "enabled"]) } {
continue
}
set name [dict get $v name]
set enabled [string tolower [dict get $v "enabled"]]
set implementation [dict get $v "implementation"]
if { !([dict exists $::config_dict $implementation]) } {
continue
}
set v [dict get $::config_dict $implementation]
if { [dict get $v "driver"] == "oxford_labview" } {
if { $enabled == "true" || $enabled == "always" } {
if { !([dict exists $v "driver"]) } {
continue
}
if { [string equal -nocase [dict get $v "driver"] "lakeshore_336"] } {
if { [string equal -nocase $enabled "true" ] || [string equal -nocase $enabled "always"] } {
if { ![string equal -nocase [SplitReply [environment_simulation]] "false"] } {
set asyncqueue "null"
${ns}::sics_log 9 "[environment_simulation] => using null asyncqueue"
@@ -574,13 +587,3 @@ if { [info exists ::config_dict] } {
} 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

View File

@@ -1922,17 +1922,30 @@ proc ::scobj::lakeshore_336::sics_log {debug_level debug_string} {
}
} catch_message ]
}
clientput "file evaluation of sct_lakeshore_336.tcl"
::scobj::lakeshore_336::sics_log 9 "file evaluation of sct_lakeshore_336.tcl"
proc ::scobj::lakeshore_336::read_config {} {
set catch_status [ catch {
set ns "::scobj::lakeshore_336"
dict for {k v} $::config_dict {
if { [dict exists $v "implementation"] } {
if { !([dict exists $v "name"] && [dict exists $v "enabled"]) } {
continue
}
set name [dict get $v name]
set enabled [string tolower [dict get $v "enabled"]]
set implementation [dict get $v "implementation"]
if { !([dict exists $::config_dict $implementation]) } {
continue
}
set v [dict get $::config_dict $implementation]
if { [dict get $v "driver"] == "lakeshore_336" } {
if { $enabled == "true" || $enabled == "always" } {
if { !([dict exists $v "driver"]) } {
continue
}
if { [string equal -nocase [dict get $v "driver"] "lakeshore_336"] } {
if { [string equal -nocase $enabled "true" ] || [string equal -nocase $enabled "always"] } {
if { ![string equal -nocase [SplitReply [environment_simulation]] "false"] } {
set asyncqueue "null"
${ns}::sics_log 9 "[environment_simulation] => using null asyncqueue"

View File

@@ -2126,17 +2126,30 @@ proc ::scobj::lakeshore_340::sics_log {debug_level debug_string} {
}
} catch_message ]
}
clientput "file evaluation of sct_lakeshore_336.tcl"
::scobj::lakeshore_336::sics_log 9 "file evaluation of sct_lakeshore_336.tcl"
proc ::scobj::lakeshore_340::read_config {} {
set catch_status [ catch {
set ns "::scobj::lakeshore_340"
dict for {k v} $::config_dict {
if { [dict exists $v "implementation"] } {
if { !([dict exists $v "name"] && [dict exists $v "enabled"]) } {
continue
}
set name [dict get $v name]
set enabled [string tolower [dict get $v "enabled"]]
set implementation [dict get $v "implementation"]
if { !([dict exists $::config_dict $implementation]) } {
continue
}
set v [dict get $::config_dict $implementation]
if { [dict get $v "driver"] == "lakeshore_340" } {
if { $enabled == "true" || $enabled == "always" } {
if { !([dict exists $v "driver"]) } {
continue
}
if { [string equal -nocase [dict get $v "driver"] "lakeshore_340"] } {
if { [string equal -nocase $enabled "true" ] || [string equal -nocase $enabled "always"] } {
if { ![string equal -nocase [SplitReply [environment_simulation]] "false"] } {
set asyncqueue "null"
${ns}::sics_log 9 "[environment_simulation] => using null asyncqueue"