Loads a set of arguments from a DataShare file, Displays those values in an HTML prompt, and then saves user en- tered values back into a DataShare file.
0 |
File Path or Embedded File |
Input HTML Form Path |
Location of the displayed HTML page |
1 |
Integer |
Window Width |
HTML Display Width in Pixels |
2 |
Integer |
Window Height |
HTML Display Height in Pixels |
3 |
File Path or Embedded File |
Input DataShare File Path |
Location of the input values for the HTML |
4 |
File Path or Embedded File |
Output DataShare File Path |
Location to write the HTML inputs |
5 |
Boolean |
Save in Binary Format? |
Binary or Text output |
6 |
Integer |
Step to jump to if Canceled (-1 will fail Step if Cancel) |
Step to jump to if canceled. |
7 |
String |
Save Button Text |
Custom text used for the Save Button |
8 |
String |
Cancel Button Text |
Custom text used for the Cancel Button |
9 |
Boolean |
Hide Save and Cancel buttons? |
True will hide the buttons. |
None.
SUCCESS |
The file was successfully loaded. |
FAILURE |
The file could not be loaded or had an invalid format. |
Currently, the application supports the following data types extracted from HTML form:
String (S), Integer (I), Double (D), Boolean (B)
In order to identify each value the HTML id attribute must be specified. The id attribute can be unique as needed. In order to identify type of entered value, the application uses first character of HTML id attribute.
For example, id=”S123” or id=”S87654” will be identified as Strings.
Number fields: number fields can be either integer or double and would be specified as follows:
<input type=”number” id = “D1” name=”Circle Diameter” value=0>
<input type=”number” id = “I” name=”Desired Measurement Count” value=0>
Radio buttons: It is important for radio buttons of the same group to have identical name attributes and data type. As in example below, id indicates String and name “Gender” for all <input> tags:
<fieldset> <legend>Gender</legend>
<input align=”left” type=”radio” id=”S3” name=”Gender” value=”male” checked> Male
<input align=”left” type=”radio” id=”S3” name=”Gender” value=”female”> Female
<input align=”left” type=”radio” id=”S3” name=”Gender” value=”other”> Other
</fieldset>
File Browser: The selected filename path should have String identification as in example below:
<input type=”file” size = “50” id=”S4” name=”CAD File Path” value=””>
Note on File Browse: Before presenting the HTML form to user, the application restores previously saved values from a DataShare file. An input field of “file” type has read only “value” attribute for security purpose. The application can’t populate (write) pre-stored filename to reopened HTML form. The re-opened form filename path initial value is al- ways empty. User doesn’t have to re-enter filename again on the re-opened form; unless he wants to change the path.
CheckBoxes: The HTML checkboxes represent Boolean values. See example below for proper type/name identifica- tion:
<input type=”checkbox” id=”B1” name=”Prompt for Tooling Selection” value=””>Prompt for Tooling Selection<br>
Dropdown List: The type/name identification should be added to <select> tag. See below:
<select id=”S5” name=”Tracker”>
<option value=”Faro”>Faro Vantage Laser Tracker</option>
<option value=”Leica”>Lieca AT960 Laser Tracker</option>
<option value=”API”>API Radian Laser Tracker</option>
</select>
jQuery and JavaScript: Adding: <meta http-equiv=”x-ua-compatible” content=”IE=edge”> into the header of an html file sent to the MP command “Load HTML Form” allows the use of jQuery commands.
jQuery and other libraries need to be linked to the form as well, for example in the header:
<script type=”text/javascript” src=”javascripts/jquery-3.3.1.min.js”></script> if the jQuery JavaScript is saved locally.
Note on Buttons: Buttons created in your HTML can serve the purpose of submitting or canceling the form. This is especially helpful if the button is tied to a JavaScript function that writes values related to the selected button to a datashare file accessible to the MP following an “onclick” event. It prevents the operator from having to select the but- ton and submitting the form, and allows the Save and Cancel buttons to be hidden in the HTML window (argument 7).
In the style section of your HTML header, create the two classes that are recognized by the MP:
<head>
<style>
.classSaveButton {}
.classCancelButton {}
</style>
</head>
Then add the classes to the button(s) that will act as submit or cancel. The buttons can support multiple classes, so simply add the new class to the button element with a space in between, i.e.
<input type=”button” class=”classSaveButton” value=”Import Control Points” onclick=”nextFunction(‘this.value)” />
An example MP with this Load HTML form can be found on the website here: http://www.kinematics.com/ftp/SA/Install/Examples/Instructional/