private void Execute() { if (!ControllerPlanetCNC.IsAvailability) { return; } if (tbSendGKode.Text.Trim() == "") { return; } ControllerPlanetCNC.ExecuteCommand(tbSendGKode.Text); tbSendGKode.Text = ""; }
private void button3_Click(object sender, EventArgs e) { if (!ControllerPlanetCNC.IsAvailability) { return; } string sGcode = @"G0 F" + (int)numericUpDown3.Value + " X" + numericUpDown6.Value + " Y" + numericUpDown5.Value + " Z" + numericUpDown4.Value; if (!ControllerPlanetCNC.IsAvailability) { return; } ControllerPlanetCNC.ExecuteCommand(sGcode); }
private void SendCommand(string _X = "", string _Y = "", string _Z = "", string _A = "") { if (_X == "" && _Y == "" && _Z == "" && _A == "") { ControllerPlanetCNC.ExecuteCommand("M201"); //остановка ручного движения return; } string sendValue = "M200 F" + numericUpDown1.Value.ToString("0000"); if (_X != "") sendValue += " X" + _X; if (_Y != "") sendValue += " Y" + _Y; if (_Z != "") sendValue += " Z" + _Z; if (_A != "") sendValue += " A" + _A; ControllerPlanetCNC.ExecuteCommand(sendValue); }