Operation

The purpose of the Operations Cache is to load the configuration of an ACO operation, which is fairly static into memory, so that commonly reused items such as column definitions, views and related location twins are quickly accessible.

OperationsCache Class

class ClientSDK.CacheHelper.OperationCache

InitializeAsync

Loads the operation cache.

  • Required Role(s): Any

ClientSDK.CacheHelper.OperationsCache.InitializeAsync()
Return type

Task<bool>

Column Info Methods

GetTelemetryPath

Loads the operation cache.

  • Required Role(s): Any

ClientSDK.CacheHelper.OperationsCache.GetTelemetryPath(string digitalTwinReferenceId, bool includeItem)
Parameters
  • digitalTwinReferenceId (string) – The unique Column identifier (GUID). This is also the TwinReferenceId of the twin related to the column.

  • includeItem (bool) – Whether to include the column name in the path.

Return type

string

GetWimsVarType

Retrieves the WIMS Var Type for a column. This is the single letter representation.

  • Required Role(s): Any

ClientSDK.CacheHelper.OperationsCache.GetWimsVarType(Column column)
Parameters

column (Column) – The Column object.

Return type

string

GetWimsType

Retrieves the WIMS Var Type for a column. This is the text representation.

  • Required Role(s): Any

ClientSDK.CacheHelper.OperationsCache.GetWimsType(Column column)
Parameters

column (Column) – The Column object.

Return type

string

Note

WIMS equivalent variable types: - Daily Worksheet

  • P - Daily variable / parameter

  • C - Daily calculated variable

  • T - Daily text variable

  • Four Hour Worksheet
    • 4 - Daily Detail variable tracked every 4 hours

    • G - 4 hour calc.

    • E - 4 hour text variable

  • Hourly Worksheet
    • H - Daily Detail variable tracked every hour

    • N - Hourly Calc

    • B - Hourly Text

  • Hourly Worksheet
    • F - Daily Detail variable tracked every 15 minutes

    • V - 15 Minute Calc

    • X - 15 Minute Text

GetWorksheetType

Returns the enumerated Worksheet Type

  • Required Role(s): Any

ClientSDK.CacheHelper.OperationsCache.GetWorksheetType(DigitalTwin digitalTwin)
Parameters

digitalTwin (DigitalTwin) – The column digital twin.

Return type

EnumWorksheet

GetWorksheetTypeName

Returns the name of the type of the worksheet.
  • 15 Minutes

  • Hourly

  • 4 Hour

  • Daily

  • Required Role(s): Any

ClientSDK.CacheHelper.OperationsCache.GetWorksheetTypeName(string guid)
Parameters

guid (string) – The unique Column identifier (GUID). This is also the TwinReferenceId of the twin related to the column.

Return type

string

GetColumnGuidByIndex

Returns a column GUID based on the index of the column digital twin.

  • Required Role(s): Any

ClientSDK.CacheHelper.OperationsCache.GetColumnGuidByIndex(string index)
Parameters

index (string) – The index of the column digital twin.

Return type

string

Info

Returns a column info based on any of the following:

  • Column Number: The unique uint id of the column. This is also the long id of the column twin.

  • Column GUID: The unique id (GUID) of the column. This is also the TwinReferenceId of the twin related to the column.

  • WIMS VarNum: The Variable Number from WIMS if the operation was converted from WIMS.

  • WIMS Variable Id: The Variable Id from WIMS if the operation was converted from WIMS.

  • Required Role(s): Any

ClientSDK.CacheHelper.OperationsCache.Info(string columnIdentifier, string field)
Parameters
  • columnIdentifier (string) – unique identifier of the column.

  • field (string) – The information to retrieve. See Note below.

Return type

string

Note

