|
@@ -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;
|
|
|
}
|
|
|
}
|
|
|
}
|