Example #1
0
 public GUIOrbitEditor(MissionProfile missionProfile)
 {
     // TODO: Maybe add a switch for complex and simple orbits, the complex editor might also include an option to copy an orbit from a reference-object ...
     this.body                = FlightGlobals.GetHomeBody();
     this.missionProfile      = missionProfile;
     this.altitudeSelector    = new GUIRichValueSelector("Altitude", Math.Floor(this.missionProfile.maxAltitude), "m", Math.Ceiling(this.missionProfile.minAltitude), Math.Floor(this.missionProfile.maxAltitude), true, "#,##0");
     this.inclinationSelector = new GUIRichValueSelector("Inclination", 0, "°", -180, 180, true, "+0.00;-0.00");
 }
 public GUITransportSelector(Vessel targetVessel, MissionProfile missionProfile)
 {
     this.targetVessel   = targetVessel;
     this.missionProfile = missionProfile;
     resourceSelectors   = new List <GUIRichValueSelector>();
     availableResources  = TargetVessel.GetFreeResourcesCapacities(targetVessel);
     foreach (var availablePayload in availableResources)
     {
         var selector = new GUIRichValueSelector(availablePayload.name, 0, "", 0, Math.Round(availablePayload.amount, 2), true, "#,##0.00");
         resourceSelectors.Add(selector);
     }
     crewTransferSelector = new GUICrewTransferSelector(targetVessel, missionProfile);
 }
Example #3
0
        public void Reset()
        {
            // Simple orbits:
            altitudeSelector    = new GUIRichValueSelector("Altitude", Math.Floor(this.missionProfile.maxAltitude), "m", Math.Ceiling(this.missionProfile.minAltitude), Math.Floor(this.missionProfile.maxAltitude), true, "#,##0");
            inclinationSelector = new GUIRichValueSelector("Inclination", 0, "°", -180, 180, true, "+0.000;-0.000");

            // Additional settings for complex orbits:
            eccentricitySelector             = new GUIRichValueSelector("Eccentricity", 0, "", 0, 1, true, "0.000");
            semiMajorAxisSelector            = new GUIRichValueSelector("SMA", Math.Floor(body.Radius + this.missionProfile.maxAltitude), "m", Math.Ceiling(body.Radius + this.missionProfile.minAltitude), Math.Floor(body.Radius + this.missionProfile.maxAltitude), true, "#,##0.0");
            longitudeOfAscendingNodeSelector = new GUIRichValueSelector("LAN", 0, "°", 0, 360, true, "0.000");
            argumentOfPeriapsisSelector      = new GUIRichValueSelector("AOP", 0, "°", 0, 360, true, "0.000");
            meanAnomalyAtEpochSelector       = new GUIRichValueSelector("MAE", 0, "° rad", -Math.PI, Math.PI, true, "0.000");
            showReferenceVessels             = false;
            referenceVesselEpoch             = 0;
        }