QueryDataServiceClient.cs 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376
  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.CommonData;
  12. using MECF.Framework.Common.IOCore;
  13. namespace MECF.Framework.Common.DataCenter
  14. {
  15. public class QueryDataClient : Singleton<QueryDataClient>
  16. {
  17. public bool InProcess { get; set; }
  18. private IQueryDataService _service;
  19. public IQueryDataService Service
  20. {
  21. get
  22. {
  23. if (_service == null)
  24. {
  25. if (InProcess)
  26. _service = new QueryDataService();
  27. else
  28. _service = new QueryDataServiceClient();
  29. }
  30. return _service;
  31. }
  32. }
  33. }
  34. public class QueryDataServiceClient : ServiceClientWrapper<IQueryDataService>, IQueryDataService
  35. {
  36. public QueryDataServiceClient()
  37. : base("Client_IQueryDataService", "QueryDataService")
  38. {
  39. }
  40. public Dictionary<string, object> PollData(IEnumerable<string> keys)
  41. {
  42. Dictionary<string, object> result = null;
  43. Invoke(svc => { result = svc.PollData(keys); });
  44. return result;
  45. }
  46. public Dictionary<string, object> PollConfig(IEnumerable<string> keys)
  47. {
  48. Dictionary<string, object> result = null;
  49. Invoke(svc => { result = svc.PollConfig(keys); });
  50. return result;
  51. }
  52. public Dictionary<string, object> PollConfigByModule(string module, IEnumerable<string> keys)
  53. {
  54. Dictionary<string, object> result = null;
  55. Invoke(svc => { result = svc.PollConfigByModule(module, 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 object GetConfigByModule(string module, string key)
  71. {
  72. object result = null;
  73. Invoke(svc => { result = svc.GetConfigByModule(module, key); });
  74. return result;
  75. }
  76. public string GetConfigFileContent()
  77. {
  78. string result = null;
  79. Invoke(svc => { result = svc.GetConfigFileContent(); });
  80. return result;
  81. }
  82. public string GetFileContent(string fileName)
  83. {
  84. string result = null;
  85. Invoke(svc => { result = svc.GetFileContent(fileName); });
  86. return result;
  87. }
  88. public string GetConfigFileDispenseByModule(string module)
  89. {
  90. string result = null;
  91. Invoke(svc => { result = svc.GetConfigFileDispenseByModule(module); });
  92. return result;
  93. }
  94. public List<string> GetFileListByFolderBrowser(string folderBrowser)
  95. {
  96. List<string> result = null;
  97. Invoke(svc => { result = svc.GetFileListByFolderBrowser(folderBrowser); });
  98. return result;
  99. }
  100. public string GetConfigFileContentByModule(string module)
  101. {
  102. string result = null;
  103. Invoke(svc => { result = svc.GetConfigFileContentByModule(module); });
  104. return result;
  105. }
  106. public List<SCConfigItem> GetConfigItemList()
  107. {
  108. List<SCConfigItem> result = null;
  109. Invoke(svc => { result = svc.GetConfigItemList(); });
  110. return result;
  111. }
  112. public List<EventItem> QueryDBEvent(string sql)
  113. {
  114. List<EventItem> result = null;
  115. Invoke(svc => { result = svc.QueryDBEvent(sql); });
  116. return result;
  117. }
  118. public List<HistoryCarrierData> QueryDBCarrier(string sql)
  119. {
  120. List<HistoryCarrierData> result = null;
  121. Invoke(svc => { result = svc.QueryDBCarrier(sql); });
  122. return result;
  123. }
  124. public List<HistoryStatisticsOCRData> QueryDBOCRStatistics(string sql)
  125. {
  126. List<HistoryStatisticsOCRData> result = null;
  127. Invoke(svc => { result = svc.QueryDBOCRStatistics(sql); });
  128. return result;
  129. }
  130. public List<HistoryOCRData> QueryDBOCRHistory(string sql)
  131. {
  132. List<HistoryOCRData> result = null;
  133. Invoke(svc => { result = svc.QueryDBOCRHistory(sql); });
  134. return result;
  135. }
  136. public List<HistoryFfuDiffPressureData> QueryDBFfuDiffPressureStatistics(string sql)
  137. {
  138. List<HistoryFfuDiffPressureData> result = null;
  139. Invoke(svc => { result = svc.QueryDBFfuDiffPressureStatistics(sql); });
  140. return result;
  141. }
  142. public List<StatsStatisticsData> QueryStatsDBStatistics(string sql)
  143. {
  144. List<StatsStatisticsData> result = null;
  145. Invoke(svc => { result = svc.QueryStatsDBStatistics(sql); });
  146. return result;
  147. }
  148. public List<HistoryProcessData> QueryDBProcess(string sql)
  149. {
  150. List<HistoryProcessData> result = null;
  151. Invoke(svc => { result = svc.QueryDBProcess(sql); });
  152. return result;
  153. }
  154. public List<HistoryWaferData> QueryDBWafer(string sql)
  155. {
  156. List<HistoryWaferData> result = null;
  157. Invoke(svc => { result = svc.QueryDBWafer(sql); });
  158. return result;
  159. }
  160. public List<HistoryMoveData> QueryDBMovement(string sql)
  161. {
  162. List<HistoryMoveData> result = null;
  163. Invoke(svc => { result = svc.QueryDBMovement(sql); });
  164. return result;
  165. }
  166. public List<HistoryJobMoveData> QueryDBJobMovementByJobGuid(string jobGuid)
  167. {
  168. List<HistoryJobMoveData> result = null;
  169. Invoke(svc => { result = svc.QueryDBJobMovementByJobGuid(jobGuid); });
  170. return result;
  171. }
  172. public List<HistoryJobMoveData> QueryDBJobMovementByJobGuidAndStationName(string jobGuid, string stationName)
  173. {
  174. List<HistoryJobMoveData> result = null;
  175. Invoke(svc => { result = svc.QueryDBJobMovementByJobGuidAndStationName(jobGuid, stationName); });
  176. return result;
  177. }
  178. public List<HistoryDataItem> GetOneDayHistoryData(IEnumerable<string> keys, DateTime begin, string module)
  179. {
  180. List<HistoryDataItem> result = null;
  181. Invoke(svc => { result = svc.GetOneDayHistoryData(keys, begin, module); });
  182. return result;
  183. }
  184. public List<HistoryDataItem> GetHistoryDataFromStartToEnd(IEnumerable<string> keys, DateTime begin, DateTime end, string module)
  185. {
  186. List<HistoryDataItem> result = null;
  187. Invoke(svc => { result = svc.GetHistoryDataFromStartToEnd(keys, begin, end, module); });
  188. return result;
  189. }
  190. public DataTable QueryData(string sql)
  191. {
  192. DataTable result = null;
  193. Invoke(svc => { result = svc.QueryData(sql); });
  194. return result;
  195. }
  196. public List<HistoryDataItem> GetHistoryData(IEnumerable<string> keys, string recipeRunGuid, string module)
  197. {
  198. List<HistoryDataItem> result = null;
  199. Invoke(svc => { result = svc.GetHistoryData(keys, recipeRunGuid, module); });
  200. return result;
  201. }
  202. public List<NotifiableIoItem> GetDiList(string key)
  203. {
  204. List<NotifiableIoItem> result = null;
  205. Invoke(svc => { result = svc.GetDiList(key); });
  206. return result;
  207. }
  208. public List<NotifiableIoItem> GetDoList(string key)
  209. {
  210. List<NotifiableIoItem> result = null;
  211. Invoke(svc => { result = svc.GetDoList(key); });
  212. return result;
  213. }
  214. public List<NotifiableIoItem> GetAiList(string key)
  215. {
  216. List<NotifiableIoItem> result = null;
  217. Invoke(svc => { result = svc.GetAiList(key); });
  218. return result;
  219. }
  220. public List<NotifiableIoItem> GetAoList(string key)
  221. {
  222. List<NotifiableIoItem> result = null;
  223. Invoke(svc => { result = svc.GetAoList(key); });
  224. return result;
  225. }
  226. public List<WaferHistoryWafer> GetWaferHistoryWafers(string id)
  227. {
  228. List<WaferHistoryWafer> result = null;
  229. Invoke(svc => { result = svc.GetWaferHistoryWafers(id); });
  230. return result;
  231. }
  232. public WaferHistoryRecipe GetWaferHistoryRecipe(string id)
  233. {
  234. WaferHistoryRecipe result = null;
  235. Invoke(svc => { result = svc.GetWaferHistoryRecipe(id); });
  236. return result;
  237. }
  238. public List<WaferHistoryRecipe> GetWaferHistoryRecipes(string id)
  239. {
  240. List<WaferHistoryRecipe> result = null;
  241. Invoke(svc => { result = svc.GetWaferHistoryRecipes(id); });
  242. return result;
  243. }
  244. public List<WaferHistoryMovement> GetWaferHistoryMovements(string id)
  245. {
  246. List<WaferHistoryMovement> result = null;
  247. Invoke(svc => { result = svc.GetWaferHistoryMovements(id); });
  248. return result;
  249. }
  250. public List<WaferHistoryLot> QueryWaferHistoryLotsBySql(string sql)
  251. {
  252. List<WaferHistoryLot> result = null;
  253. Invoke(svc => { result = svc.QueryWaferHistoryLotsBySql(sql); });
  254. return result;
  255. }
  256. public List<WaferHistoryLot> GetWaferHistoryLots(DateTime startTime, DateTime endTime, string keyWord)
  257. {
  258. List<WaferHistoryLot> result = null;
  259. Invoke(svc => { result = svc.GetWaferHistoryLots(startTime, endTime, keyWord); });
  260. return result;
  261. }
  262. public string GetTypedConfigContent(string type, string contentPath)
  263. {
  264. string result = null;
  265. Invoke(svc => { result = svc.GetTypedConfigContent(type, contentPath); });
  266. return result;
  267. }
  268. public void SetTypedConfigContent(string type, string contentPath, string content)
  269. {
  270. Invoke(svc => { svc.SetTypedConfigContent(type, contentPath, content); });
  271. }
  272. public List<WaferHistorySecquence> GetWaferHistorySecquences(string id)
  273. {
  274. List<WaferHistorySecquence> result = null;
  275. Invoke(svc => { result = svc.GetWaferHistorySecquences(id); });
  276. return result;
  277. }
  278. public List<string> GetExpertLayoutRecipeContent(string chamberId, string recipeFile)
  279. {
  280. List<string> result = null;
  281. Invoke(svc => { result = svc.GetExpertLayoutRecipeContent(chamberId, recipeFile); });
  282. return result;
  283. }
  284. public List<string> GetLayoutRecipeContent(/*string chamberId, */string recipeContent, string slotCount, string cassetteSlotCount)
  285. {
  286. List<string> result = null;
  287. Invoke(svc => { result = svc.GetLayoutRecipeContent(/*chamberId, */recipeContent, slotCount, cassetteSlotCount); });
  288. return result;
  289. }
  290. public List<string> GetLayoutExpertRecipeContent(string recipeContent, string slotCount, string cassetteSlotCount)
  291. {
  292. List<string> result = null;
  293. Invoke(svc => { result = svc.GetLayoutExpertRecipeContent(/*chamberId, */recipeContent, slotCount, cassetteSlotCount); });
  294. return result;
  295. }
  296. public string GetInterlockConfigContent()
  297. {
  298. string result = null;
  299. Invoke(svc => { result = svc.GetInterlockConfigContent(); });
  300. return result;
  301. }
  302. public string GetInterlockUserDefineConfigContent()
  303. {
  304. string result = null;
  305. Invoke(svc => { result = svc.GetInterlockUserDefineConfigContent(); });
  306. return result;
  307. }
  308. public void SetInterlockConfigContent(string content)
  309. {
  310. Invoke(svc => { svc.SetInterlockConfigContent(content); });
  311. }
  312. public List<RecipeHistory> QueryByRecipePathHistory(string RecipePath, int row = 20)
  313. {
  314. List<RecipeHistory> result = null;
  315. Invoke(svc => { result = svc.QueryByRecipePathHistory(RecipePath, row); });
  316. return result;
  317. }
  318. public bool ClearByRecipePathHistory(string RecipePath)
  319. {
  320. bool result = false;
  321. Invoke(svc => { result = svc.ClearByRecipePathHistory(RecipePath); });
  322. return result;
  323. }
  324. }
  325. }