schangxiang@126.com
2025-11-04 f5ed29dc26c7cd952d56ec5721a2efc43cd25992
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
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
using DataEntity.Sockets.TakePhoto;
using HxModel.Sockets.HxHotel;
using HxSocket;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Data;
using System.Xml;
using XCommon.Log;
using XCoreBLL.Resource;
using XImagingXhandler.XDAL;
 
namespace XCore
{
    public class TakePhotoBll
    {
        public HxSocketClient socketTcpListener = null;
        public BacteriaBll bacteriaBll = new BacteriaBll();
        private const string EQUIPMENT_ID = "ID2023";
 
        string strCurrentCulture = "";
        public TakePhotoBll()
        {
            strCurrentCulture = System.Threading.Thread.CurrentThread.CurrentCulture.Name;
        }
 
        #region 检查所有属性设置是否满足要求
        /// <summary>
        /// 检查所有属性设置是否满足要求
        /// </summary>
        /// <param name="methodTakePhoto">拍照属性对象</param>
        /// <returns>检查所有属性设置是否满足要求</returns>
        public MethodPropertyInfo CheckProperty(MethodTakePhoto methodTakePhoto)
        {
            MethodPropertyInfo methodPropertyInfo = new MethodPropertyInfo();
 
            if (strCurrentCulture == "zh-CN")
            {
                methodPropertyInfo.property_tips_info = TakePhotoResourceCHS.tipsInfo.ToString();
 
                if (methodTakePhoto.ismanualconfig == 1)
                {
                    if (methodTakePhoto.bacteriaids == null || methodTakePhoto.bacteriaids == "")
                    {
                        methodPropertyInfo.property_name_info = TakePhotoResourceCHS.bacteriaids.ToString();
                    }
 
                    if (methodTakePhoto.gapValue == null || methodTakePhoto.gapValue == "")
                    {
                        methodPropertyInfo.property_name_info = TakePhotoResourceCHS.gapValue.ToString();
                    }
 
                }
            }
            else if (strCurrentCulture == "en-US")
            {
                methodPropertyInfo.property_tips_info = TakePhotoResourceENU.tipsInfo.ToString();
 
                if (methodTakePhoto.ismanualconfig == 1)
                {
                    if (methodTakePhoto.bacteriaids == null || methodTakePhoto.bacteriaids == "")
                    {
                        methodPropertyInfo.property_name_info = TakePhotoResourceENU.bacteriaids.ToString();
                    }
 
                    if (methodTakePhoto.gapValue == null || methodTakePhoto.gapValue == "")
                    {
                        methodPropertyInfo.property_name_info = TakePhotoResourceENU.gapValue.ToString();
                    }
 
                }
            }
            return methodPropertyInfo;
        }
        #endregion
 
