Example #1
0
 public SingleOutputCmd(Output output, PwmSpeed speed)
     : this()
 {
     Output           = output;
     SingleOutputMode = SingleOutputMode.Pwm;
     Data             = (int)speed;
 }
Example #2
0
        public static int ToPercent(this PwmSpeed speed)
        {
            var index   = Array.IndexOf(AscendingSpeeds, speed);
            var percent = (index - AscendingSpeeds.Length / 2) * 100;

            return(percent);
        }
Example #3
0
 public static ICommand Create(Output output, PwmSpeed speed)
 {
     return(new SingleOutputCmd(output, speed));
 }
Example #4
0
 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);
        }
Example #7
0
 public ComboPwmCmd(PwmSpeed redSpeed, PwmSpeed blueSpeed)
     : this()
 {
     RedSpeed  = redSpeed;
     BlueSpeed = blueSpeed;
 }
Example #8
0
        public void Execute(Output output, PwmSpeed speed)
        {
            var command = CommandFactory.Create(output, speed);

            m_CommandProcessor.Execute(command);
        }
Example #9
0
        public void Execute(PwmSpeed redSpeed, PwmSpeed blueSpeed)
        {
            var command = CommandFactory.Create(redSpeed, blueSpeed);

            m_CommandProcessor.Execute(command);
        }