PrewetUIControl.xaml.cs 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. using MECF.Framework.Common.CommonData.Prewet;
  2. using MECF.Framework.Common.OperationCenter;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows;
  10. using System.Windows.Controls;
  11. using System.Windows.Data;
  12. using System.Windows.Documents;
  13. using System.Windows.Input;
  14. using System.Windows.Media;
  15. using System.Windows.Media.Animation;
  16. using System.Windows.Media.Imaging;
  17. using System.Windows.Media.Media3D;
  18. using System.Windows.Navigation;
  19. using System.Windows.Shapes;
  20. using static System.Net.Mime.MediaTypeNames;
  21. namespace CyberX8_Themes.UserControls
  22. {
  23. /// <summary>
  24. /// PrewetUIControl.xaml 的交互逻辑
  25. /// </summary>
  26. public partial class PrewetUIControl : UserControl
  27. {
  28. public PrewetUIControl()
  29. {
  30. InitializeComponent();
  31. }
  32. public static readonly DependencyProperty ModuleNameProperty = DependencyProperty.Register(
  33. "ModuleName", typeof(string), typeof(PrewetUIControl),
  34. new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.AffectsRender));
  35. /// <summary>
  36. /// 模块名称
  37. /// </summary>
  38. public string ModuleName
  39. {
  40. get
  41. {
  42. return (string)this.GetValue(ModuleNameProperty);
  43. }
  44. set
  45. {
  46. this.SetValue(ModuleNameProperty, value);
  47. }
  48. }
  49. public static readonly DependencyProperty PumpDataProperty = DependencyProperty.Register(
  50. "PumpData", typeof(PrewetPumpData), typeof(PrewetUIControl), new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.AffectsRender));
  51. /// <summary>
  52. /// PumpData
  53. /// </summary>
  54. public PrewetPumpData PumpData
  55. {
  56. get
  57. {
  58. return (PrewetPumpData)this.GetValue(PumpDataProperty);
  59. }
  60. set
  61. {
  62. this.SetValue(PumpDataProperty, value);
  63. }
  64. }
  65. public static readonly DependencyProperty IsErrorProerty = DependencyProperty.Register(
  66. "IsError",typeof(bool), typeof(PrewetUIControl), new FrameworkPropertyMetadata(false,FrameworkPropertyMetadataOptions.AffectsRender));
  67. /// <summary>
  68. /// 工艺腔体是否error
  69. /// </summary>
  70. public bool IsError
  71. {
  72. get
  73. {
  74. return (bool)this.GetValue(IsErrorProerty);
  75. }
  76. set
  77. {
  78. this.SetValue(IsErrorProerty, value);
  79. }
  80. }
  81. public static readonly DependencyProperty IsWaferHolderProerty = DependencyProperty.Register(
  82. "IsWaferHolder", typeof(bool), typeof(PrewetUIControl), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
  83. /// <summary>
  84. /// 工艺腔体是否存在WaferHolder
  85. /// </summary>
  86. public bool IsWaferHolder
  87. {
  88. get
  89. {
  90. return (bool)this.GetValue(IsWaferHolderProerty);
  91. }
  92. set
  93. {
  94. this.SetValue(IsWaferHolderProerty, value);
  95. }
  96. }
  97. public static readonly DependencyProperty TankColorLevelProperty = DependencyProperty.Register(
  98. "TankColorLevel", typeof(int), typeof(PrewetUIControl), new FrameworkPropertyMetadata(2, FrameworkPropertyMetadataOptions.AffectsRender));
  99. /// <summary>
  100. /// TankColorLevel 用于储水罐变色
  101. /// </summary>
  102. public int TankColorLevel
  103. {
  104. get
  105. {
  106. return (int)this.GetValue(TankColorLevelProperty);
  107. }
  108. set
  109. {
  110. this.SetValue(TankColorLevelProperty, value);
  111. }
  112. }
  113. public static readonly DependencyProperty IsPumpValvaOpenProperty = DependencyProperty.Register(
  114. "IsPumpValvaOpen", typeof(bool), typeof(PrewetUIControl), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
  115. /// <summary>
  116. /// IsPumpValvaOpen
  117. /// </summary>
  118. public bool IsPumpValvaOpen
  119. {
  120. get
  121. {
  122. return (bool)this.GetValue(IsPumpValvaOpenProperty);
  123. }
  124. set
  125. {
  126. this.SetValue(IsPumpValvaOpenProperty, value);
  127. }
  128. }
  129. public static readonly DependencyProperty YaxleDataProperty = DependencyProperty.Register(
  130. "YaxleData", typeof(double), typeof(PrewetUIControl), new FrameworkPropertyMetadata(170.00, FrameworkPropertyMetadataOptions.AffectsRender));
  131. /// <summary>
  132. /// YaxleData Linmot Y轴位置
  133. /// </summary>
  134. public double YaxleData
  135. {
  136. get
  137. {
  138. return (double)this.GetValue(YaxleDataProperty);
  139. }
  140. set
  141. {
  142. this.SetValue(YaxleDataProperty, value);
  143. }
  144. }
  145. private void OpenPumpValve_Click(object sender, RoutedEventArgs e)
  146. {
  147. InvokeClient.Instance.Service.DoOperation($"Prewet1.PumpValveOn");
  148. }
  149. private void ClosePumpValve_Click(object sender, RoutedEventArgs e)
  150. {
  151. InvokeClient.Instance.Service.DoOperation($"Prewet1.PumpValveOff");
  152. }
  153. }
  154. }