Create pas/config/source/source.tcl
config/source/source_common.tcl
pelican_configuration.tcl

deploySICS.sh
Don't deploy script validator configs, they are obsolete

server_config.tcl
Source config has been moved to  config/source and is specialised for each instrument by calling the instrument specific initialiser ::source:isc_initalize

commands_common_1.tcl
The monitor mode and preset are recorded when running the count command

counter_common_1.tcl
Report and record the counts and time for the multicounter and each monitor.  Also record the mode and preset for the multicounter.

hmm_configuration_common_1.tcl
Cleanup, remove obsolete code.
Report and record the hmm total counts and time.
Allow monitor controlled acquisition from the histogram server

nxscripts_common_1.tcl
Add DataType to NXdata section, preserve case in text attributes.

scan_common_1.tcl
Provide sensible feedback for our bmonscan and hmscan objects.
Set run_mode when doing a scan.  Allow users to select the datatype for histmem scans and to force a scan

wombat_configuration.tcl
echidna_configuration.tcl
platypus_configuration.tcl
kowari_configuration.tcl
quokka_configuration.tcl
Load source config.

quokka_configuration.tcl
SICS-198 HACK, Add AttrotDeg and RotApDeg status feedback.

sans/commands/commands.tcl
Add status feedback for quokka "guide" command.

sans/parameters/parameters.tcl
Make sure data can be saved as xml (replace % with _percent)
SICS-198 HACK, add AttRotDeg and RotApDeg status feedback.

utility.tcl
Fix nasty "params array generator" bug.  SICS commands execute at runlevel 0 which means that the params anonymous array must be made at this level.
Provide the normalattlist command to enable creating attribute lists with the case preserved.

Added the runsics, runtestsics and sicsclient scripts to CVS.
Added source configurations for echidna, wombat, kowari, quokka, platypus, and pelican to CVS

r2644 | ffr | 2008-07-11 11:09:57 +1000 (Fri, 11 Jul 2008) | 53 lines
This commit is contained in:
Ferdi Franceschini
2008-07-11 11:09:57 +10:00
committed by Douglas Clowes
parent b4fb916018
commit 01be487c52
33 changed files with 779 additions and 393 deletions

View File

