增加拍照、取放料的动作的统计功能

Eight
lhiven 7 months ago
parent 7be04f5924
commit a716d353ff

@ -350,10 +350,12 @@ namespace Rs.MotionPlat.Flow
} }
break; break;
case EDischargeFlowStep.: case EDischargeFlowStep.:
ActionStart();
ProductLocationFlow.Instance.Grab(ETrayType.Input, takeSlotIndex); ProductLocationFlow.Instance.Grab(ETrayType.Input, takeSlotIndex);
productLocationResult = OneGrabSixteenManager.Instance.GetResults(); productLocationResult = OneGrabSixteenManager.Instance.GetResults();
if (productLocationResult != null || GlobalVar.RunSpace) if (productLocationResult != null || GlobalVar.RunSpace)
{ {
ActionEnd("PnP 扫描 16 个 DUT 2DBC", "PrP scan 16 DUT 2DBC");
//对结果进行处理 //对结果进行处理
flowStep = EDischargeFlowStep.; flowStep = EDischargeFlowStep.;
} }
@ -468,6 +470,7 @@ namespace Rs.MotionPlat.Flow
//{ //{
// DischargeModuleGoSafePosFlow.Instance.GoSafePostion(ESafePosSide.PlaceToFixture); // DischargeModuleGoSafePosFlow.Instance.GoSafePostion(ESafePosSide.PlaceToFixture);
//} //}
ActionStart();
if(GroupAxisMove.XY1Y2MovePos(targetPosition, GlobalVar.WholeSpeed, EGoWhichSide.FixtureSide)) if(GroupAxisMove.XY1Y2MovePos(targetPosition, GlobalVar.WholeSpeed, EGoWhichSide.FixtureSide))
{ {
AxisPosPrint.PrintXY1Y2TargetPos("到治具放料缓冲位,", targetPosition, GetClassName()); AxisPosPrint.PrintXY1Y2TargetPos("到治具放料缓冲位,", targetPosition, GetClassName());
@ -477,6 +480,7 @@ namespace Rs.MotionPlat.Flow
case EDischargeFlowStep.: case EDischargeFlowStep.:
if(Ops.IsStop("LoadX","LoadY1","LoadY2")) if(Ops.IsStop("LoadX","LoadY1","LoadY2"))
{ {
ActionEnd("拾取器移动到另一个治具", "Picker move to another test cell (2nd)");
AxisPosPrint.PrintXY1Y2CurrentPos("轴loadx,loady1,loady2已停止运动,",GetClassName()); AxisPosPrint.PrintXY1Y2CurrentPos("轴loadx,loady1,loady2已停止运动,",GetClassName());
if(AxisArrived.LoadXY1Y2IsArrived(targetPosition.X, targetPosition.Y1, targetPosition.Y2)) if(AxisArrived.LoadXY1Y2IsArrived(targetPosition.X, targetPosition.Y1, targetPosition.Y2))
{ {
@ -996,6 +1000,29 @@ namespace Rs.MotionPlat.Flow
} }
return null; 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");
}
}
} }
} }

