Simulation result definition


<< Click to show table of contents >>

Navigation:  Connection to Plant Simulation >

Simulation result definition


Simulation results are gathered and encoded for transfer within [SimJSONCtrl.]SimJSONResult.

The preferred way to define simulation results would be within the subclass within SimUIObjects_Public to have the settings transferable to other plant simulation models.

Result data are transferred within tables and visualized in the front end in widgets within result sections.

 

Contents

1. Registering of simulation result tables

2. Definition of simulation result view sections and widgets

 2.1 Widget definition

 2.2 HTML-Result definition

 

 

1. Registering of simulation result tables

Result tables can be (statically or dynamically via interface method) entered within tblStatisticDataTableDef with following attributes

Besides static definition, the flexible way of adding simulation results would be through the interface method m_AddStatisticTableDef with parameter for the same table columns.

nodeName: unique result data (table) node name

active: table will be exported for results

category: stat-table, only category for now

statisticsTable: string-path to either a table object within a frame or a sub table within a table object

adjustUserMethod: object path to a user method to be executed after transfer into the result frame SimJSONResult

dynamicCreatedEntry: Boolean to indicate whether this entry was created by interface method dynamically

 

 

2. Definition of simulation result view sections and widgets

Result view sections are defined within the table tblResultViewSectionDef either through entry or through interface-method.

 

Within this table following definitions are set:

class: unique simulation result section id

title_localization_key: localization id for the title (within SimJSONResult.t_Localization)

text_localization_key: localization id for the subtitle (within SimJSONResult.t_Localization)

widgets: sub-table with definition of widgets:

oclass: unique widget overall in result view

otitle_localization_key: title of widget with key to localization table

otitle_localization_table: title as a table with columns for the different languages

onodeName: nodeName of the corresponding result table node with its entries

owidgetDefinitionID: refers to a widget definition within tblResultViewWidgetDef; enables the standardization of widgets to be used for many different data visualizations of the same type with the same result data structure

showFromBeginning: indicate that a section should be open directly at loading the result page within the front end

 

In general, it is recommended to dynamically code the addition of result views and widgets via interface methods:

m_AddResultViewSectionDef: adds a result view section definition with above mentioned data

m_AddWidgetToSection: adds a result view widget to an already defined (either static or per interface method) result section

 

 

2.1 Widget definition

General widget types (and referred to by the above mentioned widgetDefinitionID) can be defined within tblResultViewWidgetDef with the following columns:

widgetDefinitionID: id for the widget

type: widget type

obar [chart]

oline [chart]

ostackedBar

odataGrid: table visualization

opivotGrid: dataGrid with integrated comparison between alternatives

ohtml: html data visualization within one specific result view node

otimeline: represents the commonly referred to as “Gantt”-visualization; (“gantt” is within the underlying technology with DevExtreme similar to a project plan)

seriesColumn: the column in the result table to reference the data series (also displayed in the legend on the right-hand side)

xAxisColumn:

ocolumn in the result table for the x-axis

oNote that currently a date time x-Axis is not automatically implemented; therefore, values should be encoded in result tables in string the ways they should be displayed

xAxisSorting: e.g. “natural”, indicates the sorting of the x-axis; only current application: histogram with x-axis to be sorted like “[0,5], ]5,10] …”

yAxisColumn: column in the result table for the y-axis

titleColumn: only for type: timeline, column for the title for a line entry

startDateColumn: only for type: timeline, column for the start date time for a line entry (underlying result table column has to be of type date time; this will automatically be encoded to the correct JSON format)

endDateColumn: only for type: endDateColumn, column for the end date time for a line entry (underlying result table column has to be of type date time; this will automatically be encoded to the correct JSON format)

htmlTemplate: only for type: html; optional, can be used when a template should be applied to a given html result data within a result table

options: id for JSON options for this widget definition, refers to an entry within tblResultViewOptionsDef; e.g. general options for a widget like max. for y-axis or background, tick marks etc.

seriesOptions:

oid for JSON series options for this widget definition, applied to data series defined within the column referred to in seriesColumn, refers to an entry within tblResultViewSeriesOptionsDef

oe.g. for visualization options for every entry of the data series “working” with a green visualization

showFromBeginning: open the widget when opening the result view in the frontend, similar to the option of the whole section

 

Necessary columns for exemplary widget definition within:

dataGrid:

ooptionsID optional

bar/line:

oseriesColumn

oxAxisColumn

oyAxisColumn

ooptionsID optional

oseriesOptionsID optional

html:

ohtmlTemplate optional

timeline:

oseriesColumn

oyAxisColumn

otitleColumn

ostartDateColumn

oendDateColumn

oseriesOptionsID optional

 

 

2.2 HTML-Result definition

Two possible ways to define a html-result node within the result view:

(1) a single html-valid result data node within a result table

(2) a result table with column values to fill placeholder within a htmlTemplate

 

Variant 1):

Define a result table with one column (column-name “html”) and one row. Fill this single cell with a valid html-definition. The corresponding widget would only have the definition for type=”html”, no html-template is needed.

 

Variant 2):

Define a result widget with type =”html” and a html-template, e.g.

 

<h1 style='color:{{headlineColor}}'>{{headlineText}}</h1><ul> 

 <li>{{text_1}}</li><li>{{text_2}}</li></ul>

 

The corresponding result table need then a column index with column names corresponding to every placeholder, indicated by “{{..}}”.

So in given example define a table with 4 columns (:string): headlineColor, headlineText, text_1, text_2.

The values of the first row of each column will be placed at the placeholder in the html at the front end.

With this you can define a result node in html and load certain table values for different alternatives.

 

 


© SimPlan AG - Hanau District Court, Commercial Register (Part B) 6845 - info@simplan.de - www.simplan.de