Breadcrumbs

Configuring General Resources for histories

General resources are heavily used with history interfaces. We want the interface to pick the right parameters automatically to avoid classic Niagara headache to create a chart. Remember something? (smile)

image2019-3-4 19:57:6.png

When we select "Hot water consumption", we want to end up with a column chart with a sum aggregation and in red (because it's hot) whereas a temperature should appear as green and as a Line Chart and with an average yAggregation.

All should be automatic and this is precisely the role of the General Resources in this case.

Basically we're going to add tags to points and histories to describe how charts should be built, which parameters it should use (aggregation, color, delta, .etc). Tags will depend on the assignation to the model. Each time we assign a point to the model, it will look for the right GeneralResource, according to a mapping with the model, and decide which tag it should add to the point and to the history.

The "consumption" example

 A classic example. So, let's say a consumption should:

  • Be always represented as columns (or bars)

  • Have a computed delta (get the difference between two consecutive values)

  • Use a sum aggregation for the y axis (we want to sum the consumption per month when visualizing a year)

  • Have a color depending on the source (gaz should be purple, electricity yellow and water blue)

 

Open the General  Resource folder

image2019-3-4 20:12:45.png

There are 4 main General Resources.

 

GraphType

We'll start with the Graph Type. Open the corresponding definition.

Enable the Resource Definition at the top.

Then, from the btibCore palette (or btibElasticsearch palette), add three ChartType resources to the definition and name them:

  • Column

  • Line

  • Area

image2019-3-4 20:17:35.png        image2019-3-4 20:17:54.png

Add the Nature aspect if you want to play the same example, or choose your own Nodes otherwise.

 

Select with the folder arrow -> Hierarchy chooser. Then select in the Nature hierarchy, in the Dimension folder, the "Energy" Node.

image2019-3-4 20:22:4.png

Then go to a point in your station.

  • Add an history extension if it doesn't have one yet.

  • Add an InfoSource from btibStructure

  • Assign the point to the Energy Node

image2019-3-4 20:25:24.png

  • Save the view

  • Check the tag in the InfoSource, in the point or in the HistoryExtension:

image2019-3-4 20:26:45.png

There is now a tag to define which type of chart should be used to show the history of this point.

 

yAggregation

Repeat the same operation for the yAggregation.

image2019-3-4 20:28:17.png

 

Delta

And for the delta

image2019-3-4 20:31:0.png

Color

Careful, we said we wanted blue for water, yellow for Electricity... So we need another mapping. So add a shadeResource from the palette.

Wait.... Why is it called a ShadeResource? When you want to display one consumption, one color is enough but when you want to show many "Electricity consumption", you don't want to show the same color. This is why we're defining a shade of colors. Define a couple of colors for the resource and create the mapping to Electricity. Then add a new resource for Water etc.

If you don't to bother so much, there pre-defined shades in the btibElasticsearch palette.

image2019-3-4 20:37:31.png

 

Then go back to the point and assign it to "Electricity". You will get the right tags.

image2019-3-4 20:38:31.png

 

So when you display it in the ChartCreator or in a FlexPane card:

image2019-3-4 20:42:34.png