Regen two sct drivers
This commit is contained in:
@@ -89,7 +89,7 @@ proc ::scobj::eurotherm_3200::checkstatus {tc_root} {
|
||||
if {[hpropexists [sct] simulated] && [sct simulated] == "true"} {
|
||||
set pv "${sp}"
|
||||
hupdateif ${tc_root}/[sct driveable] ${sp}
|
||||
}
|
||||
} else {
|
||||
set pv "[hval ${tc_root}/[sct driveable]]"
|
||||
}
|
||||
if { abs(${pv} - ${sp}) <= [sct tolerance] } {
|
||||
@@ -229,8 +229,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 {
|
||||
|
||||
@@ -281,8 +281,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"
|
||||
@@ -569,9 +569,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}"
|
||||
@@ -585,8 +585,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}
|
||||
}
|
||||
@@ -599,9 +599,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 sct_eurotherm_3200.tcl"
|
||||
@@ -679,11 +679,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
|
||||
|
||||
Reference in New Issue
Block a user