Modify legacy drivers so that they can be called by sct wrappers and define wrapper templates.

This commit is contained in:
Ferdi Franceschini
2014-07-15 00:30:17 +10:00
parent 6112c8afa0
commit 67b8576f35
24 changed files with 134 additions and 768 deletions

View File

@ -0,0 +1,9 @@
# vim: ts=8 sts=2 sw=2 expandtab autoindent smartindent nocindent
driver agilent_33220A = {
protocol = std
class = environment
simulation_group = environment_simulation
code mkDriver = {%%
makesctcontroller $name $ip $port
%%}
}

View File

@ -0,0 +1,12 @@
# vim: ts=8 sts=2 sw=2 expandtab autoindent smartindent nocindent
driver keithley_m2700 = {
protocol = std
sobj_priv_type = 'user float'
class = environment
simulation_group = environment_simulation
add_args = 'id datype tol'
make_args = 'id datype tol'
code mkDriver = {%%
mk_sct_keithley_2700 $sct_controller environment $name $tol $id $datype
%%}
}

View File

@ -4,7 +4,9 @@ driver protekmm = {
sobj_priv_type = 'user float'
class = environment
simulation_group = environment_simulation
add_args = 'id datype'
make_args = 'id datype'
code mkDriver = {%%
MakeProtek $name $sct_controller
MakeProtek $name $sct_controller $id $datype
%%}
}

View File

@ -574,7 +574,6 @@ debug_log "Registering node $nodeName for write callback"
# set ns ::scobj::k2700
set ns "[namespace current]"
MakeSICSObj $tempobj SCT_OBJECT
sicslist setatt $tempobj klass $klass
sicslist setatt $tempobj long_name $tempobj
@ -680,88 +679,4 @@ set fd [open "../log/k2700.log" w]
puts $fd "file evaluation of sct_keithley_2700.tcl"
close $fd
namespace eval ::scobj::add_keithley_2700 {
set debug_threshold 5
}
proc ::scobj::add_keithley_2700::sics_log {debug_level debug_string} {
set catch_status [ catch {
set debug_threshold ${::scobj::add_keithley_2700::debug_threshold}
if {${debug_level} >= ${debug_threshold}} {
sicslog "::scobj::add_keithley_2700::${debug_string}"
}
} catch_message ]
}
clientput "file evaluation of sct_keithley_2700.tcl"
::scobj::add_keithley_2700::sics_log 9 "file evaluation of sct_keithley_2700.tcl"
proc ::scobj::add_keithley_2700::read_config {} {
set catch_status [ catch {
set ns "::scobj::add_keithley_2700"
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 exists $v "driver"]) } {
continue
}
if { [string equal -nocase [dict get $v "driver"] "keithley_2700"] } {
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"
} 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 {term tol id datype} {
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_keithley_2700 ${name} "aqadapter" ${asyncqueue} {*}$arg_list
}
}
}
}
} catch_message ]
handle_exception ${catch_status} ${catch_message}
}
if { [info exists ::config_dict] } {
::scobj::add_keithley_2700::read_config
} else {
::scobj::add_keithley_2700::sics_log 5 "No config dict"
}
namespace import ::scobj::k2700::*

View File

