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

Prevent time catch up in real time mode #1213

Merged
merged 4 commits into from
Jan 3, 2025

Conversation

bcoconni
Copy link
Member

This PR fixes the bug reported in the issue #1187.

A new class Timer is added that manages elapsed time. It is inheriting SGPropertyChangeListener so that every time the property simulation/reset is set the timer is properly reset.

The CI workflow is also modified to check that executing the following command takes at least 90 seconds (i.e. 2 runs of 25 seconds and 1 run of 40 seconds):

JSBSim scripts/c172_cruise_8K.xml --realtime --nice

The script c172_cruise_8K.xml is also simplified:

  • It runs quicker: the end time and the time that triggers the reset have been shortened.
  • The termination event has been removed. Instead the last run is executed until the end time is reached.

@bcoconni bcoconni linked an issue Dec 30, 2024 that may be closed by this pull request
Copy link

codecov bot commented Dec 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 24.96%. Comparing base (330a6e3) to head (b61c15f).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1213   +/-   ##
=======================================
  Coverage   24.96%   24.96%           
=======================================
  Files         170      170           
  Lines       19281    19281           
=======================================
  Hits         4814     4814           
  Misses      14467    14467           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bcoconni bcoconni changed the title Fix time catch up in real time mode Prevent time catch up in real time mode Dec 30, 2024
@agodemar agodemar merged commit 5be7eab into JSBSim-Team:master Jan 3, 2025
29 checks passed
@bcoconni bcoconni deleted the bcoconni/issue1187 branch January 3, 2025 17:01
@coasho
Copy link

coasho commented Jan 16, 2025

thanks @bcoconni for implementing this fix! The new Timer class with SGPropertyChangeListener handles the reset behavior really well. I tested PR #1213 and it works exactly as expected now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reset command causes rapid time-catch-up in realtime mode
3 participants