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.
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.