@ -122,12 +122,12 @@ close $fd
# @param cbFunc, this function will be called after the voltage reading has been updated
# NOTE: If the interval is negative then the multimeter will be polled on every cycle of
# the SICS task loop.
proc MakeProtek {name sctName {scale 1.0} {offset 0.0} {interval 0.5} {cbFunc "return idle"}} {
proc MakeProtek {name sctName CID CTYPE {scale 1.0} {offset 0.0} {interval 0.5} {cbFunc "return idle"}} {
set catch_status [ catch {
set sctName "sct_$name"
set sobjName "$name"
set soState "so_state_$name"
clientput "MakeSICSObj $sobjName SCT_OBJECT"
clientput "MakeSICSObj $soState SCT_OBJECT"
MakeSICSObj $soState SCT_OBJECT
sicslist setatt $sobjName long_name $sobjName
@ -135,6 +135,7 @@ proc MakeProtek {name sctName {scale 1.0} {offset 0.0} {interval 0.5} {cbFunc "r
hsetprop /sics/$soState/state read rqStateRep
hsetprop /sics/$soState/state rdStateRep rdStateRep
hsetprop /sics/$soState/state oldval "UNKNOWN"
hsetprop /sics/$sobjName permlink data_set ${CTYPE}${CID}S1
hsetprop /sics/$sobjName read rqVal "reportVal"
hsetprop /sics/$sobjName reportVal ProtekMainDisplay /sics/$soState callBack
hsetprop /sics/$sobjName callBack $cbFunc

View File

@ -0,0 +1,12 @@
# vim: ts=8 sts=2 sw=2 expandtab autoindent smartindent nocindent
driver eurotherm_m2000 = {
protocol = std
sobj_priv_type = 'user float'
class = environment
simulation_group = environment_simulation
add_args = 'id datype dev_id tol'
make_args = 'id datype dev_id tol'
code mkDriver = {%%
mk_sct_eurotherm_et2000 sct_controller environment $name $dev_id $tol $id $datype
%%}
}

View File

@ -0,0 +1,12 @@
# vim: ts=8 sts=2 sw=2 expandtab autoindent smartindent nocindent
driver lakeshore_m370 = {
protocol = std
sobj_priv_type = 'user float'
class = environment
simulation_group = environment_simulation
add_args = 'tol'
make_args = 'tol'
code mkDriver = {%%
mk_sct_driver $sct_controller environment $name $tol
%%}
}

View File

@ -0,0 +1,11 @@
# vim: ts=8 sts=2 sw=2 expandtab autoindent smartindent nocindent
driver ls336 = {
protocol = std
class = environment
simulation_group = environment_simulation
add_args = 'id datype {tol1 1.0} {tol2 1.0}'
make_args = 'id datype tol1 tol2'
code mkDriver = {%%
::scobj::ls336::mk_sct_lakeshore_336 $sct_controller environment $name $id $datype $tol1 $tol2 0
%%}
}

View File

@ -0,0 +1,11 @@
# vim: ts=8 sts=2 sw=2 expandtab autoindent smartindent nocindent
driver ls340 = {
protocol = std
class = environment
simulation_group = environment_simulation
add_args = 'id datype {tol1 1.0} {tol2 1.0}'
make_args = 'id datype tol1 tol2'
code mkDriver = {%%
::scobj::ls340::mk_sct_lakeshore_340 $sct_controller environment $name $id $datype $tol1 $tol2 0
%%}
}

View File

@ -0,0 +1,11 @@
# vim: ts=8 sts=2 sw=2 expandtab autoindent smartindent nocindent
driver nprvasm2 = {
protocol = std
class = environment
simulation_group = environment_simulation
add_args = '{tol 1.0}'
make_args = 'tol'
code mkDriver = {%%
mk_sct_newport_rva sct_${name} environment $name $tol
%%}
}

View File

@ -167,7 +167,6 @@ debug_log "halt $tc_root"
if {[ catch {
set ns ::scobj::et2000
MakeSICSObj $tempobj SCT_OBJECT
sicslist setatt $tempobj klass $klass
sicslist setatt $tempobj long_name $tempobj
@ -366,90 +365,6 @@ set fd [open "../log/et2000.log" w]
puts $fd "file evaluation of sct_eurotherm_2000.tcl"
close $fd
namespace eval ::scobj::eurotherm_2000 {
set debug_threshold 5
}
proc ::scobj::eurotherm_2000::sics_log {debug_level debug_string} {
set catch_status [ catch {
set debug_threshold ${::scobj::eurotherm_2000::debug_threshold}
if {${debug_level} >= ${debug_threshold}} {
sicslog "::scobj::eurotherm_2000::${debug_string}"
}
} catch_message ]
}
clientput "file evaluation of sct_eurotherm_2000.tcl"
::scobj::eurotherm_2000::sics_log 9 "file evaluation of sct_eurotherm_2000.tcl"
proc ::scobj::eurotherm_2000::read_config {} {
set catch_status [ catch {
set ns "::scobj::eurotherm_2000"
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 exists $v "driver"]) } {
continue
}
if { [string equal -nocase [dict get $v "driver"] "eurotherm_2000"] } {
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"
} 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 {devid tol id type} {
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_eurotherm_2000 ${name} "aqadapter" ${asyncqueue} {*}$arg_list
}
}
}
}
} catch_message ]
handle_exception ${catch_status} ${catch_message}
}
if { [info exists ::config_dict] } {
::scobj::eurotherm_2000::read_config
} else {
::scobj::eurotherm_2000::sics_log 5 "No config dict"
}
namespace import ::scobj::et2000::*
#add_et2000 et2000 137.157.201.213 502 1 5

View File

@ -1581,7 +1581,6 @@ proc createNode {scobj_hpath sct_controller cmdGroup varName readable writable p
# @return nothing (well, the sct object)
proc mk_sct_lakeshore_336 {sct_controller klasse tempobj CID CTYPE tol1 tol2 verbose} {
if {[ catch {
MakeSICSObj $tempobj SCT_OBJECT
sicslist setatt $tempobj klass $klasse
sicslist setatt $tempobj long_name $tempobj
# Create a base node for all the state machines of this sics object
@ -1910,96 +1909,3 @@ proc add_lakeshore_336 {name IP port {terminator \r\n} {_tol1 1.0} {_tol2 1.0} {
return -code error "in add_ls336: $message"
}
}
namespace eval ::scobj::lakeshore_336 {
set debug_threshold 5
}
proc ::scobj::lakeshore_336::sics_log {debug_level debug_string} {
set catch_status [ catch {
set debug_threshold ${::scobj::lakeshore_336::debug_threshold}
if {${debug_level} >= ${debug_threshold}} {
sicslog "::scobj::lakeshore_336::${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 exists $v "driver"]) } {
continue
}
if { [string equal -nocase [dict get $v "driver"] "lakeshore_336"] } {
set driver [dict get $v driver]
${ns}::sics_log 9 "Found ${name}: $driver"
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"
} 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
${ns}::sics_log 9 "${name}:${driver}: MakeAsyncProtocol ${asyncprotocol}"
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]
${ns}::sics_log 9 "${name}:${driver}: MakeAsyncQueue ${asyncqueue} ${asyncprotocol} ${IP} ${PORT}"
MakeAsyncQueue ${asyncqueue} ${asyncprotocol} ${IP} ${PORT}
if { [dict exists $v "timeout"] } {
${asyncqueue} timeout "[dict get $v "timeout"]"
}
}
set arg_list [list]
foreach arg {tol1 tol2 id} {
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"
}
}
${ns}::sics_log 9 "add_lakeshore_336 ${name} aqadapter ${asyncqueue} {*}$arg_list"
add_lakeshore_336 ${name} "aqadapter" ${asyncqueue} {*}$arg_list
}
}
}
}
} catch_message ]
handle_exception ${catch_status} ${catch_message}
}
if { [info exists ::config_dict] } {
::scobj::lakeshore_336::read_config
} else {
::scobj::lakeshore_336::sics_log 5 "No config dict"
}
namespace import ::scobj::ls336::*

View File

@ -1755,8 +1755,9 @@ proc createNode {scobj_hpath sct_controller cmdGroup varName readable writable p
# @param tempobj short name for the temperature controller scriptcontext object (typ. tc1 or tc2)
# @param tol temperature tolerance in Kelvin (typ. 1)
# @return nothing (well, the sct object)
proc mk_sct_lakeshore_340 {sct_controller klasse tempobj CID CTYPE LSmodel tol1 tol2 verbose} {
proc mk_sct_lakeshore_340 {sct_controller klasse tempobj CID CTYPE tol1 tol2 verbose} {
if {[ catch {
set LSmodel "ls340"
set ::scobj::ls340::ls340_driveTolerance1 $tol1
set ::scobj::ls340::ls340_driveTolerance2 $tol2
set ::scobj::ls340::ls340_LSmodel $LSmodel
@ -1770,7 +1771,6 @@ proc createNode {scobj_hpath sct_controller cmdGroup varName readable writable p
#Wombat uses only CR not CRLF
#set ::scobj::ls340::ls340_term "" ! obsolete
MakeSICSObj $tempobj SCT_OBJECT
sicslist setatt $tempobj klass $klasse
sicslist setatt $tempobj long_name $tempobj
# Create a base node for all the state machines of this sics object
@ -2114,92 +2114,3 @@ proc add_lakeshore_340 {name IP port {terminator \r\n} {_tol1 1.0} {_tol2 1.0} {
return -code error "in add_lakeshore_340: $message"
}
}
namespace eval ::scobj::lakeshore_340 {
set debug_threshold 5
}
proc ::scobj::lakeshore_340::sics_log {debug_level debug_string} {
set catch_status [ catch {
set debug_threshold ${::scobj::lakeshore_340::debug_threshold}
if {${debug_level} >= ${debug_threshold}} {
sicslog "::scobj::lakeshore_340::${debug_string}"
}
} catch_message ]
}
clientput "file evaluation of sct_lakeshore_340.tcl"
::scobj::lakeshore_340::sics_log 9 "file evaluation of sct_lakeshore_340.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 exists $v "driver"]) } {
continue
}
if { [string equal -nocase [dict get $v "driver"] "lakeshore_340"] } {
set driver [dict get $v driver]
${ns}::sics_log 9 "Found ${name}: $driver"
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"
} 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
${ns}::sics_log 9 "${name}:${driver}: MakeAsyncProtocol ${asyncprotocol}"
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]
${ns}::sics_log 9 "${name}:${driver}: MakeAsyncQueue ${asyncqueue} ${asyncprotocol} ${IP} ${PORT}"
MakeAsyncQueue ${asyncqueue} ${asyncprotocol} ${IP} ${PORT}
if { [dict exists $v "timeout"] } {
${asyncqueue} timeout "[dict get $v "timeout"]"
}
}
set arg_list [list]
foreach arg {tol1 tol2 id} {
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"
}
}
${ns}::sics_log 9 "add_lakeshore_340 ${name} aqadapter ${asyncqueue} {*}$arg_list"
add_lakeshore_340 ${name} "aqadapter" ${asyncqueue} {*}$arg_list
}
}
}
}
} catch_message ]
handle_exception ${catch_status} ${catch_message}
}
if { [info exists ::config_dict] } {
::scobj::lakeshore_340::read_config
} else {
::scobj::lakeshore_340::sics_log 5 "No config dict"
}
namespace import ::scobj::ls340::*

