优化放料到料仓生成的文件,增加SN和放料时间

master
lhiven 10 months ago
parent 2d33157fe9
commit 5eb1de3c02

@ -136,7 +136,7 @@ namespace Rs.MotionPlat.Flow.SubFlow
//}
if (GroupAxisMove.XY1Y2MovePos(targetPosition, GlobalVar.WholeSpeed, EGoWhichSide.StockSide))
{
AxisPosPrint.PrintXY1Y2TargetPos("到料仓拍照位上方,", targetPosition, GetClassName());
AxisPosPrint.PrintXY1Y2TargetPos($"到{trayType}料仓拍照位上方,", targetPosition, GetClassName());
flowStep = EStockPlaceFlowStep.;
}
}
@ -148,7 +148,7 @@ namespace Rs.MotionPlat.Flow.SubFlow
AxisPosPrint.PrintXY1Y2CurrentPos("轴loadx,loady1,loady2已停止运动,", GetClassName());
if (AxisArrived.LoadXY1Y2IsArrived(targetPosition.X, targetPosition.Y1, targetPosition.Y2))
{
AxisPosPrint.PrintXY1Y2CurrentPos("已运动到料仓拍照位上方,", GetClassName());
AxisPosPrint.PrintXY1Y2CurrentPos($"已运动到{trayType}料仓拍照位上方,", GetClassName());
flowStep = EStockPlaceFlowStep.;
}
else
@ -162,16 +162,22 @@ namespace Rs.MotionPlat.Flow.SubFlow
VisionResult vr = VisionHelper.Grab(Vision.EVisionScene.TrayLocation);
if(vr!=null && vr.Result)
{
curNozzle = NozzleManager.GetNozzle(nozzleIndex);
slotOffsetX = vr.OffsetX;
slotOffsetY=vr.OffsetY;
string title = "index,offsetx,offsety\r\n";
string content = $"{slotIndex},{slotOffsetX},{slotOffsetY}\r\n";
string dataDir = $"d://data/placestock";
string sn = "";
if(curNozzle!=null && curNozzle.Product!=null && !string.IsNullOrEmpty(curNozzle.Product.SN))
{
sn = curNozzle.Product.SN;
}
string title = "index,sn,offsetx,offsety,time\r\n";
string content = $"{slotIndex},{sn},{slotOffsetX},{slotOffsetY},{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss fff")}\r\n";
string dataDir = $"d://data/placestock//{DateTime.Now.ToString("yyyy-MM-dd")}";
if(!Directory.Exists(dataDir))
{
Directory.CreateDirectory(dataDir);
}
string dataFilePath = $"{dataDir}//{DateTime.Now.ToString("yyyy-MM-dd")}.csv";
string dataFilePath = $"{dataDir}//{GlobalVar.LotName}_{trayType}.csv";
if(!File.Exists(dataFilePath))
{
File.AppendAllText(dataFilePath, title);

Loading…
Cancel
Save