User:Jcreer/SNS:DMI Exporting/Importing Elements: Difference between revisions

From XMS Wiki
Jump to navigationJump to search
No edit summary
Line 172: Line 172:
     </card>     
     </card>     
  </combo_box>
  </combo_box>
|}
=====Element ''<process_each_arc>''=====
{|class="wikitable"
|-
|width="70"|'''Info'''
|width="530"| Indicator to loop through each arc in the given context. 
|-
|'''Versions'''
| 2
|-
|'''Attributes'''
|ignore_on_read
|-
|'''Children'''
|width="530"| [[SMS:Dynamic Model Interface Schema#Element <card_name>|card_name]], [[SMS:Dynamic Model Interface Schema#Element <export_format>|export_format]], [[SMS:Dynamic Model Interface Schema#Element <separator>|separator]], [[SMS:Dynamic Model Interface Schema#Element <process_each_point>|process_each_point]], end_card, use_parameter, declare_parameter
|-
|'''Used by'''
| width="530"| [[SMS:Dynamic Model Interface Schema#Element <card>|card]], [[SMS:Dynamic Model Interface Schema#Element <process_each_coverage>|process_each_coverage]], [[SMS:Dynamic Model Interface Schema#Element <process_each_polygon>|process_each_polygon]]
|-
|'''Example '''
|width="530"|
|}
|}

Revision as of 22:09, 3 March 2015


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”, a user can use the # character to get to the value or units.
Versions 1, 2
Attributes ignore_on_read
Children none
Used by card
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 group, card, input_file, output_file. 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, 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 <process_each_arc>
Info Indicator to loop through each arc in the given context.
Versions 2
Attributes ignore_on_read
Children card_name, export_format, separator, process_each_point, end_card, use_parameter, declare_parameter
Used by card, process_each_coverage, process_each_polygon
Example