NPIB1.6 User's Guide

by

Ronald D. Kriz, Associate Professor
Engineering Science and Mechanics
Virginia Polytechnic Institute and State University
Blacksburg, Virginia 24061


Table of Contents:

  1. Introduction
  2. Installation
  3. Set up "public_html" for JWave and NPIB"
  4. "How-to" NPIB-form Tutorials:
  5. Frequently asked questions:
  6. Known bugs:


4.1 How-To-Create NPIB1.6 forms. Example: Polar Plot, module02

For NPIB1.6 modules a split web page appears with the NPIB1.6 form in the lower frame and the upper frame appears with the "how-to-use" instructions. The lower frame is created by a java form1.6 builder. This web page describes how to create the NPIB1.6 form for the polar plot module02 as an example.

The NPIB1.6 form, shown below, appears in the lower frame.

We provide a NPIB1.6 form editor ("form.jar") that creates new NPIB1.6 (*.html) files or edits existing NPIB1.6 (*.html) files. On the server spelunker.sv.vt.edu this NPIB1.6 form editor is located in two places:

  1. /www/jwave/npib/form.jar_Archive/form.jar_1.6/form.jar
    (form.jar ver1.6 is archived in this directory)

  2. /home/"username"/npib/form.jar
    NOTE: a home-directory "username" corresponds to a user-account on the server.

In this case the /home/"username"/npib/form.jar is accessed by setting both the PATH and CLASSPATH to this directory. With these two paths set any NPIB file (*.html) can be edited in any directory when you logged onto the server (i.e. spelunker.sv.vt.edu).

echo $PATH --> ... /home/"username"/npib: ....

echo $CLASSPATH --> ... /home/"username"/npib/form.jar: ....

For this example on the server spelunker.sv.vt.edu we can go to the directory /www/jwave/crcd/kriz/modules/module02 and edit the file new_polar.html with the following command at the UNIX prompt.

   spelunker% form1.6 -e polar.html

To create a new NPIB file at the UNIX prompt type...

   spelunker% form1.6 -e

You can give this file a name using the Save option when you leave the editor.


Only one "Working Window" should appear on your monitor**: (1) "NPIB Creator". The earlier 1.5 version also generated a second window: "Output Editor". IF you are logged onto the server (i.e. spelunker) from a remote workstation and are using NPIB1.6 form.jar file on the sever (i.e. spelunker), then you must have setup the environmental DISPLAY variable to display X-windows back to your remote workstation**. But if you are using NPIB1.6, we recommend that you install your own NPIB1.6 form.jar file in the ~/bin directory off of your home directory similar to how the NPIB1.6 form.jar file was setup on the ~/bin directory on the server (i.e. spelunker). If you are creating the NPIB1.6 file (*.html) on a remote machine it is not necessary to ftp transfer the NPIB1.6 file (*.html) to the server (i.e. spelunker) because the newer NPIB1.6 form editor has a "Save Local" or "Save Ftp" feature built into NPIB1.6 form editor that transfers the edited NPIB1.6 form file to a directory on the server (i.e. spelunker). This will be explained in more detail below.


Information for working with the NPIB Creator "Working Window"

At the top of the NPIB Creator "Working Window" you can select from a number of pulldown menu options.

At the top of the NPIB Creator window under File, the choices are as expected New, Open, Save and Exit. Under Edit there is only one choice -- Remove which removes the last entry that was created form the items under Insert shown below.

Under Insert the choices are Text Field, Label, and Button. The majority of the time you will select a Text Field box with a Label above the box. A Button is used to select or initiate a task, for example the Submit button is used to create a file, in this case polar.dat, from the information on the NPIB form and then submit this file to the application for processing.

When and item is selected under Insert an Insert-window appears prompting you to enter a unique name for this item: Text-Field, Label, Button. This name will be used again in the Output Editor "Working Window".

After you have entered a unique name followed by OK, the item should appear in the the upper left corner of the NPIB Creator window. To move and reposition the button, label, or text-field items, simply select the item to be moved by holding down the left mouse button over the item on the NPIB Creator "Working Window" and drag (hold down mouse button while moving the mouse) the item by moving the mouse to the desired location. When you let go of the mouse button the item will appear in the new location. NOTE: you will not see the item "move" but rather the item will re-appear in the new position of the NPIB form near the location where the left mouse button was released. You may have to reposition the selected item a second time and "fine-tune" the the exact location. This is not intuative and takes some practice. In this way all of the items (Text Field, Label, Button) of a working NPIB form can be created and positioned as desired.

