本文整理汇总了C#中Axis.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Axis.ToString方法的具体用法?C# Axis.ToString怎么用?C# Axis.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Axis
的用法示例。
在下文中一共展示了Axis.ToString方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LawOfCosinesPlanCalculation
/// <summary>
/// Calcula o angule entre os três joints enviados por parâmetros
/// </summary>
/// <param name="auxiliaryJointPosition">Posição do primeiro Joint</param>
/// <param name="centerJointPosition">Posição do segundo Joint</param>
/// <param name="auxiliary2JointPosition">Posição do terceiro Joint</param>
/// <param name="firstAxis">Primeiro eixo para o cálculo</param>
/// <param name="secondAxis">Segundo eixo para o cálculo</param>
/// <returns>Retorna o resultado da lei dos cossenos em graus</returns>
private static double LawOfCosinesPlanCalculation( SkeletonPoint auxiliaryJointPosition, SkeletonPoint centerJointPosition,SkeletonPoint auxiliary2JointPosition, Axis firstAxis, Axis secondAxis )
{
double firstAxisCenterJointPosition = centerJointPosition.GetType().GetProperty( firstAxis.ToString() ).GetValue( centerJointPosition, null ).To<double>();
double secondAxisCenterJointPosition = centerJointPosition.GetType().GetProperty(secondAxis.ToString()).GetValue(centerJointPosition, null).To<double>();
double firstAxisAuxiliaryJointPosition = auxiliaryJointPosition.GetType().GetProperty(firstAxis.ToString()).GetValue(auxiliaryJointPosition, null).To<double>();
double secondAxisAuxiliaryJointPosition = auxiliaryJointPosition.GetType().GetProperty(secondAxis.ToString()).GetValue(auxiliaryJointPosition, null).To<double>();
double firstAxisAuxiliaryJoint2Position = auxiliary2JointPosition.GetType().GetProperty(firstAxis.ToString()).GetValue(auxiliary2JointPosition, null).To<double>();
double secondAxisAuxiliaryJoint2Position = auxiliary2JointPosition.GetType().GetProperty(secondAxis.ToString()).GetValue(auxiliary2JointPosition, null).To<double>();
double a = StraightSegmentBetweenTwoJoints( firstAxisAuxiliaryJointPosition, secondAxisAuxiliaryJointPosition, firstAxisCenterJointPosition, secondAxisCenterJointPosition );
double b = StraightSegmentBetweenTwoJoints( firstAxisCenterJointPosition, secondAxisCenterJointPosition, firstAxisAuxiliaryJoint2Position, secondAxisAuxiliaryJoint2Position );
double c = StraightSegmentBetweenTwoJoints( firstAxisAuxiliaryJointPosition, secondAxisAuxiliaryJointPosition, firstAxisAuxiliaryJoint2Position, secondAxisAuxiliaryJoint2Position );
double resultInRadians = Math.Acos( ( Math.Pow( a, 2 ) + Math.Pow( b, 2 ) - Math.Pow( c, 2 ) ) / ( 2 * a * b ) );
double ResultInDegrees = resultInRadians * 180 / Math.PI;
return ResultInDegrees;
}
示例2: AxisController
/// <summary>
/// Build an AxisPositionController object.
///
/// </summary>
/// <param name="axis">Axis controlled by this object</param>
/// <param name="deviceController">Actual hardware controller</param>
/// <param name="minusSlewRate">Slew rate to use when moving in the MINUS orientation</param>
/// <param name="plusSlewRate">Slew rate to use when moving in the PLUS orientation</param>
public AxisController(Axis axis, DeviceController deviceController, double minusSlewRate, double plusSlewRate)
{
this.traceLogger = new TraceLogger("", "ArduinoST4 AxisPositionController " + axis.ToString());
this.traceLogger.Enabled = true;
this.axis = axis;
this.deviceController = deviceController;
this.minusSlewRate = minusSlewRate;
this.plusSlewRate = plusSlewRate;
this.axisMovementTracker = new AxisMovementTracker();
}
示例3: Set3DIndex
private static void Set3DIndex(ref int x, ref int y, ref int z, int index, Axis axis)
{
switch (axis)
{
case Axis.X:
x = index;
break;
case Axis.Y:
y = index;
break;
case Axis.Z:
z = index;
break;
default:
throw new ApplicationException("Unknown Axis: " + axis.ToString());
}
}
示例4: Coord
public static double Coord(this Point3D point, Axis axis)
{
switch (axis)
{
case Axis.X:
return point.X;
case Axis.Y:
return point.Y;
case Axis.Z:
return point.Z;
default:
throw new ApplicationException("Unknown Axis: " + axis.ToString());
}
}
示例5: GetTransform
/// <summary>
/// This tells how to rotate from 1,0,0 to the direction passed in
/// </summary>
private static Transform3D GetTransform(Axis axis, bool positiveDirection)
{
Vector3D desiredVector;
switch (axis)
{
case Axis.X:
if (positiveDirection)
{
// It's already built along positive X
return Transform3D.Identity;
}
else
{
desiredVector = new Vector3D(-1, 0, 0);
}
break;
case Axis.Y:
desiredVector = new Vector3D(0, positiveDirection ? 1 : -1, 0);
break;
case Axis.Z:
desiredVector = new Vector3D(0, 0, positiveDirection ? 1 : -1);
break;
default:
throw new ApplicationException("Unknown Axis: " + axis.ToString());
}
return new RotateTransform3D(new QuaternionRotation3D(Math3D.GetRotation(new Vector3D(1, 0, 0), desiredVector)));
}
示例6: Move
/// <summary>
/// Tell the hardware to start / stop moving on the given axis.
/// If the given orientation is null, the movement will stop.
/// </summary>
/// <param name="axis">Axis to move</param>
/// <param name="orientation">Orientation along the axis</param>
public void Move(Axis axis, Orientation? orientation)
{
//Do nothing if not connected
if (!this.Connected)
{
return;
}
String axisName = axis.ToString();
if (orientation == null)
{
//Stops the movement for the axis
this.CommandBool(axisName + "0");
}
else
{
String sign = (Orientation)orientation == Orientation.PLUS ? "+" : "-";
this.CommandBool(axisName + sign);
}
}