Пример #1
0
        private void BT_Cs8c_Click(object sender, EventArgs e)
        {
            if (CBE_RecipeName.EditValue.ToString() == "")
            {
                MessageBox.Show("无产品");
                return;
            }



            if (TxtData.SoapData.InterfaceType != 9)
            {
                MessageBox.Show("下位机请切换到主界面!");
                return;
            }

            if (TxtData.SoapData.ToolMode != 1)
            {
                MessageBox.Show("请切换到手动模式!");
                return;
            }


            TxtData.PublicData.ErrorCode = 0;
            System.Threading.ThreadPool.QueueUserWorkItem(new WaitCallback(Poll));
            Frm_Wait frm = new Frm_Wait(CBE_RecipeName.EditValue.ToString());

            frm.ShowDialog();
            CBE_RecipeName_TextChanged(this, null);
        }
Пример #2
0
        private void BT_MatLab_Click(object sender, EventArgs e)
        {
            if (gv.RowCount == 0)
            {
                MessageBox.Show("没有路径");
                return;
            }
            if (CBE_RecipeName.EditValue.ToString() == "" || Frame == null)
            {
                MessageBox.Show("请先建立产品");
                return;
            }
            if ((FileName = PublicFunc.OpenDir_Show()) == null)
            {
                return;
            }



            TxtData.PublicData.ErrorCode = 0;
            TxtData.PublicData.ErrorLine = 0;
            OperIndex = 5;
            System.Threading.ThreadPool.QueueUserWorkItem(new WaitCallback(PollImport));
            Frm_Wait frM = new Frm_Wait(CBE_RecipeName.EditValue.ToString(), false);

            frM.ShowDialog();
            ViewPoint(GC_Cut, GV_Cut, db.GetDV_Trajpos(TrajName));
        }
Пример #3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void BT_Download_Click(object sender, EventArgs e)
        {
            if (!TxtData.SoapData.IsHome)
            {
                MessageBox.Show("机械手臂请先回零!");
                return;
            }

            if (TxtData.SoapData.InterfaceType != 9)
            {
                MessageBox.Show("下位机请切换到主界面!");
                return;
            }

            if (TxtData.SoapData.ToolMode != 4)
            {
                MessageBox.Show("请切换到远程模式!");
                return;
            }


            if (!TxtData.SoapData.PowerOn)
            {
                MessageBox.Show("请先上电!");
                return;
            }



            TxtData.PublicData.ErrorCode = 0;
            System.Threading.ThreadPool.QueueUserWorkItem(new WaitCallback(Poll));
            Frm_Wait frm = new Frm_Wait();

            frm.ShowDialog();
        }
Пример #4
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void BT_Download_Click(object sender, EventArgs e)
        {
            if (!TxtData.SoapData.IsHome)
            {
                MessageBox.Show("机械手臂请先回零!");
                return;
            }

            if (TxtData.SoapData.InterfaceType != 9)
            {
                MessageBox.Show("下位机请切换到主界面!");
                return;
            }

            if (TxtData.SoapData.ToolMode != 4)
            {
                MessageBox.Show("请切换到远程模式!");
                return;
            }

            if (!TxtData.SoapData.PowerOn)
            {
                MessageBox.Show("请先上电!");
                return;
            }

            TxtData.PublicData.ErrorCode = 0;
            System.Threading.ThreadPool.QueueUserWorkItem(new WaitCallback(Poll));
            Frm_Wait frm = new Frm_Wait();
            frm.ShowDialog();
        }
