1
0
Fork 0
Commit graph

1759 commits

Author SHA1 Message Date
James Turner
333321556f Add example of coordinate conversion 2023-01-05 14:28:20 +00:00
James Turner
df43cb2554 Canvas: make setVisible chainable
Change Element.setVisible to return self, so it can be chain
called like most other setters. Note this also requires some C++
changes in FlightGear.
2023-01-04 15:32:26 +00:00
TheFGFSEagle
074e2511de Fixed some more typos 2023-01-04 12:35:04 +00:00
TheFGFSEagle
114694cbbe Fix inheritance mistake, add resizing test button 2023-01-04 10:03:27 +00:00
TheFGFSEagle
b2f37b67f8 Added usage example for the TabWidget 2023-01-03 13:49:56 +00:00
TheFGFSEagle
4bc559bcf4 Added canvas widget factory dialog 2023-01-03 13:49:56 +00:00
TheFGFSEagle
09e15ddf16 Added canvas checkbox subclass whose check state is always the bool value of a node and vice versa 2023-01-03 12:39:51 +00:00
TheFGFSEagle
8d5e4aaf1c Added basic tab widget 2023-01-03 12:39:51 +00:00
James Turner
aef16be4f0 Revert "Add option to read upper winds from simbrief"
As requested by Lars, revert these commits since they don't
work as hoped, reliably.

This reverts commit 55b17f4c5e.
This reverts commit 91401a95b0.
2022-11-24 12:17:49 +00:00
James Turner
1e1f974b76 Clean up autopush attribution 2022-10-18 10:08:41 +01:00
James Turner
6e8520dbb5 Canvas windows: allow hiding without deletion
Optionally, allow Canvas windows to persist (and be shown again) when
closed.
2022-10-14 09:01:52 +01:00
James Turner
4fd8092e38 Canvas GUI: left position for checkbox text 2022-10-14 09:00:02 +01:00
Roman Ludwicki
41006285d5 Fix description for Shift-F10 2022-09-29 00:45:58 +02:00
James Turner
312822e4b0 Canvas: reduce SVG console spam
Ignore certain standard elements added by Sodipodi / Inkscape, to
reduce console spam loading SVGs.
2022-09-26 08:59:18 +01:00
James Turner
459dea77e5 Add more Nasal skeleton for new UI objects 2022-09-26 08:58:24 +01:00
James Turner
82cb79feb3 Add additional widgets for PUI compat
Styling of these is not complete yet.
2022-09-09 12:19:33 +01:00
Lars Toenning
55b17f4c5e Block metar winds if simbrief winds are active 2022-08-21 15:57:34 +02:00
Lars Toenning
91401a95b0 Add option to read upper winds from simbrief 2022-08-16 08:33:35 +01:00
Roman Ludwicki
1c5fcf3cef Add missing button "Rudder Trim Pos" for joystick assignment 2022-07-17 19:55:23 +02:00
James Turner
3965f216e5 Gui: add some helpers:
- clear() function on LineEdit
 - setDefault/Destructive flags on Button
 - check if focus is set on a Widget
2022-06-30 12:41:17 +02:00
James Turner
fe7c87b21a Nasal glue for building widgets from XML compat 2022-06-30 12:41:10 +02:00
Josh Davidson
918b5fd72f Canvas: Add an option for Canvas dialogs to not take focus from the simulator 2022-06-30 11:33:40 +02:00
Julian Smith
c55c17dd64 Nasal/multiplayer.nas: always enable multiplayer chat when replaying.
This is an additional fix for bug 2731, ensuring that replay includes chat
messages even if we are not connected to an MP server.
2022-04-22 20:38:00 +01:00
Julian Smith
e0070501e6 Nasal/multiplayer.nas: always enable multiplayer menu items when replaying.
This fixes bug 2731, where MP menu items were greyed out if we are not
connected to MP server, even if we are replaying a recording with MP aircraft.
2022-04-22 00:27:54 +01:00
James Turner
e945dafca3 Props: add defaultValue to getInt|Double Value
Simplify handling where the property value might be nil.
2022-04-06 07:49:39 +01:00
Richard Harrison
a395423f27 Nsasl: Added Exec Scheduler
see also https://wiki.flightgear.org/Nasal_Optimisation#Emesary_real_time_executive

Using a scheduler to manage the invocation of Nasal modules provides a more predictable and efficient way to replace update loops and also optimises property tree access to one access per property per frame by using a hash that contains the property values.

There is a default global object created (emexec.ExecScheduler) that should be used in most circumstances.

Each Nasal object simply has to have an update(notification) method. This will be called on a schedule and the notification will contain any requested property values.

