MetalSHUIControl.xaml.cs 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  1. using MECF.Framework.Common.CommonData.Metal;
  2. using MECF.Framework.Common.CommonData.Prewet;
  3. using MECF.Framework.Common.OperationCenter;
  4. using System;
  5. using System.Collections.Generic;
  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.Imaging;
  16. using System.Windows.Navigation;
  17. using System.Windows.Shapes;
  18. namespace CyberX8_Themes.UserControls
  19. {
  20. /// <summary>
  21. /// MetalSHUIControl.xaml 的交互逻辑
  22. /// </summary>
  23. public partial class MetalSHUIControl : UserControl
  24. {
  25. public MetalSHUIControl()
  26. {
  27. InitializeComponent();
  28. }
  29. public static readonly DependencyProperty ModuleNameProperty = DependencyProperty.Register(
  30. "ModuleName", typeof(string), typeof(MetalSHUIControl),
  31. new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.AffectsRender));
  32. /// <summary>
  33. /// 模块名称
  34. /// </summary>
  35. public string ModuleName
  36. {
  37. get
  38. {
  39. return (string)this.GetValue(ModuleNameProperty);
  40. }
  41. set
  42. {
  43. this.SetValue(ModuleNameProperty, value);
  44. }
  45. }
  46. public static readonly DependencyProperty MetalDataProperty = DependencyProperty.Register(
  47. "MetalData", typeof(StandardHotMetalDeviceData), typeof(MetalSHUIControl), new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.AffectsRender));
  48. /// <summary>
  49. /// MetalDeviceData
  50. /// </summary>
  51. public StandardHotMetalDeviceData MetalData
  52. {
  53. get
  54. {
  55. return (StandardHotMetalDeviceData)this.GetValue(MetalDataProperty);
  56. }
  57. set
  58. {
  59. this.SetValue(MetalDataProperty, value);
  60. }
  61. }
  62. public static readonly DependencyProperty IsErrorProerty = DependencyProperty.Register(
  63. "IsError", typeof(bool), typeof(MetalSHUIControl), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
  64. /// <summary>
  65. /// 工艺腔体是否error
  66. /// </summary>
  67. public bool IsError
  68. {
  69. get
  70. {
  71. return (bool)this.GetValue(IsErrorProerty);
  72. }
  73. set
  74. {
  75. this.SetValue(IsErrorProerty, value);
  76. }
  77. }
  78. public static readonly DependencyProperty TankColorLevelProperty = DependencyProperty.Register(
  79. "TankColorLevel", typeof(int), typeof(MetalSHUIControl), new FrameworkPropertyMetadata(2, FrameworkPropertyMetadataOptions.AffectsRender));
  80. /// <summary>
  81. /// TankColorLevel 用于储水罐变色
  82. /// </summary>
  83. public int TankColorLevel
  84. {
  85. get
  86. {
  87. return (int)this.GetValue(TankColorLevelProperty);
  88. }
  89. set
  90. {
  91. this.SetValue(TankColorLevelProperty, value);
  92. }
  93. }
  94. public static readonly DependencyProperty IsClampValveOpenProperty = DependencyProperty.Register(
  95. "IsClampValveOpen", typeof(bool), typeof(MetalSHUIControl), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
  96. /// <summary>
  97. /// ClampValve状态
  98. /// </summary>
  99. public bool IsClampValveOpen
  100. {
  101. get
  102. {
  103. return (bool)this.GetValue(IsClampValveOpenProperty);
  104. }
  105. set
  106. {
  107. this.SetValue(IsClampValveOpenProperty, value);
  108. }
  109. }
  110. public static readonly DependencyProperty IsSingalPumpProperty = DependencyProperty.Register(
  111. "IsSingalPump", typeof(bool), typeof(MetalSHUIControl), new FrameworkPropertyMetadata(true, FrameworkPropertyMetadataOptions.AffectsRender));
  112. /// <summary>
  113. /// ClampValve状态
  114. /// </summary>
  115. public bool IsSingalPump
  116. {
  117. get
  118. {
  119. return (bool)this.GetValue(IsSingalPumpProperty);
  120. }
  121. set
  122. {
  123. this.SetValue(IsSingalPumpProperty, value);
  124. }
  125. }
  126. public static readonly DependencyProperty IsCellCirculationValveOnProperty = DependencyProperty.Register(
  127. "IsCellCirculationValveOn", typeof(bool), typeof(MetalSHUIControl), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
  128. /// <summary>
  129. /// CellCirculationValve状态(true:cell flow,false:cell bypass)
  130. /// </summary>
  131. public bool IsCellCirculationValveOn
  132. {
  133. get
  134. {
  135. return (bool)this.GetValue(IsCellCirculationValveOnProperty);
  136. }
  137. set
  138. {
  139. this.SetValue(IsCellCirculationValveOnProperty, value);
  140. }
  141. }
  142. public static readonly DependencyProperty IsCellPumpOnProperty = DependencyProperty.Register(
  143. "IsCellPumpOn", typeof(bool), typeof(MetalSHUIControl), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
  144. /// <summary>
  145. /// CellPump状态
  146. /// </summary>
  147. public bool IsCellPumpOn
  148. {
  149. get
  150. {
  151. return (bool)this.GetValue(IsCellPumpOnProperty);
  152. }
  153. set
  154. {
  155. this.SetValue(IsCellPumpOnProperty, value);
  156. }
  157. }
  158. public static readonly DependencyProperty YaxleDataProperty = DependencyProperty.Register(
  159. "YaxleData", typeof(double), typeof(MetalSHUIControl), new FrameworkPropertyMetadata(170.00, FrameworkPropertyMetadataOptions.AffectsRender));
  160. /// <summary>
  161. /// YaxleData Linmot Y轴位置
  162. /// </summary>
  163. public double YaxleData
  164. {
  165. get
  166. {
  167. return (double)this.GetValue(YaxleDataProperty);
  168. }
  169. set
  170. {
  171. this.SetValue(YaxleDataProperty, value);
  172. }
  173. }
  174. public static readonly DependencyProperty CellFlowProperty = DependencyProperty.Register(
  175. "CellFlow", typeof(double), typeof(MetalSHUIControl),
  176. new FrameworkPropertyMetadata((double)0, FrameworkPropertyMetadataOptions.AffectsRender));
  177. /// <summary>
  178. /// Cell Flow
  179. /// </summary>
  180. public double CellFlow
  181. {
  182. get
  183. {
  184. return (double)this.GetValue(CellFlowProperty);
  185. }
  186. set
  187. {
  188. this.SetValue(CellFlowProperty, value);
  189. }
  190. }
  191. public static readonly DependencyProperty IsWaferHolderProerty = DependencyProperty.Register(
  192. "IsWaferHolder", typeof(bool), typeof(MetalSHUIControl), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
  193. /// <summary>
  194. /// 工艺腔体是否存在WaferHolder
  195. /// </summary>
  196. public bool IsWaferHolder
  197. {
  198. get
  199. {
  200. return (bool)this.GetValue(IsWaferHolderProerty);
  201. }
  202. set
  203. {
  204. this.SetValue(IsWaferHolderProerty, value);
  205. }
  206. }
  207. /// <summary>
  208. /// Clamp Valve
  209. /// </summary>
  210. /// <param name="sender"></param>
  211. /// <param name="e"></param>
  212. private void OpenClampValve_Click(object sender, RoutedEventArgs e)
  213. {
  214. InvokeClient.Instance.Service.DoOperation($"{ModuleName}.ClampOn");
  215. }
  216. private void CloseClampValve_Click(object sender, RoutedEventArgs e)
  217. {
  218. InvokeClient.Instance.Service.DoOperation($"{ModuleName}.ClampOff");
  219. }
  220. /// <summary>
  221. /// Cell Circulation Valve(三向阀)
  222. /// </summary>
  223. /// <param name="sender"></param>
  224. /// <param name="e"></param>
  225. /// 打开Cell Flow(关闭Cell Bypass)
  226. private void OpenCellFlow_Click(object sender, RoutedEventArgs e)
  227. {
  228. InvokeClient.Instance.Service.DoOperation($"{ModuleName}.CellSwitchToFlow");
  229. }
  230. /// <summary>
  231. /// 打开CellBypass(关闭Cell Flow)
  232. /// </summary>
  233. /// <param name="sender"></param>
  234. /// <param name="e"></param>
  235. private void OpenCellBypass_Click(object sender, RoutedEventArgs e)
  236. {
  237. InvokeClient.Instance.Service.DoOperation($"{ModuleName}.CellSwitchToBypass");
  238. }
  239. }
  240. }