40 lines
1.2 KiB
Tcl
Executable File
40 lines
1.2 KiB
Tcl
Executable File
#!/usr/bin/tclsh
|
|
# Generates the instrument description XML file "InstXML.xml"
|
|
# by first installing the hmake and makeHdb<device> commands
|
|
# defined in the hpdbxml.tcl script, and then sourcing the
|
|
# hipadaba_configuration.tcl script to call them and create the DOM.
|
|
|
|
set instName [lindex $argv 0];
|
|
|
|
proc clientput {msg code} {puts $msg}
|
|
# Load the parameter lists required by hpdbxml.tcl
|
|
rename ::unknown _unknown
|
|
proc ::unknown {args} {}
|
|
source hipadaba/ParList.tcl
|
|
rename ::unknown ""
|
|
rename _unknown ::unknown
|
|
#Install the hmake and makeHdb<device> commands which generate
|
|
# the XML DOM.
|
|
source hipadaba/hpdbxml.tcl
|
|
array set accesscode [list 0 READ_ONLY 1 MANAGER 2 USER 3 SPY ];
|
|
|
|
proc genXML {instrument} {
|
|
global doc;
|
|
array set instPath [list echidna hrpd wombat hipd koala qld quokka sans platypus reflectometer pelican pas taipan tas kowari rsd];
|
|
|
|
instrumentXML $instrument;
|
|
cd $instPath($instrument);
|
|
|
|
# hipadaba_configuration.tcl is generated by gen_hipadaba_config.tcl
|
|
source hipadaba_configuration.tcl;
|
|
set fh [open InstXML.xml w];
|
|
puts -nonewline $fh "<?xml version = '1.0' encoding = 'UTF-8'?>";
|
|
puts -nonewline $fh [$doc asXML -indent none];
|
|
close $fh;
|
|
}
|
|
|
|
|
|
if {$tcl_interactive==0} {
|
|
genXML $instName;
|
|
}
|