QueryDataServiceClient.cs 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303
  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. using static System.Windows.Forms.VisualStyles.VisualStyleElement.StartPanel;
  20. namespace MECF.Framework.Common.DataCenter
  21. {
  22. public class QueryDataClient : Singleton<QueryDataClient>
  23. {
  24. public bool InProcess { get; set; }
  25. private IQueryDataService _service;
  26. public IQueryDataService Service
  27. {
  28. get
  29. {
  30. if (_service == null)
  31. {
  32. if (InProcess)
  33. _service = new QueryDataService();
  34. else
  35. _service = new QueryDataServiceClient();
  36. }
  37. return _service;
  38. }
  39. }
  40. }
  41. public class QueryDataServiceClient : ServiceClientWrapper<IQueryDataService>, IQueryDataService
  42. {
  43. public QueryDataServiceClient()
  44. : base("Client_IQueryDataService", "QueryDataService")
  45. {
  46. }
  47. public Dictionary<string, object> PollData(IEnumerable<string> keys)
  48. {
  49. Dictionary<string, object> result = null;
  50. Invoke(svc => { result = svc.PollData(keys); });
  51. return result;
  52. }
  53. public Dictionary<string, object> PollConfig(IEnumerable<string> keys)
  54. {
  55. Dictionary<string, object> result = null;
  56. Invoke(svc => { result = svc.PollConfig(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 string GetConfigFileContent( )
  72. {
  73. string result = null;
  74. Invoke(svc => { result = svc.GetConfigFileContent(); });
  75. return result;
  76. }
  77. public List<EventItem> QueryDBEvent(string sql)
  78. {
  79. List<EventItem> result = null;
  80. Invoke(svc => { result = svc.QueryDBEvent(sql); });
  81. return result;
  82. }
  83. public List<HistoryCarrierData> QueryDBCarrier(string sql)
  84. {
  85. List<HistoryCarrierData> result = null;
  86. Invoke(svc => { result = svc.QueryDBCarrier(sql); });
  87. return result;
  88. }
  89. public List<HistoryProcessData> QueryDBProcess(string sql)
  90. {
  91. List<HistoryProcessData> result = null;
  92. Invoke(svc => { result = svc.QueryDBProcess(sql); });
  93. return result;
  94. }
  95. public List<HistoryWaferData> QueryDBWafer(string sql)
  96. {
  97. List<HistoryWaferData> result = null;
  98. Invoke(svc => { result = svc.QueryDBWafer(sql); });
  99. return result;
  100. }
  101. public List<HistoryMoveData> QueryDBMovement(string sql)
  102. {
  103. List<HistoryMoveData> result = null;
  104. Invoke(svc => { result = svc.QueryDBMovement(sql); });
  105. return result;
  106. }
  107. public List<HistoryJobMoveData> QueryDBJobMovementByJobGuid(string jobGuid)
  108. {
  109. List<HistoryJobMoveData> result = null;
  110. Invoke(svc => { result = svc.QueryDBJobMovementByJobGuid( jobGuid); });
  111. return result;
  112. }
  113. public List<HistoryJobMoveData> QueryDBJobMovementByJobGuidAndStationName(string jobGuid, string stationName)
  114. {
  115. List<HistoryJobMoveData> result = null;
  116. Invoke(svc => { result = svc.QueryDBJobMovementByJobGuidAndStationName( jobGuid, stationName); });
  117. return result;
  118. }
  119. public List<HistoryDataItem> GetOneDayHistoryData(IEnumerable<string> keys, DateTime begin, string module)
  120. {
  121. List<HistoryDataItem> result = null;
  122. Invoke(svc => { result = svc.GetOneDayHistoryData(keys,begin, module); });
  123. return result;
  124. }
  125. public List<HistoryDataItem> GetHistoryDataFromStartToEnd(IEnumerable<string> keys, DateTime begin,DateTime end, string module)
  126. {
  127. List<HistoryDataItem> result = null;
  128. Invoke(svc => { result = svc.GetHistoryDataFromStartToEnd(keys, begin, end,module); });
  129. return result;
  130. }
  131. public DataTable QueryData(string sql)
  132. {
  133. DataTable result = null;
  134. Invoke(svc => { result = svc.QueryData(sql); });
  135. return result;
  136. }
  137. public List<HistoryDataItem> GetHistoryData(IEnumerable<string> keys, string recipeRunGuid, string module)
  138. {
  139. List<HistoryDataItem> result = null;
  140. Invoke(svc => { result = svc.GetHistoryData(keys, recipeRunGuid, module); });
  141. return result;
  142. }
  143. public List<NotifiableIoItem> GetDiList(string key)
  144. {
  145. List<NotifiableIoItem> result = null;
  146. Invoke(svc => { result = svc.GetDiList(key); });
  147. return result;
  148. }
  149. public List<NotifiableIoItem> GetDoList(string key)
  150. {
  151. List<NotifiableIoItem> result = null;
  152. Invoke(svc => { result = svc.GetDoList(key); });
  153. return result;
  154. }
  155. public List<NotifiableIoItem> GetAiList(string key)
  156. {
  157. List<NotifiableIoItem> result = null;
  158. Invoke(svc => { result = svc.GetAiList(key); });
  159. return result;
  160. }
  161. public List<NotifiableIoItem> GetAoList(string key)
  162. {
  163. List<NotifiableIoItem> result = null;
  164. Invoke(svc => { result = svc.GetAoList(key); });
  165. return result;
  166. }
  167. public List<LeakCheckResultItem> GetHistoryLeakCheck(string Module)
  168. {
  169. List<LeakCheckResultItem> result = null;
  170. Invoke(svc =>
  171. {
  172. result = svc.GetHistoryLeakCheck(Module);
  173. });
  174. return result;
  175. }
  176. public List<PMLeakCheckResult> GetPMLeakCheckResult(string Module)
  177. {
  178. List<PMLeakCheckResult> result = null;
  179. Invoke(svc =>
  180. {
  181. result = svc.GetPMLeakCheckResult(Module);
  182. });
  183. return result;
  184. }
  185. public List<PMLeakCheckResult> GetPMLeakCheckResultWithBasePressure(string Module)
  186. {
  187. List<PMLeakCheckResult> result = null;
  188. Invoke(svc =>
  189. {
  190. result = svc.GetPMLeakCheckResultWithBasePressure(Module);
  191. });
  192. return result;
  193. }
  194. public List<MFCVerificationData> GetMFCVerificationData(DateTime begin, DateTime end)
  195. {
  196. List<MFCVerificationData> result = null;
  197. Invoke(svc =>
  198. {
  199. result = svc.GetMFCVerificationData(begin,end);
  200. });
  201. return result;
  202. }
  203. public List<MFCVerificationOnePointData> GetMFCVerificationOnePointData()
  204. {
  205. List<MFCVerificationOnePointData> result = null;
  206. Invoke(svc =>
  207. {
  208. result = svc.GetMFCVerificationOnePointData();
  209. });
  210. return result;
  211. }
  212. public List<MFCVerificationTenPointsData> GetMFCVerificationTenPointsData()
  213. {
  214. List<MFCVerificationTenPointsData> result = null;
  215. Invoke(svc =>
  216. {
  217. result = svc.GetMFCVerificationTenPointsData();
  218. });
  219. return result;
  220. }
  221. public List<HistoryStepItem> GetHistorySteps(DateTime begin, DateTime end)
  222. {
  223. List<HistoryStepItem> result = null;
  224. Invoke(svc =>
  225. {
  226. result = svc.GetHistorySteps(begin,end);
  227. });
  228. return result;
  229. }
  230. public List<OffsetItem> QueryOffsetDataByTime(string moduleName, DateTime from_time, DateTime to_time)
  231. {
  232. List<OffsetItem> result = null;
  233. Invoke(svc => { result = svc.QueryOffsetDataByTime(moduleName, from_time, to_time); });
  234. return result;
  235. }
  236. public int GetDBEventAllCount(string sql)
  237. {
  238. int result = 0;
  239. Invoke(svc => { result = svc.GetDBEventAllCount(sql); });
  240. return result;
  241. }
  242. public string GetTypedConfigContent(string type, string contentPath)
  243. {
  244. string result="";
  245. Invoke(svc => { result = svc.GetTypedConfigContent(type, contentPath); });
  246. return result;
  247. }
  248. public void SetTypedConfigContent(string type, string contentPath, string content)
  249. {
  250. Invoke(svc => { svc.SetTypedConfigContent(type, contentPath, content); });
  251. }
  252. public List<UserItem> QueryAllUsers()
  253. {
  254. List<UserItem> result = new List<UserItem>();
  255. Invoke(svc => { result = svc.QueryAllUsers(); });
  256. return result;
  257. }
  258. public void InserUser(UserItem userItem)
  259. {
  260. Invoke(svc => { svc.InserUser(userItem); });
  261. }
  262. public void DeleteUser(string userName)
  263. {
  264. Invoke(svc => { svc.DeleteUser(userName); });
  265. }
  266. public void DeleteCounterItem(string name)
  267. {
  268. Invoke(svc => { svc.DeleteCounterItem(name); });
  269. }
  270. }
  271. }