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.
|