        #region 执行拍照,返回结果字符串
        /// <summary>
        /// 执行拍照,返回结果字符串
        /// </summary>
        /// <param name="xmlNode">拍照节点</param>
        /// <param name="dtChoiceParams">拍照参数</param>
        /// <param name="softwareDeviceNumber"></param>
        /// <param name="bacteriaInfo"></param>
        /// <param name="isSimulator"></param>
        /// <returns>结果实体对象</returns>
        public List<string> ExecuteTakePhoto(XmlNode xmlNode, DataTable dtChoiceParams, string softwareDeviceNumber,
            Bacteria bacteriaInfo, bool isSimulator = false)
        {
            //调用Socket,下发拍照参数命令
            List<string> strResult = new List<string>();
            LoggerHelper.InfoLog("[TakePhotoBll][ExecuteTakePhoto] Start");
 
            if (!isSimulator)
            {
                // 发送拍照请求
                strResult = socketTcpListener.SendMessage(GenerateTakePhotoReq(xmlNode, dtChoiceParams, softwareDeviceNumber, bacteriaInfo), true);
            }
            else
            {
                strResult.Add("{  \"message_id\": \"02bb3628-0a29-48d7-8614-3412f4258797\",  \"message_type\": 4,  \"method\": \"Run\",  \"equipment_id\": \"ID2023\",  \"workflow_id\": \"\",  \"experiment_id\": \"60b75190-b9ef-4936-935c-f8d824d0b166\",  \"process_info\": {},  \"timestamp\": \"2023-09-25T13:52:27.8776083+08:00\"}#!HxSEP!#\r\n");
                strResult.Add("{  \"message_id\": \"02bb3628-0a29-48d7-8614-3412f4258797\",  \"message_type\": 5,  \"method\": \"Run\",  \"equipment_id\": \"ID2023\",  \"workflow_id\": \"\",  \"experiment_id\": \"60b75190-b9ef-4936-935c-f8d824d0b166\",  \"data\": {    \"json\": \"http://192.168.0.238:8099/upload/20230926_143909_238_000005_38_GUID_YS12.json\",    \"image\": \"http://192.168.0.238:8099/upload/20230926_143909_238_000005_38_GUID_YS12.jpg\"  },  \"process_info\": {},  \"method_status\": 2,  \"error\": {    \"error_code\": \"\",    \"error_text\": \"\",    \"troubleshoot\": 0  },  \"timestamp\": \"2023-09-25T13:53:12.2100249+08:00\"}#!HxSEP!#\r\n");
            }
            return strResult;
        }
        #endregion
 
