Skip to content

Commit

Permalink
I think I fixed that time issue for both PropUntil and Prop.
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristopherRabotin committed May 6, 2017
1 parent e09c36b commit aade4dd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion mission.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func (a *Mission) PropagateUntil(dt time.Time, autoClose bool) {
if !autoClose {
a.StopDT = dt.Add(a.step)
} else {
a.StopDT = dt
a.StopDT = dt.Add(-a.step)
}
// For the final propagation report says the exact prop time, we update the start date time.
a.StartDT = a.CurrentDT.Add(-a.step)
Expand All @@ -103,6 +103,7 @@ func (a *Mission) Propagate() {
// Write the first data point
if !a.propuntilCalled {
a.CurrentDT = a.CurrentDT.Add(-a.step)
a.StopDT = a.StopDT.Add(-a.step)
a.SetState(0, a.GetState())
a.LogStatus()
}
Expand Down
4 changes: 2 additions & 2 deletions mission_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -806,8 +806,8 @@ func TestMissionSTM(t *testing.T) {
previousState = state.Vector()
}
t.Logf("real duration = %s", mission.CurrentDT.Sub(startDT))
if numStates != 86402 {
t.Fatalf("expected 86402 states to be processed, got %d (failed on %d)", numStates, meth)
if numStates != 86401 {
t.Fatalf("expected 86401 states to be processed, got %d (failed on %d)", numStates, meth)
}
if meth == 2 {
cfgLoaded = false // Unload the modified config file
Expand Down

0 comments on commit aade4dd

Please sign in to comment.