SMS:Dynamic Model Interface Schema: Difference between revisions

From XMS Wiki
Jump to navigationJump to search
Line 452: Line 452:




=====Element ''<condition>''=====
{|class="wikitable"
|-
|width="70"|'''Info'''
|width="530"|Evaluates two or more objects using GREATER_THAN, GREATER_THAN_EQUALS, LESS_THAN, LESS_THAN_EQUALS, EQUALS, AND, OR, and NOT.  If condition is not met, then message is displayed (if model_check) or widget is hidden/dimmed (if dependency).  String literals, such as an entry in a combo-box, must be enclosed in double-quotes (ex. “Combo box entry”).
|-
|'''Versions'''
|1, 2
|-
|'''Attributes'''
|none
|-
|'''Children'''
|none
|-
|'''Used by'''
| model_check, dependency, text_style
|-
|'''Example'''
|< table >
  <column>
      <text>A</text>
      <edit_box>
        <unique_name>colA</unique_name>
      </edit_box>
    </column>
…// other columns also defined
 
  <model_check>
      <condition>( (colA EQUALS 0.0 OR colB LESS_THAN 0.0) AND NOT(colD NOT EQUALS EMPTY OR colE NOT EQUALS “Some value”))</condition>
      <message>Column D or E is required</message>
  </model_check>
</ table >
|}
{{Navbox SMS}}
{{Navbox SMS}}

Revision as of 00:06, 3 January 2014


The dynamic model interface is available in SMS version 11.2 and later. It is primarily a tool for developers. The dynamic model interface provides a way to quickly generate an interface for a numeric model.

Dynamic dialogs are a quick way to generate dialogs without having to compile code. To add or delete a widget on a dynamic dialog, the user simply modifies the XML document. When the modified document is loaded, the new/modified dialog exists. The XML document defines the layout, behavior and the different dialog controls.

The dialog is divided into 2 sections, the tree and the widget view. The tree is on the left side of the dialog and it contains groups and items that represent data. Clicking on a group or item will result with the widget view being updated to match the selected tree or group item.

  • Order of the tree items and groups will match the order defined in the XML file.
  • Clicking on group will display all children items in the widget view.
  • Clicking on a single item will display associated widgets in widget view.
  • Tree item will also display the values in a non-editable field.
  • Unique_name use format: file::unique_name#value
  • Widgets or groups of widgets can be loaded from an outside file by using <link_to_xml>.
  • Multiple widgets when displayed on right side can be expanded/collapsed – TO BE DETERMINED
  • Can have nested groups
  • Keywords are words SMS has reserved in the schema and can not be used as unique names. All keywords will start with a “#”. Here is a list of available keywords:
  • #card_name
  • #geom_name – name of geometry as it shows up in the project explorer
  • #project_name
  • #value
  • #units
  • #xmdf_path – path inside the XMDF file
  • #file_name
  • #file_path
  • #sms_path – path in sms project explorer once inside a geometric item
  • #count (used for a widget in a table for counting the rows/columns)
  • #geom_guid

Projection keyword:

  • #horizontal_datum: NAD83 |NAD27|LOCAL
  • #horizontal_system: UTM|STATE_PLANE|GEOGRAPHIC|LOCAL
  • #horizontal_units: FEET|METERS|DEGREES
  • #horizontal_zone: 3104 etc
  • #vertical_datum
  • #vertical_units

Additional keywords are defined with the various custom control widgets.

Note: In changing from version 1 to version 2, all tags that were <custom_control_XXXX> were changed to <control_XXXX>.


Element <alignH>
Info Align text horizontally in a text box. Keywords are LEFT, RIGHT, CENTER, and JUSTIFIED
Versions 1, 2
Attributes none
Children none
Used by text_box
Example
<text_box>
    <unique_name>edtD50Units</unique_name>
     <alignH>CENTER</alignH>
     <text>mm</text>
</text_box>
Element <alignV>
Info Align text horizontally in a text box. Keywords are BOTTOM, TOP, and CENTER
Versions 1, 2
Attributes none
Children none
Used by text_box
Example
<text_box>
    <unique_name>edtD50Units</unique_name>
     <alignV>TOP</alignV>
     <text>mm</text>
</text_box>
Element <arc_att>
Info Used to specify what attributes should be used for the arcs of a coverage.
Versions 2
Attributes none
Children menu_item
Used by coverage
Example
Element <attribute_set>
Info This represents an item in the project explorer that is some sort of grouping.
Versions 3
Attributes none
Children takes, menu_item
Used by model
Example See the model example.
Element <blue>
Info The blue element of a color. Ranges from 0 to 255. Added in SMS 11.2.
Versions 1, 2
Attributes none
Children none
Used by color
Example

This would change the text to a bright red color.

<text_style>                       	
   <color>
     <red>255</red>
     <green>0</green>
     <blue>0</blue>
   </color>
<text_style>


