From 08eb41acc98fdfbc3f51ee4a45b8739b53ea109b Mon Sep 17 00:00:00 2001 From: Michael Zillgith Date: Mon, 12 Aug 2024 12:34:53 +0100 Subject: [PATCH] - .NET API: Added functions SetReportSetting and GetReportSetting to IedServerConfig (LIB61850-404) --- dotnet/IEC61850forCSharp/IedServerConfig.cs | 44 +++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/dotnet/IEC61850forCSharp/IedServerConfig.cs b/dotnet/IEC61850forCSharp/IedServerConfig.cs index 33365792..5eacb1e0 100644 --- a/dotnet/IEC61850forCSharp/IedServerConfig.cs +++ b/dotnet/IEC61850forCSharp/IedServerConfig.cs @@ -27,6 +27,21 @@ using IEC61850.Common; namespace IEC61850.Server { + + /// + /// RCB properties that are configurable to be writable or read-only + /// + [Flags] + public enum ReportSettings + { + RPT_ID = 1, + BUF_TIME = 2, + DATSET = 4, + TRG_OPS = 8, + OPT_FIELDS = 16, + INTG_PD = 32, + } + /// /// IedServer configuration object /// @@ -131,6 +146,13 @@ namespace IEC61850.Server [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)] static extern void IedServerConfig_setSyncIntegrityReportTimes(IntPtr self, [MarshalAs(UnmanagedType.I1)] bool enable); + [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)] + static extern void IedServerConfig_setReportSetting(IntPtr self, byte setting, [MarshalAs(UnmanagedType.I1)] bool enable); + + [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.I1)] + static extern bool IedServerConfig_getReportSetting(IntPtr self, byte setting); + internal IntPtr self; public IedServerConfig() @@ -379,6 +401,28 @@ namespace IEC61850.Server } } + /// + /// Make a configurable report setting writeable or read-only + /// + /// ReportSettings is a flag enum, so you can set multiple settings at once + /// Can be used to implement some of Services\ReportSettings options + /// the settings that should be configured writeable or read-only + /// true, settings are writeable, false, settings are read-only + public void SetReportSetting(ReportSettings settings) + { + IedServerConfig_setReportSetting(self, (byte)settings, true); + } + + /// + /// Get the value of a specific report setting + /// + /// one value of ReportSettings + /// true, when setting is writable ("Dyn") or false, when read-only + public bool GetReportSetting(ReportSettings setting) + { + return IedServerConfig_getReportSetting(self, (byte)setting); + } + /// /// Releases all resource used by the object. ///