Selaa lähdekoodia

ELK需求162:MFC51编辑完显示feedback
现在逻辑:MFC51不在编辑状态显示的是monitor状态下值,编辑状态时显示根据原来逻辑,manual状态显示setpoint。

huangping 1 kuukausi sitten
vanhempi
commit
4577b32a4d

+ 30 - 9
FrameworkLocal/UICore/Control/AnalogControl4Jet.xaml.cs

@@ -112,9 +112,23 @@ namespace Aitex.Core.UI.Control
             }
         }
 
-     
-      
-      
+
+        /// <summary>
+        /// 虚拟状态--应对需要显示其他状态的值
+        /// </summary>
+        public string VirtualGasStateType
+        {
+            get { return (string)GetValue(VirtualGasStateTypeProperty); }
+            set { SetValue(VirtualGasStateTypeProperty, value); }
+        }
+
+        // Using a DependencyProperty as the backing store for VirtualGasStateType.  This enables animation, styling, binding, etc...
+        public static readonly DependencyProperty VirtualGasStateTypeProperty =
+            DependencyProperty.Register("VirtualGasStateType", typeof(string), typeof(AnalogControl4Jet), new PropertyMetadata(""));
+
+
+
+
         private static void OnDeviceDataChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
         {
             var self = (AnalogControl4Jet)d;
@@ -199,6 +213,7 @@ namespace Aitex.Core.UI.Control
                 this.SetValue(HideDialogProperty, value);
             }
         }
+        private bool _isEdit=false;
 
         protected override void OnRender(DrawingContext drawingContext)
         {
@@ -249,7 +264,12 @@ namespace Aitex.Core.UI.Control
             if (DeviceData != null)
             {
                 BrushConverter brushConverter = new BrushConverter();
-                switch (GasStateType)
+                var type = GasStateType;
+                if(!_isEdit&&Enum.TryParse(VirtualGasStateType,out GasPanelStateType result))
+                {
+                    type = result;
+                }
+                switch (type)
                 {
                     case GasPanelStateType.Manual:
                         ShowValue = DeviceData.SetPoint.ToString("f3");
@@ -429,11 +449,12 @@ namespace Aitex.Core.UI.Control
 
         private void Grid_TouchUp(object sender, TouchEventArgs e)
         {
-            if (DeviceData == null)
-                return;
-            if (GasStateType == GasPanelStateType.Monitor) return;
-            if (HideDialog)
+            _isEdit = true;
+            if (DeviceData == null|| GasStateType == GasPanelStateType.Monitor|| HideDialog)
+            {
+                _isEdit = false; 
                 return;
+            }
             BrushConverter brushConverter = new BrushConverter();
             InputDialogBox dialogBox = new InputDialogBox
             {
@@ -497,7 +518,7 @@ namespace Aitex.Core.UI.Control
             dialogBox.Close();
             dialogBox.Dispose();
             RefreshMFCData();
-
+            _isEdit = false;
         }
     }
 }

+ 1 - 0
Furnace/FurnaceUI/Views/Operations/Maintenances/N2PurgeStatusView.xaml

@@ -952,6 +952,7 @@
                                 Command="{Binding CmdSetMfcFlow}"
                                 DeviceData="{Binding MFC51}"
                                 GasStateType="{Binding SelectedGasStateType, UpdateSourceTrigger=PropertyChanged}"
+                                VirtualGasStateType="Monitor"
                                 IsEnabled="{Binding IsManagerPermission}"
                                 TagName="Number"
                                 ViewName="GasPanelView"/>