public string GetPositionTargetString() { if (target is PositionTarget) { return(Coordinates.ToStringDMS(targetLatitude, targetLongitude, true)); } if (NormalTargetExists) { return(Coordinates.ToStringDMS(TargetOrbit.referenceBody.GetLatitude(Position), TargetOrbit.referenceBody.GetLongitude(Position), true)); } return("N/A"); }
void DrawGUIPrediction() { ReentrySimulation.Result result = predictor.Result; if (result != null) { switch (result.outcome) { case ReentrySimulation.Outcome.LANDED: GUILayout.Label("Landing Predictions:"); GUILayout.Label(Coordinates.ToStringDMS(result.endPosition.latitude, result.endPosition.longitude) + "\nASL:" + MuUtils.ToSI(result.endASL, -1, 4) + "m"); GUILayout.Label(result.body.GetExperimentBiomeSafe(result.endPosition.latitude, result.endPosition.longitude)); double error = Vector3d.Distance(mainBody.GetWorldSurfacePosition(result.endPosition.latitude, result.endPosition.longitude, 0) - mainBody.position, mainBody.GetWorldSurfacePosition(core.target.targetLatitude, core.target.targetLongitude, 0) - mainBody.position); GUILayout.Label("Target difference = " + MuUtils.ToSI(error, 0) + "m" + "\nMax drag: " + result.maxDragGees.ToString("F1") + "g" + "\nDelta-v needed: " + result.deltaVExpended.ToString("F1") + "m/s" + "\nTime to land: " + (vessel.Landed ? "0.0s" : GuiUtils.TimeToDHMS(result.endUT - Planetarium.GetUniversalTime(), 1))); break; case ReentrySimulation.Outcome.AEROBRAKED: GUILayout.Label("Predicted orbit after aerobraking:"); Orbit o = result.AeroBrakeOrbit(); if (o.eccentricity > 1) { GUILayout.Label("Hyperbolic, eccentricity = " + o.eccentricity.ToString("F2")); } else { GUILayout.Label(MuUtils.ToSI(o.PeA, 3) + "m x " + MuUtils.ToSI(o.ApA, 3) + "m"); } GUILayout.Label("Max drag: " + result.maxDragGees.ToString("F1") + "g" + "\nExit atmosphere in: " + GuiUtils.TimeToDHMS(result.aeroBrakeUT - Planetarium.GetUniversalTime(), 1)); break; case ReentrySimulation.Outcome.NO_REENTRY: GUILayout.Label("Orbit does not reenter:\n" + MuUtils.ToSI(orbit.PeA, 3) + "m Pe > " + MuUtils.ToSI(mainBody.RealMaxAtmosphereAltitude(), 3) + (mainBody.atmosphere ? "m atmosphere height" : "m ground")); break; case ReentrySimulation.Outcome.TIMED_OUT: GUILayout.Label("Reentry simulation timed out."); break; } } }
void DrawGUIPrediction() { ReentrySimulation.Result result = predictor.GetResult(); if (result != null) { switch (result.outcome) { case ReentrySimulation.Outcome.LANDED: GUILayout.Label("Predicted landing site:"); GUILayout.Label(Coordinates.ToStringDMS(result.endPosition.latitude, result.endPosition.longitude)); double error = Vector3d.Distance(mainBody.GetRelSurfacePosition(result.endPosition.latitude, result.endPosition.longitude, 0), mainBody.GetRelSurfacePosition(core.target.targetLatitude, core.target.targetLongitude, 0)); GUILayout.Label("Difference from target = " + MuUtils.ToSI(error, 0) + "m"); if (result.maxDragGees > 0) { GUILayout.Label("Predicted max drag gees: " + result.maxDragGees.ToString("F1")); } break; case ReentrySimulation.Outcome.AEROBRAKED: GUILayout.Label("Predicted orbit after aerobraking:"); Orbit o = result.EndOrbit(); if (o.eccentricity > 1) { GUILayout.Label("Hyperbolic, eccentricity = " + o.eccentricity.ToString("F2")); } else { GUILayout.Label(MuUtils.ToSI(o.PeA, 3) + "m x " + MuUtils.ToSI(o.ApA, 3) + "m"); } break; case ReentrySimulation.Outcome.NO_REENTRY: GUILayout.Label("Orbit does not reenter:"); GUILayout.Label(MuUtils.ToSI(orbit.PeA, 3) + "m Pe > " + MuUtils.ToSI(mainBody.RealMaxAtmosphereAltitude(), 3) + "m atmosphere height"); break; case ReentrySimulation.Outcome.TIMED_OUT: GUILayout.Label("Reentry simulation timed out."); break; } } }
public string GetCoordinateString() { return(Coordinates.ToStringDMS(vesselState.latitude, vesselState.longitude, true)); }
public string GetNameWithCoords() { return((Name != "" ? Name : (Target != null ? Target.vesselName : "Waypoint")) + " - " + Coordinates.ToStringDMS(Latitude, Longitude, false)); // ((Latitude >= 0 ? "N " : "S ") + Math.Abs(Math.Round(Latitude, 3)) + ", " + (Longitude >= 0 ? "E " : "W ") + Math.Abs(Math.Round(Longitude, 3))); }