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

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

            m_CommandProcessor.Execute(command);
        }