        /// <summary>
        /// 获取拍照请求字符串
        /// </summary>
        /// <param name="xmlNode"></param>
        /// <param name="dtChoiceParams"></param>
        /// <param name="softwareDeviceNumber"></param>
        /// <param name="bacteriaInfo"></param>
        /// <returns></returns>
        public string GenerateTakePhotoReq(XmlNode xmlNode, DataTable dtChoiceParams, string softwareDeviceNumber, Bacteria bacteriaInfo)
        {
            string strCommand = string.Empty;
            try
            {
                if (xmlNode != null && dtChoiceParams != null)
                {
                    string experimentid = dtChoiceParams.Rows[0]["属性值"].ToString();
                    string barcode = dtChoiceParams.Rows[1]["属性值"].ToString();
                    string bacterias = dtChoiceParams.Rows[2]["属性值"].ToString();
                    string shape = dtChoiceParams.Rows[3]["属性值"].ToString();
                    string edge = dtChoiceParams.Rows[4]["属性值"].ToString();
                    string color = dtChoiceParams.Rows[5]["属性值"].ToString();
                    float min_diam = float.Parse(dtChoiceParams.Rows[6]["属性值"].ToString());
                    float max_diam = float.Parse(dtChoiceParams.Rows[7]["属性值"].ToString());
                    float prox = float.Parse(dtChoiceParams.Rows[8]["属性值"].ToString());
                    string choicemode = dtChoiceParams.Rows[9]["属性值"].ToString();
                    string choice_distance_mode = dtChoiceParams.Rows[10]["属性值"].ToString();
                    string choicebottomdistance = dtChoiceParams.Rows[11]["属性值"].ToString();
                    string choicexAxisoffsite = dtChoiceParams.Rows[12]["属性值"].ToString();
                    string choiceyAxisoffsite = dtChoiceParams.Rows[13]["属性值"].ToString();
                    string coatingbottomdistance = dtChoiceParams.Rows[14]["属性值"].ToString();
                    string coatingxAxisoffsite = dtChoiceParams.Rows[15]["属性值"].ToString();
                    string coatingyAxisoffsite = dtChoiceParams.Rows[16]["属性值"].ToString();
                    string coating_mode = dtChoiceParams.Rows[17]["属性值"].ToString();
                    string coating_speed = dtChoiceParams.Rows[18]["属性值"].ToString();
                    int model_type = Convert.ToInt32(dtChoiceParams.Rows[19]["属性值"].ToString());
                    string merge_masks = dtChoiceParams.Rows[20]["属性值"].ToString();
                    float ds_ratio = float.Parse(dtChoiceParams.Rows[21]["属性值"].ToString());
                    float mean_diam = float.Parse(dtChoiceParams.Rows[22]["属性值"].ToString());
                    float dist_to_edge = float.Parse(dtChoiceParams.Rows[23]["属性值"].ToString());
                    string mark_color = dtChoiceParams.Rows[24]["属性值"].ToString();
                    string draw_label = dtChoiceParams.Rows[25]["属性值"].ToString();
                    string fontsize = dtChoiceParams.Rows[26]["属性值"].ToString();
                    string top_light = dtChoiceParams.Rows[27]["属性值"].ToString();
                    string bottom_light = dtChoiceParams.Rows[28]["属性值"].ToString();
                    int Ismanualconfig = Convert.ToInt32(xmlNode.SelectSingleNode("ismanualconfig").InnerText);
                    string strBacteriaids = xmlNode.SelectSingleNode("bacteriaids").InnerText;      // 挑菌的种类
                    string strGuid = Guid.NewGuid().ToString();
 
                    if (Ismanualconfig == 1)//手动配置,从数据库中读取本次拍照已选中菌落的数据信息
                    {
                        string[] bacteria = strBacteriaids.Split(',');
                        if (bacteria.Length > 1) //多个菌落 TODO暂未实现
                        {
                            #region Del
                            //string strJson = "";
                            //string strSubJson = "";
 
                            //for (int i = 0; i < bacteria.Length; i++)
                            //{
                            //    Bacteria bacteria1 = bacteriaBll.GetABacteria(bacteria[i]);
                            //    strSubJson += "{" + "orgType:\"" + bacteria1.bacteria_name +
                            //                           "\",mindiameterSize:" + bacteria1.bacteria_min_size.ToString() +
                            //                           ",maxdiameterSize:" + bacteria1.bacteria_max_size.ToString() +
                            //                           ",proximity:" + prox.ToString() +
                            //                           ",shape:\"" + bacteria1.bacteria_shape.ToString() +
                            //                           "\",edge:\"" + bacteria1.bacteria_edge.ToString() +
                            //                           "\",color:\"" + bacteria1.bacteria_color.ToString() +
                            //                     "\"}";
                            //}
 
                            //strJson = "{" + "message_id:\"" + strGuid +
                            //                "\",message_type:2" +
                            //                ",method:\"Run\"" +
                            //                ",equipment_id:\"ID2023\"" +
                            //              ",\"workflow_id\":\"" + "workflow_id_" + strGuid + "\"" +
                            //                ",\"experiment_id\":\"" + "experiment_id_" + strGuid + "\"" +
                            //                "\",parameters:" +
                            //                     strSubJson +
                            //                ",process_info:{}" +
                            //                ",estimate_time:5" +
                            //                ",timeout:60" +
                            //                ",description:\"NO DESC\"" +
                            //                ",timestamp:\"" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "\"}#!HxSEP!#";
                            //strCommand = strJson;
                            #endregion
                        }
                        else if (bacteria.Length == 1)//单个菌落
                        {
                            string strBottomLight = string.Empty;
 
                            #region Del
                            //string strJson = "{" + "\"message_id\":\"" + strGuid +
                            //                "\",\"message_type\":2" +
                            //                ",\"method\":\"Run\"" +
                            //                ",\"equipment_id\":\"ID2023\"" +
                            //                ",\"workflow_id\":\"" + "workflow_id_" + strGuid + "\"" +
                            //                ",\"experiment_id\":\"" + "experiment_id_" + strGuid + "\"" +
 
                            //                ",\"parameters\":" +
                            //                     "{" +
                            //                     "\"model\":{" + "\"model_type\":" + model_type.ToString() +
                            //                     "}," +
                            //                     "\"params\":{" + 
                            //                            "\"merge_masks\":\"" + merge_masks.ToString()+ "\"" +
                            //                           ",\"ds_ratio\":" + ds_ratio.ToString() +
                            //                           ",\"mean_diam\":" + mean_diam.ToString() +
                            //                           //",prox:" + dtChoiceParams.Rows[8]["属性值"].ToString() +        // 临近度
                            //                           ",\"prox\":" + prox +        // 临近度
                            //                           ",\"max_diam\":" + max_diam.ToString() +
                            //                           ",\"min_diam\":" + min_diam.ToString() +
                            //                           ",\"dist_to_edge\":" + dist_to_edge.ToString() +
                            //                           ",\"segments\":" + 1 +
                            //                           ",\"barcode\":\"" + barcode + "\"" +
                            //                     "}," +
                            //                     "\"filter\":{" + "\"check_prox\":\"" + "True" +
                            //                           "\",\"check_diam_range\":\"" + "True" +
                            //                           "\",\"check_roundness\":\"" + (model_type.Equals("7") ? "False" : "True") +
                            //                           "\",\"check_near_edge\":\"" + "True" +
                            //                     "\"}," +
                            //                     "\"paint\":{" + "\"draw_dish_edge\":\"" + "True" +
                            //                           "\",\"draw_mark\":\"" + "True" +
                            //                           //"\",\"fontsize\":" + fontsize +
                            //                           //",\"mark_color\":\"" + mark_color +
                            //                           //"\",\"draw_label\":\"" + draw_label +
                            //                           "\",\"draw_cell_edge\":\"" + "True" +
                            //                           "\",\"cell_edge_color\":\"" + "(0,255,0)" +
                            //                     "\"}," +
                            //                     "\"optional\":{" + "\"channel_1\" :\"" + "True" +
                            //                     "\"}," +
                            //                     "\"light\":{" +
                            //                     //"\"top_light\":" + top_light +
                            //                     //strBottomLight +
                            //                     "}" +
                            //                     "}" +
                            //                ",\"process_info\":{}" +
                            //                ",\"estimate_time\":5" +
                            //                ",\"timeout\":60" +
                            //                ",\"description\":\"NO DESC\"" +
                            //                ",\"timestamp\":\"" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "\"}";
                            //strCommand = strJson;
                            #endregion
 
                            #region 拍照参数
                            TakePhotoRequestObject req = new TakePhotoRequestObject();
                            req.SetBaseVal(EQUIPMENT_ID, "Run");
 
                            TakePhotoParameter parameters = new TakePhotoParameter();
                            #region Model
                            Model model = new Model();
                            model.model_type = model_type;
                            parameters.model = model;
                            #endregion
 
                            #region Params
                            Params param = new Params();
                            param.merge_masks = merge_masks;
                            param.ds_ratio = ds_ratio;
                            param.mean_diam = mean_diam;
                            param.prox = prox;
                            param.max_diam = max_diam;
                            param.min_diam = min_diam;
                            param.dist_to_edge = dist_to_edge;
                            //param.segments = 1;
                            param.barcode = barcode;
                            parameters.param = param;
                            #endregion
 
                            #region filter
                            //Filter filter = new Filter();
                            //filter.check_prox = "True";
                            //filter.check_diam_range = "True";
                            //filter.check_roundness = (model_type.Equals("7") ? "False" : "True");
                            //filter.check_near_edge = "True";
                            //parameters.filter = filter;
                            #endregion
 
                            #region paint
                            //Paint paint = new Paint();
                            //paint.draw_dish_edge = "True";
                            //paint.draw_mark = "True";
                            //paint.draw_cell_edge = "True";
                            //paint.cell_edge_color = "(0,255,0)";
                            //parameters.paint = paint;
                            #endregion
 
                            #region optional
                            Optional optional = new Optional();
                            optional.channel_1 = bacteriaInfo.chanel1_color;
                            optional.channel_2 = bacteriaInfo.chanel2_color;
                            parameters.optional = optional;
                            #endregion
 
                            #region light
                            Light light = new Light();
                            parameters.light = light;
                            #endregion
 
                            req.parameters = parameters;
                            #endregion
 
                            strCommand = JsonConvert.SerializeObject(req);
                        }
                    }
                    else if (Ismanualconfig == 2) //自动配置,从固定目录的文件中读取数据
                    {
                        string strJson = "";
                        //if (dtChoiceParams != null)
                        {
                            strJson = "{" + "message_id:\"" + Guid.NewGuid().ToString() +
                                            "\",message_type:2" +
                                            ",method:\"Run\"" +
                                            ",equipment_id:\"ID2023\"" +
                                            ",workflow_id:\"\"" +
                                            ",experiment_id:\"" + experimentid +
                                            "\",parameters:" +
                                                 "{" +
                                                 "model:{" + "model_type:" + model_type +
                                                       ",model_name:\"" + "YS12" +
                                                       "\",flow_threshold:" + "0.4" +
                                                       ",batch_size:" + "16" +
                                                       ",min_size:" + "1" +
                                                       ",merge_masks:\"" + merge_masks +
                                                 "\"}," +
                                                 "params:{" + "ds_ratio:" + ds_ratio +
                                                       ",mean_diam:" + mean_diam +
                                                       ",prox:" + prox +
                                                       ",max_diam:" + max_diam +
                                                       ",min_diam:" + min_diam +
                                                       ",dist_to_edge:" + dist_to_edge +
                                                       ",barcode:\"" + barcode +
                                                 "\"}," +
                                                 "filter:{" + "check_prox:\"" + "True" +
                                                       "\",check_diam_range:\"" + "True" +
                                                       "\",check_roundness:\"" + (model_type.Equals("7") ? "False" : "True") +
                                                       "\",check_near_edge:\"" + "True" +
                                                 "\"}," +
                                                 "paint:{" + "draw_dish_edge:\"" + "True" +
                                                       "\",draw_mark:\"" + "True" +
                                                       //"\",fontsize:" + fontsize +
                                                       //",mark_color:\"" + mark_color +
                                                       //"\",draw_label:\"" + draw_label +
                                                       "\",draw_cell_edge:\"" + "True" +
                                                       "\",cell_edge_color:\"" + "(0,255,0)" +
                                                 "\"}," +
                                                 //"optional:{" + "save_last_setting :\"" + "True" +
                                                 //"\"}," +
                                                 "light:{" +
                                                 //"top_light:" + top_light +
                                                 //      ",bottom_light:" + bottom_light +
                                                 "}" +
                                                 "}" +
                                            ",process_info:{}" +
                                            ",estimate_time:5" +
                                            ",timeout:60" +
                                            ",description:\"NO DESC\"" +
                                            ",timestamp:\"" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "\"}";
                        }
                        strCommand = strJson;
                    }
 
                }
            }
            catch (Exception ex)
            {
                LoggerHelper.ErrorLog("ERROR:", ex);
            }
            return strCommand;
        }
 