Info Fields (Field - Info Returned):

  • Operation - Operation hame

  • Location:VarName - path:ColumnName

  • Name:Units - ColumnName {Unit Short Name}

  • ShortName - Parameter Short Name

  • ShortName.Units - Parameter Short Name {Unit Short Name}

  • GetWimsVarType

  • Type

  • ParameterType - Parameter Long Name

  • ParameterType.Units - Parameter Long Name {Unit Short Name}

  • Units - Unit Short Name

  • XREF

  • ScadaTag

  • LIMS_LOC

  • LIMS_TEST

  • Statistic

  • StoretCode

  • StoretCodeDesc

  • StoretCode-Desc - Storet Code - Storet Code Description

  • EntryMin

  • EntryMax

  • Path

  • Location

  • Parent

  • GrandParent

  • Frequency

  • VarNum

Get Column Methods

GetColumnByColumnNumber

Returns a column based on the Column Number

  • Required Role(s): Any

ClientSDK.CacheHelper.OperationsCache.GetColumnByColumnNumber(uint id)
Parameters

uint (string) – The unique uint id of the column. This is also the long id of the column twin.

Return type

Column

GetColumnByIdentifier

Returns a column based on any of the following:

  • Column Number: The unique uint id of the column. This is also the long id of the column twin.

  • Column GUID: The unique id (GUID) of the column. This is also the TwinReferenceId of the twin related to the column.

  • WIMS VarNum: The Variable Number from WIMS if the operation was converted from WIMS.

  • WIMS Variable Id: The Variable Id from WIMS if the operation was converted from WIMS.

  • Required Role(s): Any

ClientSDK.CacheHelper.OperationsCache.GetColumnByIdentifier(string sId)
Parameters

sId (string) – unique identifier of the column.

Return type

Column

GetColumnByVarNum

Returns a column based on the WIMS VarNum.

  • Required Role(s): Any

ClientSDK.CacheHelper.OperationsCache.GetColumnByVarNum(long varNum)
Parameters

varNum (long) – The VarNum from WIMS if the operation was converted from WIMS.

Return type

Column

GetColumnByVariableId

Returns a column based on the WIMS Variable ID.

  • Required Role(s): Any

ClientSDK.CacheHelper.OperationsCache.GetColumnByVariableId(long variableId)
Parameters

variableId (long) – The Variable Id from WIMS if the operation was converted from WIMS.

Return type

Column

GetColumnTwinByGuid

Returns a column twin based on the Column GUID. This is also the TwinReferenceId of the twin related to the column.

  • Required Role(s): Any

ClientSDK.CacheHelper.OperationsCache.GetColumnTwinByGuid(string guid)
Parameters

guid (string) – The unique Column identifier (GUID). This is also the TwinReferenceId of the twin related to the column.

Return type

DigitalTwin

Column Twin Data Methods

GetColumnTwinDataPropertyLong

Retrieves the value from the Column Twin Data.

  • Required Role(s): Any

ClientSDK.CacheHelper.OperationsCache.GetColumnTwinDataPropertyLong(string guid, string path, string key)
Parameters
  • guid (string) – The unique Column identifier (GUID). This is also the TwinReferenceId of the twin related to the column.

  • path (string) – JSON Path to the key to be retrieved.

  • key (string) – JSON Key that is found under the path.

Return type

long

GetColumnTwinDataPropertyDouble

Retrieves the value from the Column Twin Data.

  • Required Role(s): Any

ClientSDK.CacheHelper.OperationsCache.GetColumnTwinDataPropertyDouble(string guid, string path, string key)
Parameters
  • guid (string) – The unique Column identifier (GUID). This is also the TwinReferenceId of the twin related to the column.

  • path (string) – JSON Path to the key to be retrieved.

  • key (string) – JSON Key that is found under the path.

Return type

double

GetColumnTwinDataPropertyDate

Retrieves the value from the Column Twin Data.

  • Required Role(s): Any

ClientSDK.CacheHelper.OperationsCache.GetColumnTwinDataPropertyDate(string guid, string path, string key)
Parameters
  • guid (string) – The unique Column identifier (GUID). This is also the TwinReferenceId of the twin related to the column.

  • path (string) – JSON Path to the key to be retrieved.

  • key (string) – JSON Key that is found under the path.

Return type

dateTime

