QueryDataServiceClient.cs 8.7 KB

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