CoatingSegmentServiceClient.cs 9.37 KB
Newer Older
潘栩锋's avatar
潘栩锋 committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using System.ComponentModel;
using System.Collections.ObjectModel;

using FObjBase;
using FLY.Thick.Base.IService;
using FLY.Thick.Base.OBJ_INTERFACE;
using FLY.Thick.Base.Common;

namespace FLY.Thick.Base.Client
{
潘栩锋's avatar
潘栩锋 committed
16 17 18 19
    //public class CoatingSegmentServiceClient : FObj, ICoatingSegmentService
    //{
    //    IFConn mConn;
    //    UInt32 mServerID;
潘栩锋's avatar
潘栩锋 committed
20

潘栩锋's avatar
潘栩锋 committed
21 22 23 24 25 26 27
    //    public CoatingSegmentServiceClient()
    //    {
    //        mServerID = COATINGSEGMENT_OBJ_INTERFACE.ID;
    //        Last.Time = DateTime.Now;
    //        Last.PartCount = 1;
    //        Last.CoatingPart.Add(new CoatingSegmentPart() { Distance = 0, Total = 0 });
    //    }
潘栩锋's avatar
潘栩锋 committed
28

潘栩锋's avatar
潘栩锋 committed
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106
    //    #region ISegmentService
    //    private bool enable = false;
    //    public bool Enable
    //    {
    //        get { return enable; }
    //        set
    //        {
    //            if (enable != value)
    //            {
    //                enable = value;
    //                NotifyPropertyChanged("Enable");
    //            }
    //        }
    //    }
    //    private bool ensave = false;
    //    public bool EnSave
    //    {
    //        get
    //        {
    //            return ensave;
    //        }
    //        set
    //        {
    //            if (ensave != value)
    //            {
    //                ensave = value;
    //                NotifyPropertyChanged("EnSave");
    //            }
    //        }
    //    }
    //    private int savecnt = 500;
    //    public int SaveCnt
    //    {
    //        get
    //        {
    //            return savecnt;
    //        }
    //        set
    //        {
    //            if (savecnt != value)
    //            {
    //                savecnt = value;
    //                NotifyPropertyChanged("SaveCnt");
    //            }
    //        }
    //    }
    //    private int recentCnt = 20;
    //    /// <summary>
    //    /// 列表的行数
    //    /// </summary>
    //    public int RecentCnt
    //    {
    //        get { return recentCnt; }
    //        set
    //        {
    //            if (recentCnt != value)
    //            {
    //                recentCnt = value;
    //                NotifyPropertyChanged("RecentCnt");
    //            }
    //        }
    //    }
    //    private int inidxofvside = 11;
    //    public int InIdxOfVSide
    //    {
    //        get
    //        {
    //            return inidxofvside;
    //        }
    //        set
    //        {
    //            if (inidxofvside != value)
    //            {
    //                inidxofvside = value;
    //                NotifyPropertyChanged("InIdxOfVSide");
    //            }
    //        }
    //    }
潘栩锋's avatar
潘栩锋 committed
107

潘栩锋's avatar
潘栩锋 committed
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139
    //    private double warningtol_total;
    //    public double WarningTol_Total
    //    {
    //        get
    //        {
    //            return warningtol_total;
    //        }
    //        set
    //        {
    //            if (warningtol_total != value)
    //            {
    //                warningtol_total = value;
    //                NotifyPropertyChanged("WarningTol_Total");
    //            }
    //        }
    //    }
    //    private double warningtol_distance;
    //    public double WarningTol_Distance
    //    {
    //        get
    //        {
    //            return warningtol_distance;
    //        }
    //        set
    //        {
    //            if (warningtol_distance != value)
    //            {
    //                warningtol_distance = value;
    //                NotifyPropertyChanged("WarningTol_Distance");
    //            }
    //        }
    //    }
潘栩锋's avatar
潘栩锋 committed
140 141


潘栩锋's avatar
潘栩锋 committed
142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177
    //    ObservableCollection<FlyData_CoatingSegmentHistory> m_coatingPartList = new ObservableCollection<FlyData_CoatingSegmentHistory>();
    //    public ObservableCollection<FlyData_CoatingSegmentHistory> Recent
    //    {
    //        get { return m_coatingPartList; }
    //    }
    //    FlyData_CoatingSegmentHistory last = new FlyData_CoatingSegmentHistory();
    //    public FlyData_CoatingSegmentHistory Last 
    //    {
    //        get {
    //            return last;
    //        }
    //    }
    //    #endregion
    //    #region 工艺
    //    CoatingSegmentProfile profile = new CoatingSegmentProfile();
    //    public CoatingSegmentProfile Profile { get { return profile; } }
    //    #endregion
    //    public void Apply() 
    //    {
    //        COATINGSEGMENT_OBJ_INTERFACE.Pack_Params p = new COATINGSEGMENT_OBJ_INTERFACE.Pack_Params();
    //        p.enable = Enable;
    //        p.enSave = EnSave;
    //        p.saveCnt = SaveCnt;
    //        p.inIdxOfVSide = InIdxOfVSide;
    //        p.warningtol_distance = WarningTol_Distance;
    //        p.warningtol_total = WarningTol_Total;
    //        CurrObjSys.SetValueEx(mConn, mServerID, ID,
    //            COATINGSEGMENT_OBJ_INTERFACE.SET_PARAMS,
    //            p.ToBytes());
    //    }
    //    public void ProfileApply() 
    //    {
    //        CurrObjSys.SetValueEx(mConn, mServerID, ID,
    //            COATINGSEGMENT_OBJ_INTERFACE.SET_PROFILE,
    //            Profile.ToBytes());
    //    }
潘栩锋's avatar
潘栩锋 committed
178 179


潘栩锋's avatar
潘栩锋 committed
180
    //    #region INotifyPropertyChanged 成员
潘栩锋's avatar
潘栩锋 committed
181

潘栩锋's avatar
潘栩锋 committed
182 183 184 185 186 187 188 189 190
    //    public event PropertyChangedEventHandler PropertyChanged;
    //    protected void NotifyPropertyChanged(string propertyname)
    //    {
    //        if (PropertyChanged != null)
    //        {
    //            PropertyChanged.Invoke(this, new PropertyChangedEventArgs(propertyname));
    //        }
    //    }
    //    #endregion
潘栩锋's avatar
潘栩锋 committed
191

潘栩锋's avatar
潘栩锋 committed
192 193 194 195 196 197 198 199 200 201 202 203 204 205
    //    public override void Dispose()
    //    {
    //        CurrObjSys.ObjRemove(
    //            this, mConn);
    //    }
    //    public override void ConnectNotify(IFConn from)
    //    {
    //        mConn = from;
    //        if (from.IsConnected)
    //        {
    //            //获取所有数据,设置推送
    //            CurrObjSys.GetValueEx(
    //                mConn, mServerID, ID,
    //                COATINGSEGMENT_OBJ_INTERFACE.GET_PARAMS);
潘栩锋's avatar
潘栩锋 committed
206

潘栩锋's avatar
潘栩锋 committed
207 208 209
    //            CurrObjSys.GetValueEx(
    //                mConn, mServerID, ID,
    //                COATINGSEGMENT_OBJ_INTERFACE.GET_PROFILE);
潘栩锋's avatar
潘栩锋 committed
210

潘栩锋's avatar
潘栩锋 committed
211 212 213
    //            CurrObjSys.GetValueEx(
    //                mConn, mServerID, ID,
    //                COATINGSEGMENT_OBJ_INTERFACE.GET_LAST);
潘栩锋's avatar
潘栩锋 committed
214

潘栩锋's avatar
潘栩锋 committed
215 216 217
    //            CurrObjSys.CallFunctionEx(
    //                mConn, mServerID, ID,
    //                COATINGSEGMENT_OBJ_INTERFACE.CALL_GETRECENT, null);
潘栩锋's avatar
潘栩锋 committed
218

潘栩锋's avatar
潘栩锋 committed
219 220 221 222 223 224 225 226 227 228 229 230 231 232
    //            CurrObjSys.SenseConfigEx(
    //                mConn, mServerID, ID,
    //                0xffffffff, SENSE_CONFIG.ADD);
    //        }
    //    }
    //    public override void PushGetValue(IFConn from, uint srcid, ushort memid, byte[] infodata)
    //    {
    //        switch (memid)
    //        {
    //            case COATINGSEGMENT_OBJ_INTERFACE.GET_PARAMS:
    //                {
    //                    COATINGSEGMENT_OBJ_INTERFACE.Pack_Params p = new COATINGSEGMENT_OBJ_INTERFACE.Pack_Params();
    //                    if (!p.TryParse(infodata))
    //                        return;
潘栩锋's avatar
潘栩锋 committed
233

潘栩锋's avatar
潘栩锋 committed
234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275
    //                    Enable = p.enable;
    //                    EnSave = p.enSave;
    //                    SaveCnt = p.saveCnt;
    //                    RecentCnt = p.recentCnt;
    //                    InIdxOfVSide = p.inIdxOfVSide;
    //                    WarningTol_Distance = p.warningtol_distance;
    //                    WarningTol_Total = p.warningtol_total;
    //                } break;
    //            case COATINGSEGMENT_OBJ_INTERFACE.GET_PROFILE:
    //                {
    //                    int count;
    //                    if (!Profile.TryParse(infodata, 0, out count))
    //                        return;
    //                } break;
    //            case COATINGSEGMENT_OBJ_INTERFACE.GET_LAST:
    //                {
    //                    int count;
    //                    if (!Last.TryParse(infodata, 0, out count))
    //                        return;
    //                    if (Recent.Count > 0) 
    //                    {
    //                        if (Last.Time > Recent.Last().Time) 
    //                        {
    //                            ToSaveList(Last);
    //                        }
    //                    }
    //                }break;
    //        }
    //    }
    //    public override void PushInfo(IFConn from, uint srcid, ushort infoid, byte[] infodata)
    //    {
    //        PushGetValue(from, srcid, infoid, infodata);
    //    }
    //    public override void CallFunction(IFConn from, uint srcid, uint magic, ushort funcid, byte[] infodata)
    //    {
    //        switch (funcid)
    //        {
    //            case COATINGSEGMENT_OBJ_INTERFACE.CALL_GETRECENT:
    //                {
    //                    COATINGSEGMENT_OBJ_INTERFACE.Pack_Recent r = new COATINGSEGMENT_OBJ_INTERFACE.Pack_Recent();
    //                    if (!r.TryParse(infodata))
    //                        return;
潘栩锋's avatar
潘栩锋 committed
276

潘栩锋's avatar
潘栩锋 committed
277 278 279 280 281 282 283 284 285 286 287 288 289 290
    //                    Recent.Clear();
    //                    for (int i = 0; i < r.data.Count(); i++)
    //                        ToSaveList(r.data[i]);
    //                } break;
    //        }
    //    }
    //    //压入数据列
    //    void ToSaveList(FlyData_CoatingSegmentHistory coatingpart) 
    //    {
    //        Recent.Add(coatingpart);
    //        if (Recent.Count > RecentCnt)
    //            Recent.RemoveAt(0);
    //    }
    //}
潘栩锋's avatar
潘栩锋 committed
291
}