When more than one message type being transmitted on the bridge only one of the types would be reliably received. Bug caused because the message index is per notification type (on MP bridge outgoing) but was being treated as per incoming bridge (rather than notification).
Implement the Nearest Airports PFD softkey, displaying a scrollable
list of the closest 25 airports within 200nm.
Also fix a couple of minor bugs and add self-checking to the
GroupElement
Previously the FG1000 and MFD assumed that all notifications received
via Emesary had a Device_Id field. This is true for
notifications.PFDEventNotification.DefaultType but not for other
messages - e.g. those generated by the AN SPN 46 system on the
carrier.
The effect of this was that when Nimitz was loaded, the FG1000 stopped
working with various errors.
This fix checks the notification type before the Device_Id.
The method horizon() returns the distance to the horizon, along earth
surface, starting from current location. The method
greatcircle_distance_to(A,B) returns the shortest distance to a great
circle passing by A and B, along earth surface and from current location.
In conjunction with some FlightGear changes, the delegate can now do
all sequencing decisions, i.e the GPS C++ code does not make any policy
decisions about sequencing.
Update the default Nasal delegate to mimic the old behaviour, and set
the config option, both to allow future developments and to demonstrate
the new API.
It looks like widgets don't inherit font or colour from parent widgets. Also,
setting font=nil gives sublety different results compared to leaving font
unspecified.
So we now set font and colour explicitly for every widget using new function
set_default().
Also set font and colour of 'Pilots:' widgets and heading widget to me.fg[1] to
match other text.
resetViewPos(): set /sim/current-view/?-offset-m to
/sim/view[]/config/?-offset-m, not zeros.
This requires corresponding change to flightgear to compensate for the extra
offset, and fixes things when aircraft implement custom views by writing to
/sim/current-view/?-offset-m.
It's always been at the top; and although it is clear that the intent of this change was to improve things it highlights the need to make more substantial improvements to the way on screen messages are handled.
What we probably should have is an area that has a transparent dark background, a fixed size, supports scrolling, can be left open (or re-opened) and moved persitently around the screen.
This reverts commit 82f3eb45b9.
Due to Nasal/view.nas making a sequential copy of views, inserting new view
number 8 for Tower View AGL broke custom views, e.g. for aircraft 777).
We no longer require Model View (it's identical to Helicopter view now), so
this way we can have Tower View AGL without altering sequential view numbers.
I think the previous alternating colours were confusing because of the use of
a third and fourth colour for when we have no model or are using a fallback
model.
I think this is more convenient than the normal model-view buttons / popup
list. [Though this is still there.]
Nasal/multiplayer.nas:
Added new column 'view' with checkbox. Also added 'view self' button to
titlebar to view the user's aircraft.
Fix some bad indentation.
Nasal/view.nas:
Changed /sim/current-view/model-view to contain just the callsign, not
'<callsign> <model>', so that Nasal/multiplayer.nas can get the callsign
reliably.
We remember the multiplayer aircraft so that when switching between views,
multiplayer views (currently Helicopter, Model, Tower and Tower AGL) show the
same aircraft.
Nasal/view.nas: use /orientation/true-heading-deg in Model view and Tower AGL
view. This avoids problem when looking at multiplayer aircraft because there is
no /ai/models/multiplayer[]/orientation/heading-deg
Nasal/view.nas: improved handling of sim/current-view/{x,y,z}-offset-m. Changed
resetViewPos() to set these all to zero, because view's offsets are now
kept separate. Also removed setting of /sim/current-view/z-offset-m to
chase-distance - this is the wrong place now that views define the offset
explicitly.
Also added Tower View AGL support.
- This will alert if any individual notifcation takes more than a certain amount of time to process.
Works well with the Emesary M_exec to identify where the slow parts of Nasal are.
Only the selected channel will now be used for PTT; however the bindings still selected the appropriate channel prior to setting PTT.
This provides a compatible solution that can also easily be bound to the (joystick) controls.
PTT now in
/controls/radios/comm-ptt as an int; non zero indicates which comm radio to use
/comm-radio-selected is the default comm channel to use. This should usually be the same as will be set by PTT into /controls/radios/comm-ptt
NOTE: that PTT will switch the FG comm inbound and outbound frequency to whichever radio was PTT'd.
+ After discussion with Henning:
- orig_setlistener() and orig_maketimer() were not intended to be
public -> prefix the function names with an underscore;
- clear the add-on's lists of tracked listeners and timers in
remove() (load() does that too, but it's a bit late).
+ Little rewording in Docs/README.add-ons.
Without this it will cause a nil dereference resulting in
Nasal runtime error: non-objects have no members
at D:/Program Files/FlightGear 2018.2.2/data/Nasal/canvas/map/WPT.lcontroller, line 57
called from: D:/Program Files/FlightGear 2018.2.2/data/Nasal/canvas/map/WPT.lcontroller, line 79
called from: D:/Program Files/FlightGear 2018.2.2/data/Nasal/canvas/MapStructure.nas, line 1088
called from: D:/Program Files/FlightGear 2018.2.2/data/Nasal/geo.nas, line 384
called from: D:/Program Files/FlightGear 2018.2.2/data/Nasal/canvas/MapStructure.nas, line 1051
called from: D:/Program Files/FlightGear 2018.2.2/data/Nasal/canvas/MapStructure.nas, line 1059
called from: D:/Program Files/FlightGear 2018.2.2/data/Nasal/canvas/map/WPT.lcontroller, line 26
called from: D:/Program Files/FlightGear 2018.2.2/data/Nasal/globals.nas, line 119
Trigger sets /controls/armament/trigger - typically for a gun, but can be used (model side) to launch anything
Pick sets /controls/armament/pickle - typically to release something (e.g. missiles), but could be bound model side to act as a trigger.
Definitely problems in aar.nas, seaport.nas; as these were hanging off a fdm-initialized.
The others have timers that are started from a listener and as such are more suited to use maketimer rather than settimer
The modules that use the loopid technique are probably fine, but these are also more suited (and easier to understand) using a maketimer
- modify to work with JSBSim aircraft when reloading the fuel based on the payload (e.g. external tanks selected)
- add property sim/gui/dialogs/payload-reload that when set will cause the payload dialog to reload (to support a second dialog that modifies the payload)
- fix so that the window retains its position (close handler) and window Z order when reloading.
- added extra bindings
- reworked the view axis (usually bound to the hat); to move at a better rate.
- trim to elevator position. When selected this will remember the current position and when the joystick is centered it will apply this as the trim. Very useful for carrier approaches; and also it helps to do something that is much easier with loaded controls when you can feel the pressure being reduced by the operations of the trim switch