Beispiel #1
0
        public LandingBurnEvent(Vessel vessel, Connection connectionLink)
        {
            connection = connectionLink;
            firstStage = new F9FirstStage(vessel, RocketBody.F9_FIRST_STAGE);

            firstStage.firstStage = connection.SpaceCenter().ActiveVessel;

            //firstStage.landingBurn2(connection);
        }
Beispiel #2
0
        public Falcon9Event(Vessel vessel, Connection connectionLink, Connection connectionFirstStageLink)
        {
            connection           = connectionLink;
            connectionFirstStage = connectionFirstStageLink;
            firstStage           = new F9FirstStage(vessel, RocketBody.F9_FIRST_STAGE);
            var Falcon9 = firstStage;

            Console.WriteLine("Second Stage accisition signal.");

            Console.WriteLine("First Stage accisition signal.");

            Console.WriteLine("Loading...");
            //Task.Run(LoadSupervisor);
            //while (FalconSupervisor.Instance == null) { Thread.Sleep(1000); }
            Console.WriteLine("Loaded !");

            Task.Run(() => {
                while (true)
                {
                    FalconSupervisor.Execute(() =>
                    {
                        try
                        {
                            #region FirstStageThrust
                            FalconSupervisor.Instance.lb_PowerCentral.Text = Math.Round(firstStage.firstStage.Parts.WithTag("MainCentral")[0].Engine.Thrust).ToString() + "kN";
                            FalconSupervisor.Instance.lb_PowerSecond1.Text = Math.Round(firstStage.firstStage.Parts.WithTag("MainSecond")[1].Engine.Thrust).ToString() + "kN";
                            FalconSupervisor.Instance.lb_PowerSecond0.Text = Math.Round(firstStage.firstStage.Parts.WithTag("MainSecond")[0].Engine.Thrust).ToString() + "kN";
                            FalconSupervisor.Instance.lb_PowerMain1.Text   = Math.Round(firstStage.firstStage.Parts.WithTag("Main")[1].Engine.Thrust).ToString() + "kN";
                            FalconSupervisor.Instance.lb_PowerMain2.Text   = Math.Round(firstStage.firstStage.Parts.WithTag("Main")[2].Engine.Thrust).ToString() + "kN";
                            FalconSupervisor.Instance.lb_PowerMain3.Text   = Math.Round(firstStage.firstStage.Parts.WithTag("Main")[3].Engine.Thrust).ToString() + "kN";
                            FalconSupervisor.Instance.lb_PowerMain4.Text   = Math.Round(firstStage.firstStage.Parts.WithTag("Main")[4].Engine.Thrust).ToString() + "kN";
                            FalconSupervisor.Instance.lb_PowerMain5.Text   = Math.Round(firstStage.firstStage.Parts.WithTag("Main")[5].Engine.Thrust).ToString() + "kN";
                            FalconSupervisor.Instance.lb_PowerMain0.Text   = Math.Round(firstStage.firstStage.Parts.WithTag("Main")[0].Engine.Thrust).ToString() + "kN";
                            #endregion

                            #region CenterEngine
                            if (firstStage.firstStage.Parts.WithTag("MainCentral")[0].Engine.Thrust > 0 && firstStage.firstStage.Parts.WithTag("MainCentral")[0].Engine.Thrust < 700000)
                            {
                                FalconSupervisor.Instance.pb_CenterEngine.Image = Image.FromFile("C:/Users/Utilisateur/Documents/SpaceX Computer/SpaceXComputer/SpaceXComputer/SpaceX/Falcon 9/Engine-Yellow.png");
                            }
                            else if (firstStage.firstStage.Parts.WithTag("MainCentral")[0].Engine.Thrust > 0 && firstStage.firstStage.Parts.WithTag("MainCentral")[0].Engine.Thrust >= 700000)
                            {
                                FalconSupervisor.Instance.pb_CenterEngine.Image = Image.FromFile("C:/Users/Utilisateur/Documents/SpaceX Computer/SpaceXComputer/SpaceXComputer/SpaceX/Falcon 9/Engine-Green.png");
                            }
                            else
                            {
                                FalconSupervisor.Instance.pb_CenterEngine.Image = Image.FromFile("C:/Users/Utilisateur/Documents/SpaceX Computer/SpaceXComputer/SpaceXComputer/SpaceX/Falcon 9/Engine-Red.png");
                            }
                            #endregion

                            #region SecondsEngines
                            if (firstStage.firstStage.Parts.WithTag("MainSecond")[0].Engine.Thrust > 0 && firstStage.firstStage.Parts.WithTag("MainSecond")[0].Engine.Thrust < 700000)
                            {
                                FalconSupervisor.Instance.pb_Second0.Image = Image.FromFile("C:/Users/Utilisateur/Documents/SpaceX Computer/SpaceXComputer/SpaceXComputer/SpaceX/Falcon 9/Engine-Yellow.png");
                            }
                            else if (firstStage.firstStage.Parts.WithTag("MainSecond")[0].Engine.Thrust > 0 && firstStage.firstStage.Parts.WithTag("MainSecond")[0].Engine.Thrust >= 700000)
                            {
                                FalconSupervisor.Instance.pb_Second0.Image = Image.FromFile("C:/Users/Utilisateur/Documents/SpaceX Computer/SpaceXComputer/SpaceXComputer/SpaceX/Falcon 9/Engine-Green.png");
                            }
                            else
                            {
                                FalconSupervisor.Instance.pb_Second0.Image = Image.FromFile("C:/Users/Utilisateur/Documents/SpaceX Computer/SpaceXComputer/SpaceXComputer/SpaceX/Falcon 9/Engine-Red.png");
                            }

                            if (firstStage.firstStage.Parts.WithTag("MainSecond")[1].Engine.Thrust > 0 && firstStage.firstStage.Parts.WithTag("MainSecond")[1].Engine.Thrust < 700000)
                            {
                                FalconSupervisor.Instance.pb_Second1.Image = Image.FromFile("C:/Users/Utilisateur/Documents/SpaceX Computer/SpaceXComputer/SpaceXComputer/SpaceX/Falcon 9/Engine-Yellow.png");
                            }
                            else if (firstStage.firstStage.Parts.WithTag("MainSecond")[1].Engine.Thrust > 0 && firstStage.firstStage.Parts.WithTag("MainSecond")[1].Engine.Thrust >= 700000)
                            {
                                FalconSupervisor.Instance.pb_Second1.Image = Image.FromFile("C:/Users/Utilisateur/Documents/SpaceX Computer/SpaceXComputer/SpaceXComputer/SpaceX/Falcon 9/Engine-Green.png");
                            }
                            else
                            {
                                FalconSupervisor.Instance.pb_Second1.Image = Image.FromFile("C:/Users/Utilisateur/Documents/SpaceX Computer/SpaceXComputer/SpaceXComputer/SpaceX/Falcon 9/Engine-Red.png");
                            }
                            #endregion

                            #region MainEngines
                            if (firstStage.firstStage.Parts.WithTag("Main")[0].Engine.Thrust > 0 && firstStage.firstStage.Parts.WithTag("Main")[0].Engine.Thrust < 700000)
                            {
                                FalconSupervisor.Instance.pb_Main0.Image = Image.FromFile("C:/Users/Utilisateur/Documents/SpaceX Computer/SpaceXComputer/SpaceXComputer/SpaceX/Falcon 9/Engine-Yellow.png");
                            }
                            else if (firstStage.firstStage.Parts.WithTag("Main")[0].Engine.Thrust > 0 && firstStage.firstStage.Parts.WithTag("Main")[0].Engine.Thrust >= 700000)
                            {
                                FalconSupervisor.Instance.pb_Main0.Image = Image.FromFile("C:/Users/Utilisateur/Documents/SpaceX Computer/SpaceXComputer/SpaceXComputer/SpaceX/Falcon 9/Engine-Green.png");
                            }
                            else
                            {
                                FalconSupervisor.Instance.pb_Main0.Image = Image.FromFile("C:/Users/Utilisateur/Documents/SpaceX Computer/SpaceXComputer/SpaceXComputer/SpaceX/Falcon 9/Engine-Red.png");
                            }

                            if (firstStage.firstStage.Parts.WithTag("Main")[1].Engine.Thrust > 0 && firstStage.firstStage.Parts.WithTag("Main")[1].Engine.Thrust < 700000)
                            {
                                FalconSupervisor.Instance.pb_Main1.Image = Image.FromFile("C:/Users/Utilisateur/Documents/SpaceX Computer/SpaceXComputer/SpaceXComputer/SpaceX/Falcon 9/Engine-Yellow.png");
                            }
                            else if (firstStage.firstStage.Parts.WithTag("Main")[1].Engine.Thrust > 0 && firstStage.firstStage.Parts.WithTag("Main")[1].Engine.Thrust >= 700000)
                            {
                                FalconSupervisor.Instance.pb_Main1.Image = Image.FromFile("C:/Users/Utilisateur/Documents/SpaceX Computer/SpaceXComputer/SpaceXComputer/SpaceX/Falcon 9/Engine-Green.png");
                            }
                            else
                            {
                                FalconSupervisor.Instance.pb_Main1.Image = Image.FromFile("C:/Users/Utilisateur/Documents/SpaceX Computer/SpaceXComputer/SpaceXComputer/SpaceX/Falcon 9/Engine-Red.png");
                            }

                            if (firstStage.firstStage.Parts.WithTag("Main")[2].Engine.Thrust > 0 && firstStage.firstStage.Parts.WithTag("Main")[2].Engine.Thrust < 700000)
                            {
                                FalconSupervisor.Instance.pb_Main2.Image = Image.FromFile("C:/Users/Utilisateur/Documents/SpaceX Computer/SpaceXComputer/SpaceXComputer/SpaceX/Falcon 9/Engine-Yellow.png");
                            }
                            else if (firstStage.firstStage.Parts.WithTag("Main")[2].Engine.Thrust > 0 && firstStage.firstStage.Parts.WithTag("Main")[2].Engine.Thrust >= 700000)
                            {
                                FalconSupervisor.Instance.pb_Main2.Image = Image.FromFile("C:/Users/Utilisateur/Documents/SpaceX Computer/SpaceXComputer/SpaceXComputer/SpaceX/Falcon 9/Engine-Green.png");
                            }
                            else
                            {
                                FalconSupervisor.Instance.pb_Main2.Image = Image.FromFile("C:/Users/Utilisateur/Documents/SpaceX Computer/SpaceXComputer/SpaceXComputer/SpaceX/Falcon 9/Engine-Red.png");
                            }

                            if (firstStage.firstStage.Parts.WithTag("Main")[3].Engine.Thrust > 0 && firstStage.firstStage.Parts.WithTag("Main")[3].Engine.Thrust < 700000)
                            {
                                FalconSupervisor.Instance.pb_Main3.Image = Image.FromFile("C:/Users/Utilisateur/Documents/SpaceX Computer/SpaceXComputer/SpaceXComputer/SpaceX/Falcon 9/Engine-Yellow.png");
                            }
                            else if (firstStage.firstStage.Parts.WithTag("Main")[3].Engine.Thrust > 0 && firstStage.firstStage.Parts.WithTag("Main")[3].Engine.Thrust >= 700000)
                            {
                                FalconSupervisor.Instance.pb_Main3.Image = Image.FromFile("C:/Users/Utilisateur/Documents/SpaceX Computer/SpaceXComputer/SpaceXComputer/SpaceX/Falcon 9/Engine-Green.png");
                            }
                            else
                            {
                                FalconSupervisor.Instance.pb_Main3.Image = Image.FromFile("C:/Users/Utilisateur/Documents/SpaceX Computer/SpaceXComputer/SpaceXComputer/SpaceX/Falcon 9/Engine-Red.png");
                            }

                            if (firstStage.firstStage.Parts.WithTag("Main")[4].Engine.Thrust > 0 && firstStage.firstStage.Parts.WithTag("Main")[4].Engine.Thrust < 700000)
                            {
                                FalconSupervisor.Instance.pb_Main4.Image = Image.FromFile("C:/Users/Utilisateur/Documents/SpaceX Computer/SpaceXComputer/SpaceXComputer/SpaceX/Falcon 9/Engine-Yellow.png");
                            }
                            else if (firstStage.firstStage.Parts.WithTag("Main")[4].Engine.Thrust > 0 && firstStage.firstStage.Parts.WithTag("Main")[4].Engine.Thrust >= 700000)
                            {
                                FalconSupervisor.Instance.pb_Main4.Image = Image.FromFile("C:/Users/Utilisateur/Documents/SpaceX Computer/SpaceXComputer/SpaceXComputer/SpaceX/Falcon 9/Engine-Green.png");
                            }
                            else
                            {
                                FalconSupervisor.Instance.pb_Main4.Image = Image.FromFile("C:/Users/Utilisateur/Documents/SpaceX Computer/SpaceXComputer/SpaceXComputer/SpaceX/Falcon 9/Engine-Red.png");
                            }

                            if (firstStage.firstStage.Parts.WithTag("Main")[5].Engine.Thrust > 0 && firstStage.firstStage.Parts.WithTag("Main")[5].Engine.Thrust < 700000)
                            {
                                FalconSupervisor.Instance.pb_Main5.Image = Image.FromFile("C:/Users/Utilisateur/Documents/SpaceX Computer/SpaceXComputer/SpaceXComputer/SpaceX/Falcon 9/Engine-Yellow.png");
                            }
                            else if (firstStage.firstStage.Parts.WithTag("Main")[5].Engine.Thrust > 0 && firstStage.firstStage.Parts.WithTag("Main")[5].Engine.Thrust >= 700000)
                            {
                                FalconSupervisor.Instance.pb_Main5.Image = Image.FromFile("C:/Users/Utilisateur/Documents/SpaceX Computer/SpaceXComputer/SpaceXComputer/SpaceX/Falcon 9/Engine-Green.png");
                            }
                            else
                            {
                                FalconSupervisor.Instance.pb_Main5.Image = Image.FromFile("C:/Users/Utilisateur/Documents/SpaceX Computer/SpaceXComputer/SpaceXComputer/SpaceX/Falcon 9/Engine-Red.png");
                            }
                            #endregion



                            FalconSupervisor.Instance.lb_Debug.Text = "Speed : " + Math.Round(firstStage.firstStage.Flight(firstStage.firstStage.SurfaceReferenceFrame).TrueAirSpeed).ToString();
                        }
                        catch
                        {
                        }
                    });

                    Thread.Sleep(200);
                }
            });

            //Thread.Sleep(5000);

            foreach (Vessel vesselTarget in connection.SpaceCenter().Vessels)
            {
                if (Startup.GetInstance().GetFlightInfo().getDragon() == false)
                {
                    if (vesselTarget.Name.Contains("Dragon SpX-C2") && vesselTarget.Type.Equals(VesselType.Probe))
                    {
                        firstStage.firstStage      = vesselTarget;
                        firstStage.firstStage.Name = "Falcon 9 Full";
                        Console.WriteLine("FALCON 9 : Falcon 9 accisition signal.");
                        break;
                    }
                }
                else if (Startup.GetInstance().GetFlightInfo().getDragon() == true)
                {
                    if (vesselTarget.Name.Equals("Falcon 9 Dragon COTS-1") && vesselTarget.Type.Equals(VesselType.Probe))
                    {
                        firstStage.firstStage      = vesselTarget;
                        firstStage.firstStage.Name = "Falcon 9 Dragon";
                        Console.WriteLine("FALCON 9 : Falcon 9 accisition signal.");
                        break;
                    }
                }
            }

            if (Startup.GetInstance().GetFlightInfo().getLZ() == "OCISLY")
            {
                droneShip = new F9FirstStage(vessel, RocketBody.OCISLY);
                foreach (Vessel vesselTarget in connectionFirstStage.SpaceCenter().Vessels)
                {
                    if (vesselTarget.Name.Contains("Of Course I Still Love You") && vesselTarget.Type.Equals(VesselType.Relay))
                    {
                        firstStage.droneShip      = vesselTarget;
                        firstStage.droneShip.Name = "Of Course I Still Love You";
                        Console.WriteLine("FIRST STAGE : OCISLY accisition signal.");
                        Console.WriteLine($"Lat = {firstStage.droneShip.Flight(firstStage.droneShip.SurfaceReferenceFrame).Latitude} | Long = {firstStage.droneShip.Flight(firstStage.droneShip.SurfaceReferenceFrame).Longitude}");
                        //break;
                    }
                }
            }

            Falcon9.F9Startup(connection, connectionFirstStageLink);

            /*Thread Abort = new Thread(FlightAbort);
             * Abort.Start();*/

            while (firstStage.firstStage.Flight(null).SurfaceAltitude < 100)
            {
                Thread.Sleep(100);
            }

            Thread GravityTurn = new Thread(gravityTurn);
            GravityTurn.Start();
            stageSep();

            foreach (Vessel vesselTargetFirst in connectionFirstStage.SpaceCenter().Vessels)
            {
                if (vesselTargetFirst.Name.Contains("Falcon 9") && vesselTargetFirst.Name.Contains("") && vesselTargetFirst.Type.Equals(VesselType.Probe))
                {
                    secondStage            = new F9SecondStage(vessel, RocketBody.F9_SECOND_STAGE);
                    firstStage.secondStage = secondStage;
                    secondStage.secondStage.Control.Forward = 1;
                    secondStage.secondStage.Name            = "F9 Second Stage";
                    secondStage.rocketBody = RocketBody.F9_SECOND_STAGE;
                    Console.WriteLine("FALCON 9 : Second Stage as configured.");
                }
            }


            firstStage.switchToSecondStage = true;

            /*foreach (Vessel vesselTargetSecond in connection.SpaceCenter().Vessels)
             * {
             *  if (Startup.GetInstance().GetFlightInfo().getDragon() == false)
             *  {
             *      if (vesselTargetSecond.Name.Equals("Falcon 9 Block 6.1") && vesselTargetSecond.Type.Equals(VesselType.Probe))
             *      {
             *          secondStage.secondStage = vesselTargetSecond;
             *          secondStage.secondStage.Name = "Falcon 9 Second Stage";
             *          Console.WriteLine("FALCON 9 : Second stage accisition signal.");
             *          break;
             *      }
             *  }
             *  else if (Startup.GetInstance().GetFlightInfo().getDragon() == true)
             *  {
             *      if (vesselTargetSecond.Name.Equals("Falcon 9 Dragon COTS-1") && vesselTargetSecond.Type.Equals(VesselType.Probe))
             *      {
             *          secondStage.secondStage = vesselTargetSecond;
             *          secondStage.secondStage.Name = "Falcon 9 Second Stage";
             *          Console.WriteLine("FALCON 9 : Second stage accisition signal.");
             *          break;
             *      }
             *  }
             * }*/
            foreach (Vessel vesselTargetFirst in connectionFirstStage.SpaceCenter().Vessels)
            {
                if (vesselTargetFirst.Name.Contains("Falcon 9") && vesselTargetFirst.Name.Contains("Sonde") && vesselTargetFirst.Type.Equals(VesselType.Probe))
                {
                    firstStage.firstStage      = vesselTargetFirst;
                    firstStage.firstStage.Name = "F9 First Stage";
                    firstStage.rocketBody      = RocketBody.F9_FIRST_STAGE;
                    Console.WriteLine("FALCON 9 : First Stage as configured.");
                }
            }

            if (Startup.GetInstance().GetFlightInfo().getLZ() == "OCISLY")
            {
                droneShip = new F9FirstStage(vessel, RocketBody.OCISLY);
                foreach (Vessel vesselTarget in connectionFirstStage.SpaceCenter().Vessels)
                {
                    if (vesselTarget.Name.Contains("Of Course I Still Love You") && vesselTarget.Type.Equals(VesselType.Relay))
                    {
                        firstStage.droneShip      = vesselTarget;
                        firstStage.droneShip.Name = "Of Course I Still Love You";
                        Console.WriteLine("FIRST STAGE : OCISLY accisition signal.");
                        break;
                    }
                }
            }
            //connectionFirstStage = new Connection(address: IPAddress.Parse("192.168.1.88"), rpcPort: 50000, streamPort: 50001);
            firstStage.ConnectionF91stStage(connection);
            Thread Boostback = new Thread(firstStage.boostbackStart);
            //Boostback.Start();
            secondStage.SecondStageStartup();
            Thread FairingSep = new Thread(secondStage.fairingSep);
            FairingSep.Start();
            secondStage.SECO(vessel, connection);
            secondStage.satSep();

            Console.WriteLine("Stop ?");
            while (Console.ReadLine() != "stop")
            {
            }
        }
