Skip to main content

Model Actions

Model actions are complex data actions designed to be used with the XINA Data Model Standards.

MODEL_MN_IMPORTMODEL_TM_IMPORT

The MODEL_MN_IMPORTMODEL_TM_IMPORT action mnemonic data forimports a singletelemetry modelfile into XINA.a model.

database specifier (optional, default <model>.data.mn.full)fortimeoverlapwithdatabase, ignore, (optional, default fail)
Property ValueRequired
action "model_mn_import"model_tm_import"yes
model model group specifieryes
object_id object ID of CSV data file
ttime data type (optional, default to model type)yes
mn_databaseformat mnemonicstring yes
on_overlapconf behaviorjsonobject no
u_id UUID no
failmeta, deletejsonobject, no

Unlike standard XINA insert operations, this action can have impacts across multiple databases. The imported data file must contain three columns:

columndescription
t / timetime
mn / mn_id / mnemonic / hk / hk_id / name / labelmnemonic name or ID
v / valuevalue, empty string, or null

The time column may either be a zoned ISO8601 timestamp or Unix time. If Unix time it will be interpretted according to the type set to t in the action.

If the mn column is an integer it will be interpretted as a literal mnemonic ID. Otherwise the name will be parsed from this format:

<name>[(<unit>[;n0=v0|n1=v1|...])]

<name> will be used for the mnemonic name lookup. The comparison is case insensitive and any whitespace is treated as a single underscore. <unit> is optional. If provided, it must match the unit of an associated mnemonic definition, otherwise an error is thrown. The section after unit defines discrete value mapping.

When a data set is imported the XINA server will run the following steps:

  • For each row:
    • validate time and value
    • process mnemonic
      • If mnemonic ID
        • If found in definitions database:
          • If mnemonic is deprecated, throw error
          • Else, use mnemonic for row
        • Else, throw error due to unrecognized ID
      • Else, parse name and optional unit
        • If name match found:
          • If unit is provided and does not match, throw error
          • If mnemonic is deprecated, throw error
          • Else, use mnemonic for row
        • Else, mnemonic is new, create new temporary mnemonic definition based on provided information
  • If any rows contain same mnemonic and time, throw error
  • Check for time overlap in database
    • If found
      • If on_overlap = fail, throw error
      • Else If on_overlap = delete, delete all data from database in time range of imported data
      • Else (on_overlap = ignore), do nothing
  • If new mnemonic definitions created, insert into mnemonic definition database
  • Insert data into mnemonic database

MODEL_MN_MERGE

ExamplesThe MODEL_MN_MERGE action merges one or more existing mnemonics into a single existing mnemonic.

MODEL_INT_OPEN

The MODEL_INT_OPEN action opens one or more intervals in a model.

MODEL_INT_CLOSE

The MODEL_INT_OPEN action closes one or more intervals in a model.