Пример #1
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());
         }
     }
 }
Пример #2
0
 private void NGBoxFullErrorHandler(string source, string message, ErrorDialogResult result)
 {
     if (result == ErrorDialogResult.OK)
     {
         bool BackNGBoxClean, FrontNGBoxClean;
         if (ClassWorkFlow.Instance.UnloadMode == EnumUnloadMode.全NG)
         {
             BackNGBoxClean  = ThisInport(EnumInportName.SortingPNPNGBoxFull1).status&& ThisInport(EnumInportName.SortingPNPNGBoxFull2).status;
             FrontNGBoxClean = ThisInport(EnumInportName.SortingPNPNGBoxFull3).status&& ThisInport(EnumInportName.SortingPNPNGBoxFull4).status;
         }
         else
         {
             BackNGBoxClean  = ThisInport(EnumInportName.SortingPNPNGBoxFull1).status || ThisInport(EnumInportName.SortingPNPNGBoxFull2).status;
             FrontNGBoxClean = ThisInport(EnumInportName.SortingPNPNGBoxFull3).status || ThisInport(EnumInportName.SortingPNPNGBoxFull4).status;
         }
         if (IsUseBackNGBox)
         {
             if (BackNGBoxClean)
             {
                 ClassErrorHandle.ShowError(source, "后下料NG料盒满。请移走NG料。", ErrorLevel.Notice, false, false, NGBoxFullErrorHandler);
             }
         }
         else
         {
             if (FrontNGBoxClean)
             {
                 ClassErrorHandle.ShowError(source, "前下料NG料盒满。请移走NG料。", ErrorLevel.Notice, false, false, NGBoxFullErrorHandler);
             }
         }
     }
 }
Пример #3
0
 private void ErrorReturnHandler(string source, string message, ErrorDialogResult result)
 {
     if (!owner.IsRunning)
     {
         return;
     }
     if (result == ErrorDialogResult.OK || result == ErrorDialogResult.Retry)
     {
         ClassZone传送机械手 TransZone = ClassWorkZones.Instance.WorkZone传送机械手;
         ClassBaseWorkZone.HandleVacuumFailCell("传送机械手上料", TransZone.TransLoadDataStations.ToArray());
         ClassBaseWorkZone.HandleVacuumFailCell("传送机械手下料", TransZone.TransUnloadDataStations.ToArray());
         //ClassWorkZones.Instance.WorkZone尺寸测量.ActionToGetPart();
         res = TransZone.ActionStartUnload(ClassWorkZones.Instance.DoTransPNPUnload, ClassWorkZones.Instance.AfterTransPNPUnload);
         if (res != null)
         {
             ClassErrorHandle.ShowError(source, res, ErrorReturnHandler);
             oldres = res;
         }
         else
         {
             ClassErrorHandle.CheckAlarmListStatus(source, oldres);
             DoneReturn("TransPNPPlaceFinish");
         }
     }
 }
Пример #4
0
 private void ErrorReturnHandler(string source, string message, ErrorDialogResult result)
 {
     if (result == ErrorDialogResult.OK || result == ErrorDialogResult.Retry)
     {
         if (optionBoxResultNG.Checked)
         {
             res = new ErrorInfoWithPause("Test error.", ErrorLevel.Alarm, true, false, ErrorReturnHandler);
         }
         else
         {
             res = null;
         }
         if (res != null)
         {
             ClassErrorHandle.ShowError(source, res, ErrorReturnHandler);
             oldres = res;
         }
         else
         {
             ClassErrorHandle.CheckAlarmListStatus(source, oldres);
         }
         BaseForm.DoInvokeRequired(listBox1, () =>
         {
             listBox1.Items.Clear();
             foreach (ErrorInfoWithPause err in ClassErrorHandle.ErrorList)
             {
                 listBox1.Items.Add(err.ToString());
             }
         });
     }
 }
