QueryDataServiceClient.cs 7.9 KB

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