QueryDataServiceClient.cs 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  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.UI.ControlDataContext;
  7. using Aitex.Core.Util;
  8. using Aitex.Core.WCF;
  9. using Aitex.Sorter.Common;
  10. using MECF.Framework.Common.CommonData;
  11. using MECF.Framework.Common.IOCore;
  12. using VirgoCommon;
  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 object GetData(string key)
  53. {
  54. object result = null;
  55. Invoke(svc => { result = svc.GetData(key); });
  56. return result;
  57. }
  58. public object GetConfig(string key)
  59. {
  60. object result = null;
  61. Invoke(svc => { result = svc.GetConfig(key); });
  62. return result;
  63. }
  64. public string GetConfigFileContent( )
  65. {
  66. string result = null;
  67. Invoke(svc => { result = svc.GetConfigFileContent(); });
  68. return result;
  69. }
  70. public List<EventItem> QueryDBEvent(string sql)
  71. {
  72. List<EventItem> result = null;
  73. Invoke(svc => { result = svc.QueryDBEvent(sql); });
  74. return result;
  75. }
  76. public List<HistoryCarrierData> QueryDBCarrier(string sql)
  77. {
  78. List<HistoryCarrierData> result = null;
  79. Invoke(svc => { result = svc.QueryDBCarrier(sql); });
  80. return result;
  81. }
  82. public List<HistoryProcessData> QueryDBProcess(string sql)
  83. {
  84. List<HistoryProcessData> result = null;
  85. Invoke(svc => { result = svc.QueryDBProcess(sql); });
  86. return result;
  87. }
  88. public List<HistoryWaferData> QueryDBWafer(string sql)
  89. {
  90. List<HistoryWaferData> result = null;
  91. Invoke(svc => { result = svc.QueryDBWafer(sql); });
  92. return result;
  93. }
  94. public List<HistoryMoveData> QueryDBMovement(string sql)
  95. {
  96. List<HistoryMoveData> result = null;
  97. Invoke(svc => { result = svc.QueryDBMovement(sql); });
  98. return result;
  99. }
  100. public List<HistoryJobMoveData> QueryDBJobMovementByJobGuid(string jobGuid)
  101. {
  102. List<HistoryJobMoveData> result = null;
  103. Invoke(svc => { result = svc.QueryDBJobMovementByJobGuid( jobGuid); });
  104. return result;
  105. }
  106. public List<HistoryJobMoveData> QueryDBJobMovementByJobGuidAndStationName(string jobGuid, string stationName)
  107. {
  108. List<HistoryJobMoveData> result = null;
  109. Invoke(svc => { result = svc.QueryDBJobMovementByJobGuidAndStationName( jobGuid, stationName); });
  110. return result;
  111. }
  112. public List<HistoryDataItem> GetOneDayHistoryData(IEnumerable<string> keys, DateTime begin, string module)
  113. {
  114. List<HistoryDataItem> result = null;
  115. Invoke(svc => { result = svc.GetOneDayHistoryData(keys,begin, module); });
  116. return result;
  117. }
  118. public List<HistoryDataItem> GetHistoryDataFromStartToEnd(IEnumerable<string> keys, DateTime begin,DateTime end, string module)
  119. {
  120. List<HistoryDataItem> result = null;
  121. Invoke(svc => { result = svc.GetHistoryDataFromStartToEnd(keys, begin, end,module); });
  122. return result;
  123. }
  124. public DataTable QueryData(string sql)
  125. {
  126. DataTable result = null;
  127. Invoke(svc => { result = svc.QueryData(sql); });
  128. return result;
  129. }
  130. public List<HistoryDataItem> GetHistoryData(IEnumerable<string> keys, string recipeRunGuid, string module)
  131. {
  132. List<HistoryDataItem> result = null;
  133. Invoke(svc => { result = svc.GetHistoryData(keys, recipeRunGuid, module); });
  134. return result;
  135. }
  136. public List<NotifiableIoItem> GetDiList(string key)
  137. {
  138. List<NotifiableIoItem> result = null;
  139. Invoke(svc => { result = svc.GetDiList(key); });
  140. return result;
  141. }
  142. public List<NotifiableIoItem> GetDoList(string key)
  143. {
  144. List<NotifiableIoItem> result = null;
  145. Invoke(svc => { result = svc.GetDoList(key); });
  146. return result;
  147. }
  148. public List<NotifiableIoItem> GetAiList(string key)
  149. {
  150. List<NotifiableIoItem> result = null;
  151. Invoke(svc => { result = svc.GetAiList(key); });
  152. return result;
  153. }
  154. public List<NotifiableIoItem> GetAoList(string key)
  155. {
  156. List<NotifiableIoItem> result = null;
  157. Invoke(svc => { result = svc.GetAoList(key); });
  158. return result;
  159. }
  160. public List<LeakCheckResultItem> GetHistoryLeakCheck(string Module)
  161. {
  162. List<LeakCheckResultItem> result = null;
  163. Invoke(svc =>
  164. {
  165. result = svc.GetHistoryLeakCheck(Module);
  166. });
  167. return result;
  168. }
  169. }
  170. }