Esempio n. 1
0
 public override void run(StateEventArgs inputEventArg)
 {
     lock (runLock)
     {
         switch (inputEventArg.eventName)
         {
         case "SortingPickFinish":
         case "Unload":
         case "NotReady":
             if (ClassWorkZones.Instance.WorkZone下料传送.IsUnLoadOutEmpty)
             {
                 ClassCommonSetting.SMLogInfo(this.owner.Name, this.Name, "下料传送带上没有物料,下料检查停止。");
                 return;
             }
             if (!ClassWorkZones.Instance.WorkZone下料传送.CheckUnloadReady())
             {
                 DoneReturn("NotReady");
             }
             else
             {
                 base.run(inputEventArg);
                 DoneReturn("ReadyUnload");
             }
             break;
         }
     }
 }
Esempio n. 2
0
 public override void run(StateEventArgs inputEventArg)
 {
     lock (runLock)
     {
         if (inputEventArg.eventName != "WaitPNPFree")
         {
             base.run(inputEventArg);
         }
         switch (inputEventArg.eventName)
         {
         case "CellWorkAllFinish":     //From state TransPNPReady
         case "WaitPNPFree":
             if (ClassWorkFlow.Instance.TransPNPWorkSM.IsRunning)
             {
                 DoneReturn("WaitPNPFree");
                 return;
             }
             else if (owner.IsRunning)
             {
                 parts = ClassWorkZones.Instance.WorkZone厚度测量.GetDataInfoString() + " " + ClassWorkZones.Instance.WorkZone顶封边定位.GetDataInfoString();
                 ClassCommonSetting.SMLogInfo(this.owner.Name, this.Name, "传送机械手开始传送物料: " + parts);
                 ClassWorkFlow.Instance.TransPNPWorkSM.subscribeMeToResponseEvents(this);
                 ClassWorkFlow.Instance.TransPNPWorkSM.StartHandler(this, null);
             }
             break;
         }
     }
 }
Esempio n. 3
0
 public override void run(StateEventArgs inputEventArg)
 {
     lock (runLock)
     {
         base.run(inputEventArg);
         switch (inputEventArg.eventName)
         {
         case "LoadinFinish":                                                                 //From state StartLoadin
         case "WaitPNPFree":
             if (ClassWorkZones.Instance.WorkZone上料传送.LoadInDataStations[0].CellData == null) // && !ClassWorkZones.Instance.WorkZone上料传送.ThisInport(ClassZone上料传送.EnumInportName.LoadInConvInPos).status)
             {
                 return;
             }
             if (isRunning)
             {
                 DoneReturn("WaitPNPFree");
             }
             else if (owner.IsRunning)
             {
                 isRunning = true;
                 parts     = ClassWorkZones.Instance.WorkZone上料传送.GetDataInfoString();
                 ClassCommonSetting.SMLogInfo(this.owner.Name, this.Name, "上料机械手开始取物料: " + parts);
                 ClassWorkFlow.Instance.LoadPNPLoadSM.subscribeMeToResponseEvents(this);
                 ClassWorkFlow.Instance.LoadPNPLoadSM.StartHandler(this, null);
             }
             break;
         }
     }
 }
Esempio n. 4
0
 private void ErrorReturnHandler(string source, string message, ErrorDialogResult result)
 {
     if (!owner.IsRunning)
     {
         return;
     }
     if (result == ErrorDialogResult.OK || result == ErrorDialogResult.Retry)
     {
         ClassZone上料传送 LoadinZone = ClassWorkZones.Instance.WorkZone上料传送;
         if (message != "")
         {
             Colibri.CommonModule.Forms.BaseForm.DoInvokeRequired(MainForm.instance, () => MessageBox.Show(MainForm.instance, $"无数据有电芯的错误处理:取出不符的多余电芯。{Environment.NewLine}" +
                                                                                                           $"有数据无电芯的错误处理:无需处理。点确定后数据将会被删除忽略掉。{Environment.NewLine}{Environment.NewLine}" +
                                                                                                           $"处理完成后点确定。"));
             LoadinZone.SetLoadin();
         }
         res = LoadinZone.CheckLoadin();
         if (res != null)
         {
             ClassErrorHandle.ShowError(source, res, ErrorReturnHandler);
             oldres = res;
         }
         else
         {
             ClassErrorHandle.CheckAlarmListStatus(source, oldres);
             timer.StartTimer(5000);
             DoneReturn("LoadinFinish");
             ClassCommonSetting.SMLogInfo(this.owner.Name, this.Name, "上料结束:" + (ClassWorkFlow.Instance.GetCell).ToString());
         }
     }
 }
