More common initialisation code has been moved from the instrument configuration files to server_config.tcl:server_init
server_init now handles restoring status before calling initialisation commands as well as loading extraconfig, building the HDB and catching errors. Added dummy_motors in the motor_configuration.tcl files for automated tests. sicshipadaba.c Fix broken "hset /path start" by set connection object in command callback. r2724 | ffr | 2008-10-20 11:08:31 +1100 (Mon, 20 Oct 2008) | 7 lines
This commit is contained in:
committed by
Douglas Clowes
parent
fb97ee8631
commit
7ded983eba
@@ -1,5 +1,5 @@
|
||||
# $Revision: 1.27 $
|
||||
# $Date: 2008-09-24 22:47:11 $
|
||||
# $Revision: 1.28 $
|
||||
# $Date: 2008-10-20 00:08:30 $
|
||||
# Author: Ferdi Franceschini (ffr@ansto.gov.au)
|
||||
# Last revision by: $Author: ffr $
|
||||
|
||||
@@ -34,26 +34,11 @@ fileeval $cfPath(commands)/commands.tcl
|
||||
fileeval $cfPath(anticollider)/anticollider.tcl
|
||||
source gumxml.tcl
|
||||
|
||||
########
|
||||
# Parameters set above the restore command will be clobbered by
|
||||
# the values in the status.tcl file
|
||||
# BIG WARNING: DON'T PUT 'restore' IN A CATCH BLOCK BECAUSE IT RETURNS
|
||||
# AN ERROR IF THERE IS NO ../log/status.tcl FILE.
|
||||
restore
|
||||
|
||||
catch {
|
||||
::anticollider::init
|
||||
# ::environment::temperature::add_ls340 tc1 1
|
||||
# ::environment::temperature::add_ls340 tc2 2
|
||||
# ::environment::temperature::add_west400
|
||||
server_init
|
||||
server_init
|
||||
###########################################
|
||||
# WARNING: Do not add any code below server_init, if you do SICS may fail to initialise properly.
|
||||
|
||||
if [file exists ../extraconfig.tcl] {
|
||||
fileeval ../extraconfig.tcl
|
||||
}
|
||||
|
||||
buildHDB instrument_dictionary
|
||||
}
|
||||
|
||||
clientput $errorContext
|
||||
clientput $callStack
|
||||
# You can add extra-configuration code in ../extraconfig.tcl
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
# $Revision: 1.31 $
|
||||
# $Date: 2008-09-23 22:44:01 $
|
||||
# $Revision: 1.32 $
|
||||
# $Date: 2008-10-20 00:08:30 $
|
||||
# Author: Ferdi Franceschini (ffr@ansto.gov.au)
|
||||
# Last revision by: $Author: ffr $
|
||||
source $cfPath(anticollider)/anticollider.tcl
|
||||
|
||||
# START MOTOR CONFIGURATION
|
||||
|
||||
@@ -726,4 +725,3 @@ make_gap_motors ss2hg gap ss2ho offset ss2r ss2l mm $slit2HGroup
|
||||
proc motor_set_sobj_attributes {} {
|
||||
}
|
||||
# END MOTOR CONFIGURATION
|
||||
::anticollider::init
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# $Revision: 1.33 $
|
||||
# $Date: 2008-08-19 05:11:55 $
|
||||
# $Revision: 1.34 $
|
||||
# $Date: 2008-10-20 00:08:30 $
|
||||
# Author: Ferdi Franceschini (ffr@ansto.gov.au)
|
||||
# Last revision by: $Author: ffr $
|
||||
|
||||
@@ -31,25 +31,14 @@ fileeval $cfPath(hmm)/hmm_configuration.tcl
|
||||
fileeval $cfPath(nexus)/nxscripts.tcl
|
||||
fileeval $cfPath(scan)/scan.tcl
|
||||
fileeval $cfPath(commands)/commands.tcl
|
||||
fileeval $cfPath(anticollider)/anticollider.tcl
|
||||
source gumxml.tcl
|
||||
|
||||
########
|
||||
# Parameters set above the restore command will be clobbered by
|
||||
# the values in the status.tcl file
|
||||
# BIG WARNING: DON'T PUT 'restore' IN A CATCH BLOCK BECAUSE IT RETURNS
|
||||
# AN ERROR IF THERE IS NO ../log/status.tcl FILE.
|
||||
restore
|
||||
catch {
|
||||
# ::environment::temperature::add_ls340 tc1 1
|
||||
# ::environment::temperature::add_ls340 tc2 2
|
||||
server_init
|
||||
# ::environment::temperature::add_west400
|
||||
server_init
|
||||
###########################################
|
||||
# WARNING: Do not add any code below server_init, if you do SICS may fail to initialise properly.
|
||||
|
||||
if [file exists ../extraconfig.tcl] {
|
||||
fileeval ../extraconfig.tcl
|
||||
}
|
||||
|
||||
buildHDB instrument_dictionary
|
||||
}
|
||||
|
||||
clientput $errorContext
|
||||
clientput $callStack
|
||||
# You can add extra-configuration code in ../extraconfig.tcl
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# $Revision: 1.1 $
|
||||
# $Date: 2008-07-11 01:09:57 $
|
||||
# $Revision: 1.2 $
|
||||
# $Date: 2008-10-20 00:08:30 $
|
||||
# Author: Ferdi Franceschini (ffr@ansto.gov.au)
|
||||
# Last revision by: $Author: ffr $
|
||||
|
||||
@@ -17,10 +17,12 @@ source server_config.tcl
|
||||
########################################
|
||||
# INSTRUMENT SPECIFIC CONFIGURATION
|
||||
|
||||
fileeval $cfPath(motors)/motor_configuration.tcl
|
||||
|
||||
|
||||
fileeval $cfPath(source)/source.tcl
|
||||
source $cfPath(hipadaba)/hipadaba_configuration.tcl
|
||||
fileeval $cfPath(parameters)/parameters.tcl
|
||||
fileeval $cfPath(motors)/motor_configuration.tcl
|
||||
fileeval $cfPath(plc)/plc.tcl
|
||||
fileeval $cfPath(counter)/counter.tcl
|
||||
fileeval $cfPath(hmm)/hmm_configuration.tcl
|
||||
@@ -31,23 +33,8 @@ fileeval $cfPath(commands)/commands.tcl
|
||||
fileeval $cfPath(anticollider)/anticollider.tcl
|
||||
source gumxml.tcl
|
||||
|
||||
server_init
|
||||
###########################################
|
||||
# WARNING: Do not add any code below server_init, if you do SICS may fail to initialise properly.
|
||||
|
||||
########
|
||||
# Parameters set above the restore command will be clobbered by
|
||||
# the values in the status.tcl file
|
||||
# BIG WARNING: DON'T PUT 'restore' IN A CATCH BLOCK BECAUSE IT RETURNS
|
||||
# AN ERROR IF THERE IS NO ../log/status.tcl FILE.
|
||||
restore
|
||||
|
||||
catch {
|
||||
server_init
|
||||
if [file exists extraconfig.tcl] {
|
||||
fileeval extraconfig.tcl
|
||||
}
|
||||
|
||||
buildHDB instrument_dictionary
|
||||
}
|
||||
|
||||
clientput $errorContext
|
||||
clientput $callStack
|
||||
|
||||
# You can add extra-configuration code in ../extraconfig.tcl
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# $Revision: 1.20 $
|
||||
# $Date: 2008-07-18 04:33:39 $
|
||||
# $Revision: 1.21 $
|
||||
# $Date: 2008-10-20 00:08:30 $
|
||||
# Author: Ferdi Franceschini (ffr@ansto.gov.au)
|
||||
# Last revision by: $Author: ffr $
|
||||
|
||||
@@ -17,42 +17,28 @@ source server_config.tcl
|
||||
########################################
|
||||
# INSTRUMENT SPECIFIC CONFIGURATION
|
||||
|
||||
fileeval $cfPath(motors)/motor_configuration.tcl
|
||||
|
||||
|
||||
fileeval $cfPath(source)/source.tcl
|
||||
source $cfPath(hipadaba)/hipadaba_configuration.tcl
|
||||
fileeval $cfPath(parameters)/parameters.tcl
|
||||
fileeval $cfPath(motors)/motor_configuration.tcl
|
||||
fileeval $cfPath(plc)/plc.tcl
|
||||
fileeval $cfPath(counter)/counter.tcl
|
||||
fileeval $cfPath(hmm)/hmm_configuration.tcl
|
||||
fileeval $cfPath(hmm)/detector.tcl
|
||||
fileeval $cfPath(nexus)/nxscripts.tcl
|
||||
fileeval $cfPath(hmm)/detector.tcl
|
||||
fileeval $cfPath(scan)/scan.tcl
|
||||
fileeval $cfPath(chopper)/chopper.tcl
|
||||
fileeval $cfPath(commands)/commands.tcl
|
||||
fileeval $cfPath(anticollider)/anticollider.tcl
|
||||
source gumxml.tcl
|
||||
|
||||
::utility::mkVar ::anticollider::protect_detector text manager protect_detector false detector true false
|
||||
::anticollider::protect_detector "true"
|
||||
|
||||
########
|
||||
# Parameters set above the restore command will be clobbered by
|
||||
# the values in the status.tcl file
|
||||
# BIG WARNING: DON'T PUT 'restore' IN A CATCH BLOCK BECAUSE IT RETURNS
|
||||
# AN ERROR IF THERE IS NO ../log/status.tcl FILE.
|
||||
restore
|
||||
server_init
|
||||
###########################################
|
||||
# WARNING: Do not add any code below server_init, if you do SICS may fail to initialise properly.
|
||||
|
||||
catch {
|
||||
::utility::mkVar ::anticollider::protect_detector text manager protect_detector false detector true false
|
||||
::anticollider::protect_detector "true"
|
||||
|
||||
::anticollider::init
|
||||
server_init
|
||||
|
||||
if [file exists ../extraconfig.tcl] {
|
||||
fileeval ../extraconfig.tcl
|
||||
}
|
||||
|
||||
buildHDB instrument_dictionary
|
||||
}
|
||||
|
||||
clientput $errorContext
|
||||
clientput $callStack
|
||||
# You can add extra-configuration code in ../extraconfig.tcl
|
||||
|
||||
@@ -134,7 +134,7 @@ Motor dummy_motor asim [params \
|
||||
absEnc 1\
|
||||
absEncHome $mphi_Home\
|
||||
cntsPerX 8192]
|
||||
setHomeandRange -motor dummy_motor -home 0 -lowrange 169 uprange 169
|
||||
setHomeandRange -motor dummy_motor -home 0 -lowrange 169 -uprange 169
|
||||
dummy_motor speed 1
|
||||
dummy_motor movecount $move_count
|
||||
dummy_motor precision 0.01
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# $Revision: 1.14 $
|
||||
# $Date: 2008-07-18 04:33:39 $
|
||||
# $Revision: 1.15 $
|
||||
# $Date: 2008-10-20 00:08:30 $
|
||||
# Author: Ferdi Franceschini (ffr@ansto.gov.au)
|
||||
# Last revision by: $Author: ffr $
|
||||
|
||||
@@ -31,23 +31,8 @@ fileeval $cfPath(commands)/commands.tcl
|
||||
fileeval $cfPath(anticollider)/anticollider.tcl
|
||||
source gumxml.tcl
|
||||
|
||||
########
|
||||
# Parameters set above the restore command will be clobbered by
|
||||
# the values in the status.tcl file
|
||||
# BIG WARNING: DON'T PUT 'restore' IN A CATCH BLOCK BECAUSE IT RETURNS
|
||||
# AN ERROR IF THERE IS NO ../log/status.tcl FILE.
|
||||
restore
|
||||
server_init
|
||||
###########################################
|
||||
# WARNING: Do not add any code below server_init, if you do SICS may fail to initialise properly.
|
||||
|
||||
catch {
|
||||
::anticollider::init
|
||||
server_init
|
||||
|
||||
if [file exists ../extraconfig.tcl] {
|
||||
fileeval ../extraconfig.tcl
|
||||
}
|
||||
|
||||
buildHDB instrument_dictionary
|
||||
}
|
||||
|
||||
clientput $errorContext
|
||||
clientput $callStack
|
||||
# You can add extra-configuration code in ../extraconfig.tcl
|
||||
|
||||
@@ -48,3 +48,13 @@ proc pop { which } {
|
||||
}
|
||||
publish pop user
|
||||
|
||||
# TODO SICS-198 add feedback support to getset macro generator
|
||||
foreach pname {AttRotDeg RotApDeg} {
|
||||
hmake /instrument/parameters/derived_parameters/$pname/feedback spy none
|
||||
hsetprop /instrument/parameters/derived_parameters/$pname/feedback data false
|
||||
hsetprop /instrument/parameters/derived_parameters/$pname/feedback control true
|
||||
hattach /instrument/parameters/derived_parameters/$pname/feedback ${pname}_status status
|
||||
hsetprop /instrument/parameters/derived_parameters/$pname/feedback/status control true
|
||||
hsetprop /instrument/parameters/derived_parameters/$pname/feedback/status data false
|
||||
hsetprop /instrument/parameters/derived_parameters/$pname/feedback/status nxsave false
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# $Revision: 1.13 $
|
||||
# $Date: 2008-08-29 11:38:20 $
|
||||
# $Revision: 1.14 $
|
||||
# $Date: 2008-10-20 00:08:31 $
|
||||
# Author: Ferdi Franceschini (ffr@ansto.gov.au)
|
||||
# Last revision by: $Author: ffr $
|
||||
|
||||
@@ -17,61 +17,29 @@ source server_config.tcl
|
||||
########################################
|
||||
# INSTRUMENT SPECIFIC CONFIGURATION
|
||||
|
||||
fileeval $cfPath(motors)/motor_configuration.tcl
|
||||
|
||||
|
||||
fileeval $cfPath(source)/source.tcl
|
||||
source $cfPath(hipadaba)/hipadaba_configuration.tcl
|
||||
fileeval $cfPath(nexus)/nxscripts.tcl
|
||||
fileeval $cfPath(parameters)/parameters.tcl
|
||||
fileeval $cfPath(velsel)/velsel.tcl
|
||||
fileeval $cfPath(motors)/motor_configuration.tcl
|
||||
fileeval $cfPath(plc)/plc.tcl
|
||||
fileeval $cfPath(optics)/optics.tcl
|
||||
fileeval $cfPath(counter)/counter.tcl
|
||||
fileeval $cfPath(hmm)/hmm_configuration.tcl
|
||||
fileeval $cfPath(nexus)/nxscripts.tcl
|
||||
fileeval $cfPath(hmm)/detector.tcl
|
||||
fileeval $cfPath(scan)/scan.tcl
|
||||
fileeval $cfPath(commands)/commands.tcl
|
||||
fileeval $cfPath(anticollider)/anticollider.tcl
|
||||
source gumxml.tcl
|
||||
|
||||
|
||||
########
|
||||
# Parameters set above the restore command will be clobbered by
|
||||
# the values in the status.tcl file
|
||||
# BIG WARNING: DON'T PUT 'restore' IN A CATCH BLOCK BECAUSE IT RETURNS
|
||||
# AN ERROR IF THERE IS NO ../log/status.tcl FILE.
|
||||
restore
|
||||
|
||||
::utility::mkVar ::anticollider::protect_detector text manager protect_detector false detector true false
|
||||
::anticollider::protect_detector "true"
|
||||
|
||||
server_init
|
||||
###########################################
|
||||
# WARNING: Do not add any code below server_init, if you do SICS may fail to initialise properly.
|
||||
|
||||
########
|
||||
# Parameters set above the restore command will be clobbered by
|
||||
# the values in the status.tcl file
|
||||
# BIG WARNING: DON'T PUT 'restore' IN A CATCH BLOCK BECAUSE IT RETURNS
|
||||
# AN ERROR IF THERE IS NO ../log/status.tcl FILE.
|
||||
restore
|
||||
|
||||
catch {
|
||||
::anticollider::init
|
||||
server_init
|
||||
|
||||
if [file exists ../extraconfig.tcl] {
|
||||
fileeval ../extraconfig.tcl
|
||||
}
|
||||
|
||||
buildHDB instrument_dictionary
|
||||
# TODO SICS-198 add feedback support to getset macro generator
|
||||
foreach pname {AttRotDeg RotApDeg} {
|
||||
hmake /instrument/parameters/derived_parameters/$pname/feedback spy none
|
||||
hsetprop /instrument/parameters/derived_parameters/$pname/feedback data false
|
||||
hsetprop /instrument/parameters/derived_parameters/$pname/feedback control true
|
||||
hattach /instrument/parameters/derived_parameters/$pname/feedback ${pname}_status status
|
||||
hsetprop /instrument/parameters/derived_parameters/$pname/feedback/status control true
|
||||
hsetprop /instrument/parameters/derived_parameters/$pname/feedback/status data false
|
||||
hsetprop /instrument/parameters/derived_parameters/$pname/feedback/status nxsave false
|
||||
}
|
||||
}
|
||||
|
||||
clientput $errorContext
|
||||
clientput $callStack
|
||||
# You can add extra-configuration code in ../extraconfig.tcl
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# SICS common configuration
|
||||
|
||||
# $Revision: 1.43 $
|
||||
# $Date: 2008-09-24 01:37:59 $
|
||||
# $Revision: 1.44 $
|
||||
# $Date: 2008-10-20 00:08:30 $
|
||||
# Author: Ferdi Franceschini (ffr@ansto.gov.au)
|
||||
# Last revision by $Author: ffr $
|
||||
# RELEASE_NUMBER: $Name: not supported by cvs2svn $
|
||||
@@ -139,7 +139,7 @@ sics_release [lindex $tmpstr [expr [llength $tmpstr] - 1]]
|
||||
sics_release lock
|
||||
|
||||
::utility::mkVar sics_revision_num Text internal
|
||||
set tmpstr [string map {"$" ""} {$Revision: 1.43 $}]
|
||||
set tmpstr [string map {"$" ""} {$Revision: 1.44 $}]
|
||||
sics_revision_num [lindex $tmpstr [expr [llength $tmpstr] - 1]]
|
||||
sics_revision_num lock
|
||||
|
||||
@@ -227,10 +227,17 @@ proc server_set_sobj_attributes {} {
|
||||
|
||||
proc server_init {} {
|
||||
if [ catch {
|
||||
########
|
||||
# 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
|
||||
}
|
||||
::source::isc_initialize
|
||||
::counter::isc_initialize
|
||||
::histogram_memory::isc_initialize
|
||||
::scan::isc_initialize
|
||||
::anticollider::init
|
||||
::commands::isc_initialize
|
||||
MakeStateMon hmscan
|
||||
sicslist setatt sics_suid privilege readonly
|
||||
@@ -244,7 +251,21 @@ proc server_init {} {
|
||||
|
||||
server_set_sobj_attributes
|
||||
} message ] {
|
||||
if {$::errorCode=="NONE"} {return $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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user