VPWCellUIControl.xaml.cs 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262
  1. using MECF.Framework.Common.OperationCenter;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using System.Windows;
  8. using System.Windows.Controls;
  9. using System.Windows.Data;
  10. using System.Windows.Documents;
  11. using System.Windows.Input;
  12. using System.Windows.Media;
  13. using System.Windows.Media.Imaging;
  14. using System.Windows.Navigation;
  15. using System.Windows.Shapes;
  16. namespace PunkHPX8_Themes.UserControls
  17. {
  18. /// <summary>
  19. /// VPWCellUIControl.xaml 的交互逻辑
  20. /// </summary>
  21. public partial class VPWCellUIControl : UserControl
  22. {
  23. public VPWCellUIControl()
  24. {
  25. InitializeComponent();
  26. }
  27. public static readonly DependencyProperty ModuleNameProperty = DependencyProperty.Register(
  28. "ModuleName", typeof(string), typeof(VPWCellUIControl),
  29. new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.AffectsRender));
  30. /// <summary>
  31. /// 模块名称
  32. /// </summary>
  33. public string ModuleName
  34. {
  35. get
  36. {
  37. return (string)this.GetValue(ModuleNameProperty);
  38. }
  39. set
  40. {
  41. this.SetValue(ModuleNameProperty, value);
  42. }
  43. }
  44. public static readonly DependencyProperty DripValveProerty = DependencyProperty.Register(
  45. "DripValve", typeof(bool), typeof(VPWCellUIControl), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
  46. /// <summary>
  47. /// DripValve
  48. /// </summary>
  49. public bool DripValve
  50. {
  51. get
  52. {
  53. return (bool)this.GetValue(DripValveProerty);
  54. }
  55. set
  56. {
  57. this.SetValue(DripValveProerty, value);
  58. }
  59. }
  60. public static readonly DependencyProperty SmallValveProerty = DependencyProperty.Register(
  61. "SmallValve", typeof(bool), typeof(VPWCellUIControl), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
  62. /// <summary>
  63. /// SmallValve
  64. /// </summary>
  65. public bool SmallValve
  66. {
  67. get
  68. {
  69. return (bool)this.GetValue(SmallValveProerty);
  70. }
  71. set
  72. {
  73. this.SetValue(SmallValveProerty, value);
  74. }
  75. }
  76. public static readonly DependencyProperty LargeValveProerty = DependencyProperty.Register(
  77. "LargeValve", typeof(bool), typeof(VPWCellUIControl), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
  78. /// <summary>
  79. /// LargeValve
  80. /// </summary>
  81. public bool LargeValve
  82. {
  83. get
  84. {
  85. return (bool)this.GetValue(LargeValveProerty);
  86. }
  87. set
  88. {
  89. this.SetValue(LargeValveProerty, value);
  90. }
  91. }
  92. public static readonly DependencyProperty VentValveProerty = DependencyProperty.Register(
  93. "VentValve", typeof(bool), typeof(VPWCellUIControl), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
  94. /// <summary>
  95. /// VentValve
  96. /// </summary>
  97. public bool VentValve
  98. {
  99. get
  100. {
  101. return (bool)this.GetValue(VentValveProerty);
  102. }
  103. set
  104. {
  105. this.SetValue(VentValveProerty, value);
  106. }
  107. }
  108. public static readonly DependencyProperty DrainValveProerty = DependencyProperty.Register(
  109. "DrainValve", typeof(bool), typeof(VPWCellUIControl), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
  110. /// <summary>
  111. /// DrainValve
  112. /// </summary>
  113. public bool DrainValve
  114. {
  115. get
  116. {
  117. return (bool)this.GetValue(DrainValveProerty);
  118. }
  119. set
  120. {
  121. this.SetValue(DrainValveProerty, value);
  122. }
  123. }
  124. public static readonly DependencyProperty VacuumValveProerty = DependencyProperty.Register(
  125. "VacuumValve", typeof(bool), typeof(VPWCellUIControl), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
  126. /// <summary>
  127. /// VacuumValve
  128. /// </summary>
  129. public bool VacuumValve
  130. {
  131. get
  132. {
  133. return (bool)this.GetValue(VacuumValveProerty);
  134. }
  135. set
  136. {
  137. this.SetValue(VacuumValveProerty, value);
  138. }
  139. }
  140. public static readonly DependencyProperty DIWLoopDoProperty = DependencyProperty.Register(
  141. "DIWLoopDo", typeof(double), typeof(VPWCellUIControl), new FrameworkPropertyMetadata(0.0, FrameworkPropertyMetadataOptions.AffectsRender));
  142. /// <summary>
  143. /// DIWLoopDo
  144. /// </summary>
  145. public double DIWLoopDo
  146. {
  147. get
  148. {
  149. return (double)this.GetValue(DIWLoopDoProperty);
  150. }
  151. set
  152. {
  153. this.SetValue(DIWLoopDoProperty, value);
  154. }
  155. }
  156. public static readonly DependencyProperty DIWFlowProperty = DependencyProperty.Register(
  157. "DIWFlow", typeof(double), typeof(VPWCellUIControl), new FrameworkPropertyMetadata(0.0, FrameworkPropertyMetadataOptions.AffectsRender));
  158. /// <summary>
  159. /// DIWFlow
  160. /// </summary>
  161. public double DIWFlow
  162. {
  163. get
  164. {
  165. return (double)this.GetValue(DIWFlowProperty);
  166. }
  167. set
  168. {
  169. this.SetValue(DIWFlowProperty, value);
  170. }
  171. }
  172. public static readonly DependencyProperty CellVacuumProperty = DependencyProperty.Register(
  173. "CellVacuum", typeof(double), typeof(VPWCellUIControl), new FrameworkPropertyMetadata(0.0, FrameworkPropertyMetadataOptions.AffectsRender));
  174. /// <summary>
  175. /// CellVacuum
  176. /// </summary>
  177. public double CellVacuum
  178. {
  179. get
  180. {
  181. return (double)this.GetValue(CellVacuumProperty);
  182. }
  183. set
  184. {
  185. this.SetValue(CellVacuumProperty, value);
  186. }
  187. }
  188. private void OpenDripValve_Click(object sender, RoutedEventArgs e)
  189. {
  190. InvokeClient.Instance.Service.DoOperation($"{ModuleName}.FlowDripOn");
  191. }
  192. private void CloseDripValve_Click(object sender, RoutedEventArgs e)
  193. {
  194. InvokeClient.Instance.Service.DoOperation($"{ModuleName}.FlowDripOff");
  195. }
  196. private void OpenSmallValve_Click(object sender, RoutedEventArgs e)
  197. {
  198. InvokeClient.Instance.Service.DoOperation($"{ModuleName}.FlowSmallOn");
  199. }
  200. private void CloseSmallValve_Click(object sender, RoutedEventArgs e)
  201. {
  202. InvokeClient.Instance.Service.DoOperation($"{ModuleName}.FlowSmallOff");
  203. }
  204. private void OpenLargeValve_Click(object sender, RoutedEventArgs e)
  205. {
  206. InvokeClient.Instance.Service.DoOperation($"{ModuleName}.FlowLargeOn");
  207. }
  208. private void CloseLargeValve_Click(object sender, RoutedEventArgs e)
  209. {
  210. InvokeClient.Instance.Service.DoOperation($"{ModuleName}.FlowLargeOff");
  211. }
  212. private void OpenVentValve_Click(object sender, RoutedEventArgs e)
  213. {
  214. InvokeClient.Instance.Service.DoOperation($"{ModuleName}.VentValveOn");
  215. }
  216. private void CloseVentValve_Click(object sender, RoutedEventArgs e)
  217. {
  218. InvokeClient.Instance.Service.DoOperation($"{ModuleName}.VentValveOff");
  219. }
  220. private void OpenDrainValve_Click(object sender, RoutedEventArgs e)
  221. {
  222. InvokeClient.Instance.Service.DoOperation($"{ModuleName}.DrainValveOn");
  223. }
  224. private void CloseDrainValve_Click(object sender, RoutedEventArgs e)
  225. {
  226. InvokeClient.Instance.Service.DoOperation($"{ModuleName}.DrainValveOff");
  227. }
  228. private void OpenCellVacuumValve_Click(object sender, RoutedEventArgs e)
  229. {
  230. InvokeClient.Instance.Service.DoOperation($"{ModuleName}.VacuumValveOn");
  231. }
  232. private void CloseCellVacuumValve_Click(object sender, RoutedEventArgs e)
  233. {
  234. InvokeClient.Instance.Service.DoOperation($"{ModuleName}.VacuumValveOff");
  235. }
  236. }
  237. }