LoaderStationSideControl.xaml.cs 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482
  1. using MECF.Framework.Common.OperationCenter;
  2. using CyberX8_Core;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Text.RegularExpressions;
  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. /// LoaderStationSideControl.xaml 的交互逻辑
  22. /// </summary>
  23. public partial class LoaderStationSideControl : UserControl
  24. {
  25. #region 属性
  26. public static readonly DependencyProperty ModuleNameProperty = DependencyProperty.Register(
  27. "ModuleName", typeof(string), typeof(LoaderStationSideControl),
  28. new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.AffectsRender));
  29. /// <summary>
  30. /// 模块名称
  31. /// </summary>
  32. public string ModuleName
  33. {
  34. get
  35. {
  36. return (string)this.GetValue(ModuleNameProperty);
  37. }
  38. set
  39. {
  40. this.SetValue(ModuleNameProperty, value);
  41. }
  42. }
  43. public static readonly DependencyProperty ModuleTitleProperty = DependencyProperty.Register(
  44. "ModuleTitle", typeof(string), typeof(LoaderStationSideControl),
  45. new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.AffectsRender));
  46. /// <summary>
  47. /// 标题
  48. /// </summary>
  49. public string ModuleTitle
  50. {
  51. get
  52. {
  53. return (string)this.GetValue(ModuleTitleProperty);
  54. }
  55. set
  56. {
  57. this.SetValue(ModuleTitleProperty, value);
  58. }
  59. }
  60. public static readonly DependencyProperty CommandProperty = DependencyProperty.Register(
  61. "OperationCommand", typeof(ICommand), typeof(LoaderStationSideControl),
  62. new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.AffectsRender));
  63. public ICommand OperationCommand
  64. {
  65. get
  66. {
  67. return (ICommand)this.GetValue(CommandProperty);
  68. }
  69. set
  70. {
  71. this.SetValue(CommandProperty, value);
  72. }
  73. }
  74. public static readonly DependencyProperty WaferPresentProperty = DependencyProperty.Register(
  75. "WaferPresent", typeof(bool), typeof(LoaderStationSideControl), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
  76. /// <summary>
  77. /// WaferPresent
  78. /// </summary>
  79. public bool WaferPresent
  80. {
  81. get
  82. {
  83. return (bool)this.GetValue(WaferPresentProperty);
  84. }
  85. set
  86. {
  87. this.SetValue(WaferPresentProperty, value);
  88. }
  89. }
  90. public static readonly DependencyProperty DoorUnlockedProperty = DependencyProperty.Register(
  91. "DoorUnlocked", typeof(bool), typeof(LoaderStationSideControl), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
  92. /// <summary>
  93. /// DoorUnlocked
  94. /// </summary>
  95. public bool DoorUnlocked
  96. {
  97. get
  98. {
  99. return (bool)this.GetValue(DoorUnlockedProperty);
  100. }
  101. set
  102. {
  103. this.SetValue(DoorUnlockedProperty, value);
  104. }
  105. }
  106. public static readonly DependencyProperty CRSVacuumProperty = DependencyProperty.Register(
  107. "CRSVacuum", typeof(bool), typeof(LoaderStationSideControl), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
  108. /// <summary>
  109. /// CRSVacuum
  110. /// </summary>
  111. public bool CRSVacuum
  112. {
  113. get
  114. {
  115. return (bool)this.GetValue(CRSVacuumProperty);
  116. }
  117. set
  118. {
  119. this.SetValue(CRSVacuumProperty, value);
  120. }
  121. }
  122. public static readonly DependencyProperty WhBladderedProperty = DependencyProperty.Register(
  123. "WhBladdered", typeof(bool), typeof(LoaderStationSideControl), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
  124. /// <summary>
  125. /// WhBladdered
  126. /// </summary>
  127. public bool WhBladdered
  128. {
  129. get
  130. {
  131. return (bool)this.GetValue(WhBladderedProperty);
  132. }
  133. set
  134. {
  135. this.SetValue(WhBladderedProperty, value);
  136. }
  137. }
  138. public static readonly DependencyProperty TransBladderedProperty = DependencyProperty.Register(
  139. "TransBladdered", typeof(bool), typeof(LoaderStationSideControl), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
  140. /// <summary>
  141. /// TransBladdered
  142. /// </summary>
  143. public bool TransBladdered
  144. {
  145. get
  146. {
  147. return (bool)this.GetValue(TransBladderedProperty);
  148. }
  149. set
  150. {
  151. this.SetValue(TransBladderedProperty, value);
  152. }
  153. }
  154. public static readonly DependencyProperty TransHighPresedProperty = DependencyProperty.Register(
  155. "TransHighPresed", typeof(bool), typeof(LoaderStationSideControl), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
  156. /// <summary>
  157. /// TransHighPresed
  158. /// </summary>
  159. public bool TransHighPresed
  160. {
  161. get
  162. {
  163. return (bool)this.GetValue(TransHighPresedProperty);
  164. }
  165. set
  166. {
  167. this.SetValue(TransHighPresedProperty, value);
  168. }
  169. }
  170. public static readonly DependencyProperty BernoulliBladderedProperty = DependencyProperty.Register(
  171. "BernoulliBladdered", typeof(bool), typeof(LoaderStationSideControl), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
  172. /// <summary>
  173. /// BernoulliBladdered
  174. /// </summary>
  175. public bool BernoulliBladdered
  176. {
  177. get
  178. {
  179. return (bool)this.GetValue(BernoulliBladderedProperty);
  180. }
  181. set
  182. {
  183. this.SetValue(BernoulliBladderedProperty, value);
  184. }
  185. }
  186. public static readonly DependencyProperty BernoulliN2Property = DependencyProperty.Register(
  187. "BernoulliN2", typeof(bool), typeof(LoaderStationSideControl), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
  188. /// <summary>
  189. /// BernoulliN2
  190. /// </summary>
  191. public bool BernoulliN2
  192. {
  193. get
  194. {
  195. return (bool)this.GetValue(BernoulliN2Property);
  196. }
  197. set
  198. {
  199. this.SetValue(BernoulliN2Property, value);
  200. }
  201. }
  202. public static readonly DependencyProperty DoorUpperLockedProperty = DependencyProperty.Register(
  203. "DoorUpperLocked", typeof(bool), typeof(LoaderStationSideControl), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
  204. /// <summary>
  205. /// DoorUpperLocked
  206. /// </summary>
  207. public bool DoorUpperLocked
  208. {
  209. get
  210. {
  211. return (bool)this.GetValue(DoorUpperLockedProperty);
  212. }
  213. set
  214. {
  215. this.SetValue(DoorUpperLockedProperty, value);
  216. }
  217. }
  218. public static readonly DependencyProperty DoorUpperUnlockedProperty = DependencyProperty.Register(
  219. "DoorUpperUnlocked", typeof(bool), typeof(LoaderStationSideControl), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
  220. /// <summary>
  221. /// DoorUpperUnlocked
  222. /// </summary>
  223. public bool DoorUpperUnlocked
  224. {
  225. get
  226. {
  227. return (bool)this.GetValue(DoorUpperUnlockedProperty);
  228. }
  229. set
  230. {
  231. this.SetValue(DoorUpperUnlockedProperty, value);
  232. }
  233. }
  234. public static readonly DependencyProperty DoorLowerLockedProperty = DependencyProperty.Register(
  235. "DoorLowerLocked", typeof(bool), typeof(LoaderStationSideControl), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
  236. /// <summary>
  237. /// DoorLowerLocked
  238. /// </summary>
  239. public bool DoorLowerLocked
  240. {
  241. get
  242. {
  243. return (bool)this.GetValue(DoorLowerLockedProperty);
  244. }
  245. set
  246. {
  247. this.SetValue(DoorLowerLockedProperty, value);
  248. }
  249. }
  250. public static readonly DependencyProperty DoorLowerUnlockedProperty = DependencyProperty.Register(
  251. "DoorLowerUnlocked", typeof(bool), typeof(LoaderStationSideControl), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
  252. /// <summary>
  253. /// DoorLowerUnlocked
  254. /// </summary>
  255. public bool DoorLowerUnlocked
  256. {
  257. get
  258. {
  259. return (bool)this.GetValue(DoorLowerUnlockedProperty);
  260. }
  261. set
  262. {
  263. this.SetValue(DoorLowerUnlockedProperty, value);
  264. }
  265. }
  266. public static readonly DependencyProperty CRSVacuumValueProperty = DependencyProperty.Register(
  267. "CRSVacuumValue", typeof(double), typeof(LoaderStationSideControl), new FrameworkPropertyMetadata(0.00, FrameworkPropertyMetadataOptions.AffectsRender));
  268. /// <summary>
  269. /// CRSVacuumValue
  270. /// </summary>
  271. public double CRSVacuumValue
  272. {
  273. get
  274. {
  275. return (double)this.GetValue(CRSVacuumValueProperty);
  276. }
  277. set
  278. {
  279. this.SetValue(CRSVacuumValueProperty, value);
  280. }
  281. }
  282. public static readonly DependencyProperty WhPressureValueProperty = DependencyProperty.Register(
  283. "WhPressureValue", typeof(double), typeof(LoaderStationSideControl), new FrameworkPropertyMetadata(0.00, FrameworkPropertyMetadataOptions.AffectsRender));
  284. /// <summary>
  285. /// WhPressureValue
  286. /// </summary>
  287. public double WhPressureValue
  288. {
  289. get
  290. {
  291. return (double)this.GetValue(WhPressureValueProperty);
  292. }
  293. set
  294. {
  295. this.SetValue(WhPressureValueProperty, value);
  296. }
  297. }
  298. public static readonly DependencyProperty TransRetractedProperty = DependencyProperty.Register(
  299. "TransRetracted", typeof(bool), typeof(LoaderStationSideControl), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
  300. /// <summary>
  301. /// Retracted
  302. /// </summary>
  303. public bool TransRetracted
  304. {
  305. get
  306. {
  307. return (bool)this.GetValue(TransRetractedProperty);
  308. }
  309. set
  310. {
  311. this.SetValue(TransRetractedProperty, value);
  312. }
  313. }
  314. public static readonly DependencyProperty BernoulliExtendProperty = DependencyProperty.Register(
  315. "BernoulliExtend", typeof(bool), typeof(LoaderStationSideControl), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
  316. /// <summary>
  317. /// BernoulliExtend
  318. /// </summary>
  319. public bool BernoulliExtend
  320. {
  321. get
  322. {
  323. return (bool)this.GetValue(BernoulliExtendProperty);
  324. }
  325. set
  326. {
  327. this.SetValue(BernoulliExtendProperty, value);
  328. }
  329. }
  330. /// <summary>
  331. /// BernoulliRetract
  332. /// </summary>
  333. public bool BernoulliRetract
  334. {
  335. get
  336. {
  337. return !(bool)this.GetValue(BernoulliExtendProperty);
  338. }
  339. }
  340. public static readonly DependencyProperty TranslationPresValueProperty = DependencyProperty.Register(
  341. "TranslationPresValue", typeof(double), typeof(LoaderStationSideControl), new FrameworkPropertyMetadata(0.00, FrameworkPropertyMetadataOptions.AffectsRender));
  342. /// <summary>
  343. /// TranslationPresValue
  344. /// </summary>
  345. public double TranslationPresValue
  346. {
  347. get
  348. {
  349. return (double)this.GetValue(TranslationPresValueProperty);
  350. }
  351. set
  352. {
  353. this.SetValue(TranslationPresValueProperty, value);
  354. }
  355. }
  356. public static readonly DependencyProperty BernoulliBladderPressureProperty = DependencyProperty.Register(
  357. "BernoulliBladderPressure", typeof(double), typeof(LoaderStationSideControl), new FrameworkPropertyMetadata(0.00, FrameworkPropertyMetadataOptions.AffectsRender));
  358. /// <summary>
  359. /// BernoulliBladderPressure
  360. /// </summary>
  361. public double BernoulliBladderPressure
  362. {
  363. get
  364. {
  365. return (double)this.GetValue(BernoulliBladderPressureProperty);
  366. }
  367. set
  368. {
  369. this.SetValue(BernoulliBladderPressureProperty, value);
  370. }
  371. }
  372. public static readonly DependencyProperty BernoulliPressureProperty = DependencyProperty.Register(
  373. "BernoulliPressure", typeof(double), typeof(LoaderStationSideControl), new FrameworkPropertyMetadata(0.00, FrameworkPropertyMetadataOptions.AffectsRender));
  374. /// <summary>
  375. /// BernoulliPressure
  376. /// </summary>
  377. public double BernoulliPressure
  378. {
  379. get
  380. {
  381. return (double)this.GetValue(BernoulliPressureProperty);
  382. }
  383. set
  384. {
  385. this.SetValue(BernoulliPressureProperty, value);
  386. }
  387. }
  388. #endregion
  389. /// <summary>
  390. /// 构造函数
  391. /// </summary>
  392. public LoaderStationSideControl()
  393. {
  394. InitializeComponent();
  395. }
  396. private void SavedPos_Click(object sender, RoutedEventArgs e)
  397. {
  398. if (OperationCommand != null)
  399. {
  400. //OperationCommand.Execute(new object[] { ModuleName, "Position", new object[] { "TargetPosition", SavedPosition } });
  401. }
  402. }
  403. #region 按钮
  404. private void DoorLockOn_Click(object sender, RoutedEventArgs e)
  405. {
  406. InvokeClient.Instance.Service.DoOperation($"{ModuleName}.DoorLockOn");
  407. }
  408. private void DoorLockOff_Click(object sender, RoutedEventArgs e)
  409. {
  410. InvokeClient.Instance.Service.DoOperation($"{ModuleName}.DoorLockOff");
  411. }
  412. private void VacuumOn_Click(object sender, RoutedEventArgs e)
  413. {
  414. InvokeClient.Instance.Service.DoOperation($"{ModuleName}.VacuumOn");
  415. }
  416. private void VacuumOff_Click(object sender, RoutedEventArgs e)
  417. {
  418. InvokeClient.Instance.Service.DoOperation($"{ModuleName}.VacuumOff");
  419. }
  420. private void WhBladderOn_Click(object sender, RoutedEventArgs e)
  421. {
  422. InvokeClient.Instance.Service.DoOperation($"{ModuleName}.WhBladderOn");
  423. }
  424. private void WhBladderOff_Click(object sender, RoutedEventArgs e)
  425. {
  426. InvokeClient.Instance.Service.DoOperation($"{ModuleName}.WhBladderOff");
  427. }
  428. private void TranlateBladderOn_Click(object sender, RoutedEventArgs e)
  429. {
  430. InvokeClient.Instance.Service.DoOperation($"{ModuleName}.TransBladderOn");
  431. }
  432. private void TranlateBladderOff_Click(object sender, RoutedEventArgs e)
  433. {
  434. InvokeClient.Instance.Service.DoOperation($"{ModuleName}.TransBladderOff");
  435. }
  436. private void TranlateHighPresOn_Click(object sender, RoutedEventArgs e)
  437. {
  438. InvokeClient.Instance.Service.DoOperation($"{ModuleName}.TransHighOn");
  439. }
  440. private void TranlateHighPresOff_Click(object sender, RoutedEventArgs e)
  441. {
  442. InvokeClient.Instance.Service.DoOperation($"{ModuleName}.TransHighOff");
  443. }
  444. private void BernoulliBladderOn_Click(object sender, RoutedEventArgs e)
  445. {
  446. InvokeClient.Instance.Service.DoOperation($"{ModuleName}.BernoulliBladderOn");
  447. }
  448. private void BernoulliBladderOff_Click(object sender, RoutedEventArgs e)
  449. {
  450. InvokeClient.Instance.Service.DoOperation($"{ModuleName}.BernoulliBladderOff");
  451. }
  452. private void BernoulliN2On_Click(object sender, RoutedEventArgs e)
  453. {
  454. InvokeClient.Instance.Service.DoOperation($"{ModuleName}.BernoulliN2On");
  455. }
  456. private void BernoulliN2Off_Click(object sender, RoutedEventArgs e)
  457. {
  458. InvokeClient.Instance.Service.DoOperation($"{ModuleName}.BernoulliN2Off");
  459. }
  460. #endregion
  461. }
  462. }