private void button2_Click(object sender, EventArgs e) //开始按钮 { string com = CommandCreate.TestCommand(""); Commondata.GalilControler.GProgramDownload(com); Commondata.GalilControler.GProgramUpload(); Commondata.GalilControler.GCommand("XQ#TEST"); }
private void button1_Click(object sender, EventArgs e) //选择产品按钮 { Form1 IForm1 = (Form1)this.Owner; string model; try { if (dataGridView1.SelectedRows.Count > 1) { MessageBox.Show("请选择一行数据!"); } else { if (Commondata.GetConfigValue("YZeroValue") == "" && Commondata.GetConfigValue("ZZeroValue") == "" && Commondata.GetConfigValue("WZeroValue") == "") { Console.WriteLine(Commondata.GetConfigValue("YZeroValue") + "wtf" + Commondata.GetConfigValue("ZZeroValue") + Commondata.GetConfigValue("WZeroValue")); MessageBox.Show("请设置零点!"); } else { model = dataGridView1.CurrentRow.Cells["Model"].Value.ToString(); IForm1.SetProductValue(model); UploadCommand = CommandCreate.TestCommand(model); //UpLoadCommand(UploadCommand); System.IO.File.WriteAllText(Commondata.commandtxt, UploadCommand); MessageBox.Show("命令已生成,点击命令查看按钮以查看。"); this.Dispose(); } } } catch (Exception e1) { MessageBox.Show(e1.Message); return; } }