Dataplot GUI: Design and Structure
|
|
Implementation
|
Dataplot GUI Implemented Using Tcl/Tk and Expect Scripting
Languages
|
The Dataplot graphical user interface (GUI) was developed
by Robert Lipman using the Tcl/Tk and Expect toolkits.
Tcl was developed by John Osterhout to add scripting
capabilities to existing programs. Tk was a later
extension to Tcl that allowed graphical interfaces
to be developed using a scripting language (as
oppossed to using a compiled language such as C/C++).
Expect is a utility developed by Don Libes of NIST.
The graphical interface is written using Tcl/Tk scripts.
Expect, if available on the given platform, is used to
handle the communications between Dataplot and the Tcl/Tk
scripts. If Expect is not available, as is the case for
Windows platforms, an alternative method of communication
is used that relies soley on Tcl/Tk.
|
Contents of the Menus are File Driven
|
The contents of the menus are contained in ASCII
files. This allows for easy modification and
development.
See the Extending Dataplot
web page for guidance in modifying the contents of these
ASCII files.
|
Advantages of the Tcl/Tk Approach
|
Some of the advantages of using the Tcl/Tk/Expect
utilities are:
- The Tcl/Tk and Expect utilities are both freely
downloadable on both Unix and Windows platforms.
Maintaining Dataplot as free software that is
available on a wide variety of computing platforms
is a major design goal of Dataplot.
- Tcl/Tk provides portability between Unix and PC
platforms. Dataplot uses the same Tcl/Tk scripts
for both the Unix and PC Windows platforms.
This is significant advantage for a non-commerical
program like Dataplot. We are not a software
company, and wo we simply do not have the resources
to develop and maintain native mode GUI's on
multiple platforms.
- Using a scripting language, as oppossed to writing
C/C++ code, provided for faster development and
modification of the GUI design.
- The Dataplot GUI Tcl/TK scripts are fundamentally
independent of the Dataplot code. For the original
implementation of the Dataplot GUI, we made only one
relatively minor change to the Dataplot source code in
order to implement the graphical interface. We have
since added a few minor code updates to Dataplot to
implement certain desirable features to the GUI. The
main point here was that we were able to add
significant developments to the GUI without modifying
the underlying Dataplot source code.
This also allows us to develop new capabilities
in the underlying command line version of Dataplot
without dealing with the complications of
incorporating them into the graphical interface.
|
Disadvantages of the Tcl/Tk Approach
|
The disadvantages of the Tcl/Tk/Expect approach are:
- Tcl/Tk and Expect have to be installed separately.
This shoule be a minor issue on most platforms.
The installation of Tcl/Tk is fairly automatic on
the PC Windows platform and many Unix sites already
provide these utilities. If your Unix site does not,
you may need assistance from your local system
adminstrators to have them installed.
Some care needs to be taken that an appropriate
version of Tcl/Tk is installed. Currently, we
recommend at least version 8.3 of Tcl/Tk be installed
(version 8.0 is the minimum).
- As a scripting language, there may be some performance
loss compared to using built-in C or C++ code.
For current hardware, the Tcl/Tk performance is
actually quite good. The primary area where
performance is an issue is the updating of the
data spreadsheet for large data sets. For very old
hardware, you may wish to stick with the command
line version.
- The decoupling of the GUI from the underlying
Dataplot code has significant advantages. However
it does have a few drawbacks as well. Specifically,
error checking of menu inputs occurs when the
Dataplot commands are actually implemented, not
when the items are entered into the menu.
- Using Tcl/Tk provides a consistent interface between
the Unix and Windows implementations of the Dataplot
GUI. The disadvantage of this is that the Dataplot
GUI will not have a "native mode look and feel"
on certain platforms. This is less of an issue on
Unix platforms as there is less standardization of
GUI's under Unix. It is an issue on Windows
platforms, where providing a "Microsoft look and
feel" can make software easier to learn and use for
those who have experience with other popular
Windows software. Related to this on Windows
platforms is the issue of windows programming.
The use of Tcl/Tk requires that Dataplot be built
in "console" mode. This makes certain windows
programming constructs more difficult (e.g.,
using the windows printer drivers).
|
|
Design of the Dataplot GUI
|
Windows in the Dataplot GUI
|
The Dataplot GUI provides six windows.
These windows can typically be controlled using standard
mouse operations on your local window system. That is,
they can be moved, resized, closed, and so forth. Since this
involves standard mouse operations that are platform dependent
(and independent of Dataplot), we don't discuss that issue
further.
- Main Menu Window
- Alphanumeric Output Window,/a>
- Graphics Window
- Command Window
- Data Spreadsheet
- Command Line
|
Main Menu Window
|
The Main Menu Window is used to execute Dataplot
commands.
The main menu window is at the top of the
gui. A menu is accessed by clicking the left
mouse button on the desire menu button.
Sub-menus may be:
- menus to additional menus;
- explanatory text; or
- action menus that initiate 1 or more Dataplot
commands.
The sub-menus have two special buttons. Clicking
the "X" button on the left corner makes the
menu disappear. Left clicking the "File" button
brings up several generic items. These are
self-explanatory for the most part (e.g., save,
print, etc.).
Clicking the right mouse button brings up the most
recently accessed menus.
|
Alphanumeric Output Window
|
Many Dataplot commands generate alphanumeric
output. This output is saved to the
alphanumeric output which is located in the
upper left quadrant.
For convenience, the output is saved in
"pages". That is, the output for each command
is saved in a separate page. The arrow buttons in
the upper left corner are used to navigate these pages.
A counter is displayed in the upper right corner to
show the current page.
In addition, the output window shows provides the
following buttons:
- The "File" button allows the current output page
to be printed or saved to a file. The items
under "File" are generally self-explanatory.
- The "Commands" button provides access to a few
common commands.
- The "Help" button access the on-line Dataplot
help files.
|
Graphics Window
|
The graphics window, located in the upper right quadrant,
is where graphics output is displayed.
For Unix platforms, graphics are displayed in
an X11 window. For PC platforms, the graphics
are displayed using a Tcl/Tk window.
The graphics window provides the following buttons.
- The "File" button provides the following options:
Clear - erases the graphics window
Save Postscript - saves the current graph, in Postscript
format to a file name of your choice
Save Pixmap - saves the current graph as a pixmap that
can be viewed later via the View Pixmap
button
View Pixmap - views graphs created previously by the
Save Pixmap button. These graphs are
displayed in a new window, not the
graphics window.
Software - generate graphs using Tcl/Tk. This is
Graphics the default, and only choice, on PC
platforms. On Unix platforms, graphics
are generated using X11. You can
specify the Tcl/Tk graphics by clicking
this button. Using Tcl/Tk allows the
window to be resized and activates the
options under the Draw button.
- The "Edit" button supports the following features.
Settings - this brings up a table of plot control
features that you can set by modifying the
table. Plot control features can also be
set under the "PlotMod" window.
Graph Font - allows you to select a font for the screen
graphics. Only applies if Software Graphics
are being used.
Print Font - allows you to select a font for the
Postscript version of the plot.
- The "Draw" button allows certain diagrammatic graphics to
be generated using the mouse. It is only only active when
the Software Graphics are being used.
- The "Help" button access the on-line Dataplot
help files for the Dataplot graphics commands.
- The "Replot" button redraws the most recent plot.
This is convenient if you've made a number of
changes to plot control features (e.g., adding
a title, setting the line types) and you want to
regenerate the plot.
- The "Refresh" button is used to redraw the current
graph window. This is slightly different than
the "Replot" button. With "Replot", you are
actually re-entering the most recent plot command.
With "Refresh", you are simply restoring the
current contents of the graph window. "Refresh"
is typically used when the graph has been destroyed
by window operations.
- The "Print" button prints the current graph on your
default printer.
- The Counter in the upper right corner shows the
coordinates of the cursor when it is in the
graphics window. These are Dataplot 0 to 100
units. This can be useful for positioning text
and other graphics elements.
|
Command Window
|
The Command History Window displays the Dataplot
commands that have been executed in the current
Dataplot session. This window is located in the
lower left quadrant.
In addition, the output window shows provides the
following buttons:
- The "File" button allows the current output page
to be printed or saved to a file. The items
under "File" are generally self-explanatory.
- The "Commands" button provides access to a few
common commands.
|
Data Spreadsheet Window
|
The spreadsheet window can be used to enter data
directly from the window. It is also useful for
showing the currently defined data. That is, if
you read data from a file, the variables you read
are displayed in the spreadsheet window.
To enter data directly from the spreadsheet
window, simply move the mouse to one of the
boxes, click the left mouse button, and type
the value. You can use the tab key to move
to the next row. Click the "Apply" button
to enter the data. The "Files/Data" menu is used
to read data from files.
A number of buttons are provided for this window:
- The "Set Decimals" button allows you to specify
the number of decimal points used in displaying
the data. By default, the data is displayed in
exponential format. You can specify 0 to 10 for
the number of decimal points. Clicking "-1"
resets exponential format.
- The "Apply" button is used to read any data you
manually typed in the spreadsheet into Dataplot.
- The "Replot" button redraws the most recent plot.
This is convenient if you've made a number of
changes to plot control features (e.g., adding
a title, setting the line types) and you want to
regenerate the plot.
- The "Refresh" button is used to redraw the current
graph window. This is slightly different than
the "Replot" button. With "Replot", you are
actually re-entering the most recent plot command.
With "Refresh", you are simply restoring the
current contents of the graph window. "Refresh"
is typically used when the graph has been destroyed
by window operations.
- The "No Update" button is used to suppress the
updating of the data in the spreadsheet window.
This is typically done for performance reasons.
Although the data window is convenient, it can hamper
performance when dealing with moderate and large
sized data sets. The spreadsheet is normally updated
whenever a new variable is created or a DELETE is
performed. If there are several thousand data points,
this can take some time.
The following limitations of the spreadsheet should
be noted:
- Only variables are displayed. Parameters, strings,
and matrices are not displayed.
The current parameters can be listed by entering the
command STATUS PARAMETERS from the command line
window. Likewise, the command STATUS FUNCTIONS
lists all currently defined strings.
- Dataplot does not currently automatically read
common spread sheet files such as Excel or Quattro
Pro files. You need to save these files as ASCII
files and then read the ASCII files into Dataplot.
|
Command Line Window
|
The Command Line window typically appears at the
bottom. This window is used to manually enter any
valid Dataplot command. Simply move the mouse into
this window and start typing the command. Either
hit the carriage return or left-click the "OK"
button to execute the command.
If Dataplot is still executing a command initiated
by one of the menus, the command line window may
not accept any input. The cursor will look like
a circle (it is usually an arrow) if a menu command
is still executing.
This window allows Dataplot to incorporate both
point and click menu operations and typed commands.
Both methods of operation have their advantages, so
we consider a seamless intermixing of menu and
command line operation quite desirable.
A few Dataplot commands don't function properly
from the gui. The details are provided under the
"Performance" menu.
The "Clear" button on this window erase any input that
you may have already typed. The "Variables" button
brings up a list of currently defined Dataplot variables.
|
Privacy
Policy/Security Notice
Disclaimer |
FOIA
NIST is an agency of the U.S.
Commerce Department.
Date created: 09/20/2001
Last updated: 09/28/2016
Please email comments on this WWW page to
alan.heckert@nist.gov.
|