SMS:Dynamic Model Interface Schema: Difference between revisions

From XMS Wiki
Jump to navigationJump to search
Line 1,918: Line 1,918:
|width="530"| Item to be placed in a menu. The text is the text displayed in the menu, link_to describes the dialog to be launched, dependency describes what needs to be true in order for the menu item to appear.
|width="530"| Item to be placed in a menu. The text is the text displayed in the menu, link_to describes the dialog to be launched, dependency describes what needs to be true in order for the menu item to appear.


The double_click attribute (if true) indicates that this is the menu item to be launched on a double click event. For example, if a menu_item is in an arc_att, and has double_click = “true”, then when an arc is double clicked, the dialog specified by the menu item is launched.   
The double_click attribute (if true) indicates that this is the menu item to be launched on a double-click event. For example, if a menu_item is in an arc_att, and has double_click = “true”, then when an arc is double clicked, the dialog specified by the menu item is launched.   
|-
|-
|'''Versions'''
|'''Versions'''

Revision as of 23:29, 6 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 <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 >
Element <contains>
Info Holds all the groups and items of a group.
Versions 2
Attributes none
Children group, item
Used by group
Example


Element <control_curve>
Info Displays an curve push button. When pushed the xy curve values can be updated and a curve is displayed.
Versions 2
Attributes none
Children max_rows, flags, x_column, y_column, unique_name, dependency
Used by item, row, column
Example This example creates a curve limited to 10 rows.
<item>
   <control_curve>
       <unique_name>myCurve1</unique_name>
       <max_rows>10</max_rows>
       <flags>XY_USEDATE</flags>
       <x_column>
          <text>Time
       </x_column>
       <y_column>
  	<text>Velocity</text>   
       </y_column>	
   </control_curve>
  …


Element <control_dataset>
Info

Displays an edit box, and push buttons for select, delete and create. Once selected, the dataset string is placed into the edit box. <dataset_type> can be scalar or vector. Possible keyword outputs are file_name (which is the name of the dataset without path), geom_name, and file_path (full path c:\somewhere) and sms_path.

Versions 1 (<custom_control_XXXX>), 2
Attributes none
Children push_button, dataset_type, unique_name, dependency, default, dataset_name, text_style, use_paramter (version 2)
Used by item, row, column
Example This example creates the custom control with only the select and delete buttons.
<item>
    <control_dataset>
        <push_button>select<push_button>
        <push_button>delete</push_button>
        <dataset_type>scalar</dataset_type>
    </control_dataset>


Element <control_date>
Info Displays date and time selector, where a date can be selected. Possible output is value, which will be the date formatted as specified in SMS preferences. Possible outputs are year, month, day, hour, minute, second.

Keywords:

  • #DAY_DIGIT
  • #DAY_DIGIT_ZERO
  • #DAYS_IN_YEAR
  • #DAY_SHORT_NAME
  • #DAY_LONG_NAME
  • #MONTH_DIGIT
  • #MONTH_DIGIT_ZERO
  • #MONTH_SHORT_NAME
  • #MONTH_LONG_NAME
  • #YEAR_2
  • #YEAR_4
  • #HOUR
  • #HOUR_ZERO
  • #HOUR_24
  • #HOUR_24_ZERO
  • #MINUTE
  • #MINUTE_ZERO
  • #SECOND
  • #SECOND_ZERO
  • #AM_PM
  • #AM_PM_CAPS
Versions 1 (<custom_control_XXXX>), 2
Attributes none
Children unique_name, dependency, default, text_style
Used by item, row, column
Example
<item>
   <text>Start date</text>
   <control_date>
       <unique_name>edtDate</unique_name>
   </control_date>
   <card>
       <card_name>DATE</card_name>
       <export_format>"%s Day:%s Month:%s Year:%s Hour:%s Minute%s 
       Second:%s\n", #card_name, edtDate#DAY_DIGIT, 
       edtDate#MONTH_LONG_NAME, edtDate#YEAR_4, edtDate#HOUR_24, 
       edtDate#MINUTE_ZERO, edtDate#SECOND_ZERO</export_format>
   </card>
</item>


Element <control_density>
Info Displays an edit box and combo box. Combo box can contain kg/m^3, gr/cm^3, lb/ft^3. Possible outputs are value and units.