Пример #5
0
        protected override void InPortDeActive(string inPort)
        {
            string err = "";

            switch ((EnumInportName)Enum.Parse(typeof(EnumInportName), inPort))
            {
            case EnumInportName.FrameAirPressSens:
                err = " 总气压";
                break;

            case EnumInportName.FrameVacuumSens:
                err = " 总真空";
                break;

            case EnumInportName.FrameDoorOpen:
                if (_safetyStatus != null)
                {
                    _safetyStatus(ThisInport(EnumInportName.FrameDoorOpen));
                }
                break;
            }
            if (err != "")
            {
                //ActionStopWorkFlow("GeneralAirError");
                if (_isRunning)
                {
                    //ActionPauseWorkFlow(WFContFrom.GeneralAirError);
                    ClassErrorHandle.ShowError("气路", "气路异常:" + err, ErrorLevel.Alarm, false, true);
                }
                else
                {
                    ClassErrorHandle.ShowError("气路", "设备异常:" + err, ErrorLevel.Error);
                }
            }
        }
Пример #6
0
 public override void run(StateEventArgs inputEventArg)
 {
     lock (runLock)
     {
         switch (inputEventArg.eventName)
         {
         case "UnloadPNPPickFinish":     //From state PickPart
         case "WaitUnloadOutEmpty":
             if (!ClassWorkZones.Instance.WorkZone下料传送.IsUnLoadHavePartEmpty)
             {
                 DoneReturn("WaitUnloadOutEmpty");
                 return;
             }
             base.run(inputEventArg);
             ClassZone下料机械手     UnloadZone = ClassWorkZones.Instance.WorkZone下料机械手;
             ErrorInfoWithPause res        = UnloadZone.ActionMove(ClassZone下料机械手.EnumPoint.Place);
             if (res != null)
             {
                 ClassErrorHandle.ShowError("下料PNP放料", res);
                 return;
             }
             ErrorReturnHandler("", "", ErrorDialogResult.OK);
             break;
         }
     }
 }
Пример #7
0
        public void DoReset()
        {
            ClassCommonSetting.ProgramLog(LogFile.Level.Debug, "WorkFlow", $"{Name}工作区域复位开始");
            ErrorInfoWithPause res = null;

            Reseting = true;
            lock (ResetLock)
            {
                ResetErr = new ClassErrorHandle();
                ClassCommonSetting.ProgramLog(LogFile.Level.Debug, "WorkFlow", $"{Name}工作区域所有端口复位");
                res = ResetOutPort();
                if (res != null)
                {
                    ClassErrorHandle.ShowError(this.Name, res);
                    return;
                }
                ClassCommonSetting.ProgramLog(LogFile.Level.Debug, "WorkFlow", $"{Name}工作区域所有电机上电");
                ServoOnAllMotor();
                Reset(ResetErr);
                if (ResetErr.NoError)
                {
                    _ioPublisher.notifyDoneEventSubscribers(this, new StateEventArgs("ResetDone", this.Name));
                }
                else
                {
                    _ioPublisher.notifyErrorEventSubscribers(this, new FailureException(ResetErr.ErrMessage));
                }
            }
            Reseting = false;
            ClassCommonSetting.ProgramLog(LogFile.Level.Debug, "WorkFlow", $"{Name}工作区域复位结束");
        }
Пример #8
0
 private void ErrorReturnHandler(string source, string message, ErrorDialogResult result)
 {
     if (!owner.IsRunning)
     {
         return;
     }
     if (result == ErrorDialogResult.OK || result == ErrorDialogResult.Retry)
     {
         if (message != "")
         {
             ClassBaseWorkZone.HandleVacuumFailCell(source, ClassWorkZones.Instance.WorkZone上料机械手.LoadPNPDataStations.ToArray());
             for (int i = 0; i < ClassBaseWorkZone.CELLCOUNT; i++)
             {
                 ClassWorkZones.Instance.WorkZone上料传送.LoadInDataStations[i].TransferFrom(ClassWorkZones.Instance.WorkZone上料机械手.LoadPNPDataStations[i]);
             }
         }
         res = ClassWorkZones.Instance.WorkZone上料机械手.ActionLoadPNPStartPick(ClassWorkZones.Instance.DoLoadInPNPPick, ClassWorkZones.Instance.AfterLoadInPNPPick);
         if (res != null)
         {
             ClassErrorHandle.ShowError(source, res, ErrorReturnHandler);
             oldres = res;
         }
         else
         {
             ClassErrorHandle.CheckAlarmListStatus(source, oldres);
             DoneReturn("LoadPNPPickPartFinish");
             ClassWorkZones.Instance.WorkZone上料机械手.isPicking = false;
         }
     }
 }
