internal virtual void SendProgressiveCommand(IProgressiveCommand args) { string command; ProgressiveCommandFormatter.Load(args); if (args.AbsoluteControlMode) { string message = string.Format("{0},{1},{2},{3},{4},{5},{6}", (int)ProgressiveCommandFormatter.Mode, ProgressiveCommandFormatter.Roll, ProgressiveCommandFormatter.Pitch, ProgressiveCommandFormatter.Gaz, ProgressiveCommandFormatter.Yaw, ProgressiveCommandFormatter.MagnetoPsi, ProgressiveCommandFormatter.MagnetoPsiAccuracy); command = CommandFormatter.CreateCommand(PcmdMagCommand, message); } else { string message = string.Format("{0},{1},{2},{3},{4}", (int)ProgressiveCommandFormatter.Mode, ProgressiveCommandFormatter.Roll, ProgressiveCommandFormatter.Pitch, ProgressiveCommandFormatter.Gaz, ProgressiveCommandFormatter.Yaw); command = CommandFormatter.CreateCommand(PcmdCommand, message); } CommandQueue.Enqueue(command); }
private void TestPitchAndRollUnderThreshold(float pitch, float roll) { _mockProgressiveCommand.Setup(x => x.Pitch).Returns(pitch); _mockProgressiveCommand.Setup(x => x.Roll).Returns(roll); // Act _target.Load(_mockProgressiveCommand.Object); // Assert _target.Pitch.Should().Be(0); _target.Roll.Should().Be(0); (_target.Mode & ProgressiveCommandFormatter.Modes.EnableProgressiveCommands).Should().Be((ProgressiveCommandFormatter.Modes) 0); }