1
0
Fork 0
Commit graph

1693 commits

Author SHA1 Message Date
Stuart Buchanan
f8e1bb2e6e Emesary: Improve error messages 2020-12-17 22:42:42 +00:00
James Turner
c1d1932e5d Menubar auto-hide when leaving normal mouse mode.
Patch from Michael Danilov: when auto-hide of the menubar is enabled,
tigger the hide when we enter (via tab) mouse-flight-controls or 
mouse-look mode, since the menubar is not accessible in these modes
anyway.
2020-12-12 16:42:39 +00:00
Michael Danilov
1052addd23 Mouse: setting for flight controls sensitivitiy. 2020-12-08 15:10:36 +01:00
Julian Smith
da01eab6c1 Grey-out CompositeView menu items if CompositeView not enabled.
Thanks to Michael Danilov for explanation of how to do this.

Also removed spurious hot-key text from CompositeView menu items.
2020-11-24 13:39:21 +00:00
Scott Giese
a150e89e9b Index out of range (-1) 2020-11-21 02:12:39 -06:00
Scott Giese
c874567679 Local weather: setprop() passed a NaN in local_weather/weather_tiles.nas, line 2795
Tiecket: #2423
2020-11-21 02:12:02 -06:00
James Turner
f125b75429 Joystick-config: fix ToggleButton, add AP-DISC
Fix the created binding for toggle buttons.

Add autopilotDisconnect helper to controls.nas, and expose the new
function in the joystick configurator dialog. 

Fixes from Henning Stahlke
2020-11-19 21:17:51 +00:00
Stuart Buchanan
010bd8c145 Fix props.condition
Previously props.condition threw an error if any of the
properties in the condition were not defines.  This is
contrary to the behaviour of SGCondition, which it seeks
to emulate, which considers such undefined properties as
having the value 0.0.

Now this is the case.

This function only appears to be used by tutorials.nas,
where this behaviour was seen as discrepancy between
the checklist <condition> behaviour and the tutorial
<condition> behaviour.

See https://sourceforge.net/p/flightgear/codetickets/2394/?page=1
2020-11-19 18:44:00 +00:00
Richard Harrison
32266ba928 Add comments for props.UpdateManager methods 2020-11-17 11:59:29 +01:00
fly
5981539a38 Autopush: Improve handeling on speedup
Signed-off-by: fly <merspieler@airmail.cc>
2020-11-02 12:26:47 +00:00
Julian Smith
390779a8a1 Nasal/controls.nas: improved handling of /autopilot/locks/passive-mode
Use (!passive) instead of (passive == 0), so that passive == nil is treated as
0.

E.g. this allows keyboard control of autopilot target speed, heading and
altitude in harrier-gr3.
2020-11-01 09:32:39 +00:00
Julian Smith
96ab5884f9 Nasal/controls.nas: turn parking brakes off when normal brakes are applied.
Avoids problems with toggling - difficult to reliably turn parking brakes off.
2020-11-01 09:32:39 +00:00
Stuart Buchanan
9e2ee8b969 Checklist/Tutorial: Auto view direction to marker
This change automatically changes the view direction to look
at a <marker> if any is defined for a checklist item or tutorial
step.

Both the tutorial and checklist features support a <marker> element
which can be used by an aircraft developer to display a magenta
circle around an item of interest (typically a control in the
cockpit).

Previously aircraft developers had to add a <view> element to move
the viewpoint to look at the marker, while users of checklists had
to look for the marker manually.

Now:
- For checklists, pressing the "?" button on a checklist will pan the viewpoint
to the marker.
- For tutorials, if there is not a <view> element defined for a
tutorial step, the view will automatically pan to the marker.
2020-10-31 16:00:51 +00:00
legoboyvdlp R
850b6910b0 Switch live WXR layer to new API after wunderground API was taken down 2020-10-26 09:55:16 +00:00
Automatic Release Builder
85b5c817b0 Nasal: use ‘quiet’ flag when loading jetways.xml
Avoid console spam from probing for jetways files every ten seconds
2020-10-25 19:56:40 +00:00
Richard Harrison
bcd59f8370 Nasal PartitionProcessor added time limiter
the partition processor can now either process a certain number of items per frame, or spend a certain amount of time processing items.

The two options work together - so typically you'd pick a sensible amount of items to process per frame and then maybe also set a maximum amount of time per frame to be sure.

