- IEC 61850 client: reporting - support data set entries with multiple reasons for inclusion

pull/239/head
Michael Zillgith 5 years ago
parent b3c5ecdcf2
commit d85b7ac777

@ -47,14 +47,17 @@ namespace IEC61850
return newRCB;
}
internal void RemoveRCB(ReportControlBlock rcb) {
if (activeRCBs != null) {
internal void RemoveRCB(ReportControlBlock rcb)
{
if (activeRCBs != null)
{
activeRCBs.Remove(rcb);
}
}
}
[Flags]
public enum ReasonForInclusion
{
/** the element is not included in the received report */
@ -67,16 +70,16 @@ namespace IEC61850
REASON_QUALITY_CHANGE = 2,
/** the element is included due to an update of the data value */
REASON_DATA_UPDATE = 3,
REASON_DATA_UPDATE = 4,
/** the element is included due to a periodic integrity report task */
REASON_INTEGRITY = 4,
REASON_INTEGRITY = 8,
/** the element is included due to a general interrogation by the client */
REASON_GI = 5,
REASON_GI = 16,
/** the reason for inclusion is unknown */
REASON_UNKNOWN = 6
REASON_UNKNOWN = 32
}
/// <summary>
@ -284,7 +287,8 @@ namespace IEC61850
/// </returns>
public MmsValue GetDataSetValues()
{
if (dataSetValues == IntPtr.Zero) {
if (dataSetValues == IntPtr.Zero)
{
dataSetValues = ClientReport_getDataSetValues(self);
if (dataSetValues == IntPtr.Zero)
@ -307,7 +311,8 @@ namespace IEC61850
/// </param>
public ReasonForInclusion GetReasonForInclusion(int index)
{
if (values == null) {
if (values == null)
{
GetDataSetValues();
if (values == null)
@ -375,7 +380,8 @@ namespace IEC61850
if (entryIdRef == IntPtr.Zero)
return null;
else {
else
{
MmsValue entryId = new MmsValue(entryIdRef);
return entryId.getOctetString();

@ -716,16 +716,18 @@ iedConnection_handleReport(IedConnection self, MmsValue* value)
goto exit_function;
}
matchingReport->reasonForInclusion[i] = 0;
if (MmsValue_getBitStringBit(reasonForInclusion, 1) == true)
matchingReport->reasonForInclusion[i] = IEC61850_REASON_DATA_CHANGE;
else if (MmsValue_getBitStringBit(reasonForInclusion, 2) == true)
matchingReport->reasonForInclusion[i] = IEC61850_REASON_QUALITY_CHANGE;
else if (MmsValue_getBitStringBit(reasonForInclusion, 3) == true)
matchingReport->reasonForInclusion[i] = IEC61850_REASON_DATA_UPDATE;
else if (MmsValue_getBitStringBit(reasonForInclusion, 4) == true)
matchingReport->reasonForInclusion[i] = IEC61850_REASON_INTEGRITY;
else if (MmsValue_getBitStringBit(reasonForInclusion, 5) == true)
matchingReport->reasonForInclusion[i] = IEC61850_REASON_GI;
matchingReport->reasonForInclusion[i] |= IEC61850_REASON_DATA_CHANGE;
if (MmsValue_getBitStringBit(reasonForInclusion, 2) == true)
matchingReport->reasonForInclusion[i] |= IEC61850_REASON_QUALITY_CHANGE;
if (MmsValue_getBitStringBit(reasonForInclusion, 3) == true)
matchingReport->reasonForInclusion[i] |= IEC61850_REASON_DATA_UPDATE;
if (MmsValue_getBitStringBit(reasonForInclusion, 4) == true)
matchingReport->reasonForInclusion[i] |= IEC61850_REASON_INTEGRITY;
if (MmsValue_getBitStringBit(reasonForInclusion, 5) == true)
matchingReport->reasonForInclusion[i] |= IEC61850_REASON_GI;
}
else {
matchingReport->reasonForInclusion[i] = IEC61850_REASON_UNKNOWN;

@ -1116,16 +1116,16 @@ typedef enum {
IEC61850_REASON_QUALITY_CHANGE = 2,
/** the element is included due to an update of the data value */
IEC61850_REASON_DATA_UPDATE = 3,
IEC61850_REASON_DATA_UPDATE = 4,
/** the element is included due to a periodic integrity report task */
IEC61850_REASON_INTEGRITY = 4,
IEC61850_REASON_INTEGRITY = 8,
/** the element is included due to a general interrogation by the client */
IEC61850_REASON_GI = 5,
IEC61850_REASON_GI = 16,
/** the reason for inclusion is unknown (e.g. report is not configured to include reason-for-inclusion) */
IEC61850_REASON_UNKNOWN = 6
IEC61850_REASON_UNKNOWN = 32
} ReasonForInclusion;
#define REASON_NOT_INCLUDED IEC61850_REASON_NOT_INCLUDED

Loading…
Cancel
Save