private void btSaveCurZ_Click(object sender, RoutedEventArgs e)
        {
            if (MessageBox.Show("是否确认保存当前位置Z", "确认信息", MessageBoxButton.OKCancel) == MessageBoxResult.OK)
            {
                StationDataMngr.instance.PlacePos_L[WinRobotCalib.GetWinInst.GetCurSt() - 1].DblValue3 = PosCur.DblValue3;
                StationDataMngr.instance.WriteIniPlacePos(WinRobotCalib.GetWinInst.GetCurSt());
                LogicRobot.L_I.WriteRobotCMD(PCToRbt.PRP_FinishTeachZ);
                BaseDealComprehensiveResult.ShowState("PC->Rbt,示教Z结束");
                WinRobotCalib.GetWinInst.EnableRb(true);
                this.Dispatcher.Invoke(new Action(() =>
                {
                    EnableDriveButton(false);
                    AddStInfo();
                    dgStInfo.Items.Refresh();
                    this.Dispatcher.Invoke(new Action(() =>
                    {
                        btSaveCurXY.IsEnabled    = false;
                        btSaveCurZ.IsEnabled     = false;
                        btStartTeachXY.IsEnabled = true;
                        btStartTeachZ.IsEnabled  = true;

                        EnableDriveButton(false);
                    }));
                }));
                blTeachZ = false;
            }
        }
        /// <summary>
        /// 初始化控件和参数
        /// </summary>
        public override void Init_TrrigerDealResult()
        {
            try
            {
                BaseDealComprehensiveResult[] baseDealComprehensiveResults = new BaseDealComprehensiveResult[12] {
                    DealComprehensiveResult1.D_I,
                    DealComprehensiveResult2.D_I,
                    DealComprehensiveResult3.D_I,
                    DealComprehensiveResult4.D_I,
                    DealComprehensiveResult5.D_I,
                    DealComprehensiveResult6.D_I,
                    DealComprehensiveResult7.D_I,
                    DealComprehensiveResult8.D_I,

                    DealComprehensiveResult9.D_I,
                    DealComprehensiveResult10.D_I,
                    DealComprehensiveResult11.D_I,
                    DealComprehensiveResult12.D_I
                };

                //初始化
                base.Init_TrrigerDealResult(baseDealComprehensiveResults);
            }
            catch (Exception ex)
            {
                Log.L_I.WriteError(NameClass, ex);
            }
        }
 private void btStartTeachZ_Click(object sender, RoutedEventArgs e)
 {
     if (WinRobotCalib.GetWinInst.GetCurSt() < 0)
     {
         return;
     }
     if (MessageBox.Show("请确认是否示教Z_工位:" + WinRobotCalib.GetWinInst.GetCurStName(), "确认信息", MessageBoxButton.OKCancel) == MessageBoxResult.OK)
     {
         if (MessageBox.Show("请确认是否安装了示教针!", "确认信息", MessageBoxButton.OKCancel) == MessageBoxResult.OK)
         {
             if (MessageBox.Show("请确认机台内没有人员!", "确认信息", MessageBoxButton.OKCancel) == MessageBoxResult.OK)
             {
                 WinRobotCalib.GetWinInst.EnableRb(false);
                 LogicRobot.L_I.WriteRobotCMD(new Point4D(WinRobotCalib.GetWinInst.GetCurSt(), 0, 0, 0), PCToRbt.PRP_StartTeachZ);
                 BaseDealComprehensiveResult.ShowState("PC->Rbt,开始示教Z_" + WinRobotCalib.GetWinInst.GetCurSt());
                 blTeachZ = true;
                 this.Dispatcher.Invoke(new Action(() =>
                 {
                     btStartTeachXY.IsEnabled = false;
                     btStartTeachZ.IsEnabled  = false;
                 }));
             }
         }
     }
 }
 /// <summary>
 /// 保留触发8
 /// </summary>
 /// <param name="trrigerSource_e"></param>
 /// <param name="i"></param>
 void LogicPLC_Inst_Reserve8_event(TriggerSource_enum trrigerSource_e, int i)
 {
     try
     {
         TransPlatCode(RegeditMain.R_I.CodeArm);
         BaseDealComprehensiveResult.Init();
     }
     catch (Exception ex)
     {
         Log.L_I.WriteError("MainWindow", ex);
     }
 }