Пример #9
0
 private void ErrorReturnHandler(string source, string message, ErrorDialogResult result)
 {
     if (!owner.IsRunning)
     {
         return;
     }
     if (result == ErrorDialogResult.OK || result == ErrorDialogResult.Retry)
     {
         if (message != "")
         {
             ClassBaseWorkZone.HandleVacuumFailCell(source, sortingZone.SortNGDataStations.ToArray());
             for (int i = 0; i < ClassBaseWorkZone.CELLCOUNT; i++)
             {
                 if (ClassWorkZones.Instance.WorkZone下料传送.UnloadOutDataStations[i].CellData == null)
                 {
                     ClassWorkZones.Instance.WorkZone下料传送.UnloadOutDataStations[i].TransferFrom(sortingZone.SortNGDataStations[i]);
                 }
             }
         }
         res = sortingZone.ActionSortPNPStartPick(ClassWorkZones.Instance.DoSortPNPPick, ClassWorkZones.Instance.AfterSortPNPPick);
         if (res != null)
         {
             ClassErrorHandle.ShowError(source, res, ErrorReturnHandler);
             oldres = res;
         }
         else
         {
             ClassErrorHandle.CheckAlarmListStatus(source, oldres);
             DoneReturn("SortingPNPPickFinish");
         }
     }
 }
Пример #10
0
 private void ErrorReturnHandler(string source, string message, ErrorDialogResult result)
 {
     if (!owner.IsRunning)
     {
         return;
     }
     if (result == ErrorDialogResult.OK || result == ErrorDialogResult.Retry)
     {
         res = LoadZone.CheckNGBoxAvaliable();
         if (res == null)
         {
             res = LoadZone.ActionMove(ClassZone上料机械手.EnumPointY.PlaceNG);
             if (res != null)
             {
                 ClassErrorHandle.ShowError(source, res);
                 return;
             }
             res = LoadZone.ActionLoadPNPStartPlaceNG(ClassWorkZones.Instance.AfterLoadInPNPPlaceNG);
             if (res != null)
             {
                 ClassErrorHandle.ShowError(source, res);
                 return;
             }
             ClassErrorHandle.CheckAlarmListStatus(source, oldres);
             DoneReturn("LoadPNPPlaceNGFinish");
         }
         else
         {
             ClassErrorHandle.ShowError(source, res, ErrorReturnHandler);
             oldres = res;
         }
     }
 }
Пример #11
0
 private void ErrorReturnHandler(string source, string message, ErrorDialogResult result)
 {
     if (!owner.IsRunning)
     {
         return;
     }
     if (result == ErrorDialogResult.OK || result == ErrorDialogResult.Retry)
     {
         res = ClassWorkZones.Instance.WorkZoneNG挑选机械手.UpdateRow();
         if (res == null)
         {
             ClassBaseWorkZone.HandleVacuumFailCell(source, sortingZone.SortNGDataStations.ToArray());
             res = sortingZone.ActionSortPNPStartPlaceNG(ClassWorkZones.Instance.AfterSortPNPPlace);
             if (res != null)
             {
                 ClassErrorHandle.ShowError(source, res, ErrorReturnHandler);
                 oldres = res;
             }
             else
             {
                 ClassErrorHandle.CheckAlarmListStatus(source, oldres);
                 DoneReturn("SortingPNPPlaceNGFinish");
             }
         }
         else
         {
             ClassErrorHandle.ShowError(source, res, ErrorReturnHandler);
             oldres = res;
         }
     }
 }
