Allow sics_config and device simulation flags in another file

This commit is contained in:
Douglas Clowes
2014-09-08 15:53:52 +10:00
parent e6925423e3
commit 5e28264909

View File

@ -15,23 +15,27 @@ set quieckport 60004
# false: The real 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) # 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) # fakedev column = settings for test platforms (ie SICS_SIMULATION=fakedev)
foreach {simflag icsval fakedev} { if [file exists ./sics_simulation.tcl] {
opal_simulation false true source ./sics_simulation.tcl
detector_simulation false true } else {
hmm_simulation false true foreach {simflag icsval fakedev} {
environment_simulation false false opal_simulation false true
counter_simulation false true detector_simulation false true
motor_simulation false false hmm_simulation false true
chopper_simulation false true environment_simulation false false
velsel_simulation false true counter_simulation false true
plc_simulation false true motor_simulation false false
rfgen_simulation false true chopper_simulation false true
goniometer_simulation false true velsel_simulation false true
magnetic_simulation false true plc_simulation false true
} { rfgen_simulation false true
dict set SIMFLAG_VAL $simflag ICSVAL $icsval goniometer_simulation false true
dict set SIMFLAG_VAL $simflag FAKEDEV $fakedev magnetic_simulation false true
VarMake $simflag Text internal } {
dict set SIMFLAG_VAL $simflag ICSVAL $icsval
dict set SIMFLAG_VAL $simflag FAKEDEV $fakedev
VarMake $simflag Text internal
}
} }
VarMake sics_simulation Text internal VarMake sics_simulation Text internal
@ -120,7 +124,9 @@ if {[info exists env(SICS_SIMULATION)] != 1} {
} }
fileeval util/config_reader.tcl fileeval util/config_reader.tcl
if [file exists ../sics_config.ini] { if [file exists ./sics_config.ini] {
set config_dict [config_reader::parse_file ./sics_config.ini]
} elseif [file exists ../sics_config.ini] {
set config_dict [config_reader::parse_file ../sics_config.ini] set config_dict [config_reader::parse_file ../sics_config.ini]
} }