MCE processes sequences of time-variant data. Each time-value pair within this data is a Data Point, and each sequence of them is a Data Point List.
A Data Item owns a single Data Point List, providing properties including name and an equation for applying to each Data Point in the Data Point List if applicable. As well as having implicit Data Item dependences, Data Item equations can also refer to the Data Point Lists of other Data Items.
With these concepts in mind, the work of MCE can be summarised as
- Interpreting Data Item equations and processing their Data Point Lists.
- Monitoring dependencies between Data Items.
- Caching and storing Data Item properties and their Data Point Lists.
The Data Point and Data Point List
Property | Description | Example |
Value | A numeric value | 12.345 |
Time | Time the value applies to. | 12:57:34 17-03-2008 |
Interpolated Flag | Set if the value has been derived due to insufficient data available | True |
A Data Point list is a time-ordered collection of these Data Points. All calculations are performed at a Data Point List (i.e. time range) or Data Point (i.e. point-in-time) level. The concepts of Data Items and Meters are responsible for the state, behaviour and properties of the calculations performed.
There are a number of properties and functions available on a Data Point List that are defined here.
The Data Item
A Data Item contains all of the information required to process its Data Point List. There are two fundamental types:
Calculations
Calculations are broken up into two stages. The first stage involves determining the times at which Data Points should exist, referred to as Data Item Calculation. The second stage calculates the value (and interpolated flag) of each Data Point, known as Value Calculation.
The logic of the Data Item Calculation stage is defined by a Data Item Calculator Template file. The Value Calculation Stage also has its own Value Calculator Template file, which combined with an equation defines value calculation logic. Both templates are uncompiled, human-readable code files which can be modified or replaced to suit a particular Data Item calculation requirement.
Equations
An equation is a textual description of logic to apply to each Data Point in the owned Data Point List. A multitude of functions are available, including those available from the Value Calculator Template, Data Point List, and Microsoft .Net libraries.
Dependencies
A Calculated Data Item has dependencies on other Data Items if it references their data in either of its calculation stages . Such references are referred to as Child Data Item references. The collection of Child Data Items referenced by a Data Item is referred to as the Consumed List. Conversely, the collection of Data Items that reference a specific Data Item is the Consumer List.
Dirty Storage State
Calculated Data Item calculations are only performed when its Data Point List is requested. Once calculated, the data is cached for performance and stored. Re-calculations are only performed when the Data Point List is requested and it is considered to be in a Dirty state. The data is marked dirty when:
- Data Item properties are changed that could affect calculations
- Child Data Items are dirtied
Property | Description | Example |
Name | Data Item full name. | Company1|Site1|Meter1|CALC |
IsCalculated | Flag indicating whether the Data Item is calculated (Calculated Data Item) or contains raw data (Raw Data Item). | True |
Equation | The equation used on each Data Point in the owned Data Point List. This is empty if a Raw Data Item. | [CALC1].GetValueAtTime(Time) * 10 |
Equation Error | A description of detected equation errors. This is empty if the equation is valid or not set. | At least one child Data Item must be referenced within the equation. |
DataItemCalculatorTemplate | The code file used to create the owned Data Point List. This is empty for Raw Data Items. | CalculatedDataItemCalculatorTemplate |
ValueCalculatorTemplate | The code file used to calculate the value of each Data Point within the Data Point List. This is empty for Raw Data Items. | StandardValueCalculatorTemplate |
IsStorageDirty | Flag indicating whether storage is dirty. If dirty, the owned Data Point list is re-calculated when required. This only applies to Calculated Data Items. | True |
IsReadOnly | Indicates whether the equation can be modified. This only applies to Calculated Data Items. | False |