Esempio n. 1
0
        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();
            }
        }
Esempio n. 2
0
        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();
            }
        }
Esempio n. 3
0
        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();
            }
        }
Esempio n. 4
0
 private void textBoxAlias_TextChanged(object sender, EventArgs e)
 {
     ParseCheck.TextBoxCheckByParserUInt(sender, UInt32.TryParse);
 }
Esempio n. 5
0
 private void textBoxTargetPos_TextChanged(object sender, EventArgs e)
 {
     ParseCheck.TextBoxCheckByParserDouble(sender, Double.TryParse);
 }
Esempio n. 6
0
 private void textBoxVelocityLimit_TextChanged(object sender, EventArgs e)
 {
     ParseCheck.TextBoxCheckByParserDouble(sender, Double.TryParse);
 }
Esempio n. 7
0
 private void textBoxSDOSubIndexC_TextChanged(object sender, EventArgs e)
 {
     ParseCheck.TextBoxCheckByParserUInt(sender, ParseCheck.UIntTryParseFromHex);
 }
Esempio n. 8
0
 private void textBoxProfileDeceleration_TextChanged(object sender, EventArgs e)
 {
     ParseCheck.TextBoxCheckByParserUInt(sender, ParseCheck.UIntTryParseNotZero);
 }
Esempio n. 9
0
 private void textBoxHMAcceleration_TextChanged(object sender, EventArgs e)
 {
     ParseCheck.TextBoxCheckByParserUInt(sender, UInt32.TryParse);
 }
Esempio n. 10
0
 private void textBoxCloseLoopFilter_TextChanged(object sender, EventArgs e)
 {
     ParseCheck.TextBoxCheckByParserDouble(sender, ParseCheck.DoubleTryParseNotNeg);
 }
Esempio n. 11
0
 private void textBoxExtEncoderChannel_TextChanged(object sender, EventArgs e)
 {
     ParseCheck.TextBoxCheckByParserUInt(sender, UInt32.TryParse);
 }
Esempio n. 12
0
 private void textBoxExtEncoderDirection_TextChanged(object sender, EventArgs e)
 {
     ParseCheck.TextBoxCheckByParserInt(sender, ParseCheck.IntTryParseNotZero);
 }
Esempio n. 13
0
 private void textBoxHomeOffset_TextChanged(object sender, EventArgs e)
 {
     ParseCheck.TextBoxCheckByParserDouble(sender, Double.TryParse);
 }
Esempio n. 14
0
 private void textBoxAxisNumber_TextChanged(object sender, EventArgs e)
 {
     ParseCheck.TextBoxCheckByParserUInt(sender, ParseCheck.UIntTryParseNotZero);
 }
Esempio n. 15
0
 private void textBoxSDOValueC_TextChanged(object sender, EventArgs e)
 {
     ParseCheck.TextBoxCheckByParserInt(sender, Int32.TryParse);
 }
Esempio n. 16
0
 private void textBoxMaxPosDeviation_TextChanged(object sender, EventArgs e)
 {
     ParseCheck.TextBoxCheckByParserDouble(sender, ParseCheck.DoubleTryParseNotNeg);
 }
Esempio n. 17
0
 private void textBoxTargetTorque_TextChanged(object sender, EventArgs e)
 {
     ParseCheck.TextBoxCheckByParserInt(sender, Int32.TryParse);
 }
Esempio n. 18
0
 private void textBoxIgnorableDistance_TextChanged(object sender, EventArgs e)
 {
     ParseCheck.TextBoxCheckByParserDouble(sender, ParseCheck.DoubleTryParsePos);
 }
Esempio n. 19
0
 private void textBoxProfileVelocity_TextChanged(object sender, EventArgs e)
 {
     ParseCheck.TextBoxCheckByParserUInt(sender, UInt32.TryParse);
 }
Esempio n. 20
0
 private void textBoxAmax_TextChanged(object sender, EventArgs e)
 {
     ParseCheck.TextBoxCheckByParserDouble(sender, ParseCheck.DoubleTryParsePos);
 }
Esempio n. 21
0
 private void textBoxTorqueSlope_TextChanged(object sender, EventArgs e)
 {
     ParseCheck.TextBoxCheckByParserUInt(sender, ParseCheck.UIntTryParseNotZero);
 }
Esempio n. 22
0
        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();
            }
        }