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

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

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

            m_CommandProcessor.Execute(command);
        }