Remove superfluous trailing white space from TCL files

This commit is contained in:
Douglas Clowes
2014-05-16 12:30:51 +10:00
parent 89e4e37f9e
commit 92d3acb5d5
230 changed files with 1835 additions and 1835 deletions

View File

@@ -6,7 +6,7 @@
# /*--------------------------------------------------------------------------
# L A K E S H O R E 3 x x S E R I E S D R I V E R
#
# This file contains the implementation of a driver for the Lakeshore 218
# This file contains the implementation of a driver for the Lakeshore 218
# controller implemented as a scriptcontext object in TCL.
# object in TCL.
#
@@ -43,7 +43,7 @@ proc ::scobj::ls218::getValue {idx cmd chID nextState} {
if {[ catch {
if {[hpropexists [sct] geterror]} {
hdelprop [sct] geterror
}
}
if {$chID == 1} {
set comm "$cmd $idx"
@@ -57,7 +57,7 @@ proc ::scobj::ls218::getValue {idx cmd chID nextState} {
}
} else {
return -code error "in getValue: error input Ch ID"
}
}
sct send "$comm\r\n"
} message ]} {
return -code error "in getValue: $message"
@@ -79,7 +79,7 @@ proc ::scobj::ls218::rdValue {nodeName varName idx} {
if {[string first "ASCERR" $replyData] != -1} {
sct geterror $replyData
return -code error "Error in LS218 Response: $replyData"
return -code error "Error in LS218 Response: $replyData"
} elseif {[string length $replyData] < 1} {
return -code error "Error in LS218: no message returned from device"
} else {
@@ -88,7 +88,7 @@ proc ::scobj::ls218::rdValue {nodeName varName idx} {
}
switch -exact $varName {
"alarm" { if {[lindex $fields 0] == 0} {
"alarm" { if {[lindex $fields 0] == 0} {
hset $nodeName/offOn off
} else {
hset $nodeName/offOn on
@@ -105,7 +105,7 @@ proc ::scobj::ls218::rdValue {nodeName varName idx} {
hset $nodeName/deadband [lindex $fields 4]
hset $nodeName/latchEnable [lindex $fields 5]
}
"aStatus" { if {[lindex $fields 0] == 0} {
"aStatus" { if {[lindex $fields 0] == 0} {
hset $nodeName/highStatus Unactivated
} else {
hset $nodeName/highStatus Activated
@@ -116,8 +116,8 @@ proc ::scobj::ls218::rdValue {nodeName varName idx} {
hset $nodeName/lowStatus Activated
}
}
"Celsius" { hset $nodeName [lindex $fields 0]
set curValue [lindex $fields 0]
"Celsius" { hset $nodeName [lindex $fields 0]
set curValue [lindex $fields 0]
}
"CurveHd" { hset $nodeName/curve [lindex $fields 0]
hset $nodeName/name [lindex $fields 1]
@@ -127,7 +127,7 @@ proc ::scobj::ls218::rdValue {nodeName varName idx} {
3 {hset $nodeName/format Ohm/K}
4 {hset $nodeName/format "log Ohm/K"}
default {}
}
}
hset $nodeName/limitValue [lindex $fields 4]
switch -exact [lindex $fields 5] {
1 {hset $nodeName/coefficient negative}
@@ -165,7 +165,7 @@ proc ::scobj::ls218::rdValue {nodeName varName idx} {
default { hset $nodeName UNKNOW}
}
}
"Kelvin" { hset $nodeName $fields
"Kelvin" { hset $nodeName $fields
#append $logString " Kelvin - $fields;"
set curValue $fields
}
@@ -178,7 +178,7 @@ proc ::scobj::ls218::rdValue {nodeName varName idx} {
default { hset $nodeName/xSource UNKNOW}
}
}
"LinearEquData" { hset $nodeName $fields
"LinearEquData" { hset $nodeName $fields
set curValue $fields
}
"mnmxSource" { switch -exact [lindex $fields 0] {
@@ -190,17 +190,17 @@ proc ::scobj::ls218::rdValue {nodeName varName idx} {
}
}
"mnmxValue" { hset $nodeName "[lindex $fields 0] , [lindex $fields 1]"}
"status" {
"status" {
# RDGST? chID Reads input status returns an integer with the following meaning
# Bit Weighting StatusIndicator
# 4 16 temp underrange
# 5 32 temp overrange
# 6 64 units under range
# 7 128 untis over range
# 6 64 units under range
# 7 128 untis over range
set field [string trimleft $fields 0]
if {[string length $field] == 0} {
set field 0
}
}
set str ""
set i [format %x $field]
@@ -219,11 +219,11 @@ proc ::scobj::ls218::rdValue {nodeName varName idx} {
hset $nodeName $str
}
"SensorUnitValue" { hset $nodeName $fields
"SensorUnitValue" { hset $nodeName $fields
#append $logString " SensorUnitValue - $fields;"
set curValue $fields
}
"data" { hset $nodeName $fields
"data" { hset $nodeName $fields
set curValue $fields
}
"aOutput" { switch -exact [lindex $fields 0] {
@@ -247,7 +247,7 @@ proc ::scobj::ls218::rdValue {nodeName varName idx} {
}
hset $nodeName/highValue [lindex $fields 4]
hset $nodeName/lowValue [lindex $fields 5]
hset $nodeName/manualValue [lindex $fields 6]
hset $nodeName/manualValue [lindex $fields 6]
}
"IDN" { hset $nodeName/manufacturer [lindex $fields 0]
hset $nodeName/model [lindex $fields 1]
@@ -273,7 +273,7 @@ proc ::scobj::ls218::rdValue {nodeName varName idx} {
default { hset $nodeName/alarmType UNKNOW }
}
}
default { return -code error "in rdValue: wrong input parameter"}
default { return -code error "in rdValue: wrong input parameter"}
}
if {$curValue != [sct oldval]} {
sct oldval $curValue
@@ -310,7 +310,7 @@ proc ::scobj::ls218::rdValue {nodeName varName idx} {
# @param type attribute for HDB tree
# @param nxsave attribute for HDB tree
# @param mutable attribute for HDB tree
# @param nxalias attribute for HDB tree
# @param nxalias attribute for HDB tree
# @return OK
proc createNode {scobj_hpath idx sct_controller cmdGroup varName readable pollEnabled dataType permission rdCmd chID rdFunc} {
@@ -341,9 +341,9 @@ proc createNode {scobj_hpath idx sct_controller cmdGroup varName readable pollEn
}
if {$readable == 1} {
hsetprop $nodeName read ${ns}::getValue $idx $rdCmd $chID rdFuncState
hsetprop $nodeName read ${ns}::getValue $idx $rdCmd $chID rdFuncState
hsetprop $nodeName rdFuncState ${ns}::rdValue $nodeName $varName $idx
hsetprop $nodeName oldval UNKNOW
hsetprop $nodeName oldval UNKNOW
}
if {$pollEnabled == 1} {
if {[SplitReply [environment_simulation]]=="false"} {
@@ -397,13 +397,13 @@ proc ::scobj::ls218::mkLS218 {argList} {
makesctcontroller sct_$pa(NAME) std $pa(IP):$pa(PORT)
# create parent nodes for input, output, and relay
# create parent nodes for input, output, and relay
foreach chanType {input output relay} {
switch -exact $chanType {
"input" {set chanList $pa(INPUTCHAN)}
"output" {set chanList $pa(OUTPUTCHAN)}
"relay" {set chanList $pa(RELAYCHAN)}
}
}
if {[string length $chanList] > 0} {
set hPath $scobj_hpath/$chanType
hfactory $hPath plain user none
@@ -443,7 +443,7 @@ proc ::scobj::ls218::mkLS218 {argList} {
# rdFunc nextState Function to be called after the getValue function, typically rdValue()
# hdbTree set to 1 if a HDB needs to be created at the node
# klass type of klass of the HDB node
# control type of contrl of the HDB node
# control type of contrl of the HDB node
# data type of data of the HDB node
# priv type of previlige level of the HDB node
# type type of the HDB node
@@ -453,35 +453,35 @@ proc ::scobj::ls218::mkLS218 {argList} {
###########################################################################################################
set inputNodes {
{} alarm 1 1 none user {ALARM?} 1 {rdValue}
alarm offOn 0 0 text user {} 0 {}
alarm source 0 0 text user {} 0 {}
alarm highValue 0 0 float user {} 0 {}
alarm lowValue 0 0 float user {} 0 {}
alarm deadband 0 0 float user {} 0 {}
alarm latchEnable 0 0 int user {} 0 {}
{} aStatus 1 1 none user {ALARMST?} 1 {rdValue}
aStatus highStatus 0 0 text user {} 0 {}
aStatus lowStatus 0 0 text user {} 0 {}
{} alarm 1 1 none user {ALARM?} 1 {rdValue}
alarm offOn 0 0 text user {} 0 {}
alarm source 0 0 text user {} 0 {}
alarm highValue 0 0 float user {} 0 {}
alarm lowValue 0 0 float user {} 0 {}
alarm deadband 0 0 float user {} 0 {}
alarm latchEnable 0 0 int user {} 0 {}
{} aStatus 1 1 none user {ALARMST?} 1 {rdValue}
aStatus highStatus 0 0 text user {} 0 {}
aStatus lowStatus 0 0 text user {} 0 {}
{} Celsius 1 1 float user {CRDG?} 1 {rdValue}
{} CurveHd 1 1 none user {CRVHDR?} 0 {rdValue}
CurveHd curve 0 0 text user {} 0 {}
CurveHd name 0 0 text user {} 0 {}
CurveHd SN 0 0 text user {} 0 {}
CurveHd format 0 0 text user {} 0 {}
CurveHd limitValue 0 0 float user {} 0 {}
CurveHd coefficient 0 0 text user {} 0 {}
{} CurveID 1 1 text user {INCRV?} 1 {rdValue}
{} control 1 1 text user {INPUT?} 1 {rdValue}
{} inputType 1 1 text user {INTYPE?} G {rdValue}
{} CurveHd 1 1 none user {CRVHDR?} 0 {rdValue}
CurveHd curve 0 0 text user {} 0 {}
CurveHd name 0 0 text user {} 0 {}
CurveHd SN 0 0 text user {} 0 {}
CurveHd format 0 0 text user {} 0 {}
CurveHd limitValue 0 0 float user {} 0 {}
CurveHd coefficient 0 0 text user {} 0 {}
{} CurveID 1 1 text user {INCRV?} 1 {rdValue}
{} control 1 1 text user {INPUT?} 1 {rdValue}
{} inputType 1 1 text user {INTYPE?} G {rdValue}
{} Kelvin 1 1 float user {KRDG?} 1 {rdValue}
{} Linear 1 1 none user {LINEAR?} 1 {rdValue}
Linear varM 0 0 float user {} 0 {}
Linear xSource 0 0 text user {} 0 {}
Linear varB 0 0 float user {} 0 {}
{} LinearEquData 1 1 float user {LRDG?} 1 {rdValue}
{} mnmxSource 1 1 text user {MNMX?} 1 {rdValue}
{} mnmxValue 1 1 text user {MNMXRDG?} 1 {rdValue}
{} Linear 1 1 none user {LINEAR?} 1 {rdValue}
Linear varM 0 0 float user {} 0 {}
Linear xSource 0 0 text user {} 0 {}
Linear varB 0 0 float user {} 0 {}
{} LinearEquData 1 1 float user {LRDG?} 1 {rdValue}
{} mnmxSource 1 1 text user {MNMX?} 1 {rdValue}
{} mnmxValue 1 1 text user {MNMXRDG?} 1 {rdValue}
{} status 1 1 text user {RDGST?} 1 {rdValue}
{} SensorUnitValue 1 1 float user {SRDG?} 1 {rdValue}
}
@@ -489,33 +489,33 @@ proc ::scobj::ls218::mkLS218 {argList} {
set outputNodes {
{} data 1 1 float user {AOUT?} 1 {rdValue}
{} aOutput 1 1 none user {ANALOG?} 1 {rdValue}
aOutput bipolarEnable 0 0 text user {} 0 {}
aOutput monitorMode 0 0 text user {} 0 {}
aOutput inputChID 0 0 int user {} 0 {}
aOutput source 0 0 text user {} 0 {}
aOutput highValue 0 0 float user {} 0 {}
aOutput lowValue 0 0 float user {} 0 {}
aOutput manualValue 0 0 int user {} 0 {}
aOutput bipolarEnable 0 0 text user {} 0 {}
aOutput monitorMode 0 0 text user {} 0 {}
aOutput inputChID 0 0 int user {} 0 {}
aOutput source 0 0 text user {} 0 {}
aOutput highValue 0 0 float user {} 0 {}
aOutput lowValue 0 0 float user {} 0 {}
aOutput manualValue 0 0 int user {} 0 {}
}
set relayNodes {
{} relay 1 1 none user {RELAY?} 1 {rdValue}
relay mode 0 0 text user {} 0 {}
relay input 0 0 int user {} 0 {}
relay alarmType 0 0 text user {} 0 {}
{} relay 1 1 none user {RELAY?} 1 {rdValue}
relay mode 0 0 text user {} 0 {}
relay input 0 0 int user {} 0 {}
relay alarmType 0 0 text user {} 0 {}
}
set otherNodes {
{} IDN 1 1 none user {*IDN?} 0 {rdValue}
IDN manufacturer 0 0 text user {} 0 {}
IDN model 0 0 text user {} 0 {}
IDN serialNumber 0 0 text user {} 0 {}
IDN firmwareDate 0 0 text user {} 0 {}
{} logStatus 1 1 text user {LOG?} 0 {rdValue}
{} IDN 1 1 none user {*IDN?} 0 {rdValue}
IDN manufacturer 0 0 text user {} 0 {}
IDN model 0 0 text user {} 0 {}
IDN serialNumber 0 0 text user {} 0 {}
IDN firmwareDate 0 0 text user {} 0 {}
{} logStatus 1 1 text user {LOG?} 0 {rdValue}
}
# create sub-tree for all 8 input channels
foreach idx $pa(INPUTCHAN) {
foreach idx $pa(INPUTCHAN) {
foreach {cmdGroup varName readable pollEnabled dataType permission rdCmd chID rdFunc} $inputNodes {
createNode $scobj_hpath/input $idx sct_$pa(NAME) $cmdGroup $varName $readable $pollEnabled $dataType $permission $rdCmd $chID $rdFunc
}
@@ -535,7 +535,7 @@ proc ::scobj::ls218::mkLS218 {argList} {
}
}
# create "other" sub-tree
# create "other" sub-tree
foreach {cmdGroup varName readable pollEnabled dataType permission rdCmd chID rdFunc} $otherNodes {
createNode $scobj_hpath/other 0 sct_$pa(NAME) $cmdGroup $varName $readable $pollEnabled $dataType $permission $rdCmd $chID $rdFunc
}
@@ -572,9 +572,9 @@ proc ::scobj::ls218::mkLS218 {argList} {
if {[string length $pa(INPUTCHAN)] > 0} {
foreach idx $pa(INPUTCHAN) {
foreach {item klass control data nxsave mutable priv alias} {
Celsius sensor true true true true user Celsius
Celsius sensor true true true true user Celsius
Kelvin sensor true true true true user Kelvin
SensorUnitValue sensor true true true true user SensorUnitValue
SensorUnitValue sensor true true true true user SensorUnitValue
} {
set hpath /sics/ls218/input/ch$idx/$item
hsetprop $hpath nxalias ls218-input-ch$idx-$alias
@@ -594,11 +594,11 @@ proc ::scobj::ls218::mkLS218 {argList} {
set hpath /sics/ls218/output/ch$idx/data
hsetprop $hpath nxalias ls218-output-ch$idx-data
hsetprop $hpath klass sensor
hsetprop $hpath privilege user
hsetprop $hpath control true
hsetprop $hpath data true
hsetprop $hpath nxsave true
hsetprop $hpath mutable true
hsetprop $hpath privilege user
hsetprop $hpath control true
hsetprop $hpath data true
hsetprop $hpath nxsave true
hsetprop $hpath mutable true
hsetprop $hpath sdsinfo ::nexus::scobj::sdsinfo
}
}
@@ -610,7 +610,7 @@ proc ::scobj::ls218::mkLS218 {argList} {
}
}
# end of namespace ::scobj::ls218
# end of namespace ::scobj::ls218
# Main process call
# @param name short name for the Lakeshore Temp controller 218

View File

@@ -1718,7 +1718,7 @@ proc createNode {scobj_hpath sct_controller cmdGroup varName readable writable p
hfactory $scobj_hpath/sensor plain spy none
# Flags ls340 and ls336 indicate whether this command is support by Lakeshore model ls340 and ls336, respectively
foreach {cmdGroup varName readable writable pollEnabled drivable idx ls340 ls336 dataType permission rdCmd rdFunc wrCmd wrFunc allowedValues} $deviceCommandToplevel {
createNode $scobj_hpath $sct_controller $cmdGroup $varName $readable $writable $pollEnabled $drivable $idx $ls340 $ls336 $dataType $permission $rdCmd $rdFunc $wrCmd $wrFunc $allowedValues $klasse
createNode $scobj_hpath $sct_controller $cmdGroup $varName $readable $writable $pollEnabled $drivable $idx $ls340 $ls336 $dataType $permission $rdCmd $rdFunc $wrCmd $wrFunc $allowedValues $klasse
}
# create a base node for each commandGroup element - these are all polled
@@ -1729,7 +1729,7 @@ proc createNode {scobj_hpath sct_controller cmdGroup varName readable writable p
hfactory $scobj_hpath/other plain spy none
foreach {cmdGroup varName readable writable pollEnabled drivable idx ls340 ls336 dataType permission rdCmd rdFunc wrCmd wrFunc allowedValues} $deviceCommand {
createNode $scobj_hpath $sct_controller $cmdGroup $varName $readable $writable $pollEnabled $drivable $idx $ls340 $ls336 $dataType $permission $rdCmd $rdFunc $wrCmd $wrFunc $allowedValues $klasse
createNode $scobj_hpath $sct_controller $cmdGroup $varName $readable $writable $pollEnabled $drivable $idx $ls340 $ls336 $dataType $permission $rdCmd $rdFunc $wrCmd $wrFunc $allowedValues $klasse
# helpNotes4user $scobj_hpath $cmdGroup $varName
}

View File

@@ -228,7 +228,7 @@ namespace eval ::scobj::[set vendor]_[set device] {
return -code error "[sct geterror]"
}
if { $ramp_rate < 0.001 || $ramp_rate > 10 } {
if { $ramp_enable == 1 } {
if { $ramp_enable == 1 } {
sct geterror "RAMP bad rate from [sct result]"
return -code error "[sct geterror]"
}

View File

@@ -811,7 +811,7 @@ namespace eval ::scobj::[set vendor]_[set device] {
hsetprop $scobj_hpath klass parameter
hsetprop $scobj_hpath sdsinfo ::nexus::scobj::sdsinfo
set point 1
if {0} {
if {0} {
::scobj::hinitprops $the_name Loop1
set point 2
::scobj::hinitprops $the_name Loop2/setpoint

View File

@@ -68,7 +68,7 @@ debug_log "rdValue [sct] [sct result]"
sct send "$cmd"
return $nextState
}
proc rdTemp {tc_root} {
debug_log "rdTemp [sct] [sct result]"
set data [sct result]
@@ -132,7 +132,7 @@ debug_log "rdValue [sct] [sct result]"
sct send $cmd
return $nextState
}
proc rdSpeed {tc_root} {
debug_log "rdSpeed [sct] [sct result]"
set data [sct result]
@@ -547,12 +547,12 @@ debug_log "setPoint $cmd $par"
set the_valu [lindex $parts 2]
set the_ramp [lindex $parts 3]
if {$the_type == "I"} {
set the_valu [expr {round($the_valu * 20.0)}]
set the_ramp [expr {round($the_ramp * 20.0)}]
set the_valu [expr {round($the_valu * 20.0)}]
set the_ramp [expr {round($the_ramp * 20.0)}]
} elseif {$the_type == "S"} {
} elseif {$the_type == "T"} {
set the_valu [expr {round($the_valu * 20.0)}]
set the_ramp [expr {round($the_ramp * 20.0 /45 * 32768)}]
set the_valu [expr {round($the_valu * 20.0)}]
set the_ramp [expr {round($the_ramp * 20.0 /45 * 32768)}]
} else {
sct geterror "Profile error: $line"
sct print "Profile error: $line"

View File

@@ -224,7 +224,7 @@ debug_log "setValue $dev:16:$cmd $par"
hset $tc_root/Loop1/setpoint [sct target]
return idle
}
proc setPoint {tc_root nextState cmd} {
set dev "[hval $tc_root/dev_id]"
set par [sct target]

View File

@@ -232,7 +232,7 @@ debug_log "setValue $dev:16:$cmd $par"
hset $tc_root/Loop1/setpoint [sct target]
return idle
}
proc setPoint {tc_root nextState cmd} {
set dev "[hval $tc_root/dev_id]"
set par [sct target]
@@ -417,7 +417,7 @@ proc createNode {scobj_hpath sct_controller cmdGroup varName readable writable\
set scobj_hpath /sics/$tempobj
#
#
# These addresses are modbus addresses on the RUI/gateway over two devices
# The RMC is at address 1 and the modbus offset on the RUI for gateway 1
# is zero, so these addresses are as specified in the manual.

View File

@@ -376,7 +376,7 @@ debug_log "setValue $dev:16:$cmd $par"
hset $tc_root/status "busy"
return idle
}
# Get the High Limit Point
proc getLimHi {tc_root nextState cmd} {
set d1 [hval $tc_root/Loop1/limit_hi]
@@ -402,7 +402,7 @@ debug_log "setValue $dev:16:$cmd $par"
hset $tc_root/Loop4/limit_hi [sct target]
return idle
}
# Set the All Set Points
proc setAll {tc_root nextState cmd} {
debug_log "setAll $tc_root $nextState $cmd [sct]=[sct target] [hget [sct]]"
@@ -413,7 +413,7 @@ debug_log "setValue $dev:16:$cmd $par"
hset $tc_root/device_control/previous_error [expr [sct target] - [hval $tc_root/samplesensor]]
return idle
}
proc setPoint {tc_root nextState cmd} {
set dev "[hval $tc_root/dev_id]"
set par [sct target]
@@ -645,7 +645,7 @@ proc createNode {scobj_hpath sct_controller cmdGroup varName readable writable\
hfactory $scobj_hpath/Loop2 plain spy none
hfactory $scobj_hpath/Loop3 plain spy none
hfactory $scobj_hpath/Loop4 plain spy none
foreach {cmdGroup varName readable writable drivable dataType permission rdCmd rdFunc wrCmd wrFunc allowedValues} $deviceCommand {
createNode $scobj_hpath $sct_controller $cmdGroup $varName $readable $writable $drivable $dataType $permission $rdCmd $rdFunc $wrCmd $wrFunc $allowedValues $klass
}

View File

@@ -42,7 +42,7 @@ proc ::environment::temperature::add_west400 {IP} {
tc1 tolerance 10
}
sicslist setatt tc1 environment_name tc1
sicslist setatt tc1 environment_name tc1
sicslist setatt tc1 long_name control_sensor_reading
::environment::mkenvinfo tc1 {ramprate {priv user} powerlimit {priv manager} }
#::environment::mkenvinfo tc1 {heateron {priv user} range {priv manager} }