Regenerate SCT drivers

This commit is contained in:
Douglas Clowes
2014-11-13 13:53:04 +11:00
parent 30c23b1e0a
commit f076b537ed
2 changed files with 436 additions and 198 deletions

View File

@@ -232,8 +232,8 @@ proc ::scobj::eurotherm_3200::setValue {tc_root nextState cmd_str} {
handle_exception ${catch_status} ${catch_message}
}
proc ::scobj::eurotherm_3200::mkDriver { sct_controller name device_class simulation_flag ip_address tcp_port id datype dev_id tol } {
::scobj::eurotherm_3200::sics_log 9 "::scobj::eurotherm_3200::mkDriver ${sct_controller} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${datype} ${dev_id} ${tol}"
proc ::scobj::eurotherm_3200::mkDriver { sct_controller name device_class simulation_flag ip_address tcp_port id datype dev_id {tol 5} {lowerlimit 0} {upperlimit 500} } {
::scobj::eurotherm_3200::sics_log 9 "::scobj::eurotherm_3200::mkDriver ${sct_controller} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${datype} ${dev_id} ${tol} ${lowerlimit} ${upperlimit}"
set ns "[namespace current]"
set catch_status [ catch {
@@ -284,8 +284,8 @@ proc ::scobj::eurotherm_3200::mkDriver { sct_controller name device_class simula
hsetprop ${scobj_hpath}/loop1/setpoint data true
hsetprop ${scobj_hpath}/loop1/setpoint mutable true
hsetprop ${scobj_hpath}/loop1/setpoint nxsave true
hsetprop ${scobj_hpath}/loop1/setpoint lowerlimit 0
hsetprop ${scobj_hpath}/loop1/setpoint upperlimit 40
hsetprop ${scobj_hpath}/loop1/setpoint lowerlimit ${lowerlimit}
hsetprop ${scobj_hpath}/loop1/setpoint upperlimit ${upperlimit}
hsetprop ${scobj_hpath}/loop1/setpoint tolerance ${tol}
hsetprop ${scobj_hpath}/loop1/setpoint permlink data_set "T[format "%02d" ${id}]SP01"
hsetprop ${scobj_hpath}/loop1/setpoint @description "T[format "%02d" ${id}]SP01"
@@ -572,9 +572,9 @@ proc ::scobj::eurotherm_3200::mkDriver { sct_controller name device_class simula
handle_exception ${catch_status} ${catch_message}
}
proc ::scobj::eurotherm_3200::add_driver {name device_class simulation_flag ip_address tcp_port id datype dev_id tol} {
proc ::scobj::eurotherm_3200::add_driver {name device_class simulation_flag ip_address tcp_port id datype dev_id {tol 5 } {lowerlimit 0} {upperlimit 500}} {
set catch_status [ catch {
::scobj::eurotherm_3200::sics_log 9 "::scobj::eurotherm_3200::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${datype} ${dev_id} ${tol}"
::scobj::eurotherm_3200::sics_log 9 "::scobj::eurotherm_3200::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${datype} ${dev_id} ${tol} ${lowerlimit} ${upperlimit}"
if {[string equal -nocase "${simulation_flag}" "false"]} {
if {[string equal -nocase "aqadapter" "${ip_address}"]} {
::scobj::eurotherm_3200::sics_log 9 "makesctcontroller sct_${name} aqadapter ${tcp_port}"
@@ -588,8 +588,8 @@ proc ::scobj::eurotherm_3200::add_driver {name device_class simulation_flag ip_a
::scobj::eurotherm_3200::sics_log 9 "makesctcontroller sct_${name} aqadapter NULL"
makesctcontroller sct_${name} aqadapter NULL
}
::scobj::eurotherm_3200::sics_log 1 "::scobj::eurotherm_3200::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${datype} ${dev_id} ${tol}"
::scobj::eurotherm_3200::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${datype} ${dev_id} ${tol}
::scobj::eurotherm_3200::sics_log 1 "::scobj::eurotherm_3200::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${datype} ${dev_id} ${tol} ${lowerlimit} ${upperlimit}"
::scobj::eurotherm_3200::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${datype} ${dev_id} ${tol} ${lowerlimit} ${upperlimit}
} catch_message ]
handle_exception ${catch_status} ${catch_message}
}
@@ -602,9 +602,9 @@ namespace eval ::scobj::eurotherm_3200 {
namespace export add_driver
}
proc add_eurotherm_3200 {name ip_address tcp_port id datype dev_id tol} {
proc add_eurotherm_3200 {name ip_address tcp_port id datype dev_id {tol 5 } {lowerlimit 0} {upperlimit 500}} {
set simulation_flag "[string tolower [SplitReply [environment_simulation]]]"
::scobj::eurotherm_3200::add_driver ${name} "environment" ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${datype} ${dev_id} ${tol}
::scobj::eurotherm_3200::add_driver ${name} "environment" ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${datype} ${dev_id} ${tol} ${lowerlimit} ${upperlimit}
}
clientput "file evaluation of eurotherm_3200_sct.tcl"
@@ -682,11 +682,15 @@ proc ::scobj::eurotherm_3200::read_config {} {
}
set arg_list [list]
set missing_list [list]
foreach arg {id datype dev_id tol} {
array unset default_map
array set default_map [list tol 5 lowerlimit 0 upperlimit 500]
foreach arg {id datype dev_id tol lowerlimit upperlimit} {
if {[dict exists $u $arg]} {
lappend arg_list "[dict get $u $arg]"
} elseif {[dict exists $v $arg]} {
lappend arg_list "[dict get $v $arg]"
} elseif {[info exists default_map($arg)]} {
lappend arg_list $default_map($arg)
} else {
${ns}::sics_log 9 "Missing configuration value $arg"
lappend missing_list $arg