Пример #12
0
 private void NGBoxFullErrorHandler(string source, string message, ErrorDialogResult result)
 {
     if (result == ErrorDialogResult.OK)
     {
         if (ThisInport(EnumInportName.LoadPNPNGBoxFull).status)
         {
             ClassErrorHandle.ShowError(this.Name, "上料NG盒满,请移走NG料后按OK。", ErrorLevel.Notice, false, false, NGBoxFullErrorHandler);
         }
     }
 }
Пример #13
0
        private void MotorMoveAsyncReturn(IAsyncResult result)
        {
            AsyncActionMotorMove handler = (AsyncActionMotorMove)((AsyncResult)result).AsyncDelegate;
            ErrorInfoWithPause   res     = handler.EndInvoke(result);

            if (res != null)
            {
                ClassErrorHandle.ShowError(this.Name, res);
            }
        }
Пример #14
0
 private void ErrorReturnHandler(string source, string message, ErrorDialogResult result)
 {
     if (!owner.IsRunning)
     {
         return;
     }
     if (result == ErrorDialogResult.OK || result == ErrorDialogResult.Retry)
     {
         bool           AllPick   = true;
         ClassZone传送机械手 TransZone = ClassWorkZones.Instance.WorkZone传送机械手;
         if (message != "")
         {
             ClassBaseWorkZone.HandleVacuumFailCell("传送机械手上料", TransZone.TransLoadDataStations.ToArray());
             ClassBaseWorkZone.HandleVacuumFailCell("传送机械手下料", TransZone.TransUnloadDataStations.ToArray());
             for (int i = 0; i < ClassBaseWorkZone.CELLCOUNT; i++)
             {
                 ClassWorkZones.Instance.WorkZone顶封边定位.TopAlignDataStations[i].TransferFrom(TransZone.TransLoadDataStations[i]);
                 ClassWorkZones.Instance.WorkZone厚度测量.ThicknessDataStations[i].TransferFrom(TransZone.TransUnloadDataStations[i]);
             }
         }
         res = TransZone.ActionStartLoad(out AllPick, ClassWorkZones.Instance.DoTransPNPLoad, ClassWorkZones.Instance.AfterTransPNPLoad);
         if (res == null)
         {
             if (!AllPick)
             {
                 res = new ErrorInfoWithPause("吸料后真空检测错误", ErrorLevel.Alarm, true);
                 ClassErrorHandle.ShowError(source, res, ErrorReturnHandler);
                 oldres = res;
             }
             else
             {
                 res = TransZone.ActionMove(ClassZone传送机械手.EnumPointPNPX.Unload);
                 if (res != null)
                 {
                     ClassErrorHandle.ShowError(source, res);
                 }
                 else
                 {
                     ClassErrorHandle.CheckAlarmListStatus(source, oldres);
                     DoneReturn("TransPNPPickFinish");
                 }
             }
         }
         else
         {
             ClassErrorHandle.ShowError(source, res, ErrorReturnHandler);
             oldres = res;
         }
     }
 }
Пример #15
0
        protected override void InPortActive(string inPort)
        {
            switch ((EnumInportName)Enum.Parse(typeof(EnumInportName), inPort))
            {
            case EnumInportName.LoadPNPNGBox:
                ClassErrorHandle.ShowError(inPort, "上料NG料盒被移走。移回NG盒后按OK。", ErrorLevel.Notice);
                DoUpdateNGBox();
                break;

            case EnumInportName.LoadPNPNGBoxFull:
                DoUpdateNGBox();
                break;
            }
        }
Пример #16
0
        /// <summary>
        /// 急停处理。
        /// 发送EStop系统事件。
        /// </summary>
        /// <returns>返回执行结果。成功返回空字符。</returns>
        public string DoEmergency()
        {
            ClassCommonSetting.ProgramLog(LogFile.Level.Info, "WorkFLow", "流程因急停停止");
            if (_isRunning)
            {
                ClassErrorHandle.ShowError(this.Name, "急停按钮按下,流程因急停停止", ErrorLevel.Alarm);
            }
            else
            {
                ClassErrorHandle.ShowError(this.Name, "急停按钮按下", ErrorLevel.Alarm);
            }

            CommonFunction.SysPublisher.notifyEStopEventSubscribers(this, new StateEventArgs("急停", ""));

            return("");
        }