View File

@ -785,7 +785,6 @@ namespace eval ::scobj::[set vendor]_[set device] {
debug_log 1 "mk_sct_driver $sct_controller $klass $name $tol"
set catch_status [ catch {
MakeSICSObj $name SCT_OBJECT
sicslist setatt $name klass $klass
sicslist setatt $name long_name $name
@ -927,72 +926,3 @@ namespace eval ::scobj::[set vendor]_[set device] {
namespace import ::scobj::[set vendor]_[set device]::*
# add_lakeshore_370 "tc371" 127.0.0.1 7371 2.0
proc ::scobj::lakeshore_370::sics_log {debug_level debug_string} {
set catch_status [ catch {
set debug_threshold ${::scobj::lakeshore_370::debug_threshold}
if {${debug_level} >= ${debug_threshold}} {
sicslog "::scobj::lakeshore_370::${debug_string}"
}
} catch_message ]
}
proc ::scobj::lakeshore_370::read_config {} {
set catch_status [ catch {
set ns "::scobj::lakeshore_370"
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 exists $v "driver"]) } {
continue
}
if { [string equal -nocase [dict get $v "driver"] "lakeshore_370"] } {
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"
} 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"]"
}
}
add_lakeshore_370 ${name} "aqadapter" ${asyncqueue}
}
}
}
}
} catch_message ]
handle_exception ${catch_status} ${catch_message}
}
if { [info exists ::config_dict] } {
::scobj::lakeshore_370::read_config
} else {
::scobj::lakeshore_370::sics_log 5 "No config dict"
}

