From 5eb1de3c0231963c32a59109dd1ac5a89b9ad7d7 Mon Sep 17 00:00:00 2001 From: lhiven Date: Sun, 11 Aug 2024 17:57:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=94=BE=E6=96=99=E5=88=B0?= =?UTF-8?q?=E6=96=99=E4=BB=93=E7=94=9F=E6=88=90=E7=9A=84=E6=96=87=E4=BB=B6?= =?UTF-8?q?=EF=BC=8C=E5=A2=9E=E5=8A=A0SN=E5=92=8C=E6=94=BE=E6=96=99?= =?UTF-8?q?=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Rs.DeweyTester/Flow/SubFlow/StockPlaceFlow.cs | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/Rs.DeweyTester/Flow/SubFlow/StockPlaceFlow.cs b/Rs.DeweyTester/Flow/SubFlow/StockPlaceFlow.cs index f013681..0bae93a 100644 --- a/Rs.DeweyTester/Flow/SubFlow/StockPlaceFlow.cs +++ b/Rs.DeweyTester/Flow/SubFlow/StockPlaceFlow.cs @@ -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);