Using the time limit option will take slightly more CPU - but can still be a net benefit
2020-10-25 20:02:41 +01:00
Richard Harrison
7c13462959 Emesary(MP) : Use correct ID for ArmamentNotification 2020-10-23 17:46:40 +02:00
Richard Harrison
d99b621009 Emesary MP notifications ID added (OPRF) 2020-10-19 10:18:26 +02:00
Nikolai V Chr
7434c50ab9 Make sure notifications don't stay in the outgoing MP emesary property, which could lead pilots just connecting to MP to get a past notification. 2020-10-19 00:40:05 +02:00
James Turner
3285e5fe32 Modules.nas: add return values to some methods.
Patch from Henning Stalkhe.
2020-09-03 17:51:16 +01:00
legoboyvdlp R
d0749eee9b Bugfix (temporary) for emesary nasal runtime error. 2020-08-31 19:39:22 +01:00
Stuart Buchanan
45b97601f2 Handle unusual use of - in .svg files
Previously valid SVG strings such as
m 547.56916,962.17731 c 10e-6,25.66886
M831,144.861c-0.236,0.087-0.423,0.255-0.629,

would fail to parse.

Fix by Henning STALHKE
2020-08-19 20:09:06 +01:00
Erik Hofman
6bbb7ff448 Merge branch 'next' of ssh://git.code.sf.net/p/flightgear/fgdata into next 2020-08-15 08:38:00 +02:00
Erik Hofman
9cb073bf8f Add a license exception to single owner (Melchoir Franz and myself) that clarifies that merely calling Nasal functions from third party aircraft does not invoce the derived-work clause of the GPL. Signed of by the authors 2020-08-12 14:40:59 +02:00
Erik Hofman
4bd2a41875 Add a license exception to single owner (Melchoir Franz and myself) that clarifies that merely calling Nasal functions from third party aircraft does not invoce the derived-work clause of the GPL. Signed of by the authors 2020-08-12 14:40:44 +02:00
Erik Hofman
8e7c4550d7 Add a license exception to single owner (Melchoir Franz and myself) that clarifies that merely calling Nasal functions from third party aircraft does not invoce the derived-work clause of the GPL. Signed of by the authors 2020-08-12 14:39:32 +02:00
James Turner
0431a2ec6f Nasal modules: don’t give up on an error.
Fix from Henning Stahlke
2020-08-12 11:04:10 +01:00
James Turner
398d9cb486 Add ‘del’ method to SVGCanvas
From Henning Stahlke
2020-08-02 11:06:19 +01:00
Richard Harrison
33ac2eff46 Added Emesary MP bridge unit tests 2020-08-01 16:44:02 +02:00
Henning Stahlke
6ac7b3385e move min and max from std/Vector.nas (class file) to std.nas 2020-07-30 10:48:27 +01:00
Richard Harrison
3666ba1511 Emesary fixes
- Transfer encoding rewritten to handle negative numbers properly and fix scaling.
- Change the "no receive method" to be just a warning as it is unwise rather than
  being wrong.

Emesary MP bridge fixes from Nikolai

OutgoingBridge:

- When transmitting queue, make sure transmitted
  messages cannot remain in the queue when not completely emptied, and
  thus be sent again, and eventually fill up the queue.

- Also allow smaller messages to sent even though there was not room for
  a larger message (the removal of the 'break' command).

- To prevent coding the same message again with the 'break' removed,
  store an already coded string that was rejected due to too little room
  inside the message so when there is room for it, it was coded only
  once.

- Stop recalculating MessageExpiryTime when there is no
  room for a notification. If it has asked to expire after expire time,
  let it expire.

IncomingBridge:

- Make sure listeners on emesary[x] properties are
  removed when a mp aircraft is invalid, otherwise a hidden bridge will
  sit in background and process same notifications a new bridge is
  already processing.

- Change order of setting IncomingMessageIndex to ease
  debugging in reciever.

- Since a bridge class can handle multiple emesary
  properties on same aircraft, use a vector per aircraft to store the
  bridge instances in, to make sure Remove can be called on all
  instances listening to same aircraft.
2020-07-25 14:11:07 +02:00
Richard Harrison
37729a8661 Added Nasal frame utils: (1) partition processor
The partition processor is a simple class that allows lists of data to be processed in chunks per invocation. It is designed to minimise per frame processing whilst keeping the code simple and the performance acceptable.

test code (use with F-14):

