QueryDataServiceClient.cs 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324
  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.SCCore;
  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.IOCore;
  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 Dictionary<string, object> PollConfigByModule(string module, IEnumerable<string> keys)
  52. {
  53. Dictionary<string, object> result = null;
  54. Invoke(svc => { result = svc.PollConfigByModule(module, keys); });
  55. return result;
  56. }
  57. public object GetData(string key)
  58. {
  59. object result = null;
  60. Invoke(svc => { result = svc.GetData(key); });
  61. return result;
  62. }
  63. public object GetConfig(string key)
  64. {
  65. object result = null;
  66. Invoke(svc => { result = svc.GetConfig(key); });
  67. return result;
  68. }
  69. public void SetItemValue(string key, int value)
  70. {
  71. Invoke(svc => { svc.SetItemValue(key, value); });
  72. }
  73. public object GetConfigByModule(string module, string key)
  74. {
  75. object result = null;
  76. Invoke(svc => { result = svc.GetConfigByModule(module, key); });
  77. return result;
  78. }
  79. public string GetConfigFileContent()
  80. {
  81. string result = null;
  82. Invoke(svc => { result = svc.GetConfigFileContent(); });
  83. return result;
  84. }
  85. public string GetConfigFileContentByModule(string module)
  86. {
  87. string result = null;
  88. Invoke(svc => { result = svc.GetConfigFileContentByModule(module); });
  89. return result;
  90. }
  91. public List<SCConfigItem> GetConfigItemList()
  92. {
  93. List<SCConfigItem> result = null;
  94. Invoke(svc => { result = svc.GetConfigItemList(); });
  95. return result;
  96. }
  97. public List<EventItem> QueryDBEvent(string sql)
  98. {
  99. List<EventItem> result = null;
  100. Invoke(svc => { result = svc.QueryDBEvent(sql); });
  101. return result;
  102. }
  103. public List<HistoryCarrierData> QueryDBCarrier(string sql)
  104. {
  105. List<HistoryCarrierData> result = null;
  106. Invoke(svc => { result = svc.QueryDBCarrier(sql); });
  107. return result;
  108. }
  109. public List<HistoryProcessData> QueryDBProcessCarrier(string sql)
  110. {
  111. List<HistoryProcessData> result = null;
  112. Invoke(svc => { result = svc.QueryDBProcessCarrier(sql); });
  113. return result;
  114. }
  115. public List<HistoryProcessData> QueryDBProcessLot(string sql)
  116. {
  117. List<HistoryProcessData> result = null;
  118. Invoke(svc => { result = svc.QueryDBProcessLot(sql); });
  119. return result;
  120. }
  121. public List<HistoryStatisticsOCRData> QueryDBOCRStatistics(string sql)
  122. {
  123. List<HistoryStatisticsOCRData> result = null;
  124. Invoke(svc => { result = svc.QueryDBOCRStatistics(sql); });
  125. return result;
  126. }
  127. public List<HistoryOCRData> QueryDBOCRHistory(string sql)
  128. {
  129. List<HistoryOCRData> result = null;
  130. Invoke(svc => { result = svc.QueryDBOCRHistory(sql); });
  131. return result;
  132. }
  133. public List<HistoryFfuDiffPressureData> QueryDBFfuDiffPressureStatistics(string sql)
  134. {
  135. List<HistoryFfuDiffPressureData> result = null;
  136. Invoke(svc => { result = svc.QueryDBFfuDiffPressureStatistics(sql); });
  137. return result;
  138. }
  139. public List<StatsStatisticsData> QueryStatsDBStatistics(string sql)
  140. {
  141. List<StatsStatisticsData> result = null;
  142. Invoke(svc => { result = svc.QueryStatsDBStatistics(sql); });
  143. return result;
  144. }
  145. public List<HistoryProcessData> QueryDBProcess(string sql)
  146. {
  147. List<HistoryProcessData> result = null;
  148. Invoke(svc => { result = svc.QueryDBProcess(sql); });
  149. return result;
  150. }
  151. public List<HistoryWaferData> QueryDBWafer(string sql)
  152. {
  153. List<HistoryWaferData> result = null;
  154. Invoke(svc => { result = svc.QueryDBWafer(sql); });
  155. return result;
  156. }
  157. public List<HistoryMoveData> QueryDBMovement(string sql)
  158. {
  159. List<HistoryMoveData> result = null;
  160. Invoke(svc => { result = svc.QueryDBMovement(sql); });
  161. return result;
  162. }
  163. public List<HistoryJobMoveData> QueryDBJobMovementByJobGuid(string jobGuid)
  164. {
  165. List<HistoryJobMoveData> result = null;
  166. Invoke(svc => { result = svc.QueryDBJobMovementByJobGuid(jobGuid); });
  167. return result;
  168. }
  169. public List<HistoryJobMoveData> QueryDBJobMovementByJobGuidAndStationName(string jobGuid, string stationName)
  170. {
  171. List<HistoryJobMoveData> result = null;
  172. Invoke(svc => { result = svc.QueryDBJobMovementByJobGuidAndStationName(jobGuid, stationName); });
  173. return result;
  174. }
  175. public List<HistoryDataItem> GetOneDayHistoryData(IEnumerable<string> keys, DateTime begin, string module)
  176. {
  177. List<HistoryDataItem> result = null;
  178. Invoke(svc => { result = svc.GetOneDayHistoryData(keys, begin, module); });
  179. return result;
  180. }
  181. public List<HistoryDataItem> GetHistoryDataFromStartToEnd(IEnumerable<string> keys, DateTime begin, DateTime end, string module)
  182. {
  183. List<HistoryDataItem> result = null;
  184. Invoke(svc => { result = svc.GetHistoryDataFromStartToEnd(keys, begin, end, module); });
  185. return result;
  186. }
  187. public DataTable QueryData(string sql)
  188. {
  189. DataTable result = null;
  190. Invoke(svc => { result = svc.QueryData(sql); });
  191. return result;
  192. }
  193. public List<HistoryDataItem> GetHistoryData(IEnumerable<string> keys, string recipeRunGuid, string module)
  194. {
  195. List<HistoryDataItem> result = null;
  196. Invoke(svc => { result = svc.GetHistoryData(keys, recipeRunGuid, module); });
  197. return result;
  198. }
  199. public List<NotifiableIoItem> GetDiList(string key)
  200. {
  201. List<NotifiableIoItem> result = null;
  202. Invoke(svc => { result = svc.GetDiList(key); });
  203. return result;
  204. }
  205. public List<NotifiableIoItem> GetDoList(string key)
  206. {
  207. List<NotifiableIoItem> result = null;
  208. Invoke(svc => { result = svc.GetDoList(key); });
  209. return result;
  210. }
  211. public List<NotifiableIoItem> GetAiList(string key)
  212. {
  213. List<NotifiableIoItem> result = null;
  214. Invoke(svc => { result = svc.GetAiList(key); });
  215. return result;
  216. }
  217. public List<NotifiableIoItem> GetAoList(string key)
  218. {
  219. List<NotifiableIoItem> result = null;
  220. Invoke(svc => { result = svc.GetAoList(key); });
  221. return result;
  222. }
  223. public List<WaferHistoryWafer> GetWaferHistoryWafers(string id)
  224. {
  225. List<WaferHistoryWafer> result = null;
  226. Invoke(svc => { result = svc.GetWaferHistoryWafers(id); });
  227. return result;
  228. }
  229. public WaferHistoryRecipe GetWaferHistoryRecipe(string id)
  230. {
  231. WaferHistoryRecipe result = null;
  232. Invoke(svc => { result = svc.GetWaferHistoryRecipe(id); });
  233. return result;
  234. }
  235. public List<WaferHistoryRecipe> GetWaferHistoryRecipes(string id)
  236. {
  237. List<WaferHistoryRecipe> result = null;
  238. Invoke(svc => { result = svc.GetWaferHistoryRecipes(id); });
  239. return result;
  240. }
  241. public List<WaferHistoryMovement> GetWaferHistoryMovements(string id)
  242. {
  243. List<WaferHistoryMovement> result = null;
  244. Invoke(svc => { result = svc.GetWaferHistoryMovements(id); });
  245. return result;
  246. }
  247. public List<WaferHistoryLot> QueryWaferHistoryLotsBySql(string sql)
  248. {
  249. List<WaferHistoryLot> result = null;
  250. Invoke(svc => { result = svc.QueryWaferHistoryLotsBySql(sql); });
  251. return result;
  252. }
  253. public List<WaferHistoryLot> GetWaferHistoryLots(DateTime startTime, DateTime endTime, string keyWord)
  254. {
  255. List<WaferHistoryLot> result = null;
  256. Invoke(svc => { result = svc.GetWaferHistoryLots(startTime, endTime, keyWord); });
  257. return result;
  258. }
  259. public string GetTypedConfigContent(string type, string contentPath)
  260. {
  261. string result = null;
  262. Invoke(svc => { result = svc.GetTypedConfigContent(type, contentPath); });
  263. return result;
  264. }
  265. public void SetTypedConfigContent(string type, string contentPath, string content)
  266. {
  267. Invoke(svc => { svc.SetTypedConfigContent(type, contentPath, content); });
  268. }
  269. public List<WaferHistorySecquence> GetWaferHistorySecquences(string id)
  270. {
  271. List<WaferHistorySecquence> result = null;
  272. Invoke(svc => { result = svc.GetWaferHistorySecquences(id); });
  273. return result;
  274. }
  275. public List<string> GetLayoutRecipeContent(string recipeContent, string slotCount, string cassetteSlotCount)
  276. {
  277. List<string> result = null;
  278. Invoke(svc => { result = svc.GetLayoutRecipeContent(recipeContent, slotCount, cassetteSlotCount); });
  279. return result;
  280. }
  281. }
  282. }