QueryDataServiceClient.cs 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  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.CommonData;
  11. using MECF.Framework.Common.DBCore;
  12. using MECF.Framework.Common.IOCore;
  13. using Venus_Core;
  14. using VenusCommon;
  15. namespace MECF.Framework.Common.DataCenter
  16. {
  17. public class QueryDataClient : Singleton<QueryDataClient>
  18. {
  19. public bool InProcess { get; set; }
  20. private IQueryDataService _service;
  21. public IQueryDataService Service
  22. {
  23. get
  24. {
  25. if (_service == null)
  26. {
  27. if (InProcess)
  28. _service = new QueryDataService();
  29. else
  30. _service = new QueryDataServiceClient();
  31. }
  32. return _service;
  33. }
  34. }
  35. }
  36. public class QueryDataServiceClient : ServiceClientWrapper<IQueryDataService>, IQueryDataService
  37. {
  38. public QueryDataServiceClient()
  39. : base("Client_IQueryDataService", "QueryDataService")
  40. {
  41. }
  42. public Dictionary<string, object> PollData(IEnumerable<string> keys)
  43. {
  44. Dictionary<string, object> result = null;
  45. Invoke(svc => { result = svc.PollData(keys); });
  46. return result;
  47. }
  48. public Dictionary<string, object> PollConfig(IEnumerable<string> keys)
  49. {
  50. Dictionary<string, object> result = null;
  51. Invoke(svc => { result = svc.PollConfig(keys); });
  52. return result;
  53. }
  54. public object GetData(string key)
  55. {
  56. object result = null;
  57. Invoke(svc => { result = svc.GetData(key); });
  58. return result;
  59. }
  60. public object GetConfig(string key)
  61. {
  62. object result = null;
  63. Invoke(svc => { result = svc.GetConfig(key); });
  64. return result;
  65. }
  66. public string GetConfigFileContent( )
  67. {
  68. string result = null;
  69. Invoke(svc => { result = svc.GetConfigFileContent(); });
  70. return result;
  71. }
  72. public List<EventItem> QueryDBEvent(string sql)
  73. {
  74. List<EventItem> result = null;
  75. Invoke(svc => { result = svc.QueryDBEvent(sql); });
  76. return result;
  77. }
  78. public List<HistoryCarrierData> QueryDBCarrier(string sql)
  79. {
  80. List<HistoryCarrierData> result = null;
  81. Invoke(svc => { result = svc.QueryDBCarrier(sql); });
  82. return result;
  83. }
  84. public List<HistoryProcessData> QueryDBProcess(string sql)
  85. {
  86. List<HistoryProcessData> result = null;
  87. Invoke(svc => { result = svc.QueryDBProcess(sql); });
  88. return result;
  89. }
  90. public List<HistoryWaferData> QueryDBWafer(string sql)
  91. {
  92. List<HistoryWaferData> result = null;
  93. Invoke(svc => { result = svc.QueryDBWafer(sql); });
  94. return result;
  95. }
  96. public List<HistoryMoveData> QueryDBMovement(string sql)
  97. {
  98. List<HistoryMoveData> result = null;
  99. Invoke(svc => { result = svc.QueryDBMovement(sql); });
  100. return result;
  101. }
  102. public List<HistoryJobMoveData> QueryDBJobMovementByJobGuid(string jobGuid)
  103. {
  104. List<HistoryJobMoveData> result = null;
  105. Invoke(svc => { result = svc.QueryDBJobMovementByJobGuid( jobGuid); });
  106. return result;
  107. }
  108. public List<HistoryJobMoveData> QueryDBJobMovementByJobGuidAndStationName(string jobGuid, string stationName)
  109. {
  110. List<HistoryJobMoveData> result = null;
  111. Invoke(svc => { result = svc.QueryDBJobMovementByJobGuidAndStationName( jobGuid, stationName); });
  112. return result;
  113. }
  114. public List<HistoryDataItem> GetOneDayHistoryData(IEnumerable<string> keys, DateTime begin, string module)
  115. {
  116. List<HistoryDataItem> result = null;
  117. Invoke(svc => { result = svc.GetOneDayHistoryData(keys,begin, module); });
  118. return result;
  119. }
  120. public List<HistoryDataItem> GetHistoryDataFromStartToEnd(IEnumerable<string> keys, DateTime begin,DateTime end, string module)
  121. {
  122. List<HistoryDataItem> result = null;
  123. Invoke(svc => { result = svc.GetHistoryDataFromStartToEnd(keys, begin, end,module); });
  124. return result;
  125. }
  126. public DataTable QueryData(string sql)
  127. {
  128. DataTable result = null;
  129. Invoke(svc => { result = svc.QueryData(sql); });
  130. return result;
  131. }
  132. public List<HistoryDataItem> GetHistoryData(IEnumerable<string> keys, string recipeRunGuid, string module)
  133. {
  134. List<HistoryDataItem> result = null;
  135. Invoke(svc => { result = svc.GetHistoryData(keys, recipeRunGuid, module); });
  136. return result;
  137. }
  138. public List<NotifiableIoItem> GetDiList(string key)
  139. {
  140. List<NotifiableIoItem> result = null;
  141. Invoke(svc => { result = svc.GetDiList(key); });
  142. return result;
  143. }
  144. public List<NotifiableIoItem> GetDoList(string key)
  145. {
  146. List<NotifiableIoItem> result = null;
  147. Invoke(svc => { result = svc.GetDoList(key); });
  148. return result;
  149. }
  150. public List<NotifiableIoItem> GetAiList(string key)
  151. {
  152. List<NotifiableIoItem> result = null;
  153. Invoke(svc => { result = svc.GetAiList(key); });
  154. return result;
  155. }
  156. public List<NotifiableIoItem> GetAoList(string key)
  157. {
  158. List<NotifiableIoItem> result = null;
  159. Invoke(svc => { result = svc.GetAoList(key); });
  160. return result;
  161. }
  162. public List<LeakCheckResultItem> GetHistoryLeakCheck(string Module)
  163. {
  164. List<LeakCheckResultItem> result = null;
  165. Invoke(svc =>
  166. {
  167. result = svc.GetHistoryLeakCheck(Module);
  168. });
  169. return result;
  170. }
  171. public List<PMLeakCheckResult> GetPMLeakCheckResult(string Module)
  172. {
  173. List<PMLeakCheckResult> result = null;
  174. Invoke(svc =>
  175. {
  176. result = svc.GetPMLeakCheckResult(Module);
  177. });
  178. return result;
  179. }
  180. public List<MFCVerificationData> GetMFCVerificationData(DateTime begin, DateTime end)
  181. {
  182. List<MFCVerificationData> result = null;
  183. Invoke(svc =>
  184. {
  185. result = svc.GetMFCVerificationData(begin,end);
  186. });
  187. return result;
  188. }
  189. public List<MFCVerificationOnePointData> GetMFCVerificationOnePointData()
  190. {
  191. List<MFCVerificationOnePointData> result = null;
  192. Invoke(svc =>
  193. {
  194. result = svc.GetMFCVerificationOnePointData();
  195. });
  196. return result;
  197. }
  198. public List<MFCVerificationTenPointsData> GetMFCVerificationTenPointsData()
  199. {
  200. List<MFCVerificationTenPointsData> result = null;
  201. Invoke(svc =>
  202. {
  203. result = svc.GetMFCVerificationTenPointsData();
  204. });
  205. return result;
  206. }
  207. }
  208. }