Files
sics/site_ansto/instrument/server_config.tcl
Ferdi Franceschini 0f96e4f82f server_config.tcl
server_init now calls ::counter::isc_initialize, ::histogram_memory::isc_initialize and ::scan::isc_initialize

scan.c
SICS-158  Restrict bmonscan and hmscan to only one scan variable

count_common.tcl
Create a mulicounter which uses the available monitors as channels.  The multicounter is used in bmonscans

hipadaba_configuration_common.tcl
Use _link as the suffix for the nxvgroup name when making nexus file links.

hmm_configuration_common.tcl
SICS-190 Create hdb entries for bm_counts, bm_event_rate, bm_status
SICS-164 Allow running histmem in simulated mode.

hmm_cylindrical_detector_configuration.tcl
Only refer to detector SICSVariables when necessary, otherwise we get dependency problems.

nxscripts_common_1.tcl
Separate histmem_filtype_spec from bmon_filetype_spec so that we can use the histem_filetyp_spec names to restrict the histmem scan filetypes.
Close the data file on error in proc ::nexus::save
Allow int and text types when saving macro data

scan_common_1.tcl
SICS-173  Allow users to force a scan when the instrument isn't ready
Added ic_initialize proc so we can make dependencies explicit in the init_server proc
SICS-186 Allow monitor modes for histmem scans
Allow selection of histmem file policies from runscan command

echidna, wombat, kowari, quokka and platypus component and server configurations
Added instrument specific configuration initialisation functions in the component configuration files.
Add a catch block to the top-level instrument server configuration file and printout the errorContext and callStack

r2641 | ffr | 2008-07-01 17:02:26 +1000 (Tue, 01 Jul 2008) | 34 lines
2012-11-15 13:39:55 +11:00

271 lines
8.0 KiB
Tcl

# SICS common configuration
# $Revision: 1.36 $
# $Date: 2008-07-01 07:02:25 $
# Author: Ferdi Franceschini (ffr@ansto.gov.au)
# Last revision by $Author: ffr $
#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
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\
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
::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.36 $}]
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
proc server_set_sobj_attributes {} {
if [ catch {
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
## 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 {
::counter::isc_initialize
::histogram_memory::isc_initialize
::scan::isc_initialize
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 ] {
if {$::errorCode=="NONE"} {return $message}
return -code error $message
}
}
# Make the opal status info object
set sim_mode [SplitReply [opal_simulation]]
if {$sim_mode == "true"} {
proc opal {status} {
set opal_status {
"CALIBRATED.CALIBRATED REACTOR POWER 0290_04:ARPCS_CNTRL.RO0005 = 20 (08-06-04 11:42:39)"
"CNS HELIUM INLET TEMPERATURE 6290_09:TI_100.PNT = 19.6426 (08-06-20 12:17:36)"
"CNS H/E HELIUM OUTLET TEMPERATUR 6290_MB08:TI_712DCI.MEAS = 25.68 (08-06-20 12:17:36)"
"CNS HELIUM FLOW 6290_09:FI1_106.PNT = 64.2064 (08-06-20 12:17:36)"
}
switch $status {
"CALIBRATED REACTOR POWER" {
return [lindex $opal_status 0]
}
"CNS HELIUM INLET TEMPERATURE" {
return [lindex $opal_status 1]
}
"HELIUM OUTLET TEMPERATUR" {
return [lindex $opal_status 2]
}
"CNS HELIUM FLOW" {
return [lindex $opal_status 3]
}
"list" {
return $opal_status
}
}
}
publish opal user
} else {
MakeAsyncQueue lss_chan LSS 137.157.204.67 31250
MakeLSSMonitor opal lss_chan 0
}
::utility::macro::getset float reactor_power {} {
set str [opal "CALIBRATED REACTOR POWER"]
set value [lindex [lindex [split $str =] 1] 0]
return "reactor_power = $value"
}
sicslist setatt reactor_power klass source
sicslist setatt reactor_power long_name power
sicslist setatt reactor_power mutable true
sicslist setatt reactor_power units "MW"
::utility::macro::getset float cns_inlet_temp {} {
set str [opal "CNS HELIUM INLET TEMPERATURE"]
set value [lindex [lindex [split $str =] 1] 0]
return "cns_inlet_temp = $value"
}
sicslist setatt cns_inlet_temp klass source
sicslist setatt cns_inlet_temp long_name cns_inlet_temp
sicslist setatt cns_inlet_temp mutable true
sicslist setatt cns_inlet_temp units "K"
::utility::macro::getset float cns_outlet_temp {} {
set str [opal "HELIUM OUTLET TEMPERATUR"]
set value [lindex [lindex [split $str =] 1] 0]
return "cns_outlet_temp = $value"
}
sicslist setatt cns_outlet_temp klass source
sicslist setatt cns_outlet_temp long_name cns_outlet_temp
sicslist setatt cns_outlet_temp mutable true
sicslist setatt cns_outlet_temp units "K"
::utility::macro::getset float cns_flow {} {
set str [opal "CNS HELIUM FLOW"]
set value [lindex [lindex [split $str =] 1] 0]
return "cns_flow = $value"
}
sicslist setatt cns_flow klass source
sicslist setatt cns_flow long_name cns_flow_temp
sicslist setatt cns_flow mutable true
sicslist setatt cns_flow units "ls-1"