Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deceleration Readouts (New Pull) #119

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions KerbalEngineer/Flight/Readouts/ReadoutLibrary.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,19 @@ static ReadoutLibrary()
readouts.Add(new ImpactBiome());

// Vessel
readouts.Add(new Name());
readouts.Add(new DeltaVStaged());
readouts.Add(new Name());
readouts.Add(new DecelerationDeltaV());
readouts.Add(new DecelerationTime());
readouts.Add(new DecelerationDistanceTotal());
readouts.Add(new DecelerationDistanceHorizontal());
readouts.Add(new DecelerationDistanceVertical());
readouts.Add(new DecelerationAltitudeOverGround());
readouts.Add(new DecelerationAltitude());
readouts.Add(new DecelerationBiome());
readouts.Add(new DecelerationLatitude());
readouts.Add(new DecelerationLongitude());
readouts.Add(new DecelerationSlope());
readouts.Add(new DeltaVStaged());
readouts.Add(new DeltaVCurrent());
readouts.Add(new DeltaVTotal());
readouts.Add(new DeltaVCurrentTotal());
Expand Down
2 changes: 1 addition & 1 deletion KerbalEngineer/Flight/Readouts/Surface/Longitude.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public Longitude()
public override void Draw(SectionModule section)
{
double angle = AngleHelper.Clamp180(FlightGlobals.ship_longitude);
DrawLine(Units.ToAngleDMS(angle) + (angle < 0.0 ? "W" : " E"), section.IsHud);
DrawLine(Units.ToAngleDMS(angle) + (angle < 0.0 ? " W" : " E"), section.IsHud);
}
}
}
69 changes: 69 additions & 0 deletions KerbalEngineer/Flight/Readouts/Vessel/DecelerationAltitude.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
//
// Kerbal Engineer Redux
//
// Copyright (C) 2014 CYBUTEK
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//

#region Using Directives

using System;

using KerbalEngineer.Extensions;
using KerbalEngineer.Flight.Sections;

#endregion

namespace KerbalEngineer.Flight.Readouts.Vessel
{
public class DecelerationAltitude : ReadoutModule
{
#region Constructors

public DecelerationAltitude()
{
this.Name = "Decel. Point: Alt. Terrain";
this.Category = ReadoutCategory.GetCategory("Vessel");
this.HelpString = "Shows the terrain altitude/elevation at the point your Deceleration Burn will end.";
this.IsDefault = false;
}

#endregion

#region Methods: public

public override void Draw(SectionModule section)
{
if (!DecelerationProcessor.ShowDetails)
{
return;
}

this.DrawLine(DecelerationProcessor.Altitude.ToDistance(), section.IsHud);
}

public override void Reset()
{
DecelerationProcessor.Reset();
}

public override void Update()
{
DecelerationProcessor.RequestUpdate();
}

#endregion
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
//
// Kerbal Engineer Redux
//
// Copyright (C) 2014 CYBUTEK
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//

#region Using Directives

using System;

using KerbalEngineer.Extensions;
using KerbalEngineer.Flight.Sections;

#endregion

namespace KerbalEngineer.Flight.Readouts.Vessel
{
public class DecelerationAltitudeOverGround : ReadoutModule
{
#region Constructors

public DecelerationAltitudeOverGround()
{
this.Name = "Decel. Point: Alt. Remaining";
this.Category = ReadoutCategory.GetCategory("Vessel");
this.HelpString = "Shows the remaining altitude over the point your Deceleration Burn will end.";
this.IsDefault = false;
}

#endregion

#region Methods: public

public override void Draw(SectionModule section)
{
if (!DecelerationProcessor.ShowDetails)
{
return;
}

this.DrawLine(DecelerationProcessor.AltitudeOverGround.ToDistance(), section.IsHud);
}

public override void Reset()
{
DecelerationProcessor.Reset();
}

public override void Update()
{
DecelerationProcessor.RequestUpdate();
}

#endregion
}
}
64 changes: 64 additions & 0 deletions KerbalEngineer/Flight/Readouts/Vessel/DecelerationBiome.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
//
// Kerbal Engineer Redux
//
// Copyright (C) 2014 CYBUTEK
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//

#region Using Directives

using KerbalEngineer.Flight.Sections;

#endregion

namespace KerbalEngineer.Flight.Readouts.Vessel
{
public class DecelerationBiome : ReadoutModule
{
#region Constructors

public DecelerationBiome()
{
this.Name = "Decel. Point: Biome";
this.Category = ReadoutCategory.GetCategory("Vessel");
this.HelpString = "Shows the biome at the point your Deceleration Burn will end.";
this.IsDefault = false;
}

#endregion

#region Methods: public

public override void Draw(SectionModule section)
{
if (DecelerationProcessor.ShowDetails)
{
this.DrawLine(DecelerationProcessor.Biome, section.IsHud);
}
}

public override void Reset()
{
DecelerationProcessor.Reset();
}

public override void Update()
{
DecelerationProcessor.RequestUpdate();
}

#endregion
}
}
69 changes: 69 additions & 0 deletions KerbalEngineer/Flight/Readouts/Vessel/DecelerationDeltaV.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
//
// Kerbal Engineer Redux
//
// Copyright (C) 2014 CYBUTEK
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//

#region Using Directives

using System;

using KerbalEngineer.Extensions;
using KerbalEngineer.Flight.Sections;

#endregion

namespace KerbalEngineer.Flight.Readouts.Vessel
{
public class DecelerationDeltaV : ReadoutModule
{
#region Constructors

public DecelerationDeltaV()
{
this.Name = "Decel. Burn: deltaV";
this.Category = ReadoutCategory.GetCategory("Vessel");
this.HelpString = "Total change in velocity to kill all surface velocity including potential velocity gained trough freefall.";
this.IsDefault = false;
}

#endregion

#region Methods: public

public override void Draw(SectionModule section)
{
if (!DecelerationProcessor.ShowDetails)
{
return;
}

this.DrawLine("Decel. Burn: deltaV", DecelerationProcessor.DecelerationDeltaV.ToSpeed() + " (" + (DecelerationProcessor.HasDeltaV ? "S" + DecelerationProcessor.FinalStage : "X") + ")", section.IsHud);
}

public override void Reset()
{
DecelerationProcessor.Reset();
}

public override void Update()
{
DecelerationProcessor.RequestUpdate();
}

#endregion
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
//
// Kerbal Engineer Redux
//
// Copyright (C) 2014 CYBUTEK
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//

#region Using Directives

using KerbalEngineer.Extensions;
using KerbalEngineer.Flight.Sections;

#endregion

namespace KerbalEngineer.Flight.Readouts.Vessel
{
public class DecelerationDistanceHorizontal : ReadoutModule
{
#region Constructors

public DecelerationDistanceHorizontal()
{
this.Name = "Decel. Burn: Horiz. Dist.";
this.Category = ReadoutCategory.GetCategory("Vessel");
this.HelpString = "Horizontal distance covered during Deceleration Burn.";
this.IsDefault = false;
}

#endregion

#region Methods: public

public override void Draw(SectionModule section)
{
if (!DecelerationProcessor.ShowDetails)
{
return;
}

this.DrawLine(DecelerationProcessor.HorizontalDistance.ToDistance(), section.IsHud);
}

public override void Reset()
{
DecelerationProcessor.Reset();
}

public override void Update()
{
DecelerationProcessor.RequestUpdate();
}

#endregion
}
}
Loading