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

@@ -11,7 +11,7 @@
# LF Amplifier/Generator
#
# @author: Jing Chen, ANSTO, 2012-06-26
# @brief: SICS driver for LF AG 1010 LF Amplifier/Generator
# @brief: SICS driver for LF AG 1010 LF Amplifier/Generator
#
# ----------------------------------------------------------------------------*/
@@ -26,14 +26,14 @@ namespace eval ::scobj::ag1010 {
variable CtrlSetBurstPar [format %02x 8]
variable CtrlSetSweepPar [format %02x 9]
variable CtrlGetLIMITS [format %02x 17]
variable CtrlGetPAGC [format %02x 19]
variable CtrlGetPMGC [format %02x 20]
variable CtrlGetFREQ [format %02x 21]
variable CtrlGetSKEY [format %02x 23]
variable CtrlGetLIMITS [format %02x 17]
variable CtrlGetPAGC [format %02x 19]
variable CtrlGetPMGC [format %02x 20]
variable CtrlGetFREQ [format %02x 21]
variable CtrlGetSKEY [format %02x 23]
variable CtrlGetBurstPar [format %02x 24]
variable CtrlGetSweepPar [format %02x 25]
variable CtrlGetSVER [format %02x 29]
variable CtrlGetSVER [format %02x 29]
variable CtrlGetMEAS [format %02x 30]
variable CtrlGetSTA [format %02x 31]
@@ -58,14 +58,14 @@ namespace eval ::scobj::ag1010 {
proc ::scobj::ag1010::getValue {tc_root nextState rdPara} {
if {[ catch {
set HEAD 0x96
set LEN [lindex $rdPara 0]
set LEN [lindex $rdPara 0]
set CTRL [lindex $rdPara 1]
set DATA 0
set CRC 0
if {[hpropexists [sct] geterror]} {
hdelprop [sct] geterror
}
}
if {$LEN < 2} {
return -code error "Error in LF AG1010 Setting: wrong data length provided."
} elseif {$LEN > 2} {
@@ -92,10 +92,10 @@ proc ::scobj::ag1010::setValue {tc_root nextState rdPara wrPara} {
# tc_root and idx are not being used - however, don't remove so we can use the
# same calling mask as for setPoint() or other $wrFunc
variable ForPowerLimit
variable RefPowerLimit
variable FreqUpLimit
variable FreqDownLimit
variable ForPowerLimit
variable RefPowerLimit
variable FreqUpLimit
variable FreqDownLimit
set ns /sics/ag1010
#set ns [sct]
@@ -142,7 +142,7 @@ proc ::scobj::ag1010::setValue {tc_root nextState rdPara wrPara} {
set data [format %04x%04x $Freq $FreqHz]
}
}
"SoftOn" {
"SoftOn" {
if {$newPara > 1 || $newPara < 0} {
return -code error "Error in setValue: only allowed input values for SoftKey are {0,1}."
} else {
@@ -266,13 +266,13 @@ proc ::scobj::ag1010::setValue {tc_root nextState rdPara wrPara} {
"BurstMode" { if {$newPara<0 || $newPara>3} {
return -code error "Error in setValue: only allowed input values for BurstMode are {0,1,2,3}"
} else {
set BurstMode $newPara
set BurstMode $newPara
}
set BRepTime [hval $ns/BurstPar/BRepTime]
set TimeOfPower [hval $ns/BurstPar/TimeOfPower]
set TimeOfPower [hval $ns/BurstPar/TimeOfPower]
set data [format %02x%04x%04x $BurstMode $BRepTime $TimeOfPower]
}
"BRepTime" {
"BRepTime" {
#set BurstMode [hval $ns/BurstPar/BurstMode]
#if {[string match -nocase $BurstMode "Mode OFF"]} {
# set BurstMode 0
@@ -287,7 +287,7 @@ proc ::scobj::ag1010::setValue {tc_root nextState rdPara wrPara} {
#}
# set mode to Changing Burst Parameters without Chanigng Burst Mode -- 2
set BurstMode 2
set BurstMode 2
set TimeOfPower [hval $ns/BurstPar/TimeOfPower]
set data [format %02x%04x%04x $BurstMode $newPara $TimeOfPower]
}
@@ -326,15 +326,15 @@ proc ::scobj::ag1010::setValue {tc_root nextState rdPara wrPara} {
set SStp [expr [hval $ns/SweepPar/StepFreq] / 1000]
set SStpHz [expr [hval $ns/SweepPar/StepFreq] % 1000]
set SCyc [hval $ns/SweepPar/SCyc]
set data [format %02x%02x%02x%02x%02x%02x $SweepMode $SStr $SStp $SCyc $SStrHz $SStpHz]
}
set data [format %02x%02x%02x%02x%02x%02x $SweepMode $SStr $SStp $SCyc $SStrHz $SStpHz]
}
"SSteF" { set SweepMode 2
set SStr [expr [hval $ns/SweepPar/StartFreq] / 1000]
set SStrHz [expr [hval $ns/SweepPar/StartFreq] % 1000]
set SStp [expr $newPara / 1000]
set SStpHz [expr $newPara % 1000]
set SCyc [hval $ns/SweepPar/SCyc]
set data [format %02x%02x%02x%02x%02x%02x $SweepMode $SStr $SStp $SCyc $SStrHz $SStpHz]
set data [format %02x%02x%02x%02x%02x%02x $SweepMode $SStr $SStp $SCyc $SStrHz $SStpHz]
}
"SSCyc" { set SweepMode 2
set SStr [expr [hval $ns/SweepPar/StartFreq] / 1000]
@@ -350,7 +350,7 @@ proc ::scobj::ag1010::setValue {tc_root nextState rdPara wrPara} {
sct send "$cmd"
} message ]} {
return -code error "Error in setValue: $message. While sending command"
}
}
return $nextState
}
@@ -397,7 +397,7 @@ proc ::scobj::ag1010::rdValue {} {
set ctrlCode [format %d 0x[string range $data 4 5]]
switch -glob $ctrlCode {
42 { return -code error "Error in rdValue()"
42 { return -code error "Error in rdValue()"
}
2 { set FPLH [string range $data 6 7]
set FPLL [string range $data 8 9]
@@ -428,9 +428,9 @@ proc ::scobj::ag1010::rdValue {} {
}
7 { set softKey 0x[string range $data 6 7]
if {[expr $softKey & 0x80] == 0} {
hset $ns/SKEY/SoftOn "Controller takes over the keyboard of controller"
hset $ns/SKEY/SoftOn "Controller takes over the keyboard of controller"
} else {
hset $ns/SKEY/SoftOn "Host takes over the keyboard of controller"
hset $ns/SKEY/SoftOn "Host takes over the keyboard of controller"
}
if {[expr $softKey & 0x08] == 0} {
hset $ns/SKEY/Key1 "Off"
@@ -463,11 +463,11 @@ proc ::scobj::ag1010::rdValue {} {
} elseif {$SCode == 3} {
hset $ns/BurstPar/BurstMode "External Burst Mode ON"
}
set BRepTH [string range $data 8 9]
set BRepTL [string range $data 10 11]
hset $ns/BurstPar/BRepTime [format %d [expr 0x$BRepTH$BRepTL]]
set BOnTH [string range $data 12 13]
set BOnTL [string range $data 14 15]
hset $ns/BurstPar/TimeOfPower [format %d [expr 0x$BOnTH$BOnTL]]
@@ -484,13 +484,13 @@ proc ::scobj::ag1010::rdValue {} {
set SStr [format %d 0x[string range $data 8 9]]
set SStrHz [format %d 0x[string range $data 14 15]]
hset $ns/SweepPar/StartFreq [expr $SStr * 1000 + $SStrHz]
set SStp [format %d 0x[string range $data 10 11]]
set SStpHz [format %d 0x[string range $data 16 17]]
hset $ns/SweepPar/StepFreq [expr $SStp * 1000 + $SStpHz]
set SCyc [format %d 0x[string range $data 12 13]]
hset $ns/SweepPar/SCyc $SCyc
hset $ns/SweepPar/SCyc $SCyc
}
13 { set SNH [string range $data 6 7]
set SNL [string range $data 8 9]
@@ -650,7 +650,7 @@ proc createNode {scobj_hpath sct_controller cmdGroup varName readable writable p
}
}
if {$writable == 1} {
hsetprop $nodeName write ${ns}::setValue $scobj_hpath $rdFunc $rdPara $wrPara
hsetprop $nodeName write ${ns}::setValue $scobj_hpath $rdFunc $rdPara $wrPara
hsetprop $nodeName $rdFunc ${ns}::$rdFunc
if {$pollEnabled == 1} {
if {[SplitReply [environment_simulation]]=="false"} {
@@ -691,7 +691,7 @@ proc ::scobj::ag1010::mkAG {argList} {
}
MakeSICSObj $pa(NAME) SCT_OBJECT
sicslist setatt $pa(NAME) klass environment
sicslist setatt $pa(NAME) klass environment
sicslist setatt $pa(NAME) long_name $pa(NAME)
# Create a base node for all the state machines of this sics object
@@ -708,8 +708,8 @@ proc ::scobj::ag1010::mkAG {argList} {
# Nodes appear in gumtree in the order in which they are created here.
#
# Initialise the model-dependent list of supported device commands
#
# cmdGroup subdirectory in which the node is to be created, "P" means under top-parent node
#
# cmdGroup subdirectory in which the node is to be created, "P" means under top-parent node
# varName name of the actual node typically representing one device command
# readable set to 1 if the node represents a query command, 0 if it is not
# writable set to 1 if the node represents a request for a change in settings sent to the device
@@ -759,7 +759,7 @@ proc ::scobj::ag1010::mkAG {argList} {
MEAS ReversePower 0 0 0 1 float {W} user {} {} {} {}
MEAS Temperature 0 0 0 1 float {0C} user {} {} {} {}
P STA 1 0 1 1 none {} spy {2 31} {rdValue} {} {}
STA MainState 0 0 0 1 text {} user {} {} {} {}
STA MainState 0 0 0 1 text {} user {} {} {} {}
STA State 0 0 0 1 int {} user {} {} {} {}
STA/State FstRemote 0 0 0 1 text {} user {} {} {} {}
STA/State FStExtBurst 0 0 0 1 text {} user {} {} {} {}
@@ -783,7 +783,7 @@ proc ::scobj::ag1010::mkAG {argList} {
P SetPMGC 0 1 1 1 float {%} user {4 4} {rdValue} {PMGC} {}
P SetFREQ 0 1 1 1 int {Hz} user {6 5} {rdValue} {FREQ} {}
P SetSoftOn 0 1 1 1 int {} user {3 7} {rdValue} {SoftOn} {1,0}
P SetKey1 0 1 1 1 int {} user {3 7} {rdValue} {Key1} {1,0}
P SetKey1 0 1 1 1 int {} user {3 7} {rdValue} {Key1} {1,0}
P SetKey0 0 1 1 1 int {} user {3 7} {rdValue} {Key0} {1,0}
P SetKey2 0 1 1 1 int {} user {3 7} {rdValue} {Key2} {1,0}
P SetKey3 0 1 1 1 int {} user {3 7} {rdValue} {Key3} {1,0}
@@ -792,20 +792,20 @@ proc ::scobj::ag1010::mkAG {argList} {
P SetBTimeOfPower 0 1 1 1 int {us} user {7 8} {rdValue} {BTofP} {}
P SetSweepMode 0 1 1 1 int {} user {13 9} {rdValue} {SweepMode} {0,1,2}
P SetSStartFreq 0 1 1 1 int {Hz} user {13 9} {rdValue} {SStrF} {}
P SetSStepFreq 0 1 1 1 int {Hz} user {13 9} {rdValue} {SSteF} {}
P SetSStepFreq 0 1 1 1 int {Hz} user {13 9} {rdValue} {SSteF} {}
P SetSSCyc 0 1 1 1 int {} user {13 9} {rdValue} {SSCyc} {}
}
foreach {cmdGroup varName readable writable pollEnabled displayable dataType unit permission rdPara rdFunc wrPara allowedValues} \
$deviceCommandToplevel {
createNode $scobj_hpath sct_$pa(NAME) $cmdGroup $varName $readable $writable $pollEnabled $displayable $dataType $unit $permission $rdPara $rdFunc $wrPara $allowedValues
createNode $scobj_hpath sct_$pa(NAME) $cmdGroup $varName $readable $writable $pollEnabled $displayable $dataType $unit $permission $rdPara $rdFunc $wrPara $allowedValues
}
# add HDB structure here
::scobj::set_required_props $ns
foreach {hpath klass control data priv type} {
foreach {hpath klass control data priv type} {
/sics/ag1010 environment true true spy part
/sics/ag1010/MEAS NXsensor true true user NXsensor
/sics/ag1010/FRE NXsample true true user NXsample
@@ -856,13 +856,13 @@ proc lf_pagc {{para ""} args} {
set ns /sample/ag1010
set newPara [string trim $para " "]
# scale W to dW
set newPara [expr $newPara * 10]
set data [format %04x $newPara]
set cmd [format %02x%02x%02x%s%02x $HEAD $LEN $CTRL $data $CRC]
broadcast "Set Power Level for AGC mode to $newPara dW"
broadcast "Set Power Level for AGC mode to $newPara dW"
sct_ag1010 send "$cmd"
}
}
@@ -962,7 +962,7 @@ proc lf_limits {args} {
set RPL [expr $val * 10]
}
}
default { error "ERROR: $arg should be 'FPL' or 'RPL'"
default { error "ERROR: $arg should be 'FPL' or 'RPL'"
return idle
}
}
@@ -1016,7 +1016,7 @@ proc lf_burst {args} {
"rtime" { set BRepTime $val
broadcast "Set Repetition Period Burst Cycle to $val ms"
}
"top" { set TimeOfPower $val
"top" { set TimeOfPower $val
broadcast "Set Time of Power in Burst Cycle to $val us"
}
default { error "ERROR: $arg should be 'mode', 'rtime' or 'top'" }
@@ -1042,7 +1042,7 @@ proc lf_sweep {args} {
set CRC 0
set ns /sample/ag1010
set SweepMode 2
set SStr [expr [hval $ns/SweepPar/StartFreq] / 1000]
set SStrHz [expr [hval $ns/SweepPar/StartFreq] % 1000]
@@ -1073,12 +1073,12 @@ proc lf_sweep {args} {
broadcast "Set Start Frequency in Sweep Mode to $val Hz"
}
"stepF" { set SStp [expr $val / 1000]
"stepF" { set SStp [expr $val / 1000]
set SStpHz [expr $val % 1000]
broadcast "Set Step Frequency in Sweep Mode to $val Hz"
}
"np" { set np $val
"np" { set np $val
broadcast "Set Number of Steps in Full Sweep Cycle to $val"
}
@@ -1113,13 +1113,13 @@ publish lf_sweep user
# @param IP IP address of the device (e.g. IP of moxabox that hooks up to the AG1010)
# @param port port number on the moxabox (typ. 4001, 4002, 4003, or 4004)
# @param turning if the parameter is turnable and can be set from the Gumtree
# @internal time internal in polling the nodes
# @internal time internal in polling the nodes
# IP 137.157.202.219
::scobj::ag1010::mkAG {
name "ag1010"
IP 137.157.202.214
PORT 4003
IP 137.157.202.214
PORT 4003
tuning 1
interval 5
}