private void machinesToolStripMenuItem_Click(object sender, EventArgs e) { MachineLoadForm mform = new MachineLoadForm(grbl); mform.ShowDialog(); if (mform.Ok) { foreach (var param in mform.ParameterList) { if (grbl.IsConnected) { grbl.UpdateParameter(param.Id, param.Value); } } } }
private void btn_Update_Click(object sender, EventArgs e) { string msg = ValidateText(_textVal); if (msg == string.Empty) { GrblParameterBase selected = (GrblParameterBase)cmb_params.SelectedItem; string paramVal = GetValue(); DialogResult result = MessageBox.Show( $"Update {selected.Desc} from [{selected.Val}] to [{paramVal}]?", "Warning", MessageBoxButtons.OKCancel); if (result == DialogResult.OK) { grbl.UpdateParameter(selected.ID, paramVal); } } else { lbl_message.Text = msg; } }