Commit Graph

5876 Commits

Author SHA1 Message Date
James Turner
8e338389dd MMap: fix a missed change to use pimpl. 2021-03-16 20:33:44 +00:00
James Turner
522aed9b73 MMap : improved error reporting, Win32 compat
Use strutils::sterror to print errno; convert to pimpl idiom to
avoid pulling Windows.h into public view.
2021-03-16 15:49:58 +00:00
Erik Hofman
0c72b5e622 Of course Windows has it's own _read and _write function whcih conflict with our own. Rename to mmap_read and mmap_write. 2021-03-16 11:55:40 +01:00
Erik Hofman
c6a7dbd755 Do not allocate any memory but work directly on the mmapped buffer 2021-03-16 10:30:58 +01:00
Erik Hofman
84f7faea05 Set EOF when reaching the end of the mmap buffer 2021-03-16 10:30:27 +01:00
Erik Hofman
e8cbcebad8 Make life easier by implementing the system read and write function and call that from the classes read and write functions. Add a forward and rewind function. Add a test_untar derived mmap test utility. 2021-03-16 09:51:37 +01:00
James Turner
cf2fe76bb8 Log positions in courseDeg/distanceM failures
Trying to understand what causes FLIGHTGEAR-71G on Sentry; suspect it
might be passing in uninitalised values.
2021-03-15 15:45:19 +00:00
James Turner
798e690279 ReadWav: error reporting
Report errors from readWAV, and improve attribution for the
format error (include the file path). As a result, mark the individual
exceptions as dont-report, since we will report higher up.
2021-03-15 15:45:19 +00:00
Erik Hofman
931a696007 Add a setup function which takes the topic name from the descriptors typename 2021-03-15 15:16:28 +01:00
Erik Hofman
76cf1e01c6 Sigh, fix a stupid typo. 2021-03-15 15:16:00 +01:00
Erik Hofman
88beb40090 Make simple_mmap and simple_unmmap static private members of SGMMapFile. This should also fix the Windows build error on Jenkins. 2021-03-15 14:45:52 +01:00
Erik Hofman
c539f7ebb6 Add an advance function to step through the mmaped buffer 2021-03-15 13:29:39 +01:00
Erik Hofman
4ace6bda60 Use the new mmap functionality to access the timezone file, removing the need to keep the database in memory. 2021-03-15 11:08:22 +01:00
Erik Hofman
f00a825e2d Add a cross-platform file mmap class and use it to access the timezone file, removing the need to keep the database in memory. 2021-03-15 10:58:17 +01:00
Erik Hofman
508a511070 More gracefully bail out on a missing timzeone file 2021-03-13 13:09:59 +01:00
Erik Hofman
1ea11d987e Add a function to get the timezone description 2021-03-13 10:12:46 +01:00
James Turner
feaac37705 Make SGTimeZoneCOntainer using a pimpl
Keeps zonedetect data private to SimGear
2021-03-12 14:44:26 +00:00
James Turner
4a1809b566 TerraSync: allow an explicit osm2city server
Fixes an error case where a manual TerraSync server is specified; we
would attempt to use an empty string as the OSM2City server, with
hilarious consequences.

Sentry-Id: FLIGHTGEAR-NCZ
2021-03-12 12:47:51 +00:00
Erik Hofman
a9615869e3 If a reader is detected there is no need to test it further, just set a boolean. 2021-03-12 10:48:12 +01:00
Erik Hofman
878b742558 Display the time file that fails 2021-03-12 10:45:01 +01:00
Erik Hofman
9bbb615fbf Use sg_ifstream to load the timezone database into a buffer, and access the database from that buffer. This prevents opening and closing the files too often and allows for wide character paths on Windows. 2021-03-12 09:27:15 +01:00
Erik Hofman
c9e24dcb0b Use a vector database to get the timezone based on territorial boundaries 2021-03-11 15:59:52 +01:00
Stuart Buchanan
bbd84a944a WS30: Improved Road rendering
- Remove road vertices too close together (slicer artifacts)
- Generate linked polygons to remove most gaps.
2021-03-10 22:12:25 +00:00
Erik Hofman
b6c80f2e6a Postpone reader detection to the write call and skip writing if there is no reader yet. 2021-03-10 16:14:30 +01:00
Erik Hofman
c0205f7eb2 Use the find_dependency option to parse Simgear dependencies to FlightGear 2021-03-08 16:15:14 +01:00
Erik Hofman
023364e245 Fix reading from DDS: read data in the requested buffer and not in our own private buffer. 2021-03-08 13:45:18 +01:00
Stuart Buchanan
7b336d2018 WS30 Improve LineFeature Mesh
- Rely on the Slicer for path vertices
- Remove redundant vertices (<1m distance)
2021-03-07 22:26:25 +00:00
James Turner
c86b6fe96c Catalogs: check for local IO failures writing to disk
Sentry.io shows some examples where we failed to write valid data
to disk; check for that if possible.
2021-03-07 15:34:57 +00:00
James Turner
71358dca92 Error-reporting: show XML path when 3D load fails 2021-03-07 12:30:36 +00:00
James Turner
087547c6a0 Report out-of-memory in some loading places
BTG can throw bad-alloc in the wild; catch this case and report it.
2021-03-07 12:30:36 +00:00
James Turner
b7234be625 TerraSync: report errors during downloading
Report various out-of-memory and IO failure conditions; especially,
failure to write downloaded to disk, which was previously not 
recorded.
2021-03-07 12:30:36 +00:00
Stuart Buchanan
0b986beac6 WS30 - Line feature accuracy and width control
- Fix a bug causing roads to be displaced from their
true position (caused by incorrect assumption in ElevationSlicer).