Keywords:

  • #MPV_MG_PER_L
  • #MPV_G_PER_L
  • #MPV_KG_PER_CU_M
  • #MPV_G_PER_CU_CM
  • #MPV_LB_PER_CU_FT
Versions 1 (<custom_control_XXXX>), 2
Attributes none
Children option, unique_name, dependency, range, default, text_style
Used by item, row, column
Example

Displays kg/m^3 and lb/ft^3 in combo box. If kg/m^3 selected and exported, returns the text “kg m”.

<item>
   <text>Density </text>
   <control_density>
       <option>
          <text>kg/m^3</text>
          <export_text>kg m</export_text>
          <unit_keyword>#MPV_KG_PER_CU_M</unit_keyword>
       </option>
       <option>
          <text>lb_ft^3</text>
          <export_text>lbs ft</export_text>
          <unit_keyword>#MPV_LB_PER_CU_FT</unit_keyword>
        </option>
    </control_density>
 …


Element <control_duration>
Info Displays an edit box and combo box. Combo box contains days, hours, minutes, seconds. Possible outputs are value and units.

Keywords:

  • #TIME_SECONDS
  • #TIME_MINUTES
  • #TIME_HOURS
  • #TIME_DAYS
  • #TIME_WEEKS
  • #TIME_YEARS
Versions 1 (<custom_control_XXXX>), 2
Attributes none
Children option, unique_name, dependency, range, default, text_style
Used by item, row, column
Example Displays only minutes and hours in combo box. If hours selected and exported, returns the text “hrs”.
<item>
   <text>Transport Time Step</text>
   <control_duration>
       <option>
          <text>minutes</text>
          <export_text>min</export_text>
          <unit_keyword>#TIME_MINUTES</unit_keyword>
       </option>
       <option>
          <text>hours</text>
          <export_text>hrs</export_text>
          <unit_keyword>#TIME_HOURS</unit_keyword>
          <default></default>
       </option>
   </control_duration>
 …


Element <control_file_opener>
Info

Push button that opens a file open dialog to select files. Possible outputs are file_path.

Versions 1 (<custom_control_XXXX>), 2
Attributes none
Children filter, create_file, unique_name, dependency, default, text_style
Used by item, row, column
Example Opens a file dialog, filtering on files with *.h5 and *.cmcards extensions
<item>
   <text>File:</text>
   <control_file_opener>
    	<filter>Cmcards file (.cmcards)</filter> 
    </control_file_opener>
…


Element <control_length>
Info Displays an edit box and combo box. Combo box can contain meters, cm, mm, um, ft, in. Possible outputs are value and units.

Keywords:

  • #LEN_MM
  • #LEN_CM
  • #LEN_M
  • #LEN_KM
  • #LEN_INCH
  • #LEN_FT
  • #LEN_YD
  • #LEN_MILE
  • #LEN_UM
Versions 1 (<custom_control_XXXX>), 2
Attributes none
Children option, unique_name, dependency, range, default, text_style
Used by item, row, column
Example Displays only cm, and mm in combo box. If cm selected and exported, returns the text “centimeter”.
<item>
   <text>Length</text>
   <control_length>
       <option>
          <text>cm</text>
          <export_text>centimeter</export_text>
          <unit_keyword>#LEN_CM</unit_keyword>
       </option>
       <option>
          <text>mm</text>
          <export_text>mm</export_text>
          <unit_keyword>#LEN_MM</unit_keyword>
          <default></default>
        </option>
    </control_length>


Element <control_velocity>
Info Displays an edit box and combo box. Combo box can contain m/sec, m/min, m/hours, etc.... Also could be m/sec, cm/sec, ft/sec, etc... The option tag specifies which options are displayed. The edit box will display doubles, within the given range, if provided. Possible outputs are value and units.

Keywords:

  • #VEL_M_PER_S
  • #VEL_KM_PER_H
  • #VEL_FT_PER_S
  • #VEL_MPH
  • #VEL_KNOTS
  • #VEL_CM_PER_S
  • #VEL_MM_PER_S
