AITWaferIdReaderData.cs 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Linq;
  5. using System.Reflection;
  6. using System.Runtime.Serialization;
  7. using System.Text;
  8. using System.Windows.Input;
  9. using Aitex.Core.UI.MVVM;
  10. namespace Aitex.Core.Common.DeviceData
  11. {
  12. [DataContract]
  13. [Serializable]
  14. public class AITWaferIdReaderData : INotifyPropertyChanged, IDeviceData
  15. {
  16. public event PropertyChangedEventHandler PropertyChanged;
  17. public void InvokePropertyChanged(string propertyName)
  18. {
  19. if (PropertyChanged != null)
  20. {
  21. PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
  22. }
  23. }
  24. public void InvokePropertyChanged()
  25. {
  26. PropertyInfo[] ps = this.GetType().GetProperties();
  27. foreach (PropertyInfo p in ps)
  28. {
  29. InvokePropertyChanged(p.Name);
  30. if (p.PropertyType == typeof (ICommand))
  31. {
  32. DelegateCommand<string> cmd = p.GetValue(this, null) as DelegateCommand<string>;
  33. if (cmd != null)
  34. cmd.RaiseCanExecuteChanged();
  35. }
  36. }
  37. FieldInfo[] fi = this.GetType().GetFields();
  38. foreach (FieldInfo p in fi)
  39. {
  40. InvokePropertyChanged(p.Name);
  41. if (p.FieldType == typeof (ICommand))
  42. {
  43. DelegateCommand<string> cmd = p.GetValue(this) as DelegateCommand<string>;
  44. if (cmd != null)
  45. cmd.RaiseCanExecuteChanged();
  46. }
  47. }
  48. }
  49. /// <summary>
  50. /// 阀的唯一名称,UI与RT交互的ID
  51. /// </summary>
  52. [DataMember]
  53. public string DeviceName { get; set; }
  54. /// <summary>
  55. /// 显示在界面上的名称
  56. /// </summary>
  57. [DataMember]
  58. public string DisplayName { get; set; }
  59. /// <summary>
  60. /// IO 表中定义的物理编号,物理追溯使用 比如: V122
  61. /// </summary>
  62. [DataMember]
  63. public string DeviceSchematicId { get; set; }
  64. [DataMember]
  65. public bool IsInitalized { get; set; }
  66. [DataMember]
  67. public bool IsBusy { get; set; }
  68. [DataMember]
  69. public bool IsError { get; set; }
  70. [DataMember]
  71. public string FoupID { get; set; }
  72. public AITWaferIdReaderData()
  73. {
  74. DisplayName = "Undefined";
  75. }
  76. public void Update(IDeviceData data)
  77. {
  78. }
  79. }
  80. public class AITWaferIdReaderOperation
  81. {
  82. public const string TrigOn = "TrigOn";
  83. public const string TrigOff = "TrigOff";
  84. }
  85. public class AITWaferIdReaderPropertyName
  86. {
  87. public const string Status = "Status";
  88. }
  89. }