123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197 |
- using System;
- using System.Collections.Generic;
- using System.Data;
- using EPInterface.Data;
- using System.ServiceModel;
- using Aitex.Core.Util;
- using Aitex.Core.WCF;
- using EPInterface.Datas;
- using MECF.Framework.Common.Utilities;
- namespace EPInterface
- {
- public class EPDClient : Singleton<EPDClient>
- {
-
- private IEPDService _service;
- public IEPDService Service
- {
- get
- {
- if (_service == null)
- {
-
- _service = new EPDServiceClient();
- }
- return _service;
- }
- }
- }
- public class EPDServiceClient : ServiceClientWrapper<IEPDService>, IEPDService
- {
- public EPDServiceClient()
- : base("Client_IEPDService", "EPDService")
- {
- }
- public void SetModel(int channel,string name, string model)
- {
- Invoke(svc => { svc.SetModel(channel, name, model); });
- }
- public int Heartbeat(int counter)
- {
- int result = 0;
- Invoke(svc => { result = svc.Heartbeat(counter); });
- return result;
- }
- public void Online()
- {
- Invoke(svc => { svc.Online(); });
- }
- public void Offline()
- {
- Invoke(svc => { svc.Offline(); });
- }
- public bool IsOnline()
- {
- bool result = false;
- Invoke(svc => { result = svc.IsOnline(); });
- return result;
- }
- public void SetOption(string name, string value)
- {
- Invoke(svc => { svc.SetOption(name, value); });
- }
- public string GetOption(string name )
- {
- string result = string.Empty;
- Invoke(svc => { result = svc.GetOption(name); });
- return result;
- }
- public void RecipeStart(int channel, string name)
- {
- Invoke(svc => { svc.RecipeStart(channel, name); });
- }
- public void RecipeStop(int channel)
- {
- Invoke(svc => { svc.RecipeStop(channel); });
- }
- public void Start(int channel,int idx, string name, string model)
- {
- Invoke(svc => { svc.Start(channel, idx, name, model); });
- }
- public void StartByConfig(int channel, int idx, string name, EPDConfig config)
- {
- Invoke(svc => { svc.StartByConfig(channel, idx, name, config); });
- }
- public void Stop(int channel)
- {
- Invoke(svc => { svc.Stop(channel); });
- }
- public void Pause(int channel)
- {
- Invoke(svc => { svc.Pause(channel); });
- }
- public void Resume(int channel)
- {
- Invoke(svc => { svc.Resume(channel); });
- }
- public int QueryChannels()
- {
- int result = 0;
- Invoke(svc => { result = svc.QueryChannels(); });
- return result;
- }
- public List<string> QueryChannelNames()
- {
- List<string> result = new List<string>();
- Invoke(svc => { result = svc.QueryChannelNames(); });
- return result;
- }
- public string QueryChannelName(int channel)
- {
- string result = "";
- Invoke(svc => { result = svc.QueryChannelName(channel); });
- return result;
- }
- public Tuple<string,string> QueryModel(int channel)
- {
- Tuple<string, string> result = null;
- Invoke(svc => { result = svc.QueryModel(channel); });
- return result;
- }
- public double[] QueryWave(int channel)
- {
- double[] result = null;
- Invoke(svc => { result = svc.QueryWave(channel); });
- return result;
- }
- public CRawDataItem QueryData(int channel)
- {
- CRawDataItem result = default(CRawDataItem) ;
- Invoke(svc => { result = svc.QueryData(channel); });
- return result;
- }
- public EPDState QueryState(int channel)
- {
- EPDState result = EPDState.UnSampling;
- Invoke(svc => { result = svc.QueryState(channel); });
- return result;
- }
- public bool QueryRecordState(int channel)
- {
- bool result = false;
- Invoke(svc => { result = svc.QueryRecordState(channel); });
- return result;
- }
- public long QueryRecipeTime(int channel)
- {
- long result = 0;
- Invoke(svc => { result = svc.QueryRecipeTime(channel); });
- return result;
- }
- public List<long> QueryStepTime(int channel)
- {
- List<long> result = new List<long>();
- Invoke(svc => { result = svc.QueryStepTime(channel); });
- return result;
- }
- public List<string> QueryConfigList()
- {
- List<string> result = new List<string>();
- Invoke(svc => { result = svc.QueryConfigList(); });
- return result;
- }
- public string QueryConfig(string name)
- {
- string result = string.Empty;
- Invoke(svc => { result = svc.QueryConfig(name); });
- return result;
- }
- }
- }
|