123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234 |
- using Aitex.Core.RT.ConfigCenter;
- 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.DBCore;
- using MECF.Framework.Common.Equipment;
- using MECF.Framework.Common.IOCore;
- using System;
- using System.Collections.Generic;
- using System.Collections.ObjectModel;
- using System.Data;
- using System.Diagnostics;
- using System.Linq;
- using System.ServiceModel;
- using System.Text;
- using System.Threading.Tasks;
- namespace Common.DataCenter
- {
- [ServiceBehavior(InstanceContextMode = InstanceContextMode.Single, ConcurrencyMode = ConcurrencyMode.Multiple)]
- public class QueryDataService : IQueryDataService
- {
- public Dictionary<string, object> PollData(IEnumerable<string> keys)
- {
- return DATA.PollData(keys);
- }
- public string GetConfigFileContent()
- {
- return SC.GetConfigFileContent();
- }
- public Dictionary<string, object> PollConfig(IEnumerable<string> 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<NotifiableIoItem> GetDiList(string key)
- {
- var ret = IO.GetDiList(key);
- List<NotifiableIoItem> result = new List<NotifiableIoItem>();
- 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<NotifiableIoItem> GetDoList(string key)
- {
- var ret = IO.GetDoList(key);
- List<NotifiableIoItem> result = new List<NotifiableIoItem>();
- 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<NotifiableIoItem> GetAiList(string key)
- {
- var ret = IO.GetAiList(key);
- List<NotifiableIoItem> result = new List<NotifiableIoItem>();
- 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<NotifiableIoItem> GetAoList(string key)
- {
- var ret = IO.GetAoList(key);
- List<NotifiableIoItem> result = new List<NotifiableIoItem>();
- 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<EventItem> QueryDBEvent(string sql)
- {
- return EV.QueryDBEvent(sql);
- }
- public List<HistoryCarrierData> QueryDBCarrier(string sql)
- {
- return CarrierDataRecorder.QueryDBCarrier(sql);
- }
- public List<HistoryProcessData> QueryDBProcess(string sql)
- {
- return ProcessDataRecorder.QueryDBProcess(sql);
- }
- public List<HistoryWaferData> QueryDBWafer(string sql)
- {
- return WaferDataRecorder.QueryDBWafer(sql);
- }
- public List<HistoryMoveData> QueryDBMovement(string sql)
- {
- return WaferMoveHistoryRecorder.QueryDBMovement(sql);
- }
- public List<HistoryJobMoveData> QueryDBJobMovementByJobGuid(string jobGuid)
- {
- return JobMoveHistoryRecorder.QueryJobMovement(jobGuid);
- }
- public List<HistoryJobMoveData> QueryDBJobMovementByJobGuidAndStationName(string jobGuid, string stationName)
- {
- return JobMoveHistoryRecorder.QueryJobMovement(jobGuid, stationName);
- }
- public List<HistoryDataItem> GetHistoryData(IEnumerable<string> keys, string recipeRunGuid, string module)
- {
- return ProcessDataRecorder.GetHistoryData(keys, recipeRunGuid, module);
- }
- public List<HistoryDataItem> GetOneDayHistoryData(IEnumerable<string> keys, DateTime begin, string module)
- {
- return ProcessDataRecorder.GetOneDayHistoryData(keys, begin, module);
- }
- public List<HistoryDataItem> GetHistoryDataFromStartToEnd(IEnumerable<string> keys, DateTime begin, DateTime end, string module)
- {
- return ProcessDataRecorder.GetHistoryDataFromStartToEnd(keys, begin, end, module);
- }
- public DataTable QueryData(string sql)
- {
- return DataQuery.Query(sql);
- }
- public object QueryDeviceWafer(string module)
- {
- return DATA.Poll(module + ".WaferInfos");
- }
- public object QueryWafer(string module)
- {
- return DATA.Poll("All" + ".WaferInfos");
- }
- public object QueryRobotWafer(string hand)
- {
- return DATA.Poll($"{ModuleName.Robot}.{hand}.WaferInfos");
- }
- public object QueryDeviceState(string name)
- {
- return DATA.Poll($"{name}.Status");
- }
- public string QueryDevice(string module, string key)
- {
- return DATA.Poll($"{module}.{key}").ToString();
- }
- public object QueryLP(string module, string key)
- {
- return DATA.Poll($"{module}.{key}");
- }
- public ObservableCollection<NotifiableIoItem> GetDIList()
- {
- var result = (ObservableCollection<NotifiableIoItem>)DATA.Poll("DIItemList");
- return result;
- }
- public ObservableCollection<NotifiableIoItem> GetDOList()
- {
- var result = (ObservableCollection<NotifiableIoItem>)DATA.Poll("DOItemList");
- return result;
- }
- public List<string> QueryLog()
- {
- return (List<string>)DATA.Poll("GetLogList");
- }
- }
- }
|