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: 992593fc237f
Choose a base ref
...
head repository: mockingbirdnest/Principia
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: c0c273283051
Choose a head ref
  • 4 commits
  • 2 files changed
  • 2 contributors

Commits on Mar 12, 2017

  1. a bug with initialization

    eggrobin committed Mar 12, 2017
    Copy the full SHA
    dfdefdb View commit details
  2. enable the serialization

    eggrobin committed Mar 12, 2017
    Copy the full SHA
    1e08053 View commit details
  3. blank

    eggrobin committed Mar 12, 2017
    Copy the full SHA
    275016c View commit details
  4. Merge pull request #1248 from eggrobin/missing-advance-time-and-seria…

    …lization
    
    Missing AdvanceTime and enabling serialization
    pleroy authored Mar 12, 2017
    Copy the full SHA
    c0c2732 View commit details
Showing with 4 additions and 9 deletions.
  1. +2 −1 ksp_plugin/vessel.cpp
  2. +2 −8 ksp_plugin_adapter/ksp_plugin_adapter.cs
3 changes: 2 additions & 1 deletion ksp_plugin/vessel.cpp
Original file line number Diff line number Diff line change
@@ -91,7 +91,8 @@ void Vessel::FreeParts() {
void Vessel::PreparePsychohistory(Instant const& t) {
CHECK(!parts_.empty());
if (psychohistory_->Empty()) {
LOG(INFO) << "Preparing psychohistory of vessel " << ShortDebugString();
LOG(INFO) << "Preparing psychohistory of vessel " << ShortDebugString()
<< " at " << t;
BarycentreCalculator<DegreesOfFreedom<Barycentric>, Mass> calculator;
ForAllParts([&calculator](Part& part) {
calculator.Add(part.degrees_of_freedom(), part.mass());
10 changes: 2 additions & 8 deletions ksp_plugin_adapter/ksp_plugin_adapter.cs
Original file line number Diff line number Diff line change
@@ -357,7 +357,6 @@ public override void OnAwake() {

public override void OnSave(ConfigNode node) {
base.OnSave(node);
#if THE_SERIALIZATION_WORKS_AGAIN
if (PluginRunning()) {
String serialization;
IntPtr serializer = IntPtr.Zero;
@@ -369,15 +368,13 @@ public override void OnSave(ConfigNode node) {
node.AddValue(principia_key, serialization);
}
}
#endif
}

public override void OnLoad(ConfigNode node) {
base.OnLoad(node);
if (must_record_journal_) {
Log.ActivateRecorder(true);
}
#if THE_SERIALIZATION_WORKS_AGAIN
if (node.HasValue(principia_key)) {
Cleanup();
SetRotatingFrameThresholds();
@@ -410,12 +407,9 @@ public override void OnLoad(ConfigNode node) {
plugin_construction_ = DateTime.Now;
plugin_source_ = PluginSource.SAVED_STATE;
} else {
#endif
Log.Warning("No principia state found, creating one");
ResetPlugin();
#if THE_SERIALIZATION_WORKS_AGAIN
}
#endif
}

#endregion
@@ -1552,8 +1546,6 @@ private void ResetPlugin() {
insert_body(Planetarium.fetch.Sun);
ApplyToBodyTree(insert_body);
plugin_.EndInitialization();
plugin_.AdvanceTime(Planetarium.GetUniversalTime(),
Planetarium.InverseRotAngle);
} catch (Exception e) {
Log.Fatal("Exception while reading initial state: " + e.ToString());
}
@@ -1623,6 +1615,8 @@ private void ResetPlugin() {
}
}
}
plugin_.AdvanceTime(Planetarium.GetUniversalTime(),
Planetarium.InverseRotAngle);
plotting_frame_selector_.reset(
new ReferenceFrameSelector(this,
plugin_,