Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mockingbirdnest/Principia
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: b991b85ffc74
Choose a base ref
...
head repository: mockingbirdnest/Principia
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 619a8237818c
Choose a head ref
  • 9 commits
  • 5 files changed
  • 1 contributor

Commits on Mar 19, 2019

  1. Copy the full SHA
    98ea878 View commit details
  2. Copy the full SHA
    fb0b13f View commit details
  3. Better names.

    pleroy committed Mar 19, 2019
    Copy the full SHA
    5cfa4ba View commit details
  4. Remove the Dispose pattern.

    pleroy committed Mar 19, 2019
    Copy the full SHA
    46eab9f View commit details

Commits on Mar 20, 2019

  1. Copy the full SHA
    cc86aa5 View commit details
  2. Copy the full SHA
    2aec83d View commit details
  3. Cleanup.

    pleroy committed Mar 20, 2019
    Copy the full SHA
    f6f9f34 View commit details
  4. After egg's review.

    pleroy committed Mar 20, 2019
    Copy the full SHA
    736532d View commit details
  5. Merge pull request #2101 from pleroy/NoDisposable

    Get rid of the "disposable" pattern for windows
    pleroy authored Mar 20, 2019
    Copy the full SHA
    619a823 View commit details
20 changes: 10 additions & 10 deletions ksp_plugin_adapter/burn_editor.cs
Original file line number Diff line number Diff line change
@@ -11,6 +11,9 @@ public BurnEditor(PrincipiaPluginAdapter adapter,
IntPtr plugin,
Vessel vessel,
double initial_time) {
adapter_ = adapter;
plugin_ = plugin;
vessel_ = vessel;
Δv_tangent_ =
new DifferentialSlider(label : "Δv tangent",
unit : "m / s",
@@ -43,15 +46,12 @@ public BurnEditor(PrincipiaPluginAdapter adapter,
Planetarium.GetUniversalTime() - value)));
initial_time_.value = initial_time;
reference_frame_selector_ = new ReferenceFrameSelector(
adapter,
plugin,
adapter_,
ReferenceFrameChanged,
"Manœuvring frame");
plugin_ = plugin;
vessel_ = vessel;
adapter_ = adapter;
reference_frame_selector_.Reset(
adapter_.plotting_frame_selector_.get().FrameParameters());
reference_frame_selector_.Initialize(plugin_);
reference_frame_selector_.SetFrameParameters(
adapter_.plotting_frame_selector_.FrameParameters());
ComputeEngineCharacteristics();
}

@@ -96,7 +96,7 @@ public bool Render(bool enabled) {
}
string frame_warning = "";
if (!reference_frame_selector_.FrameParameters().Equals(
adapter_.plotting_frame_selector_.get().FrameParameters())) {
adapter_.plotting_frame_selector_.FrameParameters())) {
frame_warning = "Manœuvre frame differs from plotting frame";
}
UnityEngine.GUILayout.TextArea(frame_warning, warning_style);
@@ -136,7 +136,7 @@ public void Reset(NavigationManoeuvre manoeuvre) {
Δv_normal_.value = burn.delta_v.y;
Δv_binormal_.value = burn.delta_v.z;
initial_time_.value = burn.initial_time;
reference_frame_selector_.Reset(burn.frame);
reference_frame_selector_.SetFrameParameters(burn.frame);
is_inertially_fixed_ = burn.is_inertially_fixed;
duration_ = manoeuvre.duration;
initial_mass_in_tonnes_ = manoeuvre.initial_mass_in_tonnes;
@@ -159,7 +159,7 @@ public void ReferenceFrameChanged(NavigationFrameParameters parameters) {
}

public void Close() {
reference_frame_selector_.Dispose();
reference_frame_selector_.DisposeWindow();
}

private void ComputeEngineCharacteristics() {
9 changes: 5 additions & 4 deletions ksp_plugin_adapter/flight_planner.cs
Original file line number Diff line number Diff line change
@@ -8,9 +8,11 @@ namespace principia {
namespace ksp_plugin_adapter {

class FlightPlanner : SupervisedWindowRenderer {
public FlightPlanner(PrincipiaPluginAdapter adapter,
IntPtr plugin) : base(adapter) {
public FlightPlanner(PrincipiaPluginAdapter adapter) : base(adapter) {
adapter_ = adapter;
}

public void Initialize(IntPtr plugin) {
plugin_ = plugin;
final_time_ = new DifferentialSlider(
label : "Plan length",
@@ -24,7 +26,6 @@ public FlightPlanner(PrincipiaPluginAdapter adapter,
TimeSpan.FromSeconds(
value - plugin_.FlightPlanGetInitialTime(
vessel_.id.ToString()))));

}

protected override void RenderWindow() {
@@ -352,8 +353,8 @@ internal static string FormatTimeSpan (TimeSpan span) {
}

// Not owned.
private readonly IntPtr plugin_;
private readonly PrincipiaPluginAdapter adapter_;
private IntPtr plugin_;
private Vessel vessel_;
private List<BurnEditor> burn_editors_;

Loading