From bfaf92a79cd07830ba186d85f304b42ab33ff72e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 20 Mar 2024 19:11:58 +0000 Subject: [PATCH] [NEW-FEATURE] Posibility to close any dialog at init (#698) * Create draft PR for #697 * + reopen dialogs after restart application (TcoDialog,TcoInspector) + posibilty to close all dialog by restore methods (TcoDialog,TcoInspector) --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Peter Barancek --- .../src/Abstractions/Dialogs/IsDialog.cs | 2 + .../Application/Dialogs/DialogProxyService.cs | 14 ++++++ src/TcoCore/README.md | 11 +++++ .../TcoCustomizedDialogDialogViewModel.cs | 2 +- .../TcoDialog/TcoDialogDialogViewModel.cs | 2 +- .../pex/TcoDialog/TcoCustomizedDialog.cs | 22 ++++++++++ .../pex/TcoDialog/TcoDialog.cs | 22 ++++++++++ .../pex/TcoDialog/TcoDialogBase.cs | 5 +++ .../Customized/TcoCustomizedDialog.TcPOU | 42 ++++++++++-------- .../Customized/eCustomizedDialogAnswer.TcDUT | 3 +- .../POUs/Prototypes/TcoDialog/TcoDialog.TcPOU | 43 +++++++++++-------- .../Prototypes/TcoDialog/eDialogAnswer.TcDUT | 3 +- .../Examples/Dialogs/DiaglogsContext.TcPOU | 11 ++++- .../tests/TcoCore.Sandbox.Wpf/App.xaml.cs | 3 +- src/TcoInspectors/README.md | 5 +++ .../pex/TcoInspectorDialog.cs | 24 +++++++++++ .../TcoInspectorDialogDialogView.xaml | 1 - .../TcoInspectorDialogDialogView.xaml.cs | 19 +------- .../TcoInspectorDialogViewModel.cs | 30 ++++++------- .../TcoInspectionGroup.TcPOU | 11 +---- .../POUs/TcoInspector/TcoInspector.TcPOU | 10 +++++ .../TcoInspector/TcoInspectorDialog.TcPOU | 20 ++++++--- .../POUs/Examples/ExampleContext.TcPOU | 6 ++- .../Sandbox.TcoInspectors.Wpf/App.xaml.cs | 13 +++--- 24 files changed, 225 insertions(+), 99 deletions(-) create mode 100644 src/TcoCore/src/TcoCoreConnector/pex/TcoDialog/TcoCustomizedDialog.cs create mode 100644 src/TcoCore/src/TcoCoreConnector/pex/TcoDialog/TcoDialog.cs create mode 100644 src/TcoInspectors/src/TcoInspectorsConnector/pex/TcoInspectorDialog.cs diff --git a/src/TcOpen.Inxton/src/Abstractions/Dialogs/IsDialog.cs b/src/TcOpen.Inxton/src/Abstractions/Dialogs/IsDialog.cs index df0aa80fe..4cf21b833 100644 --- a/src/TcOpen.Inxton/src/Abstractions/Dialogs/IsDialog.cs +++ b/src/TcOpen.Inxton/src/Abstractions/Dialogs/IsDialog.cs @@ -10,6 +10,8 @@ namespace TcOpen.Inxton.Dialogs public interface IsDialog : IVortexObject { string DialogId { get; set; } + + void ShowAgainIfInvoked(); void Initialize(Action dialogAction); } diff --git a/src/TcOpen.Inxton/src/Application/Dialogs/DialogProxyService.cs b/src/TcOpen.Inxton/src/Application/Dialogs/DialogProxyService.cs index dd7423e44..ccf8aeb64 100644 --- a/src/TcOpen.Inxton/src/Application/Dialogs/DialogProxyService.cs +++ b/src/TcOpen.Inxton/src/Application/Dialogs/DialogProxyService.cs @@ -15,6 +15,7 @@ public abstract class DialogProxyServiceBase protected DialogProxyServiceBase(IEnumerable observedObjects) { UpdateDialogs(observedObjects); + ShowDialogsIfAlreadyInvoked(observedObjects); } void UpdateDialogs(IEnumerable observedObjects) { @@ -27,6 +28,19 @@ void UpdateDialogs(IEnumerable observedObjects) } } + } + + void ShowDialogsIfAlreadyInvoked(IEnumerable observedObjects) + { + if (observedObjects == null || observedObjects.Count() == 0) return; + foreach (var observedObject in observedObjects) + { + foreach (var dialog in observedObject.GetDescendants()) + { + dialog.ShowAgainIfInvoked(); + } + } + } protected abstract void Queue(IsDialog dialog); } diff --git a/src/TcoCore/README.md b/src/TcoCore/README.md index 2b7b99008..6c9c08d62 100644 --- a/src/TcoCore/README.md +++ b/src/TcoCore/README.md @@ -7,6 +7,17 @@ ## Dialogs +### Plc Hide dialog + +```csharp + 0: + _dialog1.Restore(); + _dialog2.Restore(); + _dialog3.Restore(); + _dialog4.Restore(); + _dialogCustomized.Restore(); +``` + ### Plc Example usage of Dialog ```csharp diff --git a/src/TcoCore/src/TcoCore.Wpf/TcoDialog/TcoDialog/TcoCustomizedDialogDialogViewModel.cs b/src/TcoCore/src/TcoCore.Wpf/TcoDialog/TcoDialog/TcoCustomizedDialogDialogViewModel.cs index 35d4719e3..5406cbc7c 100644 --- a/src/TcoCore/src/TcoCore.Wpf/TcoDialog/TcoDialog/TcoCustomizedDialogDialogViewModel.cs +++ b/src/TcoCore/src/TcoCore.Wpf/TcoDialog/TcoDialog/TcoCustomizedDialogDialogViewModel.cs @@ -48,7 +48,7 @@ public TcoCustomizedDialogDialogViewModel() : base() private void dispatcherTimer_Tick(object sender, EventArgs e) { Dialog.Read(); - if ( Dialog._answer.LastValue != (short)eCustomizedDialogAnswer.NoAnswer) + if (Dialog._answer.LastValue != (short)eCustomizedDialogAnswer.Invoked) { this.Close(this, new EventArgs()); diff --git a/src/TcoCore/src/TcoCore.Wpf/TcoDialog/TcoDialog/TcoDialogDialogViewModel.cs b/src/TcoCore/src/TcoCore.Wpf/TcoDialog/TcoDialog/TcoDialogDialogViewModel.cs index 9c9332b23..33b991447 100644 --- a/src/TcoCore/src/TcoCore.Wpf/TcoDialog/TcoDialog/TcoDialogDialogViewModel.cs +++ b/src/TcoCore/src/TcoCore.Wpf/TcoDialog/TcoDialog/TcoDialogDialogViewModel.cs @@ -48,7 +48,7 @@ public TcoDialogDialogViewModel() : base() private void dispatcherTimer_Tick(object sender, EventArgs e) { Dialog.Read(); - if ( Dialog._answer.LastValue != (short)eDialogAnswer.NoAnswer) + if ( Dialog._answer.LastValue != (short)eDialogAnswer.Invoked) { this.Close(this, new EventArgs()); diff --git a/src/TcoCore/src/TcoCoreConnector/pex/TcoDialog/TcoCustomizedDialog.cs b/src/TcoCore/src/TcoCoreConnector/pex/TcoDialog/TcoCustomizedDialog.cs new file mode 100644 index 000000000..3e83c08c0 --- /dev/null +++ b/src/TcoCore/src/TcoCoreConnector/pex/TcoDialog/TcoCustomizedDialog.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using TcOpen.Inxton.Dialogs; +using Vortex.Connector; + +namespace TcoCore +{ + public partial class TcoCustomizedDialog : IsDialog + { + public new void ShowAgainIfInvoked() + { + this.Read(); + if ((eDialogAnswer)this._answer.LastValue == eDialogAnswer.Invoked) + { + this._restoreRequest.Synchron = true; + } + } + } +} diff --git a/src/TcoCore/src/TcoCoreConnector/pex/TcoDialog/TcoDialog.cs b/src/TcoCore/src/TcoCoreConnector/pex/TcoDialog/TcoDialog.cs new file mode 100644 index 000000000..902da1914 --- /dev/null +++ b/src/TcoCore/src/TcoCoreConnector/pex/TcoDialog/TcoDialog.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using TcOpen.Inxton.Dialogs; +using Vortex.Connector; + +namespace TcoCore +{ + public partial class TcoDialog : IsDialog + { + public new void ShowAgainIfInvoked() + { + this.Read(); + if ((eDialogAnswer)this._answer.LastValue == eDialogAnswer.Invoked) + { + this._restoreRequest.Synchron = true; + } + } + } +} diff --git a/src/TcoCore/src/TcoCoreConnector/pex/TcoDialog/TcoDialogBase.cs b/src/TcoCore/src/TcoCoreConnector/pex/TcoDialog/TcoDialogBase.cs index 89dce4b95..79959fad9 100644 --- a/src/TcoCore/src/TcoCoreConnector/pex/TcoDialog/TcoDialogBase.cs +++ b/src/TcoCore/src/TcoCoreConnector/pex/TcoDialog/TcoDialogBase.cs @@ -10,5 +10,10 @@ namespace TcoCore public partial class TcoDialogBase : IsDialog { public string DialogId { get; set; } + + public void ShowAgainIfInvoked() + { + + } } } diff --git a/src/TcoCore/src/XaeTcoCore/TcoCore/POUs/Prototypes/TcoDialog/Customized/TcoCustomizedDialog.TcPOU b/src/TcoCore/src/XaeTcoCore/TcoCore/POUs/Prototypes/TcoDialog/Customized/TcoCustomizedDialog.TcPOU index 885732d14..0d5294f62 100644 --- a/src/TcoCore/src/XaeTcoCore/TcoCore/POUs/Prototypes/TcoDialog/Customized/TcoCustomizedDialog.TcPOU +++ b/src/TcoCore/src/XaeTcoCore/TcoCore/POUs/Prototypes/TcoDialog/Customized/TcoCustomizedDialog.TcPOU @@ -56,11 +56,24 @@ END_VAR + + + + + + +_answer := eCustomizedDialogAnswer.Invoked;]]> @@ -70,10 +83,8 @@ END_VAR ]]> +ClearInfos(); +_answer:=eCustomizedDialogAnswer.NoAnswer;]]> @@ -107,15 +118,13 @@ _contentOption4 := ''; -_imageSource := ''; -_text := ''; -_caption := ''; -_dialogType := eDialogType.Undefined; +ClearInfos(); Show := THIS^; -IF THIS^._taskState = eTaskState.Done AND _answer <> eDialogAnswer.NoAnswer THEN - THIS^.Restore(); +IF THIS^._taskState = eTaskState.Done AND _answer <> eCustomizedDialogAnswer.Invoked AND _answer<>eCustomizedDialogAnswer.NoAnswer THEN + SUPER^.Restore(); + THIS^.ClearInfos(); END_IF; ]]> @@ -184,10 +193,8 @@ _contentOption2 := ''; _contentOption3 := ''; _contentOption4 := ''; -_imageSource := ''; -_text := ''; -_caption := ''; -_dialogType := eDialogType.Undefined; +ClearInfos(); + ShowWithExternalClose := THIS^; @@ -203,8 +210,9 @@ IF _rTrig.q THEN END_IF -IF THIS^._taskState=eTaskState.Done AND _answer<>eDialogAnswer.NoAnswer THEN - THIS^.Restore(); +IF THIS^._taskState=eTaskState.Done AND _answer<>eDialogAnswer.Invoked THEN + SUPER^.Restore(); + THIS^.ClearInfos(); END_IF; ]]> diff --git a/src/TcoCore/src/XaeTcoCore/TcoCore/POUs/Prototypes/TcoDialog/Customized/eCustomizedDialogAnswer.TcDUT b/src/TcoCore/src/XaeTcoCore/TcoCore/POUs/Prototypes/TcoDialog/Customized/eCustomizedDialogAnswer.TcDUT index c97026eb1..959235bd6 100644 --- a/src/TcoCore/src/XaeTcoCore/TcoCore/POUs/Prototypes/TcoDialog/Customized/eCustomizedDialogAnswer.TcDUT +++ b/src/TcoCore/src/XaeTcoCore/TcoCore/POUs/Prototypes/TcoDialog/Customized/eCustomizedDialogAnswer.TcDUT @@ -10,7 +10,8 @@ TYPE Option1 := 10, Option2 := 20, Option3 := 30, - Option4 := 40 + Option4 := 40, + Invoked := 50 ); END_TYPE ]]> diff --git a/src/TcoCore/src/XaeTcoCore/TcoCore/POUs/Prototypes/TcoDialog/TcoDialog.TcPOU b/src/TcoCore/src/XaeTcoCore/TcoCore/POUs/Prototypes/TcoDialog/TcoDialog.TcPOU index c8bf24eb5..928c41a89 100644 --- a/src/TcoCore/src/XaeTcoCore/TcoCore/POUs/Prototypes/TcoDialog/TcoDialog.TcPOU +++ b/src/TcoCore/src/XaeTcoCore/TcoCore/POUs/Prototypes/TcoDialog/TcoDialog.TcPOU @@ -52,11 +52,24 @@ END_VAR + + + + + + +_answer := eDialogAnswer.Invoked;]]> @@ -66,10 +79,8 @@ END_VAR ]]> +THIS^.ClearInfos(); +_answer:=eDialogAnswer.NoAnswer;]]> @@ -99,16 +110,13 @@ _hasYes := FALSE; _hasNo := FALSE; _hasCancel := FALSE; -_imageSource :=''; -_text := ''; -_caption := ''; -_dialogType := eDialogType.Undefined; - +ClearInfos(); Show := THIS^; -IF THIS^._taskState=eTaskState.Done AND _answer<>eDialogAnswer.NoAnswer THEN - THIS^.Restore(); +IF THIS^._taskState=eTaskState.Done AND _answer<>eDialogAnswer.Invoked AND _answer<>eDialogAnswer.NoAnswer THEN + SUPER^.Restore(); + THIS^.ClearInfos(); END_IF; ]]> @@ -173,10 +181,8 @@ _hasYes := FALSE; _hasNo := FALSE; _hasCancel := FALSE; -_imageSource :=''; -_text := ''; -_caption := ''; -_dialogType := eDialogType.Undefined; +ClearInfos(); + ShowWithExternalClose := THIS^; @@ -192,8 +198,9 @@ IF _rTrig.q THEN END_IF -IF THIS^._taskState=eTaskState.Done AND _answer<>eDialogAnswer.NoAnswer THEN - THIS^.Restore(); +IF THIS^._taskState=eTaskState.Done AND _answer<>eDialogAnswer.Invoked AND _answer<>eDialogAnswer.NoAnswer THEN + SUPER^.Restore(); + THIS^.ClearInfos(); END_IF; ]]> diff --git a/src/TcoCore/src/XaeTcoCore/TcoCore/POUs/Prototypes/TcoDialog/eDialogAnswer.TcDUT b/src/TcoCore/src/XaeTcoCore/TcoCore/POUs/Prototypes/TcoDialog/eDialogAnswer.TcDUT index 358f7e1f0..9ccfc69ae 100644 --- a/src/TcoCore/src/XaeTcoCore/TcoCore/POUs/Prototypes/TcoDialog/eDialogAnswer.TcDUT +++ b/src/TcoCore/src/XaeTcoCore/TcoCore/POUs/Prototypes/TcoDialog/eDialogAnswer.TcDUT @@ -10,7 +10,8 @@ TYPE OK := 10, Yes := 20, No := 30, - Cancel := 40 + Cancel := 40, + Invoked :=50 ); END_TYPE ]]> diff --git a/src/TcoCore/src/XaeTcoCore/TcoCoreExamples/Examples/Dialogs/DiaglogsContext.TcPOU b/src/TcoCore/src/XaeTcoCore/TcoCoreExamples/Examples/Dialogs/DiaglogsContext.TcPOU index 02c2c9db7..f87210996 100644 --- a/src/TcoCore/src/XaeTcoCore/TcoCoreExamples/Examples/Dialogs/DiaglogsContext.TcPOU +++ b/src/TcoCore/src/XaeTcoCore/TcoCoreExamples/Examples/Dialogs/DiaglogsContext.TcPOU @@ -44,7 +44,14 @@ END_VAR]]> + + //restore method also close each inactive dialog + Data.BoltPresenceInspector.Restore(); + GroupInspection.Restore(); + answer := _dialog .Show() .WithType(eDialogType.Question) diff --git a/src/TcoInspectors/src/TcoInspectorsConnector/pex/TcoInspectorDialog.cs b/src/TcoInspectors/src/TcoInspectorsConnector/pex/TcoInspectorDialog.cs new file mode 100644 index 000000000..cc546bd65 --- /dev/null +++ b/src/TcoInspectors/src/TcoInspectorsConnector/pex/TcoInspectorDialog.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using TcoCore; +using TcOpen.Inxton.Dialogs; +using Vortex.Connector; + +namespace TcoInspectors +{ + public partial class TcoInspectorDialog : IsDialog + { + public new void ShowAgainIfInvoked() + { + this.Read(); + if (this._isInvoked.LastValue) + { + this._restoreRequest.Synchron = true; + } + } + } + +} diff --git a/src/TcoInspectors/src/Wpf/TcOpen.Inxton.TcoInspectors.Wpf/Abstractions/InspectorDialogue/TcoInspectorDialogDialogView.xaml b/src/TcoInspectors/src/Wpf/TcOpen.Inxton.TcoInspectors.Wpf/Abstractions/InspectorDialogue/TcoInspectorDialogDialogView.xaml index 80156c85a..5d03ccfc1 100644 --- a/src/TcoInspectors/src/Wpf/TcOpen.Inxton.TcoInspectors.Wpf/Abstractions/InspectorDialogue/TcoInspectorDialogDialogView.xaml +++ b/src/TcoInspectors/src/Wpf/TcOpen.Inxton.TcoInspectors.Wpf/Abstractions/InspectorDialogue/TcoInspectorDialogDialogView.xaml @@ -12,7 +12,6 @@ xmlns:vortexs="http://vortex.security.mts/xaml" xmlns:wv2="clr-namespace:Microsoft.Web.WebView2.Wpf;assembly=Microsoft.Web.WebView2.Wpf" xmlns:converters="clr-namespace:TcOpen.Inxton.TcoInspectors.Wpf.Converters" mc:Ignorable="d" - Loaded="Window_Loaded" ResizeMode="NoResize" ShowInTaskbar="False" SizeToContent="WidthAndHeight" diff --git a/src/TcoInspectors/src/Wpf/TcOpen.Inxton.TcoInspectors.Wpf/Abstractions/InspectorDialogue/TcoInspectorDialogDialogView.xaml.cs b/src/TcoInspectors/src/Wpf/TcOpen.Inxton.TcoInspectors.Wpf/Abstractions/InspectorDialogue/TcoInspectorDialogDialogView.xaml.cs index c680727d2..9348e6dd7 100644 --- a/src/TcoInspectors/src/Wpf/TcOpen.Inxton.TcoInspectors.Wpf/Abstractions/InspectorDialogue/TcoInspectorDialogDialogView.xaml.cs +++ b/src/TcoInspectors/src/Wpf/TcOpen.Inxton.TcoInspectors.Wpf/Abstractions/InspectorDialogue/TcoInspectorDialogDialogView.xaml.cs @@ -29,24 +29,7 @@ public TcoInspectorDialogDialogView() this.DataContextChanged += TcoInspectorDialogView_DataContextChanged; } - private void Window_Loaded(object sender, RoutedEventArgs e) - { - // // Calculate the desired window size (80% of the screen resolution) - // double screenWidth = SystemParameters.PrimaryScreenWidth; - // double screenHeight = SystemParameters.PrimaryScreenHeight; - - // double desiredWidth = screenWidth * 0.9; - // double desiredHeight = screenHeight * 0.9; - - // // Set the window size - // MaxWidth = desiredWidth; - // MaxHeight = desiredHeight; - - // // Center the window on the screen - // Left = (screenWidth - Width) / 2; - // Top = (screenHeight - Height) / 2; - } - + private void TcoInspectorDialogView_DataContextChanged(object sender, System.Windows.DependencyPropertyChangedEventArgs e) { context = this.DataContext as TcoInspectorDialogDialogViewModel; diff --git a/src/TcoInspectors/src/Wpf/TcOpen.Inxton.TcoInspectors.Wpf/Abstractions/InspectorDialogue/TcoInspectorDialogViewModel.cs b/src/TcoInspectors/src/Wpf/TcOpen.Inxton.TcoInspectors.Wpf/Abstractions/InspectorDialogue/TcoInspectorDialogViewModel.cs index 7f93704c6..d406ffaea 100644 --- a/src/TcoInspectors/src/Wpf/TcOpen.Inxton.TcoInspectors.Wpf/Abstractions/InspectorDialogue/TcoInspectorDialogViewModel.cs +++ b/src/TcoInspectors/src/Wpf/TcOpen.Inxton.TcoInspectors.Wpf/Abstractions/InspectorDialogue/TcoInspectorDialogViewModel.cs @@ -37,30 +37,30 @@ public TcoInspectorDialogDialogViewModel() () => TcOpen.Inxton.TcoAppDomain.Current.Logger.Information($"{nameof(OverrideCommand)} of {Dialog.HumanReadable} was executed @{{payload}}.", new { Dialog.Symbol })); } - + List _inspectorsList; public IEnumerable Inspectors { get { if (_inspectorsList == null) - { + { _inspectorsList = new List(); try { - - var parent = Dialog.GetParent(); - + + var parent = Dialog.GetParent(); + switch (parent) { case TcoInspectionGroup g: g.Read(); - + _inspectorsList = g._inspections.Take(g._inspectionIndex.Synchron) .Select(p => g.GetConnector().IdentityProvider.GetVortexerByIdentity(p.Synchron) as IVortexObject) .Where(p => !(p is NullVortexIdentity)).ToList(); - + break; case TcoInspector i: _inspectorsList.Add(parent); @@ -108,10 +108,10 @@ public string Description sb.Clear();//clear if failures descriptions are empty } return sb.ToString().TrimEnd(new char[] { ';', ' ' }); - + } } - + public string FailureDescription { get @@ -120,12 +120,12 @@ public string FailureDescription parent.Read(); var sb = new System.Text.StringBuilder(); - + foreach (var inspector in Inspectors) { var insp = inspector as IsInspector; - + if (insp != null) { @@ -140,9 +140,9 @@ public string FailureDescription } - bool result = sb.ToString().All(c => c == ';'|| c==' '); + bool result = sb.ToString().All(c => c == ';' || c == ' '); - if (result ) + if (result) { sb.Clear();//clear if failures descriptions are empty } @@ -177,7 +177,7 @@ public string ErrorCode } bool result = sb.ToString().All(c => c == ';' || c == ' '); - + if (result) { sb.Clear();//clear if failures descriptions are empty @@ -201,7 +201,7 @@ public string ErrorCode private void dispatcherTimer_Tick(object sender, EventArgs e) { Dialog.Read(); - if (Dialog._dialogRetry.LastValue || Dialog._dialogTerminate.LastValue || Dialog._dialogOverride.LastValue) + if (Dialog._dialogRetry.LastValue || Dialog._dialogTerminate.LastValue || Dialog._dialogOverride.LastValue || !Dialog._isInvoked.LastValue) { CloseRequestEventHandler?.Invoke(this, e); diff --git a/src/TcoInspectors/src/XAE/XAE/TcoInspectors/POUs/TcoInspectionGroup/TcoInspectionGroup.TcPOU b/src/TcoInspectors/src/XAE/XAE/TcoInspectors/POUs/TcoInspectionGroup/TcoInspectionGroup.TcPOU index 990729199..0f79efd3e 100644 --- a/src/TcoInspectors/src/XAE/XAE/TcoInspectors/POUs/TcoInspectionGroup/TcoInspectionGroup.TcPOU +++ b/src/TcoInspectors/src/XAE/XAE/TcoInspectors/POUs/TcoInspectionGroup/TcoInspectionGroup.TcPOU @@ -62,15 +62,6 @@ END_IF ]]> - - - - - - - diff --git a/src/TcoInspectors/src/XAE/XAE/TcoInspectors/POUs/TcoInspector/TcoInspector.TcPOU b/src/TcoInspectors/src/XAE/XAE/TcoInspectors/POUs/TcoInspector/TcoInspector.TcPOU index 0eb1945f7..f0231e825 100644 --- a/src/TcoInspectors/src/XAE/XAE/TcoInspectors/POUs/TcoInspector/TcoInspector.TcPOU +++ b/src/TcoInspectors/src/XAE/XAE/TcoInspectors/POUs/TcoInspector/TcoInspector.TcPOU @@ -304,6 +304,16 @@ END_IF; ]]> + + + + + + diff --git a/src/TcoInspectors/src/XAE/XAE/TcoInspectors/POUs/TcoInspector/TcoInspectorDialog.TcPOU b/src/TcoInspectors/src/XAE/XAE/TcoInspectors/POUs/TcoInspector/TcoInspectorDialog.TcPOU index 39c6c1170..4e6147fe2 100644 --- a/src/TcoInspectors/src/XAE/XAE/TcoInspectors/POUs/TcoInspector/TcoInspectorDialog.TcPOU +++ b/src/TcoInspectors/src/XAE/XAE/TcoInspectors/POUs/TcoInspector/TcoInspectorDialog.TcPOU @@ -38,6 +38,7 @@ VAR _showErrorCode:BOOL; _showDescription:BOOL; + _isInvoked: BOOL; END_VAR ]]> @@ -143,8 +144,9 @@ END_IF @@ -175,17 +177,19 @@ END_VAR ]]> @@ -245,14 +249,17 @@ END_IF SUPER^(); {warning disable C0357} IF(_dialogRetry AND _dialogIsClosed) THEN + _isInvoked:=FALSE; _refInspector.Retry(inRetryStep); END_IF IF(_dialogTerminate AND _dialogIsClosed) THEN + _isInvoked:=FALSE; _refInspector.Terminate(); END_IF IF(_dialogOverride AND _dialogIsClosed) THEN + _isInvoked:=FALSE; _refInspector.CarryOn(); END_IF {warning enable C0357} @@ -343,19 +350,18 @@ HandleExternalSignals(inRetrySignal:=inRetrySignal,inTerminateSignal:=inTerminat IF(_dialogRetry AND _dialogIsClosed) THEN + _isInvoked:=FALSE; _refInspector.Retry(inRetryStep); - - END_IF //terminate IF(_dialogTerminate AND _dialogIsClosed) THEN + _isInvoked:=FALSE; _refInspector.Terminate(); - - END_IF IF(_dialogOverride AND _dialogIsClosed) THEN + _isInvoked:=FALSE; _refInspector.CarryOn(); END_IF {warning enable C0357} diff --git a/src/TcoInspectors/src/XAE/XAE/TcoInspectorsTests/POUs/Examples/ExampleContext.TcPOU b/src/TcoInspectors/src/XAE/XAE/TcoInspectorsTests/POUs/Examples/ExampleContext.TcPOU index 3dbb5f2a0..15315e7d8 100644 --- a/src/TcoInspectors/src/XAE/XAE/TcoInspectorsTests/POUs/Examples/ExampleContext.TcPOU +++ b/src/TcoInspectors/src/XAE/XAE/TcoInspectorsTests/POUs/Examples/ExampleContext.TcPOU @@ -67,6 +67,10 @@ IF (seq.Step(inStepID := 0, inStepDescription := 'ASKING SOME QUESTION')) THEN //-------------------------------------------------------- // + //restore method also close inactive dialog + Data.BoltPresenceInspector.Restore(); + GroupInspection.Restore(); + answer := _dialog .Show() .WithType(eDialogType.Question) @@ -476,7 +480,7 @@ VAR_INPUT END_VAR ]]> -