Skip to content

Commit

Permalink
Merge pull request #2501 from pleroy/Fubini
Browse files Browse the repository at this point in the history
Next release is Fubini
pleroy authored Mar 20, 2020
2 parents 7ef1374 + 87c67dd commit f0b8e69
Showing 5 changed files with 3 additions and 77 deletions.
15 changes: 0 additions & 15 deletions ksp_plugin/interface_vessel.cpp
Original file line number Diff line number Diff line change
@@ -50,21 +50,6 @@ QP __cdecl principia__VesselFromParent(Plugin const* const plugin,
return m.Return(ToQP(plugin->VesselFromParent(parent_index, vessel_guid)));
}

char const* __cdecl principia__VesselGetPileUpTrace(
Plugin const* const plugin,
char const* const vessel_guid) {
journal::Method<journal::VesselGetPileUpTrace> m({plugin, vessel_guid});
CHECK_NOTNULL(plugin);
base::UniqueArray<char> bytes;
plugin->GetVessel(vessel_guid)
->ForSomePart([&bytes](ksp_plugin::Part const& part) {
std::string const& trace = part.containing_pile_up()->Trace();
bytes = base::UniqueArray<char>(trace.size() + 1);
std::memcpy(bytes.data.get(), trace.data(), bytes.size);
});
return m.Return(bytes.data.release());
}

AdaptiveStepParameters __cdecl
principia__VesselGetPredictionAdaptiveStepParameters(
Plugin const* const plugin,
24 changes: 0 additions & 24 deletions ksp_plugin/pile_up.cpp
Original file line number Diff line number Diff line change
@@ -430,7 +430,6 @@ void PileUp::DeformPileUpIfNeeded(Instant const& t) {
angular_momentum_ /
Identity<ApparentPileUp, NonRotatingPileUp>()(inertia_tensor);

std::stringstream trace;
// In the |EquivalentRigidPileUp| reference frame, a rigid body with the same
// inertia and angular momentum as the pile up would be immobile. We use this
// intermediate frame to apply a rigid rotational correction to the motions of
@@ -473,29 +472,6 @@ void PileUp::DeformPileUpIfNeeded(Instant const& t) {

MakeEulerSolver(Identity<ApparentPileUp, NonRotatingPileUp>()(inertia_tensor),
t);

trace << "rotational correction:\n"
<< (actual_pile_up_equivalent_rotation.Inverse() *
apparent_pile_up_equivalent_rotation)
.angular_velocity_of_to_frame()
.Norm()
<< "\nangular momentum error:\n"
<< (Identity<ApparentPileUp, NonRotatingPileUp>()(
apparent_angular_momentum) -
angular_momentum_)
.Norm()
<< "\ncorresponding rotational correction:\n"
<< (Identity<ApparentPileUp, NonRotatingPileUp>()(
apparent_equivalent_angular_velocity) -
actual_equivalent_angular_velocity)
.Norm()
<< u8"\nω apparent:\n"
<< apparent_equivalent_angular_velocity.Norm()
<< "\nL in principal axes:\n"
<< inertia_tensor.Diagonalize<PileUpPrincipalAxes>().rotation.Inverse()(
apparent_angular_momentum);

last_correction_trace_ = trace.str();
}

Status PileUp::AdvanceTime(Instant const& t) {
6 changes: 0 additions & 6 deletions ksp_plugin/pile_up.hpp
Original file line number Diff line number Diff line change
@@ -133,10 +133,6 @@ class PileUp {
not_null<Ephemeris<Barycentric>*> ephemeris,
std::function<void()> deletion_callback);

std::string const& Trace() {
return last_correction_trace_;
}

private:
// A pointer to a member function of |Part| used to append a point to either
// trajectory (history or psychohistory).
@@ -200,8 +196,6 @@ class PileUp {
// angular velocity of a part remains constant.
Bivector<AngularMomentum, NonRotatingPileUp> angular_momentum_change_;

std::string last_correction_trace_;

// The |history_| is the past trajectory of the pile-up. It is normally
// integrated with a fixed step using |fixed_instance_|, except in the
// presence of intrinsic acceleration. It is authoritative in the sense that
18 changes: 3 additions & 15 deletions ksp_plugin_adapter/main_window.cs
Original file line number Diff line number Diff line change
@@ -5,10 +5,10 @@ namespace ksp_plugin_adapter {

internal class MainWindow : SupervisedWindowRenderer {
// Update this section before each release.
private const string next_release_name_ = "Frobenius";
private const int next_release_lunation_number_ = 250;
private const string next_release_name_ = "Fubini";
private const int next_release_lunation_number_ = 251;
private readonly DateTimeOffset next_release_date_ =
new DateTimeOffset(2020, 03, 24, 09, 28, 00, TimeSpan.Zero);
new DateTimeOffset(2020, 04, 23, 02, 26, 00, TimeSpan.Zero);

public delegate Vessel PredictedVessel();

@@ -272,18 +272,6 @@ private void RenderKSPFeatures() {
}

private void RenderLoggingSettings() {
#if FROBENIOID
string trace = "";
if (FlightGlobals.ActiveVessel &&
adapter_.PluginRunning() &&
plugin.HasVessel(FlightGlobals.ActiveVessel.id.ToString())) {
trace =
plugin.VesselGetPileUpTrace(FlightGlobals.ActiveVessel.id.ToString());
}
UnityEngine.GUILayout.TextArea(
trace,
style: Style.Multiline(UnityEngine.GUI.skin.textArea));
#endif
using (new UnityEngine.GUILayout.HorizontalScope()) {
UnityEngine.GUILayout.Label(text : "Verbose level:");
if (UnityEngine.GUILayout.Button(text : "←",
17 changes: 0 additions & 17 deletions serialization/journal.proto
Original file line number Diff line number Diff line change
@@ -2077,23 +2077,6 @@ message VesselFromParent {
optional Return return = 3;
}

message VesselGetPileUpTrace {
extend Method {
optional VesselGetPileUpTrace extension = 5999;
}
message In {
required fixed64 plugin = 1 [(pointer_to) = "Plugin const",
(is_subject) = true];
required string vessel_guid = 2;
}
message Return {
required fixed64 result = 1 [(encoding) = UTF_8,
(is_produced) = true];
}
optional In in = 1;
optional Return return = 3;
}

message VesselGetPredictionAdaptiveStepParameters {
extend Method {
optional VesselGetPredictionAdaptiveStepParameters extension = 5090;

0 comments on commit f0b8e69

Please sign in to comment.