Exemplo n.º 1
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;
            }

            string Mess = db.BatchSpeed(RecipeName, CBE_id.SelectedIndex + 1, CBE_idend.SelectedIndex + 1, PointType, ParaType, data, CE_Replace.Checked) ? "成功" : "操作异常";

            MessageBox.Show(Mess);
        }
Exemplo n.º 2
0
        void Poll(object target)
        {
            Bthread = true;
            TxtData.PublicData.ErrorCode = (db.BatchSpeed(RecipeName, CBE_id.SelectedIndex + 1, CBE_idend.SelectedIndex + 1, PointType, ParaType, Buffdata, CE_Replace.Checked)) ? 40 : 60;

            //  string Mess = db.BatchSpeed(RecipeName, CBE_id.SelectedIndex + 1, CBE_idend.SelectedIndex + 1, PointType, ParaType, data, CE_Replace.Checked) ? "成功" : "操作异常";
            // MessageBox.Show(Mess);

            Bthread = false;
        }