QueryDataService.cs 6.9 KB

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