Chart module documentation

Chart

Chart represents a TimeSeriesChart instance in Simantics ontology (http://www.simantics.org/Charts-1.2/TimeSeriesChart). Instances of Chart can be used as a parameter in SCL functions.

createChart :: Resource -> <Proc> Resource

Creates a new Chart to the default Charts folder under the given Model parameter. Returns the created Chart.

createChartInGroup :: Resource -> <Proc> Resource

Creates a new Chart under the given ChartGroup parameter. Returns the created Chart.

chartsOf :: Resource -> <ReadGraph> [Resource]

Browses the given Model for its Charts and then returns them in a list.

ChartItem

ChartItem represents an Item instance in Simantics ontology (http://www.simantics.org/Charts-1.2/Chart/Item). Instances of ChartItem can be used as a parameter in SCL functions.

addChartItems :: Resource -> Variable -> <WriteGraph> Resource

Creates new chartItem with the given Variable to the given Chart and returns the created ChartItem. New Subscription item is created at the same time.

linkSubToChart :: Resource -> Resource -> <WriteGraph> Resource

Links the given Subscription to the given chart and returns the created ChartItem.

ChartGroup

ChartGroup represents a ChartGroup instance in Simantics ontology (http://www.simantics.org/Charts-1.2/ChartGroup). Instances of ChartGroup can be used as a parameter in SCL functions.

createChartGroup :: Resource -> <Proc> Resource

Creates a new ChartGroup under the given Model parameter. Returns the created ChartGroup.

Export subscription data as CSV

data CSVExportPlan

Example of construction:

plan = CSVExportPlan {
    startTime = 0.0,
    timeStep = 1.0,
    decimalSeparator = decimalSeparatorFromString ".",
    columnSeparator = columnSeparatorFromString ",",
    resample = True,
    samplingMode = exportInterpolationFromString "lerp",
    timeDigits = 7,
    floatDigits = 9,
    doubleDigits = 15
}
CSVExportPlan :: Double -> Double -> DecimalSeparator -> ColumnSeparator -> Boolean -> ExportInterpolation -> Integer -> Integer -> Integer -> CSVExportPlan
data SubscriptionCSVExportPlan

Example of construction:

plan = SubscriptionCSVExportPlan {
    modelName = "Model",
    filePath = "D:/folder/output.csv",
    subscriptionNames = ["Default"],
    exportPlan = CSVExportPlan {
        startTime = 0.0,
        timeStep = 1.0,
        decimalSeparator = decimalSeparatorFromString ".",
        columnSeparator = columnSeparatorFromString ",",
        resample = True,
        samplingMode = exportInterpolationFromString "lerp",
        timeDigits = 7,
        floatDigits = 9,
        doubleDigits = 15
    }
}
SubscriptionCSVExportPlan :: String -> [String] -> String -> CSVExportPlan -> SubscriptionCSVExportPlan
exportSubscriptionsCSV :: SubscriptionCSVExportPlan -> <Proc> ()

Exports subscription data as CSV values in a similar manner as the CSV Exporter provided by the user interface.

The produced export will be encoded using the system default encoding which is initialized from the java.encoding JVM system property. You can use java -XshowSettings:all -version to see the default settings for any JVM.

Example of usage:

exportSubscriptionsCSV SubscriptionCSVExportPlan {
    modelName = "Model",
    filePath = "D:/folder/output.csv",
    subscriptionNames = ["Default"],
    exportPlan = CSVExportPlan {
        startTime = 0.0,
        timeStep = 1.0,
        decimalSeparator = decimalSeparatorFromString ".",
        columnSeparator = columnSeparatorFromString ",",
        resample = True,
        samplingMode = exportInterpolationFromString "lerp",
        timeDigits = 7,
        floatDigits = 9,
        doubleDigits = 15
    }
}
exportSubscriptionsCSVWithCharset :: SubscriptionCSVExportPlan -> String -> <Proc> ()

Exports subscription data as CSV values similarly to exportSubscriptionsCSV but requires also explicitly specifying the output CSV text encoding.

Some usual encodings include:

  • "UTF-8"
  • "US-ASCII"
  • "x-UTF-16LE-BOM"
    • Excel-compatible 16-bit unicode text

but any other JVM-supported character set name can be provided as well.

columnSeparatorFromString :: String -> <Proc> ColumnSeparator

Possible arguments are:

Comma (,)
Tabulator (\\t)
Semicolon (;)
Colon (:)
Space ( )
decimalSeparatorFromString :: String -> <Proc> DecimalSeparator

Possible arguments are:

Dot (.)
Comma (,)
exportInterpolationFromString :: String -> <Proc> ExportInterpolation

Possible arguments are:

Linear Interpolation (lerp)
Previous Sample (previous)

Undocumented entities