public SingleOutputCmd(Output output, PwmSpeed speed) : this() { Output = output; SingleOutputMode = SingleOutputMode.Pwm; Data = (int)speed; }
public static int ToPercent(this PwmSpeed speed) { var index = Array.IndexOf(AscendingSpeeds, speed); var percent = (index - AscendingSpeeds.Length / 2) * 100; return(percent); }
public static ICommand Create(Output output, PwmSpeed speed) { return(new SingleOutputCmd(output, speed)); }
public static ICommand Create(PwmSpeed redSpeed, PwmSpeed blueSpeed) { return(new ComboPwmCmd(redSpeed, blueSpeed)); }
public void TestAngleToPosition(int angle, PwmSpeed expected) { PwmSpeed actual = angle.FromAngle(); Assert.AreEqual(expected, actual); }
public void TestPercentToSpeedConvertion(int percent, PwmSpeed expected) { PwmSpeed actual = percent.FromPercent(); Assert.AreEqual(expected, actual); }
public ComboPwmCmd(PwmSpeed redSpeed, PwmSpeed blueSpeed) : this() { RedSpeed = redSpeed; BlueSpeed = blueSpeed; }
public void Execute(Output output, PwmSpeed speed) { var command = CommandFactory.Create(output, speed); m_CommandProcessor.Execute(command); }
public void Execute(PwmSpeed redSpeed, PwmSpeed blueSpeed) { var command = CommandFactory.Create(redSpeed, blueSpeed); m_CommandProcessor.Execute(command); }