Exemplo n.º 1
0
        public void TestTrimControl()
        {
            FlightControlSystem fcs = new FlightControlSystem();

            fcs.trimControl = true;

            fcs.TrimCollective  = 0.5;
            fcs.CollectiveInput = 0.5;
            fcs.Update(0.01);
            Assert.AreEqual(0.75, fcs.Collective, 0.001);

            fcs.TrimCollective  = -0.5;
            fcs.CollectiveInput = -0.5;
            fcs.Update(0.01);
            Assert.AreEqual(-0.75, fcs.Collective, 0.001);

            fcs.TrimCollective  = -0.5;
            fcs.CollectiveInput = 0.5;
            fcs.Update(0.01);
            Assert.AreEqual(0.25, fcs.Collective, 0.001);

            fcs.TrimCollective  = 0.5;
            fcs.CollectiveInput = -0.5;
            fcs.Update(0.01);
            Assert.AreEqual(-0.25, fcs.Collective, 0.001);
        }
Exemplo n.º 2
0
        public void NullZone_AboveNegative_Scales()
        {
            FlightControlSystem fcs = new FlightControlSystem();

            fcs.latNullZone = 0.2;
            fcs.LatInput    = -0.8;
            fcs.Update(0.01);
            Assert.AreEqual(-0.75, fcs.LatCyclic, 0.001);
        }
Exemplo n.º 3
0
        public void NullZone_BelowNegative_Returns0()
        {
            FlightControlSystem fcs = new FlightControlSystem();

            fcs.longNullZone = 0.5;
            fcs.LongInput    = -0.2;
            fcs.Update(0.01);
            Assert.AreEqual(0.0, fcs.LongCyclic, 0.001);
        }
Exemplo n.º 4
0
        public void CollectiveNullZone_NotTrimControl_DoesNotApply()
        {
            FlightControlSystem fcs = new FlightControlSystem();

            fcs.trimControl        = false;
            fcs.collectiveNullZone = 0.2;
            fcs.CollectiveInput    = 0.8;
            fcs.Update(0.01);
            Assert.AreEqual(0.8, fcs.Collective, 0.001);
        }
Exemplo n.º 5
0
        public void CollectiveNullZone_TrimControl_Applies()
        {
            FlightControlSystem fcs = new FlightControlSystem();

            fcs.trimControl        = true;
            fcs.collectiveNullZone = 0.2;
            fcs.CollectiveInput    = 0.8;
            fcs.Update(0.01);
            Assert.AreEqual(0.75, fcs.Collective, 0.001);
        }