From b49c4d3156664bed7f898c63cfd101e7256acd8f Mon Sep 17 00:00:00 2001 From: lhiven Date: Sat, 10 Aug 2024 16:24:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=BE=E6=96=99=E5=88=B0=E6=96=99=E4=BB=93?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=8A=8A=E5=81=8F=E7=A7=BB=E9=87=8F=E5=86=99?= =?UTF-8?q?=E5=85=A5=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Rs.DeweyTester/Flow/SubFlow/StockPlaceFlow.cs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/Rs.DeweyTester/Flow/SubFlow/StockPlaceFlow.cs b/Rs.DeweyTester/Flow/SubFlow/StockPlaceFlow.cs index 67c630a..f013681 100644 --- a/Rs.DeweyTester/Flow/SubFlow/StockPlaceFlow.cs +++ b/Rs.DeweyTester/Flow/SubFlow/StockPlaceFlow.cs @@ -7,6 +7,7 @@ using Rs.MotionPlat.Flow.SafePosFlow; using Rs.MotionPlat.Vision; using System; using System.Collections.Generic; +using System.IO; using System.Linq; using System.Text; using System.Threading; @@ -161,7 +162,21 @@ namespace Rs.MotionPlat.Flow.SubFlow VisionResult vr = VisionHelper.Grab(Vision.EVisionScene.TrayLocation); if(vr!=null && vr.Result) { - slotOffsetX = vr.OffsetX; slotOffsetY=vr.OffsetY; + 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"; + if(!Directory.Exists(dataDir)) + { + Directory.CreateDirectory(dataDir); + } + string dataFilePath = $"{dataDir}//{DateTime.Now.ToString("yyyy-MM-dd")}.csv"; + if(!File.Exists(dataFilePath)) + { + File.AppendAllText(dataFilePath, title); + } + File.AppendAllText(dataFilePath, content); flowStep = EStockPlaceFlowStep.到料仓放料位上方; } else