|
@@ -192,10 +192,17 @@ namespace SCADA_DAQ.Customer.Machines
|
|
|
/// <summary>
|
|
|
/// 吸盘2中心点坐标
|
|
|
/// </summary>
|
|
|
- public Point Cup3Center = new Point((int)CustomerEnv.SortingMacConfigValue.Cup2OriginOffset.X,
|
|
|
+ public Point Cup2Center = new Point((int)CustomerEnv.SortingMacConfigValue.Cup2OriginOffset.X,
|
|
|
(int)CustomerEnv.SortingMacConfigValue.Cup2OriginOffset.Y);
|
|
|
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// 吸盘3中心点坐标
|
|
|
+ /// </summary>
|
|
|
+ public Point Cup3Center = new Point((int)CustomerEnv.SortingMacConfigValue.Cup3OriginOffset.X,
|
|
|
+ (int)CustomerEnv.SortingMacConfigValue.Cup3OriginOffset.Y);
|
|
|
+
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// 旋转1后新坐标
|
|
|
/// </summary>
|
|
@@ -251,15 +258,12 @@ namespace SCADA_DAQ.Customer.Machines
|
|
|
end = true;
|
|
|
if (CurrentCycDoc != null)
|
|
|
{
|
|
|
-
|
|
|
ExistSmallBoard(CurrentCycDoc);
|
|
|
-
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
MessageBox.Show($"参数页面中的'单机运行时cyc文件'为空!");
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -326,26 +330,27 @@ namespace SCADA_DAQ.Customer.Machines
|
|
|
//var Cup3Center = new Point(135, -155);
|
|
|
//修改后
|
|
|
|
|
|
-
|
|
|
if ((CurrentLabel.ActualLength > 550 && CurrentLabel.ActualWidth > 200) ||
|
|
|
- (CurrentLabel.ActualWidth > 550 && CurrentLabel.ActualLength > 200)
|
|
|
- )
|
|
|
+ (CurrentLabel.ActualWidth > 550 && CurrentLabel.ActualLength > 200))
|
|
|
{
|
|
|
BoardInfo.CupIndex = 2;
|
|
|
if (CurrentLabel.ActualWidth > CurrentLabel.ActualLength)
|
|
|
{
|
|
|
BoardInfo.Rotation = -90;
|
|
|
BoardInfo.ReleaseY = CurrentLabel.ActualLength / 2 - 150;
|
|
|
- //releaseY = CurrentLabel.ActualLength / 2 - 140;
|
|
|
|
|
|
- }
|
|
|
+ var cup2NewCenter = new Point(Cup2Center.Y * -1, (double)Cup2Center.X); //旋转后的坐标
|
|
|
+ BoardInfo.CupCenter = new Point(BoardInfo.CupCenter.X - cup2NewCenter.X, BoardInfo.CupCenter.Y - cup2NewCenter.Y);
|
|
|
+ //releaseY = CurrentLabel.ActualLength / 2 - 140;
|
|
|
+ CupNewCenter = cup2NewCenter;
|
|
|
+ }
|
|
|
else
|
|
|
{
|
|
|
BoardInfo.ReleaseY = CurrentLabel.ActualWidth / 2 - 150;
|
|
|
- //BoardInfo.ReleaseY = CurrentLabel.ActualWidth / 2 - 140;
|
|
|
-
|
|
|
+ var cup2NewCenter = new Point(Cup1Center.X, Cup1Center.Y); //旋转后的坐标
|
|
|
+ BoardInfo.CupCenter = new Point(BoardInfo.CupCenter.X - cup2NewCenter.X, BoardInfo.CupCenter.Y - cup2NewCenter.Y);
|
|
|
+ CupNewCenter = cup2NewCenter;
|
|
|
}
|
|
|
- CupNewCenter = new Point(0, 0);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -369,7 +374,6 @@ namespace SCADA_DAQ.Customer.Machines
|
|
|
BoardInfo.CupCenter = new Point(BoardInfo.CupCenter.X - cup1NewCenter.X, BoardInfo.CupCenter.Y - cup1NewCenter.Y);
|
|
|
BoardInfo.ReleaseY = CurrentLabel.ActualWidth / 2 - 30;
|
|
|
CupNewCenter = cup1NewCenter;
|
|
|
- //BoardInfo.ReleaseY = CurrentLabel.ActualWidth / 2 - 170;
|
|
|
}
|
|
|
}
|
|
|
else
|
|
@@ -377,18 +381,12 @@ namespace SCADA_DAQ.Customer.Machines
|
|
|
BoardInfo.Rotation = 90;
|
|
|
var cup1NewCenter = new Point(Cup1Center.Y, -1 * (double)Cup1Center.X); //旋转后的坐标
|
|
|
CupNewCenter = cup1NewCenter;
|
|
|
- //cup3NewCenter.Offset(100, 32.5); //补偿夹具尺寸
|
|
|
BoardInfo.CupCenter = new Point(BoardInfo.CupCenter.X - cup1NewCenter.X, BoardInfo.CupCenter.Y - cup1NewCenter.Y);
|
|
|
- //BoardInfo.ReleaseY = CurrentLabel.ActualWidth / 2;
|
|
|
BoardInfo.ReleaseY = CurrentLabel.ActualLength / 2 - 180;
|
|
|
- //BoardInfo.ReleaseY = CurrentLabel.ActualWidth / 2 - 20;
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
else if (BoardInfo.CupIndex == 3)
|
|
|
{
|
|
|
-
|
|
|
if (CenterX <= 600)
|
|
|
{
|
|
|
if (CurrentLabel.ActualLength < CurrentLabel.ActualWidth)
|
|
@@ -397,14 +395,10 @@ namespace SCADA_DAQ.Customer.Machines
|
|
|
var cup3NewCenter = new Point(Cup3Center.Y * -1, (double)Cup3Center.X); //旋转后的坐标
|
|
|
BoardInfo.CupCenter = new Point(BoardInfo.CupCenter.X - cup3NewCenter.X, BoardInfo.CupCenter.Y - cup3NewCenter.Y);
|
|
|
CupNewCenter = cup3NewCenter;
|
|
|
-
|
|
|
}
|
|
|
//BoardInfo.ReleaseY = CurrentLabel.ActualWidth / 2;
|
|
|
BoardInfo.ReleaseY = CurrentLabel.ActualLength / 2 - 180;
|
|
|
-
|
|
|
//BoardInfo.ReleaseY = CurrentLabel.ActualWidth / 2 - 20;
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -413,9 +407,7 @@ namespace SCADA_DAQ.Customer.Machines
|
|
|
//BoardInfo.ReleaseY = CurrentLabel.ActualWidth / 2 + 500;
|
|
|
BoardInfo.ReleaseY = CurrentLabel.ActualWidth / 2 - 180;
|
|
|
CupNewCenter = cup3NewCenter;
|
|
|
-
|
|
|
//BoardInfo.ReleaseY = CurrentLabel.ActualWidth / 2 - 20;
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
else
|
|
@@ -469,7 +461,7 @@ namespace SCADA_DAQ.Customer.Machines
|
|
|
var labels = JsonHelper.JsonDeserialize<CameraModels>(_strContent); //获取标签位置
|
|
|
var codes = labels.ID.Split(',');
|
|
|
var labelModels = new List<LabelModel>();
|
|
|
- var minCount =Math.Min( Math.Min(labels.X.Count, labels.R.Count),codes.Length);
|
|
|
+ var minCount = Math.Min(Math.Min(labels.X.Count, labels.R.Count), codes.Length);
|
|
|
for (int i = 0; i < minCount; i++)
|
|
|
{
|
|
|
labelModels.Add(new LabelModel { X = labels.X[i], Y = labels.Y[i], R = labels.R[i], CodeID = codes[i] });
|
|
@@ -495,7 +487,7 @@ namespace SCADA_DAQ.Customer.Machines
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -529,12 +521,7 @@ namespace SCADA_DAQ.Customer.Machines
|
|
|
GetListenReg(Tag_Reset).SetBit();
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
else
|
|
@@ -608,14 +595,14 @@ namespace SCADA_DAQ.Customer.Machines
|
|
|
//都放在输送辊中心点,无需偏移
|
|
|
BoardInfo.ReleaseY = 0;
|
|
|
GetListenReg(Tag_CaptureX).WriteObject(null,
|
|
|
- moveX + (float)xOffset, //D1512
|
|
|
- moveY + (float)yOffset, //D1514
|
|
|
- (float)rotation, //D1516
|
|
|
- (short)1, // D1518
|
|
|
- (short)BoardInfo.CupIndex, // D1519.
|
|
|
- (float)18.0, // D1520 //厚度
|
|
|
- (float)470 + releaseXOffset, // D1522 放板位置X
|
|
|
- (float)BoardInfo.ReleaseY, // D1524 放板位置Y
|
|
|
+ moveX + (float)xOffset, //D1512
|
|
|
+ moveY + (float)yOffset, //D1514
|
|
|
+ (float)rotation, //D1516
|
|
|
+ (short)1, // D1518
|
|
|
+ (short)BoardInfo.CupIndex, // D1519.
|
|
|
+ (float)18.0, // D1520 //厚度
|
|
|
+ (float)470 + releaseXOffset, // D1522 放板位置X
|
|
|
+ (float)BoardInfo.ReleaseY, // D1524 放板位置Y
|
|
|
(float)releaseRotation //放板角度
|
|
|
);
|
|
|
|
|
@@ -722,7 +709,7 @@ namespace SCADA_DAQ.Customer.Machines
|
|
|
{
|
|
|
t.Status = Models.TaskStatus.Finished;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
|
|
|
GetListenReg(Tag_SmallBoardManualConfirm).SetBit();
|
|
|
}
|