View File

@ -944,7 +944,6 @@ proc createNode {scobj_hpath sct_controller cmdGroup varName readable writable\
set catch_status [ catch {
set ns "[namespace current]"
MakeSICSObj $tempobj SCT_OBJECT
sicslist setatt $tempobj klass $klass
sicslist setatt $tempobj long_name $tempobj

View File

@ -403,7 +403,6 @@ proc createNode {scobj_hpath sct_controller cmdGroup varName readable writable\
set catch_status [ catch {
set ns "[namespace current]"
MakeSICSObj $tempobj SCT_OBJECT
sicslist setatt $tempobj klass $klass
sicslist setatt $tempobj long_name $tempobj
@ -540,87 +539,4 @@ set fd [open "../log/watlow_pm.log" w]
puts $fd "file evaluation of sct_watlow_pm.tcl"
close $fd
namespace eval ::scobj::watlow_pm {
set debug_threshold 5
}
proc ::scobj::watlow_pm::sics_log {debug_level debug_string} {
set catch_status [ catch {
set debug_threshold ${::scobj::watlow_pm::debug_threshold}
if {${debug_level} >= ${debug_threshold}} {
sicslog "::scobj::watlow_pm::${debug_string}"
}
} catch_message ]
}
clientput "file evaluation of sct_watlow_pm.tcl"
::scobj::watlow_pm::sics_log 9 "file evaluation of sct_watlow_pm.tcl"
proc ::scobj::watlow_pm::read_config {} {
set catch_status [ catch {
set ns "::scobj::watlow_pm"
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 exists $v "driver"]) } {
continue
}
if { [string equal -nocase [dict get $v "driver"] "watlow_pm"] } {
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"
} 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 {devid tol id type} {
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_watlow_pm ${name} "aqadapter" ${asyncqueue} {*}$arg_list
}
}
}
}
} catch_message ]
handle_exception ${catch_status} ${catch_message}
}
if { [info exists ::config_dict] } {
::scobj::watlow_pm::read_config
} else {
::scobj::watlow_pm::sics_log 5 "No config dict"
}
namespace import ::scobj::watlow_pm::*