Versions 1 (<custom_control_XXXX>), 2
Attributes none
Children option, unique_name, dependency, range, default, text_style
Used by item, row, column
Example Displays m/sec and cm/sec in combo box. If m/sec selected and exported, returns the text “m sec”.
<item>
   <text>Velocity </text>
   <control_velocity>
       <unique_name>ccVelocity</unique_name>
       <range>0-100</range>
       <option>
          <text>m/sec</text>
          <export_text>m sec</export_text>
          <unit_keyword>#VEL_M_PER_S</unit_keyword>
       </option>
       <option>
          <text>cm/sec</text>
          <export_text>cm sec</export_text>
          <unit_keyword>#VEL_CM_PER_S</unit_keyword>
        </option>
    </control_velocity>
 …


Element <control_volume_flow>
Info Displays an edit box and combo box. Combo box can contain m^3/sec, m^3/min, m^3/hours, etc.... Also could be m^3/sec, cm^3/sec, ft^3/sec, etc... The option tag specifies which options are displayed. The edit box will display doubles, within the given range, if provided. Possible outputs are value and units.
Versions 2
Attributes none
Children option, unique_name, dependency, range, default, text_style
Used by item, row, column
Example Displays m^3/sec and cm^3/sec in combo box. If m^3/sec selected and exported, returns the text “m^3 sec”.
<item>
   <text>Volume flow</text>
   <control_volume_flow>
       <unique_name>ccVolumeFlow</unique_name>
       <range>0-100</range>
       <option>
          <text>m^3/sec</text>
          <export_text>m^3 sec</export_text>
          <unit_keyword>#VFLOW_CU_M_PER_SEC</unit_keyword>
       </option>
       <option>
          <text>cm^3/sec</text>
          <export_text>cm^3 sec</export_text>
          <unit_keyword>#VFLOW_CU_CM_PER_SEC</unit_keyword>
        </option>
    </control_volume_flow>
 …


Element <coverage>
Info Defines a coverage type for the model.
Versions 2
Attributes z_is_elev
Children coverage_type, point_att, arc_att, polygon_att, material_att, menu_item
Used by model
Example This defines a coverage that can be created.
<coverage z_is_elev = “true”>
 <coverage_type>MyModel</coverage_type>
 <point_att>
   <menu_item>
     <text>Assign BC...</text>
     <link_to>NodeAtt</link_to>
   </menu_item>
 </point_att>
 <arc_att>
   <menu_item>
     <text>Assign BC...</text>
     <link_to>NodestringBC</link_to>
   </menu_item>
 </arc_att>
 <material_att>
   <link_to>MaterialProp</link_to>
 </material_att>
</coverage>


Element <coverage_type>
Info Gives the name to be used for a type of coverage.
Versions 2
Attributes none
Children none
Used by coverage, take_coverage
Example See the coverage example and the takes example.


Element <dataset_name>
Info Determines the name of the dataset to be created. Uses the standard printf and sprintf format (www.cplusplus.com/reference/clibrary/cstdio/printf/). The keywords #row_number, #column_number, #row_name, and #column_name are used when the dataset is in a table.
Versions 1, 2
Attributes none
Children none
Used by control_dataset
Example
<control_dataset>                           
    <dataset_name>”Five percent Layer %d”, #row_number</dataset_name>
	…
</control_dataset>


Element <dataset_type>
Info Determines if the dataset is scalar or vector.
Versions 1, 2
Attributes none
Children none
Used by control_dataset
Example
<control_dataset>                           
    <dataset_type>scalar</dataset_type>
	…
</control_dataset>


Element <default>
Info Sets the initial default value of a widget. Can also be used to state the default combo-box option.
Versions 1, 2
Attributes none
Children none
Used by edit_box, check_box, option, any element that begins with “custom_control”
Example 1
<edit_box>                       	
    <default>1.5</default>
</edit_box >
Example 2 Check box is checked
<check_box>                       	
    <default>checked</default>
</check_box >
Example 3 Check box isn’t checked
<check_box>                   	    
    <default>unchecked</default>
</check_box >
Example 4 Combo box hours is default
<combo_box>
   <option>
      <text>minutes</text>
   </option>
   <option>
      <text>hours</text>
      <default></default>
   </option>
Example 5 Custom control date always has a date formatted as “day-month-year hour:minute:second”.
<control_date>
    <default>16-7-2010 14:45:32</default>
</control_date>