Пример #5
0
        private void BT_Download_Click(object sender, EventArgs e)
        {
            if (!TxtData.SoapData.IsHome)
            {
                MessageBox.Show("机械手臂请先回零!");
                return;
            }

            if (TxtData.SoapData.InterfaceType != 9)
            {
                MessageBox.Show("下位机请切换到主界面!");
                return;
            }

            if (TxtData.SoapData.ToolMode != 4)
            {
                MessageBox.Show("请切换到远程模式!");
                return;
            }


            if (!TxtData.SoapData.PowerOn)
            {
                MessageBox.Show("请先上电!");
                return;
            }
            if (NUD_Press.Value < 0 || NUD_Rel.Value < 0 || NUD_Rot.Value < 0 || NUD_Speed.Value < 0 || ND_Z.Value < 0)
            {
                MessageBox.Show("生成设置的参数不能为0!");
                return;
            }

            if (Frame == null || Frame == new  double[] { 0, 0, 0, 0, 0, 0 })
            {
                if (MessageBox.Show(
                        "产品坐标系都是零,是否继续下载?", "产品坐标系为零", MessageBoxButtons.YesNo) == DialogResult.No)
                {
                    return;
                }
            }

            //if (offse== null || Frame == new double[] { 0, 0, 0, 0, 0, 0 })
            //{
            //    if (MessageBox.Show(
            //        "产品坐标系都是零,是否继续下载?", "产品坐标系为零", MessageBoxButtons.YesNo) == DialogResult.No)
            //    {
            //        return;
            //    }


            //}

            TxtData.PublicData.ErrorCode = 0;
            System.Threading.ThreadPool.QueueUserWorkItem(new WaitCallback(Poll));
            Frm_Wait frm = new Frm_Wait();

            frm.ShowDialog();
        }