Esempio n. 5
0
 public override void DoneHandler(BaseClass sender, StateEventArgs e)
 {
     base.DoneHandler(sender, e);
     if (e.eventName == "SortingPNPPickFinish")
     {
         ClassWorkFlow.Instance.SortingPNPWorkSM.unsubscribeMeFromResponseEvents(this);
         DoneReturn("SortingPickFinish");
         isSortingPNPPicked = true;
         ClassCommonSetting.SMLogInfo(this.owner.Name, this.Name, "NG挑选取物料结束: " + parts);
         CheckNGSorting();
     }
 }
Esempio n. 6
0
 private void StartSorting()
 {
     ClassCommonSetting.SMLogInfo(this.owner.Name, this.Name, "执行StartSorting");
     if (ClassWorkFlow.Instance.SortingPNPWorkSM.IsRunning)
     {
         DoneReturn("WaitPNPFree");
     }
     else if (owner.IsRunning)
     {
         parts = ClassWorkZones.Instance.WorkZone下料传送.GetDataInfoString();
         ClassCommonSetting.SMLogInfo(this.owner.Name, this.Name, "NG挑选开始: " + parts);
         ClassWorkFlow.Instance.SortingPNPWorkSM.subscribeMeToResponseEvents(this);
         ClassWorkFlow.Instance.SortingPNPWorkSM.StartHandler(this, null);
     }
 }
Esempio n. 7
0
 public override void run(StateEventArgs inputEventArg)
 {
     lock (runLock)
     {
         base.run(inputEventArg);
         switch (inputEventArg.eventName)
         {
         case "TransPNPFinish":     //From state StartTransPNP
             parts = ClassWorkZones.Instance.WorkZone厚度测量.GetDataInfoString();
             ClassCommonSetting.SMLogInfo(this.owner.Name, this.Name, "厚度测量开始: " + parts);
             oldres = null;
             ErrorReturnHandler("厚度测量", "", ErrorDialogResult.Retry);
             break;
         }
     }
 }
Esempio n. 8
0
        public override void DoneHandler(BaseClass sender, StateEventArgs e)
        {
            base.DoneHandler(sender, e);
            switch (e.eventName)
            {
            case "CCDMotorBackToGetPart":
                DoneReturn("UnloadPickFinish");
                break;

            case "UnloadPNPPlaceFinish":
                UnloadPNPFinish = true;
                ClassWorkFlow.Instance.UnloadPNPWorkSM.unsubscribeMeFromResponseEvents(this);
                DoneReturn("UnloadPlaceFinish");
                ClassCommonSetting.SMLogInfo(this.owner.Name, this.Name, "下料机械手放物料结束: " + parts);
                break;
            }
        }
Esempio n. 9
0
        public override void DoneHandler(BaseClass sender, StateEventArgs e)
        {
            base.DoneHandler(sender, e);
            switch (e.eventName)
            {
            case "LoadPNPPlacePartFinish":
                DoneReturn("LoadPNPPlaceFinish");
                ClassCommonSetting.SMLogInfo(this.owner.Name, this.Name, "上料机械手放物料结束: " + parts);
                break;

            case "LoadPNPPlaceNGFinish":
                ClassWorkFlow.Instance.LoadPNPLoadSM.unsubscribeMeFromResponseEvents(this);
                ClassCommonSetting.SMLogInfo(this.owner.Name, this.Name, "上料机械手放物料结束 ");
                isRunning = false;
                break;
            }
        }
Esempio n. 10
0
        public override void DoneHandler(BaseClass sender, StateEventArgs e)
        {
            base.DoneHandler(sender, e);
            switch (e.eventName)
            {
            case "TransPNPPlaceFinish":
                ClassWorkFlow.Instance.TransPNPWorkSM.unsubscribeMeFromResponseEvents(this);
                //((CDIMainStateMachine)owner).EventTopAlignFinish = false;
                //((CDIMainStateMachine)owner).EventThichnessMeasFinish = false;
                ((CDIMainStateMachine)owner).EventUnloadPickFinish = !ClassWorkZones.Instance.WorkZone尺寸测量.HavePart();
                DoneReturn("TransPNPFinish");
                ClassCommonSetting.SMLogInfo(this.owner.Name, this.Name, "传送机械手放物料结束: " + parts);
                break;

            case "TransPNPPickFinish":
                DoneReturn("TransPNPPickFinish");
                ClassCommonSetting.SMLogInfo(this.owner.Name, this.Name, "传送机械手取物料结束: " + parts);
                break;
            }
        }