Element <dependency>
Info Dependencies allow widgets to be hidden, dimmed (grayed out), or shown based on the state/value of another widget. The <dependency> tag can be placed in any widget, combo-box option, item, or group. You need to specify the condition that this object is dependent upon and what the value(s) need(s) to be in order for the object to be shown/not dimmed. If the condition is false, by default the control is hidden. To have the control dimmed, use the <dim> tag.
Versions 1, 2
Attributes none
Children condition, dim
Used by card, check_box, text_box, combo_box, table, any element that begins with “custom_control”, edit_box, item, group
Example 1 We only want our edit_box displayed if the check_box is checked (true). If check_box is not checked, we want to dim(show but is grayed out) the edit_box.
<check_box>
    <unique_name>MyBox</unique_name>
…
 
<edit_box>
   <dependency>	
       <condition>MyBox EQUALS CHECKED</condition>
       <dim></dim>
   </dependency>
Example 2 We want our text_box displayed if the edit_box has a value between 0-3 or if the combo box has the value minutes or days.
<edit_box>
    <unique_name>MyEdit_box</unique_name>
…
<combo_box>
    <unique_name>MyComboBox</unique_name>
    <option><text>hours</text></option>
    <option><text>minutes</text></option>
   …
 
 
<text_box>
    <dependency>
        <condition>(MyEdit_box GREATER_THAN_EQUALS 0 AND MyEdit_box 
        LESS_THAN_EQUALS 3) OR (MyComboBox EQUALS “minutes” OR 
        MyComboBox EQUALS “days”)</condition>
   </dependency>
</text_box>


Element <dialog>
Info Used to define a dialog.
Versions 2
Attributes none
Children dialog_name, pages
Used by dialogs
Example


Element <dialog_name>
Info Specifies the name of a dialog. This is required. This name is used by link_to.
Versions 2
Attributes none
Children none
Used by dialog
Example


Element <dialogs>
Info Contains all the dialogs used in a model.
Versions 2
Attributes none
Children dialog
Used by model
Example


Element <display_options_arc>
Info Specifies that the options in the combo box are to be used as arc/nodestring boundary condition display options. This element should only be used once in the schema.
Versions 2
Attributes none
Children none
Used by combo_box
Example


Element <dim>
Info Specifies that when the dependency is false, the widget should be dimmed, not hidden.
Versions 1, 2
Attributes none
Children none
Used by dependency
Example See dependency example.


Element <edit_box>
Info Widget that displays text or numbers. If <type> not specified, default to double.
Versions 1, 2
Attributes none
Children type, default, unique_name, range, optional, dependency, text_style
Used by item, row, column
Example
<edit_box>                       	
   <type>double</type>
   <range>0, 2.2</range>
   <default>1.0 </default>
   <unique_name>edtBox5</unique_name>
   <optional></optional>
   <dependency>…</dependency>…
</ edit_box 


Element <executable>
Info Represents a single executable used by the model.
Versions 2
Attributes none
Children executable_name, input_file, output_file, executable_order
Used by simulation
Example 1
<executable>
   <executable_name>SRH 2D</executable_name>
   <input_file>
     <file_ref>caseFile</file_ref>
     <export_location>"%s", #project_name</export_location>
     <command_args>” -%s", #file_name</command_args>
     <execute>”%s”, #executable_name</execute>
   </input_file>
   <executable_order>1</executable_order>
 </executable>
Example 2 In the following example, one instance of the numeric model is executed per coverage. A file will be exported per coverage and no command line arguments are used when launching the model.
<executable>
   <executable_name>SRH 2D</executable_name>
   <input_file>
     <process_each_coverage>
       <file_ref>caseFile</file_ref>
       <export_location>"%s/%s", #geom_name, #project_name</export_location>
       <execute>”%s - %s”, #executable_name, #geom_name</execute>
   </process_each_coverage>
   </input_file>
   <executable_order>1</executable_order>
 </executable>
Example 3 In the following example, only one instance of the numeric model is executed. A file will be exported per coverage and no command line arguments are used when launching the model.
<executable>
   <executable_name>SRH 2D</executable_name>
   <input_file>
     <file_ref>caseFile</file_ref>
     <process_each_coverage>
       <export_location>"%s/%s", #geom_name, #project_name</export_location>
   </process_each_coverage>
   <execute>”%s”, #executable_name</execute>
   </input_file>
   <executable_order>1</executable_order>
 </executable>


