From 23d7092a5c9355df34dc985766bf4054a79a72d5 Mon Sep 17 00:00:00 2001 From: Michael Zillgith Date: Wed, 28 Oct 2015 10:52:47 +0100 Subject: [PATCH] - .NET API: added Report.GetDataSetName method --- dotnet/IEC61850forCSharp/Reporting.cs | 10 ++++++++++ dotnet/reporting/ReportingExample.cs | 4 ++++ 2 files changed, 14 insertions(+) diff --git a/dotnet/IEC61850forCSharp/Reporting.cs b/dotnet/IEC61850forCSharp/Reporting.cs index 627116fe..dfbf6d6b 100644 --- a/dotnet/IEC61850forCSharp/Reporting.cs +++ b/dotnet/IEC61850forCSharp/Reporting.cs @@ -146,6 +146,9 @@ namespace IEC61850 [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)] static extern IntPtr ClientReport_getRcbReference(IntPtr self); + [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)] + static extern IntPtr ClientReport_getDataSetName(IntPtr self); + [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)] static extern IntPtr ClientReport_getRptId(IntPtr self); @@ -289,6 +292,13 @@ namespace IEC61850 return Marshal.PtrToStringAnsi (rcbRef); } + public string GetDataSetName () + { + IntPtr dataSetName = ClientReport_getDataSetName (self); + + return Marshal.PtrToStringAnsi (dataSetName); + } + /// /// Gets the data reference for the specified data set element /// diff --git a/dotnet/reporting/ReportingExample.cs b/dotnet/reporting/ReportingExample.cs index 52b43b05..98571949 100644 --- a/dotnet/reporting/ReportingExample.cs +++ b/dotnet/reporting/ReportingExample.cs @@ -30,6 +30,10 @@ namespace reporting Console.WriteLine (" entryID: " + shb.ToString ()); } + if (report.HasDataSetName ()) { + Console.WriteLine (" report data set: " + report.GetDataSetName ()); + } + Console.WriteLine (" report dataset contains " + values.Size () + " elements"); for (int i = 0; i < values.Size(); i++) {