libtase2  2.4.0
TASE.2/ICCP Protocol Source Code Library for C/C++
Loading...
Searching...
No Matches
tase2_model.h
Go to the documentation of this file.
1/*
2 * tase2_model.h
3 *
4 * This file is part of libtase2
5 *
6 * Copyright 2014-2019 MZ Automation GmbH
7 *
8 * All rights reserved.
9 *
10 */
11
12#ifndef PRIVATE_TASE2_TASE2_SERVER_TASE2_MODEL_H_
13#define PRIVATE_TASE2_TASE2_SERVER_TASE2_MODEL_H_
14
15#ifdef __cplusplus
16extern "C" {
17#endif
18
19#include "tase2_common.h"
20
25
31typedef struct sTase2_DataModel* Tase2_DataModel;
32
33typedef struct sTase2_Domain* Tase2_Domain;
34
41typedef struct sTase2_DataPoint* Tase2_DataPoint;
42
46typedef struct sTase2_IndicationPoint* Tase2_IndicationPoint;
47
51typedef struct sTase2_ProtectionEquipment* Tase2_ProtectionEquipment;
52
56typedef struct sTase2_DSTransferSet* Tase2_DSTransferSet;
57
59 Tase2_Domain vcc;
60 Tase2_Domain domains;
62 Tase2_Edition edition; /* 1 = 1996-08, 2 = 2000-08 */
63};
64
65
71
75typedef struct sTase2_DataSet* Tase2_DataSet;
76
80typedef struct sTase2_DataSetEntry* Tase2_DataSetEntry;
81
83 char* name;
84 Tase2_DataSet sibling;
85 Tase2_DataSetEntry entries;
86 Tase2_DataSetEntry lastEntry;
87};
88
90 Tase2_Domain domain;
92 Tase2_DataSetEntry sibling;
93};
94
95typedef struct sTase2_TransferSet* Tase2_TransferSet;
96
97typedef struct sTase2_InformationMessage* Tase2_InformationMessage;
98
101 void* infoBuf;
102 Tase2_InformationMessage sibling;
103};
104
105
107 char* name;
109
110 Tase2_DataPoint dataPoints; /* list of data points */
111 void* dataPointHashTree; /* list of data points for efficient name lookup */
112 int dataPointCount; /* number of registered data points */
113 Tase2_DataPoint lastDataPoint; /* last element of list of data points */
114 Tase2_DataSet dataSets;
116 Tase2_InformationMessage informationMessages;
117 Tase2_Domain sibling;
118};
119
123
124
129
130
131
137
138typedef struct sTase2_ControlPoint* Tase2_ControlPoint;
139
148TASE2_API const char*
150
161TASE2_API Tase2_Domain
163
171TASE2_API Tase2_PointValue
173
179TASE2_API const char*
181
187TASE2_API Tase2_QualityClass
189
195TASE2_API Tase2_TimeStampClass
197
205
211TASE2_API bool
213
219TASE2_API void
221
228TASE2_API void
230
238TASE2_API void
240
246TASE2_API void
248
255TASE2_API void
257
265TASE2_API void
267
275TASE2_API void
277
283TASE2_API void
285
291TASE2_API void
293
300TASE2_API void
302
310TASE2_API void
312
321TASE2_API void
323
331TASE2_API void
333
341TASE2_API void
343
344
348TASE2_API const char*
350
356TASE2_API void
358
364TASE2_API void
366
372TASE2_API void
374
380TASE2_API void
382
388TASE2_API void
390
400TASE2_API const char*
402
410TASE2_API Tase2_Domain
412
422
437TASE2_API Tase2_TagValue
439
448TASE2_API void
450
451
457TASE2_API Tase2_DataModel
459
465TASE2_API void
466Tase2_DataModel_setEdition(Tase2_DataModel self, Tase2_Edition edition);
467
471TASE2_API void
472Tase2_DataModel_destroy(Tase2_DataModel self);
473
482TASE2_API void
483Tase2_DataModel_hideSpecialTSVariables(Tase2_DataModel self, bool value);
484
492TASE2_API Tase2_Domain
493Tase2_DataModel_addDomain(Tase2_DataModel self, const char* domainName);
494
502TASE2_API Tase2_Domain
503Tase2_DataModel_getDomain(Tase2_DataModel self, const char* domainName);
504
510TASE2_API Tase2_Domain
511Tase2_DataModel_getVCC(Tase2_DataModel self);
512
518TASE2_API const char*
519Tase2_Domain_getName(Tase2_Domain self);
520
530TASE2_API void
531Tase2_Domain_setBilateralTableId(Tase2_Domain self, const char* id);
532
574TASE2_API Tase2_IndicationPoint
575Tase2_Domain_addIndicationPoint(Tase2_Domain self, const char* name, Tase2_IndicationPointType type,
576 Tase2_QualityClass qualityClass, Tase2_TimeStampClass timeStampClass, bool hasCOV, bool readOnly);
577
591TASE2_API Tase2_ControlPoint
592Tase2_Domain_addControlPoint(Tase2_Domain self, const char* deviceName, Tase2_ControlPointType pointType, Tase2_DeviceClass deviceClass, bool hasTag, int16_t checkBackId);
593
603Tase2_Domain_addProtectionEquipment(Tase2_Domain self, const char* equipmentName, bool isPacked);
604
615TASE2_API Tase2_DSTransferSet
616Tase2_Domain_addDSTransferSet(Tase2_Domain self, const char* name);
617
628TASE2_API Tase2_DataSet
629Tase2_Domain_addDataSet(Tase2_Domain self, const char* name);
630
639TASE2_API Tase2_DataPoint
640Tase2_Domain_getDataPoint(Tase2_Domain self, const char* pointName);
641
648TASE2_API void
649Tase2_Domain_addInformationMessageObject(Tase2_Domain self, int maxSize);
650
659TASE2_API Tase2_DataSetEntry
660Tase2_DataSet_addEntry(Tase2_DataSet self, Tase2_Domain domain, const char* variableName);
661
667TASE2_API const char*
669
675TASE2_API Tase2_Domain
677
693TASE2_API char*
695
701TASE2_API int32_t
703
709TASE2_API int32_t
711
717TASE2_API int32_t
719
725TASE2_API int32_t
727
736TASE2_API int32_t
738
744TASE2_API uint32_t
746
752TASE2_API bool
754
760TASE2_API bool
762
768TASE2_API bool
770
776TASE2_API bool
778
784TASE2_API bool
786
792TASE2_API int16_t
794
797#ifdef __cplusplus
798}
799#endif
800
801
802#endif /* PRIVATE_TASE2_TASE2_SERVER_TASE2_MODEL_H_ */
Tase2_IndicationPointType
Definition tase2_common.h:137
Tase2_TagValue
Definition tase2_common.h:293
Tase2_QualityClass
Definition tase2_common.h:144
struct sTase2_BilateralTable * Tase2_BilateralTable
Definition tase2_endpoint.h:27
Tase2_TimeStampClass
Definition tase2_common.h:149
TASE2_API char * Tase2_DSTransferSet_getDataSetName(Tase2_DSTransferSet self)
Get the data set name of the transfer set.
TASE2_API void Tase2_IndicationPoint_setRealQ(Tase2_IndicationPoint self, float value, Tase2_DataFlags flags)
Set the value, and quality of a data point of type TASE2_IND_POINT_TYPE_REAL.
TASE2_API Tase2_ProtectionEquipment Tase2_Domain_addProtectionEquipment(Tase2_Domain self, const char *equipmentName, bool isPacked)
Create a new data point of type protection equipment.
TASE2_API Tase2_DataSet Tase2_Domain_addDataSet(Tase2_Domain self, const char *name)
Add a new data set to the domain or VCC pseudo-domain.
TASE2_API Tase2_IndicationPointType Tase2_IndicationPoint_getType(Tase2_IndicationPoint self)
Get the indication point type.
TASE2_API Tase2_Domain Tase2_DataModel_getVCC(Tase2_DataModel self)
Get the VCC pseudo domain that is representing the VCC scope data model items.
TASE2_API Tase2_ControlPointType Tase2_ControlPoint_getType(Tase2_ControlPoint self)
Get the type of the control point.
TASE2_API const char * Tase2_DataPoint_getName(Tase2_DataPoint self)
Get the name of the data point.
TASE2_API int32_t Tase2_DSTransferSet_getIntegrityCheck(Tase2_DSTransferSet self)
Get the time interval for integrity checks (Integrity Check)
TASE2_API void Tase2_ProtectionEquipment_setSingleEventFlags(Tase2_ProtectionEquipment self, Tase2_SingleEventFlags eventFlags)
Set the single event flags (value and quality)
TASE2_API const char * Tase2_ControlPoint_getName(Tase2_ControlPoint self)
Get the name of the control point.
TASE2_API Tase2_Domain Tase2_ControlPoint_getDomain(Tase2_ControlPoint self)
Get the domain of the control point.
TASE2_API void Tase2_ProtectionEquipment_setPackedEventFlags(Tase2_ProtectionEquipment self, Tase2_PackedEventFlags flags)
Set the quality flags of a packed event.
TASE2_API const char * Tase2_IndicationPoint_getName(Tase2_IndicationPoint self)
Get the relative name of the indication point.
TASE2_API void Tase2_Domain_addInformationMessageObject(Tase2_Domain self, int maxSize)
Add an information message object to a domain of VCC scope.
TASE2_API void Tase2_IndicationPoint_setStateSupplementalQTimeStamp(Tase2_IndicationPoint self, Tase2_DataStateSupplemental value, Tase2_DataFlags flags, uint64_t timestamp)
Set the value, quality, and timestamp of a data point of type TASE2_IND_POINT_TYPE_STATE_SUPPLEMENTAL...
TASE2_API void Tase2_ControlPoint_setTag(Tase2_ControlPoint self, Tase2_TagValue value, const char *reason, Tase2_BilateralTable tagOwner)
Set the tag value and additional tag information locally.
Tase2_DataPointType
Definition tase2_model.h:66
TASE2_API bool Tase2_DSTransferSet_getRBE(Tase2_DSTransferSet self)
Get the RBE (report by exception) flag.
struct sTase2_ProtectionEquipment * Tase2_ProtectionEquipment
Representation of protection equipment in the server data model.
Definition tase2_model.h:51
TASE2_API void Tase2_IndicationPoint_setCOV(Tase2_IndicationPoint self, uint16_t cov)
Set the COV (cointer of value changes) of the data point.
TASE2_API Tase2_TagValue Tase2_ControlPoint_getTag(Tase2_ControlPoint self, char **reason, Tase2_BilateralTable *tagOwner)
Get the tag value and additional tag information.
TASE2_API const char * Tase2_ProtectionEquipment_getName(Tase2_ProtectionEquipment self)
Get the name of the protection equipment.
TASE2_API bool Tase2_DSTransferSet_getStatus(Tase2_DSTransferSet self)
Get the status of the DS transfer set.
TASE2_API void Tase2_IndicationPoint_setDiscrete(Tase2_IndicationPoint self, int32_t value)
Set the value of a data point of type TASE2_IND_POINT_TYPE_DISCRETE.
TASE2_API int32_t Tase2_DSTransferSet_getTLE(Tase2_DSTransferSet self)
Get the TLE (time limit for execution) value.
TASE2_API Tase2_Domain Tase2_DataModel_getDomain(Tase2_DataModel self, const char *domainName)
Get the domain instance with a specific name.
TASE2_API void Tase2_IndicationPoint_setDiscreteQTimeStamp(Tase2_IndicationPoint self, int32_t value, Tase2_DataFlags flags, uint64_t timestamp)
Set the value, quality, and timestamp of a data point of type TASE2_IND_POINT_TYPE_DISCRETE.
Tase2_TransferSetType
Definition tase2_model.h:120
TASE2_API Tase2_DataPoint Tase2_Domain_getDataPoint(Tase2_Domain self, const char *pointName)
Get the data point (indication point, device, or protection equipment) with the given name.
TASE2_API bool Tase2_DSTransferSet_getCritical(Tase2_DSTransferSet self)
Get the critical flag (report acknowledge by client required when set)
struct sTase2_TransferSet * Tase2_TransferSet
Definition tase2_model.h:95
TASE2_API Tase2_PointValue Tase2_DataPoint_getPointValue(Tase2_DataPoint self)
Get the point value (Tase2_PointValue) of this data point.
TASE2_API bool Tase2_DSTransferSet_getBlockData(Tase2_DSTransferSet self)
Get the block data flag.
struct sTase2_IndicationPoint * Tase2_IndicationPoint
Representation of indication points in the server data model.
Definition tase2_model.h:46
TASE2_API const char * Tase2_Domain_getName(Tase2_Domain self)
Get the name of the domain.
TASE2_API const char * Tase2_TransferSet_getName(Tase2_TransferSet self)
Get the name of the transfer set.
TASE2_API void Tase2_DataModel_destroy(Tase2_DataModel self)
Release all resources and memory used by the data model.
TASE2_API Tase2_Domain Tase2_DataModel_addDomain(Tase2_DataModel self, const char *domainName)
Add a TASE.2 domain to the data model.
TASE2_API void Tase2_IndicationPoint_setQuality(Tase2_IndicationPoint self, Tase2_DataFlags flags)
Sets the quality flags of a data point.
TASE2_API int32_t Tase2_DSTransferSet_getInterval(Tase2_DSTransferSet self)
Get the interval value (time interval between server reports)
struct sTase2_ControlPoint * Tase2_ControlPoint
Definition tase2_model.h:138
TASE2_API Tase2_QualityClass Tase2_IndicationPoint_getQualityClass(Tase2_IndicationPoint self)
Get the quality class of the indication point.
TASE2_API void Tase2_ProtectionEquipment_setPackedEvent(Tase2_ProtectionEquipment self, Tase2_EventFlags packedEvent)
Set the event flags of a packed event.
TASE2_API Tase2_ControlPoint Tase2_Domain_addControlPoint(Tase2_Domain self, const char *deviceName, Tase2_ControlPointType pointType, Tase2_DeviceClass deviceClass, bool hasTag, int16_t checkBackId)
Create a new data point of type control point (device)
TASE2_API Tase2_IndicationPoint Tase2_Domain_addIndicationPoint(Tase2_Domain self, const char *name, Tase2_IndicationPointType type, Tase2_QualityClass qualityClass, Tase2_TimeStampClass timeStampClass, bool hasCOV, bool readOnly)
Create a new data point of type indication point.
Tase2_DeviceClass
Definition tase2_model.h:125
TASE2_API Tase2_DataModel Tase2_DataModel_create()
Create a new data model instance.
TASE2_API void Tase2_IndicationPoint_setRealQTimeStamp(Tase2_IndicationPoint self, float value, Tase2_DataFlags flags, uint64_t timestamp)
Set the value, quality, and timestamp of a data point of type TASE2_IND_POINT_TYPE_REAL.
TASE2_API int16_t Tase2_DSTransferSet_getEventCodeRequested(Tase2_DSTransferSet self)
Get the event code requested value.
TASE2_API int32_t Tase2_DSTransferSet_getStartTime(Tase2_DSTransferSet self)
Get the start time for condition monitoring of the transfer set.
Tase2_ControlPointType
Definition tase2_model.h:132
TASE2_API Tase2_TimeStampClass Tase2_IndicationPoint_getTimestampClass(Tase2_IndicationPoint self)
Get the timestamp class of the indication point.
TASE2_API void Tase2_DataModel_setEdition(Tase2_DataModel self, Tase2_Edition edition)
Set the TASE.2/ICCP edition to be used with the data model.
TASE2_API Tase2_DataSetEntry Tase2_DataSet_addEntry(Tase2_DataSet self, Tase2_Domain domain, const char *variableName)
Add a data set entry to a static data set.
TASE2_API void Tase2_Domain_setBilateralTableId(Tase2_Domain self, const char *id)
Set the bilateral table (BLT) id of the domain.
TASE2_API void Tase2_IndicationPoint_setReal(Tase2_IndicationPoint self, float value)
Set the value of a data point of type TASE2_IND_POINT_TYPE_REAL.
TASE2_API void Tase2_IndicationPoint_setStateSupplemental(Tase2_IndicationPoint self, Tase2_DataStateSupplemental value)
Set the value of a data point of type TASE2_IND_POINT_TYPE_STATE_SUPPLEMENTAL.
TASE2_API Tase2_Domain Tase2_TransferSet_getDomain(Tase2_TransferSet self)
Get the TASE.2 domain of the transfer set.
struct sTase2_DSTransferSet * Tase2_DSTransferSet
Represents a data set transfer set (DSTS) in the server.
Definition tase2_model.h:56
TASE2_API void Tase2_IndicationPoint_setStateTimeStamp(Tase2_IndicationPoint self, Tase2_DataState value, uint64_t timestamp)
Set the state, quality, and timestamp of a TASE2_IND_POINT_TYPE_STATE type indication point.
TASE2_API int32_t Tase2_DSTransferSet_getBufferTime(Tase2_DSTransferSet self)
Get the buffer time (wait time before report is sent)
TASE2_API void Tase2_IndicationPoint_setState(Tase2_IndicationPoint self, Tase2_DataState value)
Set the state and quality of a TASE2_IND_POINT_TYPE_STATE type indication point.
TASE2_API void Tase2_IndicationPoint_setTimeStamp(Tase2_IndicationPoint self, uint64_t timestamp)
Sets the timestamp of a data point.
TASE2_API void Tase2_IndicationPoint_setStateSupplementalQ(Tase2_IndicationPoint self, Tase2_DataStateSupplemental value, Tase2_DataFlags flags)
Set the value, and quality of a data point of type TASE2_IND_POINT_TYPE_STATE_SUPPLEMENTAL.
TASE2_API void Tase2_ProtectionEquipment_setOperatingTime(Tase2_ProtectionEquipment self, int32_t operatingTime)
Set the operating time (duration) of a protection equipment event.
TASE2_API void Tase2_ProtectionEquipment_setEventTime(Tase2_ProtectionEquipment self, uint64_t eventTime)
Set the event time (timestamp when the event started) of a protection equipment event.
TASE2_API Tase2_DSTransferSet Tase2_Domain_addDSTransferSet(Tase2_Domain self, const char *name)
Add a new data set transfer set (DSTS) to a domain.
TASE2_API uint32_t Tase2_DSTransferSet_getDsConditionsRequested(Tase2_DSTransferSet self)
Get the DSConditions to trigger a report transmission.
TASE2_API void Tase2_DataModel_hideSpecialTSVariables(Tase2_DataModel self, bool value)
Option to hide special transfer set variables in data model.
TASE2_API void Tase2_IndicationPoint_setDiscreteQ(Tase2_IndicationPoint self, int32_t value, Tase2_DataFlags flags)
Set the value, and quality of a data point of type TASE2_IND_POINT_TYPE_DISCRETE.
struct sTase2_DataPoint * Tase2_DataPoint
Abstract type representing data points in the server data model.
Definition tase2_model.h:41
TASE2_API Tase2_Domain Tase2_DataPoint_getDomain(Tase2_DataPoint self)
Get the Tase2_Domain of the data point.
TASE2_API bool Tase2_DSTransferSet_getAllChangesReported(Tase2_DSTransferSet self)
Get the All Changes Reported flag.
TASE2_API bool Tase2_IndicationPoint_hasCOV(Tase2_IndicationPoint self)
Check if the indication point has a counter of value change (COV) field.
@ TASE2_POINT_TYPE_CONTROL
Definition tase2_model.h:68
@ TASE2_POINT_TYPE_INDICATION
Definition tase2_model.h:67
@ TASE2_POINT_TYPE_PROTECTION_EVENT
Definition tase2_model.h:69
@ TASE2_TS_TYPE_DATA_SET
Definition tase2_model.h:121
@ TASE2_DEVICE_CLASS_SBO
Definition tase2_model.h:126
@ TASE2_DEVICE_CLASS_DIRECT
Definition tase2_model.h:127
@ TASE2_CONTROL_TYPE_SETPOINT_DESCRETE
Definition tase2_model.h:135
@ TASE2_CONTROL_TYPE_SETPOINT_REAL
Definition tase2_model.h:134
@ TASE2_CONTROL_TYPE_COMMAND
Definition tase2_model.h:133
uint8_t Tase2_DataState
Definition tase2_common.h:451
uint8_t Tase2_SingleEventFlags
Definition tase2_common.h:1092
uint8_t Tase2_DataFlags
Definition tase2_common.h:440
struct sTase2_PointValue * Tase2_PointValue
A TASE.2 point value with type information.
Definition tase2_common.h:388
uint8_t Tase2_EventFlags
Definition tase2_common.h:1103
uint8_t Tase2_PackedEventFlags
Definition tase2_common.h:1112
uint8_t Tase2_DataStateSupplemental
Definition tase2_common.h:479
Definition tase2_model.h:58
Tase2_Domain domains
Definition tase2_model.h:60
Tase2_Edition edition
Definition tase2_model.h:62
Tase2_Domain vcc
Definition tase2_model.h:59
bool hideSpecialTSVariables
Definition tase2_model.h:61
Representation of a data set entry in the server data model.
Definition tase2_model.h:89
char * variableName
Definition tase2_model.h:91
Tase2_DataSetEntry sibling
Definition tase2_model.h:92
Tase2_Domain domain
Definition tase2_model.h:90
Representation of a data set in the server data model.
Definition tase2_model.h:82
Tase2_DataSetEntry lastEntry
Definition tase2_model.h:86
Tase2_DataSet sibling
Definition tase2_model.h:84
char * name
Definition tase2_model.h:83
Tase2_DataSetEntry entries
Definition tase2_model.h:85
Definition tase2_model.h:106
Tase2_TransferSet transferSets
Definition tase2_model.h:115
Tase2_InformationMessage informationMessages
Definition tase2_model.h:116
Tase2_DataSet dataSets
Definition tase2_model.h:114
Tase2_Domain sibling
Definition tase2_model.h:117
void * dataPointHashTree
Definition tase2_model.h:111
Tase2_DataPoint dataPoints
Definition tase2_model.h:110
Tase2_DataPoint lastDataPoint
Definition tase2_model.h:113
char * name
Definition tase2_model.h:107
char * bilateralTableId
Definition tase2_model.h:108
int dataPointCount
Definition tase2_model.h:112
Definition tase2_model.h:99
int maxSize
Definition tase2_model.h:100
Tase2_InformationMessage sibling
Definition tase2_model.h:102
void * infoBuf
Definition tase2_model.h:101
Tase2_Edition
Definition tase2_model.h:21
@ TASE2_EDITION_1996_08
Definition tase2_model.h:22
@ TASE2_EDITION_2000_08
Definition tase2_model.h:23