Element <executable name>
Info Defines the name for the executable in the preferences window.
Versions 2
Attributes none
Children none
Used by executable
Example See executable example


Element <executable order>
Info Defines the order in which this executable should run relative to other executables in the same simulation.
Versions 2
Attributes none
Children none
Used by executable
Example In this example, the executable for “My Model Preprocess” will run before “My Model Main” is allowed to start.
<executable>
  <executable_name>My Model Main</executable_name>
  <execuatble_order>1</executable_order>
   ...
</executable>	 

<executable>
  <executable_name>My Model Preprocess</executable_name>
  <execuatble_order>0</executable_order>
   ...
</executable>


Element <execute>
Info Defines when to run an executable. The text of this element is the text that will be displayed as the process name when running the model.
Versions 2
Attributes none
Children none
Used by input_file, anything starting with process_
Example See executable example.


Element <export_format>
Info Placed inside the <card> to determine how the card format will be displayed when exporting to a text file. Uses the standard printf and sprintf format (www.cplusplus.com/reference/clibrary/cstdio/printf/). “#card_name” should be used when displaying the card. When using an element that starts with “custom_control”, you can use the # character to get to the value or units.
Versions 1, 2
Attributes ignore_on_read
Children none
Used by card, export_each_row, export_column(Version 1), export_each_coverage, export_each_polygon, export_each_arc, export_each_point
Example 1
<edit_box>
  <unique_name>MyEditBox</unique_name>
</edit_box>
…
<card>
   <card_name>FIFTH_GRAIN</card_name>
   <export_format>”%s %lf\n", #card_name, MyEditBox</export_format>
</card>
Example 2

If the edit_box has the value of 15, this would print out: FIFTH_GRAIN 15

Example 3

If export_format was changed to this: <export_format>”%s \”%lf\” // comment\n", #card_name, MyEditBox </export_format>

FIFTH_GRAIN “15” // comment

Example 4
<control_length>
  <unique_name>MyLength</unique_name>
  ...
</control_length>
…
<card>
   <card_name>ADAPTATION_LENGTH_TOTAL</card_name>
   <export_format>”%s %lf, %s\n", #card_name, MyLength#value,
                              MyLength#units</export_format>
</card> 

ADAPTATION_LENGTH_TOTAL 25 cm


Element <export_group>
Info A way of grouping optional exports.
Versions 2
Attributes ignore_on_read
Children Any element beginning with “process_” and required.
Used by Any element beginning with “process_”.
Example


Element <export_location>
Info Relative or absolute path of the export file (.cmcards). Can be used multiple times if exporting to more than 1 file location. Keywords can be #PROJECT_NAME and #GEOMETRY.
Versions 1, 2
Attributes none
Children none
Used by link_to (version 1), group, card, input_file (version 2), output_file (version 2). If it used just within group or link_to (version 1), then everything within the element will use the same export location unless specified in the child group or item card.
Example 1
<export_location>\\Ideal__Inlet.cmcards</export_location>
Example 2
<export_location>\\#PROJECT_NAME_#GEOMETRY.cmcards</export_location>

<export_location>”\\%s__%s.cmcards”, #PROJECT_NAME, 
   #GEOMETRY</export_location>


Element <export_optional>
Info Indicator of text that might be included. If it has default as a child, then SMS will write out the text included in this element.
Versions 2
Attributes ignore_on_read
Children Any element beginning with “process_”, export_format, default and separator.
Used by Any element beginning with “process_”.
Example


Element <export_text>
Info Used to write out a different name to the export file than the “text” displayed to the user.
Versions 1, 2
Attributes none
Children none
Used by option
Example We have a combo box and one of the options is Equilibrium which is selected. If the file is exported and the <export_text> card is omitted we would write out:
FORMULATION Equilibrium

However, if we wanted to write out EQ instead, we would use the <export_text> tag. The exported line would look like: FORMULATION EQ

<combo_box>
   <unique_name>formulationUnits</unique_name>
   <option>
       <text>Equilibrium</text>
       <export_text>EQ</export_text>
   </option> 	 
…
   <card>
        	 <card_name>FORMULATION</card_name>
        	 <export_format>"%s %s\n, #card_name, formulationUnits
   </card>     	 
</combo_box>


Element <file_def>
Info file_def
Versions 2
Attributes control_def
Children file_ref, file_type, export_location, card
Used by model
Example


