Table (Named Data Type)

From wiki.fine.cz
Jump to navigation Jump to search

Used to store tables with multiple rows. Items define columns, which can be of any item type.

Template XML definition

Common Properties

Property Template XML Description Presence Default
Settings [E] Settings required
    Table type     [A] ENUM TableType Table type {[V] General,[V] Depth,[V] DepthNoDuplicates,[V] Thickness,[V] DepthFromTo,[V] DepthFromToNoDuplicates,[V] DepthFromToOptionalDepthTo,[V] Attachments} optional General
Item [:E:] Item List of column definitions of any type including Table required
    Visibility in table views     [A] BOOL Hidden Column is hidden in table view (but data are visible while editing table row) optional false
Range [E] Range optional
    Minimal number of rows     [A] INT MinRows Minimal number of rows user must enter optional 0

Table types have some obligatory columns according to following table:

Table type Enum value Sorting Column name Column Special Column type Note
Table with arbitrary columns [V] General No sorting, rows can be swapped and inserted No arbitrary columns
Table with Depth column [V] Depth Sorted in ascending order by Depth,

if rows have duplicate Depth, can be swapped

Depth Double_Depth Double
Table with Depth column,

no duplicate depths allowed

[V] DepthNoDuplicates Sorted in ascending order by Depth Depth Double_Depth Double
Table with layers defined by its thickness [V] Thickness No sorting, rows can be swapped and inserted Thickness Double_Thickness Double Thickness is defined in data, but user can optionally enter Depth to (Depth from is visualized, starting from 0.0)
Table with depth intervals from-to [V] DepthFromTo Sorted in ascending order by DepthFrom,

if equal, then by DepthTo

Depth from Double_DepthFrom Double It is possible to have gaps between rows, intervals can overlap
Depth to Double_DepthTo Double
Table with depth intervals from-to,

no duplicate depth ranges allowed

[V] DepthFromToNoDuplicates Sorted in ascending order by DepthFrom Depth from Double_DepthFrom Double It is possible to have gaps between rows, intervals cannot overlap
Depth to Double_DepthTo Double
Table with depth intervals from-to,

depth to is optional

[V] DepthFromToOptionalDepthTo Sorted in ascending order by DepthFrom,

if equal, then by DepthTo, if exists

Depth from Double_DepthFrom Double User can enter interval or depth only
Depth to Double_DepthTo Double
Table for attachments referencing [V] Attachments No sorting, rows can be swapped and inserted Name String_CommonIdent String Table used to store attachments references
File File

Example of Template XML

<Item ID="{21DA2A83-A06A-40CA-8ACF-6FB8C593CC3D}" ItemType="Table">

  <Name ... />

  <Settings TableType="Thickness" />

  <Item ID="{94D6458E-3A0C-4157-B5EF-5793907A78FC}" ItemType="Double">

    <Name Lang="CS" Text="Mocnost" />

    <Settings Symbol="t" UnitType="Length" UnitDefMetric="m" DecimalDigitsMetric="2" ExponentMetric="false" />

  </Item>

  <Item ID="{2CDBAE53-1285-44FB-874B-BE512C0C22F6}" ItemType="String">

    <Name Lang="CS" Text="Název zeminy" />

    <Settings />

  </Item>

  <Item ... />

</Item>

Data XML definition

Common Properties

  • Table has no specific attributes
  • It has sub-elements of type Row, which have sub-elements of type Item defined by Template columns

Example of Data XML

<Item ID="{21DA2A83-A06A-40CA-8ACF-6FB8C593CC3D}">

  <Row>

    <Item ID="{94D6458E-3A0C-4157-B5EF-5793907A78FC}" DblValue="0,50" Unit="Length_m" />

    <Item ID="{2CDBAE53-1285-44FB-874B-BE512C0C22F6}" StrValue="gravel" />

    <Item ... />

  </Row>

  <Row>

    <Item ID="{94D6458E-3A0C-4157-B5EF-5793907A78FC}" DblValue="1,50" Unit="Length_m" />

    <Item ID="{2CDBAE53-1285-44FB-874B-BE512C0C22F6}" StrValue="sand" />

    <Item ... />

  </Row>

  <Row .... />

  <Row .... />

</Item>