|
|
@@ -1060,7 +1060,7 @@ namespace TeamAAS_VP.Core
|
|
|
{
|
|
|
return;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
var addressConfig = _configService.GetPlcAddresses();
|
|
|
var plc = _plcService.GetPlcByNumber(addressConfig.PlcNo) as OpcUaClientPLC;
|
|
|
if (plc == null || !plc.IsConnected) return;
|
|
|
@@ -1186,7 +1186,7 @@ namespace TeamAAS_VP.Core
|
|
|
{
|
|
|
await plc.WriteNodeAsync(addressConfig.Out_DownCameraStatus.Address, (Int16)2);
|
|
|
return;
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
|
|
|
}
|
|
|
@@ -1484,7 +1484,7 @@ namespace TeamAAS_VP.Core
|
|
|
}
|
|
|
var currentPosition = robot.GetRobotPos();
|
|
|
|
|
|
-
|
|
|
+
|
|
|
//如果上相机2的流程id为空,则表示只有一个上相机
|
|
|
if (currentProduct.MoveDownCamera2LockPhotoProcedureId == Guid.Empty)
|
|
|
{
|
|
|
@@ -1549,7 +1549,7 @@ namespace TeamAAS_VP.Core
|
|
|
float centerX = (float)(visionResults[0].X + visionResults[1].X) / 2;
|
|
|
float centerY = (float)(visionResults[0].Y + visionResults[1].Y) / 2;
|
|
|
_MoveCameraAngle = Common.CalculateAngleBetweenPointsDegrees(new PointF((float)visionResults[0].X, (float)visionResults[0].Y), new PointF((float)visionResults[1].X, (float)visionResults[1].Y));
|
|
|
- UpCameraPutResults[cameraIndex] = new OpenCvSharp.Point3f(centerX, centerY,(float)_MoveCameraAngle);
|
|
|
+ UpCameraPutResults[cameraIndex] = new OpenCvSharp.Point3f(centerX, centerY, (float)_MoveCameraAngle);
|
|
|
await plc.WriteNodeAsync(addressConfig.Out_UpCameraPutStatus.Address, (Int16)1);
|
|
|
return;
|
|
|
}
|
|
|
@@ -1751,17 +1751,17 @@ namespace TeamAAS_VP.Core
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- double upCameraX=0, upCameraY=0,upCameraU=0;
|
|
|
+ double upCameraX = 0, upCameraY = 0, upCameraU = 0;
|
|
|
upCameraX = UpCameraPutResults[1].X;
|
|
|
- upCameraY= UpCameraPutResults[1].Y;
|
|
|
- upCameraU= UpCameraPutResults[1].Z;
|
|
|
+ upCameraY = UpCameraPutResults[1].Y;
|
|
|
+ upCameraU = UpCameraPutResults[1].Z;
|
|
|
//如果下相机拍照的次数是1,则判断用时拍照的相机是几个
|
|
|
int upCameraNum = _configService.GetSystemConfiguration().UpCameraPutNum;
|
|
|
if (upCameraNum == 2)
|
|
|
{
|
|
|
- upCameraX = (UpCameraPutResults[1].X+ UpCameraPutResults[2].X) / 2;
|
|
|
- upCameraY= (UpCameraPutResults[1].Y + UpCameraPutResults[2].Y) / 2;
|
|
|
- upCameraU= Common.CalculateAngleBetweenPointsDegrees(new PointF((float)UpCameraPutResults[1].X, (float)UpCameraPutResults[1].Y), new PointF((float)UpCameraPutResults[2].X, (float)UpCameraPutResults[2].Y));
|
|
|
+ upCameraX = (UpCameraPutResults[1].X + UpCameraPutResults[2].X) / 2;
|
|
|
+ upCameraY = (UpCameraPutResults[1].Y + UpCameraPutResults[2].Y) / 2;
|
|
|
+ upCameraU = Common.CalculateAngleBetweenPointsDegrees(new PointF((float)UpCameraPutResults[1].X, (float)UpCameraPutResults[1].Y), new PointF((float)UpCameraPutResults[2].X, (float)UpCameraPutResults[2].Y));
|
|
|
}
|
|
|
|
|
|
var point = currentProduct.ScrewPoints[0].Clone();
|
|
|
@@ -1841,6 +1841,7 @@ namespace TeamAAS_VP.Core
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ }
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
SendTaskMessage(ex.Message, MessageLevel.Error);
|