private ConstantInstruction(ConstantInstruction originalInstruction, InstructionOrientation newOrientation) : base(originalInstruction.StepCount, newOrientation) { BaseDeltaT = originalInstruction.BaseDeltaT; PeriodNumerator = originalInstruction.PeriodNumerator; Offset = originalInstruction.Offset; }
private AccelerationInstruction(AccelerationInstruction originalInstruction, InstructionOrientation newOrientation) : base(originalInstruction.StepCount, newOrientation) { InitialDeltaT = originalInstruction.InitialDeltaT; StartN = originalInstruction.StartN; BaseDelta = originalInstruction.BaseDelta; BaseRemainder = originalInstruction.BaseRemainder; }
private static int transformSteps(int stepCount, InstructionOrientation dirV, int maxSteps) { if (dirV == InstructionOrientation.Reversed) { return(maxSteps - stepCount); } return(stepCount); }
/// </inheritdoc> internal override StepInstrution WithOrientation(InstructionOrientation orientation) { if (Orientation == orientation) { return(this); } return(new ConstantInstruction(this, orientation)); }
private bool checkHomeBoundary(int position, InstructionOrientation orientation, int maxStepCount) { switch (orientation) { case InstructionOrientation.Normal: return(position <= 0); case InstructionOrientation.Reversed: return(position >= maxStepCount); default: return(true); } }
protected StepInstrution(Int16 stepCount, InstructionOrientation orientation) { StepCount = stepCount; Orientation = orientation; }
/// <summary> /// Reorganizes instruction according to given orientation if needed. /// Internal orientation info is kept, therefore, applying same orientation more than once won't change anything. /// </summary> /// <param name="orientation">The provided direction. When instrution is created, direction is Normal.</param> /// <returns>Instruction with desired orientation.</returns> internal abstract StepInstrution WithOrientation(InstructionOrientation orientation);