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); }
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); }
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(); }