The following paper documents a PIE product that was developed using Argus' published PDK, based on GenericExport.DLL which was published on our Web site in March 1997. This product uses the strength of the PIE technology to implement a "flat text file" mechanism (as suggested by Dr. Cliff Voss of the USGS) which allows one to automate the creation of stationery Argus ONE projects.
The PIE is compatible with Argus ONE version 4 or later.
The following solutions allow model developers, who are not familiar with C programing, to create simple Graphical User Interfaces (GUIs) for numerical models. These solutions, based on the existing Argus PIE technology, allow one to interface with codes (models), from the simple creation of a "stationery" document for a model code, and up to the creation of a full featured code interface with dialogs and menus. This is achieved through the use of a ready-made Generic PIE (provided from our web site) and "flat text file" interface which may or may not interact with an external program written in any language.
The simplest form of using this ready-made Generic PIE completely eliminates the need for programing. The more advanced form allows an external application (written in any language) to interact with the ready-made Generic PIE, through a series of pre-defined ASCII (text) files.
The four different uses of the Generic PIE described below are:
The only noticeable limitation presented by this approach, as compared with advanced PIEs developed using DLLs or Shared Libraries, is that this approach does not allow adding and deleting Argus ONE layers after a project has been defined (see MODFLOW GUI-PIE).
To develop function PIEs, import PIEs, interpolator PIEs, etc. one needs to use the C interface PIE Development Kit.
Click here to download all the necessary examples which also include source code for Visual Basic and JAVA and executable examples for an external application which interacts with the Generic PIE. Examples and source codes in other languages (e.g. Delphi Pascal) will be made available in the future.
A stationery PIE is a PIE that creates a customized Argus ONE document without interacting with the user through dialog boxes. Such a PIE performs two tasks:
To create a stationery PIE, the PIE developer needs to define a layer structure and an export template. For that purpose follow the steps below:
To have your PIE up and running, copy the GenericProject.DLL file into the "ArgusPIE" directory within the "Argus Interware" directory (it is recommended to create a directory within it, such as "MyPIE" which will contain all the required files). Rename the GenericProject.DLL to "MyPIE.DLL". Also copy the "MyPIE.LAY" and "MyPIE.MET" files to this directory.
When running ArgusONE, "MyPIE" is loaded. It is listed in the PIEs list , both in the Greeting and in the About windows. A new menu item "New MyPIE Project..." will appear in the PIEs menu. Selecting this command will create a new untitled copy of the stationery document harboring the layer structure supplied in the LAY file. When this file is the active one, and the active layer is a mesh or grid, another item "Export MyPIE..." will be added to the PIEs menu. This command will run the export template given in "MyPIE.MET" to create the input files and run the Model.
You can find a sample stationery PIE in the attached directory:
The GenericProject.DLL supports adding variables to the template. This feature enables the user to customize certain values in the export template through a values file. To do so, create a file called "MyPIE.VAL" having lines like:
@<variable>@ = <value>
Before the PIE passes the export template to ArgusONE, it looks for a VAL file. If such a file is found, the PIE will, for each variable, go through the export template, locate all the expressions containing "@<variable>@" and replace them by the string "<value>".
For example, if the export template contains the line:
If: @Number of time steps@ > 0
and the VAL file contains the line:
@Number of time steps@ = 5
then, the template passed to ArgusONE will look like:
If: 5 > 0
You can find a sample PIE in the attached directory:
Generic Project\stationery with val\
Note that GenericProject.DLL will save the content of the VAL file within the ArgusONE document when it is saved to disk. Hence you don't have to worry about saving, loading, working with several projects concurrently, or moving a project to another directory or computer.
In contrary to fully developed PIEs which include the GUI within the PIE (DLL, Shared Library), Generic Project PIEs use external programs (executable) to provide a front-end to the PIE.
A PIE with a GUI (Graphical User Interface) requires an executable (EXE) file that displays a dialog box and manages the interaction with the user. This executable provides a graphical representation of the fields contained in the VAL file. For each variable in the VAL file, the executable should display a control (e.g. text box, button, list) through which the user edits the variable's value. This VAL file will later be used by the Generic Project PIE as in the previous example.
The EXE file can be created with any development system: Visual Basic, Fortran, Visual C++, Java, Code Warrior, etc. When the EXE file is executed, it receives, as an argument, the PIE's name, not including the extension ("MyPIE" in our example). It should then read the VAL file, interpret the values given inside and display a dialog box filled with the proper values. The user then will be allowed to view the values and modify them according to his/her needs. When the user dismisses the dialog box, the EXE should re-write the VAL file to reflect the new values, and exits.
The EXE file should have the same name as the PIE, e.g. MyPIE.EXE. The Generic Project PIE calls it on three instances:
Two sample projects are provided to demonstrate how to create an EXE file in Visual Basic and in Java.
You can find a sample GUI PIE in the attached directorys:
A PIE with a GUI might use different dialog boxes for each of the above three instances. The PIE interacts with the executable (or executables) through command line arguments (DOS like) when it calls it. To achieve this, an INI file should be used. The INI file specifies the arguments passed by the PIE to the executable in each of the three instances. Additionally, the INI file defines the type of layers from which the export template is allowed to be called.
The INI file looks like the VAL file, but specifies special variables:
|@MENU@||The string that will appear in the "New project..." and "Run..." menu items. That variable enables you to use a menu name that is different from the DLL file name.
For example: "@MENU@ = VS2DT" will create a menu item: "New VS2DT Project..." regardless of the PIE's name
|@NEW COMMAND@||The command line to be executed when a new project is created. You can place here a different EXE file name, or add command line arguments.
For example: "@NEW COMMAND@ = C:\MODELS\VS2DT.EXE NEW" will execute that command line when the "New Project..." menu is selected
|@EDIT COMMAND@||The command line to be executed when the user requests the "Edit Project Info..." command|
|@PRE EXPORT COMMAND@||The command line to be executed prior to project export|
|@EXPORT TRI MESH@||A value of "1" here will denote that "Run..." command will be executed from Tri. Mesh layers. A value of "0" here, or omitting this line altogether will remove the "Run..." command from the PIEs menu when the active layer is a Tri. Mesh layer|
|@EXPORT QUAD MESH@||Same for Quad Mesh layers|
|@EXPORT GRID@||Same for Grid layers|
Generic Project\Customized GUI\
To create your own EXE file, use the Visual Basic project given in "SampleEXE-VB.zip". This code is very flexible since it loops through all the Text Boxes it finds in the dialog box, and updates the VAL file accordingly. You can create your own dialog box in few minutes by following the steps below:
To create your own EXE file, use the Visual J++ project given in "SampleEXE-J.zip". This code is very flexible since it loops through all the Text Boxes it finds in the dialog box, and updates the VAL file accordingly. You can create your own dialog box in few hours by following the steps below:
Important Note: In order to run Java Applets, one must have Java VM (Virtual Machine) installed. If you intend to distribute GUI elements that uses Java Applet, Java VM must by installed on the target machine!
To find out more about Argus and its products email email@example.com or call:
Tech. support: firstname.lastname@example.org
snail mail: Argus Holdings, POB 6254, Herzelia, 46160, Israel
Copyright © Argus Holdings, Ltd. 1992-2015