private void textBoxSlavePos_Submit(object sender) { TextBox tb = sender as TextBox; UInt32 n; if (ParseCheck.UIntTryParseNotZero(tb.Text, out n) && n != 0 && alias == 0) { slaveNumber = n; Reset(); UpdateData(); } else { tb.Text = slaveNumber.ToString(); } }
private void textBoxAxisNumberSubmit(object sender) { TextBox tb = sender as TextBox; UInt32 n; if (ParseCheck.UIntTryParseNotZero(tb.Text, out n)) { axisNumber = n; Reset(); UpdateConfig(); } else { tb.Text = axisNumber.ToString(); } }
private void textBoxChannel_Submit(object sender) { TextBox tb = sender as TextBox; UInt32 n; if (ParseCheck.UIntTryParseNotZero(tb.Text, out n) && n != 0) { channelNumber = n; Reset(); UpdateData(); } else { tb.Text = channelNumber.ToString(); } }
private void textBoxAlias_TextChanged(object sender, EventArgs e) { ParseCheck.TextBoxCheckByParserUInt(sender, UInt32.TryParse); }
private void textBoxTargetPos_TextChanged(object sender, EventArgs e) { ParseCheck.TextBoxCheckByParserDouble(sender, Double.TryParse); }
private void textBoxVelocityLimit_TextChanged(object sender, EventArgs e) { ParseCheck.TextBoxCheckByParserDouble(sender, Double.TryParse); }
private void textBoxSDOSubIndexC_TextChanged(object sender, EventArgs e) { ParseCheck.TextBoxCheckByParserUInt(sender, ParseCheck.UIntTryParseFromHex); }
private void textBoxProfileDeceleration_TextChanged(object sender, EventArgs e) { ParseCheck.TextBoxCheckByParserUInt(sender, ParseCheck.UIntTryParseNotZero); }
private void textBoxHMAcceleration_TextChanged(object sender, EventArgs e) { ParseCheck.TextBoxCheckByParserUInt(sender, UInt32.TryParse); }
private void textBoxCloseLoopFilter_TextChanged(object sender, EventArgs e) { ParseCheck.TextBoxCheckByParserDouble(sender, ParseCheck.DoubleTryParseNotNeg); }
private void textBoxExtEncoderChannel_TextChanged(object sender, EventArgs e) { ParseCheck.TextBoxCheckByParserUInt(sender, UInt32.TryParse); }
private void textBoxExtEncoderDirection_TextChanged(object sender, EventArgs e) { ParseCheck.TextBoxCheckByParserInt(sender, ParseCheck.IntTryParseNotZero); }
private void textBoxHomeOffset_TextChanged(object sender, EventArgs e) { ParseCheck.TextBoxCheckByParserDouble(sender, Double.TryParse); }
private void textBoxAxisNumber_TextChanged(object sender, EventArgs e) { ParseCheck.TextBoxCheckByParserUInt(sender, ParseCheck.UIntTryParseNotZero); }
private void textBoxSDOValueC_TextChanged(object sender, EventArgs e) { ParseCheck.TextBoxCheckByParserInt(sender, Int32.TryParse); }
private void textBoxMaxPosDeviation_TextChanged(object sender, EventArgs e) { ParseCheck.TextBoxCheckByParserDouble(sender, ParseCheck.DoubleTryParseNotNeg); }
private void textBoxTargetTorque_TextChanged(object sender, EventArgs e) { ParseCheck.TextBoxCheckByParserInt(sender, Int32.TryParse); }
private void textBoxIgnorableDistance_TextChanged(object sender, EventArgs e) { ParseCheck.TextBoxCheckByParserDouble(sender, ParseCheck.DoubleTryParsePos); }
private void textBoxProfileVelocity_TextChanged(object sender, EventArgs e) { ParseCheck.TextBoxCheckByParserUInt(sender, UInt32.TryParse); }
private void textBoxAmax_TextChanged(object sender, EventArgs e) { ParseCheck.TextBoxCheckByParserDouble(sender, ParseCheck.DoubleTryParsePos); }
private void textBoxTorqueSlope_TextChanged(object sender, EventArgs e) { ParseCheck.TextBoxCheckByParserUInt(sender, ParseCheck.UIntTryParseNotZero); }
private void buttonSDOExecute_Click(object sender, EventArgs e) { string cmd; bool upload; switch (comboBoxSDOOperation.SelectedIndex) { case 0: cmd = "sdo-upload-u8"; upload = true; break; case 1: cmd = "sdo-upload-u16"; upload = true; break; case 2: cmd = "sdo-upload-u32"; upload = true; break; case 3: cmd = "sdo-upload-i8"; upload = true; break; case 4: cmd = "sdo-upload-i16"; upload = true; break; case 5: cmd = "sdo-upload-i32"; upload = true; break; case 6: cmd = "sdo-download-u8"; upload = false; break; case 7: cmd = "sdo-download-u16"; upload = false; break; case 8: cmd = "sdo-download-u32"; upload = false; break; case 9: cmd = "sdo-download-i8"; upload = false; break; case 10: cmd = "sdo-download-i16"; upload = false; break; case 11: cmd = "sdo-download-i32"; upload = false; break; default: return; } UInt32 idx; UInt32 subidx; if (ParseCheck.UIntTryParseFromHex(textBoxSDOIndexC.Text, out idx) && ParseCheck.UIntTryParseFromHex(textBoxSDOSubIndexC.Text, out subidx)) { if (upload) { botnana.EvaluateScript(subidx.ToString() + @" " + idx.ToString() + @" " + slaveNumber.ToString() + @" " + cmd); } else { botnana.EvaluateScript(textBoxSDOValueC.Text + @" " + subidx.ToString() + @" " + idx.ToString() + @" " + slaveNumber.ToString() + @" " + cmd); } UpdateData(); } }