@ -69,6 +69,7 @@ namespace Rs.MotionPlat.Flow.SubFlow
TargetPosition targetPosition = new TargetPosition(); TargetPosition targetPosition = new TargetPosition();
TestFixture curFixture = TestFixtureManager.Instance.GetTestFixture(fixtureIndex); TestFixture curFixture = TestFixtureManager.Instance.GetTestFixture(fixtureIndex);
Nozzle curNozzle=NozzleManager.GetNozzle(nozzleIndex); Nozzle curNozzle=NozzleManager.GetNozzle(nozzleIndex);
DischargeFlow.Instance.ActionStart();
while (!finished) while (!finished)
{ {
if (MachineManage.Instance.MachineStatus == EMachineStatus.Stop && needStop) if (MachineManage.Instance.MachineStatus == EMachineStatus.Stop && needStop)
@ -241,7 +242,8 @@ namespace Rs.MotionPlat.Flow.SubFlow
case EFixturePlaceFlowStep.: case EFixturePlaceFlowStep.:
if (Ops.IsStop($"NozzleZ{curNozzle.NozzleIndex}")) if (Ops.IsStop($"NozzleZ{curNozzle.NozzleIndex}"))
{ {
if(bTest) DischargeFlow.Instance.ActionEnd("拾取器将新的 DUT 装入治具夹头", "Picker load new DUT to test cell holder");
if (bTest)
{ {
finished = true; finished = true;
flowStep = EFixturePlaceFlowStep.; flowStep = EFixturePlaceFlowStep.;

@ -67,7 +67,7 @@ namespace Rs.MotionPlat.Flow.SubFlow
TargetPosition targetPosition = new TargetPosition(); TargetPosition targetPosition = new TargetPosition();
TestFixture curFixture = TestFixtureManager.Instance.GetTestFixture(fixtureIndex); TestFixture curFixture = TestFixtureManager.Instance.GetTestFixture(fixtureIndex);
Nozzle curNozzle = null; Nozzle curNozzle = null;
DischargeFlow.Instance.ActionStart();
while (!finished) while (!finished)
{ {
if (MachineManage.Instance.MachineStatus == EMachineStatus.Stop && needStop) if (MachineManage.Instance.MachineStatus == EMachineStatus.Stop && needStop)
@ -206,6 +206,7 @@ namespace Rs.MotionPlat.Flow.SubFlow
case EFixtureTakeFlowStep.: case EFixtureTakeFlowStep.:
if (curNozzle.HasProduct() || GlobalVar.RunSpace) if (curNozzle.HasProduct() || GlobalVar.RunSpace)
{ {
DischargeFlow.Instance.ActionEnd("拾取器从治具夹头上卸下 DUT", "Picker unload DUT from test cell holder");
if(btest) if(btest)
{ {
finished = true; finished = true;

@ -98,6 +98,7 @@ namespace Rs.MotionPlat.Flow.SubFlow
TargetPosition targetPosition = new TargetPosition(); TargetPosition targetPosition = new TargetPosition();
Nozzle curNozzle = NozzleManager.GetNozzle(nozzleIndex); Nozzle curNozzle = NozzleManager.GetNozzle(nozzleIndex);
TraySlot curPlaceSlot = null; TraySlot curPlaceSlot = null;
DischargeFlow.Instance.ActionStart();
while (!finished) while (!finished)
{ {
if (MachineManage.Instance.MachineStatus == EMachineStatus.Stop && needStop) if (MachineManage.Instance.MachineStatus == EMachineStatus.Stop && needStop)
@ -283,6 +284,7 @@ namespace Rs.MotionPlat.Flow.SubFlow
case EStockPlaceFlowStep.: case EStockPlaceFlowStep.:
if (!curNozzle.HasProduct() || GlobalVar.RunSpace) 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) if(curNozzle.Product!=null)
{ {
curNozzle.Product.ToSlotIndex = curPlaceSlot.Index; curNozzle.Product.ToSlotIndex = curPlaceSlot.Index;

@ -68,6 +68,7 @@ namespace Rs.MotionPlat.Flow.SubFlow
/// <param name="className"></param> /// <param name="className"></param>
public void Take(ETrayType trayType, int slotIndex,int nozzleIndex, EStockScanBarcodeMode scanBarCodeMode= EStockScanBarcodeMode.Multi, ProductLocationResult locaResult=null,bool needStop=true) public void Take(ETrayType trayType, int slotIndex,int nozzleIndex, EStockScanBarcodeMode scanBarCodeMode= EStockScanBarcodeMode.Multi, ProductLocationResult locaResult=null,bool needStop=true)
{ {
if (finished) if (finished)
finished = false; finished = false;
else else
@ -75,6 +76,7 @@ namespace Rs.MotionPlat.Flow.SubFlow
flowStep = EStockTakeFlowStep.; flowStep = EStockTakeFlowStep.;
string logInfo = string.Empty; string logInfo = string.Empty;
TargetPosition targetPosition = new TargetPosition(); TargetPosition targetPosition = new TargetPosition();
DischargeFlow.Instance.ActionStart();
while (!finished) while (!finished)
{ {
if (MachineManage.Instance.MachineStatus == EMachineStatus.Stop && needStop) if (MachineManage.Instance.MachineStatus == EMachineStatus.Stop && needStop)
@ -245,6 +247,7 @@ namespace Rs.MotionPlat.Flow.SubFlow
//flowStep = EStockTakeFlowStep.判断是否需要从料仓取料; //flowStep = EStockTakeFlowStep.判断是否需要从料仓取料;
finished = true; finished = true;
flowStep = EStockTakeFlowStep.; flowStep = EStockTakeFlowStep.;
DischargeFlow.Instance.ActionEnd("PnP 从输入托盘拾取 1 个 DUT", "PhP pick up 1 DUT from input tray");
} }
else else
{ {

Loading…
Cancel
Save