Browse Source

MFC变色bug 调整

jiangjy 1 month ago
parent
commit
e7a36d0b08

+ 29 - 6
FrameworkLocal/UICore/Control/AnalogControl4Jet.xaml.cs

@@ -112,6 +112,9 @@ namespace Aitex.Core.UI.Control
             }
         }
 
+     
+      
+      
         private static void OnDeviceDataChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
         {
             var self = (AnalogControl4Jet)d;
@@ -164,7 +167,7 @@ namespace Aitex.Core.UI.Control
         {
             get
             {
-               
+
                 return (AnalogDeviceDataItem)this.GetValue(DeviceDataProperty);
             }
             set
@@ -205,7 +208,8 @@ namespace Aitex.Core.UI.Control
             RefreshMFCData();
         }
 
-        private void RefreshMFCData()
+      
+        public void RefreshMFCData()
         {
             #region FeedBack
             if (DeviceData == null) return;
@@ -267,8 +271,21 @@ namespace Aitex.Core.UI.Control
                         break;
                     case GasPanelStateType.Recipe:
                         ShowValue = DeviceData.VirtualFeedBack.ToString("f3");
-                        topBorder.Background = (float.Parse(ShowValue) > 0 && "RecipeView".Equals(ViewName)) ? (Brush)brushConverter.ConvertFromString("#FFFFD2") : (Brush)brushConverter.ConvertFromString("#B0D1F1");
-                        downBorder.Background = (float.Parse(ShowValue) > 0 && "RecipeView".Equals(ViewName)) ? (Brush)brushConverter.ConvertFromString("#FFFFD2") : (Brush)brushConverter.ConvertFromString("#B0D1F1");
+
+                        if ("RecipeView".Equals(ViewName))
+                        {
+                            if (DeviceData.IsCharge || (float.Parse(ShowValue) > 0))
+                            {
+                                topBorder.Background = (Brush)brushConverter.ConvertFromString("#FFFFD2");
+                                downBorder.Background = (Brush)brushConverter.ConvertFromString("#FFFFD2");
+                            }
+                            else
+                            {
+                                topBorder.Background = (Brush)brushConverter.ConvertFromString("#B0D1F1");
+                                downBorder.Background = (Brush)brushConverter.ConvertFromString("#B0D1F1");
+                            }
+                        }
+
                         break;
                     default:
                         ShowValue = 0.ToString("f3");
@@ -354,6 +371,12 @@ namespace Aitex.Core.UI.Control
         }
 
 
+        private void ExecuteOrNull(double value, double? ramp)
+        {
+           
+                Execute(value, ramp);
+
+        }
         private void Execute(double value, double? ramp)
         {
             if (!IsExecute)
@@ -414,7 +437,7 @@ namespace Aitex.Core.UI.Control
             BrushConverter brushConverter = new BrushConverter();
             InputDialogBox dialogBox = new InputDialogBox
             {
-                CommandDelegate = Execute,
+                CommandDelegate = ExecuteOrNull,
                 DeviceName = string.Format("{0}: {1}", DeviceData.Type, DeviceData.DisplayName),
                 DeviceId = DeviceData.DeviceId,
                 DefaultValue = DeviceData.DefaultValue,
@@ -473,7 +496,7 @@ namespace Aitex.Core.UI.Control
             //SetCursorPos(0, 0);
             dialogBox.Close();
             dialogBox.Dispose();
-
+            RefreshMFCData();
 
         }
     }

+ 3 - 3
Furnace/FurnaceUI/Views/Editors/ELK/RecipeGasPanelSettingView.xaml

@@ -12968,9 +12968,9 @@
                     Height="36"
                     HorizontalAlignment="Left"
                     VerticalAlignment="Top"
-                    Command="{Binding CmdSetMfcFlow}"
-                    DeviceData="{Binding MFC1}"
-                    GasStateType="{Binding SelectedGasStateType}"
+                    Command="{Binding CmdSetMfcFlow,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged,Delay=10}"
+                    DeviceData="{Binding MFC1,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged,Delay=10}"
+                    GasStateType="{Binding SelectedGasStateType,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged,Delay=10}"
                     IsExecute="true"
                     RampVisibility="Visible"
                     TagName="Number:3"

+ 14 - 1
Furnace/FurnaceUI/Views/Editors/ELK/RecipeGasPanelSettingViewModel.cs

@@ -19,6 +19,7 @@ using OpenSEMI.ClientBase;
 using Aitex.Core.UI.Control;
 using MECF.Framework.UI.Core.Control;
 using MECF.Framework.UI.Core.ExtendedControls;
+using System.Reflection;
 namespace FurnaceUI.Views.Editors.ELK
 {
     public class RecipeGasPanelSettingViewModel : FurnaceUIViewModelBase, IDisposable
@@ -1160,6 +1161,7 @@ namespace FurnaceUI.Views.Editors.ELK
                 FeedBack = SelectedGasStateType == GasPanelStateType.Monitor ? aITMfcData.FeedBack : aITMfcData.SetPoint,
                 SetPoint = double.Parse(mfcStrValue),
                 VirtualFeedBack = aITMfcData.VirtualFeedBack,
+                IsCharge = true
             };
         }
 
