Adding support for calendar/clock time #1047
Replies: 3 comments 4 replies
-
I have a small preference for the XML element option since that would make the parser agnostic to the local date format. The examples you gave are in the North American format MM-DD-YYYY but there are other formats such as DD-MM-YYYY which is used in France (and possibly other countries) and YYYY-MM-DD which is the international date format. In addition this calendar/clock time could be propagated to the MSIS atmosphere model which also uses calendar/clock time albeit in a much cruder way:
Also beware to time zones and the daylight saving time which make the conversion quite tricky when the date is not supplied as UTC or the OS local time. |
Beta Was this translation helpful? Give feedback.
-
Also while I was responding to the discussion #1045, I have seen that jsbsim/src/models/flight_control/FGMagnetometer.cpp Lines 73 to 90 in 3d95aeb |
Beta Was this translation helpful? Give feedback.
-
Out of interest @jonsberndt what sorts of use are you thinking of? Comparing JSBSim orbital data to other orbiting objects via ephemeris data, e.g. relative location of JSBSim orbiting object and the space station? Based on my experience writing software for flight planning I'm familiar with geomagnetic models like - https://www.ncei.noaa.gov/products/world-magnetic-model that are time dependent. Actually as per @bcoconni's mention of the magnetometer sensor we actually have an implementation of a geomagnetic model (albeit out of date) in - https://github.com/JSBSim-Team/jsbsim/blob/3d95aeb751e6ddd11b1007571b86662cd41612d8/src/simgear/magvar/coremag.cxx My other experience in terms of data that is time dependent is weather forecast data, e.g. winds aloft in a grid pattern at multiple flight levels over say a 48hr forecast period at say 3hr intervals. So I can see the new current date/time being used by C++ code like the geomagnetic model etc. but also possibly via XML data supplied by the user, e.g. forecast wind data to inject/update the current wind vector in JSBSim based on 3D position of the aircraft and current date/time by looking up the forecast wind data in a breakpoint based table for example. If we wanted to support XML data making use of the current date/time we'd need to think of how to handle that in terms of how the date/time is specified for example in a breakpoint table etc. |
Beta Was this translation helpful? Give feedback.
-
There may be occasions where we wish to run a simulation for a very specific date and time. I've been thinking for a while that I'd like to add support for this. I would think that such a date/time - an epoch - would be specified in a script file. The question I have is whether such a specification would be an attribute or an element. Taking the ball_orbit_phase script for example, this might be one way to do it, if the epoch is an attribute:
Another way would be to specify the epoch as an element:
Yet another way could be:
Internally, this should not be that hard. The effect of the above would be that we would simply specify the start of the epoch. The current date/time would then simply be the start time plus the elapsed sim time.
Any thoughts?
Beta Was this translation helpful? Give feedback.
All reactions