Esempio n. 11
0
        public override void run(StateEventArgs inputEventArg)
        {
            lock (runLock)
            {
                base.run(inputEventArg);
                switch (inputEventArg.eventName)
                {
                case "LoadPNPPlaceFinish":     //From state StartLoadPNP
                    parts = ClassWorkZones.Instance.WorkZone顶封边定位.GetDataInfoString();
                    ClassCommonSetting.SMLogInfo(this.owner.Name, this.Name, "顶峰定位开始: " + parts);
                    oldres = null;
                    ErrorReturnHandler("顶封边定位", "", ErrorDialogResult.Retry);
                    break;

                case "TransPNPPickFinish":     //From state StartTransPNP
                    ClassWorkZones.Instance.WorkZone顶封边定位.isTopAlignFree = true;
                    break;
                }
            }
        }
Esempio n. 12
0
 public override void run(StateEventArgs inputEventArg)
 {
     lock (runLock)
     {
         base.run(inputEventArg);
         //doneArgs.eventName = "CCDMeasFinish";
         switch (inputEventArg.eventName)
         {
         case "TransPNPFinish":     //From state StartTransPNP
             if (ClassWorkZones.Instance.WorkZone尺寸测量.HavePart())
             {
                 ClassWorkZones.Instance.WorkZone尺寸测量.IsWorkFree = false;
                 parts = ClassWorkZones.Instance.WorkZone尺寸测量.GetDataInfoString();
                 ClassCommonSetting.SMLogInfo(this.owner.Name, this.Name, "CCD尺寸测量开始: " + parts);
                 oldres = null;
                 ErrorReturnHandler("CCD测量", "", ErrorDialogResult.Retry);
             }
             break;
         }
     }
 }
Esempio n. 13
0
 private void CheckNGSorting()
 {
     if (isUnloadPNPPlaced && isSortingPNPPicked)
     {
         isUnloadPNPPlaced  = false;
         isSortingPNPPicked = false;
         while (!ClassWorkZones.Instance.WorkZone下料机械手.ThisInport(ClassZone下料机械手.EnumInportName.UnloadPNPCyUp).status)
         {
             Application.DoEvents();
         }
         ErrorInfoWithPause res = unloadoutzone.ActionStartShift(ClassWorkZones.Instance.AfterLoadOutShift);
         if (res != null)
         {
             ClassCommonSetting.SMLogInfo(this.owner.Name, this.Name, $"NG挑选: {res}");
             ClassErrorHandle.ShowError("NG挑选", res);
             return;
         }
         if (!ClassWorkFlow.Instance.IsGRR && ClassWorkFlow.Instance.WorkMode == EnumWorkMode.正常)
         {
             Statistic.GetProductInfo(DateTime.Now, unloadoutzone.GoolParts, unloadoutzone.NGParts);
         }
         if (unloadoutzone.NeedSorting)
         {
             StartSorting();
         }
         else
         {
             DoneReturn("SortingPickFinish");
             isSortingPNPPicked = true;
             ClassCommonSetting.SMLogInfo(this.owner.Name, this.Name, "NG挑选没有NG料: " + parts);
             CheckNGSorting();
         }
     }
     else if (!unloadoutzone.IsPlacingPart && unloadoutzone.UnloadOutDataStations[5].CellData == null && unloadoutzone.UnloadOutDataStations[4].CellData == null && unloadoutzone.UnloadOutDataStations[3].CellData == null)
     {
         unloadoutzone.AxisUnloadOutConveyor.SetZero();
         unloadoutzone.AxisUnloadOutConveyor.MoveTo(5 * ClassDataInfo.CELLPITCH);
         ClassWorkZones.Instance.AfterLoadOut();
     }
 }
Esempio n. 14
0
        public override void run(StateEventArgs inputEventArg)
        {
            lock (runLock)
            {
                base.run(inputEventArg);
                switch (inputEventArg.eventName)
                {
                case "TopAlignFinish":     //From state StartTopAlign
                    ((CDIMainStateMachine)owner).EventTopAlignFinish = true;
                    break;

                case "ThichnessMeasFinish":     //From state StartThicknessMeas
                    ((CDIMainStateMachine)owner).EventThichnessMeasFinish = true;
                    if (!ClassWorkFlow.Instance.FeedNewPart &&
                        !ClassWorkZones.Instance.WorkZone上料机械手.HavePart() &&
                        !ClassWorkZones.Instance.WorkZone顶封边定位.HavePart() &&
                        !ClassWorkZones.Instance.WorkZone上料传送.HavePart())
                    {
                        ((CDIMainStateMachine)owner).EventTopAlignFinish = true;
                    }
                    break;

                case "UnloadPickFinish":     //From state StartUnloadPNP
                    ((CDIMainStateMachine)owner).EventUnloadPickFinish = true;
                    break;
                }
                if (((CDIMainStateMachine)owner).EventTopAlignFinish && ((CDIMainStateMachine)owner).EventThichnessMeasFinish /* && ((CDIMainStateMachine)owner).EventUnloadPickFinish*/)
                {
                    if (!ClassWorkZones.Instance.WorkZone顶封边定位.HavePart() && !ClassWorkZones.Instance.WorkZone厚度测量.HavePart())
                    {
                        return;
                    }
                    ((CDIMainStateMachine)owner).EventTopAlignFinish      = false;
                    ((CDIMainStateMachine)owner).EventThichnessMeasFinish = false;
                    ClassCommonSetting.SMLogInfo(this.owner.Name, this.Name, "厚度测量和顶峰定位完成");
                    DoneReturn("CellWorkAllFinish");
                }
            }
        }