- Add control of the minimum width of roads that are rendered at
each LoD level.  Control properties under /sim/rendering/static-lod

- Improve marking tiles for re-rendering.
2021-03-06 17:23:34 +00:00
Julian Smith
4c25e7898e simgear/io/HTTP*: added support for enabling compression when downloading.
Uses underlying curl library's CURLOPT_ACCEPT_ENCODING.
2021-03-06 08:52:11 +00:00
Julian Smith
58279d03d4 simgear/scene/material/EffectCullVisitor.cxx: avoid c++ warning.
osg::Object() is a virtual base class and clang++ warns unless we explicitly construct it.
2021-03-06 08:52:11 +00:00
Erik Hofman
09156b90fe Per request: Rename DDS to DataDistributionService to prevent confusion with DDS the image format. 2021-03-06 09:10:20 +01:00
Erik Hofman
ae573877da Remove a typo 2021-03-05 15:40:11 +01:00
Erik Hofman
90e9d0a9d8 Support CycloneDDS as a SGIOChannel 2021-03-05 15:23:25 +01:00
Stuart Buchanan
c147c5eb55 WS30 - Move expensive conversion to loading thread 2021-03-04 21:00:12 +00:00
Stuart Buchanan
ce197ea828 WS30 - Improve line feature loading
- Mark tiles that require re-loading after .STG loading, removing a race
condition
- Only re-build line features rather than the entire tile
2021-03-04 20:20:41 +00:00
James Turner
40ead1f71a Add osg::Program wrapper for error-reporting 2021-03-01 11:57:30 +00:00
James Turner
802ce5ad23 ErrorReporting: set context for STG loading
Ensure the STG absolute path can be propagated to all files triggered
by STG loading, including the delayed files and proxied files. This
allows us to attribute errors to the correct scenery path.
2021-03-01 09:42:04 +00:00
Stuart Buchanan
f4dfa854ec WS30 Fix invalid search-and-replace 2021-02-27 16:17:25 +00:00
James Turner
7352e992e6 Allow delayed setup of ErrorContext data
Permit no model data to be provided, when loading a model via the
modelLib API (d’oh)
2021-02-25 12:24:43 +00:00
Stuart Buchanan
1bc0f86cc0 WS30 Line Features - fix build
Add missing files.
2021-02-25 10:54:05 +00:00
James Turner
cb15502b41 Error reporting: add SGModelData context support
Allow us to pass the current error-context from the main thread
into the osgDB loader thread. This is necessary so we can attribute
AIModel (etc) load problems to the correct source.
2021-02-25 09:04:45 +00:00
James Turner
a402eda151 Error-reporting: add some errors for Effect shaders 2021-02-25 09:04:45 +00:00
Stuart Buchanan
716835c7ad WS30 Line Features
Adds a LINE_FEATURES STG Verb of the form

LINE_FEATURES <file.txt> <Material>

Where <file.txt> is a text file consisting of line features to be
rendered with the appropriate <Material> definition.

Each line of <file.txt> has the form
<w> <attr> <a> <b> <c> <d> <lon1> <lat1> <lon2> <lat2> ...

Where
<w> is the line feature width in m
<attr> is an integer for attributes - likely a bitmask*
<a> <b> <c> <d> are floats*
<lonN> <latN> are the lon/lat of point N on the line feature

* denotes values that may be feature-dependent.  For example to indicate
street lighting, kerbing etc.

There must be at least two points on the line feature.
2021-02-24 21:49:42 +00:00
James Turner
93e2bccb0e Error reporting for submodels
Also add some error codes I forgot for AI and traffic.
2021-02-21 19:16:53 +00:00
James Turner
b8b88995cf Add failure reporting / context to various places.
Not total coverage by far, but working through the list of common
failure points as seen on Sentry
2021-02-20 19:57:29 +00:00
James Turner
041c247c0f Suppress reports on some common exception throws 2021-02-20 19:57:29 +00:00