Пример #6
0
 private void BT_Edit_Click(object sender, EventArgs e)
 {
     if (MessageBox.Show("确定需要全部清空吗?", "警告", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
     {
         return;
     }
     TxtData.PublicData.ErrorCode = 0;
     System.Threading.ThreadPool.QueueUserWorkItem(new WaitCallback(PollImport));
     Frm_Wait frm = new Frm_Wait();
     frm.ShowDialog();
     Frm_PCAlarm_Load(this,null);
 }
Пример #7
0
        private void BT_Edit_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("确定需要全部清空吗?", "警告", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
            {
                return;
            }
            TxtData.PublicData.ErrorCode = 0;
            System.Threading.ThreadPool.QueueUserWorkItem(new WaitCallback(PollImport));
            Frm_Wait frm = new Frm_Wait();

            frm.ShowDialog();
            Frm_PCAlarm_Load(this, null);
        }
Пример #8
0
        private void BT_OutPort_Click(object sender, EventArgs e)
        {
            if ((FileName = PublicFunc.SfD_Show()) == null)
            {
                return;
            }
            TxtData.PublicData.ErrorCode = 0;

            System.Threading.ThreadPool.QueueUserWorkItem(new WaitCallback(PollOutport));
            Frm_Wait frm = new Frm_Wait("", false);

            frm.ShowDialog();
            Frm_StaubliPreset_Load(this, null);
        }
Пример #9
0
        private void BT_DeleteTraj_Click(object sender, EventArgs e)
        {
            if (gv.GetFocusedDataSourceRowIndex() < 0 || gv.RowCount < 1)
            {
                MessageBox.Show("没有路径");
                return;
            }
            //2013.11.19
            //添加批处理删除路径

            //Batch_DeleteTraj frmChoose = new Batch_DeleteTraj(CBE_RecipeName.EditValue.ToString(), gv.GetSelectedRows()[0]);
            //frmChoose.ShowDialog();
            //if (TxtData.PublicData.DeleteTrajIndex==null)
            //{
            //    return;
            //}



            if (MessageBox.Show("确定需要删除路径吗?", "警告", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
            {
                return;
            }


            //Edit_Part frmE = new Edit_Part();
            //frmE.ShowDialog();

            //if (TxtData.PolishData.PartMatlabFile == null || TxtData.PolishData.PartRecipeName == null)
            //{
            //    return;
            //}
            TxtData.PublicData.DeleteTrajIndex = new int[] { gv.GetFocusedDataSourceRowIndex() + 1 };

            TxtData.PublicData.ErrorCode = 0;
            OperIndex = 4;
            System.Threading.ThreadPool.QueueUserWorkItem(new WaitCallback(PollImport));
            Frm_Wait frm = new Frm_Wait(CBE_RecipeName.EditValue.ToString(), false);

            frm.ShowDialog();
            if (TxtData.PublicData.ErrorCode == 0 || TxtData.PublicData.ErrorCode == 40)
            {
                //CBE_RecipeName.Text = TxtData.PolishData.PartRecipeName;
                //CBE_RecipeName_TextChanged(this, null);
                CBE_RecipeName_TextChanged(this, null);
            }
        }
Пример #10
0
        private void BT_Import_Click(object sender, EventArgs e)
        {
            if (CBE_PresetName.Properties.Items.Count == 0)
            {
                MessageBox.Show("没有工艺");
                return;
            }
            if ((FileName = PublicFunc.OpenDir_Show()) == null)
            {
                return;
            }
            TxtData.PublicData.ErrorCode = 0;

            System.Threading.ThreadPool.QueueUserWorkItem(new WaitCallback(PollImport));
            Frm_Wait frm = new Frm_Wait("", false);
            frm.ShowDialog();
        }
Пример #11
0
        private void BT_OutPort_Click(object sender, EventArgs e)
        {
            if (CBE_PresetName.Properties.Items.Count == 0)
            {
                MessageBox.Show("没有工艺");
                return;
            }
            if ((FileName = PublicFunc.SfD_Show()) == null)
            {
                return;
            }
            TxtData.PublicData.ErrorCode = 0;

            System.Threading.ThreadPool.QueueUserWorkItem(new WaitCallback(PollOutport));
            Frm_Wait frm = new Frm_Wait("", false);

            frm.ShowDialog();
        }
Пример #12
0
        private void BT_OutPut_Click(object sender, EventArgs e)
        {
            if (CBE_RecipeName.EditValue.ToString() == "")
            {
                MessageBox.Show("无产品");
                return;
            }
            if ((FileName = PublicFunc.SfD_Show(CBE_RecipeName.EditValue.ToString() + ".txt")) == null)
            {
                return;
            }
            TxtData.PublicData.ErrorCode = 0;
            OperIndex = 1;
            System.Threading.ThreadPool.QueueUserWorkItem(new WaitCallback(PollImport));
            Frm_Wait frm = new Frm_Wait(CBE_RecipeName.EditValue.ToString(), false);

            frm.ShowDialog();
        }
Пример #13
0
        private void BT_Delete_Click(object sender, EventArgs e)
        {
            if (CBE_RecipeName.EditValue.ToString() == "")
            {
                MessageBox.Show("无产品");
                return;
            }
            if (MessageBox.Show("确定需要删除产品?", "警告", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
            {
                return;
            }
            TxtData.PublicData.ErrorCode = 0;
            OperIndex = 2;
            System.Threading.ThreadPool.QueueUserWorkItem(new WaitCallback(PollImport));
            Frm_Wait frm = new Frm_Wait(CBE_RecipeName.EditValue.ToString(), false);

            frm.ShowDialog();
            Frm_Recipe_Load(this, null);
        }
Пример #14
0
        private void BT_Delete_Click(object sender, EventArgs e)
        {
            if (CBE_PresetName.Properties.Items.Count==0)
            {
                MessageBox.Show("没有工艺");
                return;
            }
            if (MessageBox.Show("确定需要删除吗?", "警告", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
            {
                return;
            }

            TxtData.PublicData.ErrorCode = 0;

            System.Threading.ThreadPool.QueueUserWorkItem(new WaitCallback(PollDelete));
            Frm_Wait frm = new Frm_Wait("", false);
            frm.ShowDialog();
            Frm_Preset_Load(this, null);
        }
Пример #15
0
        private void BT_Delete_Click(object sender, EventArgs e)
        {
            if (CBE_PresetName.Properties.Items.Count == 0)
            {
                MessageBox.Show("没有工艺");
                return;
            }
            if (MessageBox.Show("确定需要删除吗?", "警告", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
            {
                return;
            }

            TxtData.PublicData.ErrorCode = 0;

            System.Threading.ThreadPool.QueueUserWorkItem(new WaitCallback(PollDelete));
            Frm_Wait frm = new Frm_Wait("", false);

            frm.ShowDialog();
            Frm_Preset_Load(this, null);
        }
Пример #16
0
        private void Teach(int Flag)
        {
            if (TxtData.SoapData.InterfaceType != 9)
            {
                MessageBox.Show("下位机请切换到主界面!");
                return;
            }

            if (TxtData.SoapData.ToolMode != 1)
            {
                MessageBox.Show("请切换到手动模式!");
                return;
            }
            TxtData.PolishData.UploadType = 1;
            TxtData.PublicData.ErrorCode  = RobotKit.SoapInstance.SoapRead.SetAppdata("nVirtualKey", 275) ? 40 : 12;
            Frm_Wait frm = new Frm_Wait("", true);

            frm.ShowDialog();
            ReadHomeTcp();
        }
Пример #17
0
        private void BT_RecipeOffset_Click(object sender, EventArgs e)
        {
            if (CBE_RecipeName.EditValue.ToString() == "")
            {
                MessageBox.Show("无产品");
                return;
            }
            if (TxtData.SoapData.InterfaceType != 9)
            {
                MessageBox.Show("下位机请切换到主界面!");
                return;
            }

            if (TxtData.SoapData.ToolMode != 1)
            {
                MessageBox.Show("请切换到手动模式!");
                return;
            }

            if (!SoapInstance.SoapRead.SetAppdata("sProductName", CBE_RecipeName.EditValue.ToString()))
            {
                MessageBox.Show("设置下位机数据出错!");
                return;
            }

            if (!SoapInstance.SoapRead.SetAppdata("nInterfaceType", 11))
            {
                MessageBox.Show("设置下位机数据出错!");
                return;
            }
            //while (TxtData.SoapData.InterfaceType == 9)
            //{
            //    System.Threading.Thread.Sleep(10);
            //}
            TxtData.PublicData.ErrorCode = 0;
            Frm_Wait frm = new Frm_Wait(CBE_RecipeName.EditValue.ToString(), true);

            frm.ShowDialog();
            RecipeInfor();
        }
Пример #18
0
        private void BT_Import_Click(object sender, EventArgs e)
        {
            if (gv.RowCount != 0)
            {
                MessageBox.Show("产品已存在路径");
                return;
            }
            if (CBE_RecipeName.EditValue.ToString() == "" || Frame == null)
            {
                MessageBox.Show("请先建立产品");
                return;
            }
            if ((FileName = PublicFunc.OpenDir_Show()) == null)
            {
                return;
            }
            string[] frm = new string[6];

            if (!PublicFunc.IsFrame(FileName, Frame, ref frm))
            {
                if (MessageBox.Show(
                        "导入文本中的产品坐标系不一致,是否继续导入?" + "\n新建产品坐标系是:"
                        + Frame[0].ToString() + "," + Frame[1].ToString() + "," + Frame[2].ToString() + "," + Frame[3].ToString() + ","
                        + Frame[4].ToString() + "," + Frame[5].ToString() + "\n文本坐标系是:"
                        + frm[0].ToString() + "," + frm[1].ToString() + "," + frm[2].ToString() + "," + frm[3].ToString() + ","
                        + frm[4].ToString() + "," + frm[5].ToString(), "产品坐标系不一致", MessageBoxButtons.YesNo) == DialogResult.No)
                {
                    return;
                }
            }

            TxtData.PublicData.ErrorCode = 0;
            TxtData.PublicData.ErrorLine = 0;
            OperIndex = 3;
            System.Threading.ThreadPool.QueueUserWorkItem(new WaitCallback(PollImport));
            Frm_Wait frM = new Frm_Wait(CBE_RecipeName.EditValue.ToString(), false);

            frM.ShowDialog();
            CBE_RecipeName_TextChanged(this, null);
        }
Пример #19
0
        private void BT_Teach_Click(object sender, EventArgs e)
        {
            if (TxtData.SoapData.InterfaceType != 9)
            {
                MessageBox.Show("下位机请切换到主界面!");
                return;
            }

            if (TxtData.SoapData.ToolMode != 1)
            {
                MessageBox.Show("请切换到手动模式!");
                return;
            }


            TxtData.PublicData.ErrorCode = 0;
            System.Threading.ThreadPool.QueueUserWorkItem(new WaitCallback(Poll));
            Frm_Wait frm = new Frm_Wait(true);

            frm.ShowDialog();
            Frm_StaubliPreset_Load(this, null);
        }
Пример #20
0
        private void BT_Apply_Click(object sender, EventArgs e)
        {
            if (CBE_id.SelectedIndex > CBE_idend.SelectedIndex)
            {

                MessageBox.Show("开始序号不能超过结束序号");

                return;
            }
            bool Flag = false;
            ////for (int i = 0; i < Clb_Check.ItemCount; i++)
            ////{
            ////   PointType[i] =Clb_Check.GetItemChecked(i);
            ////   Flag = PointType[i] ? true : Flag;
            ////}
            //if (!Flag)
            //{

            //    MessageBox.Show("请进行点位选择");

            //    return;
            //}
               // Flag = false;
            for (int i = 0; i <CBK_Para.ItemCount; i++)
            {
                ParaType[i] = CBK_Para.GetItemChecked(i);
                Flag = ParaType[i] || Flag;
            }
            if (!Flag)
            {

                MessageBox.Show("请进行参数选择");

                return;
            }

            //2015.02.04
            if (CBK_Para.GetItemChecked(3))
            {
                if (MessageBox.Show("确定需要修改RZ吗?\n 修改RZ可能导致机械手臂姿态异常!", "警告", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
                {
                    return;
                }
            }

            double[] data=new double[10];
            double.TryParse(TE_A1.Text,out data[0]);
            double.TryParse(TE_A2.Text, out data[1]);
            double.TryParse(TE_A3.Text, out data[2]);
            double.TryParse(TE_A4.Text, out data[3]);
            double.TryParse(TE_A5.Text, out data[4]);
            double.TryParse(TE_A6.Text, out data[5]);
            double.TryParse(TE_A7.Text, out data[6]);
            double.TryParse(TE_A8.Text, out data[7]);
            //data[6] = (int)SE1.Value;
            //data[7] = (int)SE2.Value;
            //data[8] = (int)SE3.Value;
            //data[9] = (int)SE4.Value;

            if (data[0]<=0||data[2]<=0||data[4]<0||data[5]<0)
            {MessageBox.Show("速度与加速度,延时不能小于0");
                return;
            }
            if (bthread)
            {
                return;
            }

               // string Mess = db.BatchCut(Trajname,CBE_id.SelectedIndex+1,CBE_idend.SelectedIndex+1,ParaType,data,CE_Replace.Checked) ? "成功" : "操作异常";
              //  MessageBox.Show(Mess);
            Buffdata = data;
            //string Mess = db.BatchSpeed(RecipeName,CBE_id.SelectedIndex+1,CBE_idend.SelectedIndex+1,PointType,ParaType,data,CE_Replace.Checked) ? "成功" : "操作异常";
            //MessageBox.Show(Mess);
            TxtData.PublicData.ErrorCode = 0;
            System.Threading.ThreadPool.QueueUserWorkItem(new WaitCallback(Poll));
            Frm_Wait frm = new Frm_Wait();
            frm.ShowDialog();
        }
Пример #21
0
        private void Teach(int Flag)
        {
            if (TxtData.SoapData.InterfaceType != 9)
            {
                MessageBox.Show("下位机请切换到主界面!");
                return;
            }

            if (TxtData.SoapData.ToolMode != 1)
            {
                MessageBox.Show("请切换到手动模式!");
                return;
            }
            TxtData.PolishData.UploadType = 1;
            TxtData.PublicData.ErrorCode = RobotKit.SoapInstance.SoapRead.SetAppdata("nVirtualKey", 275) ? 40 : 12;
            Frm_Wait frm = new Frm_Wait("",true);
            frm.ShowDialog();
            ReadHomeTcp();
        }
Пример #22
0
        private void BT_Teach_Click(object sender, EventArgs e)
        {
            if (TxtData.SoapData.InterfaceType != 9)
            {
                MessageBox.Show("下位机请切换到主界面!");
                return;
            }

            if (TxtData.SoapData.ToolMode != 1)
            {
                MessageBox.Show("请切换到手动模式!");
                return;
            }

            TxtData.PublicData.ErrorCode = 0;
            System.Threading.ThreadPool.QueueUserWorkItem(new WaitCallback(Poll));
            Frm_Wait frm = new Frm_Wait(true);
            frm.ShowDialog();
            Frm_StaubliPreset_Load(this, null);
        }
Пример #23
0
        private void BT_Apply_Click(object sender, EventArgs e)
        {
            if (CBE_id.SelectedIndex > CBE_idend.SelectedIndex)
            {
                MessageBox.Show("开始序号不能超过结束序号");

                return;
            }
            bool Flag = false;

            for (int i = 0; i < Clb_Check.ItemCount; i++)
            {
                PointType[i] = Clb_Check.GetItemChecked(i);
                Flag         = PointType[i] ? true : Flag;
            }
            if (!Flag)
            {
                MessageBox.Show("请进行点位选择");

                return;
            }
            Flag = false;
            for (int i = 0; i < CBK_Para.ItemCount; i++)
            {
                ParaType[i] = CBK_Para.GetItemChecked(i);
                Flag        = ParaType[i] ? true : Flag;
            }
            if (!Flag)
            {
                MessageBox.Show("请进行参数选择");

                return;
            }

            double[] data = new double[10];
            double.TryParse(TE_A1.Text, out data[0]);
            double.TryParse(TE_A2.Text, out data[1]);
            double.TryParse(TE_A3.Text, out data[2]);
            double.TryParse(TE_A4.Text, out data[3]);
            double.TryParse(TE_A5.Text, out data[4]);
            double.TryParse(TE_A6.Text, out data[5]);
            //data[6] = (int)SE1.Value;
            //data[7] = (int)SE2.Value;
            //data[8] = (int)SE3.Value;
            //data[9] = (int)SE4.Value;

            if (data[0] <= 0 || data[2] <= 0 || data[4] < 0)
            {
                MessageBox.Show("速度与加速度不能小于0");
                return;
            }
            if (Bthread)
            {
                return;
            }
            Buffdata = data;
            //string Mess = db.BatchSpeed(RecipeName,CBE_id.SelectedIndex+1,CBE_idend.SelectedIndex+1,PointType,ParaType,data,CE_Replace.Checked) ? "成功" : "操作异常";
            //MessageBox.Show(Mess);
            TxtData.PublicData.ErrorCode = 0;
            System.Threading.ThreadPool.QueueUserWorkItem(new WaitCallback(Poll));
            Frm_Wait frm = new Frm_Wait();

            frm.ShowDialog();
        }
Пример #24
0
        private void BT_Import_Click(object sender, EventArgs e)
        {
            if ((FileName = PublicFunc.OpenDir_Show()) == null)
            {
                return;
            }
            TxtData.PublicData.ErrorCode = 0;

            System.Threading.ThreadPool.QueueUserWorkItem(new WaitCallback(PollImport));
            Frm_Wait frm = new Frm_Wait("", false);
            frm.ShowDialog();
            Frm_StaubliPreset_Load(this, null);
        }
Пример #25
0
        private void BT_Apply_Click(object sender, EventArgs e)
        {
            if (CBE_id.SelectedIndex > CBE_idend.SelectedIndex)
            {

                MessageBox.Show("开始序号不能超过结束序号");

                return;
            }
            bool Flag = false;
            for (int i = 0; i < Clb_Check.ItemCount; i++)
            {
               PointType[i] =Clb_Check.GetItemChecked(i);
               Flag = PointType[i] ? true : Flag;
            }
            if (!Flag)
            {

                MessageBox.Show("请进行点位选择");

                return;
            }
            Flag = false;
            for (int i = 0; i <CBK_Para.ItemCount; i++)
            {
                ParaType[i] = CBK_Para.GetItemChecked(i);
                Flag = ParaType[i] ? true : Flag;
            }
            if (!Flag)
            {

                MessageBox.Show("请进行参数选择");

                return;
            }

            double[] data=new double[10];
            double.TryParse(TE_A1.Text,out data[0]);
            double.TryParse(TE_A2.Text, out data[1]);
            double.TryParse(TE_A3.Text, out data[2]);
            double.TryParse(TE_A4.Text, out data[3]);
            double.TryParse(TE_A5.Text, out data[4]);
            double.TryParse(TE_A6.Text, out data[5]);
            //data[6] = (int)SE1.Value;
            //data[7] = (int)SE2.Value;
            //data[8] = (int)SE3.Value;
            //data[9] = (int)SE4.Value;

            if (data[0]<=0||data[2]<=0||data[4]<0)
            {
                MessageBox.Show("速度与加速度不能小于0");
                return;
            }
            if (Bthread)
            {
                return;
            }
            Buffdata = data;
            //string Mess = db.BatchSpeed(RecipeName,CBE_id.SelectedIndex+1,CBE_idend.SelectedIndex+1,PointType,ParaType,data,CE_Replace.Checked) ? "成功" : "操作异常";
            //MessageBox.Show(Mess);
            TxtData.PublicData.ErrorCode = 0;
            System.Threading.ThreadPool.QueueUserWorkItem(new WaitCallback(Poll));
            Frm_Wait frm = new Frm_Wait();
            frm.ShowDialog();
        }
Пример #26
0
        private void BT_Apply_Click(object sender, EventArgs e)
        {
            if (CBE_id.SelectedIndex > CBE_idend.SelectedIndex)
            {
                MessageBox.Show("开始序号不能超过结束序号");

                return;
            }
            bool Flag = false;

            ////for (int i = 0; i < Clb_Check.ItemCount; i++)
            ////{
            ////   PointType[i] =Clb_Check.GetItemChecked(i);
            ////   Flag = PointType[i] ? true : Flag;
            ////}
            //if (!Flag)
            //{

            //    MessageBox.Show("请进行点位选择");

            //    return;
            //}
            // Flag = false;
            for (int i = 0; i < CBK_Para.ItemCount; i++)
            {
                ParaType[i] = CBK_Para.GetItemChecked(i);
                Flag        = ParaType[i] || Flag;
            }
            if (!Flag)
            {
                MessageBox.Show("请进行参数选择");

                return;
            }

            //2015.02.04
            if (CBK_Para.GetItemChecked(3))
            {
                if (MessageBox.Show("确定需要修改RZ吗?\n 修改RZ可能导致机械手臂姿态异常!", "警告", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
                {
                    return;
                }
            }

            double[] data = new double[10];
            double.TryParse(TE_A1.Text, out data[0]);
            double.TryParse(TE_A2.Text, out data[1]);
            double.TryParse(TE_A3.Text, out data[2]);
            double.TryParse(TE_A4.Text, out data[3]);
            double.TryParse(TE_A5.Text, out data[4]);
            double.TryParse(TE_A6.Text, out data[5]);
            double.TryParse(TE_A7.Text, out data[6]);
            double.TryParse(TE_A8.Text, out data[7]);
            //data[6] = (int)SE1.Value;
            //data[7] = (int)SE2.Value;
            //data[8] = (int)SE3.Value;
            //data[9] = (int)SE4.Value;

            if (data[0] <= 0 || data[2] <= 0 || data[4] < 0 || data[5] < 0)
            {
                MessageBox.Show("速度与加速度,延时不能小于0");
                return;
            }
            if (bthread)
            {
                return;
            }

            // string Mess = db.BatchCut(Trajname,CBE_id.SelectedIndex+1,CBE_idend.SelectedIndex+1,ParaType,data,CE_Replace.Checked) ? "成功" : "操作异常";
            //  MessageBox.Show(Mess);
            Buffdata = data;
            //string Mess = db.BatchSpeed(RecipeName,CBE_id.SelectedIndex+1,CBE_idend.SelectedIndex+1,PointType,ParaType,data,CE_Replace.Checked) ? "成功" : "操作异常";
            //MessageBox.Show(Mess);
            TxtData.PublicData.ErrorCode = 0;
            System.Threading.ThreadPool.QueueUserWorkItem(new WaitCallback(Poll));
            Frm_Wait frm = new Frm_Wait();

            frm.ShowDialog();
        }