public EnginesStats GetEnginesStats()
            {
                var stats = new EnginesStats(Engines, VSL);

                stats.MaxDeltaV = DeltaV(stats.MaxThrust.magnitude / stats.MaxMassFlow, stats.MaxFuelMass);
                return(stats);
            }
            public EnginesStats GetEnginesStats()
            {
                var stats = new EnginesStats(VSL);

                for (int i = 0, count = Engines.Count; i < count; i++)
                {
                    var e = Engines[i];
                    e.InitState();
                    e.InitTorque(VSL, GLB.ENG.TorqueRatioFactor);
                    var throttle = e.Role == TCARole.MANUAL ? e.thrustLimit : 1;
                    if (throttle > 0)
                    {
                        var thrust = e.nominalCurrentThrust(throttle);
                        if (e.Role != TCARole.MANEUVER)
                        {
                            stats.MaxThrust    += e.wThrustDir * thrust;
                            stats.MaxDefThrust += e.defThrustDir * thrust;
                            stats.MaxMassFlow  += e.MaxFuelFlow * throttle;
                            //stats.MaxFuelMass += ;
                        }
                        if (e.isSteering)
                        {
                            stats.TorqueLimits.Add(e.specificTorque * thrust);
                        }
                    }
                }
                stats.MaxDeltaV = DeltaV(stats.MaxThrust.magnitude / stats.MaxMassFlow, stats.MaxFuelMass);
                stats.Update();
                return(stats);
            }
Ejemplo n.º 3
0
        public EnginesStats GetEnginesStats(IList <EngineWrapper> engines)
        {
            var stats = new EnginesStats();

            for (int i = 0, count = engines.Count; i < count; i++)
            {
                var e = engines[i];
                e.InitState();
                e.InitTorque(VSL, GLB.ENG.TorqueRatioFactor);
                var throttle = e.Role == TCARole.MANUAL ? e.thrustLimit : 1;
                if (throttle > 0)
                {
                    var thrust = e.nominalCurrentThrust(throttle);
                    if (e.Role != TCARole.MANEUVER)
                    {
                        stats.Thrust   += e.wThrustDir * thrust;
                        stats.MassFlow += e.MaxFuelFlow * throttle;
                    }
                    if (e.isSteering)
                    {
                        stats.TorqueLimits.Add(e.specificTorque * thrust);
                    }
                }
            }
            stats.Torque   = stats.TorqueLimits.Max;
            stats.AngularA = VSL.Torque.AngularAcceleration(stats.Torque);
            return(stats);
        }
 public void Init()
 {
     eStats = VSL.Engines.NoActiveEngines ?
              VSL.Engines.GetNearestEnginedStageStats() :
              VSL.Engines.GetEnginesStats(VSL.Engines.Active);
     pitch.setPID(TargetedToOrbitExecutor.C.TargetPitchPID);
     pitch.Min = -AttitudeControlBase.C.MaxAttitudeError;
     pitch.Reset();
     throttle.setPID(ToOrbitExecutor.C.ThrottlePID);
     throttle.setClamp(0.5f);
     throttle.Reset();
     throttle_correction.setPID(TargetedToOrbitExecutor.C.ThrottleCorrectionPID);
     throttle_correction.Reset();
     correction_started.Reset();
 }