|
@@ -120,30 +120,51 @@ namespace SCADA_DAQ.Customer.Machines
|
|
item.CaptureState = CaptureState.None;
|
|
item.CaptureState = CaptureState.None;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- StackCapture.CaptureState = CaptureState.Capturing;
|
|
|
|
|
|
+ currentBox.CaptureState = CaptureState.Capturing;
|
|
takeLocation.X = CustomerEnv.CustomerConfig.CaputreBoxLocation.X - CustomerEnv.CustomerConfig.MachineOrigin.X - (StackSln.BoxWidth_Dec / 2);
|
|
takeLocation.X = CustomerEnv.CustomerConfig.CaputreBoxLocation.X - CustomerEnv.CustomerConfig.MachineOrigin.X - (StackSln.BoxWidth_Dec / 2);
|
|
takeLocation.Y = CustomerEnv.CustomerConfig.CaputreBoxLocation.Y - CustomerEnv.CustomerConfig.MachineOrigin.Y - (StackSln.BoxLength_Dec / 2);
|
|
takeLocation.Y = CustomerEnv.CustomerConfig.CaputreBoxLocation.Y - CustomerEnv.CustomerConfig.MachineOrigin.Y - (StackSln.BoxLength_Dec / 2);
|
|
takeLocation.Z = CustomerEnv.CustomerConfig.CaputreBoxLocation.Z - CustomerEnv.CustomerConfig.MachineOrigin.Z + StackSln.BoxHeight_Dec;
|
|
takeLocation.Z = CustomerEnv.CustomerConfig.CaputreBoxLocation.Z - CustomerEnv.CustomerConfig.MachineOrigin.Z + StackSln.BoxHeight_Dec;
|
|
takeLocation.R = 0;
|
|
takeLocation.R = 0;
|
|
|
|
|
|
- var TakeBoxYIsSucess = GetListenReg(Tag_Y轴取料点上方).WriteReg($"{takeLocation.X}");
|
|
|
|
- var TakeBoxXIsSucess = GetListenReg(Tag_X轴取料点上方).WriteReg($"{takeLocation.Y}");
|
|
|
|
- var TakeBoxZIsSucess = GetListenReg(Tag_Z轴取料点).WriteReg($"{takeLocation.Z}");
|
|
|
|
|
|
+ bool TakeBoxYIsSucess;
|
|
|
|
+ bool TakeBoxXIsSucess;
|
|
|
|
+ if (CustomerEnv.CustomerConfig.SwitchXY)
|
|
|
|
+ {
|
|
|
|
+ TakeBoxYIsSucess = GetListenReg(Tag_Y轴取料点上方).WriteReg($"{takeLocation.Y}");
|
|
|
|
+ TakeBoxXIsSucess = GetListenReg(Tag_X轴取料点上方).WriteReg($"{takeLocation.X}");
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ TakeBoxYIsSucess = GetListenReg(Tag_Y轴取料点上方).WriteReg($"{takeLocation.X}");
|
|
|
|
+ TakeBoxXIsSucess = GetListenReg(Tag_X轴取料点上方).WriteReg($"{takeLocation.Y}");
|
|
|
|
+ }
|
|
|
|
+ bool TakeBoxZIsSucess = GetListenReg(Tag_Z轴取料点).WriteReg($"{takeLocation.Z}");
|
|
|
|
|
|
releaseLocation.X = (decimal)StackCapture.CaptureX - CustomerEnv.CustomerConfig.MachineOrigin.X;
|
|
releaseLocation.X = (decimal)StackCapture.CaptureX - CustomerEnv.CustomerConfig.MachineOrigin.X;
|
|
releaseLocation.Y = (decimal)StackCapture.CaptureY - CustomerEnv.CustomerConfig.MachineOrigin.Y;
|
|
releaseLocation.Y = (decimal)StackCapture.CaptureY - CustomerEnv.CustomerConfig.MachineOrigin.Y;
|
|
releaseLocation.Z = (decimal)StackCapture.CaptureZ + StackSln.BoxHeight_Dec / 2 - CustomerEnv.CustomerConfig.MachineOrigin.Z;
|
|
releaseLocation.Z = (decimal)StackCapture.CaptureZ + StackSln.BoxHeight_Dec / 2 - CustomerEnv.CustomerConfig.MachineOrigin.Z;
|
|
releaseLocation.R = (decimal)currentBox.RotationAngle;
|
|
releaseLocation.R = (decimal)currentBox.RotationAngle;
|
|
|
|
|
|
- var PutBoxXIsSucess = GetListenReg(Tag_X轴放料点上方).WriteReg($"{(int)releaseLocation.X}");
|
|
|
|
- var PutBoxYIsSucess = GetListenReg(Tag_Y轴放料点上方).WriteReg($"{(int)releaseLocation.Y}");
|
|
|
|
|
|
+ bool PutBoxXIsSucess;
|
|
|
|
+ bool PutBoxYIsSucess;
|
|
|
|
+ if (CustomerEnv.CustomerConfig.SwitchXY)
|
|
|
|
+ {
|
|
|
|
+ PutBoxXIsSucess = GetListenReg(Tag_X轴放料点上方).WriteReg($"{(int)releaseLocation.Y}");
|
|
|
|
+ PutBoxYIsSucess = GetListenReg(Tag_Y轴放料点上方).WriteReg($"{(int)releaseLocation.X}");
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ PutBoxXIsSucess = GetListenReg(Tag_X轴放料点上方).WriteReg($"{(int)releaseLocation.X}");
|
|
|
|
+ PutBoxYIsSucess = GetListenReg(Tag_Y轴放料点上方).WriteReg($"{(int)releaseLocation.Y}");
|
|
|
|
+ }
|
|
|
|
+
|
|
var PutBoxRIsSucess = GetListenReg(Tag_R轴放料点角度).WriteReg($"{(int)currentBox.RotationAngle * -1}");
|
|
var PutBoxRIsSucess = GetListenReg(Tag_R轴放料点角度).WriteReg($"{(int)currentBox.RotationAngle * -1}");
|
|
var PutBoxZIsSucess = GetListenReg(Tag_Z轴放料点).WriteReg($"{(int)releaseLocation.Z}");
|
|
var PutBoxZIsSucess = GetListenReg(Tag_Z轴放料点).WriteReg($"{(int)releaseLocation.Z}");
|
|
|
|
|
|
if (TakeBoxYIsSucess && TakeBoxXIsSucess && TakeBoxZIsSucess &&
|
|
if (TakeBoxYIsSucess && TakeBoxXIsSucess && TakeBoxZIsSucess &&
|
|
PutBoxXIsSucess && PutBoxYIsSucess && PutBoxRIsSucess && PutBoxZIsSucess)
|
|
PutBoxXIsSucess && PutBoxYIsSucess && PutBoxRIsSucess && PutBoxZIsSucess)
|
|
{
|
|
{
|
|
- GetListenReg("HMI开始作业").WriteReg(1);
|
|
|
|
|
|
+ GetListenReg(Tag_HMI开始作业).WriteReg(1);
|
|
}
|
|
}
|
|
Log.Info($"开始堆码,抓取,X:{takeLocation.X},Y:{takeLocation.Y},Z:{takeLocation.Y},角度:{0}\r\n" +
|
|
Log.Info($"开始堆码,抓取,X:{takeLocation.X},Y:{takeLocation.Y},Z:{takeLocation.Y},角度:{0}\r\n" +
|
|
$"摆放,X:{releaseLocation.X},Y:{releaseLocation.Y},Z:{releaseLocation.Z},角度:{releaseLocation.R}");
|
|
$"摆放,X:{releaseLocation.X},Y:{releaseLocation.Y},Z:{releaseLocation.Z},角度:{releaseLocation.R}");
|
|
@@ -156,7 +177,7 @@ namespace SCADA_DAQ.Customer.Machines
|
|
{
|
|
{
|
|
CurrentCapture = StackCapture
|
|
CurrentCapture = StackCapture
|
|
});
|
|
});
|
|
- StackCapture.CaptureState = CaptureState.Captured;
|
|
|
|
|
|
+ StackSln.StackCaptureList[CurrentCaputerIndex - 1].CaptureState = CaptureState.Captured;
|
|
if (CurrentCaputerIndex == StackSln.StackCaptureList.Count)
|
|
if (CurrentCaputerIndex == StackSln.StackCaptureList.Count)
|
|
{
|
|
{
|
|
CurrentCaputerIndex = 1; //堆码完成
|
|
CurrentCaputerIndex = 1; //堆码完成
|