private void buttonRead_Click(object sender, EventArgs e) { tbOutput.AppendText("Read Coordinates.\n"); TPos position = new TPos(); getPosition(ref position); numericUpDownX.Value =(decimal)position.X; numericUpDownY.Value = (decimal)position.Y; numericUpDownZ.Value = (decimal)position.Z; numericUpDownPhi.Value = (decimal)position.Phi; numericUpDownTheta.Value = (decimal)position.Theta; numericUpDownPsi.Value = (decimal)position.Psi; }
private void buttonRead_Click(object sender, EventArgs e) { tbOutput.AppendText("Read Coordinates.\n"); TPos position = new TPos(); getPosition(ref position); numericUpDownX.Value = (decimal)position.X; numericUpDownY.Value = (decimal)position.Y; numericUpDownZ.Value = (decimal)position.Z; numericUpDownPhi.Value = (decimal)position.Phi; numericUpDownTheta.Value = (decimal)position.Theta; numericUpDownPsi.Value = (decimal)position.Psi; }
private void buttonGo_Click(object sender, EventArgs e) { TPos position = new TPos(); position.X = (double)numericUpDownX.Value; position.Y = (double)numericUpDownY.Value; position.Z = (double)numericUpDownZ.Value; position.Phi = (double)numericUpDownPhi.Value; position.Theta = (double)numericUpDownTheta.Value; position.Psi = (double)numericUpDownPsi.Value; if (checkBoxLM.Checked == true) { tbOutput.AppendText("Move Linear.. "); moveToPosLin(ref position, (int)numericUpDownVel.Value, 1); tbOutput.AppendText("Done.\n"); } else { tbOutput.AppendText("Move PTP.. "); moveToPos(ref position, (int)numericUpDownVel.Value, 1); tbOutput.AppendText("Done.\n"); } }
public static extern short GT_MachineTransformation(short crd, int posType, ref double pPrePos, ref double pPos, ref int pPosNum, ref TPos pReturnPos);
static extern int moveToPosLin(ref TPos position, int vel, int accel);
static extern int getPosition(ref TPos position);