IGetSampleService.cs 6.1 KB
Newer Older
潘栩锋's avatar
潘栩锋 committed
1 2 3 4 5 6
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FLY.Thick.Base.Common;
using System.ComponentModel;
7 8
using Newtonsoft.Json;
using PropertyChanged;
9
using FObjBase;
10
using FObjBase.Reflect;
潘栩锋's avatar
潘栩锋 committed
11 12 13

namespace FLY.Thick.Base.IService
{
潘栩锋's avatar
潘栩锋 committed
14 15 16
    /// <summary>
    /// 
    /// </summary>
潘栩锋's avatar
潘栩锋 committed
17 18 19 20 21 22 23 24 25 26
    public interface IGetSampleService:INotifyPropertyChanged
    {
        /// <summary>
        /// 参数:使能
        /// </summary>
        bool Enable { get; set; }

        /// <summary>
        /// 参数:速度
        /// </summary>
27 28
        UInt32 Velocity { get; }

潘栩锋's avatar
潘栩锋 committed
29 30

        /// <summary>
31 32
        /// 参数:样品点范围 单位:脉冲
        /// 样品点直径为 Range*2
潘栩锋's avatar
潘栩锋 committed
33
        /// </summary>
34
        int SampleRange { get; set; }
潘栩锋's avatar
潘栩锋 committed
35 36

        /// <summary>
37
        /// 参数:移动滤波 ,窗口值 单位:min
潘栩锋's avatar
潘栩锋 committed
38 39 40
        /// </summary>
        int Window { get; set; }

41 42
        /// <summary>
        /// 使用%方式检查异常
43 44 45
        /// 1.滤波前AD 与 滤波后AD比较
        /// 2.当前样品AD 与 上一次样品AD比较
        /// 3.当前 样品X_AD/样品0_AD 与 上一次比较 
46 47
        /// </summary>
        bool IsCheckByPercent { get; set; }
48
        
49
        /// <summary>
50
        /// 异常比例 单位不是%
51 52
        /// </summary>
        double ErrPercent { get; set; }
53

54 55 56 57
        /// <summary>
        /// 异常值
        /// </summary>
        int ErrValue { get; set; }
58

59 60 61 62 63
        /// <summary>
        /// 当前 样品X_AD/样品0_AD 与 上一次比较 差异比例 单位不是%
        /// </summary>
        double CrossErrPercent { get; set; }

潘栩锋's avatar
潘栩锋 committed
64 65 66
        /// <summary>
        /// 参数:样品点参数
        /// </summary>
67
        [PropertyPush]
68
        SampleCell[] Samples { get; }
69

潘栩锋's avatar
潘栩锋 committed
70
        /// <summary>
71 72
        /// 参数:特征查找范围 单位:脉冲
        /// 取样范围 会扩大为 -SearchRange ~ +SearchRange
潘栩锋's avatar
潘栩锋 committed
73
        /// </summary>
74
        int SearchRange { get; set; }
75

潘栩锋's avatar
潘栩锋 committed
76
        /// <summary>
77
        /// 参数:特征参数 0:正方向, 1:反方向
潘栩锋's avatar
潘栩锋 committed
78
        /// </summary>
79
        [PropertyPush]
80
        SampleFeature[] Features { get; }
潘栩锋's avatar
潘栩锋 committed
81 82 83 84 85

        /// <summary>
        /// 应用
        /// </summary>
        void Apply();
86 87 88

        [Call(typeof(List<List<TempFilterData>>))]
        void GetTempFilterDatas(AsyncCBHandler asyncDelegate, object asyncContext);
89
    }
潘栩锋's avatar
潘栩锋 committed
90

91 92


潘栩锋's avatar
潘栩锋 committed
93 94 95
    /// <summary>
    /// 采样记录
    /// </summary>
96 97
    public class TempFilterData
    {
潘栩锋's avatar
潘栩锋 committed
98 99 100
        /// <summary>
        /// 采集时间
        /// </summary>
101
        public DateTime Time { get; set; }
潘栩锋's avatar
潘栩锋 committed
102 103 104
        /// <summary>
        /// Ad值
        /// </summary>
105
        public int Ad { get; set; }
潘栩锋's avatar
潘栩锋 committed
106 107 108
        /// <summary>
        /// 滤波后的AD值
        /// </summary>
109
        public int FilterAd { get; set; }
潘栩锋's avatar
潘栩锋 committed
110 111 112
        /// <summary>
        /// 复位
        /// </summary>
113
        public bool IsReset { get; set; }
潘栩锋's avatar
潘栩锋 committed
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 140 141 142 143 144 145 146 147 148 149

