diff --git a/src/components.abstractions/ctrl/src/AxoComponent_Status.st b/src/components.abstractions/ctrl/src/AxoComponent_Status.st index 8e275fcea..2819898b7 100644 --- a/src/components.abstractions/ctrl/src/AxoComponent_Status.st +++ b/src/components.abstractions/ctrl/src/AxoComponent_Status.st @@ -4,8 +4,12 @@ NAMESPACE AXOpen.Components.Abstractions CLASS PUBLIC AxoComponent_Status VAR PUBLIC {#ix-set:AttributeName = "ActionDescription: |[[1]ActionDescription]|"} + {#ix-attr:[WarningLevel(600)]} + {#ix-attr:[ErrorLevel(700)]} Action : AXOpen.Core.AxoTextList; {#ix-set:AttributeName = "ErrorDescription: |[[1]ErrorDescription]|"} + {#ix-attr:[WarningLevel(600)]} + {#ix-attr:[ErrorLevel(700)]} Error : AXOpen.Core.AxoTextList; END_VAR END_CLASS diff --git a/src/core/src/AXOpen.Core.Blazor/AxoTextList/AxoTextListView.razor.cs b/src/core/src/AXOpen.Core.Blazor/AxoTextList/AxoTextListView.razor.cs index 32fbd07b6..5c3b41e32 100644 --- a/src/core/src/AXOpen.Core.Blazor/AxoTextList/AxoTextListView.razor.cs +++ b/src/core/src/AXOpen.Core.Blazor/AxoTextList/AxoTextListView.razor.cs @@ -1,18 +1,29 @@ -namespace AXOpen.Core +using AXSharp.Connector; + +namespace AXOpen.Core { public partial class AxoTextListView : IDisposable { + private uint _warningLevel => this.Component.GetAttribute() != null ? this.Component.GetAttribute().Level : 0; + private uint _errorLevel => this.Component.GetAttribute() != null ? this.Component.GetAttribute().Level : 0; private string _cardClass { get { - if (Component.Id.Cyclic < (int)Messaging.eAxoMessageCategory.Warning) - return "card bg-primary text-light mb-1"; - else if (Component.Id.Cyclic >= (int)Messaging.eAxoMessageCategory.Error) - return "card bg-danger text-white mb-1"; + if(_warningLevel>0 && _errorLevel > _warningLevel) + { + if (Component.Id.Cyclic < _warningLevel) + return "card bg-primary text-light mb-1"; + else if (Component.Id.Cyclic >= _errorLevel) + return "card bg-danger text-white mb-1"; + else + return "card bg-warning text-black mb-1"; + } else - return "card bg-warning text-black mb-1"; + return "card bg-primary text-light mb-1"; + + } } diff --git a/src/core/src/AXOpen.Core/AxoTextList/AxoTextList.cs b/src/core/src/AXOpen.Core/AxoTextList/AxoTextList.cs index c4f5915b1..91b0672cf 100644 --- a/src/core/src/AXOpen.Core/AxoTextList/AxoTextList.cs +++ b/src/core/src/AXOpen.Core/AxoTextList/AxoTextList.cs @@ -1,10 +1,4 @@ using System; -using AXSharp.Connector; -using AXSharp.Connector.ValueTypes; -using System.Collections.Generic; -using AXOpen; -using System.ComponentModel; -using System.Security.Principal; namespace AXOpen.Core { @@ -12,4 +6,30 @@ public partial class AxoTextList { } -} \ No newline at end of file + public class WarningLevelAttribute : Attribute + { + public WarningLevelAttribute() + { + } + public WarningLevelAttribute(uint level) + { + Level = level; + } + + public uint Level { get; } + } + + public class ErrorLevelAttribute : Attribute + { + public ErrorLevelAttribute() + { + } + public ErrorLevelAttribute(uint level) + { + Level = level; + } + + public uint Level { get; } + } + +} diff --git a/src/integrations/ctrl/src/Examples/AxoTextList/AxoTextListExample.st b/src/integrations/ctrl/src/Examples/AxoTextList/AxoTextListExample.st index f6ec6189c..47accc955 100644 --- a/src/integrations/ctrl/src/Examples/AxoTextList/AxoTextListExample.st +++ b/src/integrations/ctrl/src/Examples/AxoTextList/AxoTextListExample.st @@ -11,7 +11,15 @@ NAMESPACE AxoTextListExample _set2zeroTask : AXOpen.Core.AxoTask; {#ix-set:AttributeName = "Description: |[[1]Description]|"} - _myTextList : AXOpen.Core.AxoTextList; + {#ix-attr:[WarningLevel(600)]} + {#ix-attr:[ErrorLevel(700)]} + _myTextList1 : AXOpen.Core.AxoTextList; + {#ix-set:AttributeName = "Same description: |[[1]Description]|"} + {#ix-attr:[WarningLevel(300)]} + {#ix-attr:[ErrorLevel(500)]} + _myTextList2 : AXOpen.Core.AxoTextList; + {#ix-set:AttributeName = "Totaly different description without error elevation: |[[1]Description3]|"} + _myTextList3 : AXOpen.Core.AxoTextList; END_VAR METHOD PROTECTED OVERRIDE Main @@ -19,15 +27,17 @@ NAMESPACE AxoTextListExample _set2zeroTask.Initialize(THIS); IF(_incrementTask.Execute()) THEN - _myTextList.Id := _myTextList.Id + UINT#1; - _incrementTask.DoneWhen(_myTextList.Id>= UINT#1000); + _myTextList1.Id := _myTextList1.Id + UINT#1; + _incrementTask.DoneWhen(_myTextList1.Id>= UINT#1000); END_IF; IF(_set2zeroTask.Execute()) THEN _incrementTask.Restore(); - _myTextList.Id := UINT#0; + _myTextList1.Id := UINT#0; _set2zeroTask.DoneWhen(TRUE); END_IF; - END_METHOD + _myTextList2.Id := _myTextList1.Id; + _myTextList3.Id := _myTextList1.Id; + END_METHOD END_CLASS END_NAMESPACE diff --git a/src/integrations/src/AXOpen.Integrations.Blazor/Pages/AxoTextList/AxoTextListExample.razor b/src/integrations/src/AXOpen.Integrations.Blazor/Pages/AxoTextList/AxoTextListExample.razor index 328d32b92..2a7f26a16 100644 --- a/src/integrations/src/AXOpen.Integrations.Blazor/Pages/AxoTextList/AxoTextListExample.razor +++ b/src/integrations/src/AXOpen.Integrations.Blazor/Pages/AxoTextList/AxoTextListExample.razor @@ -18,7 +18,13 @@
- + +
+
+ +
+
+
diff --git a/src/integrations/src/AXOpen.Integrations/AxoTextListExample/AxoTextListExampleContext.cs b/src/integrations/src/AXOpen.Integrations/AxoTextListExample/AxoTextListExampleContext.cs index 6e0263dce..6c777c282 100644 --- a/src/integrations/src/AXOpen.Integrations/AxoTextListExample/AxoTextListExampleContext.cs +++ b/src/integrations/src/AXOpen.Integrations/AxoTextListExample/AxoTextListExampleContext.cs @@ -3,6 +3,7 @@ public partial class AxoTextListExampleContext : AXOpen.Core.AxoContext { Dictionary descriptionDict = new Dictionary(); + Dictionary descriptionDict3 = new Dictionary(); public string Description { @@ -19,7 +20,7 @@ public string Description } string description = " "; - if (descriptionDict.TryGetValue(_myTextList.Id.LastValue, out description)) + if (descriptionDict.TryGetValue(_myTextList1.Id.LastValue, out description)) { return description; } @@ -31,6 +32,32 @@ public string Description } } + public string Description3 + { + get + { + if (descriptionDict3 == null) { descriptionDict3 = new Dictionary(); } + if (descriptionDict3.Count == 0) + { + descriptionDict3.Add(0, " "); + for (int i = 1; i < 1000; i++) + { + descriptionDict3.Add((uint)i, "Item from the totally different text list : " + i.ToString()); + } + + } + string description3 = " "; + if (descriptionDict3.TryGetValue(_myTextList3.Id.LastValue, out description3)) + { + return description3; + } + else + + { + return " "; + } + } + } } }