The exec will also adapt the rate to the frame rate; with a maximum of 50hz, but this will drop to as low as 4hz based on the frame rate to optimise workload.

The modules will be called in the order in which they were added; so it is possible to have modules in the right sequence (i.e. an earlier module calculates values that are used by a later module)

A simple example is below. The VSD_device has the update method
------

# list of prooperties to include in the notification hash
var properties_to_monitor = {
                                OrientationHeadingDeg  : "orientation/heading-deg",
                                OrientationPitchDeg    : "orientation/pitch-deg",
                                OrientationRollDeg     : "orientation/roll-deg",
                                GroundspeedKts         : "velocities/groundspeed-kt",
                                radar2_range           : "instrumentation/radar/radar2-range",
                                target_display         : "sim/model/f15/instrumentation/radar-awg-9/hud/target-display",
                                vc_kts                 : "instrumentation/airspeed-indicator/true-speed-kt",
                            };
# create Canvas based device (that has an update method)
VSD = VSD_Device.new(designation, textureImage, notification.Ident, root_node);

# register with the exec;
# - ident
# - proprties to include in notification hash
# - object (with an .update(notification) method
# - rate (4 = 1/4)
emexec.ExecModule.register("F15-VSD", properties_to_monitor, VSD, 4);
2022-04-04 17:23:12 +02:00
Richard Harrison
304836f41a Nasal: optimises properties in lp filter
Use geNode instead of getprop
2022-04-03 18:30:17 +02:00
Richard Harrison
2fe23785d5 Multiplayer pilot list fixes
- made it more robust so that bad data doesn't stop it from working.
- optimised to store the prop nodes that we use in the list
2022-03-17 19:27:13 +01:00
James Turner
2fb18ceed6 ProperyElement: remove dependency on aircraft.nas
Make a local copy of the makeNode helper, so Canvas doesn't depend on
aircraft.nas
2022-03-06 10:59:06 +00:00
Richard Harrison
8419dec54a Fix Tyre Smoke/Spray in air.
Previously it was possible that the smoke/spray would continue if the aircraft went weight off wheels whilst smoke was active.
2022-03-02 14:16:19 +01:00
Richard Harrison
09adb59959 Controls: Added trim to position for rudder and aileron 2022-03-02 14:16:18 +01:00
Erik Hofman
1012c49143 Add a copyright header and
make the heading relative to make it usefull for cockput cubemaps
2022-02-10 15:00:15 +01:00
Erik Hofman
216f3fbf0c Add a Nasal module to create a cubemap or panorama view
Inspiration taken from:
https://wiki.flightgear.org/Howto:Make_full_spherical_panorama
2022-02-09 15:49:23 +01:00
James Turner
2d17217a01 Marker-pins FGData changes
From Tobias Dammers
2022-01-27 12:11:24 +00:00
Scott Giese
61bf4c2858 Canvas Map: Add outline to aircraft symbol 2022-01-14 01:12:26 -06:00
Julian Smith
e951ae9e9a Nasal/multiplayer.nas: append +/- to indicate change in distance. 2022-01-08 16:16:21 +00:00
Jonathan Redpath
18eaba13f4 Apply patch by Tobias Dammers - correct RTE.lcontroller equals function to fix the infamous model not found error 2022-01-03 15:51:22 +00:00
Henning
1890502283 Add argument validation in canvas_efis/eicas-message-sys.nas 2021-12-04 14:50:01 +01:00
Henning
28e865f1e6 Bugfix for aircraft.nas: declare missing member variable 2021-12-04 14:47:22 +01:00
Richard Harrison
b5b9568bc7 Local weather: change unknown landcover message to use logprint 2021-10-18 15:31:19 +02:00
Richard Harrison
dc697141b8 Tyre effects (spray, smoke) rework
Spray density realism improved by using a curve for the density and permitting the trigger to be changed (default 0.2)

