Chapter 4. More information
Refer to the numbers in the listing above when reading the annotations below:
Ê Since icons may or may not source the various bash startup scripts we explicitly source the system
wide and our login specific startup scripts.
Ë We set the working directly explicitly to the directory in which we have installed our SpecTcl. This
ensures that when SpecTcl is started, it will find its initialization scripts.
Ì This starts SpecTcl, setting its standard input to the file setup.tcl located in
~/experiment/spectcl, the working directory. This file will initialize SpecTcl, and will be
written next.
In our startup script for SpecTcl we pointed the SpecTcl stdin at the file setup.tcl. This file will setup
the initial spectrum definitions and attach SpecTcl to the online system.
The spectcl.tcl startup script is as shown below:
Example 4-2. The spectcl.tcl SpecTcl startup script
source myspectra.tcl; # ➊
sbind -all; # ➋
.gui.b update; # ➌
if {[array names env DAQHOST] ne ""} {
set daqsource $env(DAQHOST)
} else {; # ➍
set daqsource "localhost"
}
set url "tcp://$daqsource:2602"; # ➎
attach -pipe /usr/opt/daq/current/bin/spectcldaq $url; # ➏
start; # ➐
The numbers in the explanation below refer to the numbers in the example above.
Ê This source command sources the spectrum definitions we created when we configured SpecTcl.
SpecTcl GUI configuration files are just Tcl Scripts. Sourcing these scripts reproduces the
definitions saved in them.
40
Comentarios a estos manuales