QueryDataServiceClient.cs 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Data;
  4. using Aitex.Core.RT.Event;
  5. using Aitex.Core.RT.IOCore;
  6. using Aitex.Core.UI.ControlDataContext;
  7. using Aitex.Core.Util;
  8. using Aitex.Core.WCF;
  9. using Aitex.Sorter.Common;
  10. using MECF.Framework.Common.IOCore;
  11. using Virgo_DCommon;
  12. namespace MECF.Framework.Common.DataCenter
  13. {
  14. public class QueryDataClient : Singleton<QueryDataClient>
  15. {
  16. public bool InProcess { get; set; }
  17. private IQueryDataService _service;
  18. public IQueryDataService Service
  19. {
  20. get
  21. {
  22. if (_service == null)
  23. {
  24. if (InProcess)
  25. _service = new QueryDataService();
  26. else
  27. _service = new QueryDataServiceClient();
  28. }
  29. return _service;
  30. }
  31. }
  32. }
  33. public class QueryDataServiceClient : ServiceClientWrapper<IQueryDataService>, IQueryDataService
  34. {
  35. public QueryDataServiceClient()
  36. : base("Client_IQueryDataService", "QueryDataService")
  37. {
  38. }
  39. public Dictionary<string, object> PollData(IEnumerable<string> keys)
  40. {
  41. Dictionary<string, object> result = null;
  42. Invoke(svc => { result = svc.PollData(keys); });
  43. return result;
  44. }
  45. public Dictionary<string, object> PollConfig(IEnumerable<string> keys)
  46. {
  47. Dictionary<string, object> result = null;
  48. Invoke(svc => { result = svc.PollConfig(keys); });
  49. return result;
  50. }
  51. public object GetData(string key)
  52. {
  53. object result = null;
  54. Invoke(svc => { result = svc.GetData(key); });
  55. return result;
  56. }
  57. public object GetConfig(string key)
  58. {
  59. object result = null;
  60. Invoke(svc => { result = svc.GetConfig(key); });
  61. return result;
  62. }
  63. public string GetConfigFileContent( )
  64. {
  65. string result = null;
  66. Invoke(svc => { result = svc.GetConfigFileContent(); });
  67. return result;
  68. }
  69. public List<EventItem> QueryDBEvent(string sql)
  70. {
  71. List<EventItem> result = null;
  72. Invoke(svc => { result = svc.QueryDBEvent(sql); });
  73. return result;
  74. }
  75. public List<HistoryCarrierData> QueryDBCarrier(string sql)
  76. {
  77. List<HistoryCarrierData> result = null;
  78. Invoke(svc => { result = svc.QueryDBCarrier(sql); });
  79. return result;
  80. }
  81. public List<HistoryProcessData> QueryDBProcess(string sql)
  82. {
  83. List<HistoryProcessData> result = null;
  84. Invoke(svc => { result = svc.QueryDBProcess(sql); });
  85. return result;
  86. }
  87. public List<HistoryWaferData> QueryDBWafer(string sql)
  88. {
  89. List<HistoryWaferData> result = null;
  90. Invoke(svc => { result = svc.QueryDBWafer(sql); });
  91. return result;
  92. }
  93. public List<HistoryMoveData> QueryDBMovement(string sql)
  94. {
  95. List<HistoryMoveData> result = null;
  96. Invoke(svc => { result = svc.QueryDBMovement(sql); });
  97. return result;
  98. }
  99. public List<HistoryJobMoveData> QueryDBJobMovementByJobGuid(string jobGuid)
  100. {
  101. List<HistoryJobMoveData> result = null;
  102. Invoke(svc => { result = svc.QueryDBJobMovementByJobGuid( jobGuid); });
  103. return result;
  104. }
  105. public List<HistoryJobMoveData> QueryDBJobMovementByJobGuidAndStationName(string jobGuid, string stationName)
  106. {
  107. List<HistoryJobMoveData> result = null;
  108. Invoke(svc => { result = svc.QueryDBJobMovementByJobGuidAndStationName( jobGuid, stationName); });
  109. return result;
  110. }
  111. public List<HistoryDataItem> GetOneDayHistoryData(IEnumerable<string> keys, DateTime begin, string module)
  112. {
  113. List<HistoryDataItem> result = null;
  114. Invoke(svc => { result = svc.GetOneDayHistoryData(keys,begin, module); });
  115. return result;
  116. }
  117. public List<HistoryDataItem> GetHistoryDataFromStartToEnd(IEnumerable<string> keys, DateTime begin,DateTime end, string module)
  118. {
  119. List<HistoryDataItem> result = null;
  120. Invoke(svc => { result = svc.GetHistoryDataFromStartToEnd(keys, begin, end,module); });
  121. return result;
  122. }
  123. public DataTable QueryData(string sql)
  124. {
  125. DataTable result = null;
  126. Invoke(svc => { result = svc.QueryData(sql); });
  127. return result;
  128. }
  129. public List<HistoryDataItem> GetHistoryData(IEnumerable<string> keys, string recipeRunGuid, string module)
  130. {
  131. List<HistoryDataItem> result = null;
  132. Invoke(svc => { result = svc.GetHistoryData(keys, recipeRunGuid, module); });
  133. return result;
  134. }
  135. public List<NotifiableIoItem> GetDiList(string key)
  136. {
  137. List<NotifiableIoItem> result = null;
  138. Invoke(svc => { result = svc.GetDiList(key); });
  139. return result;
  140. }
  141. public List<NotifiableIoItem> GetDoList(string key)
  142. {
  143. List<NotifiableIoItem> result = null;
  144. Invoke(svc => { result = svc.GetDoList(key); });
  145. return result;
  146. }
  147. public List<NotifiableIoItem> GetAiList(string key)
  148. {
  149. List<NotifiableIoItem> result = null;
  150. Invoke(svc => { result = svc.GetAiList(key); });
  151. return result;
  152. }
  153. public List<NotifiableIoItem> GetAoList(string key)
  154. {
  155. List<NotifiableIoItem> result = null;
  156. Invoke(svc => { result = svc.GetAoList(key); });
  157. return result;
  158. }
  159. public List<LeakCheckResultItem> GetHistoryLeakCheck(string Module)
  160. {
  161. List<LeakCheckResultItem> result = null;
  162. Invoke(svc =>
  163. {
  164. result = svc.GetHistoryLeakCheck(Module);
  165. });
  166. return result;
  167. }
  168. }
  169. }