EmptyViewModel.cs 46 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Collections.ObjectModel;
  4. using System.Linq;
  5. using System.Windows;
  6. using System.Windows.Input;
  7. using Aitex.Core.Common.DeviceData;
  8. using Aitex.Core.Util;
  9. using Aitex.Core.Utilities;
  10. using Aitex.Sorter.Common;
  11. using Caliburn.Micro;
  12. using MECF.Framework.Common.CommonData;
  13. using MECF.Framework.Common.DataCenter;
  14. using MECF.Framework.Common.OperationCenter;
  15. using MECF.Framework.Common.RecipeCenter;
  16. using MECF.Framework.UI.Client.CenterViews.Editors.Sequence;
  17. using MECF.Framework.UI.Client.CenterViews.Operations.WaferAssociation;
  18. using MECF.Framework.UI.Client.ClientBase;
  19. using OpenSEMI.ClientBase;
  20. using FurnaceUI.Controls.Common;
  21. using FurnaceUI.Models;
  22. namespace FurnaceUI.Views
  23. {
  24. public class EmptyViewModel : FurnaceUIViewModelBase
  25. {
  26. #region Property
  27. [Subscription("System.IsManualMode")]
  28. public bool IsManualMode { get; set; }
  29. [Subscription("Robot1.State")]
  30. public string Robot1Status { get; set; }
  31. [Subscription("Robot1.RobotSpeed")]
  32. public int Robot1Speed { get; set; }
  33. [Subscription("Robot2.State")]
  34. public string Robot2Status { get; set; }
  35. [Subscription("Robot2.RobotSpeed")]
  36. public int Robot2Speed { get; set; }
  37. [Subscription("System.CurrentSelectSequence")]
  38. public string SelectedSequence { get; set; }
  39. [Subscription("System.TransferCount")]
  40. public int ProcessedWaferCount { get; set; }
  41. [Subscription("System.TranserThroughput")]
  42. public int Througput { get; set; }
  43. [Subscription("System.TransferTime")]
  44. public int ProcessTime { get; set; }
  45. [Subscription("System.TotalWaferCount")]
  46. public string TotalWaferCount { get; set; }
  47. #region EFEM
  48. [Subscription("Aligner.State")]
  49. public string AlignerStatus { get; set; }
  50. [Subscription("Aligner.WaferSize")]
  51. public string AlignerWaferSize { get; set; }
  52. [Subscription("WIDReader1.CurrentLaserMark")]
  53. public string WIDReader1LaserMark { get; set; }
  54. [Subscription("WIDReader1.WIDReaderState")]
  55. public string WIDReader1Status { get; set; }
  56. [Subscription("Buffer1.Status")]
  57. public string Buffer1Status { get; set; }
  58. [Subscription("Buffer1.WaferSize")]
  59. public string Buffer1WaferSize { get; set; }
  60. [Subscription("Buffer2.Status")]
  61. public string Buffer2Status { get; set; }
  62. [Subscription("Buffer2.WaferSize")]
  63. public string Buffer2WaferSize { get; set; }
  64. [Subscription("LP1.WaferSize")]
  65. public string LP1WaferSize { get; set; }
  66. public string WaferSizeLP1
  67. {
  68. get { return IsLP1Placed ? GetWaferSize(LP1WaferSize) : "--"; }
  69. }
  70. [Subscription("LP2.WaferSize")]
  71. public string LP2WaferSize { get; set; }
  72. public string WaferSizeLP2
  73. {
  74. get { return IsLP2Placed ? GetWaferSize(LP2WaferSize) : "--"; }
  75. }
  76. [Subscription("LP3.WaferSize")]
  77. public string LP3WaferSize { get; set; }
  78. public string WaferSizeLP3
  79. {
  80. get { return IsLP3Placed ? GetWaferSize(LP3WaferSize) : "--"; }
  81. }
  82. [Subscription("LP4.WaferSize")]
  83. public string LP4WaferSize { get; set; }
  84. public string WaferSizeLP4
  85. {
  86. get { return IsLP4Placed ? GetWaferSize(LP4WaferSize) : "--"; }
  87. }
  88. [Subscription("LP1.InfoPadCarrierTypeInformation")]
  89. public string LP1CarrierInfo { get; set; }
  90. [Subscription("LP2.InfoPadCarrierTypeInformation")]
  91. public string LP2CarrierInfo { get; set; }
  92. private WaferAssociationInfo _lp1WaferAssociation;
  93. public WaferAssociationInfo LP1WaferAssociation
  94. {
  95. get { return _lp1WaferAssociation; }
  96. set { _lp1WaferAssociation = value; }
  97. }
  98. private WaferAssociationInfo _lp2WaferAssociation;
  99. public WaferAssociationInfo LP2WaferAssociation
  100. {
  101. get { return _lp2WaferAssociation; }
  102. set { _lp2WaferAssociation = value; }
  103. }
  104. private WaferAssociationInfo _lp3WaferAssociation;
  105. public WaferAssociationInfo LP3WaferAssociation
  106. {
  107. get { return _lp3WaferAssociation; }
  108. set { _lp3WaferAssociation = value; }
  109. }
  110. private WaferAssociationInfo _lp4WaferAssociation;
  111. public WaferAssociationInfo LP4WaferAssociation
  112. {
  113. get { return _lp4WaferAssociation; }
  114. set { _lp4WaferAssociation = value; }
  115. }
  116. [Subscription("LP1.CassetteState")]
  117. public LoadportCassetteState LP1CassetteState { get; set; }
  118. [Subscription("LP1.FoupDoorState")]
  119. public FoupDoorState LP1DoorState { get; set; }
  120. [Subscription("LP2.CassetteState")]
  121. public LoadportCassetteState LP2CassetteState { get; set; }
  122. [Subscription("LP2.FoupDoorState")]
  123. public FoupDoorState LP2DoorState { get; set; }
  124. [Subscription("LP3.CassetteState")]
  125. public LoadportCassetteState LP3CassetteState { get; set; }
  126. [Subscription("LP3.FoupDoorState")]
  127. public FoupDoorState LP3DoorState { get; set; }
  128. [Subscription("LP4.CassetteState")]
  129. public LoadportCassetteState LP4CassetteState { get; set; }
  130. [Subscription("LP4.FoupDoorState")]
  131. public FoupDoorState LP4DoorState { get; set; }
  132. [Subscription("Robot1.RobotMoveInfo")]
  133. public RobotMoveInfo EfemRobot1MoveInfo
  134. {
  135. get;
  136. set;
  137. }
  138. [Subscription("Robot2.RobotMoveInfo")]
  139. public RobotMoveInfo EfemRobot2MoveInfo
  140. {
  141. get;
  142. set;
  143. }
  144. [Subscription("LP1.CarrierId")]
  145. public string LP1CarrierId { get; set; }
  146. [Subscription("LP2.CarrierId")]
  147. public string LP2CarrierId { get; set; }
  148. [Subscription("LP3.CarrierId")]
  149. public string LP3CarrierId { get; set; }
  150. [Subscription("LP1.IsPlaced")]
  151. public bool IsLP1Placed { get; set; }
  152. public Visibility Foup1Visibility => IsLP1Placed ? Visibility.Visible : Visibility.Hidden;
  153. [Subscription("LP1.IsMapped")]
  154. public bool IsLP1Mapped { get; set; }
  155. public bool IsLP1MapEnable
  156. {
  157. get { return IsLP1Placed; }
  158. }
  159. [Subscription("LP1.IsDocked")]
  160. public bool IsLP1Docked{get;set;}
  161. [Subscription("LP2.IsMapped")]
  162. public bool IsLP2Mapped { get; set; }
  163. public bool IsLP2MapEnable
  164. {
  165. get { return IsLP2Placed; }
  166. }
  167. [Subscription("LP2.IsDocked")]
  168. public bool IsLP2Docked { get; set; }
  169. [Subscription("LP3.IsMapped")]
  170. public bool IsLP3Mapped { get; set; }
  171. public bool IsLP3MapEnable
  172. {
  173. get { return IsLP3Placed; }
  174. }
  175. [Subscription("LP3.IsDocked")]
  176. public bool IsLP3Docked { get; set; }
  177. [Subscription("LP4.IsMapped")]
  178. public bool IsLP4Mapped { get; set; }
  179. public bool IsLP4MapEnable
  180. {
  181. get { return IsLP4Placed; }
  182. }
  183. [Subscription("LP4.IsDocked")]
  184. public bool IsLP4Docked { get; set; }
  185. [Subscription("LP2.IsPlaced")]
  186. public bool IsLP2Placed { get; set; }
  187. public Visibility Foup2Visibility => IsLP2Placed ? Visibility.Visible : Visibility.Hidden;
  188. [Subscription("LP3.IsPlaced")]
  189. public bool IsLP3Placed { get; set; }
  190. public Visibility Foup3Visibility
  191. {
  192. get { return IsLP3Placed ? Visibility.Visible : Visibility.Hidden; }
  193. }
  194. [Subscription("LP4.IsPlaced")]
  195. public bool IsLP4Placed { get; set; }
  196. public Visibility Foup4Visibility
  197. {
  198. get { return IsLP4Placed ? Visibility.Visible : Visibility.Hidden; }
  199. }
  200. public Dictionary<string, StationPosition> StationPosition
  201. {
  202. get
  203. {
  204. return new Dictionary<string, StationPosition>()
  205. {
  206. { "System", new StationPosition() {
  207. StartPosition = new RobotPosition() { X=0, Root = 0, Arm = 0, Hand = 0 }
  208. ,EndPosition = new RobotPosition() { Root = 0, Arm = 0, Hand = 0 }}
  209. }
  210. ,{ "Robot", new StationPosition() {
  211. StartPosition = new RobotPosition() { X=0, Root = 0, Arm = 0, Hand = 0 }
  212. ,EndPosition = new RobotPosition() { Root = 0, Arm = 0, Hand = 0 }}
  213. }
  214. ,{ "LP1", new StationPosition() {
  215. StartPosition = new RobotPosition() { X=-330, Root = 180, Arm = 0, Hand = 0 }
  216. ,EndPosition = new RobotPosition() { Root = 180, Arm = 0, Hand = 0 }}
  217. }
  218. ,{ "LP2", new StationPosition() {
  219. StartPosition = new RobotPosition() { X=-270, Root = 180, Arm = 0, Hand = 0 }
  220. ,EndPosition = new RobotPosition() { Root = 180, Arm = 0, Hand = 0 }}
  221. }
  222. ,{ "LP3", new StationPosition() {
  223. StartPosition = new RobotPosition() { X=-180, Root = 180, Arm = 0, Hand = 0 }
  224. ,EndPosition = new RobotPosition() { Root = 180, Arm = 0, Hand = 0 }}
  225. }
  226. ,{ "LP4", new StationPosition() {
  227. StartPosition = new RobotPosition() { X=-310, Root = 0, Arm = 0, Hand = 0 }
  228. ,EndPosition = new RobotPosition() { Root = 0, Arm = 0, Hand = 0 }}
  229. }
  230. ,{ "LP5", new StationPosition() {
  231. StartPosition = new RobotPosition() { X=-240, Root = 0, Arm = 0, Hand = 0 }
  232. ,EndPosition = new RobotPosition() { Root = 0, Arm = 0, Hand = 0 }}
  233. }
  234. ,{ "LP6", new StationPosition() {
  235. StartPosition = new RobotPosition() { X=-170,Root = 0, Arm = 0, Hand = 0 }
  236. ,EndPosition = new RobotPosition() { Root = 0, Arm = 0, Hand = 0 } }
  237. }
  238. ,{ "LP7", new StationPosition() {
  239. StartPosition = new RobotPosition() { X=-80, Root = 0, Arm = 0, Hand = 0 }
  240. ,EndPosition = new RobotPosition() { Root = 0, Arm = 0, Hand = 0 }}
  241. }
  242. };
  243. }
  244. }
  245. public Dictionary<string, StationPosition> StationPosition2
  246. {
  247. get
  248. {
  249. return new Dictionary<string, StationPosition>()
  250. {
  251. { "System", new StationPosition() {
  252. StartPosition = new RobotPosition() { X=0, Root = 0, Arm = 0, Hand = 0 }
  253. ,EndPosition = new RobotPosition() { Root = 0, Arm = 0, Hand = 0 }}
  254. }
  255. ,{ "Robot", new StationPosition() {
  256. StartPosition = new RobotPosition() { X=0, Root = 0, Arm = 0, Hand = 0 }
  257. ,EndPosition = new RobotPosition() { Root = 0, Arm = 0, Hand = 0 }}
  258. }
  259. ,{ "Station1", new StationPosition() {
  260. StartPosition = new RobotPosition() { X=-110, Root = 180, Arm = 0, Hand = 0 }
  261. ,EndPosition = new RobotPosition() { Root = 180, Arm = 0, Hand = 0 }}
  262. }
  263. ,{ "Station2", new StationPosition() {
  264. StartPosition = new RobotPosition() { X=-40, Root = 180, Arm = 0, Hand = 0 }
  265. ,EndPosition = new RobotPosition() { Root = 180, Arm = 0, Hand = 0 }}
  266. }
  267. ,{ "Station3", new StationPosition() {
  268. StartPosition = new RobotPosition() { X=-80, Root = 0, Arm = 0, Hand = 0 }
  269. ,EndPosition = new RobotPosition() { Root = 180, Arm = 0, Hand = 0 }}
  270. }
  271. };
  272. }
  273. }
  274. public Dictionary<string, StationPosition> StationPosition3
  275. {
  276. get
  277. {
  278. return new Dictionary<string, StationPosition>()
  279. {
  280. { "System", new StationPosition() {
  281. StartPosition = new RobotPosition() { X=0, Root = 0, Arm = 0, Hand = 0 }
  282. ,EndPosition = new RobotPosition() { Root = 0, Arm = 0, Hand = 0 }}
  283. }
  284. ,{ "Robot", new StationPosition() {
  285. StartPosition = new RobotPosition() { X=0, Root = 0, Arm = 0, Hand = 0 }
  286. ,EndPosition = new RobotPosition() { Root = 0, Arm = 0, Hand = 0 }}
  287. }
  288. ,{ "Station1", new StationPosition() {
  289. StartPosition = new RobotPosition() { X=-50, Root = 0, Arm = 0, Hand = 0 }
  290. ,EndPosition = new RobotPosition() { Root = 0, Arm = 0, Hand = 0 }}
  291. }
  292. ,{ "Station2", new StationPosition() {
  293. StartPosition = new RobotPosition() { X=-100, Root = 0, Arm = 0, Hand = 0 }
  294. ,EndPosition = new RobotPosition() { Root = 0, Arm = 0, Hand = 0 }}
  295. }
  296. ,{ "Station3", new StationPosition() {
  297. StartPosition = new RobotPosition() { X=-260, Root = 0, Arm = 0, Hand = 0 }
  298. ,EndPosition = new RobotPosition() { Root = 0, Arm = 0, Hand = 0 }}
  299. }
  300. };
  301. }
  302. }
  303. #endregion
  304. #region Mainframe
  305. [Subscription("PM1.ChamberDoor.OpenFeedback")]
  306. public bool PM1SlitValveOpenFeedback { get; set; }
  307. [Subscription("PM1.ChamberDoor.CloseFeedback")]
  308. public bool PM1SlitValveCloseFeedback { get; set; }
  309. public bool IsPM1SlitValveOpen
  310. {
  311. get
  312. {
  313. if (PM1SlitValveOpenFeedback && !PM1SlitValveCloseFeedback)
  314. return true;
  315. else if (!PM1SlitValveOpenFeedback && PM1SlitValveCloseFeedback)
  316. return false;
  317. else
  318. return false;
  319. }
  320. }
  321. [Subscription("PM2.ChamberDoor.OpenFeedback")]
  322. public bool PM2SlitValveOpenFeedback { get; set; }
  323. [Subscription("PM2.ChamberDoor.CloseFeedback")]
  324. public bool PM2SlitValveCloseFeedback { get; set; }
  325. public bool IsPM2SlitValveOpen
  326. {
  327. get
  328. {
  329. if (PM2SlitValveOpenFeedback && !PM2SlitValveCloseFeedback)
  330. return true;
  331. else if (!PM2SlitValveOpenFeedback && PM2SlitValveCloseFeedback)
  332. return false;
  333. else
  334. return false;
  335. }
  336. }
  337. public FoupDoorState PM1DoorState
  338. {
  339. get
  340. {
  341. return FoupDoorState.Open;
  342. }
  343. }
  344. public FoupDoorState PM2DoorState
  345. {
  346. get
  347. {
  348. if (PM2SlitValveOpenFeedback && !PM2SlitValveCloseFeedback) return FoupDoorState.Open;
  349. if (!PM2SlitValveOpenFeedback && PM2SlitValveCloseFeedback) return FoupDoorState.Close;
  350. return FoupDoorState.Unknown;
  351. }
  352. }
  353. [Subscription("EFEM.Status")]
  354. public string EFEMStatus { get; set; }
  355. [Subscription("LP1.Status")]
  356. public string LP1Status { get; set; }
  357. [Subscription("LP2.Status")]
  358. public string LP2Status { get; set; }
  359. [Subscription("LP3.Status")]
  360. public string LP3Status { get; set; }
  361. [Subscription("LP4.Status")]
  362. public string LP4Status { get; set; }
  363. #endregion
  364. #region PM
  365. [Subscription("PM1.Status")]
  366. public string PM1Status { get; set; }
  367. [Subscription("PM1.RecipeStepName")]
  368. public string PM1RecipeStepName { get; set; }
  369. [Subscription("PM1.RecipeStepNumber")]
  370. public int PM1RecipeStepNumber { get; set; }
  371. [Subscription("PM1.RecipeStepElapseTime")]
  372. public int PM1RecipeStepElapseTime { get; set; }
  373. [Subscription("PM1.RecipeStepTime")]
  374. public int PM1RecipeStepTime { get; set; }
  375. [Subscription("PM1.RecipeTotalElapseTime")]
  376. public int PM1RecipeTotalElapseTime { get; set; }
  377. [Subscription("PM1.RecipeTotalTime")]
  378. public int PM1RecipeTotalTime { get; set; }
  379. public bool IsPM1Idle
  380. {
  381. get { return PM1Status == "Idle"; }
  382. }
  383. public bool IsPM1Process
  384. {
  385. get { return PM1Status == "Process"; }
  386. }
  387. public bool IsPM1PostProcess
  388. {
  389. get { return PM1Status == "PostProcess"; }
  390. }
  391. public bool IsPM1PreProcess
  392. {
  393. get { return PM1Status == "PreProcess"; }
  394. }
  395. public string PM1StepNumber
  396. {
  397. get
  398. {
  399. if (!IsPM1Process && !IsPM1PostProcess)
  400. return "--";
  401. return $"{PM1RecipeStepNumber}";
  402. }
  403. }
  404. public string PM1StepName
  405. {
  406. get
  407. {
  408. if (!IsPM1Process && !IsPM1PostProcess)
  409. return "--";
  410. return $"{PM1RecipeStepName}";
  411. }
  412. }
  413. public string PM1StepTime
  414. {
  415. get
  416. {
  417. if (!IsPM1Process && !IsPM1PostProcess)
  418. return "--";
  419. return $"{PM1RecipeStepElapseTime}/{PM1RecipeStepTime}";
  420. }
  421. }
  422. public string PM1RecipeTime
  423. {
  424. get
  425. {
  426. if (!IsPM1Process && !IsPM1PostProcess)
  427. return "--";
  428. return $"{PM1RecipeTotalElapseTime}/{PM1RecipeTotalTime}";
  429. }
  430. }
  431. [Subscription("PM1.SelectedRecipeName")]
  432. public string PM1SelectedRecipeName
  433. {
  434. get;
  435. set;
  436. }
  437. public string PM1SelectedRecipeNameDisplay
  438. {
  439. get
  440. {
  441. if (string.IsNullOrEmpty(PM1SelectedRecipeName))
  442. return string.Empty;
  443. return PM1SelectedRecipeName.Substring("Furnace\\Process\\".Length);
  444. }
  445. }
  446. [Subscription("PM1.ChamberPressure.DeviceData")]
  447. public AITPressureMeterData PM1ChamberPressure { get; set; }
  448. [Subscription("PM1.ChamberMonitorPressure.DeviceData")]
  449. public AITPressureMeterData PM1ChamberMonitorPressure { get; set; }
  450. [Subscription("PM1.VacuumSensorValve.DeviceData")]
  451. public AITValveData PM1VacuumSensorValve { get; set; }
  452. public string PM1ChamberRealPressure
  453. {
  454. get
  455. {
  456. float value = 1.0f;
  457. //float value = (float)PM1ChamberMonitorPressure.FeedBack;
  458. //if (value < 3.0 && PM1VacuumSensorValve.IsOpen)
  459. // value = (float)PM1ChamberPressure.FeedBack;
  460. return $"{value:F3}";
  461. }
  462. }
  463. [Subscription("PM1.ChamberHeater.DeviceData")]
  464. public AITHeaterData PM1ChamberHeaterData { get; set; }
  465. [Subscription("PM1.IsOnline")]
  466. public bool PM1IsOnline { get; set; }
  467. public bool PM1IsOffline
  468. {
  469. get { return !PM1IsOnline; }
  470. }
  471. [Subscription("PM2.IsOnline")]
  472. public bool PM2IsOnline { get; set; }
  473. public bool PM2IsOffline
  474. {
  475. get { return !PM2IsOnline; }
  476. }
  477. [Subscription("PM2.Status")]
  478. public string PM2Status { get; set; }
  479. [Subscription("PM2.RecipeStepName")]
  480. public string PM2RecipeStepName { get; set; }
  481. [Subscription("PM2.RecipeStepNumber")]
  482. public int PM2RecipeStepNumber { get; set; }
  483. [Subscription("PM2.RecipeStepElapseTime")]
  484. public int PM2RecipeStepElapseTime { get; set; }
  485. [Subscription("PM2.RecipeStepTime")]
  486. public int PM2RecipeStepTime { get; set; }
  487. [Subscription("PM2.RecipeTotalElapseTime")]
  488. public int PM2RecipeTotalElapseTime { get; set; }
  489. [Subscription("PM2.RecipeTotalTime")]
  490. public int PM2RecipeTotalTime { get; set; }
  491. public bool IsPM2Idle
  492. {
  493. get { return PM2Status == "Idle"; }
  494. }
  495. public bool IsPM2Process
  496. {
  497. get { return PM2Status == "Process"; }
  498. }
  499. public bool IsPM2PostProcess
  500. {
  501. get { return PM2Status == "PostProcess"; }
  502. }
  503. public bool IsPM2PreProcess
  504. {
  505. get { return PM2Status == "PreProcess"; }
  506. }
  507. public string PM2StepNumber
  508. {
  509. get
  510. {
  511. if (!IsPM2Process && !IsPM2PostProcess)
  512. return "--";
  513. return $"{PM2RecipeStepNumber}";
  514. }
  515. }
  516. public string PM2StepName
  517. {
  518. get
  519. {
  520. if (!IsPM2Process && !IsPM2PostProcess)
  521. return "--";
  522. return $"{PM2RecipeStepName}";
  523. }
  524. }
  525. public string PM2StepTime
  526. {
  527. get
  528. {
  529. if (!IsPM2Process && !IsPM2PostProcess)
  530. return "--";
  531. return $"{PM2RecipeStepElapseTime}/{PM2RecipeStepTime}";
  532. }
  533. }
  534. public string PM2RecipeTime
  535. {
  536. get
  537. {
  538. if (!IsPM2Process && !IsPM2PostProcess)
  539. return "--";
  540. return $"{PM2RecipeTotalElapseTime}/{PM2RecipeTotalTime}";
  541. }
  542. }
  543. [Subscription("PM2.SelectedRecipeName")]
  544. public string PM2SelectedRecipeName
  545. {
  546. get;
  547. set;
  548. }
  549. public string PM2SelectedRecipeNameDisplay
  550. {
  551. get
  552. {
  553. if (string.IsNullOrEmpty(PM2SelectedRecipeName))
  554. return string.Empty;
  555. return PM2SelectedRecipeName.Substring("Furnace\\Process\\".Length);
  556. }
  557. }
  558. [Subscription("PM2.ChamberPressure.DeviceData")]
  559. public AITPressureMeterData PM2ChamberPressure { get; set; }
  560. [Subscription("PM2.ChamberMonitorPressure.DeviceData")]
  561. public AITPressureMeterData PM2ChamberMonitorPressure { get; set; }
  562. [Subscription("PM2.VacuumSensorValve.DeviceData")]
  563. public AITValveData PM2VacuumSensorValve { get; set; }
  564. public string PM2ChamberRealPressure
  565. {
  566. get
  567. {
  568. float value = 1.0f;
  569. //float value = (float)PM2ChamberMonitorPressure.FeedBack;
  570. //if (value < 3.0 && PM2VacuumSensorValve.IsOpen)
  571. // value = (float)PM2ChamberPressure.FeedBack;
  572. return $"{value:F3}";
  573. }
  574. }
  575. [Subscription("PM2.ChamberHeater.DeviceData")]
  576. public AITHeaterData PM2ChamberHeaterData { get; set; }
  577. #endregion
  578. #region Scheduler
  579. public bool IsRtInitialized
  580. {
  581. get
  582. {
  583. return RtStatus != "Init" && RtStatus != "Initializing";
  584. }
  585. }
  586. public bool IsRtRunning
  587. {
  588. get
  589. {
  590. return RtStatus != "Init" && RtStatus != "Idle" && RtStatus != "AutoIdle";
  591. }
  592. }
  593. public bool IsRtError
  594. {
  595. get
  596. {
  597. return RtStatus == "Error";
  598. }
  599. }
  600. public bool IsAuto
  601. {
  602. get { return RtStatus == "Auto_Running" || RtStatus == "Auto_Idle"; }
  603. }
  604. [Subscription("Rt.Status")]
  605. public string RtStatus { get; set; }
  606. public bool _isCycleMode;
  607. public Visibility IsCycleInfoVisibility
  608. {
  609. get { return _isCycleMode ? Visibility.Visible : Visibility.Collapsed; }
  610. }
  611. [Subscription("Scheduler.CycledCount")]
  612. public int CycledCount { get; set; }
  613. [Subscription("Scheduler.CycledWafer")]
  614. public int CycledWafer { get; set; }
  615. [Subscription("Scheduler.CycledTime")]
  616. public int TotalCycledTime { get; set; }
  617. public string TotalCycledProduction { get => CycledWafer + "/" + TotalCycledTime; }
  618. [Subscription("Scheduler.CycledTotalWafer")]
  619. public int TotalCycledWafer { get; set; }
  620. [Subscription("Scheduler.CycleSetPoint")]
  621. public int CycleSetPoint { get; set; }
  622. public string CycleCountDisplay
  623. {
  624. get { return (CycleSetPoint > 0 && (CycledCount > CycleSetPoint)) ? $"{CycledCount + 1}/{CycleSetPoint}" : $"{CycledCount}/{CycleSetPoint}"; }
  625. }
  626. [Subscription("PlatformCycle.CycledCount")]
  627. public int PlatformCycledCount { get; set; }
  628. [Subscription("PlatformCycle.CycledWafer")]
  629. public int PlatformCycledWafer { get; set; }
  630. [Subscription("PlatformCycle.CycleSetPoint")]
  631. public int PlatformCycleSetPoint { get; set; }
  632. public string PlatformCycleCountDisplay
  633. {
  634. get { return (PlatformCycleSetPoint > 0 && (PlatformCycledCount > PlatformCycleSetPoint)) ? $"{PlatformCycledCount + 1}/{PlatformCycleSetPoint}" : $"{PlatformCycledCount}/{PlatformCycleSetPoint}"; }
  635. }
  636. [Subscription("LP1.Thickness")]
  637. public string LP1Thickness
  638. {
  639. get;
  640. set;
  641. }
  642. [Subscription("LP2.Thickness")]
  643. public string LP2Thickness
  644. {
  645. get;
  646. set;
  647. }
  648. [Subscription("LP3.Thickness")]
  649. public string LP3Thickness
  650. {
  651. get;
  652. set;
  653. }
  654. [Subscription("LP4.Thickness")]
  655. public string LP4Thickness
  656. {
  657. get;
  658. set;
  659. }
  660. [Subscription("LP1.LocalJobName")]
  661. public string LP1JobName { get; set; }
  662. [Subscription("LP1.LocalJobStatus")]
  663. public string LP1JobStatus { get; set; }
  664. [Subscription("LP2.LocalJobName")]
  665. public string LP2JobName { get; set; }
  666. [Subscription("LP2.LocalJobStatus")]
  667. public string LP2JobStatus { get; set; }
  668. [Subscription("LP3.LocalJobName")]
  669. public string LP3JobName { get; set; }
  670. [Subscription("LP3.LocalJobStatus")]
  671. public string LP3JobStatus { get; set; }
  672. [Subscription("LP4.LocalJobName")]
  673. public string LP4JobName { get; set; }
  674. [Subscription("LP4.LocalJobStatus")]
  675. public string LP4JobStatus { get; set; }
  676. //Queued,Selected,WaitingForStart,Executing,Paused,Completed,
  677. public bool IsLP1JobExecuting
  678. {
  679. get { return LP1JobStatus == "Executing"; }
  680. }
  681. public bool IsLP1JobPaused
  682. {
  683. get { return LP1JobStatus == "Paused"; }
  684. }
  685. public bool IsLP1JobExist
  686. {
  687. get { return !string.IsNullOrEmpty(LP1JobStatus); }
  688. }
  689. public bool IsLP2JobExecuting
  690. {
  691. get { return LP2JobStatus == "Executing"; }
  692. }
  693. public bool IsLP2JobPaused
  694. {
  695. get { return LP2JobStatus == "Paused"; }
  696. }
  697. public bool IsLP2JobExist
  698. {
  699. get { return !string.IsNullOrEmpty(LP2JobStatus); }
  700. }
  701. public bool IsLP3JobExecuting
  702. {
  703. get { return LP3JobStatus == "Executing"; }
  704. }
  705. public bool IsLP3JobPaused
  706. {
  707. get { return LP3JobStatus == "Paused"; }
  708. }
  709. public bool IsLP3JobExist
  710. {
  711. get { return !string.IsNullOrEmpty(LP3JobStatus); }
  712. }
  713. public bool IsLP4JobExecuting
  714. {
  715. get { return LP4JobStatus == "Executing"; }
  716. }
  717. public bool IsLP4JobPaused
  718. {
  719. get { return LP4JobStatus == "Paused"; }
  720. }
  721. public bool IsLP4JobExist
  722. {
  723. get { return !string.IsNullOrEmpty(LP4JobStatus); }
  724. }
  725. #endregion
  726. #region Button Logic
  727. [Subscription("LP1.IsAutoDetectCarrierType")]
  728. public bool LP1IsAutoDetectCarrierType { get; set; }
  729. [Subscription("LP2.IsAutoDetectCarrierType")]
  730. public bool LP2IsAutoDetectCarrierType { get; set; }
  731. [Subscription("LP1.ValidCarrierTypeList")]
  732. public Tuple<int, string>[] LP1ValidCarrierTypeList { get; set; }
  733. [Subscription("LP2.ValidCarrierTypeList")]
  734. public Tuple<int, string>[] LP2ValidCarrierTypeList { get; set; }
  735. public bool IsShowLP1CarrierType
  736. {
  737. get
  738. { return !LP1IsAutoDetectCarrierType; }
  739. }
  740. public bool IsShowLP2CarrierType
  741. {
  742. get
  743. { return !LP2IsAutoDetectCarrierType; }
  744. }
  745. public bool IsEnableJobLP1
  746. {
  747. get { return IsAuto && LP1CassetteState == LoadportCassetteState.Normal; }
  748. }
  749. public bool IsEnableReadIdLP1
  750. {
  751. get { return LP1CassetteState == LoadportCassetteState.Normal && !IsLP1JobExecuting && !IsLP1JobPaused; }
  752. }
  753. public bool IsEnableLoadLP1
  754. {
  755. get { return LP1CassetteState == LoadportCassetteState.Normal && !IsLP1JobExecuting && !IsLP1JobPaused; }
  756. }
  757. public bool IsEnableUnloadLP1
  758. {
  759. get { return LP1CassetteState == LoadportCassetteState.Normal && !IsLP1JobExecuting && !IsLP1JobPaused; }
  760. }
  761. public bool IsEnableJobLP2
  762. {
  763. get { return IsAuto && LP2CassetteState == LoadportCassetteState.Normal; }
  764. }
  765. public bool IsEnableReadIdLP2
  766. {
  767. get { return LP2CassetteState == LoadportCassetteState.Normal && !IsLP2JobExecuting && !IsLP2JobPaused; }
  768. }
  769. public bool IsEnableLoadLP2
  770. {
  771. get { return LP2CassetteState == LoadportCassetteState.Normal && !IsLP2JobExecuting && !IsLP2JobPaused; }
  772. }
  773. public bool IsEnableUnloadLP2
  774. {
  775. get { return LP2CassetteState == LoadportCassetteState.Normal && !IsLP2JobExecuting && !IsLP2JobPaused; }
  776. }
  777. public bool IsEnableJobLP3
  778. {
  779. get { return IsAuto && LP3CassetteState == LoadportCassetteState.Normal; }
  780. }
  781. public bool IsEnableReadIdLP3
  782. {
  783. get { return LP3CassetteState == LoadportCassetteState.Normal && !IsLP3JobExecuting && !IsLP3JobPaused; }
  784. }
  785. public bool IsEnableLoadLP3
  786. {
  787. get { return LP3CassetteState == LoadportCassetteState.Normal && !IsLP3JobExecuting && !IsLP3JobPaused; }
  788. }
  789. public bool IsEnableUnloadLP3
  790. {
  791. get { return LP3CassetteState == LoadportCassetteState.Normal && !IsLP3JobExecuting && !IsLP3JobPaused; }
  792. }
  793. public bool IsEnableJobLP4
  794. {
  795. get { return IsAuto && LP4CassetteState == LoadportCassetteState.Normal; }
  796. }
  797. public bool IsEnableReadIdLP4
  798. {
  799. get { return LP4CassetteState == LoadportCassetteState.Normal && !IsLP4JobExecuting && !IsLP4JobPaused; }
  800. }
  801. public bool IsEnableLoadLP4
  802. {
  803. get { return LP4CassetteState == LoadportCassetteState.Normal && !IsLP4JobExecuting && !IsLP4JobPaused; }
  804. }
  805. public bool IsEnableUnloadLP4
  806. {
  807. get { return LP4CassetteState == LoadportCassetteState.Normal && !IsLP4JobExecuting && !IsLP4JobPaused; }
  808. }
  809. public bool IsEnableAbort
  810. {
  811. get
  812. {
  813. if (IsAuto)
  814. return IsLP1JobExist || IsLP2JobExist || IsLP3JobExist;
  815. return IsRtRunning && !IsRtError;
  816. }
  817. }
  818. public bool IsEnableAuto
  819. {
  820. get { return !IsAuto && IsRtInitialized && !IsRtError; }
  821. }
  822. public bool IsEnableManual
  823. {
  824. get { return IsAuto && IsRtInitialized && !IsLP1JobExist && !IsLP2JobExist && !IsLP3JobExist && !IsRtError; }
  825. }
  826. public bool IsEnableInitialize
  827. {
  828. get { return !IsAuto && !IsRtRunning && !IsRtError; }
  829. }
  830. public bool IsEnableReturnWafer
  831. {
  832. get { return !IsAuto && !IsRtRunning && IsRtInitialized && !IsRtError; }
  833. }
  834. public Visibility ThicknessVisibility
  835. {
  836. get;
  837. set;
  838. }
  839. #endregion
  840. #endregion
  841. public EmptyViewModel()
  842. {
  843. this.DisplayName = "EmptyViewModel";
  844. //ActiveUpdateData = true;
  845. }
  846. //[IgnorePropertyChange]
  847. //public string LP1CarrierIDSetPoint { get; set; }
  848. [IgnorePropertyChange]
  849. public string LP2CarrierIDSetPoint { get; set; }
  850. protected override void OnInitialize()
  851. {
  852. base.OnInitialize();
  853. base.InitFOUP();
  854. base.InitLL();
  855. base.InitTM();
  856. base.InitEFEM();
  857. base.InitPM();
  858. base.InitBuffer();
  859. }
  860. private void LP2SetCarrierID(string obj)
  861. {
  862. InvokeClient.Instance.Service.DoOperation($"LP2.ManualSetCarrierID", new object[] { obj });
  863. }
  864. public ICommand LP1SetCarrierIDCommand { get; set; }
  865. public ICommand LP2SetCarrierIDCommand { get; set; }
  866. public ICommand SetTransCarrierTypeCommand { get; set; }
  867. protected override void OnActivate()
  868. {
  869. base.OnActivate();
  870. _isCycleMode = (bool)QueryDataClient.Instance.Service.GetConfig("System.IsCycleMode");
  871. }
  872. public void Start()
  873. {
  874. InvokeClient.Instance.Service.DoOperation("System.StartAutoRun");
  875. }
  876. public void Stop()
  877. {
  878. //InvokeClient.Instance.Service.DoOperation("System.StartAutoRun");
  879. }
  880. public void ReturnAllWafer()
  881. {
  882. InvokeClient.Instance.Service.DoOperation("System.ReturnAllWafer");
  883. }
  884. public void PlatformCycle()
  885. {
  886. InvokeClient.Instance.Service.DoOperation("System.PlatformCycle");
  887. }
  888. public void StopPlatformCycle()
  889. {
  890. InvokeClient.Instance.Service.DoOperation("System.StopPlatformCycle");
  891. }
  892. public void QuickStartProcess()
  893. {
  894. InvokeClient.Instance.Service.DoOperation("System.QuickStartProcss", null);
  895. }
  896. public void PP_Select()
  897. {
  898. SequenceDialogViewModel dialog = new SequenceDialogViewModel();
  899. dialog.DisplayName = "Select Sequence";
  900. dialog.Files = new ObservableCollection<FileNode>(RecipeSequenceTreeBuilder.GetFiles("",
  901. RecipeClient.Instance.Service.GetSequenceNameList()
  902. ));
  903. WindowManager wm = new WindowManager();
  904. bool? bret = wm.ShowDialog(dialog);
  905. if ((bool)bret)
  906. {
  907. InvokeClient.Instance.Service.DoOperation("System.SelectSequence",new object[] { dialog.DialogResult });
  908. }
  909. }
  910. protected override void InvokeAfterUpdateProperty(Dictionary<string, object> data)
  911. {
  912. if (LP1WaferAssociation == null)
  913. {
  914. LP1WaferAssociation = new WaferAssociationInfo();
  915. LP1WaferAssociation.ModuleData = ModuleManager.ModuleInfos["LP1"];
  916. }
  917. if (LP2WaferAssociation == null)
  918. {
  919. LP2WaferAssociation = new WaferAssociationInfo();
  920. LP2WaferAssociation.ModuleData = ModuleManager.ModuleInfos["LP2"];
  921. }
  922. if (LP1WaferAssociation.ModuleData == null || LP2WaferAssociation.ModuleData == null) return;
  923. LP1WaferAssociation.JobID = LP1JobName;
  924. LP1WaferAssociation.JobStatus = LP1JobStatus;
  925. LP2WaferAssociation.JobID = LP2JobName;
  926. LP2WaferAssociation.JobStatus = LP2JobStatus;
  927. if (LP1CassetteState != LoadportCassetteState.Normal)
  928. {
  929. foreach (var wafer in LP1WaferAssociation.ModuleData.WaferManager.Wafers)
  930. {
  931. wafer.SequenceName = "";
  932. }
  933. }
  934. if (LP2CassetteState != LoadportCassetteState.Normal)
  935. {
  936. foreach (var wafer in LP2WaferAssociation.ModuleData.WaferManager.Wafers)
  937. {
  938. wafer.SequenceName = "";
  939. }
  940. }
  941. //Trace.WriteLine($" RobotMoveInfo, action:{TmRobotMoveInfo.Action} armTarget:{TmRobotMoveInfo.ArmTarget} bladeTarget:{TmRobotMoveInfo.BladeTarget}");
  942. }
  943. #region LP Operation
  944. private string GetWaferSize(string size)
  945. {
  946. switch (size)
  947. {
  948. case "WS4": return "4'";
  949. case "WS6": return "6'";
  950. default: return "";
  951. }
  952. }
  953. public void SetLP1CarrierID(string carrierID)
  954. {
  955. InvokeClient.Instance.Service.DoOperation($"LP1.LoadportLoad",new object[] { carrierID});
  956. }
  957. public void SetLP2CarrierID(string carrierID)
  958. {
  959. InvokeClient.Instance.Service.DoOperation($"LP2.LoadportLoad", new object[] { carrierID });
  960. }
  961. public void LoadLP(string moduleID)
  962. {
  963. InvokeClient.Instance.Service.DoOperation($"{moduleID}.LoadportLoad");
  964. }
  965. public void ReadCarrierId(string moduleID)
  966. {
  967. InvokeClient.Instance.Service.DoOperation($"{moduleID}.ReadCarrierID");
  968. }
  969. public void UnloadLP(string moduleID)
  970. {
  971. InvokeClient.Instance.Service.DoOperation($"{moduleID}.LoadportUnload");
  972. }
  973. public void SetThickness(string moduleID, string thickness)
  974. {
  975. InvokeClient.Instance.Service.DoOperation($"{moduleID}.SetThickness", thickness);
  976. }
  977. public void Map(string module)
  978. {
  979. InvokeClient.Instance.Service.DoOperation($"System.MapWafer", module);
  980. }
  981. public void HomeAll()
  982. {
  983. InvokeClient.Instance.Service.DoOperation("System.HomeAll");
  984. //InvokeClient.Instance.Service.DoOperation("PM1.Handshake.SetHandshakeCommand", "HMI.InitializeCommand", true);
  985. //InvokeClient.Instance.Service.DoOperation("PM2.Handshake.SetHandshakeCommand", "HMI.InitializeCommand", true);
  986. //InvokeClient.Instance.Service.DoOperation("PM3.Handshake.SetHandshakeCommand", "HMI.InitializeCommand", true);
  987. }
  988. public void Abort()
  989. {
  990. InvokeClient.Instance.Service.DoOperation("System.Abort");
  991. }
  992. public void Auto()
  993. {
  994. InvokeClient.Instance.Service.DoOperation("System.SetAutoMode");
  995. }
  996. public void Pause()
  997. {
  998. InvokeClient.Instance.Service.DoOperation("System.PauseJob");
  999. }
  1000. public void Resume()
  1001. {
  1002. InvokeClient.Instance.Service.DoOperation("System.ResumeJob");
  1003. }
  1004. public void Manual()
  1005. {
  1006. InvokeClient.Instance.Service.DoOperation("System.SetManualMode");
  1007. }
  1008. public void Buffer1Move()
  1009. {
  1010. InvokeClient.Instance.Service.DoOperation("Buffer1.Move");
  1011. }
  1012. public void Buffer2To200()
  1013. {
  1014. InvokeClient.Instance.Service.DoOperation("Buffer2.MoveTo200");
  1015. }
  1016. public void Buffer2To300()
  1017. {
  1018. InvokeClient.Instance.Service.DoOperation("Buffer2.MoveTo300");
  1019. }
  1020. public void Buffer2Home()
  1021. {
  1022. InvokeClient.Instance.Service.DoOperation("Buffer2.Home");
  1023. }
  1024. public void Buffer2PickDone()
  1025. {
  1026. InvokeClient.Instance.Service.DoOperation("Buffer2.PickDone");
  1027. }
  1028. public void AlignerMoveTo200()
  1029. {
  1030. InvokeClient.Instance.Service.DoOperation($"Aligner.SetWaferSize", new object[] { "Lower", "WS8" });
  1031. }
  1032. public void AlignerMoveTo300()
  1033. {
  1034. InvokeClient.Instance.Service.DoOperation($"Aligner.SetWaferSize", new object[] { "Lower", "WS12" });
  1035. }
  1036. #endregion
  1037. #region Wafer association
  1038. #region Sequence operation
  1039. public void SelectSequence(WaferAssociationInfo info)
  1040. {
  1041. SequenceDialogViewModel dialog = new SequenceDialogViewModel();
  1042. dialog.DisplayName = "Select Sequence";
  1043. dialog.Files = new ObservableCollection<FileNode>(RecipeSequenceTreeBuilder.GetFiles("",
  1044. RecipeClient.Instance.Service.GetSequenceNameList()
  1045. ));
  1046. WindowManager wm = new WindowManager();
  1047. bool? bret = wm.ShowDialog(dialog);
  1048. if ((bool)bret)
  1049. {
  1050. info.SequenceName = dialog.DialogResult;
  1051. }
  1052. }
  1053. public void SetSlot(WaferAssociationInfo info)
  1054. {
  1055. if (InputSlotCheck(info.SlotFrom, info.SlotTo))
  1056. AssociateSequence(info, true);
  1057. }
  1058. public void SkipSlot(WaferAssociationInfo info)
  1059. {
  1060. if (InputSlotCheck(info.SlotFrom, info.SlotTo))
  1061. AssociateSequence(info, false);
  1062. }
  1063. public void SetAll(WaferAssociationInfo info)
  1064. {
  1065. info.SlotFrom = 1;
  1066. info.SlotTo = 25;
  1067. AssociateSequence(info, true);
  1068. }
  1069. public void DeselectAll(WaferAssociationInfo info)
  1070. {
  1071. info.SlotFrom = 1;
  1072. info.SlotTo = 25;
  1073. AssociateSequence(info, false);
  1074. }
  1075. public void SetSequence(WaferAssociationInfo info, int slotIndex, string seqName)
  1076. {
  1077. bool flag = string.IsNullOrEmpty(seqName);
  1078. AssociateSequence(info, flag, slotIndex - 1);
  1079. }
  1080. private bool InputSlotCheck(int from, int to)
  1081. {
  1082. if (from > to)
  1083. {
  1084. DialogBox.ShowInfo("This index of from slot should be large than the index of to slot.");
  1085. return false;
  1086. }
  1087. if (from < 1 || to > 25)
  1088. {
  1089. DialogBox.ShowInfo("This input value for from should be between 1 and 25.");
  1090. return false;
  1091. }
  1092. return true;
  1093. }
  1094. private void AssociateSequence(WaferAssociationInfo info, bool flag, int slot = -1)
  1095. {
  1096. ObservableCollection<WaferInfo> wafers = info.ModuleData.WaferManager.Wafers;
  1097. if (slot >= 0) //by wafer
  1098. {
  1099. int index = wafers.Count - slot - 1;
  1100. if (index < wafers.Count)
  1101. {
  1102. if (flag && HasWaferOnSlot(wafers.ToList(), index))
  1103. wafers[index].SequenceName = info.SequenceName;
  1104. else
  1105. wafers[index].SequenceName = string.Empty;
  1106. }
  1107. }
  1108. else //by from-to
  1109. {
  1110. for (int i = info.SlotFrom - 1; i < info.SlotTo; i++)
  1111. {
  1112. int index = wafers.Count - i - 1;
  1113. if (index < wafers.Count)
  1114. {
  1115. if (flag && HasWaferOnSlot(wafers.ToList(), index))
  1116. wafers[index].SequenceName = info.SequenceName;
  1117. else
  1118. wafers[index].SequenceName = string.Empty;
  1119. }
  1120. }
  1121. }
  1122. }
  1123. private bool HasWaferOnSlot(List<WaferInfo> wafers, int index)
  1124. {
  1125. if (wafers[index].WaferStatus == 0)
  1126. return false;
  1127. return true;
  1128. }
  1129. #endregion
  1130. #region Job operation
  1131. private bool JobCheck(string jobID)
  1132. {
  1133. if (jobID.Length == 0)
  1134. {
  1135. DialogBox.ShowWarning("Please create job first.");
  1136. return false;
  1137. }
  1138. else
  1139. return true;
  1140. }
  1141. public void CreateJob(WaferAssociationInfo info)
  1142. {
  1143. List<string> slotSequence = new List<string>();
  1144. foreach (var wafer in info.ModuleData.WaferManager.Wafers)
  1145. {
  1146. slotSequence.Insert(0, wafer.SequenceName);
  1147. }
  1148. string jobId = info.LotId.Trim();
  1149. if (string.IsNullOrEmpty(jobId))
  1150. jobId = "CJ_Local_" + info.ModuleData.ModuleID;
  1151. //info.LotId = "test";
  1152. info.LotIdSaved = true;
  1153. //WaferAssociationProvider.Instance.CreateJob(jobId, info.ModuleData.ModuleID, slotSequence, true);
  1154. }
  1155. public void AbortJob(string jobID)
  1156. {
  1157. if (JobCheck(jobID))
  1158. WaferAssociationProvider.Instance.AbortJob(jobID);
  1159. }
  1160. public void Start(string jobID)
  1161. {
  1162. if (JobCheck(jobID))
  1163. WaferAssociationProvider.Instance.Start(jobID);
  1164. }
  1165. public void Pause(string jobID)
  1166. {
  1167. if (JobCheck(jobID))
  1168. WaferAssociationProvider.Instance.Pause(jobID);
  1169. }
  1170. public void Resume(string jobID)
  1171. {
  1172. if (JobCheck(jobID))
  1173. WaferAssociationProvider.Instance.Resume(jobID);
  1174. }
  1175. public void Stop(string jobID)
  1176. {
  1177. if (JobCheck(jobID))
  1178. WaferAssociationProvider.Instance.Stop(jobID);
  1179. }
  1180. public void StartDispatchMode()
  1181. {
  1182. InvokeClient.Instance.Service.DoOperation("System.StartDispatchMode");
  1183. }
  1184. #endregion
  1185. #endregion
  1186. }
  1187. }