1
0
Fork 0
Commit graph

11430 commits

Author SHA1 Message Date
Nathaniel Warner
4ddc3dc8aa Fix orthophotos not being cleaned up on scenery reload 2020-11-27 17:54:55 -06:00
James Turner
443b4fa900 Different fix for ticket 2108, avoiding another issue
Original bug: https://sourceforge.net/p/flightgear/codetickets/2108/
New bug: https://sourceforge.net/p/flightgear/codetickets/2430/
2020-11-27 18:51:27 +00:00
Stuart Buchanan
4e46548250 Set minimum expiry time on STG nodes. 2020-11-26 22:59:39 +00:00
Julian Smith
a69e56043a src/Viewer/sview.cxx: fixed incorrect heading and roll when cloning some lookfrom views.
Bug happened with views that specify non-zero heading or roll.
2020-11-25 21:31:05 +00:00
Julian Smith
a094b822f8 Revert "src/Viewer/splash.cxx: also show info about CompositeViewer if disabled."
This reverts commit 1cf5b2ab44.
2020-11-25 21:31:05 +00:00
Colin Geniet
fa09c3a6e2 Submodels: Fix wind being applied twice on init
For FGAIBallistic objects affected by wind, speed vector denotes airspeed.
However, submodels initialize the speed vector using ground speed of the
parent aircraft, instead of its airspeed.

In effect, this means that wind is added to the initial airspeed,
or 'wind is applied twice on initialization'.
This was very noticeable when releasing a submodel with strong sidewind:
the submodel immediately starts drifting laterally at the speed of wind.

Fix the issue by subtracting wind vector from initial speed in
FGSubmodelMgr::transform for submodels affected by wind.
2020-11-24 10:35:01 +00:00
James Turner
43d32e809c Metar parsing: more input validation
Trying to avoid parsing an empty string.

Sentry-Id: FLIGHTGEAR-132
2020-11-24 09:08:50 +00:00
Nathaniel Warner
88a8cada51 Rebase photoscenery patch on next 2020-11-23 17:53:35 -06:00
Erik Hofman
b73413d52e Part 2: Work towards the option of interpolating between climate tiles by combining all climate related ground level parameters in one structure and calculating the sea level tile from the (not yet interpolated) ground level tile. Read the elevelation of the climate tile from the köppen database image which now contains the climate class in the red channel and the ground elevation in the green channel. 2020-11-22 19:29:35 +01:00
Erik Hofman
9cac817ad9 Work towards the option of interpolating between climate tiles by combining all climate related ground level parameters in one structure and calculating the sea level tile from the (not yet interpolated) ground level tile. Read the elevelation of the climate tile from the köppen database image which now contains the climate class in the red channel and the ground elevation in the green channel. 2020-11-22 15:01:43 +01:00
Julian Smith
bd0452c793 src/Viewer/renderer.cxx: disabled CompositeViewer assert that fired on shutdown after --help. 2020-11-22 08:24:49 +00:00
Julian Smith
1cf5b2ab44 src/Viewer/splash.cxx: also show info about CompositeViewer if disabled. 2020-11-22 07:45:17 +00:00
Erik Hofman
e1cf9eff49 Instead of using our own logic of calculating sea level parameters from ground level parameters, switch to using the FGEnvironmetn class instead. 2020-11-21 15:47:10 +01:00
Julian Smith
f62e5b9ce3 CompositeViewer: Support for multiple view windows using osgViewer::CompositeViewer.
Overview:

    Previously Flightgear always used a single osgViewer::Viewer(), which
    inherits from both osgViewer::ViewerBase and osgViewer::View, giving a
    single view window.

    If CompositeViewer is enabled, we instead use a osgViewer::CompositeViewer
    which contains a list of osgViewer::View's. Each of these View's can have
    its own eye position, so we can have multiple different views of the same
    scene.

    Enable at runtime with: --composite-viewer=1