Exemple #5
0
        public void Init(UCStateWork uCStateWork)
        {
            try
            {
                g_UCStateWork = uCStateWork;
                g_NoCamera    = int.Parse(this.Tag.ToString());
                switch (g_NoCamera)
                {
                case 1:
                    g_BaseDealComprehensiveResult = DealComprehensiveResult1.D_I;
                    break;

                case 2:
                    g_BaseDealComprehensiveResult = DealComprehensiveResult2.D_I;
                    break;

                case 3:
                    g_BaseDealComprehensiveResult = DealComprehensiveResult3.D_I;
                    break;

                case 4:
                    g_BaseDealComprehensiveResult = DealComprehensiveResult4.D_I;
                    break;

                case 5:
                    g_BaseDealComprehensiveResult = DealComprehensiveResult5.D_I;
                    break;

                case 6:
                    g_BaseDealComprehensiveResult = DealComprehensiveResult6.D_I;
                    break;

                case 7:
                    g_BaseDealComprehensiveResult = DealComprehensiveResult7.D_I;
                    break;

                case 8:
                    g_BaseDealComprehensiveResult = DealComprehensiveResult8.D_I;
                    break;
                }
                base.g_UCDisplayCamera = g_BaseDealComprehensiveResult.g_UCDisplayCamera;
                InitCobPos();//初始化所有的拍照位置
                ShowPar_Invoke();
            }
            catch (Exception ex)
            {
                Log.L_I.WriteError(NameClass, ex);
            }
        }
        /// <summary>
        /// 相机综合设置Main_EX
        /// </summary>
        /// <param name="noCamera"></param>
        /// <returns></returns>
        public override BaseDealComprehensiveResult GetDealComprehensiveResult(int noCamera)
        {
            try
            {
                BaseDealComprehensiveResult baseDealComprehensive = null;
                switch (noCamera)
                {
                case 1:
                    baseDealComprehensive = DealComprehensiveResult1.D_I;
                    break;

                case 2:
                    baseDealComprehensive = DealComprehensiveResult2.D_I;
                    break;

                case 3:
                    baseDealComprehensive = DealComprehensiveResult3.D_I;
                    break;

                case 4:
                    baseDealComprehensive = DealComprehensiveResult4.D_I;
                    break;

                case 5:
                    baseDealComprehensive = DealComprehensiveResult5.D_I;
                    break;

                case 6:
                    baseDealComprehensive = DealComprehensiveResult6.D_I;
                    break;

                case 7:
                    baseDealComprehensive = DealComprehensiveResult7.D_I;
                    break;

                case 8:
                    baseDealComprehensive = DealComprehensiveResult8.D_I;
                    break;
                }
                return(baseDealComprehensive);
            }
            catch (Exception ex)
            {
                Log.L_I.WriteError(NameClass, ex);
                return(null);
            }
        }
