diff --git a/Rs.DeweyTester/Flow/NormalFlow/DischargeFlow.cs b/Rs.DeweyTester/Flow/NormalFlow/DischargeFlow.cs index 6f39e81..93f1423 100644 --- a/Rs.DeweyTester/Flow/NormalFlow/DischargeFlow.cs +++ b/Rs.DeweyTester/Flow/NormalFlow/DischargeFlow.cs @@ -350,10 +350,12 @@ namespace Rs.MotionPlat.Flow } break; case EDischargeFlowStep.进料盘产品定位: + ActionStart(); ProductLocationFlow.Instance.Grab(ETrayType.Input, takeSlotIndex); productLocationResult = OneGrabSixteenManager.Instance.GetResults(); if (productLocationResult != null || GlobalVar.RunSpace) { + ActionEnd("PnP 扫描 16 个 DUT 2DBC", "PrP scan 16 DUT 2DBC"); //对结果进行处理 flowStep = EDischargeFlowStep.料仓取料; } @@ -468,6 +470,7 @@ namespace Rs.MotionPlat.Flow //{ // DischargeModuleGoSafePosFlow.Instance.GoSafePostion(ESafePosSide.PlaceToFixture); //} + ActionStart(); if(GroupAxisMove.XY1Y2MovePos(targetPosition, GlobalVar.WholeSpeed, EGoWhichSide.FixtureSide)) { AxisPosPrint.PrintXY1Y2TargetPos("到治具放料缓冲位,", targetPosition, GetClassName()); @@ -477,6 +480,7 @@ namespace Rs.MotionPlat.Flow case EDischargeFlowStep.等待到治具取料等待位: if(Ops.IsStop("LoadX","LoadY1","LoadY2")) { + ActionEnd("拾取器移动到另一个治具", "Picker move to another test cell (2nd)"); AxisPosPrint.PrintXY1Y2CurrentPos("轴loadx,loady1,loady2已停止运动,",GetClassName()); if(AxisArrived.LoadXY1Y2IsArrived(targetPosition.X, targetPosition.Y1, targetPosition.Y2)) { @@ -996,6 +1000,29 @@ namespace Rs.MotionPlat.Flow } return null; } + + Stopwatch timeStatistics = new Stopwatch(); + + public void ActionStart() + { + if (GlobalVar.EnableIndexTimeStatistics) + timeStatistics.Restart(); + } + + public void ActionEnd(string actionCnName, string actionEnName) + { + if (GlobalVar.EnableIndexTimeStatistics) + { + timeStatistics.Stop(); + string dirpath = $"d:\\data\\{DateTime.Now.ToString("yyyyMMdd")}"; + if(!Directory.Exists(dirpath)) + { + Directory.CreateDirectory(dirpath); + } + string filename = Path.Combine(dirpath, "breakdowntesttime.csv"); + File.AppendAllText(filename, $"{actionCnName},{actionEnName},{timeStatistics.ElapsedMilliseconds}\r\n"); + } + } } } diff --git a/Rs.DeweyTester/Flow/SubFlow/FixturePlaceFlow.cs b/Rs.DeweyTester/Flow/SubFlow/FixturePlaceFlow.cs index a070d5f..19a0dbf 100644 --- a/Rs.DeweyTester/Flow/SubFlow/FixturePlaceFlow.cs +++ b/Rs.DeweyTester/Flow/SubFlow/FixturePlaceFlow.cs @@ -69,6 +69,7 @@ namespace Rs.MotionPlat.Flow.SubFlow TargetPosition targetPosition = new TargetPosition(); TestFixture curFixture = TestFixtureManager.Instance.GetTestFixture(fixtureIndex); Nozzle curNozzle=NozzleManager.GetNozzle(nozzleIndex); + DischargeFlow.Instance.ActionStart(); while (!finished) { if (MachineManage.Instance.MachineStatus == EMachineStatus.Stop && needStop) @@ -241,7 +242,8 @@ namespace Rs.MotionPlat.Flow.SubFlow case EFixturePlaceFlowStep.等待治具放料完成后抬起: if (Ops.IsStop($"NozzleZ{curNozzle.NozzleIndex}")) { - if(bTest) + DischargeFlow.Instance.ActionEnd("拾取器将新的 DUT 装入治具夹头", "Picker load new DUT to test cell holder"); + if (bTest) { finished = true; flowStep = EFixturePlaceFlowStep.待触发; diff --git a/Rs.DeweyTester/Flow/SubFlow/FixtureTakeFlow.cs b/Rs.DeweyTester/Flow/SubFlow/FixtureTakeFlow.cs index 84a8c02..d7283a4 100644 --- a/Rs.DeweyTester/Flow/SubFlow/FixtureTakeFlow.cs +++ b/Rs.DeweyTester/Flow/SubFlow/FixtureTakeFlow.cs @@ -67,7 +67,7 @@ namespace Rs.MotionPlat.Flow.SubFlow TargetPosition targetPosition = new TargetPosition(); TestFixture curFixture = TestFixtureManager.Instance.GetTestFixture(fixtureIndex); Nozzle curNozzle = null; - + DischargeFlow.Instance.ActionStart(); while (!finished) { if (MachineManage.Instance.MachineStatus == EMachineStatus.Stop && needStop) @@ -206,6 +206,7 @@ namespace Rs.MotionPlat.Flow.SubFlow case EFixtureTakeFlowStep.治具取料完成真空检测: if (curNozzle.HasProduct() || GlobalVar.RunSpace) { + DischargeFlow.Instance.ActionEnd("拾取器从治具夹头上卸下 DUT", "Picker unload DUT from test cell holder"); if(btest) { finished = true; diff --git a/Rs.DeweyTester/Flow/SubFlow/StockPlaceFlow.cs b/Rs.DeweyTester/Flow/SubFlow/StockPlaceFlow.cs index a7f1514..2c78be0 100644 --- a/Rs.DeweyTester/Flow/SubFlow/StockPlaceFlow.cs +++ b/Rs.DeweyTester/Flow/SubFlow/StockPlaceFlow.cs @@ -98,6 +98,7 @@ namespace Rs.MotionPlat.Flow.SubFlow TargetPosition targetPosition = new TargetPosition(); Nozzle curNozzle = NozzleManager.GetNozzle(nozzleIndex); TraySlot curPlaceSlot = null; + DischargeFlow.Instance.ActionStart(); while (!finished) { if (MachineManage.Instance.MachineStatus == EMachineStatus.Stop && needStop) @@ -283,6 +284,7 @@ namespace Rs.MotionPlat.Flow.SubFlow case EStockPlaceFlowStep.料仓放料完成粘料检测: if (!curNozzle.HasProduct() || GlobalVar.RunSpace) { + DischargeFlow.Instance.ActionEnd("拾取器将 1 个 DUT 卸载到output托盘(OK/NG)", "Picker unload 1 DUT to output trav (OK/NG)"); if(curNozzle.Product!=null) { curNozzle.Product.ToSlotIndex = curPlaceSlot.Index; diff --git a/Rs.DeweyTester/Flow/SubFlow/StockTakeFlow.cs b/Rs.DeweyTester/Flow/SubFlow/StockTakeFlow.cs index 150684b..5a5a333 100644 --- a/Rs.DeweyTester/Flow/SubFlow/StockTakeFlow.cs +++ b/Rs.DeweyTester/Flow/SubFlow/StockTakeFlow.cs @@ -68,6 +68,7 @@ namespace Rs.MotionPlat.Flow.SubFlow /// public void Take(ETrayType trayType, int slotIndex,int nozzleIndex, EStockScanBarcodeMode scanBarCodeMode= EStockScanBarcodeMode.Multi, ProductLocationResult locaResult=null,bool needStop=true) { + if (finished) finished = false; else @@ -75,6 +76,7 @@ namespace Rs.MotionPlat.Flow.SubFlow flowStep = EStockTakeFlowStep.待触发; string logInfo = string.Empty; TargetPosition targetPosition = new TargetPosition(); + DischargeFlow.Instance.ActionStart(); while (!finished) { if (MachineManage.Instance.MachineStatus == EMachineStatus.Stop && needStop) @@ -245,6 +247,7 @@ namespace Rs.MotionPlat.Flow.SubFlow //flowStep = EStockTakeFlowStep.判断是否需要从料仓取料; finished = true; flowStep = EStockTakeFlowStep.待触发; + DischargeFlow.Instance.ActionEnd("PnP 从输入托盘拾取 1 个 DUT", "PhP pick up 1 DUT from input tray"); } else {