Пример #17
0
 public override void StartHandler(BaseClass sender, StateEventArgs e)
 {
     ThisOutport(EnumOutportName.LoadInSMEMALoadAvailable).SetOutput(false);
     base.StartHandler(sender, e);
     if (ThisInport(EnumInportName.LoadInConvInPosRight).status || ThisInport(EnumInportName.LoadInConvInPosMid).status || ThisInport(EnumInportName.LoadInConvInPosLeft).status)
     {
         ClassErrorHandle.ShowError(this.Name, "传送带取料位置有物料需要移除。", ErrorLevel.Error);
     }
     else
     {
         for (int i = 0; i < LoadInDataStations.Length; i++)
         {
             LoadInDataStations[i].CellData = null;
         }
         ClassWorkFlow.Instance.GetCell = 0;
     }
 }
Пример #18
0
 public override void run(StateEventArgs inputEventArg)
 {
     lock (runLock)
     {
         switch (inputEventArg.eventName)
         {
         case "LoadPNPPickPartFinish":     //From state PickPart
         case "WaitTopAlignFree":
             if (inputEventArg.eventName == "LoadPNPPickPartFinish")
             {
                 if (ClassWorkZones.Instance.WorkZone上料机械手.AllNG)
                 {
                     DoneReturn("AllNG");
                     return;
                 }
                 else
                 {
                     while (!ClassWorkZones.Instance.WorkZone上料机械手.AxisLoadPNPY.MoveTo(ClassZone上料机械手.EnumPointY.Buffer, false))
                     {
                         if (ClassWorkZones.Instance.WorkZone上料机械手.DispMotionError(ClassWorkZones.Instance.WorkZone上料机械手.AxisLoadPNPY, ClassZone上料机械手.EnumPointY.Buffer) != null)
                         {
                             return;
                         }
                     }
                 }
             }
             if (!ClassWorkZones.Instance.WorkZone顶封边定位.isTopAlignFree)
             {
                 DoneReturn("WaitTopAlignFree");
             }
             else
             {
                 base.run(inputEventArg);
                 ErrorInfoWithPause res = ClassWorkZones.Instance.WorkZone上料机械手.ActionMove(ClassZone上料机械手.EnumPointY.Place);
                 if (res != null)
                 {
                     ClassErrorHandle.ShowError("上料PNP放料", res);
                     return;
                 }
                 oldres = null;
                 ErrorReturnHandler("上料PNP放料", "", ErrorDialogResult.Retry);
             }
             break;
         }
     }
 }
Пример #19
0
 public override void DoneHandler(BaseClass sender, StateEventArgs e)
 {
     base.DoneHandler(sender, e);
     ClassWorkFlow.Instance.IsGRR = false;
     ClassWorkZones.Instance.WorkZone外框架.ActionStopWorkFlow(WFContFrom.GRR);
     ClassWorkFlow.Instance.UnloadMode = oldunloadmode;
     ClassWorkFlow.Instance.CDIMainSM.unsubscribeMeFromResponseEvents(this);
     if (Count < 9)
     {
         ClassErrorHandle.ShowError("GRR", $"GRR第{Count}次测量已经完成。", ErrorLevel.Notice);
     }
     else
     {
         AfterGRRTest();
     }
     ClassWorkZones.Instance.WorkZone上料传送.BarcodeEnabled = true;
     ClassWorkZones.Instance.WorkZone上料传送.GRRStartOffset = -1;
 }
Пример #20
0
 /// <summary>
 /// 流程因错误暂停(警告级别错误)。问题处理完后可恢复流程。流程没有运行或恢复流程,返回null。流程停止则返回错误。
 /// </summary>
 /// <param name="source">错误来源</param>
 /// <param name="error">错误信息</param>
 /// <returns></returns>
 public ErrorInfoWithPause WaitAlarmPause(string source, string error)
 {
     if (!_isRunning)
     {
         return(new ErrorInfoWithPause("错误:" + error + "。", ErrorLevel.Notice));
     }
     ClassErrorHandle.ShowError(source, error + "。处理完成按开始恢复运行。", ErrorLevel.Alarm, false, true);
     _isPausing = true;
     while (_isPausing)
     {
         Application.DoEvents();
         if (!_isRunning)
         {
             return(new ErrorInfoWithPause("流程停止(" + error + ")。", ErrorLevel.Notice));
         }
     }
     return(null);
 }
