QueryDataService.cs 6.4 KB

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