User:Jcreer/SMS:DMI File Definitions Elements: Difference between revisions

From XMS Wiki
Jump to navigationJump to search
Line 48: Line 48:
|'''Example'''
|'''Example'''
|
|
|}
=====Element ''<export_format>''=====
{|class="wikitable"
|-
|width="70"|'''Info'''
|width="530"| Placed inside the [[SMS:Dynamic Model Interface Schema#Element <card>|<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'''
|width="530"| none
|-
|'''Used by'''
|width="530"| [[SMS:Dynamic Model Interface Schema#Element <card>|card]]
|-
|'''Example 1'''
|width="530"|
<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'''
|width="530"|
If the edit_box has the value of 15, this would print out:
FIFTH_GRAIN 15
|-
|'''Example 3'''
|width="530"|
If export_format was changed to this:
<export_format>”%s \”%lf\” // comment\n", #card_name, MyEditBox
</export_format>
FIFTH_GRAIN “15” // comment
|-
|'''Example 4'''
|width="530"|
<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
|}
|}

Revision as of 22:18, 4 March 2015

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, anything beginning with “process_each_”, export_group, export_optional
Used by file_def
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