Browse Source

mfcText 超限后 数值再次变化 颜色未更改问题

jiangjy 1 month ago
parent
commit
bf26715ce1

+ 3 - 0
Furnace/FurnaceUI/Views/Operations/Maintenances/ManualSetViewModel.cs

@@ -28,6 +28,7 @@ using System.Linq;
 using System.Reflection;
 using System.Windows;
 using System.Windows.Controls;
+using System.Windows.Media;
 
 namespace FurnaceUI.Views.Recipes
 {
@@ -1675,6 +1676,7 @@ namespace FurnaceUI.Views.Recipes
 
         public void MFCTextChanged(string type, object sender, object item)
         {
+            BrushConverter brushConverter = new BrushConverter();
             try
             {
                 if (!string.IsNullOrEmpty(type) && item != null && sender != null)
@@ -1705,6 +1707,7 @@ namespace FurnaceUI.Views.Recipes
 
                             if (setValue != aITMfcData.SetPoint)
                             {
+                                ((TextBoxEx)sender).ChangedColor = (Brush)brushConverter.ConvertFromString("Yellow");
                                 mFCData.IsSetChanged = false;
                             }
                             else

+ 11 - 0
Furnace/FurnaceUI/Views/Recipes/RecipeProcessEditViewModel.cs

@@ -1,4 +1,5 @@
 using Aitex.Core.Common.DeviceData;
+using Aitex.Core.RT.IOCore;
 using Aitex.Core.Util;
 using Caliburn.Micro;
 using Caliburn.Micro.Core;
@@ -31,6 +32,7 @@ using System.Threading.Tasks;
 using System.Windows;
 using System.Windows.Controls;
 using System.Windows.Input;
+using System.Windows.Media;
 
 namespace FurnaceUI.Views.Recipes
 {
@@ -2778,10 +2780,17 @@ namespace FurnaceUI.Views.Recipes
                             DialogBox.ShowWarning($"{mFCData.ControlName} Out of the setting range {0}~{maxData}!");
                             ((TextBoxEx)sender).ChangedColor = ((TextBoxEx)sender).NormalColor;
                             SetSetPointValue(mFCData.ControlName, $"0");
+
+                          
                             return;
                         }
                         else
                         {
+                            BrushConverter brushConverter = new BrushConverter();
+                            if (setValue > 0)
+                            {
+                                ((TextBoxEx)sender).ChangedColor = (Brush)brushConverter.ConvertFromString("Yellow");
+                            }
                             InvokeClient.Instance.Service.DoOperation($"PM1.{mFCData.ControlName}.SetMfcVirtualValue", $"{value};{mFCData.Rampng.Value};{mFCData.AlarmValue}");
                         }
                         break;
@@ -2798,6 +2807,7 @@ namespace FurnaceUI.Views.Recipes
         {
             if (double.TryParse(value, out double getValue))
             {
+               
                 var stepNo = 0;
                 if (!_isStandbyCheckedSelect)
                     stepNo = SelectedRecipeStep.StepNo;
@@ -2808,6 +2818,7 @@ namespace FurnaceUI.Views.Recipes
                     if (mfc != null)
                     {
                         mfc.SetValue.SetValue(value);
+                      
                     }
                 }
             }