patrick
2019-10-19 809abe2aac4617cc838d36fec913f5268a066eb4
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
using A032.Process.Calibration;
using Bro.Common.Base;
using Bro.Common.Helper;
using Bro.Common.Interface;
using Bro.Common.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace A032.Process
{
    public partial class ProcessControl
    {
        [ProcessMethod("CalibrationCollection", "RobotCalibration", "机器人9点标定", true)]
        public ProcessResponse RobotCalibration(IOperationConfig config)
        {
            return new ProcessResponse(true);
        }
 
        [ProcessMethod("CalibrationCollection", "StandardPointCalibration", "标准点位标定", true)]
        public ProcessResponse StandardPointCalibration(IOperationConfig config)
        {
            return new ProcessResponse(true);
        }
 
        public void SendCalibrationStartSignal(int stepNum)
        {
 
        }
 
        private int MultipleStepsCalibration(CalibrationConfigCollection configs, Action<List<CalibrationConfig>> FinalCalculation)
        {
            throw new NotImplementedException();
 
            //configs.Configs.ForEach(c =>
            //{
            //    c.Image = null;
            //});
 
            //if (string.IsNullOrWhiteSpace(configs.CameraId) || !CameraDict.ContainsKey(configs.CameraId))
            //{
            //    throw new ProcessException("标定配置未配置正确的相机编号");
            //}
 
            //if (string.IsNullOrWhiteSpace(configs.PositionCode))
            //{
            //    throw new ProcessException("标定配置未指定路径位置");
            //}
 
            //CameraBase camera = CameraDict[configs.CameraId];
            //FrmCalib9PDynamic frm9PDynamic = new FrmCalib9PDynamic(this, camera, configs, FinalCalculation);
            //frm9PDynamic.ShowDialog();
 
            //if (configs.InputPara == null || configs.InputPara.Count <= 0)
            //{
            //    return (int)PLCReplyValue.NG;
            //}
 
            //if (configs.InputPara[0] <= 0 || configs.InputPara[0] > configs.Configs.Count)
            //{
            //    configs.InputPara = null;
            //    return (int)PLCReplyValue.IGNORE;
            //}
 
            //int sequence = configs.InputPara[0];
 
            ////第一次
            //if (sequence == 1)
            //{
            //    configs.Configs.ForEach(c =>
            //    {
            //        c.Image = null;
            //        c.OfflineImagePath = "";
            //        c.CurrentPlatPoint = new CustomizedPoint();
            //        c.ImageMarkPoint = new CustomizedPoint();
            //    });
            //}
 
            //CalibrationConfig stepConfig = configs.Configs[sequence - 1];
 
            //HDevEngineTool tool = _halconToolDict[]
 
            //CalibMarkPoint(camera, stepConfig, sequence);
 
            ////获取当前平台点位
            //stepConfig.CurrentPlatPoint = new CustomizedPoint(_monitorList.Skip(locationStartIndex).Take(4).ToList());
            ////stepConfig.CurrentPlatPoint = new CustomizedPoint(configs.InputPara.Skip(1).Take(4).ToList());
 
            ////最后一次
            //if (sequence == configs.Configs.Count)
            //{
            //    FinalCalculation?.Invoke(configs.Configs);
            //}
 
            //configs.InputPara = null;
            //return (int)PLCReplyValue.OK;
        }
    }
}