using FLY.Integrated.Common; using FLY.Integrated.IService; using FLY.Integrated.OBJ_INTERFACE; using FLY.Integrated.Server.Model; using FLY.OBJComponents.Client; using FLY.OBJComponents.IService; using FObjBase; using Newtonsoft.Json; using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq; using System.Text; using System.Threading.Tasks; namespace FLY.Integrated.Client { public class IntegratedSystemServiceClient : FObjServiceClient, IIntegratedSystemService { //public BufferServiceClient CtrlList; #region IIntegratedSystemService /// /// 数据 /// public IbcData Ibc { get; } = new IbcData(); /// /// 收卷 /// public WinderAccessory Accessory { get; } = new WinderAccessory(); SyncPropServiceClient syncPropServiceClient; /// /// PLC代理系统 /// public IPLCProxySystemService PLCos { get; private set; } #endregion /// /// 当前 INotifyPropertyChanged 对象 引发了 PropertyChanged, 是由于 接收到数据导致的 /// public bool IsInPushValue { get { return syncPropServiceClient.IsInPushValue; } } public IntegratedSystemServiceClient(UInt32 serviceId) : base(serviceId) { syncPropServiceClient = new SyncPropServiceClient( mServerID + 1, new Dictionary { {"Ibc", Ibc }, {"Accessory", Accessory }, }); PLCos = new PLCProxySystemServiceClient( mServerID + 2, new Dictionary { {"Ibc", Ibc }, {"Accessory", Accessory } }); //CtrlList = new BufferServiceClient(OBJ_INTERFACE.OBJ_INTERFACE.IBC_OBJ_CTRLLIST_ID); } public IntegratedSystemServiceClient(UInt32 serviceId, string connName) : this(serviceId) { ConnName = connName; FObjServiceClientManager.Instance.Connect_to_Another_OBJSys(connName, this); } public override UInt32[] GetIDs() { List IDs = new List(); IDs.Add(ID); IDs.Add(syncPropServiceClient.ID); IDs.AddRange(((PLCProxySystemServiceClient)PLCos).GetIDs()); //IDs.Add(CtrlList.ID); return IDs.ToArray(); } public override void ConnectNotify(IFConn from) { base.ConnectNotify(from); if (from.IsConnected) { CurrObjSys.SenseConfigEx(mConn, mServerID, ID, 0xffffffff, SENSE_CONFIG.ADD); } } } }