SICS-587 (in progress) Put IP and PORT configuration in one file.
Platypus TODO hmm, environment, and devices like multimeters and the sylvac.
This commit is contained in:
@@ -6,44 +6,31 @@
|
||||
VarMake sicsdebug Int Mugger
|
||||
sicsdebug 0
|
||||
|
||||
VarMake opal_simulation Text internal
|
||||
# Simulation flags, possible values = true or false
|
||||
# true: The simulated driver will be used.
|
||||
# false: The real driver will be used.
|
||||
# icsval column = settings when running on the Instrument Control Server (ie SICS_SIMULATION not defined)
|
||||
# fakedev column = settings for test platforms (ie SICS_SIMULATION=fakedev)
|
||||
foreach {simflag icsval fakedev} {
|
||||
opal_simulation true true
|
||||
detector_simulation false true
|
||||
hmm_simulation false true
|
||||
environment_simulation false true
|
||||
counter_simulation false false
|
||||
motor_simulation false false
|
||||
chopper_simulation false true
|
||||
velsel_simulation false true
|
||||
plc_simulation false true
|
||||
rfgen_simulation false true
|
||||
goniometer_simulation false true
|
||||
magnetic_simulation false true
|
||||
} {
|
||||
dict set SIMFLAG_VAL $simflag ICSVAL $icsval
|
||||
dict set SIMFLAG_VAL $simflag FAKEDEV $fakedev
|
||||
VarMake $simflag Text internal
|
||||
}
|
||||
|
||||
opal_simulation true
|
||||
|
||||
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 velsel_simulation Text internal
|
||||
velsel_simulation false
|
||||
|
||||
VarMake plc_simulation Text internal
|
||||
plc_simulation false
|
||||
|
||||
VarMake rfgen_simulation Text internal
|
||||
rfgen_simulation false
|
||||
|
||||
VarMake goniometer_simulation Text internal
|
||||
goniometer_simulation false
|
||||
|
||||
VarMake magnetic_simulation Text internal
|
||||
magnetic_simulation false
|
||||
|
||||
VarMake sics_fullsimulation Text internal
|
||||
VarMake sics_simulation Text internal
|
||||
|
||||
source util/utility.tcl
|
||||
source util/script_context_util.tcl
|
||||
@@ -57,41 +44,62 @@ publish syncbackup Spy
|
||||
if {[info exists env(SICS_SIMULATION)] != 1} {
|
||||
set sicsroot ../
|
||||
source sics_ports.tcl
|
||||
sics_fullsimulation false
|
||||
sics_simulation false
|
||||
dict for {simflag d} $SIMFLAG_VAL {
|
||||
$simflag [dict get $d ICSVAL]
|
||||
}
|
||||
if [file exists hostport_config.tcl] {
|
||||
fileeval hostport_config.tcl
|
||||
} else {
|
||||
#TODO SICS-587 Abort with error when all instruments have been refactored.
|
||||
clientput WARNING: hostport_config.tcl is missing
|
||||
# sics_exitus
|
||||
}
|
||||
} else {
|
||||
switch $env(SICS_SIMULATION) {
|
||||
"full" {
|
||||
set sicsroot ../
|
||||
source sics_ports.tcl
|
||||
sics_fullsimulation true
|
||||
sics_simulation true
|
||||
}
|
||||
"fakedev" {
|
||||
set sicsroot ../
|
||||
source sics_ports.tcl
|
||||
sics_simulation fakedev
|
||||
if [file exists hostport_config_test.tcl] {
|
||||
fileeval hostport_config_test.tcl
|
||||
} else {
|
||||
#TODO SICS-587 Abort with error when all instruments have been refactored.
|
||||
clientput ERROR: hostport_config_test.tcl is missing
|
||||
sics_exitus
|
||||
}
|
||||
}
|
||||
"script_validator" {
|
||||
VarMake sics_script_validator Text internal
|
||||
sics_script_validator true
|
||||
set sicsroot ../script_validator/
|
||||
source script_validator_ports.tcl
|
||||
sics_fullsimulation true
|
||||
sics_simulation 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)"
|
||||
error "ERROR: SICS_SIMULATION must be full, script_validator, or fakedev, not $env(SICS_SIMULATION)"
|
||||
sics_exitus
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
velsel_simulation true
|
||||
plc_simulation true
|
||||
rfgen_simulation true
|
||||
goniometer_simulation true
|
||||
magnetic_simulation true
|
||||
switch $env(SICS_SIMULATION) {
|
||||
"full" - "simdriv" - "script_validator" {
|
||||
dict for {simflag d} $SIMFLAG_VAL {
|
||||
$simflag true
|
||||
}
|
||||
}
|
||||
"fakedev" {
|
||||
dict for {simflag d} $SIMFLAG_VAL {
|
||||
$simflag [dict get $d FAKEDEV]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
set cfParent config
|
||||
|
||||
Reference in New Issue
Block a user