QueryDataServiceClient.cs 13 KB

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