ItemTrendPopup
- Last UpdatedJan 18, 2024
- 6 minute read
The ItemTrendPopup node displays a graphic that plots up to three variables values against time.
-
The ItemTrendPopup node inherits from Item to support 2D trend visualization.
-
The trend does not currently support interaction. It has no collision and selection meshes.
-
Therefore, trend instances do not trigger Item action events, such as actionPerformed, leftPerformed, rightPerformed upPerformed, downPerformed.

Platform support
This node is supported on XR-Windows platform only.
|
XR-WIN |
XR-P-WIN |
XR-P-IOS |
XR-P-AND |
XR-P-WASM |
|---|---|---|---|---|
|
Full support |
No support |
No support |
No support |
No support |
|
|
|
|
|
|
3D or 2D visualization
A trend node can be visualized either:
-
As a 3D object placed in the scene.
-
As a 2D overlay by a TrendViewer node.
Use the mode to select the desired visualization mode.
Within in a single project, trends can be all 2D, all 3D, or mixed.
Although ItemTrendPopup is a 3D node with mesh and coordinates, its data can be used as source for the TrendViewer.
Variables and axis
-
Each of the three variables is plotted according to its scale (varX_min - varX_max).
-
The scale axis can be visualized using the varX_showAxis. The color of the axis matches the color of the variable.
-
You might want to hide one or more scale axis when two or more variables have the same scale range. For example, three pressures of the same type of instrument. Each variable is plotted according its range, so this must also be defined.
-
When varX_show is set to false, the variable is not plotted and its scale axis is not shown independently from varX_showAxis value.
Autoscale
When autoscale is activated, the variables scale range is replaced by another range that is calculated in real time according to the variable series values.
|
Option |
Description |
|---|---|
|
Variable with axis shown |
When autoscaling a variable whose scale axis is shown, the new range is calculated based on the higher and lower values in the variable series (varX_data). |
|
Variable with axis not shown |
If a variable does not appear, its axis when autoscaling its values is evaluated together with those of var0. |
For example, if there are for example three variables plotted but just var0_axis set to true, when autoscaling the new range is calculated basing on the lower and higher values of all the three value series.
Reset on IC loading
Sometimes, due to process simulation IC loading, the simulation time moves suddenly from one time to another.
Since the trend displays only values coming in real time with no historian values, the display of the variables plot must be reset after such time jumps.
By default, the system performs an automatic reset of the trend plot when:
-
The new sample time is before the previous one (simulationState.simulationTimer moved backward).
-
The time span between .two samples is more than 10 seconds (simulationState.simulationTimer jumped forward).
Code example
This is a code example for the ItemTrendPopup node.
<ItemTrendPopup name="trend1" timeSpan="1200" var0_min="0" var0_max="100" var0_show="true" var0_name="FI2532" var0_color="1 1 1" var0="0" var1_show="true" var1_name="FI2533" var1_color="0 1 0" var1="0" var2_show="true" var2_name="FI2534" var2_color="1 0 0" var2="0" position="10.15261 0.4274013 4.099928" scale="0.7 0.7 0.7" orientation="1.54 0" />
Default actions
The default actions for ItemTrendPopup.
|
Action |
Hotkey |
Text |
Description |
|---|---|---|---|
|
close |
X |
Close |
Hides the displayed trend. |
ItemTrendPopup fields
These are the fields for ItemTrendPopup node. Only the node-specific fields are indicated, not fields obtained by inheritance.
Field inheritance: NodeBase > NodeBaseMovable > Item > ItemTrendPopup
The trend popup has a set of fields that belongs to the panel and a set relative to each variable (var0, var1, var2) that can be displayed in the panel.
|
Fields |
Type |
Use |
Default value |
Description |
|---|---|---|---|---|
|
antialias |
sbool |
Optional |
false |
Improves text and lines aspect using the anti-alias in the plot procedure. |
|
autoscale |
sbool |
Optional |
false |
Set to true to show automatic scale based on values effective minimum and maximum instead of default scale. |
|
axisXP1 |
sfloat |
Optional |
60 |
Defines distance in seconds for dents on the time axis (X). |
|
axisXP2 |
sfloat |
Optional |
1 |
Defines interval in dents for vertical line drawing. Set to 1 to trace a line for every dent. |
|
axisYDrawItems |
sint |
Optional |
1 |
Defines how many dents to draw on the variable axis (X). The values associated to dents are calculated on the range of the var0. When presenting more than one variable inside a trend popup, they have the same range. |
|
clear |
sevent |
Optional |
Not set |
Clears trend contents. |
|
maxDistanceVisible |
sfloat |
Optional |
20 |
At this distance (between trend and camera) the trend is no longer updated, because it is not readable from the user. |
|
mesh |
sstring |
Optional |
Auto-populated |
Name of the texturized mesh. Can be overridden if the item does not support naming convention. |
|
mode |
senum |
Optional |
Popup3D |
Specifies whether this trend is displayed in 2D overlay or placed at a 3D coordinate. |
|
mwxTemplate |
sstring |
Optional |
simulazione\trend_popup.mwx |
Can be overridden to use a different source MWX than standard one. |
|
orientation |
svec2 |
Optional |
0 0 |
Defines popup orientation (yaw and pitch). |
|
penSize |
sfloat |
Optional |
1 |
Trend line pen size. |
|
position |
svec3 |
Optional |
0 0 0 |
Defines popup position inside the scenario. |
|
scale |
svec3 |
Optional |
1 1 1 |
Enables scaling of the popup. |
|
texture |
sstring |
Optional |
Auto-populated |
Name of the texture to be dynamically drawn. It must correspond to the name of the texture referenced in the MWX object. This parameter should be not modified except in rare cases. |
|
textureImage |
sstring |
Optional |
Changes the texture used as base to draw. |
|
|
textureRefreshTime |
sfloat |
Optional |
0.5 |
Minimum time interval in texture update (0.5 means 2 FPS). |
|
timeSpan |
sfloat |
Optional |
1200 |
Time axis (X) interval, in seconds. |
|
visible |
sbool |
Optional |
false |
The popup visibility state. Can be read and written. |
Variable fields
The variable fields for ItemTrendPopup.
|
Fields |
Type |
Version |
Use |
Default value |
Description |
|---|---|---|---|---|---|
|
varX |
sfloat |
Optional |
0.5 |
Variable values to be plotted. Route it from an SFLOAT source. |
|
|
varX_color |
svec3 |
Optional |
1 1 1 |
Defines trend line color for the variable. The Y axis also displays with this color. Values are expressed in normalized (0-1) RGB. |
|
|
varX_data |
sfloat |
Read only |
Internally calculated |
Lists all the values currently displayed for the variable. |
|
|
varX_min |
sfloat |
Optional |
0 |
Y axis min value. |
|
|
varX_max |
sfloat |
Optional |
1 |
Y axis max value. |
|
|
varX_name |
sstring |
Optional |
"" |
Display name for the variable. |
|
|
varX_show |
sbool |
Optional |
True |
Shows/hides a variable inside the trend popup. |
|
|
varX_showAxis |
sbool |
2.3 |
Optional |
True |
Enables display of variable Y Axis. Even if the axis is not displayed, the variable is plotted according to its scale. |
|
varX_source |
sstring |
2.5 |
Optional |
Links trend to a variable. It is an alternative way to route a trend value to varX. Set the value and not the field. For example: @item.value@. |
|
|
varX_uom |
sstring |
2.3 |
Optional |
"" |
Unit of measure associated to the measure. |