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;

            bool[] Item = new bool[12];
            for (int i = 0; i < 12; i++)
            {
                Item[i] = Clb_Check.GetItemChecked(i);
                Flag    = Item[i] ? true : Flag;
            }
            if (!Flag)
            {
                MessageBox.Show("请进行选择项目");

                return;
            }

            double[] Frame = new double[6];
            double.TryParse(TE_F1.Text, out Frame[0]);
            double.TryParse(TE_F2.Text, out Frame[1]);
            double.TryParse(TE_F3.Text, out Frame[2]);
            double.TryParse(TE_F4.Text, out Frame[3]);
            double.TryParse(TE_F5.Text, out Frame[4]);
            double.TryParse(TE_F6.Text, out Frame[5]);

            double[] Offset = new double[6];
            double.TryParse(TE_O1.Text, out Offset[0]);
            double.TryParse(TE_O2.Text, out Offset[1]);
            double.TryParse(TE_O3.Text, out Offset[2]);
            double.TryParse(TE_O4.Text, out Offset[3]);
            double.TryParse(TE_O5.Text, out Offset[4]);
            double.TryParse(TE_O6.Text, out Offset[5]);

            double[] Array = new double[6];
            double.TryParse(TE_A1.Text, out Array[0]);
            double.TryParse(TE_A2.Text, out Array[1]);
            double.TryParse(TE_A3.Text, out Array[2]);
            double.TryParse(TE_A4.Text, out Array[3]);
            double.TryParse(TE_A5.Text, out Array[4]);
            double.TryParse(TE_A6.Text, out Array[5]);

            double[] DownLead = new double[6];
            //double.TryParse(TE_D1.Text, out DownLead[0]);
            double.TryParse(TE_D2.Text, out DownLead[1]);
            //  double.TryParse(TE_D3.Text, out DownLead[2]);
            double.TryParse(TE_D4.Text, out DownLead[3]);

            DownLead[0] = TE_D1.SelectedIndex;
            DownLead[2] = TE_D3.SelectedIndex;

            double[] Axis = new double[6];
            double.TryParse(TE_S1.Text, out Axis[0]);
            double.TryParse(TE_S2.Text, out Axis[1]);
            double.TryParse(TE_S3.Text, out Axis[2]);
            double.TryParse(TE_S4.Text, out Axis[3]);
            double.TryParse(TE_S5.Text, out Axis[4]);
            double.TryParse(TE_S6.Text, out Axis[5]);

            Axis[5] = Math.Max(1, Axis[5]);
            Axis[5] = Math.Min(50, Axis[5]);
            Axis[5] = (int)Axis[5];


            double[] Delay = new double[6];
            Delay[0] = (double)SE_1.Value;
            Delay[1] = (double)SE_2.Value;
            Delay[2] = (double)SE_3.Value;
            Delay[3] = (double)SE_4.Value;
            for (int i = 0; i < 4; i++)
            {
                if (Delay[i] < 0)
                {
                    MessageBox.Show("设置参数不正确");
                    return;
                }
            }

            string Mess = db.BatchTraj(Recipename, CBE_id.SelectedIndex + 1, CBE_idend.SelectedIndex + 1, Item, Frame, Offset, Array, DownLead, Axis, Delay) ? "成功" : "操作异常";

            MessageBox.Show(Mess);
        }
Exemplo n.º 2
0
        private void BT_Apply_Click(object sender, EventArgs e)
        {
            //  MessageBox.Show(TE_D1.SelectedIndex.ToString() + "    " + TE_D3.SelectedIndex.ToString());
            bool [] Item = new bool [12];
            for (int i = 0; i < 12; i++)
            {
                Item[i] = true;
            }
            double[] Frame = new double[6];
            double.TryParse(TE_F1.Text, out Frame[0]);
            double.TryParse(TE_F2.Text, out Frame[1]);
            double.TryParse(TE_F3.Text, out Frame[2]);
            double.TryParse(TE_F4.Text, out Frame[3]);
            double.TryParse(TE_F5.Text, out Frame[4]);
            double.TryParse(TE_F6.Text, out Frame[5]);

            double[] Offset = new double[6];
            double.TryParse(TE_O1.Text, out Offset[0]);
            double.TryParse(TE_O2.Text, out Offset[1]);
            double.TryParse(TE_O3.Text, out Offset[2]);
            double.TryParse(TE_O4.Text, out Offset[3]);
            double.TryParse(TE_O5.Text, out Offset[4]);
            double.TryParse(TE_O6.Text, out Offset[5]);

            double[] Array = new double[6];
            double.TryParse(TE_A1.Text, out Array[0]);
            double.TryParse(TE_A2.Text, out Array[1]);
            double.TryParse(TE_A3.Text, out Array[2]);
            double.TryParse(TE_A4.Text, out Array[3]);
            double.TryParse(TE_A5.Text, out Array[4]);
            double.TryParse(TE_A6.Text, out Array[5]);



            double[] Axis = new double[6];
            double.TryParse(TE_S1.Text, out Axis[0]);
            double.TryParse(TE_S2.Text, out Axis[1]);
            double.TryParse(TE_S3.Text, out Axis[2]);
            double.TryParse(TE_S4.Text, out Axis[3]);
            double.TryParse(TE_S5.Text, out Axis[4]);
            double.TryParse(TE_S6.Text, out Axis[5]);

            if (Axis[5] != -1)
            {
                Axis[5] = Math.Max(1, Axis[5]);
            }

            Axis[5] = Math.Min(50, Axis[5]);
            Axis[5] = (int)Axis[5];

            double[] Delay = new double[6];
            Delay[0] = (double)SE_1.Value;
            Delay[1] = (double)SE_2.Value;
            Delay[2] = (double)SE_3.Value;
            Delay[3] = (double)SE_4.Value;
            for (int i = 0; i < 4; i++)
            {
                if (Delay[i] < 0)
                {
                    MessageBox.Show("设置参数不正确");
                    return;
                }
            }
            double[] DownLeaddata = new double[6];
            // double.TryParse(TE_D1.Text, out DownLead[0]);
            double.TryParse(TE_D2.Text, out DownLeaddata[1]);
            // double.TryParse(TE_D3.Text, out DownLead[2]);
            double.TryParse(TE_D4.Text, out DownLeaddata[3]);

            DownLeaddata[0] = TE_D1.SelectedIndex;
            DownLeaddata[2] = TE_D3.SelectedIndex;

            db.EditTrajRemark(Recipename, CBE_id.SelectedIndex + 1, TE_Remark.Text);
            //MessageBox.Show(Downlead[0].ToString()+"   "+Downlead[2].ToString());
            string Mess = db.BatchTraj(Recipename, CBE_id.SelectedIndex + 1, CBE_id.SelectedIndex + 1, Item, Frame, Offset, Array, DownLeaddata, Axis, Delay) ? "成功" : "操作异常";

            MessageBox.Show(Mess);
        }