Due to the lapse in federal government funding, NASA is not updating this website. We sincerely regret this inconvenience.
HEASoft and XSPEC are now available as conda packages. See details ....
![]() |
|||||
Redesign Home | Design | Problem | Scripting | Compatibility |
Interfaces
|
As an interactive data analysis environment, XSPEC has always had an event loop that processes user commands. From XSPEC10 onward (1997) this event loop has been implemented using an embedded tcl/tk shell. This means that on initialization XSPEC starts a tcl interpreter and adds its command set to those of the tcl language. XSPEC's I/O is channeled through the tcl (or tk) I/O devices and logging is implemented by branching the output to two output channels, one to the screen and one to a file. XSPEC12 operates similarly except that the ability to use C++ data structures considerably simplifies the code. The implementation of commands constitutes the Controller layer of the design, and serves to parse user input, check for errors, and act as the "catch" point for exceptions thrown by the Model layer. |
![]() |
![]() |
The abstract nature of the I/O system allows the program to communicate with a user either through a command line using tcl channels or through widgets in a tk-based GUI environment. |
|
Having such a shell in an interactive program gives several advantages and a great deal of flexibility both to the developer and the user:
|
|
The choice of tcl/tk as the scripting language was motivated in part by the natural extension of tcl based command line programs to GUI programs using tk language based widgets. Other choices are possible today. |
|
![]() |
![]() |
[Redesign Home] [Design] [Problem] [Scripting] [Compatibility] |