HELPFUL HINT: unless you have an excellent memory you may want to maintain a hand written sketch on a seperate piece of paper as you build your NPIB form where the "unique name" is written next to the item as you build the form. You will need to access some of these "unique names" again when building the file data format in the Output Editor "Working Window".

Next you will want to assign more information to your button, label or text-field. When a text field, label, or button is selected with the left mouse button a "Properties" window appears that requires you enter specific infomation for that item. For example the figures below show Property windows for each of the items: Text Field, Label, and Button.

Common to all these windows are constraints, foreground, background, and font. If the item is the last in a row you must specify this by changing the "Grid Width" constraint parameter from 1 to 0. Default for the "Grid Width" parameter is one "1".

Experiment with and change foreground, background, and font as needed.

Text Field Property Window options: selectionStart, text, columns, caretPosition, and selectionsEnd:

The Text Field properties window has the most options: selectionStart and selectionEnd define the beginning and end of the text-field displayed in the text entry window just below the sectionStart display window. The possiblilities here are too numerous to spell out in detail so the best way to learn about these options is to experiment and see how each of them effect the NPIB form format.

The editable: True/False button at the bottom can be selected so that the form user can not edit the displayed text if False is selected.

Label Property Window options: alignment

Options for the labels are the same as for Text Field except for the alignment option which left justifies the text if set to 0 and centers the text if set to 1.

Only the Label Property Window initially sets the name and text equal. Typically the Label_name and text have different entries. "Text" is what the users sees on the final NPIB form and "name" is the unique Label_name assigned at the time the item is created with Insert and is hidden except if viewed in this property window.

Button Property Window options: actionCommand

There is only one unique option for the Button Properties, that is the actionCommand. In our case there is only one button which is the submit button. The actionCommand only makes sense within the shell script. This feature has only been used for the submit button.


Information for working with the Output Editor "Working Window"

This "Working Window" describes how the data that is displayed in the NPIB form will be formatted in the file submitted to the shell script.

For comparison the resulting file polar.dat shown below corresponds to the syntax shown above.

GRAPHITE-EPOXY
EPOXY ELASTIC PROPERTIES ( N/M**2 )
   EPOXY YOUNGS MODULUS,   EM=+5.280E+09
   EPOXY POISSONS RATIO,  NUM=0.354
FIBER ELASTIC PROPERTIES ( N/M**2 )
 FIBER LONGITUDINAL YOUNGS MODULUS, EFL=+2.320E+11
 FIBER TRANSVERSE YOUNGS MODULUS,   EFT=+1.500e+10
 FIBER SHEAR MODULUS L-T PLANE,    GFLT=+2.400e+10
 FIBER SHEAR MODULUS  T  PLANE,    GFTT=+5.020E+09
 FIBER PLANE STRAIN BULK MODULUS,  KFTT=+1.500E+10
FIBER VOLUME FRACTIONS: 0.00 0.60 1.00

At the top of the "Working Window" there are two entries: (1) the name of the shell script and (2) is any other parameter the shell script might need.

The next entry links the TextField_name as the return email address when shell script is completed.

The final entry is the window where the format is set with links to each of the textfield_names. The very first line in this window defines the filename where data is stored according to the format specified in the lines below. Here spaces are important if the program reading this file as data input requires accurate spacing which seperates the numbers associated with textfield_name. Notice that all numbers associated with textfield_names use the syntax, <link="textfield_name"\> . Recall that the textfield_names were assigned when the textfield was first created. This is why the HELPFUL HINT recommended that you keep a sketch of textfiled_names associated with the numbers in the boxes on the NPIB form. You can always verify the textfield_name associated with the texfield_item on the NPIB Creator "Working Window" but it is quicker if you use a sketch.


Direct Editing NPIB1.6 Files Using a Text Editor: It is possible to directly edit the syntax of the NPIB1.6 (*.html) file because it is a text file and the syntax is simple enough to understand. We only recommend that in some instances this may be an option to consider when the forms are particularly large where you may want to copy and paste large blocks. In this case again the item_name is key to finding the portion to edit.


**NOTE: If you are logged onto the server (i.e. spelunker.sv.vt.edu from a remote workstation make sure you either use ssh or setup xhost "server-name" and setenv DISPLAY "remote-workstation.IP.name:0.0" so that X-Windows are sent back to your remote-workstation monitor. YOU MAY NEED TO REPOSITION THE WINDOWS USING ALT-F7
Contact: Dr Ron Kriz
Revised 6/1/01
http://www.jwave.vt.edu/crcd/archives/npib1.6/usersguide/how-to-create1.6.html