Changes to allow use of osgViewer::CompositeViewer:

    Previously FGRenderer had this method:

        osgViewer::Viewer* getViewer();

    This has been replaced by these two new methods:

        osgViewer::ViewerBase* getViewerBase();
        osgViewer::View* getView();

    If CompositeViewer is not enabled (the default), the actual runtime state
    is unchanged, and getViewerBase() and getView() both return a pointer to
    the singleton osgViewer::Viewer() object.

    If CompositeViewer is enabled, getViewerBase() returns a pointer to a
    singleton osgViewer::CompositeViewer object, and getView() returns a
    pointer to the first osgViewer::View in the osgViewer::CompositeViewer's
    list.

    The other significant change to FGRenderer() is the new method:

        osg::FrameStamp* getFrameStamp()

    If CompositeViewer is not enabled, this simply returns
    getView()->getFrameStamp(). If CompositeViewer is enabled it returns
    getViewerBase()->getFrameStamp(). It is important that code that previously
    called getView()->getFrameStamp() is changed to use the new method, because
    when CompositeViewer is enabled individual osgViewer::View's appear to
    return an osg::FrameStamp with zero frame number).

    All code that uses FGRenderer has been patched up to use the new methods so
    that things work as before regardless of whether CompositeViewer is enabled
    or not.

    We make FGRenderer::update() call SviewUpdate() which updates any extra
    views.

