QueryDataService.cs 5.7 KB

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