QueryDataService.cs 8.0 KB

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