示例#1
0
        public Carbon2HopperEvent(Vessel vessel, Connection connectionLink)
        {
            connection = connectionLink;
            firstStage = new C2FirstStage(vessel, RocketBody.C2_FIRST_STAGE);
            var CarbonII = firstStage;

            foreach (Vessel vesselTarget in connection.SpaceCenter().Vessels)
            {
                if (vesselTarget.Name.Contains("Carbon II Hopper") && vesselTarget.Type.Equals(VesselType.Probe))
                {
                    firstStage.firstStage      = vesselTarget;
                    firstStage.firstStage.Name = "Carbon II Hopper";
                    Console.WriteLine("CARBON Hopper : Carbon accisition signal.");
                    break;
                }
            }

            firstStage.firstStage.AutoPilot.Engage();
            firstStage.firstStage.AutoPilot.TargetPitch   = 90;
            firstStage.firstStage.Control.Throttle        = 1;
            firstStage.firstStage.Parts.Engines[0].Active = true;
            Console.WriteLine("CARBON Hopper : Liftoff.");

            while (firstStage.firstStage.Flight(null).SurfaceAltitude < 1000)
            {
            }

            firstStage.firstStage.Control.Throttle = 0;

            while (firstStage.firstStage.Flight(firstStage.firstStage.Orbit.Body.ReferenceFrame).VerticalSpeed > 0)
            {
            }
            firstStage.firstStage.Control.Brakes        = true;
            firstStage.firstStage.AutoPilot.TargetPitch = 90;
            Thread LZ = new Thread(firstStage.LandingTarget);

            LZ.Start();
            firstStage.landingBurn();
            Thread.Sleep(9999999);
        }
示例#2
0
        public Carbon2Event(Vessel vessel, Connection connectionLink)
        {
            connection = connectionLink;
            firstStage = new C2FirstStage(vessel, RocketBody.C2_FIRST_STAGE);
            var CarbonII = firstStage;

            foreach (Vessel vesselTarget in connection.SpaceCenter().Vessels)
            {
                if (vesselTarget.Name.Contains("Carbon II") && vesselTarget.Type.Equals(VesselType.Probe))
                {
                    firstStage.firstStage      = vesselTarget;
                    firstStage.firstStage.Name = "Carbon II Full";
                    Console.WriteLine("CARBON II : Carbon II accisition signal.");
                    break;
                }
            }

            CarbonII.C2Startup();
            while (firstStage.firstStage.Flight(null).MeanAltitude < 300)
            {
                Thread.Sleep(100);
            }

            Thread GravityTurn = new Thread(gravityTurn);

            GravityTurn.Start();
            stageSep();

            secondStage = new C2SecondStage(vessel);

            foreach (Vessel vesselTargetSecond in connection.SpaceCenter().Vessels)
            {
                if ((vesselTargetSecond.Name.Contains("Carbon II") || vesselTargetSecond.Name.Contains("C2")) && vesselTargetSecond.Type.Equals(VesselType.Probe))
                {
                    secondStage.secondStage      = vesselTargetSecond;
                    secondStage.secondStage.Name = "Carbon II Second Stage";
                    Console.WriteLine("CARBON II : Second stage accisition signal.");
                    break;
                }
            }

            secondStage.SecondStageStartup();
            Thread FairingSep = new Thread(secondStage.fairingSep);

            FairingSep.Start();
            Thread SECO = new Thread(secondStage.SECO);

            SECO.Start();
            stage2Sep();

            thirdStage = new C2ThirdStage(vessel);
            foreach (Vessel vesselTargetThird in connection.SpaceCenter().Vessels)
            {
                if ((vesselTargetThird.Name.Contains("Carbon II") != vesselTargetThird.Name.Contains("Full")) && vesselTargetThird.Type.Equals(VesselType.Probe))
                {
                    secondStage.secondStage    = vesselTargetThird;
                    thirdStage.thirdStage      = vesselTargetThird;
                    thirdStage.thirdStage.Name = "Carbon II Third Stage";
                    Console.WriteLine("CARBON II : Third stage accisition signal.");
                }
            }
        }