Exemple #7
0
        /// <summary>
        /// 调用手动模拟运行
        /// </summary>
        public override void TriggerPC()
        {
            try
            {
                bool blNew = false;

                if (ParCameraWork.NumCamera > 4)
                {
                    WinTrrigerComprehensive win = WinTrrigerComprehensive.GetWinInst(out blNew);
                    if (blNew)
                    {
                        BaseDealComprehensiveResult[] baseDealComprehensiveResult = new BaseDealComprehensiveResult[8] {
                            DealComprehensiveResult1.D_I,
                            DealComprehensiveResult2.D_I,
                            DealComprehensiveResult3.D_I,
                            DealComprehensiveResult4.D_I,
                            DealComprehensiveResult5.D_I,
                            DealComprehensiveResult6.D_I,
                            DealComprehensiveResult7.D_I,
                            DealComprehensiveResult8.D_I
                        };
                        win.Init(g_UCStateWork, baseDealComprehensiveResult);
                    }
                    win.Show();
                }
                else
                {
                    WinTrrigerComprehensiveSmall win = WinTrrigerComprehensiveSmall.GetWinInst(out blNew);
                    if (blNew)
                    {
                        BaseDealComprehensiveResult[] baseDealComprehensiveResult = new BaseDealComprehensiveResult[4] {
                            DealComprehensiveResult1.D_I,
                            DealComprehensiveResult2.D_I,
                            DealComprehensiveResult3.D_I,
                            DealComprehensiveResult4.D_I,
                        };
                        win.Init(g_UCStateWork, baseDealComprehensiveResult);
                    }
                    win.Show();
                }
            }
            catch (Exception ex)
            {
                Log.L_I.WriteError(NameClass, ex);
            }
        }
        /// <summary>
        /// 保留触发5
        /// </summary>
        /// <param name="trrigerSource_e"></param>
        /// <param name="i"></param>
        void LogicPLC_Inst_Reserve5_event(TriggerSource_enum trrigerSource_e, int i)
        {
            try
            {
                ShowState("PLC通知所有检测结束");
                BaseDealComprehensiveResult.CommunicateInspResult();
                if (ModelParams.IfSegmentDelImage)
                {
                    Log.L_I.WriteError("DELIMAGE", DealComprehensiveResult1.D_I.BasePathImageSave);
                    DeleteFilesOneByOnce(DealComprehensiveResult1.D_I.BasePathImageSave
                                         , ModelParams.RetentionTime);
                    //DeleteFilesOneByOnce(@"E:\Image\NGImage\", 10);
                }

                if (ModelParams.IfPostInsp)
                {
                    UploadInsp(RegeditMain.R_I.CodePlat);
                }
            }
            catch (Exception ex)
            {
                Log.L_I.WriteError("MainWindow", ex);
            }
        }