var pptest = func{
    var xx= frame_utils.PartitionProcessor.new("TEST", 6);

    var obj = {}; # just for testing

    for (ii=0;ii<5;ii+=1) {
        xx.process(obj, awg_9.tgts_list,
                   func(pp, obj, data){
                       print("init");
                       obj.designated = -1;
                       obj.search = "Nimitz";
                       obj.completed = 0;
                   }
                   ,
                   func(pp, obj, u){
                       printf("%-5d : %s",pp.data_index, u.Callsign.getValue());

                       if (u.Callsign.getValue() == obj.search)
                         obj.designated = pp.data_index;
                       return 1;
                   },
                   func(pp, obj, data)
                   {
                       obj.completed = 1;
                       printf("Completed: %s = %d\n", obj.search, obj.designated);
                   }
                  );
        if (obj.completed)
          break;
    }
    if (!obj.completed)
      print("partial list processed");
}

pptest();
2020-07-24 15:35:10 +02:00
legoboyvdlp R
dee62a362d Add support for ALS in shader lider settings 2020-07-14 12:09:28 +01:00
Stuart Buchanan
96ea977af5 Fix case errors and Vector.nas
Fix from Julio SANTA CRUZ
2020-07-11 22:11:39 +01:00
Henning Stahlke
4cb8a03e4b move globals.Hash to std.Hash
Add std.nas to loadpriority.xml and update related files
2020-07-08 15:31:23 +01:00
Stuart Buchanan
78e9eff433 FG1000: Keyboard input for GCU 47X
From Julio Santa Cruz
2020-07-07 13:28:32 +01:00
Henning Stahlke
486797d6c6 extract base class SVGCanvas from EFIS framework to canvas/api/svgcanvas.nas 2020-07-06 10:09:33 +01:00
Henning Stahlke
63fc1cf06d move colors from draw.nas to api/colors.nas 2020-07-06 10:09:26 +01:00
Henning Stahlke
c93cf18842 bugfix canvas/gui.nas: rte on undefined member, remove unnecessary settimer call 2020-07-06 10:09:17 +01:00
Henning Stahlke
01811ec69a canvas/gui.nas add missing return values 2020-07-06 10:09:08 +01:00
James Turner
1cee9485c6 Fix Canvas-Map runway display.
Transformation was being applied twice.

Patch by Gaétan Allaert.
2020-07-01 11:44:22 +01:00
James Turner
bbbf52f47e Patch from Huntley Palmer to control condition axis 2020-07-01 10:34:03 +01:00
Henning Stahlke
a13f9b3bb0 emesary.nas add comments, type checks; fix typos; add debug/emesary.deb.nas add fgcommand to use the global transmitter 2020-06-29 14:07:25 +01:00
James Turner
986369f6ea Use logprint in more places
Trying to reduce Nasal alert-level output for non-alert-y things.
2020-06-28 07:27:29 +01:00
Henning Stahlke
09dca7d3f0 Configurable auto-gen of tutorials from checklists
Previously tutorials were generated from all checklists.

Now <auto-tutorial>false</auto-tutorial> can be set at
any level of the checklist heirarchy to disable generation
of tutorials for a given checklist, group, or for all
checklists.
2020-06-27 15:20:02 +01:00
Richard Harrison
7795efe340 Added Nasal unit tests for Emesary.
This tests
* basic functions of register/degregister
* ensures that transmit/receive work correctly
* Transfer encoding methods (byte, double, norm, int) work properly
2020-06-15 13:31:54 +02:00
Richard Harrison
077d44f347 Emesary : rework transfer encoding
This better supports -ve numbers by using -range/2 to range/2 instead of prepending a '-' to the start of the encoded value for -ve numbers.
2020-06-15 13:31:53 +02:00
Richard Harrison
8b03cb4e60 Added queued transmitter.
This is a normal transmitter than doesn't act synchronously and instead queues messages for future processing.

