2
schangxiang@126.com
2024-06-29 2b6ed5c90044f5e7e18087530e871faeb6e445ee
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
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
using Microsoft.SqlServer.Server;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace iWare_SCADA_Model
{
    [NotMapped]
    public class WorkPieceLogMiddle : WorkPieceLog
    {
        /// <summary>
        /// OP80获取QC数据标记,0表示待获取,1表示获取成功,2表示获取失败 【Editby shaocx,2024-06-15】
        /// </summary>
        public int? GetQcDataFlag { get; set; }
 
        #region SPC,NOOK 推出多件 OP20,OP50,OP60
        public string WorkPieceIDA { get; set; }
        public string WorkPieceIDB { get; set; }
        public string WorkPieceIDC { get; set; }
        public string WorkPieceIDD { get; set; }
        #endregion
 
        #region 设备信息
        /// <summary>
        /// 设备模式0.5 =true时自动, false时手动
        /// </summary>
        public bool EquipmentMode { get; set; }
        /// <summary>
        /// 1.1=true 下料到=道满料
        /// </summary>
        public bool FullMaterial { get; set; }
        /// <summary>
        /// 1.0=true   上料道缺料
        /// </summary>
        public bool LackMaterial { get; set; }
        /// <summary>
        /// 是否正常生产
        /// 运行中:0.4=true     ps:加上不缺料 算运行中
        ///空闲:0.4=true ps:加上缺料就是空闲
        /// </summary>
        public bool IsNormalProduction { get; set; }
        public bool MachineOn { get; set; }
        public bool MachineOff { get; set; }
 
        /// <summary>
        /// 刀具是否告警
        /// </summary>
        public bool IsToolChange { get; set; }
        #endregion
 
        #region 设备告警(一二类告警)
        /// <summary>
        /// 关机
        /// </summary>
        public bool IsShutDown { get; set; }
        /// <summary>
        /// 开机
        /// </summary>
        public bool IsPowerOn { get; set; }
        /// <summary>
        /// 告警是否关闭
        /// </summary>
        public bool IsCloseAlert { get; set; }
        /// <summary>
        /// 告警状态是否变更过
        /// </summary>
        public bool ischeckAlertStatus { get; set; }
        public long FailureType1 { get; set; }
        public long FailureType2 { get; set; }
        public long FailureType3 { get; set; }
        public long FailureType4 { get; set; }
        public long FailureType5 { get; set; }
        public long FailureType6 { get; set; }
        public long FailureType7 { get; set; }
        public long FailureType8 { get; set; }
        public long FailureType9 { get; set; }
        public long FailureType10 { get; set; }
        public long FailureType11 { get; set; }
        public long FailureType12 { get; set; }
        public long FailureType13 { get; set; }
        public long FailureType14 { get; set; }
        public long FailureType15 { get; set; }
        public long FailureType16 { get; set; }
        public long FailureType17 { get; set; }
        public long FailureType18 { get; set; }
        public long FailureType19 { get; set; }
        public long FailureType20 { get; set; }
        #endregion
 
        #region 设备message(一般是三类告警,但不影响设备运行)
 
        /// <summary>
        /// 是否存在message
        /// </summary>
        public bool IsMessage { get; set; }
        /// <summary>
        /// message是否变更过
        /// </summary>
        public bool ischeckMessageStatus { get; set; }
        public long FailureMessage1 { get; set; }
        public long FailureMessage2 { get; set; }
        public long FailureMessage3 { get; set; }
        public long FailureMessage4 { get; set; }
        public long FailureMessage5 { get; set; }
        public long FailureMessage6 { get; set; }
        public long FailureMessage7 { get; set; }
        public long FailureMessage8 { get; set; }
        public long FailureMessage9 { get; set; }
        public long FailureMessage10 { get; set; }
        public long FailureMessage11 { get; set; }
        public long FailureMessage12 { get; set; }
        public long FailureMessage13 { get; set; }
        public long FailureMessage14 { get; set; }
        public long FailureMessage15 { get; set; }
        public long FailureMessage16 { get; set; }
        public long FailureMessage17 { get; set; }
        public long FailureMessage18 { get; set; }
        public long FailureMessage19 { get; set; }
        public long FailureMessage20 { get; set; }
        #endregion
 
        #region OP80
        public string OP80NewCode { get; set; }
        /// <summary>
        /// 测量合格状态
        /// </summary>
        public bool St3_Means_OK { get; set; }
        /// <summary>
        /// 称重状态
        /// </summary>
        public bool St4_Weight_OK { get; set; }
        /// <summary>
        /// 打标合格状态
        /// </summary>
        public bool St5_Mark_OK { get; set; }
        /// <summary>
        /// 打标识别合格状态
        /// </summary>
        public bool ST6_Camera_OK { get; set; }
 
        public string OP80QualityFilePath { get; set; }
        public string OP60QualityFilePath { get; set; }
        public string OP20QualityFilePath { get; set; }
        #endregion
 
        #region OP30
 
        public string OP30QualityStateCH3 { get; set; }
        public string OP30QualityStateCH4 { get; set; }
        public string OP30QualityStateCH5 { get; set; }
        public string OP30QualityStateCH6 { get; set; }
 
        public DateTime? OP30QualityReceiveTimeCH3 { get; set; }
        public DateTime? OP30QualityReceiveTimeCH4 { get; set; }
        public DateTime? OP30QualityReceiveTimeCH5 { get; set; }
        public DateTime? OP30QualityReceiveTimeCH6 { get; set; }
 
 
        public string OP30QualityFilePathCH3 { get; set; }
        public string OP30QualityFilePathCH4 { get; set; }
        public string OP30QualityFilePathCH5 { get; set; }
        public string OP30QualityFilePathCH6 { get; set; }
        #endregion
 
        #region op35
        public bool OP35OK { get; set; }
        public bool OP35NOOK { get; set; }
        #endregion
 
        #region OP60哪个工位标记(A、B、C、D)【Editby shaocx,2024-06-07】
 
        /// <summary>
        /// OP60哪个工位标记(A、B、C、D)
        /// </summary>
        public bool Op60_Place_Flag { get; set; }
 
        #endregion
 
        public bool IsConnect { get; set; }
        /// <summary>
        /// PLC传值是string型的
        /// </summary>
        public string QualityStateStr { get; set; }
        public string QualityType { get; set; }
        public string QualityStateUpdateMode { get; set; }
 
        public string QualityStateUpdateUser { get; set; }
 
        public Dictionary<string, string> GetWorkPieceInfoDict()
        {
            Dictionary<string, string> dict = new Dictionary<string, string>();
            dict.Add("WorkPieceID", "WorkPieceID");
            return dict;
 
        }
        /// <summary>
        /// OP10/OP40 推出原因(1:nok,2和3:spc,4:状态不明)
        /// </summary>
        public string OP10Flag { get; set; }
        public DateTime AlertTime { get; set; }
 
 
        public string QualityOP10To1 { get; set; }
        public string QualityOP40To1 { get; set; }
 
 
        public string QualityOP20To1 { get; set; }
 
 
        public string QualityOP30To1 { get; set; }
 
 
        public string QualityOP30To2 { get; set; }
 
 
        public string QualityOP30To3 { get; set; }
 
 
        public string QualityOP30To4 { get; set; }
 
 
        public string QualityOP30To5 { get; set; }
 
 
        public string QualityOP30To6 { get; set; }
 
 
        public string QualityOP30To7 { get; set; }
        public string QualityOP30To8 { get; set; }
        public string QualityOP30To9 { get; set; }
        public string QualityOP30To10 { get; set; }
        public string QualityOP30To11 { get; set; }
 
 
        public string QualityOP35To1 { get; set; }
 
 
        public string QualityOP35To2 { get; set; }
 
        /// <summary>
        /// 大头孔直径
        /// </summary>
        public string QualityOP60To1 { get; set; }
 
        /// <summary>
        /// 小头孔直径
        /// </summary>
        public string QualityOP60To2 { get; set; }
 
 
        public string QualityOP70To1 { get; set; }
 
 
        public string QualityOP70To2 { get; set; }
 
 
        public string QualityOP70To3 { get; set; }
 
        /// <summary>
        /// 大头重量
        /// </summary>
        public string QualityOP80To1 { get; set; }
 
        /// <summary>
        /// 小头重量
        /// </summary>
        public string QualityOP80To2 { get; set; }
 
        /// <summary>
        /// 总重
        /// </summary>
        public string QualityOP80To3 { get; set; }
 
        /// <summary>
        /// 弯曲
        /// </summary>
        public string QualityOP80To4 { get; set; }
 
        /// <summary>
        /// 扭度
        /// </summary>
        public string QualityOP80To5 { get; set; }
 
        /// <summary>
        /// 大头垂直度
        /// </summary>
        public string QualityOP80To6 { get; set; }
 
 
        public string QualityOP80To7 { get; set; }
 
 
        public string QualityOP80To8 { get; set; }
 
 
        public string QualityOP80To9 { get; set; }
        /// <summary>
        /// 小头垂直度
        /// </summary>
        public string QualityOP80To10 { get; set; }
 
 
        #region 新增OP80的一些质量数据 【Editby shaocx,2024-06-13】
 
        /// <summary>
        /// OP80 质量数据-厚度
        /// </summary>
        public string QualityOP80_Houdu { get; set; }
 
        /// <summary>
        /// OP80 质量数据-中心距
        /// </summary>
        public string QualityOP80_ZXJ { get; set; }
 
        /// <summary>
        /// OP80 质量数据-大头孔圆柱度
        /// </summary>
        public string QualityOP80_DTKYZD { get; set; }
 
        /// <summary>
        /// OP80 质量数据-小头上面圆度
        /// </summary>
        public string QualityOP80_XTSMYD { get; set; }
 
        /// <summary>
        /// OP80 质量数据-小头下面圆度
        /// </summary>
        public string QualityOP80_XTXMYD { get; set; }
 
 
        #region 大头孔直径
 
        /// <summary>
        /// OP80 质量数据-大头孔直径,大头孔直径=(大头上面X方向直径+大头上面Y方向直径+大头下面X方向直径+大头下面Y方向直径)/4
        /// </summary>
        public string QualityOP80_D_TKZJ { get; set; }
 
        /// <summary>
        /// OP80 质量数据-大头上面X方向直径
        /// </summary>
        public string QualityOP80_D_S_X { get; set; }
 
        /// <summary>
        /// OP80 质量数据-大头上面Y方向直径
        /// </summary>
        public string QualityOP80_D_S_Y { get; set; }
 
        /// <summary>
        /// OP80 质量数据-大头下面X方向直径
        /// </summary>
        public string QualityOP80_D_X_X { get; set; }
 
        /// <summary>
        /// OP80 质量数据-大头下面Y方向直径
        /// </summary>
        public string QualityOP80_D_X_Y { get; set; }
 
        #endregion
 
        #region 小头孔直径
 
        /// <summary>
        /// OP80 质量数据-小头孔直径,小头孔直径=(小头上面X方向直径+小头上面Y方向直径+小头下面X方向直径+小头下面Y方向直径)/4
        /// </summary>
        public string QualityOP80_X_TKZJ { get; set; }
 
        /// <summary>
        /// OP80 质量数据-小头上面X方向直径
        /// </summary>
        public string QualityOP80_X_S_X { get; set; }
 
        /// <summary>
        /// OP80 质量数据-小头上面Y方向直径
        /// </summary>
        public string QualityOP80_X_S_Y { get; set; }
 
        /// <summary>
        /// OP80 质量数据-小头下面X方向直径
        /// </summary>
        public string QualityOP80_X_X_X { get; set; }
 
        /// <summary>
        /// OP80 质量数据-小头下面Y方向直径
        /// </summary>
        public string QualityOP80_X_X_Y { get; set; }
 
        #endregion
 
        #endregion
 
        public string EquipmentCurrentState { get; set; }
    }
    //[NotMapped]
    //public class QualityDataInfoMiddle : WorkPieceLog
    //{
    //    public Dictionary<string, string> GetWorkPieceInfoDict()
    //    {
    //        Dictionary<string, string> dict = new Dictionary<string, string>();
    //        dict.Add("WorkPieceID", "WorkPieceID");
    //        return dict;
 
    //    }
    //}
    [NotMapped]
    public class OP80Info
    {
        //日期和时间    批号/标识号    嵌套号/主轴号    操作符    文本    测量机    过程参数    测量系统    过程参数值    序列号    零件识别号    1
 
        public string 日期和时间 { get; set; }
        public string 批号 { get; set; }
        public string 嵌套号 { get; set; }
        public string 操作符 { get; set; }
        public string 文本 { get; set; }
        public string 测量机 { get; set; }
        public string 过程参数 { get; set; }
        public string 测量系统 { get; set; }
        public string 过程参数值 { get; set; }
        public string 序列号 { get; set; }
        public string 零件识别号 { get; set; }
        public List<OP80ItemInfo> OP80ItemInfolist = new List<OP80ItemInfo>();
        public List<OP80ItemInfo> OP80ItemStatusInfolist = new List<OP80ItemInfo>();
 
    }
 
    [NotMapped]
    public class OP80ItemInfo
    {
        //名称 相对值 相对值单位 绝对值 绝对值单位 名义值 上限 下限  状态/等级 分隔符
        public string 名称 { get; set; }
        public string 相对值 { get; set; }
        public string 相对值单位 { get; set; }
        public string 绝对值 { get; set; }
        public string 绝对值单位 { get; set; }
        public string 名义值 { get; set; }
        /// <summary>
        /// USL值
        /// </summary>
        public string 上限 { get; set; }
        /// <summary>
        /// LSL值
        /// </summary>
        public string 下限 { get; set; }
        /// <summary>
        /// 状态/等级
        /// </summary>
        public string 状态 { get; set; }
        public string 分隔符 { get; set; }
 
    }
}