        #region 从命令文件的xml节点构建拍照命令属性集合对象
        /// <summary>
        /// 从命令文件的xml节点构建拍照命令属性集合对象
        /// </summary>
        /// <param name="xmlNode">拍照xml节点</param>
        /// <returns>拍照命令属性集合对象</returns>
        public MethodTakePhoto GenerateMethodTakePhotoDataByXmlNode(XmlNode xmlNode)
        {
            MethodTakePhoto methodTakePhoto = new MethodTakePhoto();
 
            methodTakePhoto.isrun = xmlNode.SelectSingleNode("isrun").InnerText;
            methodTakePhoto.status = xmlNode.SelectSingleNode("status").InnerText;
            methodTakePhoto.name = xmlNode.SelectSingleNode("name").InnerText;
            methodTakePhoto.label = xmlNode.SelectSingleNode("label").InnerText;
            methodTakePhoto.strIndex = xmlNode.SelectSingleNode("strIndex").InnerText;
            methodTakePhoto.ismanualconfig = Convert.ToInt32(xmlNode.SelectSingleNode("ismanualconfig").InnerText);
            methodTakePhoto.bacteriaids = xmlNode.SelectSingleNode("bacteriaids").InnerText;
            methodTakePhoto.gapValue = xmlNode.SelectSingleNode("gapValue").InnerText;
            methodTakePhoto.colorText = xmlNode.SelectSingleNode("bacteriacolor/text").InnerText;
            methodTakePhoto.colorValue = xmlNode.SelectSingleNode("bacteriacolor/value").InnerText;
            methodTakePhoto.identification = Convert.ToInt32(xmlNode.SelectSingleNode("identification").InnerText);
            methodTakePhoto.choiceTimes = Convert.ToInt32(xmlNode.SelectSingleNode("choiceTimes").InnerText);
            //methodTakePhoto.barcode = xmlNode.SelectSingleNode("barcode").InnerText;
            if (xmlNode.SelectSingleNode("labware/text") != null)
            {
                methodTakePhoto.coatingLabwareText = xmlNode.SelectSingleNode("labware/text").InnerText;
                methodTakePhoto.coatingLabwareValue = xmlNode.SelectSingleNode("labware/value").InnerText;
            }
 
            return methodTakePhoto;
        }
        /// <summary>
        /// 从命令文件的xml节点构建拍照电泳命令属性集合对象
        /// </summary>
        /// <param name="xmlNode">拍照xml节点</param>
        /// <returns>拍照命令属性集合对象</returns>
        public MethodTakePhotoForElectro GenerateMethodTakePhotoForElectroDataByXmlNode(XmlNode xmlNode)
        {
            MethodTakePhotoForElectro methodTakePhotoForElectro = new MethodTakePhotoForElectro();
 
            methodTakePhotoForElectro.isrun = xmlNode.SelectSingleNode("isrun").InnerText;
            methodTakePhotoForElectro.status = xmlNode.SelectSingleNode("status").InnerText;
            methodTakePhotoForElectro.name = xmlNode.SelectSingleNode("name").InnerText;
            methodTakePhotoForElectro.label = xmlNode.SelectSingleNode("label").InnerText;
            methodTakePhotoForElectro.strIndex = xmlNode.SelectSingleNode("strIndex").InnerText;
            methodTakePhotoForElectro.identification = Convert.ToInt32(xmlNode.SelectSingleNode("identification").InnerText);
            if (xmlNode.SelectSingleNode("labware/text") != null)
            {
                methodTakePhotoForElectro.gumLabwareText = xmlNode.SelectSingleNode("labware/text").InnerText;
                methodTakePhotoForElectro.gumLabwareValue = xmlNode.SelectSingleNode("labware/value").InnerText;
            }
 
            return methodTakePhotoForElectro;
        }
        #endregion
 