@@ -15,7 +15,7 @@
namespace eval scan {
variable ic_runscanpar
variable hmm_filetype
variable ic_hmm_datatype
variable save_filetype
variable reset_position
variable check_thread0
@@ -32,16 +32,47 @@ set reset_position "false"
set check_thread0 false
}
proc scan_collect {sobj uobj point} {
}
}
proc ::scan::bm_scan_collect {sobj uobj point} {
set vlist [split [$sobj getvarpar 0] = ];
set w(NP) $point
set sv [string trim [lindex [split [lindex $vlist 0] . ] 1]]
set header [format "%-4.4s %-9.9s %-14s %-11s %-11s %-11s %-7.7s" NP $sv Counts Channel0 Channel1 Channel2 Time]
set varval [SplitReply [$sv]]
set counts [SplitReply [bm getcounts]]
set mon1 [SplitReply [bm getmonitor 0]]
set mon2 [SplitReply [bm getmonitor 1]]
set mon3 [SplitReply [bm getmonitor 2]]
set time [SplitReply [bm gettime]]
set data [format "%-4d %-9.3f %-14d %-11d %-11d %-11d %-7.2f" $point $varval $counts $mon1 $mon2 $mon3 $time]
clientput $header
clientput $data
}
proc ::scan::hmm_scan_collect {sobj uobj point} {
set vlist [split [$sobj getvarpar 0] = ];
set w(NP) $point
set sv [string trim [lindex [split [lindex $vlist 0] . ] 1]]
set header [format "%-4.4s %-9.9s %-14s %-11s %-11s %-11s %-7.7s" NP $sv Counts Monitor1 Monitor2 Monitor3 Time]
set varval [SplitReply [$sv]]
set counts [SplitReply [::histogram_memory::total_counts]]
set mon1 [SplitReply [bm1 getcounts]]
set mon2 [SplitReply [bm2 getcounts]]
set mon3 [SplitReply [bm3 getcounts]]
set time [SplitReply [::histogram_memory::time]]
set data [format "%-4d %-9.3f %-14d %-11d %-11d %-11d %-7.2f" $point $varval $counts $mon1 $mon2 $mon3 $time]
clientput $header
clientput $data
}
proc ::scan::ic_initialize {} {
if [ catch {
variable ic_runscanpar
variable hmm_filetype
variable ic_hmm_datatype
set hmm_filetype HISTOGRAM_XYT
set ic_hmm_datatype HISTOGRAM_XYT
MakeScanCommand hmscan bm $::cfPath(scan)/scan_common_1.hdd recover.bin
MakeScanCommand bmonscan bm $::cfPath(scan)/scan_common_1.hdd recover.bin
@@ -50,18 +81,16 @@ proc ::scan::ic_initialize {} {
bmonscan function writeheader ::scan::donothing
bmonscan function writepoint ::scan::bm_writepoint
bmonscan function count ::scan::bm_count
#bmonscan function collect ::scan::scan_collect
bmonscan function collect ::scan::bm_scan_collect
bmonscan function prepare ::scan::bm_scan_prepare
bmonscan function finish ::scan::bm_scan_finish
hmscan configure script
#hmscan function prepare hdbprepare
#hmscan function collect hdbcollect
hmscan function writeheader ::scan::donothing
hmscan function writepoint ::scan::hmm_writepoint
hmscan function count ::scan::hmm_count
#hmscan function collect ::scan::scan_collect
hmscan function collect ::scan::hmm_scan_collect
hmscan function prepare ::scan::hmm_scan_prepare
hmscan function finish ::scan::hmm_scan_finish
@@ -151,7 +180,7 @@ proc ::scan::pre_hmm_scan_prepare {} {}
proc ::scan::hmm_scan_prepare {sobj uobj} {
variable scan_pt_start_time
variable save_filetype
variable hmm_filetype
variable ic_hmm_datatype
variable check_instrument_ready
variable force_scan
@@ -161,32 +190,33 @@ proc ::scan::hmm_scan_prepare {sobj uobj} {
::scan::check_scanvar $sobj $uobj
::scan::pre_hmm_scan_prepare
}] {
abortbatch
return -code error "HMSCAN ABORTED: $::errorInfo"
}
if [catch {
set numpoints [SplitReply [$sobj np]]
set vlist [split [$sobj getvarpar 0] = ]
set scanstart [lindex $vlist 1]
set scanstep [lindex $vlist 2]
::scan::hdb_hmscan -set NP $numpoints
::scan::hdb_hmscan -set scan_variable [string trim [lindex [split [lindex $vlist 0] . ] 1]]
::scan::hdb_hmscan -set scan_start $scanstart
::scan::hdb_hmscan -set scan_increment $scanstep
set numpoints [SplitReply [$sobj np]]
set vlist [split [$sobj getvarpar 0] = ]
set scanstart [lindex $vlist 1]
set scanstep [lindex $vlist 2]
::scan::hdb_hmscan -set NP $numpoints
::scan::hdb_hmscan -set scan_variable [string trim [lindex [split [lindex $vlist 0] . ] 1]]
::scan::hdb_hmscan -set scan_start $scanstart
::scan::hdb_hmscan -set scan_increment $scanstep
set scan_pt_start_time [sicstime]
set scan_pt_start_time [sicstime]
::scan::hdb_hmscan -set feedback status BUSY
::scan::hdb_hmscan -set feedback status BUSY
run_mode "hmscan"
::nexus::newfile $hmm_filetype $save_filetype
data axis 1 [::scan::hdb_hmscan -set scan_variable]
::nexus::newfile $ic_hmm_datatype $save_filetype
data axis 1 [::scan::hdb_hmscan -set scan_variable]
clientput "Scan start: $scanstart, Scan step: $scanstep, Number of points: $numpoints"
clientput "Filetype: $hmm_filetype"
# Prime DAE
hmm pause
clientput "Scan start: $scanstart, Scan step: $scanstep, Number of points: $numpoints"
clientput "Datatype: $ic_hmm_datatype"
# Prime DAE
hmm pause
}] {
run_mode "normal"
return -code error $::errorInfo
}
} else {
@@ -212,6 +242,7 @@ proc ::scan::hmm_scan_finish {sobj uobj} {
set $save_filetype "data"
::histogram_memory::stop
::scan::hdb_hmscan -set feedback status IDLE
run_mode "normal"
# Make sure that the next save command doesn't overwrite our scan data.
# and clear any data links
::nexus::newfile clear data
@@ -229,6 +260,7 @@ proc ::scan::hmm_scan_finish {sobj uobj} {
proc ::scan::bm_scan_finish {sobj uobj} {
variable reset_position
::scan::hdb_bmonscan -set feedback status IDLE
run_mode "normal"
# Make sure that the next save command doesn't overwrite our scan data.
# and clear any data links
::nexus::newfile clear data
@@ -278,55 +310,65 @@ proc ::scan::bm_count {sobj uobj point mode preset} {
proc ::scan::bm_scan_prepare {sobj uobj} {
variable scan_pt_start_time
variable check_instrument_ready
variable force_scan
if {[::plc::inst_ready] != 1} {
return -code error "HMSCAN ABORTED: Instrument not ready"
if {$force_scan || $check_instrument_ready && [::plc::inst_ready]} {
set force_scan false
if [catch {
::scan::check_scanvar $sobj $uobj
::scan::pre_hmm_scan_prepare
}] {
return -code error "BMONSCAN ABORTED: $::errorInfo"
}
if [catch {
#TODO Parameterise varindex in some way
set varindex 0;
set numpoints [SplitReply [$sobj np]]
set vlist [split [$sobj getvarpar $varindex] = ]
set scanstart [lindex $vlist 1]
set scanstep [lindex $vlist 2]
::scan::hdb_bmonscan -set feedback filename [SplitReply [dataFileName]]
::scan::hdb_bmonscan -set NP $numpoints
::scan::hdb_bmonscan -set scan_variable [string trim [lindex [split [lindex $vlist 0] . ] 1]];
::scan::hdb_bmonscan -set scan_start $scanstart
::scan::hdb_bmonscan -set scan_increment $scanstep
set scanvar_pts [SplitReply [$sobj getvardata $varindex]]
todo_msg "SET START TIME [sicstime]"
::scan::hdb_bmonscan -set feedback status BUSY
run_mode "bmonscan"
array set bm_fb [::scan::hdb_bmonscan -list feedback]
::nexus::newfile BEAM_MONITOR data
::nexus::data axis 1 [::scan::hdb_bmonscan -set scan_variable]
#stdscan prepare $sobj $uobj;
clientput "Scan start: $scanstart, Scan step: $scanstep, Number of points: $numpoints"
clientput "Datatype: BEAM_MONITOR"
}] {
run_mode "normal"
return -code error $::errorInfo
}
} else {
return -code error "BMONSCAN ABORTED: Instrument not ready"
}
if [catch {
::scan::check_scanvar $sobj $uobj
::scan::pre_hmm_scan_prepare
}] {
abortbatch
return -code error "BMONSCAN ABORTED: $::errorInfo"
}
#TODO Parameterise varindex in some way
set varindex 0;
set numpoints [SplitReply [$sobj np]]
set vlist [split [$sobj getvarpar $varindex] = ]
set scanstart [lindex $vlist 1]
set scanstep [lindex $vlist 2]
::scan::hdb_bmonscan -set feedback filename [SplitReply [dataFileName]]
::scan::hdb_bmonscan -set NP $numpoints
::scan::hdb_bmonscan -set scan_variable [string trim [lindex [split [lindex $vlist 0] . ] 1]];
::scan::hdb_bmonscan -set scan_start $scanstart
::scan::hdb_bmonscan -set scan_increment $scanstep
set scanvar_pts [SplitReply [$sobj getvardata $varindex]]
todo_msg "SET START TIME [sicstime]"
::scan::hdb_bmonscan -set feedback status BUSY
array set bm_fb [::scan::hdb_bmonscan -list feedback]
::nexus::newfile BEAM_MONITOR data
::nexus::data axis 1 [::scan::hdb_bmonscan -set scan_variable]
#stdscan prepare $sobj $uobj;
clientput "Scan start: $scanstart, Scan step: $scanstep, Number of points: $numpoints"
clientput "Filetype: BEAM_MONITOR"
}
Publish ::scan::scan_collect user
Publish ::scan::write_nxentry user
Publish ::scan::hmm_count user
Publish ::scan::hmm_scan_prepare user
Publish ::scan::hmm_scan_finish user
Publish ::scan::hmm_scan_collect user
Publish ::scan::hmm_writepoint user
Publish ::scan::donothing user
Publish ::scan::bm_scan_prepare user
Publish ::scan::bm_scan_finish user
Publish ::scan::bm_scan_collect user
Publish ::scan::bm_writepoint user
Publish ::scan::bm_count user
@@ -342,7 +384,7 @@ namespace eval scan {
# @param force true/false (default=false)
proc runscan {scanvar start stop numpoints mode preset args} {
variable hmm_filetype
variable ic_hmm_datatype
variable save_filetype
variable reset_position
variable force_scan
@@ -352,7 +394,7 @@ namespace eval scan {
set hm_ft_names [array names ::nexus::histmem_filetype_spec]
# Default filetype for histogram memory scans
set hmm_filetype "HISTOGRAM_XYT"
set ic_hmm_datatype "HISTOGRAM_XYT"
# Default save uniquely numbered files
set savetype "save"
set reset_position [SplitReply [::scan::runscan_reset_position]]
@@ -387,11 +429,11 @@ namespace eval scan {
error "ERROR: force must be true or false"
}
}
"filetype" {
"datatype" {
if {[lsearch $hm_ft_names $val] == -1} {
error "ERROR: filetype should be one of $hm_ft_names"
error "ERROR: datatype should be one of $hm_ft_names"
} else {
set hmm_filetype $val
set ic_hmm_datatype $val
}
}
"savetype" {
@@ -408,7 +450,7 @@ namespace eval scan {
}
}
default {
error "ERROR: $arg should be 'filetype' 'savetype' or 'force'"
error "ERROR: $arg should be 'datatype' 'savetype' or 'force'"
}
}
}