GetVariableId by Column Twin

Retrieves the WIMS VariableId from the Column Twin Data.

  • Required Role(s): Any

ClientSDK.CacheHelper.OperationsCache.GetVariableId(DigitalTwin columnTwin)
Parameters

columnTwin (DigitalTwin) – The column digital twin.

Return type

long

GetVariableId by Column GUID

Retrieves the WIMS VariableId from the Column Twin Data.

  • Required Role(s): Any

ClientSDK.CacheHelper.OperationsCache.GetVariableId(string guid)
Parameters

guid (string) – The unique id (GUID) of the column digital twin.

Return type

long

Operation Methods

GetOperationById

Finds the Operation GUID given the index of the operation.

  • Required Role(s): Any

ClientSDK.CacheHelper.OperationsCache.GetOperationById(string guid)
Parameters

guid (string) – unique identifier of the operation.

Return type

OperationCache

Row Cache Methods

AddRow

Adds a row to the operation cache.

  • Required Role(s): Any

ClientSDK.CacheHelper.OperationsCache.AddRow(EnumWorksheet enumWorksheet, Row row)
Parameters
  • enumWorksheet (EnumWorksheet) – The Worksheet Type.

  • row (Row) – The Worksheet row to be cached.

Return type

void

GetRow

Gets a row from the operation cache.

  • Required Role(s): Any

ClientSDK.CacheHelper.OperationsCache.GetRow(EnumWorksheet enumWorksheet, uint rowNumber)
Parameters
  • enumWorksheet (EnumWorksheet) – The Worksheet Type.

  • rowNumber (uint) – The Worksheet row number.

Return type

Row

Properties

Id

Id
Returns

The unique identifier (GUID) for the current operation.

Return type

string

DigitalTwin

DigitalTwin
Returns

The digital twin that represents for the current operation.

Return type

DigitalTwin

DigitalTwinItem

DigitalTwinItem
Returns

The digital twin item (tree item) that represents for the current operation.

Return type

DigitalTwinItem

IsInitiated

IsInitiated
Returns

Whether the operation cache has been loaded.

Return type

bool

Delimiter

Delimiter
Returns

The delimiter used to separate the path for locations.

Return type

string

Name

Name
Returns

The name of the operation.

Return type

string

SpreadsheetDefinition

SpreadsheetDefinition
Returns

The SpreadsheetDefinition for the current operation.

Return type

SpreadsheetDefinition

FifteenMinuteWorksheetDefinition

FifteenMinuteWorksheetDefinition
Returns

The FifteenMinuteWorksheetDefinition for the current operation.

Return type

WorksheetDefinition

HourlyWorksheetDefinition

HourlyWorksheetDefinition
Returns

The HourlyWorksheetDefinition for the current operation.

Return type

WorksheetDefinition

FourHourWorksheetDefinition

FourHourWorksheetDefinition
Returns

The FourHourWorksheetDefinition for the current operation.

Return type

WorksheetDefinition

DailyWorksheetDefinition

DailyWorksheetDefinition
Returns

The DailyWorksheetDefinition for the current operation.

Return type

WorksheetDefinition

FifteenMinuteRows

FifteenMinuteRows
Returns

The Cached FifteenMinuteRows for the current operation.

Return type

Dictionary<uint, Row>

HourlyRows

HourlyRows
Returns

The Cached HourlyRows for the current operation.

Return type

Dictionary<uint, Row>

FourHourRows

FourHourRows
Returns

The Cached FourHourRows for the current operation.

Return type

Dictionary<uint, Row>

DailyRows

DailyRows
Returns

The Cached DailyRows for the current operation.

Return type

Dictionary<uint, Row>

LocationTwins

LocationTwins
Returns

The location twins for the current operation.

Return type

List<DigitalTwin>

ColumnTwins

ColumnTwins
Returns

The column twins for the current operation.

Return type

List<DigitalTwin>

MeasurementCache

MeasurementCache
Returns

The cache of measurements for the current operation.

Return type

Dictionary<string, List<Measurement>>