1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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
107
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
140
141
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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
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
224
225
226
227
228
229
230
231
232
233
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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FLY.Thick.Base.Common;
using System.ComponentModel;
using Newtonsoft.Json;
using PropertyChanged;
using FObjBase;
using FObjBase.Reflect;
namespace FLY.Thick.Base.IService
{
/// <summary>
///
/// </summary>
public interface IGetSampleService:INotifyPropertyChanged
{
/// <summary>
/// 参数:使能
/// </summary>
bool Enable { get; set; }
/// <summary>
/// 参数:速度
/// </summary>
UInt32 Velocity { get; }
/// <summary>
/// 参数:样品点范围 单位:脉冲
/// 样品点直径为 Range*2
/// </summary>
int SampleRange { get; set; }
/// <summary>
/// 参数:移动滤波 ,窗口值 单位:min
/// </summary>
int Window { get; set; }
/// <summary>
/// 使用%方式检查异常
/// 1.滤波前AD 与 滤波后AD比较
/// 2.当前样品AD 与 上一次样品AD比较
/// 3.当前 样品X_AD/样品0_AD 与 上一次比较
/// </summary>
bool IsCheckByPercent { get; set; }
/// <summary>
/// 异常比例 单位不是%
/// </summary>
double ErrPercent { get; set; }
/// <summary>
/// 异常值
/// </summary>
int ErrValue { get; set; }
/// <summary>
/// 当前 样品X_AD/样品0_AD 与 上一次比较 差异比例 单位不是%
/// </summary>
double CrossErrPercent { get; set; }
/// <summary>
/// 参数:样品点参数
/// </summary>
[PropertyPush]
SampleCell[] Samples { get; }
/// <summary>
/// 参数:特征查找范围 单位:脉冲
/// 取样范围 会扩大为 -SearchRange ~ +SearchRange
/// </summary>
int SearchRange { get; set; }
/// <summary>
/// 参数:特征参数 0:正方向, 1:反方向
/// </summary>
[PropertyPush]
SampleFeature[] Features { get; }
/// <summary>
/// 应用
/// </summary>
void Apply();
[Call(typeof(List<List<TempFilterData>>))]
void GetTempFilterDatas(AsyncCBHandler asyncDelegate, object asyncContext);
}
/// <summary>
/// 采样记录
/// </summary>
public class TempFilterData
{
/// <summary>
/// 采集时间
/// </summary>
public DateTime Time { get; set; }
/// <summary>
/// Ad值
/// </summary>
public int Ad { get; set; }
/// <summary>
/// 滤波后的AD值
/// </summary>
public int FilterAd { get; set; }
/// <summary>
/// 复位
/// </summary>
public bool IsReset { get; set; }
}
/// <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
}
/// <summary>
/// 样品点
/// </summary>
public class SampleCell: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; }
/// <summary>
/// 状态:当前测量的AD值
/// </summary>
public int AD { get; set; }
/// <summary>
/// 状态:当前测量的AD值 对应的 样品值
/// </summary>
public double SampleValue { get; set; }
#region INotifyPropertyChanged 成员
public event PropertyChangedEventHandler PropertyChanged;
#endregion
}
/// <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
}
/// <summary>
/// 样品正向校正特征
/// </summary>
public class SampleFeature :INotifyPropertyChanged
{
/// <summary>
/// 参数:使能
/// </summary>
public bool Enable { get; set; }
/// <summary>
/// 参数:开始位置
/// </summary>
public int StartPos { get; set; }
/// <summary>
/// 参数:结束位置
/// </summary>
public int EndPos { get; set; }
/// <summary>
/// 状态:相似度必须高于0.8,失败-1
/// </summary>
public double MaxRelevancy { get; set; } = -1;
/// <summary>
/// 状态:最大相似度对应的偏移
/// </summary>
public int MaxOffset { get; set; }
#region INotifyPropertyChanged 成员
public event PropertyChangedEventHandler PropertyChanged;
#endregion
}
}