        #region 检查成像点位是否已有板
        /// <summary>
        /// 检查成像点位是否已有板
        /// </summary>
        /// <returns></returns>
        public bool DoCheckSafe()
        {
            LoggerHelper.InfoLog("[TakePhotoBll][DoCheckSafe] Start");
            bool bIsError = false;
 
            try
            {
                // 发送请求
                List<string> strResult = socketTcpListener.SendMessage(GetCheckSafeReq());
                string rtnData = socketTcpListener.CheckData(strResult);
                if (string.IsNullOrEmpty(rtnData))
                {
                    bIsError = false;
                }
                else
                {
                    CheckSafeResponseObject rtData = JsonConvert.DeserializeObject<CheckSafeResponseObject>(rtnData);
                    bIsError = CheckSafeResponseData.SAFE.Equals(rtData.data.result) ? false : true;
                }
            }
            catch (Exception ex)
            {
                LoggerHelper.ErrorLog("ERROR:", ex);
            }
            finally
            {
                LoggerHelper.InfoLog("[TakePhotoBll][DoCheckSafe] End");
            }
            return bIsError;
        }
 
        /// <summary>
        /// 获取检查成像点位是否已有板的请求
        /// </summary>
        /// <returns></returns>
        private string GetCheckSafeReq()
        {
            CheckSafeRequestObject req = new CheckSafeRequestObject();
            req.SetBaseVal(EQUIPMENT_ID, "CheckSafe");
 
            return JsonConvert.SerializeObject(req);
        }
        #endregion
    }
}