@@ -1311,7 +1313,18 @@ namespace FurnaceUI.Views.Editors.ELK
         {
             base.InvokeAfterUpdateProperty(data);
             MFCChangedUpdate();
-
+            if (SelectedGasStateType == GasPanelStateType.Recipe)
+            {
+                PropertyInfo[] tempProperties = GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance);
+                foreach (PropertyInfo property in tempProperties)
+                {
+                    if (property.Name.Contains("MFC"))
+                    {
+                        // 触发属性更改通知
+                        NotifyOfPropertyChange(property.Name);
+                    }
+                }
+            }
         }
 
         private void MFCChangedUpdate()

+ 17 - 8
Furnace/FurnaceUI/Views/Maintenances/Maintenances/ELK/GasPanelViewModel.cs

@@ -567,7 +567,7 @@ namespace FurnaceUI.Views.Maintenances.Maintenances.ELK
                 {
                     return "Green";
                 }
-                return"#FFB0D1F1";
+                return "#FFB0D1F1";
             }
         }
 
@@ -1170,7 +1170,7 @@ namespace FurnaceUI.Views.Maintenances.Maintenances.ELK
                         DefaultValue = valve.DefaultValue,
                         SetPoint = valve.SetPoint,
                         Feedback = APCModeFeedback != 5,
-                        IsILKOK=true,
+                        IsILKOK = true,
                         VirtualFeedback = valve.VirtualFeedback
                     };
                 }
@@ -1352,7 +1352,7 @@ namespace FurnaceUI.Views.Maintenances.Maintenances.ELK
                     mfcData.SetRampValue = (double)args[3];
                     InvokeClient.Instance.Service.DoOperation($"System.SetConfig", $"PM1.MFC.{args[0].ToString().Split('.').LastOrDefault()}.SetLastRamping", args[3]);
                 }
-                InvokeClient.Instance.Service.DoOperation($"{args[0]}.{args[1]}", args[2]);
+                //InvokeClient.Instance.Service.DoOperation($"{args[0]}.{args[1]}", args[2]);
             }
         }
         private void PerformCmdSetMfmFlow(object param)
@@ -1637,7 +1637,7 @@ namespace FurnaceUI.Views.Maintenances.Maintenances.ELK
                 foreach (var item in properties)
                 {
                     var tempObj = item.GetValue(this);
-                    
+
                     if (item.PropertyType.Name.Contains("Data") && tempObj is AITValveData)
                     {
                         var aitTempObj = (AITValveData)tempObj;
@@ -1656,7 +1656,7 @@ namespace FurnaceUI.Views.Maintenances.Maintenances.ELK
             }
         }
 
-   
+
         private void MFCSetPointUpdate()
         {
             SetMFCSetPoint(MFC1);
@@ -1688,6 +1688,15 @@ namespace FurnaceUI.Views.Maintenances.Maintenances.ELK
             {
                 mfcShow.SetPoint = tempValue;
             }
+            if (findMfc != null && !findMfc.IsSetChanged)
+            {
+                mfcShow.IsCharge = true;
+            }
+            else
+            {
+                mfcShow.IsCharge = false;
+
+            }
 
         }
 
@@ -1768,7 +1777,7 @@ namespace FurnaceUI.Views.Maintenances.Maintenances.ELK
             {
                 return;
             }
-         
+
             switch (name.ToUpper())
             {
                 case "BWR":
@@ -1896,7 +1905,7 @@ namespace FurnaceUI.Views.Maintenances.Maintenances.ELK
                                 DictChangedValve.Add(item.Key, valveNew.Feedback);
                             }
                         }
-                        
+
                     }
                 }
             }
@@ -1931,7 +1940,7 @@ namespace FurnaceUI.Views.Maintenances.Maintenances.ELK
                         }
                         else
                         {
-                            DictChangedMFC.Add(item.Key, mfcNew.SetValue);
+                            DictChangedMFC.Add(item.Key, mfcNew.SetPoint);
                         }
                     }
                     if (mfcNew.IsRampCharge)