1、增加和视觉软件通信的日志

Eight
lhiven 5 months ago
parent d8d7f01c97
commit 25c6794d2d

@ -115,17 +115,18 @@ namespace Rs.MotionPlat.Flow.SubFlow
logInfo = $"{GetClassName()} 通知相机拍照"; logInfo = $"{GetClassName()} 通知相机拍照";
MessageQueue.Instance.Insert(logInfo); MessageQueue.Instance.Insert(logInfo);
Thread.Sleep(GlobalVar.FixtureTakePicDelaytime); Thread.Sleep(GlobalVar.FixtureTakePicDelaytime);
VisionHelper.fixtureDumpProductVision.ClearQueue(); if(VisionHelper.fixtureDumpProductVision.ClearQueue())
{
UpCameraHelper.Grab(); UpCameraHelper.Grab();
//AxisControl.LoadY2.ComparePulse(1, false);//开始拍照 //AxisControl.LoadY2.ComparePulse(1, false);//开始拍照
if(GlobalVar.RunSpace) if (GlobalVar.RunSpace)
{ {
flowStep = EFixturePlaceFlowStep.; flowStep = EFixturePlaceFlowStep.;
} }
else else
{ {
vr = VisionHelper.Grab(EVisionScene.FixtureDumpProduct,$"M{curFixture.Index};"); vr = VisionHelper.Grab(EVisionScene.FixtureDumpProduct, $"M{curFixture.Index};");
if(vr!=null && vr.Result) if (vr != null && vr.Result)
{ {
curFixture.PlaceProductOffsetX = vr.OffsetX; curFixture.PlaceProductOffsetX = vr.OffsetX;
curFixture.PlaceProductOffsetY = vr.OffsetY; curFixture.PlaceProductOffsetY = vr.OffsetY;
@ -134,9 +135,9 @@ namespace Rs.MotionPlat.Flow.SubFlow
else else
{ {
AlarmEntity alarmEntity = AlarmCollection.Get(AlarmConstID.).Transform(curFixture.Index); AlarmEntity alarmEntity = AlarmCollection.Get(AlarmConstID.).Transform(curFixture.Index);
if(alarmEntity!=null) if (alarmEntity != null)
{ {
Msgbox.ShowDialog(alarmEntity, EButtonType.Retry,true); Msgbox.ShowDialog(alarmEntity, EButtonType.Retry, true);
} }
else else
{ {
@ -144,6 +145,11 @@ namespace Rs.MotionPlat.Flow.SubFlow
} }
} }
} }
}
else
{
Msgbox.Show("send C to vision fail", EButtonType.Recheck);
}
break; break;
case EFixturePlaceFlowStep.: case EFixturePlaceFlowStep.:
if (curNozzle != null) if (curNozzle != null)

@ -159,12 +159,13 @@ namespace Rs.MotionPlat.Flow.SubFlow
} }
break; break;
case EStockPlaceFlowStep.: case EStockPlaceFlowStep.:
VisionHelper.trayLocationVision.ClearQueue(); if(VisionHelper.trayLocationVision.ClearQueue())
{
UpCameraHelper.Grab(); UpCameraHelper.Grab();
VisionResult vr = VisionHelper.Grab(Vision.EVisionScene.TrayLocation); VisionResult vr = VisionHelper.Grab(Vision.EVisionScene.TrayLocation);
if((vr!=null && vr.Result) || GlobalVar.RunSpace) if ((vr != null && vr.Result) || GlobalVar.RunSpace)
{ {
if(GlobalVar.RunSpace) if (GlobalVar.RunSpace)
{ {
flowStep = EStockPlaceFlowStep.; flowStep = EStockPlaceFlowStep.;
} }
@ -198,6 +199,11 @@ namespace Rs.MotionPlat.Flow.SubFlow
{ {
Msgbox.ShowTipDialog(EButtonType.Retry, "stock slot location fail", "", true); Msgbox.ShowTipDialog(EButtonType.Retry, "stock slot location fail", "", true);
} }
}
else
{
Msgbox.Show("send C to vision fail", EButtonType.Recheck);
}
break; break;
case EStockPlaceFlowStep.: case EStockPlaceFlowStep.:
//curNozzle = NozzleManager.GetToUnloadNozzle(); //curNozzle = NozzleManager.GetToUnloadNozzle();

@ -31,6 +31,6 @@ using System.Runtime.InteropServices;
// //
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值 //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示: //通过使用 "*",如下所示:
[assembly: AssemblyVersion("1.20.24.33")] [assembly: AssemblyVersion("1.20.25.01")]
//[assembly: AssemblyVersion("1.0.0.0")] //[assembly: AssemblyVersion("1.0.0.0")]
//[assembly: AssemblyFileVersion("1.0.0.0")] //[assembly: AssemblyFileVersion("1.0.0.0")]

@ -23,7 +23,7 @@ namespace Rs.MotionPlat.Vision
else else
{ {
string data = Encoding.ASCII.GetString(reciveBuffer.ToArray()); string data = Encoding.ASCII.GetString(reciveBuffer.ToArray());
MessageQueue.Instance.Insert(data); MessageQueue.Instance.Insert($" >>> {data}");
if (data == "M,0") if (data == "M,0")
{ {
MessageQueue.Instance.Insert("视觉收到拍照指令"); MessageQueue.Instance.Insert("视觉收到拍照指令");
@ -31,7 +31,6 @@ namespace Rs.MotionPlat.Vision
else if (data == "C,0") else if (data == "C,0")
{ {
visionGrabEvent.Set(); visionGrabEvent.Set();
MessageQueue.Instance.Insert($" >>> {data}");
} }
else else
{ {

Loading…
Cancel
Save