Пример #21
0
        /// <summary>
        /// 开始工作流程。
        /// 发送Start系统事件。
        /// </summary>
        /// <param name="FromThis">执行源</param>
        /// <returns>返回执行结果。成功返回空字符。</returns>
        public string ActionStartWorkFlow(WFContFrom FromThis)
        {
            if (ThisInport(EnumInportName.FrameDoorOpen).status /* && ClassWorkFlow.Instance.DebugMode == WFDebugMode.Auto*/)
            {
                ClassErrorHandle.ShowError(this.Name, "不能启动或恢复流程运行:外框门被打开。", ErrorLevel.Alarm);
                return("DoorOpen");
            }
            if (ClassCommonSetting.SysParam.CurrentProduct == CALIBPROD)
            {
                BaseForm.DoInvokeRequired(MainForm.instance, () => MessageBox.Show(MainForm.instance, "当前产品“calibration”是用于标定的虚拟产品,不能启动生产流程。"));
                return("WrongProduct");
            }
            ErrorInfoWithPause err = CheckGeneralAir();

            if (err != null)
            {
                return(err.Message);
            }
            if (ErrorCount > 0)
            {
                BaseForm.DoInvokeRequired(MainForm.instance, () => MessageBox.Show(MainForm.instance, "启动生产流程之前,所有错误和提示必须全部处理完成!"));
                return("ErrorNotHandle");
            }
            bool CanStart = false;

            BaseForm.DoInvokeRequired(MainForm.instance, () =>
                                      CanStart = MessageBox.Show(MainForm.instance, "启动生产流程之前,需手动检查并清除设备内(包括NG盒和可能的掉料)所有物料并确认。确认后按“确定”按钮,否则按“取消”按钮。", "启动流程", MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation) == DialogResult.OK);
            if (!CanStart)
            {
                return("NotClear");
            }
            string res = ActionSystemReset();

            if (res == "")
            {
                ClassWorkFlow.Instance.IsGRR = FromThis == WFContFrom.GRR;// true;
                CommonFunction.SysPublisher.notifyStartEventSubscribers(this, new StateEventArgs("启动", "来自" + FromThis.ToString()));
            }
            else
            {
                ClassErrorHandle.ShowError("系统复位", res, ErrorLevel.Error);
            }
            return(res);
        }
Пример #22
0
        protected string StartSerialReading(EnumCellIndex index, HardwareSerialProtocolName protocol, DataComp NeedComp)
        {
            string Data = "";
            int    i    = (int)index;

            ReadDone[i] = false;
            string res = StartSerialReading(SerialPort[i], HardwareSerialProtocolName.ThicknessRead, ref Data);

            if (res != "")
            {
                ClassErrorHandle.ShowError("读取测厚数据", String.Format("读取{0}测量数据出错:{1}", index, res), ErrorLevel.Error);
            }
            else
            {
                GetData(index, Data, NeedComp);
                ReadDone[i] = true;
            }
            ReadDone[i] = true;
            return(res);
        }
Пример #23
0
 public override void run(StateEventArgs inputEventArg)
 {
     lock (runLock)
     {
         base.run(inputEventArg);
         //doneArgs.eventName = "Unload";
         switch (inputEventArg.eventName)
         {
         case "ReadyUnload":
             ErrorInfoWithPause res = ClassWorkZones.Instance.WorkZone下料传送.ActionStartUnload(ClassWorkZones.Instance.AfterLoadOut);
             if (res != null)
             {
                 ClassErrorHandle.ShowError("下料传送带下料", res);
                 return;
             }
             DoneReturn("Unload");
             break;
         }
     }
 }
