|
|
|
|||||
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
| |
By David A. Sayed
31 March 1996
Abstract This white paper gives an overview of the exciting new features of PV-WAVE 6.0. The VDA Tool Architecture is a framework for developing cross-platform applications with graphic user interfaces (GUIs) in PV-WAVE. It is intended to put the VDA Tool Architecture into context and position the PV-WAVE Environment as a development tool. It is not intended to give detailed technical information on writing applications in PV-WAVE or to teach VDA Tool programming.
Further information on VDA Tool programming and the PV-WAVE Language
can be found in the PV-WAVE Programmer's Reference and in the PV-WAVE
Advanced Training Course.
Overview Today's computer user expects ease-of-use. For software this means applications should work with users to accomplish their objectives. From a design point of view, software needs to employ graphical user interfaces, on-line help, icons, etc. Another notable trend in general desktop software is that users are interacting with applications in their own language. These trends are now moving up from the desktop office application to scientific and engineering applications. All of this may be immensely beneficial to users but usually represents a significant resource drain for application developers, because it is seen as a distraction from the task of developing the core product. The latest releases of general purpose development environments have facilitated the development of "modern" applications, but they don't ease the development of applications for technical data analysis. History and Evolution
For several years, Visual Numerics has brought professional software
development tools to the technical software community. In successive
versions of the PV-WAVE data analysis and visualization environment, we
added a number of tools to enable application developers to create
easier-to-use software. The first of these was the introduction of
PV-WAVE Widgets in version 4.2. For users, widget-based tools such as VDA Tools Version 6.0 of PV-WAVE introduces a number of exciting new features. For end-users, there is the PV-WAVE:NAVIGATOR, which contains thirteen graphical tools giving users a familiar point-and-click interface from which they can load, view and edit datasets. Each one of these operations is performed by a Visual Data Analysis (VDA) Tool. The Navigator allows a user to invoke VDA Tools without having to use the command line.
So what are VDA Tools? They are essentially a natural progression from
PVWAVE Widgets. They differ in that they are mini-applications in
their own right, complete with a user-interface, graphical elements, a
message dispatch and processing mechanism, inter-tool communication and
a tool manager. From a developer's point of view, a VDA Tool is rather
like an application framework. The surface tool VDA Tools bring a number of significant features to PV-WAVE:
VDA Tools can be strung together; through inter-tool communication and a shared clipboard, data and graphical elements can be moved between tools. A tool may have a variety of outputs: from modified input data to completely different data types. In addition, the output from one tool can serve as the input to another.
Each tool is built up from underlying PV-WAVE elements. These include graphical elements for decorating a window (lines, bitmaps, boxes, etc.), menu bars, tool bars, message handlers. To write a new tool, a developer simply needs to re-use these components and fit them into the application framework.
PV-WAVE source code is supplied for each VDA Tool. In some cases, customising a tool is as easy as modifying a line of code. In others, it is simply a matter of deciding which messages to respond to and filling in the blanks in the application framework.
PV-WAVE 6.0 runs identically across all supported environments. Developers can write and test their code on one environment and deploy on another. VDA Tools appear on different environments according to the native look and feel of the particular environment. Functionality is completely unchanged.
We've taken the opportunity to split up application code from application strings. That is, from a developer's point of view, source code and resources are separate. If you're producing applications for international markets, you can localize any text by simply translating the resource file.
In addition to new dynamic data types such as associative arrays and
lists, the PV-WAVE kernel has been made nonblocking. That is, VDA Tools
and Widget applications can execute without tying up the command-line,
which means that more than one VDA Tool can execute at the same time. VDA Tools can be used together to build applets, complete with their own custom navigator, making them ideal for developing products for specific markets. For example, a navigator for financial engineering could be built, consisting of VDA tools for alalyzing risk or pricing derivatives. ArchitectureHow do VDA Tools work, and how easy is it to build one? The entire VDA Tool architecture is built on top of the new PV-WAVE kernel out of components. The architecture essentially represents an additional application programming interface (API) that encapsulates PV-WAVE functions and procedures as well as PV-WAVE Widgets. Therefore, VDA Tools can be written entirely in PVWAVE.
Let's take a look at the anatomy of a VDA Tool. VDA Tools ManagerThe Tools Manager oversees instances of VDA Tools in a PV-WAVE session and provides registration and initialization functions. A VDA Tool consists of re-entrant code, so it is possible to have multiple instances of each tool, each instance working on separate data. The Tools Manager is essentially a data structure that holds information about the names, methods, graphical elements, variables and attributes that constitute a VDA Tool. To the application developer, the Tools Manager consists of a set of functions, each prefixed with Tm. FunctionsThe Tool Manager API isolates applications from the underlying complexity of the Tool Manager. These functions consist of calls to initialise, obtain unique names, register, enumerate tools, communicate between tools, etc. Methods
Methods actually make a VDA Tool do something useful. They can be
thought of as the call-back procedure that is triggered in response to
a message sent by the Tool Manager. A VDA Tool can choose to handle
standard methods (shown in Table 1) or handle custom methods which are
specific to that VDA Tool.
AttributesVDA Tools attributes are internal data (such as background color, font, etc.) stored for each tool. We provide a very simple interface to accessing VDA Tool attributes. Two functions are available for storing and retrieving attributes, while another is provided for enumerating into a string array of VDA Tool attributes. VDA ObjectsObjects for common user-interface components such as dialogue boxes, menu bars, tool bars, etc. are all provided. Each of these has a default behavior that may be added to or overridden in favor of custom response to events. In addition to these objects, other graphical elements (graels) such as axes, bitmaps, legends and lines are available. Just like VDA Tools themselves, graels have methods, attributes, etc. A variety of standard methods are provided for user actions in a window: bring to front, send to back, group, ungroup, cut, copy, paste, etc.
In addition to graels, there are objects and utilities (prefixed by To build a VDA Tool, a developer needs to alalyze the problem and decide how to implement its solution in the VDA Tool framework. Using a combination of attributes, functions, methods and objects, developers can rapidly and efficiently create elegant solutions for visual data analysis. Sample VDA ToolObjectiveThe Wz_Histogram tool is fairly simple and serves as a good starting point for understanding how to add to and write VDA Tools.
Source code as well as compiled versions of VDA Tools is located in the DesignVDA Tool source code is split into a main section and call-backs. It is this main section that defines the VDA Tool, its appearance, attributes, etc. Here are the key elements:
Implementing VDA Tool functionality takes place in the call-back section of the file. The call-backs or methods define actions to be performed as a result of a message. This message mapping is set up using the TmSetMethod function shown above. Methods can be thought of as black boxes with well-defined inputs and outputs. Therefore, if you only need to modify the behavior of a certain aspect of a VDA Tool, you may only need to change some code in one method. Similarly, if you are creating a new VDA Tool based on an existing one, you can change and add methods that you need to but leave other methods unchanged. This concept of code components and re-use reduces your application development effort significantly. The NavigatorThe PV-WAVE:NAVIGATOR is very often the first thing that an "end-user" of PV-WAVE sees. The Navigator is itself a "super VDA Tool" and holds a collection of other VDA Tools. Because full source code for The Navigator is supplied, developers can easily modify it to suit their requirements, or those of their employer. For example, some organizations may not want to allow saving of files - it is a simple matter to disable the data export VDA Tool. Alternatively, developers can add custom VDA Tools to The Navigator. Again, this is easily accomplished by adding to the source code. SummaryThis brief overview has shown how you can leverage the powerful new API that PV-WAVE 6.0 gives to developers. The VDA Tools API can be used to develop entire applications in a fraction of the time required with other systems, while enabling developers to localize and maintain versions of their applications. AppendixTools Manager API
Graphical Elements API
Utilities API
|
|
|
|
| © Copyright 2010 Visual Numerics, Inc. All Rights Reserved |