Element <bold>
Info Sets the text to be bolded. Added in SMS 11.2.
Versions 1, 2
Attributes none
Children none
Used by text_style
Example

This would bold the text when the value in the edit_box is less than 0.0.

<edit_box>
  <unique_name>edtA</unique_name>
  <default>1.0</default>
  <text_style>
      <bold></bold>
      <condition>edtA LESS_THAN 0.0</condition>
  <text_style>
</edit_box>


Element <card>
Info Determines the card name and format when the item is exported. For more examples see <export_format>.
Versions 1, 2
Attributes none
Children card_name, export_format, export_location, dependency, export_table (version 1), anything beginning with “process_each_”, export_group, export_optional
Used by item (version 1), file_def (version 2)
Example
<item>
   <text>Formulation</text>
   <card>
         <card_name>FORMULATION</card_name>
         <export_format>card "formulationUnits"</export_format>
   </card> 	


Element <card_name>
Info The name of the card which is used in the card file.
Versions 1, 2
Attributes none
Children none
Used by card
Example


Element <check_box>
Info Widget that displays text that is checked/unchecked.
Versions 1, 2
Attributes none
Children text, default, unique_name, dependency, export_text_checked, export_text_unchecked, text_style
Used by item
Example
<check_box>                       	
   <text>Calculate Sediment Transport</text>
   <default>checked</default>
   <unique_name>togCalcSedimentTransport</unique_name>
   <export_text_checked>ON</export_text_checked>
   <export_text_unchecked>OFF</export_text_unchecked>
   <dependency>…</dependency>…
</ check_box >


Element <color>
Info The color of an item, expressed in red, green and blue values ranging from 0 to 255. All 0 values for red, green and blue is black. Added in SMS 11.2.
Versions 1, 2
Attributes none
Children red, green, blue
Used by text_style
Example

This would change the text to a bright red color.

<text_style>                       	
   <color>
     <red>255</red>
     <green>0</green>
     <blue>0</blue>
   </color>
<text_style>


Element <column>
Info Definition of the column in the table. A widget defined in a column will be the widget used for each cell in the column.
Versions 1, 2
Attributes none
Children text, read_only, optional, dependency, text_box, combo_box, edit_box, all elements starting with “custom_control”, check_box
Used by < table >
Example Column1 is read only, Column 2 isn’t read only and is also optional. This means the column can have empty fields and a warning message won’t be displayed.
< table >
	…
   <column>                   	
      <text>Column1</text>
      <read_only></read_only>
  </ column >
  < column >                      	
      <text>Column2</text>
      <optional></optional>
   </ column >
</ table >


Element <combo_box>
Info

Widget that displays list of options. Only 1 can be selected. If no default is specified and the optional tag is present, then an empty option will be added to the combo box. If there is no default tag, and no optional tag, then the first item will be default.

In version 2, if a combo box has display_options_arc, and is part of a dialog that is used as an arc attribute, then a limited set of display options will appear for the options of the combo box. The display option for each option of the combo box will only be line thickness and color. The display option is NOT saved at any point and will be reset every time SMS is opened.

Versions 1, 2
Attributes none
Children option, unique_name, optional, dependency, text_style, display_options_arc(version 2)
Used by item, row, column
Example Creates a combo box with hours, minutes and seconds. Hours is the default item.
<combo_box>
   <unique_name>cbxTransportUnits</unique_name>                      	
   <option>
      <text>hours</text>
      <default></default>
   </option>
   <option>
      <text>minutes</text>
	</option>
	<option>
      <text>seconds</text>
   </option>
   <dependency>…</dependency>…
</ combo_box >


Element <command_args>
Info Defines the command line arguments to run a particular executable.
Versions 2
Attributes none
Children none
Used by input_file, anything starting with process_
Example See executable example.


Element <comment>
Info Defines a character or sequence of characters that defines the start of a comment on a line. Comments are always terminated by an end of line.
Versions 2
Attributes none
Children none
Used by file_def
Example // The following example has a file where the exclamation point starts the comment.
<file_def>
...
  <comment>!</comment>
…
</file_def>


Element <condition>
Info Evaluates two or more objects using GREATER_THAN, GREATER_THAN_EQUALS, LESS_THAN, LESS_THAN_EQUALS, EQUALS, AND, OR, and NOT. If condition is not met, then message is displayed (if model_check) or widget is hidden/dimmed (if dependency). String literals, such as an entry in a combo-box, must be enclosed in double-quotes (ex. “Combo box entry”).
Versions 1, 2
Attributes none
Children none
Used by model_check, dependency, text_style
Example < table >
  <column>
     <text>A</text>
     <edit_box>
        <unique_name>colA</unique_name>
     </edit_box>
   </column>

…// other columns also defined

  <model_check>
      <condition>( (colA EQUALS 0.0 OR colB LESS_THAN 0.0) AND NOT(colD NOT EQUALS EMPTY OR colE NOT EQUALS “Some value”))</condition>
      <message>Column D or E is required</message>
  </model_check>

</ table >