Touchdown smoke trigerred by WoW changing using the velocity as a factor and then using a low pass filter on this to fade out the smoke. This results in smoke for a brief period that appears to be more realistic. F-14 example: https://i.imgur.com/FkwgoYV.gifv
2021-10-18 15:31:19 +02:00
b'Fernando Garc\xc3\xada Li\xc3\xb1\xc3\xa1n
25068efaee Merge /u/amalon/fgdata/ branch vr_1 into next
https://sourceforge.net/p/flightgear/fgdata/merge-requests/238/
2021-09-03 22:23:20 +00:00
James Hogan
7ba3e5b975
Add a VR Options dialog
Add a VR Options dialog accessible from the View menu, allowing VR to be
enabled and disabled, and the current VR state to be seen.
2021-09-01 20:36:24 +01:00
wlbragg
65c8a95dd8 Remove wildfire code from fgdata and move to fgaddons 2021-08-31 20:06:14 +01:00
Julian Smith
68997879d3 Nasal/debug.nas: backtrace(): reinstate mechanism to truncate long filenames.
Also made it configurable.
2021-08-29 21:09:12 +01:00
Julian Smith
b6da3872f1 Nasal/globals.nas: setlistener(): call die() if callback is not a function.
This avoids getting confusing errors later on, e.g. see bug 2641.
2021-08-26 23:24:46 +01:00
Julian Smith
89da92dd05 Nasal/debug.nas:backtrace(): don't truncate filename.
Truncating filenames in debug output is unhelpful.
2021-08-26 23:24:46 +01:00
Michael Danilov
d394edb0a2 Local Weather: auto-enable 3D clouds and disable the checkbox. 2021-08-23 21:18:25 +02:00
Stuart Buchanan
1093a3fa97 FG1000: TextElement setColor 2021-08-19 12:28:52 +01:00
Michael Danilov
0c82a1f59a Replay: fix rewind for nonzero start-time. 2021-08-19 00:55:51 +02:00
Richard Harrison
2b11545fdf Added tests for Nasal frame utils 2021-06-05 16:18:04 +02:00
Julian Smith
768e11d0a6 Nasal/view.nas: Allow view to be changed by setting /sim/current-view/view-number-raw.
This avoids problems when/if new default views numbers (between 0 and 99) are
added.
2021-06-02 17:07:06 +01:00
Julian Smith
4b4410becf Allow control of whether 'b' key also cancels parking brake.
Uses new property /sim/controls/brake-cancels-parking-brake.

Default is true; it is expected that some aircraft (e.g. p51d) will set this to
false so they can implement their own brake/parking-brake interaction.

Should address bug 2589.
2021-05-26 22:37:38 +01:00
James Turner
dd9507a6ef Error reporting UI tweaks 2021-04-30 13:44:08 +01:00
James Turner
6a9fddb999 Add Error notification popup 2021-04-27 16:09:27 +01:00
James Turner
02c70ee05f Canvas SVG: fix parsing of elliptical arcs in paths
See discussion in https://sourceforge.net/p/flightgear/codetickets/2569/ 

Colin Geniet found and fixed this, and has audited existing FGaddon
aircraft against this (also the FG1000).
2021-04-01 12:17:41 +01:00
Fernando García Liñán
69387f09f4 Reduce shader complexity and implement graphics presets
- All non-ALS Effects have been removed (except generic ones from model-default and terrain-default).
- The rendering dialog has been reworked to accomodate the changes.
- All necessary properties have been added to graphics-properties.xml
- Five graphics presets have been added: Minimal, Low, Medium, High and Ultra.
- Some unused properties have been removed from defaults.xml
2021-03-31 04:05:34 +02:00
Henning Stahlke
b791ead702 Fix SVG parser crash on unsupported <defs> element. 2021-02-14 13:01:18 +01:00
James Turner
cdb151eb88 Reduce log noise for non-developers 2021-02-05 10:34:59 +00:00
Julian Smith
4db50617ca Added 'Still View', a new core view, number 8.
This view is like Helicopter View except that it does not change the view
heading to match the aircraft, which makes it work much better for vertical
flight, e.g. with the shuttle.

The new view is disabled by default.

Nasal/view.nas
    contains the new view config.
defaults.xml:
    Added view 8 to list of views for which we default to Helicopter view's
    target offsets (so that they look at the centre of the aircraft).
2021-01-29 16:56:29 +00:00
Stuart Buchanan
b3abc93e96 Set /sim/rendering/shaders/skydome on quality 2021-01-25 12:01:21 +00:00
Michael Danilov
51972c51ee Add option to move chat to the left and align left. 2021-01-13 22:43:12 +01:00
Michael Danilov
a2c3c4c3d8 Add option to move chat to the left and align left. 2021-01-12 21:17:56 +01:00
James Turner
c6b8869fed Tooltips: set a flag when registering the commands
This allows the C++ side to avoid invoking the commands prematurely.
2021-01-08 19:35:09 +00:00
Fernando García Liñán
5a841e2ebe Remove 'You are on runway' message when spawning with --parkpos
Fix by Michael Danilov
2021-01-05 09:59:20 +01:00
James Turner
292695a7b5 Mouse-mode feedback message adjusts based on trigger
When triggering mouse-mode switching with right-click instead of Tab,
adjust the visual feedback to reflect this. Suggested by Huntley
Palmer.

Ticket-Id: https://sourceforge.net/p/flightgear/codetickets/2484/
2020-12-23 12:37:50 +00:00
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