Reduce log noise by setting iout = eInternal for macros. servlog.c Fixed timestamp in logfiles to get hours. hmm_configuration_common_1.tcl Added ML's mods to wombat config: ie BAT and FAT TABLE attributes and elements for multi-period acquisition and histo-streaming. Fixed "failed lsearch" bug. It's more robust to test for a non-successful lsearch instead of a failed lsearch. nxscripts_common_1.tcl SICS-297 Fixed Saving data series in a scratch file overwrites earlier entries. instdict_specification.tcl Added "scobj" kind and "sct_indexed_motor" sics object type for script context controllers and and objects. hipadaba_configuration_common.tcl Added sct_indexed_motor sics obj type to ::hdb::sobjadd and scobj kind to ::hdb::add_node sct_positmotor_common.tcl Update the index SICS variable when updating the current index value to make sure that the position is saved in the data file. You must now provide the hdb node_name when creating the sct posit motor. mk_sct_positmotor now sets the "param" and "long_name" attributes on the posit motor object util/utility.tcl Added ::utility::set_sct_indexed_motor_attributes to set SICS object attributes required for generating hdb info for an SCT_POSIT_MOTOR nxscript.c Merge the ansto mod to putslab (rev1.7) which adds support for saving unbuffered data from the histmem. sicshipadaba.c This incorporates the patch made to CommandSetCallback in rev1.10 so it can just be copied as is (ie no merge required). WARNING: There are changes to ListHdbNode to handle record separators which may affect us. Disabled sending hdb command start and stop messages because they break gumtree sicshdbfactory.c Disabled sending hdb command start and stop messages because they break gumtree hipadaba_configuration_common.tcl R2.4DEV The sct_posit_motor case of ::hdb::sobjadd is only needed to call add_node with kind=scobj. nxscripts_common_1.tcl R2.4DEV Added ::nexus::scobj::sdsinfo _gen_nxdict now skips nodes with data_type == "none" new util/script_context_util.tcl R2.4DEV Adds ::scobj::hinitprops command to initialise the hdb properties for script context object nodes. sct_positmotor_common.tcl R2.4DEV Use ::scobj::hinitprops utility command to initialise hdb properties on script context object parameter nodes. dynstring.c DynStringReplace should memcopy '\0', otherwise it can get the wrong length for iTextLen. Added DynStringReplaceWithLen to allow initialising a dynstring with char arrays which contain null chars and other non-ascii chars. Useful for read and write buffers in script context. ascon.c AsconRead return NULL for noResponse and AsconFailed otherwise the "result" node gets set with a spurious empty value. scriptcontext.c SctActionHandler only set the "result" node if there really is a reply. sicsobj.c Update from M.K. site_ansto.c Added galil and ordela hvps protocol handlers for scriptcontext. motor_dmc2280.c Allow home parameter to be outside of limits (for KOWARI) hardsup/makefile Added ordela HVPS protocol handler hardsup/sct_orhvpsprot.c New ordela HVPS protocol handler. Retries on NAKs and re-orders pot channels (ie toggles lower two bits). hardsup/sct_velselprot.c Start velocity selector protocol handler. hardsup/sct_galilprot.c Completed galil protocol handler. hipadaba_configuration_common.tcl Add new style SICS objects to hdb tree. instdict_specification.tcl Added scobj to kind list and sct_motor to sics object list. (and some housekeeping) hmm_configuration_common_1.tcl Added ratemaps to simulation. Fixe BAT_TABLE and added PERIOD_INDICES as per Mark Lesha's mods for multi-period acquisition. ratemaps now return float. sct_postimotor_common.tcl Now setting properties on the posit motor object so that it can be automatically added to the hdb tree. hrpd/config/motors/motor_configuration.tcl Fixed simulated msd motor so that it's handle properly in the hdb layer. sans/config/hmm/detector_ordela.tcl Updated the ordela calibration script to use the new sct_orhvpsprop.c script context controller. quokka_configuration.tcl Deleted lines which set the hdb properties for script context posit motors. This is now handled automatically as for other SICS objects. utility.tcl setpos now replaces the motor setpos subcommand. Added functions to set script context object attributes and sct_posit motor attributes. Created hparPath and hsibPath convenience commands for new-style SICS objects. script_context_util.tcl NEW! Adds hinitprops function to initialise the hdb properties for a script context object r2758 | ffr | 2008-12-12 17:53:53 +1100 (Fri, 12 Dec 2008) | 113 lines
277 lines
7.6 KiB
Tcl
277 lines
7.6 KiB
Tcl
# SICS common configuration
|
|
|
|
# $Revision: 1.46 $
|
|
# $Date: 2008-12-12 06:53:47 $
|
|
# Author: Ferdi Franceschini (ffr@ansto.gov.au)
|
|
# Last revision by $Author: ffr $
|
|
# RELEASE_NUMBER: $Name: not supported by cvs2svn $
|
|
|
|
#set sicsroot /usr/local/sics
|
|
VarMake opal_simulation Text internal
|
|
opal_simulation false
|
|
|
|
VarMake detector_simulation Text internal
|
|
detector_simulation false
|
|
|
|
VarMake hmm_simulation Text internal
|
|
hmm_simulation false
|
|
|
|
VarMake environment_simulation Text internal
|
|
environment_simulation false
|
|
|
|
VarMake counter_simulation Text internal
|
|
counter_simulation false
|
|
|
|
VarMake motor_simulation Text internal
|
|
motor_simulation false
|
|
|
|
VarMake chopper_simulation Text internal
|
|
chopper_simulation false
|
|
|
|
VarMake plc_simulation Text internal
|
|
plc_simulation false
|
|
|
|
VarMake sics_fullsimulation Text internal
|
|
|
|
source util/utility.tcl
|
|
source util/script_context_util.tcl
|
|
|
|
proc syncbackup {file} {
|
|
backup motorSave
|
|
backup $file
|
|
backup motorSave
|
|
}
|
|
publish syncbackup Spy
|
|
if {[info exists env(SICS_SIMULATION)] != 1} {
|
|
set sicsroot ../
|
|
source sics_ports.tcl
|
|
sics_fullsimulation false
|
|
} else {
|
|
switch $env(SICS_SIMULATION) {
|
|
"full" {
|
|
set sicsroot ../
|
|
source sics_ports.tcl
|
|
sics_fullsimulation true
|
|
}
|
|
"script_validator" {
|
|
VarMake sics_script_validator Text internal
|
|
sics_script_validator true
|
|
set sicsroot ../script_validator/
|
|
source script_validator_ports.tcl
|
|
sics_fullsimulation true
|
|
MakeSync localhost [expr [get_portnum $serverport ]-10] spy 007 ../log/syncfile.tcl
|
|
}
|
|
default {
|
|
error "ERROR: SICS_SIMULATION must be full or script_validator, not $env(SICS_SIMULATION)"
|
|
}
|
|
}
|
|
}
|
|
|
|
if {[string trim [lindex [split [sics_fullsimulation] =] 1]] == "true"} {
|
|
opal_simulation true
|
|
detector_simulation true
|
|
hmm_simulation true
|
|
counter_simulation true
|
|
environment_simulation true
|
|
motor_simulation true
|
|
chopper_simulation true
|
|
plc_simulation true
|
|
}
|
|
|
|
set cfParent config
|
|
|
|
#WARNING Make sure there are no spaces after the back-slashes
|
|
array set cfPath [list\
|
|
parameters $cfParent/parameters\
|
|
source $cfParent/source\
|
|
anticollider $cfParent/anticollider\
|
|
motors $cfParent/motors\
|
|
optics $cfParent/optics\
|
|
counter $cfParent/counter\
|
|
chopper $cfParent/chopper\
|
|
environment $cfParent/environment\
|
|
hmm $cfParent/hmm\
|
|
scan $cfParent/scan\
|
|
velsel $cfParent/velsel\
|
|
nexus $cfParent/nexus\
|
|
hipadaba $cfParent/hipadaba\
|
|
plc $cfParent/plc\
|
|
commands $cfParent/commands\
|
|
]
|
|
|
|
ServerOption LogFileBaseName $sicsroot/log/serverlog
|
|
|
|
installprotocolhandler
|
|
|
|
|
|
ServerOption statusfile $sicsroot/log/status.tcl
|
|
ServerOption RedirectFile $sicsroot/log/stdout
|
|
ServerOption LogFileDir $sicsroot/log
|
|
ServerOption QuieckPort [get_portnum $quieckport ]
|
|
ServerOption ServerPort [get_portnum $serverport ]
|
|
ServerOption InterruptPort [get_portnum $interruptport ]
|
|
ServerOption TelWord sicslogin
|
|
ServerOption TelnetPort [get_portnum $telnetport ]
|
|
ServerOption ReadUserPasswdTimeout 600000
|
|
ServerOption AcceptTimeOut 10
|
|
ServerOption ReadTimeOut 10
|
|
SicsUser manager ansto 1
|
|
SicsUser user sydney 2
|
|
SicsUser spy 007 3
|
|
|
|
MakeDataNumber SicsDataNumber $sicsroot/DataNumber
|
|
|
|
#Instrument specific configs must set the Instrument variable
|
|
::utility::mkVar SicsDataPrefix Text internal
|
|
SicsDataPrefix [SplitReply [Instrument]]
|
|
|
|
::utility::mkVar SicsDataPostFix Text manager
|
|
SicsDataPostFix nx.hdf
|
|
|
|
foreach {var val klass priv} {
|
|
program_name "SICS" entry manager
|
|
run_mode "normal" entry user
|
|
} {
|
|
::utility::mkVar $var Text $priv $var true $klass true true
|
|
$var $val
|
|
}
|
|
::utility::mkVar sics_release Text manager sics_release true entry true true
|
|
set tmpstr [string map {"$" ""} {$Name: not supported by cvs2svn $}]
|
|
sics_release [lindex $tmpstr [expr [llength $tmpstr] - 1]]
|
|
sics_release lock
|
|
|
|
::utility::mkVar sics_revision_num Text internal
|
|
set tmpstr [string map {"$" ""} {$Revision: 1.46 $}]
|
|
sics_revision_num [lindex $tmpstr [expr [llength $tmpstr] - 1]]
|
|
sics_revision_num lock
|
|
|
|
::utility::mkVar SicsDataPath Text internal
|
|
SicsDataPath $sicsroot/data/
|
|
SicsDataPath lock
|
|
::utility::mkVar Title Text user title true experiment true true
|
|
::utility::mkVar SampleDescription Text user description true sample true true
|
|
::utility::mkVar SampleName Text user name true sample true true
|
|
::utility::mkVar SampleTitle Text user short_title true sample true true
|
|
::utility::mkVar User Text user name true user true true
|
|
::utility::mkVar Email Text user email true user true true
|
|
::utility::mkVar Phone Text user phone true user true true
|
|
::utility::mkVar starttime Text user start true experiment true true
|
|
MakeDrive
|
|
|
|
exe batchpath ../batch
|
|
exe syspath ../batch
|
|
|
|
|
|
::utility::mkVar dataFileName Text user file_name true experiment true true
|
|
|
|
##
|
|
# @brief Internal action command procedure
|
|
proc _action {drivecmd obj action args} {
|
|
if [ catch {
|
|
if { [SplitReply [sicslist $obj type]] != "ActionObject" } {
|
|
error "ERROR: $obj must be an ActionObject"
|
|
}
|
|
$obj act $action
|
|
$drivecmd $obj 1
|
|
} message ] {
|
|
if {$::errorCode=="NONE"} {return $message}
|
|
return -code error $message
|
|
}
|
|
}
|
|
|
|
##
|
|
# @brief Non-blocking action command
|
|
proc action {obj action args} {
|
|
if [ catch {
|
|
_action run $obj $action $args
|
|
} message ] {
|
|
if {$::errorCode=="NONE"} {return $message}
|
|
return -code error $message
|
|
}
|
|
}
|
|
publish action user
|
|
|
|
##
|
|
# @brief Blocking action command, this will wait for the action to complete.
|
|
proc waitaction {obj action args} {
|
|
if [ catch {
|
|
_action drive $obj $action $args
|
|
} message ] {
|
|
if {$::errorCode=="NONE"} {return $message}
|
|
return -code error $message
|
|
}
|
|
}
|
|
publish waitaction user
|
|
|
|
proc server_set_sobj_attributes {} {
|
|
if [ catch {
|
|
foreach m [lrange [sicslist type Motor] 1 end] {
|
|
$m movecount 500
|
|
}
|
|
motor_set_sobj_attributes
|
|
::utility::set_motor_attributes
|
|
::utility::set_histomem_attributes
|
|
::utility::set_sobj_attributes
|
|
::utility::set_envcontrol_attributes
|
|
::plc::set_sobj_attributes
|
|
::counter::set_sobj_attributes
|
|
::nexus::set_sobj_attributes
|
|
::histogram_memory::set_sobj_attributes
|
|
::utility::set_chopper_attributes
|
|
::utility::set_sctobj_attributes
|
|
::utility::set_sct_posit_motor_attributes
|
|
## TODO move the following to the new ansto gumxml.tcl
|
|
sicslist setatt getgumtreexml privilege internal
|
|
clientput "serverport [get_portnum $::serverport]"
|
|
} message ] {
|
|
if {$::errorCode=="NONE"} {return $message}
|
|
return -code error $message
|
|
}
|
|
}
|
|
|
|
proc server_init {} {
|
|
if [ catch {
|
|
::source::isc_initialize
|
|
::counter::isc_initialize
|
|
::histogram_memory::isc_initialize
|
|
::scan::isc_initialize
|
|
::anticollider::init
|
|
::commands::isc_initialize
|
|
########
|
|
# Parameters set above the restore command will be clobbered by
|
|
# the values in the status.tcl file
|
|
if [file exists $::sicsroot/log/status.tcl ] {
|
|
restore
|
|
}
|
|
MakeStateMon hmscan
|
|
sicslist setatt sics_suid privilege readonly
|
|
sicslist setatt sics_suid klass data
|
|
sicslist setatt sics_suid kind hobj
|
|
sicslist setatt sics_suid mutable true
|
|
sicslist setatt sics_suid data true
|
|
sicslist setatt sics_suid control true
|
|
sicslist setatt sics_suid nxsave true
|
|
sicslist setatt sics_suid long_name sics_suid
|
|
|
|
server_set_sobj_attributes
|
|
|
|
} message ] {
|
|
clientput $errorContext
|
|
clientput $callStack
|
|
return -code error $message
|
|
} else {
|
|
|
|
if [ catch {
|
|
if [file exists ../extraconfig.tcl] {
|
|
fileeval ../extraconfig.tcl
|
|
}
|
|
buildHDB instrument_dictionary
|
|
} message ] {
|
|
clientput $errorContext
|
|
clientput $callStack
|
|
return -code error $message
|
|
}
|
|
return $message
|
|
}
|
|
}
|