QueryDataService.cs 5.7 KB

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