PLCProxySystemServiceClient.cs 1.78 KB
Newer Older
潘栩锋's avatar
潘栩锋 committed
1 2 3 4 5 6 7 8 9 10 11 12
using FLY.OBJComponents.IService;
using FLY.OBJComponents.OBJ_INTERFACE;
using FObjBase;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;

namespace FLY.OBJComponents.Client
{
13
    public class PLCProxySystemServiceClient :  FObjBase.Reflect.Reflect_SeviceClient, IPLCProxySystemService
潘栩锋's avatar
潘栩锋 committed
14
    {
15
        protected override Type InterfaceType => typeof(IPLCProxySystemService);
潘栩锋's avatar
潘栩锋 committed
16 17 18 19 20

        /// <summary>
        /// 与PLC连接成功
        /// </summary>
        public bool IsConnectedWithPLC { get; set; } = false;
21 22
        public PLCProxySystemServiceClient(UInt32 serviceId) : base(serviceId) { }
        public PLCProxySystemServiceClient(UInt32 serviceId, string connName) : base(serviceId, connName) { }
潘栩锋's avatar
潘栩锋 committed
23 24 25 26 27 28 29




        #region IPLCProxySystemService
        public void FeedPlan(long planID)
        {
30
            Call(nameof(FeedPlan), new { planID });
潘栩锋's avatar
潘栩锋 committed
31
        }
32 33
        public void RemovePlan(long planID)
        {
34
            Call(nameof(RemovePlan), new { planID });
35
        }
潘栩锋's avatar
潘栩锋 committed
36 37 38

        public void SetPlan(string objname, IEnumerable<string> propertynames, long planID)
        {
39
            Call(nameof(SetPlan), new { objname, propertynames, planID });
潘栩锋's avatar
潘栩锋 committed
40 41
        }

42 43 44 45 46 47
        /// <summary>
        /// 设置更新计划
        /// </summary>
        /// <param name="objname">对象名</param>
        /// <param name="propertynames">属性名</param>
        /// <param name="planID">计划的编号,应该全局唯一,建议使用时间ticks</param>
48
        public void SetPlan(string objname, IEnumerable<string> propertynames, AsyncCBHandler asyncDelegate, object asyncContext)
49
        {
50
            Call(nameof(SetPlan), new { objname, propertynames}, asyncDelegate, asyncContext);
51
        }
潘栩锋's avatar
潘栩锋 committed
52 53 54
        #endregion
    }
}