Esempio n. 15
0
 private void ErrorReturnHandler(string source, string message, ErrorDialogResult result)
 {
     if (!owner.IsRunning)
     {
         return;
     }
     if (result == ErrorDialogResult.OK || result == ErrorDialogResult.Retry)
     {
         ClassBaseWorkZone.HandleVacuumFailCell(source, ClassWorkZones.Instance.WorkZone尺寸测量.CCDMeasDataStations.ToArray());
         res = ClassWorkZones.Instance.WorkZone尺寸测量.ActionStartCCDMeas(DataComp.AddAll);
         if (res != null)
         {
             ClassErrorHandle.ShowError(source, res, ErrorReturnHandler);
             oldres = res;
         }
         else
         {
             ClassErrorHandle.CheckAlarmListStatus(source, oldres);
             DoneReturn("CCDMeasFinish");
             ClassCommonSetting.SMLogInfo(this.owner.Name, this.Name, "CCD尺寸测量流程结束: " + parts);
         }
     }
 }
Esempio n. 16
0
        public override void run(StateEventArgs inputEventArg)
        {
            lock (runLock)
            {
                //base.run(inputEventArg);
                switch (inputEventArg.eventName)
                {
                case "NewCellReady":     //From state CheckLoadIn
                    timer.StopTimer();
                    //Statistic.WFStatus = WorkFlowStatus.运行;
                    Statistic.GetWorkFlowStatus(DateTime.Now, WorkFlowStatus.运行, "开始上料");
                    if (ClassWorkFlow.Instance.FeedNewPart)
                    {
                        ClassCommonSetting.SMLogInfo(this.owner.Name, this.Name, "开始上料:" + (ClassWorkFlow.Instance.GetCell + 1).ToString());
                    }
                    else
                    {
                        ClassCommonSetting.SMLogInfo(this.owner.Name, this.Name, "开始上料:" + (ClassWorkFlow.Instance.GetCell).ToString());
                    }

                    ErrorInfoWithPause res = ClassWorkZones.Instance.WorkZone上料传送.ActionStartLoad(ClassWorkZones.Instance.AfterLoadInLoad);
                    if (res != null)
                    {
                        ClassErrorHandle.ShowError("上料传送带上料", res);
                        return;
                    }
                    if (ClassWorkZones.Instance.WorkZone上料传送.LoadInDataStations[ClassWorkZones.Instance.WorkZone上料传送.LoadInDataStations.Length - 2].CellData != null &&
                        ClassWorkZones.Instance.WorkZone上料传送.LoadInDataStations[ClassWorkZones.Instance.WorkZone上料传送.LoadInDataStations.Length - 2].CellData.Barcode == "")
                    {
                        Statistic.GetProductInfo(DateTime.Now, 1);
                    }
                    oldres = null;
                    ErrorReturnHandler("上料传送带上料", "", ErrorDialogResult.Retry);
                    break;
                }
            }
        }
Esempio n. 17
0
        public override void run(StateEventArgs inputEventArg)
        {
            lock (runLock)
            {
                base.run(inputEventArg);
                //doneArgs.eventName = "UnloadPNPFinish";
                //doneArgs.eventName = "UnloadPickFinish";
                switch (inputEventArg.eventName)
                {
                case "CCDMeasFinish":     //From state StartCCDMeas
                    EventCCDMeasFinish = true;
                    break;

                case "TransPNPMoveLeftFinish":
                    EventTransPNPMoveLeftFinish = true;
                    break;
                }
                if (EventCCDMeasFinish)
                {
                    if (!UnloadPNPFinish)
                    {
                        DoneReturn("WaitPNPFree");
                    }
                    else
                    {
                        EventCCDMeasFinish          = false;
                        EventTransPNPMoveLeftFinish = false;
                        UnloadPNPFinish             = false;
                        parts = ClassWorkZones.Instance.WorkZone尺寸测量.GetDataInfoString();
                        ClassCommonSetting.SMLogInfo(this.owner.Name, this.Name, "下料机械手开始取物料: " + parts);
                        ClassWorkFlow.Instance.UnloadPNPWorkSM.subscribeMeToResponseEvents(this);
                        ClassWorkFlow.Instance.UnloadPNPWorkSM.StartHandler(this, null);
                    }
                }
            }
        }