private void buttonMeasOnce_Click(object sender, EventArgs e) { if (MotorSafetyCheck.InPositionRange(zone.AxisOutlineMeasX, ClassZone尺寸测量.EnumPointX.Start, ClassDataInfo.CELLPITCH * (int)EnumCellIndex.右电芯)) { cellindex = EnumCellIndex.右电芯; } else if (MotorSafetyCheck.InPositionRange(zone.AxisOutlineMeasX, ClassZone尺寸测量.EnumPointX.Start, ClassDataInfo.CELLPITCH * (int)EnumCellIndex.中电芯)) { cellindex = EnumCellIndex.中电芯; } else if (MotorSafetyCheck.InPositionRange(zone.AxisOutlineMeasX, ClassZone尺寸测量.EnumPointX.Start, ClassDataInfo.CELLPITCH * (int)EnumCellIndex.左电芯)) { cellindex = EnumCellIndex.左电芯; } else { MessageBox.Show("尺寸测量需要先将指定工位移到相机下方。请先将要测量的工位移动到相机下方。"); return; } if (zone.CCDMeasDataStations[cellindex].CellData == null) { zone.CCDMeasDataStations[cellindex].CellData = ClassDataInfo.NewCellData(); //zone.CCDMeasDataStations[cellindex].CellData.Barcode = "TEST"; } DoAction(sender, () => { ErrorInfoWithPause res = zone.ActionOneCCDMeas(cellindex, DataComp.AddAll); while (!zone.isCCDAllFinish) { Thread.Sleep(1); } zone.CCDMeasDataStations[cellindex].CellData = zone.BufferDatas[(int)cellindex]; return(res); }); }
public override void run(StateEventArgs inputEventArg) { lock (runLock) { switch (inputEventArg.eventName) { case "TransPNPPickFinish": //From state PickPart case "WaitCCDReady": if (!ClassWorkZones.Instance.WorkZone尺寸测量.IsWorkFree || !MotorSafetyCheck.InPositionRange(ClassWorkZones.Instance.WorkZone尺寸测量.AxisOutlineMeasX, ClassZone尺寸测量.EnumPointX.GetPart)) { DoneReturn("WaitCCDReady"); return; } base.run(inputEventArg); oldres = null; ErrorReturnHandler("传送PNP放料", "", ErrorDialogResult.Retry); break; } } }