Exemple #9
0
        /// <summary>
        /// 调用手动模拟运行
        /// </summary>
        public override void TriggerPC()
        {
            try
            {
                bool blNew = false;

                if (ParCameraWork.NumCamera > 4 && ParCameraWork.NumCamera < 9)
                {
                    WinTrrigerComprehensive win = WinTrrigerComprehensive.GetWinInst(out blNew);
                    if (blNew)
                    {
                        BaseDealComprehensiveResult[] baseDealComprehensiveResult = new BaseDealComprehensiveResult[8] {
                            DealComprehensiveResult1.D_I,
                            DealComprehensiveResult2.D_I,
                            DealComprehensiveResult3.D_I,
                            DealComprehensiveResult4.D_I,
                            DealComprehensiveResult5.D_I,
                            DealComprehensiveResult6.D_I,
                            DealComprehensiveResult7.D_I,
                            DealComprehensiveResult8.D_I
                        };
                        win.Init(g_UCStateWork, baseDealComprehensiveResult);

                        #region 注册事件
                        win.Camera1_event += new TrrigerSourceAction_del(DealComprehensive_Camera1_event);
                        win.Camera2_event += new TrrigerSourceAction_del(DealComprehensive_Camera2_event);
                        win.Camera3_event += new TrrigerSourceAction_del(DealComprehensive_Camera3_event);
                        win.Camera4_event += new TrrigerSourceAction_del(DealComprehensive_Camera4_event);
                        win.Camera5_event += new TrrigerSourceAction_del(DealComprehensive_Camera5_event);
                        win.Camera6_event += new TrrigerSourceAction_del(DealComprehensive_Camera6_event);
                        win.Camera7_event += new TrrigerSourceAction_del(DealComprehensive_Camera7_event);
                        win.Camera8_event += new TrrigerSourceAction_del(DealComprehensive_Camera8_event);

                        //包含Index
                        win.Camera1_index_event += new TrrigerSourceIntAction_del(DealComprehensive_Camera1_event);
                        win.Camera2_index_event += new TrrigerSourceIntAction_del(DealComprehensive_Camera2_event);
                        win.Camera3_index_event += new TrrigerSourceIntAction_del(DealComprehensive_Camera3_event);
                        win.Camera4_index_event += new TrrigerSourceIntAction_del(DealComprehensive_Camera4_event);
                        win.Camera5_index_event += new TrrigerSourceIntAction_del(DealComprehensive_Camera5_event);
                        win.Camera6_index_event += new TrrigerSourceIntAction_del(DealComprehensive_Camera6_event);
                        win.Camera7_index_event += new TrrigerSourceIntAction_del(DealComprehensive_Camera7_event);
                        win.Camera8_index_event += new TrrigerSourceIntAction_del(DealComprehensive_Camera8_event);
                        #endregion 注册事件
                    }
                    win.Show();
                }
                else if (ParCameraWork.NumCamera < 9)
                {
                    WinTrrigerComprehensiveSmall win = WinTrrigerComprehensiveSmall.GetWinInst(out blNew);
                    if (blNew)
                    {
                        BaseDealComprehensiveResult[] baseDealComprehensiveResult = new BaseDealComprehensiveResult[4] {
                            DealComprehensiveResult1.D_I,
                            DealComprehensiveResult2.D_I,
                            DealComprehensiveResult3.D_I,
                            DealComprehensiveResult4.D_I,
                        };
                        win.Init(g_UCStateWork, baseDealComprehensiveResult);

                        #region 注册事件
                        win.Camera1_event += new TrrigerSourceAction_del(DealComprehensive_Camera1_event);
                        win.Camera2_event += new TrrigerSourceAction_del(DealComprehensive_Camera2_event);
                        win.Camera3_event += new TrrigerSourceAction_del(DealComprehensive_Camera3_event);
                        win.Camera4_event += new TrrigerSourceAction_del(DealComprehensive_Camera4_event);

                        //包含Index
                        win.Camera1_index_event += new TrrigerSourceIntAction_del(DealComprehensive_Camera1_event);
                        win.Camera2_index_event += new TrrigerSourceIntAction_del(DealComprehensive_Camera2_event);
                        win.Camera3_index_event += new TrrigerSourceIntAction_del(DealComprehensive_Camera3_event);
                        win.Camera4_index_event += new TrrigerSourceIntAction_del(DealComprehensive_Camera4_event);
                        #endregion 注册事件
                    }
                    win.Show();
                }
                else
                {
                    WinTrrigerComprehensiveFull win = WinTrrigerComprehensiveFull.GetWinInst(out blNew);
                    if (blNew)
                    {
                        BaseDealComprehensiveResult[] baseDealComprehensiveResult = new BaseDealComprehensiveResult[12] {
                            DealComprehensiveResult1.D_I,
                            DealComprehensiveResult2.D_I,
                            DealComprehensiveResult3.D_I,
                            DealComprehensiveResult4.D_I,
                            DealComprehensiveResult5.D_I,
                            DealComprehensiveResult6.D_I,
                            DealComprehensiveResult7.D_I,
                            DealComprehensiveResult8.D_I,

                            DealComprehensiveResult9.D_I,
                            DealComprehensiveResult10.D_I,
                            DealComprehensiveResult11.D_I,
                            DealComprehensiveResult12.D_I,
                        };
                        win.Init(g_UCStateWork, baseDealComprehensiveResult);
                    }
                    win.Show();
                }
            }
            catch (Exception ex)
            {
                Log.L_I.WriteError(NameClass, ex);
            }
        }