Element <file_type>
Info The file format. Keywords include SEQUENTIAL_ASCII, CARD_ASCII
Versions 2
Attributes none
Children none
Used by file_def
Example


Element <filter>
Info When selecting a file, used to filter the available files by the extension type. The filter tag contains two parts. The first part is the text describing the filter that gets displayed to the user. The second part is a pair of parentheses that contains the actual filter.
Versions 1, 2
Attributes none
Children none
Used by control_file_opener
Example 1 Displays all files with *.cmcards extension
<item>
   <text>Select Some File:</text>
   <control_file_opener>
    	<filter>Cmcards file (*.cmcards)</filter> 
    </control_date>
Example 2 Displays all files
<filter>All Files (*.*)</filter> 


Element <flags>
Info Flags are optional, and are used to modify the behavior/appearance of the control_curve. Only 1 flag is currently defined: XY_USEDATE. When this flag is set, the x column becomes a date/time calendar.
Versions 2
Attributes none
Children
Used by control_curve
Example This example creates a curve button with the date/time flag.
<item>
    <control_curve>
        <unique_name>myCurve1</unique_name>
        <flags>XY_USEDATE</flags>
        <x_column>
           <text>Time
        </x_column>
        <y_column>
   	<text>Velocity</text>   						 
        </y_column>	
    </control_curve>
  …
Element <green>
Info The green 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 <group>
Info Tree group item that contains one or more items or groups.
Versions 1, 2
Attributes none
Children text, item (version 1), dependency, text_style, contains (version 2)
Used by link_to (version 1), page_def (version 2), another <group> if nested (version 1), <contains> (version 2)
Example
<group>
   <text> Timing </text>
   <item>
  	… tree item stuff
   </item>
</group>
Element <input_file>
Info Defines a file to be used for input for an executable.
Versions 2
Attributes none
Children file_ref, export_location, execute, command_args, process_each_row, process_each_coverage, process_each_material
Used by executable
Example See executable example.
Element <italic>
Info Sets the text to be italicized. Added in SMS 11.2.
Versions 1, 2
Attributes none
Children none
Used by text_style
Example This would italicize 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>
      <italic></italic>
      <condition>edtA LESS_THAN 0.0</condition>
  <text_style>
</edit_box>


Element <item>
Info Tree item contains one or more widgets (combo_box, text_box, edit_box, etc). A tree item can contain multiple cards (version 1), but those cards must be mutually exclusive.
Versions 1, 2
Attributes none
Children text, card, dependency, text_box, edit_box, check_box, combo_box, table, any element starting with “custom_control”, text_style
Used by group
Example
<item>
     <text>Transport Time Step</text>
     <edit_box>…. </edit_box>
     <card>…</card>


Element <link_to>
Info Determines which dialog definition we are linking to.
Versions 2
Attributes none
Children none
Used by menu_item, material_att
Example
<simulation>
  <menu_item>
    <text>Model Control...</text>
    <link_to>SRHModelControl</link_to>
  </menu_item>
</simulation> 

<page_def>
    <page>SRHModelControl</page>
    <group>
      <contains>
      …<item>...</item>
      </contains>
    </group>
</page_def>


Element <max_rows>
Info Optional element used to limit the number of rows the user can specify in a control_curve. If this element is not used, the max_rows is unlimited.
Versions 2
Attributes none
Children none
Used by control_curve
Example This example creates a curve button with the date/time flag.
<item>
    <control_curve>
        <unique_name>myCurve1</unique_name>
        <max_rows>10</max_rows>
        <x_column>
           <text>Time
        </x_column>
        <y_column>
     	   <text>Velocity</text>   						 
        </y_column>	
    </control_curve>
  …


Element <menu_item>
Info Item to be placed in a menu. The text is the text displayed in the menu, link_to describes the dialog to be launched, dependency describes what needs to be true in order for the menu item to appear.

The double_click attribute (if true) indicates that this is the menu item to be launched on a double-click event. For example, if a menu_item is in an arc_att, and has double_click = “true”, then when an arc is double clicked, the dialog specified by the menu item is launched.

Versions 2
Attributes double_click
Children text, link_to, dependency
Used by simulation, attribute_set (version 3), coverage, point_att, arc_att, polygon_att, material_att
Example See the model example.