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