View File

@ -411,7 +411,6 @@ proc createNode {scobj_hpath sct_controller cmdGroup varName readable writable\
set catch_status [ catch {
set ns "[namespace current]"
MakeSICSObj $tempobj SCT_OBJECT
sicslist setatt $tempobj klass $klass
sicslist setatt $tempobj long_name $tempobj
@ -570,87 +569,4 @@ set fd [open "../log/watlow_rm.log" w]
puts $fd "file evaluation of sct_watlow_rm.tcl"
close $fd
namespace eval ::scobj::watlow_rm {
set debug_threshold 5
}
proc ::scobj::watlow_rm::sics_log {debug_level debug_string} {
set catch_status [ catch {
set debug_threshold ${::scobj::watlow_rm::debug_threshold}
if {${debug_level} >= ${debug_threshold}} {
sicslog "::scobj::watlow_rm::${debug_string}"
}
} catch_message ]
}
clientput "file evaluation of sct_watlow_rm.tcl"
::scobj::watlow_rm::sics_log 9 "file evaluation of sct_watlow_rm.tcl"
proc ::scobj::watlow_rm::read_config {} {
set catch_status [ catch {
set ns "::scobj::watlow_rm"
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 exists $v "driver"]) } {
continue
}
if { [string equal -nocase [dict get $v "driver"] "watlow_rm"] } {
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"
} 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 {devid tol id type} {
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_watlow_rm ${name} "aqadapter" ${asyncqueue} {*}$arg_list
}
}
}
}
} catch_message ]
handle_exception ${catch_status} ${catch_message}
}
if { [info exists ::config_dict] } {
::scobj::watlow_rm::read_config
} else {
::scobj::watlow_rm::sics_log 5 "No config dict"
}
namespace import ::scobj::watlow_rm::*

View File

@ -597,7 +597,6 @@ proc createNode {scobj_hpath sct_controller cmdGroup varName readable writable\
set catch_status [ catch {
set ns "[namespace current]"
MakeSICSObj $tempobj SCT_OBJECT
sicslist setatt $tempobj klass $klass
sicslist setatt $tempobj long_name $tempobj
@ -781,89 +780,4 @@ set fd [open "../log/watlow_st.log" w]
puts $fd "file evaluation of sct_watlow_st4.tcl"
close $fd
namespace eval ::scobj::watlow_st4 {
set debug_threshold 5
}
proc ::scobj::watlow_st4::sics_log {debug_level debug_string} {
set catch_status [ catch {
set debug_threshold ${::scobj::watlow_st4::debug_threshold}
if {${debug_level} >= ${debug_threshold}} {
sicslog "::scobj::watlow_st4::${debug_string}"
}
} catch_message ]
}
clientput "file evaluation of sct_watlow_st4.tcl"
::scobj::watlow_st4::sics_log 9 "file evaluation of sct_watlow_st4.tcl"
proc ::scobj::watlow_st4::read_config {} {
set catch_status [ catch {
set ns "::scobj::watlow_st4"
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 exists $v "driver"]) } {
continue
}
if { [string equal -nocase [dict get $v "driver"] "watlow_st4"] } {
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"
} 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 {devid tol id type} {
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_watlow_st4 ${name} "aqadapter" ${asyncqueue} {*}$arg_list
}
}
}
}
} catch_message ]
handle_exception ${catch_status} ${catch_message}
}
if { [info exists ::config_dict] } {
::scobj::watlow_st4::read_config
} else {
::scobj::watlow_st4::sics_log 5 "No config dict"
}
namespace import ::scobj::watlow_st::*