    /// <summary>
    /// 样品点 参数
    /// </summary>
    public class SampleCellParam : INotifyPropertyChanged 
    {
        /// <summary>
        /// 参数:使能
        /// </summary>
        public bool Enable { get; set; }

        /// <summary>
        /// 参数:只检查不标定
        /// </summary>
        public bool JustForCheck { get; set; }

        /// <summary>
        /// 参数:原始AD值
        /// </summary>
        public int OrgAD { get; set; }

        /// <summary>
        /// 参数:位置
        /// </summary>
        public int Position { get; set; }

        #region INotifyPropertyChanged 成员

        public event PropertyChangedEventHandler PropertyChanged;

        #endregion

    }


150 151 152 153
    /// <summary>
    /// 样品点
    /// </summary>
    public class SampleCell:INotifyPropertyChanged
潘栩锋's avatar
潘栩锋 committed
154
    {
155

潘栩锋's avatar
潘栩锋 committed
156 157 158
        /// <summary>
        /// 参数:使能
        /// </summary>
159
        public bool Enable { get; set; }
潘栩锋's avatar
潘栩锋 committed
160 161 162 163

        /// <summary>
        /// 参数:只检查不标定
        /// </summary>
164
        public bool JustForCheck { get; set; }
潘栩锋's avatar
潘栩锋 committed
165 166 167 168

        /// <summary>
        /// 参数:原始AD值
        /// </summary>
169
        public int OrgAD { get; set; }
潘栩锋's avatar
潘栩锋 committed
170 171

        /// <summary>
172
        /// 参数:位置
潘栩锋's avatar
潘栩锋 committed
173
        /// </summary>
174
        public int Position { get; set; }
潘栩锋's avatar
潘栩锋 committed
175 176 177 178

        /// <summary>
        /// 状态:当前测量的AD值
        /// </summary>
179 180
        public int AD { get; set; }

潘栩锋's avatar
潘栩锋 committed
181 182 183 184

        /// <summary>
        /// 状态:当前测量的AD值 对应的 样品值
        /// </summary>
185
        public double SampleValue { get; set; }
186 187 188 189 190 191 192

        #region INotifyPropertyChanged 成员

        public event PropertyChangedEventHandler PropertyChanged;

        #endregion

潘栩锋's avatar
潘栩锋 committed
193
    }
194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223


    /// <summary>
    /// 样品正向校正特征
    /// </summary>
    public class SampleFeatureParam : INotifyPropertyChanged
    {

        /// <summary>
        /// 参数:使能
        /// </summary>
        public bool Enable { get; set; }

        /// <summary>
        /// 参数:开始位置
        /// </summary>
        public int StartPos { get; set; }

        /// <summary>
        /// 参数:结束位置
        /// </summary>
        public int EndPos { get; set; }


        #region INotifyPropertyChanged 成员

        public event PropertyChangedEventHandler PropertyChanged;

        #endregion
    }
224 225 226 227
    /// <summary>
    /// 样品正向校正特征
    /// </summary>
    public class SampleFeature :INotifyPropertyChanged
潘栩锋's avatar
潘栩锋 committed
228
    {
229

潘栩锋's avatar
潘栩锋 committed
230 231 232
        /// <summary>
        /// 参数:使能
        /// </summary>
233 234 235
        public bool Enable { get; set; }


潘栩锋's avatar
潘栩锋 committed
236 237 238
        /// <summary>
        /// 参数:开始位置
        /// </summary>
239 240 241
        public int StartPos { get; set; }


潘栩锋's avatar
潘栩锋 committed
242 243 244
        /// <summary>
        /// 参数:结束位置
        /// </summary>
245 246
        public int EndPos { get; set; }

潘栩锋's avatar
潘栩锋 committed
247 248

        /// <summary>
249
        /// 状态:相似度必须高于0.8,失败-1
潘栩锋's avatar
潘栩锋 committed
250
        /// </summary>
251
        public double MaxRelevancy { get; set; } = -1;
潘栩锋's avatar
潘栩锋 committed
252 253 254 255

        /// <summary>
        /// 状态:最大相似度对应的偏移
        /// </summary>
256
        public int MaxOffset { get; set; }
潘栩锋's avatar
潘栩锋 committed
257

258 259 260 261 262 263 264

        #region INotifyPropertyChanged 成员

        public event PropertyChangedEventHandler PropertyChanged;


        #endregion
潘栩锋's avatar
潘栩锋 committed
265 266
    }
}