private static void LaunchSetup(FlightParameters FlightParamaters)
        {
            #region Vessel Properties

            vesselProperty.StartingThrottle          = 0.75f;
            vesselProperty.MaxFuelFirstStage         = 11985;
            vesselProperty.MaxFuelSecondStage        = 3325;
            vesselProperty.FuelNeededForCoreRecovery = 1100;

            #endregion

            #region Flight Parameters

            FlightParamaters.SpoolEngines      = true;
            FlightParamaters.TurnStartAltitude = 1000;
            FlightParamaters.TurnEndAltitude   = 26500;
            FlightParamaters.TargetApoapsis    = 200000;

            #endregion

            #region Vessel Controls

            vessel.Control.SAS      = true;
            vessel.Control.RCS      = false;
            vessel.Control.Lights   = true;
            vessel.Control.Throttle = vesselProperty.StartingThrottle;
            vessel.AutoPilot.TargetPitchAndHeading(90, 90);

            #endregion
        }
Exemple #2
0
        public CraftControls(Connection Connection, FlightParameters FlightParams)
        {
            connection   = Connection;
            flightParams = FlightParams;

            var spaceCenter = connection.SpaceCenter();

            vessel = spaceCenter.ActiveVessel;
        }
        public FlightControls(Connection Connection, VesselProperty VesselProperty, FlightParameters FlightParams, CraftControls CraftControls)
        {
            connection     = Connection;
            vesselProperty = VesselProperty;
            flightParams   = FlightParams;
            craftControls  = CraftControls;

            var spaceCenter = connection.SpaceCenter();

            vessel = spaceCenter.ActiveVessel;

            var flight = vessel.Flight();

            altitudeASL = connection.AddStream(() => flight.MeanAltitude);
        }
        public static void Main()
        {
            #region Variables

            var launchSequence   = new LaunchSequence();
            var flightParamaters = new FlightParameters();
            var craftControls    = new CraftControls(connection, flightParamaters);
            var flightControls   = new FlightControls(connection, vesselProperty, flightParamaters, craftControls);

            #endregion

            Console.WriteLine("Current Vessel: {0}", vessel.Name);
            Console.WriteLine();

            LaunchSetup(flightParamaters);
            StartFueling();
            launchSequence.BeginLaunchSequence(connection, flightParamaters.SpoolEngines);

            flightControls.RollProgram();
            flightControls.GravityTurn();
            flightControls.AscentToApoapsis();
            flightControls.OrbitalInsertion();
        }