View File

@ -0,0 +1,12 @@
# vim: ts=8 sts=2 sw=2 expandtab autoindent smartindent nocindent
driver watlow_mpm = {
protocol = std
sobj_priv_type = 'user float'
class = environment
simulation_group = environment_simulation
add_args = 'id datype dev_id tol'
make_args = 'id datype dev_id tol'
code mkDriver = {%%
mk_sct_watlow_pm $sct_controller environment $name $dev_id $tol $id $datype
%%}
}

View File

@ -0,0 +1,12 @@
# vim: ts=8 sts=2 sw=2 expandtab autoindent smartindent nocindent
driver watlow_mrm = {
protocol = std
sobj_priv_type = 'user float'
class = environment
simulation_group = environment_simulation
add_args = 'id datype dev_id tol'
make_args = 'id datype dev_id tol'
code mkDriver = {%%
mk_sct_watlow_rm $sct_controller environment $name $dev_id $tol $id $datype
%%}
}

View File

@ -0,0 +1,12 @@
# vim: ts=8 sts=2 sw=2 expandtab autoindent smartindent nocindent
driver watlow_mst4 = {
protocol = std
sobj_priv_type = 'user float'
class = environment
simulation_group = environment_simulation
add_args = 'id datype dev_id tol'
make_args = 'id datype dev_id tol'
code mkDriver = {%%
mk_sct_watlow_st $sct_controller environment $name $dev_id $tol $id $datype
%%}
}

View File

@ -48,86 +48,3 @@ proc ::environment::temperature::add_west4100 {IP ID} {
#::environment::mkenvinfo tc1 {heateron {priv user} range {priv manager} }
}
namespace eval ::scobj::west4100 {
set debug_threshold 5
}
proc ::scobj::west4100::sics_log {debug_level debug_string} {
set catch_status [ catch {
set debug_threshold ${::scobj::west4100::debug_threshold}
if {${debug_level} >= ${debug_threshold}} {
sicslog "::scobj::west4100::${debug_string}"
}
} catch_message ]
}
clientput "file evaluation of sct_west4100.tcl"
::scobj::west4100::sics_log 9 "file evaluation of sct_west4100.tcl"
proc ::scobj::west4100::read_config {} {
set catch_status [ catch {
set ns "::scobj::west4100"
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 exists $v "driver"]) } {
continue
}
if { [string equal -nocase [dict get $v "driver"] "west4100"] } {
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"
} 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 {id} {
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_west4100 ${name} "aqadapter" ${asyncqueue} {*}$arg_list
}
}
}
}
} catch_message ]
handle_exception ${catch_status} ${catch_message}
}
if { [info exists ::config_dict] } {
::scobj::west4100::read_config
} else {
::scobj::west4100::sics_log 5 "No config dict"
}

View File

@ -0,0 +1,11 @@
# vim: ts=8 sts=2 sw=2 expandtab autoindent smartindent nocindent
driver west4100 = {
protocol = std
class = environment
simulation_group = environment_simulation
add_args = 'dev_id'
make_args = 'IP dev_id'
code mkDriver = {%%
::environment::temperature::mkwest400 $name $IP $dev_id
%%}
}

View File

@ -86,8 +86,7 @@ proc rheometer_savehmmdata {rootPath} {
publish rheometer_savehmmdata user
proc add_rheo {rhControl IP tol settle {PORT 4001}} {
MakeProtek $rhControl $IP $PORT 1.0 0.0 0.5 "rhCallBack /sics/$rhControl"
proc add_rheo {rhControl tol settle} {
hfactory /sics/$rhControl/saveIndex plain user int
hset /sics/$rhControl/saveIndex 0
hfactory /sics/$rhControl/triggerList plain user text