New functions naCallMethodCtx and naCallMethod to replace
NasalSystem::callMethod from FlightGear. This has just added an
unneeded level of indirection and fits better directly into Nasal.
naSetErrorHandler can be used to register an error handler/logging
function.
These new functions are meant to replace the gcSave/gcRelease
methods of the NasalSystem class in FlightGear, as passing an
adapter to SimGear from FlightGear is quite a lot of useless work
just for being able to save objects.
Move content-encoding handler into its own file, which
simplifies the main code. As part of this, fix a bug where we
didn't flush the ZLIB buffers on response completion.
- rename mod() to fmod() to prevent collisions with the
version in math.nas (which has different handling of negatives)
- implement pow, tan, acos and asin natively
- add round(x, [p]), which rounds away from 0.0, and takes an
option precision. I.e you can round(479, 50) and get '500'; useful
in many digital cockpit displays.
Provide an API to query which tiles are currently being synced. This
allows the higher levels (TileManager in FlightGear) to safely wait on
TerraSync before loading tiles.
Doing this exposed some bugs in scheduling tiles to sync by integer
lat/lon, related to round-towards-zero with -ve values (western /
souther hemispheres). To resolve these, and also reduce spurious
syncs, switch to an explicit API for requesting tiles by SGBucket.
This keeps TerraSync fully aligned with the TileManager queue, which
has many benefits for both high and low visibility situations.
Prefer existing, idle connections to creating new connections,
even when below the max-connection limit. Gives much better re-use
and pipeline-ing, and hence reduced setup time/trips.
When re-init-ing the sim, tell TerraSync what's going on (we don't want
to actually reset it, since that would disturb in-flight downloads).
Add an explicit method so it can reset its last lon/lat, and hence do
the initial sync at the new location correctly.
Track 'waiting for response' state explicitly, so we don't
falsely report IDLE when waiting for a response.
Expose bytes-per-second download rate as metric.
Add explicit subsystem state tracking so we can safely init()
terrasync very early during startup, and hence overlap lengthy operations
(Shared Models sync and initial NavCache build)
When using built-in sync code, separate items into distinct slots.
Slots process items sequentially, but each slot works in parallel (using
a single shared HTTP engine). This allows tiles to be synced in parallel
with airports/shared models data, greatly increasing responsiveness
to get tiles synced on initial launch.
We already synchronise other things besides tiles, and will soon want different
behaviour based on the type of item we're syncing (so we can synchronize some items in parallel). Rename the struct to be clearer, and add an enum encoding the type of item for future use.
Hopefully this tells the Expat headers not to do any clever
declspec(import) or export stuff, which we don't want since we only
use the symbols within SimGearCore, and don't export them.