|
|
@@ -24,6 +24,7 @@ using TeamAAS_VP.Core.PLCs;
|
|
|
using TeamAAS_VP.Enums;
|
|
|
using TeamAAS_VP.Interfaces;
|
|
|
using TeamAAS_VP.Models;
|
|
|
+using TeamAAS_VP.Models.Calibration;
|
|
|
using TeamAAS_VP.Resources.Languages;
|
|
|
using TeamAAS_VP.Services;
|
|
|
using static TeamAAS_VP.Core.StabilityAnalyzer;
|
|
|
@@ -1200,11 +1201,11 @@ namespace TeamAAS_VP.ViewModels.Product
|
|
|
//}
|
|
|
|
|
|
////获取机器人当前坐标系
|
|
|
- //RPoint rPoint = Robot.GetRobotPos();
|
|
|
- //double[] point = new double[3];
|
|
|
- //point[0] = rPoint.X;
|
|
|
- //point[1] = rPoint.Y;
|
|
|
- //point[2] = rPoint.U;
|
|
|
+ RPoint rPoint = Robot.GetRobotPos();
|
|
|
+ double[] point = new double[3];
|
|
|
+ point[0] = rPoint.X;
|
|
|
+ point[1] = rPoint.Y;
|
|
|
+ point[2] = rPoint.U;
|
|
|
//if (calib.CameraMount == CameraMount.FixedUp || calib.CameraMount == CameraMount.FixedDown)
|
|
|
//{
|
|
|
// point = null;
|
|
|
@@ -1219,9 +1220,17 @@ namespace TeamAAS_VP.ViewModels.Product
|
|
|
//eturn (true, _pixel_x, _pixel_y, _pixel_u, calibResult.X, calibResult.Y); ;
|
|
|
if (!outputCollection.Contains("dis1"))
|
|
|
{
|
|
|
+ CalibrationInfo calibration = new CalibrationInfo();
|
|
|
string[] Point1 = ((string)(outputCollection["Point"].Value)).Split(',');
|
|
|
- var calibration = _calibrationService.GetCalibration(SelectProcedure.CalibrationId);
|
|
|
- (bool IsSucceed, double X, double Y, double U) = _calibrationService.ConvertPixelToPosition((double.Parse(Point1[0]), double.Parse(Point1[1]), double.Parse(Point1[2])), null, calibration);
|
|
|
+ try
|
|
|
+ {
|
|
|
+ calibration = _calibrationService.GetCalibration(SelectProcedure.CalibrationId);
|
|
|
+ }
|
|
|
+ catch (Exception)
|
|
|
+ {
|
|
|
+ SendTaskMessage("坐标转换失败!");
|
|
|
+ }
|
|
|
+ (bool IsSucceed, double X, double Y, double U) = _calibrationService.ConvertPixelToPosition((double.Parse(Point1[0]), double.Parse(Point1[1]), double.Parse(Point1[2])), point, calibration);
|
|
|
if (!IsSucceed)
|
|
|
{
|
|
|
SendTaskMessage("坐标转换失败!");
|