using System; using System.Collections.Generic; using System.Data; using System.ServiceModel; using Aitex.Core.RT.ConfigCenter; using Aitex.Core.RT.DataCenter; using Aitex.Core.RT.Event; using Aitex.Core.RT.IOCore; using Aitex.Core.RT.SCCore; using Aitex.Core.UI.ControlDataContext; using Aitex.Sorter.Common; using Aitex.Sorter.RT.Module.DBRecorder; using MECF.Framework.Common.CommonData; using MECF.Framework.Common.ControlDataContext; using MECF.Framework.Common.DBCore; using MECF.Framework.Common.IOCore; using MECF.Framework.Common.SubstrateTrackings; using CyberX8_Core; using VenusCommon; using MECF.Framework.Common.SCCore; namespace MECF.Framework.Common.DataCenter { [ServiceBehavior(InstanceContextMode = InstanceContextMode.Single, ConcurrencyMode = ConcurrencyMode.Multiple)] public class QueryDataService : IQueryDataService { public Dictionary PollData(IEnumerable keys) { return DATA.PollData(keys); } public string GetConfigFileContent() { return SC.GetConfigFileContent(); } public Dictionary PollConfig(IEnumerable keys) { return CONFIG.PollConfig(keys); } public object GetData(string key) { return DATA.Poll(key); } public object GetConfig(string key) { return CONFIG.Poll(key); } public List GetDiList(string key) { var ret = IO.GetDiList(key); List result = new List(); ret.ForEach(x=> result.Add(new NotifiableIoItem() { Address = x.Addr, Name = x.Name, Description = x.Description, Index = x.Index, BoolValue = x.Value, Provider = x.Provider, BlockOffset = x.BlockOffset, BlockIndex = x.Index, })); return result; } public List GetDoList(string key) { var ret = IO.GetDoList(key); List result = new List(); ret.ForEach(x => result.Add(new NotifiableIoItem() { Address = x.Addr, Name = x.Name, Description = x.Description, Index = x.Index, BoolValue = x.Value, Provider = x.Provider, BlockOffset = x.BlockOffset, BlockIndex = x.Index, })); return result; } public List GetAiList(string key) { var ret = IO.GetAiList(key); List result = new List(); ret.ForEach(x => result.Add(new NotifiableIoItem() { Address = x.Addr, Name = x.Name, Description = x.Description, Index = x.Index, ShortValue = x.Value, Provider = x.Provider, BlockOffset = x.BlockOffset, BlockIndex = x.Index, })); return result; } public List GetAoList(string key) { var ret = IO.GetAoList(key); List result = new List(); ret.ForEach(x => result.Add(new NotifiableIoItem() { Address = x.Addr, Name = x.Name, Description = x.Description, Index = x.Index, ShortValue = x.Value, Provider = x.Provider, BlockOffset = x.BlockOffset, BlockIndex = x.Index, })); return result; } public List QueryDBEvent(string sql) { return EV.QueryDBEvent(sql); } public List QueryDBCarrier(string sql) { return CarrierDataRecorder.QueryDBCarrier(sql); } public List QueryDBProcess(string sql) { return ProcessDataRecorder.QueryDBProcess(sql); } public List QueryDBWafer(string sql) { return WaferDataRecorder.QueryDBWafer(sql); } public List QueryDBMovement(string sql) { return WaferMoveHistoryRecorder.QueryDBMovement(sql); } public List QueryDBJobMovementByJobGuid(string jobGuid) { return JobMoveHistoryRecorder.QueryJobMovement(jobGuid); } public List QueryDBJobMovementByJobGuidAndStationName(string jobGuid, string stationName) { return JobMoveHistoryRecorder.QueryJobMovement(jobGuid,stationName); } public List GetHistoryData(IEnumerable keys, string recipeRunGuid, string module) { return ProcessDataRecorder.GetHistoryData(keys, recipeRunGuid, module); } public List GetOneDayHistoryData(IEnumerable keys, DateTime begin, string module) { return ProcessDataRecorder.GetOneDayHistoryData(keys, begin, module); } public List GetHistoryDataFromStartToEnd(IEnumerable keys, DateTime begin, DateTime end, string module) { return ProcessDataRecorder.GetHistoryDataFromStartToEnd(keys, begin, end,module); } public DataTable QueryData(string sql) { return DataQuery.Query(sql); } public List GetHistoryLeakCheck(string Module) { return LeakCheckResultManager.Instance.GetHistoryLeakCheck(Module); } public List GetPMLeakCheckResult(string moduleName) { return LeakCheckDataRecorder.GetAllLeakCheckData(moduleName); } public List GetMFCVerificationData(DateTime begin, DateTime end) { return MFCVerificationDataRecorder.GetMFCVerificationData(begin, end); } public List GetMFCVerificationOnePointData() { return MFCVerificationDataRecorder.GetMFCVerificationOnePointData(); } public List GetMFCVerificationTenPointsData() { return MFCVerificationDataRecorder.GetMFCVerificationTenPointsData(); } public List GetHistorySteps(DateTime begin, DateTime end) { return ProcessDataRecorder.GetHistoryStepList(begin,end); } public List QueryOffsetDataByTime(string moduleName, DateTime from_time, DateTime to_time) { return OffsetDataRecorder.QueryOffsetDataByTime(moduleName, from_time, to_time); } public string GetTypedConfigContent(string type, string contentPath) { return TypedConfigManager.Instance.GetTypedConfigContent(type, contentPath); } public void SetTypedConfigContent(string type, string contentPath, string content) { TypedConfigManager.Instance.SetTypedConfigContent(type, contentPath, content); } public List QueryAllUsers() { return UserDataRecorder.GetUserItems(); } public void InserUser(UserItem userItem) { UserDataRecorder.InserUser(userItem); } public void DeleteUser(string userName) { UserDataRecorder.DeleteUser(userName); } public void EditUser(UserItem userItem) { UserDataRecorder.EditUser(userItem); } } }