QueryDataService.cs 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Data;
  4. using System.ServiceModel;
  5. using Aitex.Core.RT.ConfigCenter;
  6. using Aitex.Core.RT.DataCenter;
  7. using Aitex.Core.RT.DBCore;
  8. using Aitex.Core.RT.Event;
  9. using Aitex.Core.RT.IOCore;
  10. using Aitex.Core.RT.SCCore;
  11. using Aitex.Core.UI.ControlDataContext;
  12. using Aitex.Sorter.Common;
  13. using Aitex.Sorter.RT.Module.DBRecorder;
  14. using MECF.Framework.Common.CommonData;
  15. using MECF.Framework.Common.ControlDataContext;
  16. using MECF.Framework.Common.DBCore;
  17. using MECF.Framework.Common.IOCore;
  18. using Venus_Core;
  19. using VenusCommon;
  20. namespace MECF.Framework.Common.DataCenter
  21. {
  22. [ServiceBehavior(InstanceContextMode = InstanceContextMode.Single, ConcurrencyMode = ConcurrencyMode.Multiple)]
  23. public class QueryDataService : IQueryDataService
  24. {
  25. public Dictionary<string, object> PollData(IEnumerable<string> keys)
  26. {
  27. return DATA.PollData(keys);
  28. }
  29. public string GetConfigFileContent()
  30. {
  31. return SC.GetConfigFileContent();
  32. }
  33. public Dictionary<string, object> PollConfig(IEnumerable<string> keys)
  34. {
  35. return CONFIG.PollConfig(keys);
  36. }
  37. public object GetData(string key)
  38. {
  39. return DATA.Poll(key);
  40. }
  41. public object GetConfig(string key)
  42. {
  43. return CONFIG.Poll(key);
  44. }
  45. public List<NotifiableIoItem> GetDiList(string key)
  46. {
  47. var ret = IO.GetDiList(key);
  48. List<NotifiableIoItem> result = new List<NotifiableIoItem>();
  49. ret.ForEach(x=> result.Add(new NotifiableIoItem()
  50. {
  51. Address = x.Addr,
  52. Name = x.Name,
  53. Description = x.Description,
  54. Index = x.Index,
  55. BoolValue = x.Value,
  56. Provider = x.Provider,
  57. BlockOffset = x.BlockOffset,
  58. BlockIndex = x.Index,
  59. }));
  60. return result;
  61. }
  62. public List<NotifiableIoItem> GetDoList(string key)
  63. {
  64. var ret = IO.GetDoList(key);
  65. List<NotifiableIoItem> result = new List<NotifiableIoItem>();
  66. ret.ForEach(x => result.Add(new NotifiableIoItem()
  67. {
  68. Address = x.Addr,
  69. Name = x.Name,
  70. Description = x.Description,
  71. Index = x.Index,
  72. BoolValue = x.Value,
  73. Provider = x.Provider,
  74. BlockOffset = x.BlockOffset,
  75. BlockIndex = x.Index,
  76. }));
  77. return result;
  78. }
  79. public List<NotifiableIoItem> GetAiList(string key)
  80. {
  81. var ret = IO.GetAiList(key);
  82. List<NotifiableIoItem> result = new List<NotifiableIoItem>();
  83. ret.ForEach(x => result.Add(new NotifiableIoItem()
  84. {
  85. Address = x.Addr,
  86. Name = x.Name,
  87. Description = x.Description,
  88. Index = x.Index,
  89. ShortValue = x.Value,
  90. Provider = x.Provider,
  91. BlockOffset = x.BlockOffset,
  92. BlockIndex = x.Index,
  93. }));
  94. return result;
  95. }
  96. public List<NotifiableIoItem> GetAoList(string key)
  97. {
  98. var ret = IO.GetAoList(key);
  99. List<NotifiableIoItem> result = new List<NotifiableIoItem>();
  100. ret.ForEach(x => result.Add(new NotifiableIoItem()
  101. {
  102. Address = x.Addr,
  103. Name = x.Name,
  104. Description = x.Description,
  105. Index = x.Index,
  106. ShortValue = x.Value,
  107. Provider = x.Provider,
  108. BlockOffset = x.BlockOffset,
  109. BlockIndex = x.Index,
  110. }));
  111. return result;
  112. }
  113. public List<EventItem> QueryDBEvent(string sql)
  114. {
  115. return EV.QueryDBEvent(sql);
  116. }
  117. public List<HistoryCarrierData> QueryDBCarrier(string sql)
  118. {
  119. return CarrierDataRecorder.QueryDBCarrier(sql);
  120. }
  121. public List<HistoryProcessData> QueryDBProcess(string sql)
  122. {
  123. return ProcessDataRecorder.QueryDBProcess(sql);
  124. }
  125. public List<HistoryWaferData> QueryDBWafer(string sql)
  126. {
  127. return WaferDataRecorder.QueryDBWafer(sql);
  128. }
  129. public List<HistoryMoveData> QueryDBMovement(string sql)
  130. {
  131. return WaferMoveHistoryRecorder.QueryDBMovement(sql);
  132. }
  133. public List<HistoryJobMoveData> QueryDBJobMovementByJobGuid(string jobGuid)
  134. {
  135. return JobMoveHistoryRecorder.QueryJobMovement(jobGuid);
  136. }
  137. public List<HistoryJobMoveData> QueryDBJobMovementByJobGuidAndStationName(string jobGuid, string stationName)
  138. {
  139. return JobMoveHistoryRecorder.QueryJobMovement(jobGuid,stationName);
  140. }
  141. public List<HistoryDataItem> GetHistoryData(IEnumerable<string> keys, string recipeRunGuid, string module)
  142. {
  143. return ProcessDataRecorder.GetHistoryData(keys, recipeRunGuid, module);
  144. }
  145. public List<HistoryDataItem> GetOneDayHistoryData(IEnumerable<string> keys, DateTime begin, string module)
  146. {
  147. return ProcessDataRecorder.GetOneDayHistoryData(keys, begin, module);
  148. }
  149. public List<HistoryDataItem> GetHistoryDataFromStartToEnd(IEnumerable<string> keys, DateTime begin, DateTime end, string module)
  150. {
  151. return ProcessDataRecorder.GetHistoryDataFromStartToEnd(keys, begin, end,module);
  152. }
  153. public DataTable QueryData(string sql)
  154. {
  155. return DataQuery.Query(sql);
  156. }
  157. public List<LeakCheckResultItem> GetHistoryLeakCheck(string Module)
  158. {
  159. return LeakCheckResultManager.Instance.GetHistoryLeakCheck(Module);
  160. }
  161. public List<PMLeakCheckResult> GetPMLeakCheckResult(string moduleName)
  162. {
  163. return LeakCheckDataRecorder.GetAllLeakCheckData(moduleName);
  164. }
  165. public List<MFCVerificationData> GetMFCVerificationData(DateTime begin, DateTime end)
  166. {
  167. return MFCVerificationDataRecorder.GetMFCVerificationData(begin, end);
  168. }
  169. public List<MFCVerificationOnePointData> GetMFCVerificationOnePointData()
  170. {
  171. return MFCVerificationDataRecorder.GetMFCVerificationOnePointData();
  172. }
  173. public List<MFCVerificationTenPointsData> GetMFCVerificationTenPointsData()
  174. {
  175. return MFCVerificationDataRecorder.GetMFCVerificationTenPointsData();
  176. }
  177. public List<HistoryStepItem> GetHistorySteps(DateTime begin, DateTime end)
  178. {
  179. return ProcessDataRecorder.GetHistoryStepList(begin,end);
  180. }
  181. public List<OffsetItem> QueryOffsetDataByTime(string moduleName, DateTime from_time, DateTime to_time)
  182. {
  183. return OffsetDataRecorder.QueryOffsetDataByTime(moduleName, from_time, to_time);
  184. }
  185. public int GetDBEventAllCount(string sql)
  186. {
  187. return EventDBWriter.QueryDBEventCount(sql);
  188. }
  189. }
  190. }