Extra view windows:

    If CompositeViewer is enabled, one can create top-level extra view windows
    by calling SviewCreate(). See src/Viewer/sview.hxx for details.

    Each extra view window has its own simgear::compositor::Compositor
    instance.

    Currently SviewCreate() can create extra view windows that clone the
    current view, or view from one point to another (e.g. from one multiplayer
    aircraft to the user's aircradt) or keep two aircraft in view, one at a
    fixed distance in the foreground.

    SviewCreate() can be called from nasal via new nasal commands "view-clone",
    "view-last-pair", "view-last-pair-double" and "view-push". Associated
    changes to fgdata gives access to these via the View menu. The "view-push"
    command tags the current view for later use by "view-last-pair" and
    "view-last-pair-double".

    Extra view windows created by SviewCreate() use a new view system called
    Sview, which allows views to be constructed at runtime instead of being
    hard-coded in *-set.xml files. This is work in progress and views aren't
    all fully implemented. For example Pilot view gets things slightly wrong
    with large roll values, Tower View AGL is not implemented, and we don't
    implement damping. See top of src/Viewer/sview.cxx for an overview.

OpenSceneGraph-3.4 issues:

    OSG-3.4's event handling seems to be incorrect with CompositeViewer -
    events get sent for the wrong window which causes issues with resize and
    closing. It doesn't seem to be possible to work around this, so closing
    extra view windows can end up closing the main window for example.

    OSG-3.6 seems to fix the problems.

    We warn if CompositeViewer is enabled and OpenSceneGraph is 3.4.
2020-11-21 13:27:02 +00:00
Erik Hofman
578f414c42 Convert wind speeds to meter per second (from kilometers per hour) since that turns out to be the meteorological standard unit for wind speeds. 2020-11-21 09:43:39 +01:00
Erik Hofman
45b6f87351 Set the wind speed based on latitude and climate code 2020-11-20 16:29:19 +01:00
Erik Hofman
0baf9f2ff3 Add wind direction based on viewe latitude. Add a number of retriever functions for weather parameters. 2020-11-19 17:17:55 +01:00
Erik Hofman
6a97b1724a Add a function to construct a METAR string from climate data 2020-11-19 14:17:43 +01:00
Erik Hofman
ef9636c8e5 Use local gravity, Use a more accurate way to calculate saturation vapor pressure. 2020-11-19 11:21:25 +01:00
Erik Hofman
98a94ecac4 Also calculate air pressure and density (while we're at it) 2020-11-19 08:29:40 +01:00
Erik Hofman
108f2d4328 Swith to the terrain presampling code for a more stable ground elevation if it is enabled. 2020-11-19 08:29:40 +01:00
Fernando García Liñán
b3e4c25358 Fix CameraGroup relative cameras 2020-11-18 14:31:06 +01:00
Automatic Release Builder
3dd4971056 Launcher: skip missing add-ons in collectArgs
Avoid passing missing add-ons to FlightGear. Since we only write a
cleaned list back to QSettings upon some user change, we can persist
bad paths.

Sentry-Id: FLIGHTGEAR-NG
2020-11-18 09:52:56 +00:00
James Turner
e8c8495d7b NavCache: clean up the tables check query
This very first query was left un-finalized, which apparently blocks
another process from obtaining the exclusive lock needed to
COMMIT. Found using the trace funtions, phew.

Sentry-Id: FLIGHTGEAR-8C
Sentry-Id: FLIGHTGEAR-8F
2020-11-18 09:52:56 +00:00
James Turner
5273c03c6c NavCache: tolerate missing branch nodes
Since we don't insert nodes in read-only mode, we need to
tolerate their absence when loading.
2020-11-18 09:52:56 +00:00
Fernando García Liñán
78a89b3507 Remove unused files 2020-11-17 19:43:08 +01:00
Richard Harrison
b41bc317dd DDS-TC identify images coming from Canvas
This is to allow the DDS texture cache to take appropriate action (such as not compressing these images to ensure that the aspect ratio is good).
2020-11-17 19:09:06 +01:00
Erik Hofman
35da4231dd Use a different way to calculate relative humidiity across the year and adjusted for daytime. 2020-11-17 15:54:43 +01:00
Fernando García Liñán
b0a64e119a Restore Launcher renderer settings to pre-Compositor state 2020-11-16 18:37:05 +01:00
Erik Hofman
627fd24fc1 Switch from season specific interpolator functions to generic interpolator functions and do the season/day specific offset calculation in dedicated helper functions. Add a daytime effect of three hours, so temperatures get it's highest peak at 15:00. 2020-11-16 15:48:27 +01:00
Fernando García Liñán
255d193bc8 Make Compositor default
- Removed the ENABLE_COMPOSITOR CMake flag.
- Removed /sim/version/compositor-support.
- Removed miscellaneous branching to check if the Compositor is enabled.
- Removed custom resource loader since Compositor Effects are now located in $FG_ROOT/Effects.
- Removed splash screen warning.
- Only use the Compositor versions of CameraGroup and FGRenderer.
- Fix redout/blackout not appearing under certain circumstances.
2020-11-16 13:25:29 +01:00
Erik Hofman
1c923ea1d0 Specify the annual sea water temperature with a month delay compared to the air temperature and use it to calculate ice cover. 2020-11-15 17:50:01 +01:00
Stuart Buchanan
566428d5b9 WS3.0: Buld airports at 0 elevation.
Previously the center of the airport was defined with the correct
elevation, but the runways etc. were built at 0 elevation.

This makes everything at 0 elevation so we can set the elevation
in the STG file for the moment.
2020-11-15 11:20:41 +00:00
Erik Hofman
f0b24af3f1 Fix an off by one problem which is left from a failed attempt to interpolatre between classes 2020-11-15 09:31:26 +01:00
Erik Hofman
dd59119570 Store the region name of the material in the region parameter 2020-11-15 09:30:27 +01:00
Erik Hofman
2b981b7ea7 Calculate the day-light factor from the sun latitude and viewer latitude. Use it the calculate the mean temperatures. Fix a problem were non seasonal parameters where using seasonal interpolators. 2020-11-14 13:43:53 +01:00
Erik Hofman
e450917611 Fix a bug in the season offset code. 2020-11-13 15:03:26 +01:00
Erik Hofman
9479839cd4 When the temperature gets low, rain turns into snow. Also make autumn a factor instead of a switch to slowly adjust the autmun slider betweenclimates. 2020-11-12 15:16:44 +01:00
Automatic Release Builder
5b08a780f6 Sentry: add some extra bread-crumbs 2020-11-12 09:35:37 +00:00
Automatic Release Builder
21e6c06a0c Fix a glitch in adding the default catalog 2020-11-12 09:35:32 +00:00
Automatic Release Builder
1583ad3b03 FlightPlans: don’t report XML errors on load
Assume FlightPlan content might be user sourced; don’t worry about
reporting errors for it.
2020-11-12 09:35:26 +00:00
Automatic Release Builder
bedcc81d98 Missed check for a readProperties file check
Sentry-Id: FLIGHTGEAR-5X
2020-11-12 09:35:19 +00:00
Automatic Release Builder
74e27eec16 SetupRootDialog: fix download URI 2020-11-12 09:35:03 +00:00
Automatic Release Builder
81150ff6a1 Sentry: don't report more XML errors
Don't report XML errors when parsing Nasal-loaded content,
or n the launcher when scanning aircraft information.
2020-11-12 09:34:18 +00:00
Automatic Release Builder
be50f64821 FlightPlan: don’t use exceptions for load errors
Avoid spamming Sentry when loading problem flight-plans.
2020-11-12 09:34:10 +00:00
James Turner
6f8c786e1a Sentry: add another XML-error ignore rule 2020-11-12 09:33:35 +00:00
James Turner
685a44ed53 Sentry: combine repeated log messages
Should make the breadcrumbs easier to read.
2020-11-12 09:33:25 +00:00
James Turner
ce65b84c20 TerraSync: wait on Models as well
Avoid starting tile load until Models is done sync-ing, since this
causes may missing file errors.
2020-11-12 09:33:15 +00:00
James Turner
c63594acec Launcher: abandon NautralEarth loading on ‘fly!’
Otherwise we waste time trying to commit loaded data during FG main
startup, which causes races on the NavCache, and is pointless.
2020-11-12 09:33:07 +00:00
James Turner
3c1594ead4 Launcher add-ons: drop missing paths on load
Don’t probe for, or pass, missing paths to FlightGear. Since we don’t
show such paths in the UI, they hang around forever, causing exceptions

Sentry-Id: FLIGHTGEAR-NG
2020-11-12 09:32:58 +00:00
James Turner
e62c64859c Launcher FirstRun: add ‘scroll to bottom’ hint 2020-11-12 09:31:44 +00:00
James Turner
d29f25c391 Launcher: missed translations MichaelD spotted 2020-11-12 09:30:23 +00:00
James Turner
ca103e7fce UI NumericalEdit: tweak marings 2020-11-12 09:30:12 +00:00
Automatic Release Builder
87d2b03b71 Sentry: add another message ignore rule 2020-11-12 09:26:57 +00:00
Erik Hofman
caac9fbd75 Switch to time based detection of autumn. The sun latitude detection is just too flaky. 2020-11-11 14:38:45 +01:00
Erik Hofman
cc0a683627 Remove debugging statements 2020-11-11 13:19:59 +01:00
Erik Hofman
3253a2e5fe Make it possble to assign an offset to the seasons. Slowly adjust environment parameters too. Fix some calculations. 2020-11-11 11:58:21 +01:00
James Turner
2683a27513 NavCache: make Transaction a no-op when read-only.
Avoid BEGINing a transaction when we’re in read-only mode, since this
is not wise.
2020-11-10 23:43:44 +00:00
James Turner
134e06af68 Avoid NavCache races on multiple copies rebuilding
If impatient users start multiple copies of FlightGear when a cache
rebuild is required, we can get into a mess. Use an additional
named mutex on Windows to avoid this situation, and block the secondary
copies until the primary instance has completed its cache rebuild.

Sentry-Id: FLIGHTGEAR-8D
Sentry-Id: FLIGHTGEAR-FY
2020-11-10 23:25:04 +00:00
James Turner
2d7e7b3df6 Waypoints: use bool returns for load errors
Avoid using exception throws for malformed input, makes error
reporting very noisy when user-generated flight plans are loaded.
2020-11-10 23:18:03 +00:00
Erik Hofman
f3f50cef35 Support instant changes when relocating more then one degree lat+lon 2020-11-10 14:49:03 +01:00
Erik Hofman
73c7793efa Make FGClimate a proper subsystem for the environment manager. Average out climate parameters between climate classes and add the climate classification code to the proprty tree, as well as the description. 2020-11-10 13:56:01 +01:00
Erik Hofman
658aa4a764 Add a climate section under the /environment properties. Add relative humidity, mean temperature and dewpoint for sea level and set the snow level based on the mean temperatures. Fix some issues for high-altitude airports (SLLP). 2020-11-09 11:46:34 +01:00
Stuart Buchanan
0982b2827a WS3.0: Initial commit of WS3.0 rendering 2020-11-08 22:43:49 +00:00
Erik Hofman
f21b9b651b Fix ocean humidity calculation, adjust humidity based on altitude and calculate sea level temeprature based on ground level temperature and altitude. 2020-11-08 15:54:54 +01:00
Erik Hofman
6e34ea5ab5 Relative humidity is low when the temperature is high and vice versa. This also makes it time-of-day dependent 2020-11-08 13:13:04 +01:00
Erik Hofman
3384a85650 Clean up the code, impement relative humidity (and related to that dew point) and better implement arid climates 2020-11-08 10:28:23 +01:00
Erik Hofman
1ae2e4c4cd Implement a set of non-lineair seasonal interpolstion fnctions and use them. 2020-11-06 13:49:16 +01:00
Erik Hofman
e3a7ab6cb3 Implement temperature and precipitation for temperate and continental climates 2020-11-05 16:05:53 +01:00
Erik Hofman
39602d98d5 * Updates as suggsted by James.
* Fall back to Ocean climate if the koppen-geiger image is not found.
* Fixes to temperature calculations based on viewer and sun lat and lon.
* Fix season and day progress factors, add an autumn progress factor.
* Set the environment parameters like ice-cover, dust-cover and wetness:
  for now always active, should be a menu option in the future.
* Add a compile-time option to dump a climate report to the console.
2020-11-05 10:09:30 +01:00
James Turner
5386051413 MP-DNS: cancel pending request on close. 2020-11-04 22:32:30 +00:00
Erik Hofman
04ff8a5e5e Add the climate class to the build, for now it's not altering anything. 2020-11-03 14:41:38 +01:00
Erik Hofman
370a412ee6 Add an early implementation of a Köppen-Geiger climate subsystem which can be used to provide to plausible weather and enviroment settings based on latitude and longitude with a resolution of 3x3 km. 2020-11-03 11:54:34 +01:00
Julian Smith
bf7d8bbbb3 src/Main/positioninit.cxx: don't open popup if unable to position on taxiway.
Have downgraded from SG_POPUP to SG_ALERT.
2020-11-02 10:53:38 +00:00
Julian Smith
cf55c5f4f5 src/GUI/new_gui.cxx: disable rescan of style files because causes problems. 2020-11-02 10:53:38 +00:00
Julian Smith
6c1387e35b src/Instrumentation/commradio.cxx: don't use and/or keywords because breaks on windows. 2020-11-01 14:46:14 +00:00
James Turner
3cbbbe3df4 Sentry: fix a merge error when enabled. 2020-11-01 11:18:55 +00:00
Julian Smith
d34f7dc451 src/Main/positioninit.cxx: open popup if we can't find taxiway to avoid starting on runway. 2020-11-01 09:29:20 +00:00
Julian Smith
fd723c0497 src/FDM/YASim/Propeller.cpp: set thrust to zero if feathered. 2020-11-01 09:29:20 +00:00
Julian Smith
2e35b01c89 src/FDM/YASim/FGFDM.cpp: show negative thrust in engines/engine[]/thrust-lbs
We previously only showed the magnitude of the thrust; this patch uses the sign
of first element of thrust vector. Makes things less confusing if an engine is
stopped or otherwise causing drag rather than thrust.
2020-11-01 09:29:20 +00:00
Julian Smith
3591bd8631 Be able to control atis speech pitch, volume and speed.
Uses these properties:
    /sim/atis/speed
    /sim/atis/volume
    /sim/atis/pitch

Values 1.0 behave as default. Other values are used to multiply default
settings.

Changes don't take affect immediately. But changing com frequency seems to
often cause an update which will then pick up the new values.
2020-11-01 09:29:20 +00:00
Julian Smith
1a4d3785c4 src/Main/fg_commands.cxx: incremented diagnostic if profiling not available. 2020-11-01 00:03:03 +00:00
Julian Smith
b78ef0c1ab src/Scripting/NasalSys.cxx: fix call to sglog() to pass function="".
Nasal function names are not persistent strings so are not handled correctly by
sg_log_delta code.
2020-11-01 00:03:03 +00:00
Julian Smith
68938ddb4b src/GUI/QtLauncher.cxx: fix call to sglog() to pass __FUNCTION__. 2020-11-01 00:03:03 +00:00
Julian Smith
63fe407d80 src/ATC/trafficcontrol.hxx: fixed warning about const return value with no affect. 2020-11-01 00:03:03 +00:00
Julian Smith
710a11eeda src/Viewer/splash.cxx: show when download speed is zero. 2020-11-01 00:03:03 +00:00
Julian Smith
aa1e0e1d1d src/Main/main.cxx: fixed warning in OpenBSD-specific code. 2020-11-01 00:03:03 +00:00
Julian Smith
a6a7ce3e4b src/Main/bootstrap.cxx: avoid warning on openbsd. 2020-11-01 00:03:03 +00:00
Julian Smith
34e749bc15 src/Main/bootstrap.cxx: disable custom segfault handler on OpenBSD. 2020-11-01 00:03:03 +00:00
Julian Smith
d7614c184c LiveMetarProperties::handleMetarData: increased diagnostics.
Increased diagnostics from SG_WARN to SG_ALERT, to mitigate confusion if METAR
is out of date etc.

Will add a better mechanism for reporting errors at some point.
2020-11-01 00:03:03 +00:00
Julian Smith
4ec80297bf src/Viewer/FGEventHandler.cxx: NewGUI::setStyle(): added code to rescan style files.
Changing style will reload style from filesystem, so one can edit styles and
see results without restarting fg.

Note that this duplicates initial populating of /gui/styles/ from
defaults.xml's <sim><gui>...</gui></sim> section, so it's a bit of a hack.
2020-11-01 00:02:43 +00:00
Julian Smith
43468727ad Added command 'dialog-toggle' - toggles display of dialogue.
E.g. useful for keyboard shortcuts.
2020-10-31 17:23:28 +00:00
Julian Smith
3c9fae3016 src/Aircraft/replay.cxx:loadTape(): use specified path if it ends with .fgtape.
Used to always prepend /sim/replay/tape-directory and append .fgtape. But it's
convenient to be able to specify exact path.
2020-10-31 17:23:28 +00:00
Julian Smith
e2f2299286 src/Main/options.cxx:fgOptLoadTape(): call fgOSExit() if we fail to load tape.
If user specified --load-tape then failure to load it should be fatal to avoid
confusion. It also avoids needlessly overwriting a valid recovery tape if
/sim/replay/recovery-period is set.
2020-10-31 17:23:28 +00:00
Julian Smith
bdfd42ebd4 src/Aircraft/replay.cxx: try to ensure parent dir of recovery tape.
Avoids unexpected absence of a recovery tape.
2020-10-31 17:23:28 +00:00
Julian Smith
270cada516 src/MultiPlayer/multiplaymgr.cxx: fix multiplayer replay when not connected to multiplayer server.
Previously when replaying a recording, we would not show any recorded
multiplayer aircraft if we were not connected to a multiplayer server.
2020-10-31 17:23:28 +00:00
Julian Smith
f04f902b66 src/GUI/MessageBox.cxx:modalMessageBox(): If no gui, use SG_POPUP to ensure message is printed to terminal. 2020-10-31 17:23:28 +00:00
Bertrand Coconnier
801ec1f7a6 Relax the assert when trying to clip with max < min.
Throwing an exception was too harsh. Instead the clipping is ignored and a warning message issued.
Reintroducing the commit 90a04a that has been inadvertently removed.
2020-10-31 18:06:21 +01:00
Bertrand Coconnier
53fac332c1 Fixes for OpenBSD.
Took the opportunity to switch to the more portable call 'fctnl(... O_NONBLOCK ...)' instead of 'ioctl(... FIONBIO ...)' for all UNIX-like OSes.
2020-10-31 14:29:22 +01:00
Bertrand Coconnier
bb0b69bc41 Fixes assertion failures reported by Julian smith.
These were due to the ground callback instance of FlightGear not setting the ellipse parameters of the 'contact' location. this commit make JSBSim immune to that scenario.
2020-10-31 14:11:14 +01:00