Beispiel #3
0
        public FalconheavyEvent(Vessel vessel, Connection connectionLink)
        {
            connection = connectionLink;
            centerCore = new FHCenterCore(vessel, RocketBody.FH_CENTERCORE);
            foreach (Vessel vesselTarget in connection.SpaceCenter().Vessels)
            {
                if (vesselTarget.Name.Equals("Falcon Heavy") && vesselTarget.Type.Equals(VesselType.Probe))
                {
                    centerCore.centerCore      = vesselTarget;
                    centerCore.centerCore.Name = "Falcon Heavy Full";
                    Console.WriteLine("FH : Falcon Heavy accisition signal.");
                    break;
                }
            }

            centerCore.FHStartup(connection);
            Thread GT = new Thread(gravityTurn);

            GT.Start();
            BECO();

            sideBoosterA = new F9FirstStage(vessel, RocketBody.FH_SIDEBOOSTER_A);
            foreach (Vessel vesselTargetFirst in connection.SpaceCenter().Vessels)
            {
                if (vesselTargetFirst.Name.Equals("FH Side Booster B") && vesselTargetFirst.Type.Equals(VesselType.Probe))
                {
                    sideBoosterA.firstStage      = vesselTargetFirst;
                    sideBoosterA.firstStage.Name = "FH Side Booster B";
                    Console.WriteLine("FH : SideBoosterB as configured.");
                }
            }
            sideBoosterB = new F9FirstStage(vessel, RocketBody.FH_SIDEBOOSTER_B);
            foreach (Vessel vesselTargetFirst in connection.SpaceCenter().Vessels)
            {
                if (vesselTargetFirst.Name.Equals("FH Side Booster A") && vesselTargetFirst.Type.Equals(VesselType.Probe))
                {
                    sideBoosterA.firstStage      = vesselTargetFirst;
                    sideBoosterA.firstStage.Name = "FH Side Booster A";
                    Console.WriteLine("FH : SideBoosterA as configured.");
                }
            }
            sideBoosterA.FHsignal(connectionLink, connectionFirstStage);
            sideBoosterB.FHsignal(connectionLink, connectionFirstStage);
            Thread BoostbackA = new Thread(sideBoosterA.boostbackStart);

            BoostbackA.Start();
            Thread BoostbackB = new Thread(sideBoosterB.boostbackStart);
            //BoostbackB.Start();

            /*stageSep();
             *
             * secondStage = new F9SecondStage(vessel, RocketBody.F9_SECOND_STAGE);
             *
             * foreach (Vessel vesselTargetSecond in connection.SpaceCenter().Vessels)
             * {
             *  if (vesselTargetSecond.Name.Equals("Falcon Heavy Block 6") && vesselTargetSecond.Type.Equals(VesselType.Probe))
             *  {
             *      secondStage.secondStage = vesselTargetSecond;
             *      secondStage.secondStage.Name = "Falcon Heavy Second Stage";
             *      Console.WriteLine("FH : Second stage accisition signal.");
             *      break;
             *  }
             * }
             *
             * secondStage.SecondStageStartup();
             * Thread FairingSep = new Thread(secondStage.fairingSep);
             * FairingSep.Start();
             * secondStage.SECO(vessel, connection);
             * secondStage.satSep();*/
        }