AlignerNoHomeViewModel.cs 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. using Aitex.Core.UI.MVVM;
  2. using Aitex.Sorter.Common;
  3. using Aitex.Sorter.UI.Controls.Common;
  4. using MECF.Framework.Common.OperationCenter;
  5. using System.Collections.Generic;
  6. using System.Windows;
  7. using System.Windows.Input;
  8. using Aitex.Core.Util;
  9. namespace Aitex.Sorter.UI.ViewModel.Maintenance
  10. {
  11. public class AlignerNoHomeViewModel : UIViewModelBase
  12. {
  13. public bool EnablePageControl
  14. {
  15. get { return !IsOnlineMode; }
  16. }
  17. [Subscription("System.IsOnlineMode")]
  18. public bool IsOnlineMode
  19. {
  20. get;
  21. set;
  22. }
  23. public AlignerNoHomeViewModel(string vmName) : base(vmName)
  24. {
  25. Command = new DelegateCommand<DependencyObject>(DoCommand);
  26. }
  27. public bool AlignerInitialized
  28. {
  29. get;
  30. set;
  31. }
  32. [Subscription("Aligner.Busy")]
  33. public bool AlignerIsBusy
  34. {
  35. get;
  36. set;
  37. }
  38. [Subscription("Aligner.Error")]
  39. public bool AlignerIsError
  40. {
  41. get;
  42. set;
  43. }
  44. [Subscription("Aligner.WaferOnAligner")]
  45. public bool WaferOnAligner
  46. {
  47. get;
  48. set;
  49. }
  50. public string ElapseTime
  51. {
  52. get;
  53. set;
  54. }
  55. public int Notch
  56. {
  57. get;
  58. set;
  59. }
  60. public string AlignerStatus
  61. {
  62. get;
  63. set;
  64. }
  65. public ICommand Command
  66. {
  67. get;
  68. private set;
  69. }
  70. private void DoCommand(DependencyObject sender)
  71. {
  72. var command = CommandHelper.GetCommandItem(sender);
  73. var lstParameter = new List<object>(command.Parameters);
  74. lstParameter.Insert(0, command.Target);
  75. lstParameter.Insert(1, command.CommandName);
  76. InvokeClient.Instance.Service.DoOperation(OperationName.DeviceOperation, lstParameter.ToArray());
  77. }
  78. }
  79. }