James Turner
fa898e7cd6
Add _adjustValue helper to Nasal-props
2020-04-15 11:24:32 +01:00
gallaert
8da16eddd6
Replace boost::to_lower and boost::to_upper by strutils::lowercase and strutils::uppercase
2020-04-14 13:26:53 +01:00
James Turner
81ba646111
Add some type-checking helpers to Nasal.Props
2020-04-14 13:26:29 +01:00
gallaert
fb65f64342
Replace BOOST_FOREACH by C++ 11 for range loop.
2020-04-12 14:40:36 +01:00
James Turner
c78e6fb443
Nasal: expose SG log levels as constants
...
This avoids the need to use integers as the first argument to logprint()
in Nasal, which is confusing. Add global constants LOG_INFO, LOG_WARN,
etc.
2020-04-09 13:59:37 +01:00
James Turner
785436abf4
Nasal: support for unregister FP delegates
2020-04-08 12:27:31 +01:00
James Turner
36ba1e3dce
UTF-8 support: replace Nasal io.stat with our own.
...
Replace the default io.stat with one which uses our validator, and
uses SGPath to call _wstat on Windows. This does mean we return less
information in the stat() result, but it seems nothing actually uses
the result apart from checking if the file exists.
2020-03-14 21:01:45 +00:00
Erik Hofman
fb348d1a8a
Fix a false compiler warnig about brackets not protecting the next if statement
2020-03-14 14:04:22 +01:00
James Turner
9389c6564f
Nasal geodinfo: warn when scenery is not loaded
2020-03-13 16:46:54 +00:00
James Turner
e492ddd5a0
Event more local8Bit -> UTF8 fixes
2020-03-13 09:53:49 +00:00
James Turner
5b41f374c6
L10N fixes: handle UTF8 paths in more places.
...
Still not complete, but now we set the command line args to be UTF-8 on
Windows, we can strip out more of the ‘local 8-bit’ places (which
screw up, generally).
2020-03-12 10:51:49 +00:00
James Turner
e509711075
Fix some warnings from current Apple clang
...
- remove some unused vars
- remove use of std::mem_fn / std::bind2nd
2020-03-10 17:02:08 +00:00
James Turner
3f14d53286
FlightPlans: fix save/load of restrictions, deleting legs from Nasal
...
- Fix Leg ownership to avoid segfaults when deleting them via Nasal
- Modify FP save/load code so restrictions and holds are correctly
saved and restored
Extend the tests to cover these cases.
2020-03-10 14:00:40 +00:00
James Turner
f14b8ba6d4
Validate Nasal makeTimer arguments
...
When the callback arguments can’t be validated,
catch is and actually report a failure, instead of creating a
non-functional timer object
2020-02-24 11:33:05 +00:00
Stuart Buchanan
1f0c21a371
Warn when Nasal module not set in defaults.xml
2020-02-19 20:32:22 +00:00
legoboyvdlp R
b920a09fcf
Correct whitespace in NasalPositioned.cxx; fix segfault in NasalPositioned by adding null check in the legGhostGetMember method; add test case for segfault
2020-01-27 16:27:46 +00:00
James Turner
fad9f7068f
Expose canvas::Image pixel funcs to Nasal
2019-12-17 22:06:35 +00:00
James Turner
68a72f22f2
Fix a copy-paste-bug in a Nasal error
2019-10-20 13:08:47 +01:00
James Turner
26b9cce6a3
Quiet false-positive tied-listener warnings
...
Use a new SGPropertyNode flag, LISTENER_SAFE, to white-list properties
where we do correctly fire listeners, and test this flag when listening
from Nasal, to avoid the warning.
2019-10-20 13:08:47 +01:00
James Turner
18c19885c6
Improvements to Nasal hold API
...
Ensure changes from Nasal are picked up by delegates (such as GPS) when
they are made. Add a route-manager test which sets and exits a hold
using Nasal.
As part of this, update the test API to make it easy to run Nasal from
a test.
2019-09-24 11:29:05 +01:00
James Turner
12cccf043a
Nasal interface to hold waypoints
2019-09-23 23:01:12 +01:00
James Turner
45df8f51b2
Move GPS sequencing into Nasal (optionally)
...
GPS now lets the delegate handle the sequencing behaviour, by
setting a new config property. The default GPS delegate (in Nasal)
now sets this property.
This requires a corresponding FGData update.
2019-09-20 13:05:57 +01:00
James Turner
2d89cb2390
Nasal: Log names of stranded persistent timers
2019-09-18 23:42:39 +01:00
James Turner
dbbebc8f7e
Tolerate missing scenery (happens in unit tests)
2019-09-18 23:42:39 +01:00
James Turner
492707a756
Flightplan-nasal alias a name for readability
2019-09-18 23:42:38 +01:00
James Turner
f643100dad
Avoid a warning when inserting nil into a FP
...
This avoids the warning when procedure construction fails, and we have
a nil result rather than an empty vector as the arg.
2019-07-15 14:37:29 +01:00
Edward d'Auvergne
34a6cb3c74
SGSubsystem classes: Registration of all subsystems.
2019-07-01 14:51:32 +02:00
Edward d'Auvergne
fb5c36fc82
SGSubsystem classes: Renaming of the subsystem ID variables and functions.
2019-07-01 14:27:30 +02:00
Edward d'Auvergne
7a6e63ddb9
SGSubsystem classes: Subsystem and subsystem group API declaration standardisation.
...
This is a cleanup commit.
2019-07-01 14:27:30 +02:00
Edward d'Auvergne
60a2444766
SGSubsystem classes: Whitespace standardisation of the declarations.
...
This is a clean up commit prior to the subsystem API standardisation to simplify
the diffs. It includes all SGSubsystem and SGSubsystemGroup derived classes.
2019-07-01 14:27:28 +02:00
Richard Harrison
8c4334e3ae
Increase severity of warning when trying to add a setlistener onto a tied property
...
- before this it was all to easy to miss being at DEBUG level and this is quite an important problem to be aware of for model developers
2019-06-11 14:38:38 +02:00
Richard Harrison
50d4b37a7d
Nasal timestamp - add elapsed uSec
2019-05-07 05:16:37 +02:00
Richard Harrison
7db06300c0
Nasal binding for SGTimeStamp via maketimestamp
...
usage:
var timer = maketimestamp();
timer.stamp(); # start timing
print("elapsed ",timer.elapsedMSec(),"ms");
2019-05-02 07:31:37 +02:00
Richard Harrison
d3ce7adc95
NasalTimers; ensure unique name as this is required to identify the timer for certain operations (e.g. stop)
2019-04-28 19:40:26 +02:00
Richard Harrison
5253215065
Improvements to performance monitoring.
...
* Ensure that subsystems are named.
* Nasal timers are named appropriately
2019-02-10 18:07:07 +01:00
Stuart Buchanan
b166b523b2
Copy name into buffer on release builds
...
Problem seen with Nasal setChildren/setValues where names were not
being passed down the stack. Identified as over-zealous IF_DEF
to remove unused variable compiler which meant snprintf was not being called
for non debug builds (see c177aeb623
)
Fix is to change assert() calls to an naRuntime error, which ensures
that the len variable is always used and is
more appropriate as buffer overrun could occur in any release build if
someone tried to set a name of >1024 characters.
2019-02-09 18:11:56 +00:00
James Turner
dee1998979
Less Boost.
2019-02-06 17:36:36 +00:00
Torsten Dreyer
c177aeb623
Silence some warnings about unused variables.
...
No functional change
2019-02-06 09:41:08 +01:00
James Turner
8487ca7ee6
Add findByIdent to Nasal API
2019-01-12 23:40:51 +00:00
James Turner
416317e444
Nasal: allow filtering airport approaches by STAR
2019-01-12 23:40:51 +00:00
James Turner
4df6cb0558
Nasal: expose additional members on fixes/navaids
...
Add a ‘colocated_dme’ member to identify VOR/ILS pairings with DME.
Also exposed the navaid unique ID for easy disambiguation.
2019-01-12 23:40:51 +00:00
James Turner
5affa13348
Nasal: expose airways data and via options
2019-01-12 23:40:50 +00:00
James Turner
018e193a58
Improve Nasal log callback handling
...
(Was being leaked on reset)
2018-12-20 16:07:44 +00:00
James Turner
0747c2b373
Fix for a flight-plan / delegate crash
...
Catch a specific issue (-1 index not permitted for fp.current in Nasal),
but also catch
2018-09-07 15:17:55 +01:00
James Turner
1eab1722e5
Fixing some Clang warnings (C++98-isms)
2018-09-02 10:07:09 +01:00
James Turner
0d58220580
Flightplans: expose remaining new methods to Nasal
2018-09-02 10:06:43 +01:00
James Turner
09fdfe358c
Reset: ensure Nasal shutdown is clean
...
Some improvements / bullet-proofing while trying to track down the
slow-on-reset issue.
2018-09-01 18:53:45 +01:00
James Turner
e6a3b9c012
Extend Nasal FlightPlan API for new members
...
Cruise alt/speed, remarks and callsign are now exposed and settable
from Nasal. Duration and route path still to be done.
2018-08-30 16:40:16 +01:00
James Turner
69dbfc0a27
Core airway and flight-plan enhancements
...
Add better airway support, fix various issues with VIA, and add
parsing / generation of ICAO route strings. Also fix the
serialisation of flight-plans with airway enroute segments, so these
can be restored correctly.
2018-08-28 12:23:01 +01:00
Edward d'Auvergne
feb854946e
TestSuite: Complete removal of FG_TESTLIB.
2018-07-26 15:52:07 +02:00