Пример #24
0
 public override void run(StateEventArgs inputEventArg)
 {
     lock (runLock)
     {
         base.run(inputEventArg);
         switch (inputEventArg.eventName)
         {
         case "Start":     //From state Idle
             ErrorInfoWithPause res = sortingZone.ActionMove(ClassZoneNG挑选机械手.EnumPointPNPY.Pick);
             if (res != null)
             {
                 ClassErrorHandle.ShowError("NG挑选PNP取料", res);
                 return;
             }
             oldres = null;
             ErrorReturnHandler("NG挑选PNP取料", "", ErrorDialogResult.Retry);
             break;
         }
     }
 }
Пример #25
0
 public override void run(StateEventArgs inputEventArg)
 {
     lock (runLock)
     {
         base.run(inputEventArg);
         switch (inputEventArg.eventName)
         {
         case "Start":     //From state Idle
             ClassWorkZones.Instance.WorkZone上料机械手.isPicking = true;
             ErrorInfoWithPause res = ClassWorkZones.Instance.WorkZone上料机械手.ActionMove(ClassZone上料机械手.EnumPointY.Pick);
             if (res != null)
             {
                 ClassErrorHandle.ShowError("上料PNP取料", res);
                 return;
             }
             oldres = null;
             ErrorReturnHandler("上料PNP取料", "", ErrorDialogResult.Retry);
             break;
         }
     }
 }
Пример #26
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();
     }
 }
Пример #27
0
        protected override void InPortActive(string inPort)
        {
            switch ((EnumInportName)Enum.Parse(typeof(EnumInportName), inPort))
            {
            case EnumInportName.SortingPNPNGBoxBack:
                ClassErrorHandle.ShowError(this.Name, "后下料NG料盒被移走。移回NG盒后按OK。", ErrorLevel.Notice);
                DoUpdateNGBox();
                break;

            case EnumInportName.SortingPNPNGBoxFront:
                ClassErrorHandle.ShowError(this.Name, "前下料NG料盒被移走。移回NG盒后按OK。", ErrorLevel.Notice);
                DoUpdateNGBox();
                break;

            case EnumInportName.SortingPNPNGBoxFull1:
            case EnumInportName.SortingPNPNGBoxFull2:
            case EnumInportName.SortingPNPNGBoxFull3:
            case EnumInportName.SortingPNPNGBoxFull4:
                DoUpdateNGBox();
                break;
            }
        }
Пример #28
0
 public bool CheckBeforeStart()
 {
     if (ThisInport(EnumInportName.FrameButtonEmergency).status || ThisInport(EnumInportName.FrameButtonEmergency2).status)
     {
         ClassErrorHandle.ShowError(this.Name, "急停按钮没有松开。", ErrorLevel.Error);
         return(false);
     }
     //foreach (HardwareAxisName name in Enum.GetValues(typeof(HardwareAxisName)))
     //    if (!SystemHardware.instance.GetAxis(name).ServoOn)
     //        axisOff += name.ToString() + ", ";
     //if (axisOff != "")
     //{
     //    ClassErrorInfo.ShowError(this.Name, "有电机掉电: " + axisOff, ErrorLevel.Error);
     //    return false;
     //}
     //if (ThisInport(EnumInportName.FrameDoorOpen).status)
     //{
     //    ClassErrorInfo.ShowError(this.Name, "外框门被打开。", ErrorLevel.Error);
     //    return false;
     //}
     return(true);
 }
Пример #29
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);
         }
     }
 }
Пример #30
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上料机械手.LoadPNPDataStations.ToArray());
         res = ClassWorkZones.Instance.WorkZone上料机械手.ActionLoadPNPStartPlace(ClassWorkZones.Instance.DoLoadInPNPPlace, ClassWorkZones.Instance.AfterLoadInPNPPlace);
         if (res != null)
         {
             ClassErrorHandle.ShowError(source, res, ErrorReturnHandler);
             oldres = res;
         }
         else
         {
             ClassErrorHandle.CheckAlarmListStatus(source, oldres);
             DoneReturn("LoadPNPPlacePartFinish");
             ClassWorkZones.Instance.WorkZone顶封边定位.isTopAlignFree = false;
         }
     }
 }