Can be useful to implement thread safe receive/transmit logic where a sub thread is requiring property changes that can be sent to a queued transmitter that is then processed in the main thread.
2020-06-15 13:31:49 +02:00
Henning Stahlke
717ae92b23 canvas_efis/efis-canvas.nas bugfix 2020-06-15 11:17:56 +01:00
Erik Hofman
027d1e4e61 Add a license exception to single owner Nasal libraries which clarifies that merely calling Nasal functions from third party aircraft does not invoke the derived-work clause of the GPL. Signed off by the authors. 2020-06-09 16:05:10 +02:00
Henning Stahlke
92fe425e0a efis-canvas.nas sanitize string 2020-06-08 19:52:48 +01:00
Henning Stahlke
ed1deacce8 props.nas: add isValidPropName and makeValidPropName; add props.nut 2020-06-08 19:52:48 +01:00
Erik Hofman
f8ce9398b9 Add a license exception to single owner Nasal libraries which clarifies that merely calling Nasal functions from third party aircraft does not invoke the derived-work clause of the GPL. Signed off by Thomas Geymayer 2020-06-08 15:07:28 +02:00
Erik Hofman
6604cad250 Add a license exception to single owner Nasal libraries which clarifies that merely calling Nasal functions from third party aircraft does not invoke the derived-work clause of the GPL. Signed off by Thorsten 2020-06-08 15:07:10 +02:00
Erik Hofman
6a4c9a2a81 Add a license exception to single owner (Melchoir Franz and myself) that clarifies that merely calling Nasal functions from third party aircraft does not invoce the derived-work clause of the GPL. Signed of by Melchoir. 2020-06-05 11:31:57 +02:00
Henning Stahlke
2f0f99826a remove unused function floor from geo.nas
Signed-off-by: Stuart Buchanan <stuart_d_buchanan@yahoo.co.uk>
2020-06-03 23:20:01 +01:00
Henning Stahlke
b5f00cb50e replace typeof() by is<type>()
Signed-off-by: Stuart Buchanan <stuart_d_buchanan@yahoo.co.uk>
2020-06-03 22:55:51 +01:00
Henning Stahlke
148328d793 Nasal loadpriority; remove nasal-dir-initialized listeners;
add more dependencies to loadpriority.xml and remove _setlistener stuff
2020-06-03 21:57:14 +01:00
Nikolai V Chr
b23d866690 Some fixes for Emesary MP Bridge (approved by Richard)
Make listeners for MP properties only fire when properties changes.
Enherit the notification before propagating to avoid StartMessageIndex being shared and thereby messages can get held back.
Some improvements to logging.
2020-05-31 05:18:04 +02:00
James Turner
f5f2a8fd33 Route-manager: sync with C++ approach trans API
When an explicit approach transition is used, route to it, otherwise
keep using the automatic selection based on IAF.
2020-05-28 09:08:30 +01:00
Stuart Buchanan
f0a999cb2c Nasal library load order
Control the order in which fgdata/Nasal/*.nas files are loaded
on startup.

Previously all the files were loaded in order based on filename.
This was problematic for aaa.nas which might want to call
props.getNode(), and generally resolved by using
_setlistener("/sim/signals/nasal-dir-initialized")

This change allows us to configure a list of Nasal files that are
loaded first on startup - loadpriority.xml.
2020-05-25 19:47:50 +01:00
James Turner
d0d55ccb04 Route-manager: use Flightplan transition data
Explicitly use the flight-plan transition data when building the
routes for the SID and STAR. Previously we didn’t actually pick
this up reliably.
2020-05-21 22:34:28 +01:00
Henning Stahlke
11e36dd8a9 debug.nas subdir per probe class 2020-05-17 20:04:05 +01:00
Henning Stahlke
ec3cef2183 aircraft.nas data use maketimer instead of settimer loop; replace typeof by isType 2020-05-17 20:03:53 +01:00
Henning Stahlke
5a5d958dd9 replace typeof() == foo with isFoo 2020-05-17 20:03:43 +01:00
Henning Stahlke
627530cf5b props.nas prevent endless recursion in copy if destination is a subnode of source 2020-05-17 20:03:30 +01:00
Henning Stahlke
eeb1b5e3d5 debug.nas add helpers for adding probes at runtime; add subnode to _debug for hit counters
add dumpProbeStats() and Breakpoint.dumpTrace()
dumpTrace to XML file separate tracer class
2020-05-17 20:01:43 +01:00
fly
b44a1c1a7c Added autopush
Signed-off-by: fly <merspieler@airmail.cc>
2020-05-15 11:29:07 +01:00
James Turner
acd37379ea Add sample test file to Nasal/ 2020-05-06 15:41:18 +01:00
Henning Stahlke
d1d3b6559e compass.nas: add font to style hash; efis-canvas.nas: improve font mapping 2020-05-05 13:52:06 +01:00
Henning Stahlke
67c83d020f make font_mapper more configurable 2020-05-05 13:52:00 +01:00
Henning Stahlke
49c8dcd442 modules/canvas_efis/efis.nas replace typeof(), use log constants, add {} 2020-05-05 13:51:56 +01:00
Henning Stahlke
17e3ba6698 debug.nas add dumpProbeStats() and Breakpoint.dumpTrace() 2020-05-05 13:51:52 +01:00
Henning Stahlke
bef5de6e81 debug.nas add helpers for adding probes at runtime; add subnode to _debug for hit counters 2020-05-05 13:51:45 +01:00
Henning Stahlke
a65cb738e5 re-enable reload prop on modules.nas 2020-04-30 11:47:25 +01:00
Henning Stahlke
551f4dab62 canvas/api/element.nas add getType 2020-04-30 08:59:25 +01:00
Henning Stahlke
e16bf79e91 move "hidden" constructor from api.nas to api/canvas.nas; add destructor support 2020-04-30 08:59:25 +01:00
Henning Stahlke
3892d2eddd move fontmapper function from svg.nas to api/text.nas so it is generally avail 2020-04-30 08:59:25 +01:00
Henning Stahlke
e996f4c8c6 add getTranslation and setGeoPosition to transform.nas, adapt element.nas accordingly;
improve readability and comments
2020-04-30 08:59:25 +01:00
Henning Stahlke
2eb4c78794 improve code readability 2020-04-30 08:59:25 +01:00
Henning Stahlke
1094e5214e split classes into separate files 2020-04-30 08:59:25 +01:00
James Turner
f074504326 setlistener: tolerate being call()-ed
Fix bug https://sourceforge.net/p/flightgear/codetickets/2219/
Changes to logging mean than setlistener breaks when invoked via
call(), which occurs in the Warthog Nasal scripting. The problem is
that call() forces caller() to return nil, which the setlistener()
debug code did not check for.
2020-04-27 22:50:34 +01:00
Henning Stahlke
95d0aa032e bugfixes for debug.nas and props.nas 2020-04-24 16:00:09 +02:00
Henning Stahlke
4c867a79f0 adjust setlistener default in modules/addons to match globals.nas 2020-04-24 16:00:09 +02:00
Henning Stahlke
fba17e4d34 Replace printlog by logprint 2020-04-21 09:07:20 +02:00
Henning Stahlke
6078cff6b1 extend debug.Probe and debug.Breakpoint classes with trace option 2020-04-21 09:06:09 +02:00
Henning Stahlke
ed3568554d Add toggleBool() to props.nas 2020-04-21 09:02:16 +02:00
James Turner
d1998f27ff Default GPS handling of DISCON waypoints
When a DISCON is sequencing, revert to OSB mode at the current heading.
Also fix heading capture when reverting to OBS mode in various other
places.
2020-04-19 17:05:29 +01:00
James Turner
fc50680694 Use logprint() in various places
This reduces Nasal console spamming to match to the set log-level
2020-04-19 16:46:57 +01:00
Henning Stahlke
251a376f68 modules.nas: change reload trigger from property to fgcommand, fix a logprint call, add module name to debug output 2020-04-19 12:39:33 +01:00
Henning Stahlke
1035ed4269 add skip parameter to debug.nas breakpoint class 2020-04-19 12:29:01 +01:00
Henning Stahlke
93c48818fd debug.nas: prevent stack overflow in dump; print function names in backtrace; 2020-04-16 16:25:20 +01:00
Henning Stahlke
8f6fd3cb79 props.nas add adjustValue() 2020-04-16 16:25:20 +01:00
Henning Stahlke
b4eaa3e438 props.nas add increment and decrement for int props 2020-04-16 16:25:17 +01:00
Henning Stahlke
f210a38011 addons.nas add fgcommand addon-reload 2020-04-16 16:23:51 +01:00
Henning Stahlke
2a48a3012b add approx_eq to math.nas and is_regular_file io.nas 2020-04-16 16:19:29 +01:00
Henning Stahlke
d2d1fead76 modified output of debug.backtrace 2020-04-16 16:18:15 +01:00
James Turner
838ba8230b Local-weather: Remove a debug print()
This caused random ‘0’ to appear on the console. Checked with
Thorsten R, okay to disable this.
2020-04-10 11:24:32 +01:00
Richard Harrison
f9eacd8be0 Nasal Debug.dump tweaks to make it readable as JSON 2020-04-09 23:56:43 +02:00
Richard Harrison
5f1784937e Added Joystick Sensitivity Reduction to dialog.
This allows the setting of the <power> tag - which in turn will decreases the sensitivity around the zero position
2020-04-09 23:56:37 +02:00