diff --git a/dotnet/IEC61850forCSharp/IEC61850ServerAPI.cs b/dotnet/IEC61850forCSharp/IEC61850ServerAPI.cs index 1f0e8bc4..183df204 100644 --- a/dotnet/IEC61850forCSharp/IEC61850ServerAPI.cs +++ b/dotnet/IEC61850forCSharp/IEC61850ServerAPI.cs @@ -2943,6 +2943,36 @@ namespace IEC61850 return false; } + public delegate void InternalEditSettingGroupConfirmationHandler(object parameter, SettingGroupControlBlock sgcb, uint editSg); + + private InternalEditSettingGroupConfirmationHandler internalEditSettingGroupConfirmationHandler = null; + + private object editSettingGroupConfirmationHandlerParameter = null; + + private EditSettingGroupConfirmationHandler editSettingGroupConfirmationHandler = null; + + public void SetEditSettingGroupConfirmationHandler(InternalEditSettingGroupConfirmationHandler handler, SettingGroupControlBlock settingGroupControlBlock, object parameter) + { + internalEditSettingGroupConfirmationHandler = handler; + editSettingGroupConfirmationHandlerParameter = parameter; + + if (editSettingGroupConfirmationHandler == null) + { + editSettingGroupConfirmationHandler = new EditSettingGroupConfirmationHandler(InternalEditSettingGroupConfirmationImplementation); + + IedServer_setEditSettingGroupConfirmationHandler(self, settingGroupControlBlock.self, editSettingGroupConfirmationHandler, IntPtr.Zero); + } + } + + private void InternalEditSettingGroupConfirmationImplementation(IntPtr parameter, IntPtr sgcb, uint editSg) + { + if (sgcb != IntPtr.Zero) + { + internalEditSettingGroupConfirmationHandler(editSettingGroupChangedHandlerParameter, new SettingGroupControlBlock(sgcb), editSg); + } + } + + //------------ //public delegate bool InternalSVCBEventHandler(SampledValuesControlBlock sampledValuesControlBlock, SMVEvent sMVEvent, object parameter); diff --git a/dotnet/server_example_access_control/Program.cs b/dotnet/server_example_access_control/Program.cs index 011948ad..e565c011 100644 --- a/dotnet/server_example_access_control/Program.cs +++ b/dotnet/server_example_access_control/Program.cs @@ -251,8 +251,14 @@ namespace server_access_control return true; } + void editSGConfirmationHandler(object parameter, SettingGroupControlBlock sgcb, uint editSg) + { + Console.WriteLine("Received edit sg confirm for sg " + editSg + "\n"); + } + iedServer.SetActiveSettingGroupChangedHandler(activeSGChangedHandler, settingGroupControlBlock, null); iedServer.SetEditSettingGroupChangedHandler(editSGChangedHandler, settingGroupControlBlock, null); + iedServer.SetEditSettingGroupConfirmationHandler(editSGConfirmationHandler, settingGroupControlBlock, null); iedServer.Start(102);