1
0
Fork 0
Commit graph

9689 commits

Author SHA1 Message Date
James Turner
68ef30d3af Linux / Qt 5.2 fixes 2017-04-10 14:39:27 +01:00
James Turner
d1e9d357b9 Trying to reduce int types warnings. 2017-04-10 14:38:57 +01:00
James Turner
427f662dca Settings searching support.
Also tightened up the layouts.
2017-04-10 14:38:57 +01:00
James Turner
3732930269 QML-driven settings UI. 2017-04-10 14:38:57 +01:00
James Turner
5c713a6b55 Split the launcher main window into its own file.
Reduces QtLauncher.cxx down to the public API and the static helper
methods; the main window lives in its own file.
2017-04-10 14:38:57 +01:00
James Turner
4234876789 Move some Launcher helpers into their own files.
Suggested be Sebastian, and it’s a good idea indeed, the main
launcher file has grown slightly.
2017-04-10 14:38:57 +01:00
James Turner
bf1ffb8875 Proof-of-concept for new settings UI. 2017-04-10 14:38:57 +01:00
Florent Rougon
cf318f1cc5 Better setting of the process exit status for fgfs and fgviewer
Some pieces of code such as fgMainInit() and, by cascading effect,
fgInitHome(), were careful to return a meaningful value indicating
success or error, however the main() function in src/Main/bootstrap.cxx
ignored it royally so far.

main() now returns:
  - EXIT_FAILURE if fgMainInit() or fgviewerMain() throws an exception;
  - whatever said function returns otherwise.
2017-04-10 02:29:48 +02:00
Florent Rougon
4b494a69bd Rename fatalMessageBox() to fatalMessageBoxWithoutExit(), add exiting variant
- Rename fatalMessageBox() to fatalMessageBoxWithoutExit(). This should
  prevent the kind of bug that prompted this set of changes: someone
  calling fatalMessageBox(), assuming the program would stop at that
  point, whereas in reality it did not.

- Add new function fatalMessageBoxThenExit(). This is not vital of
  course, but allows one to spare one line here and there and to apply
  the DRY principle for such fatal exits.

- Replace every existing call to fatalMessageBox() with one or the other
  of the two new functions. Improve formatting along the way. This
  fixes a few bugs of the kind explained above.
2017-04-10 02:29:48 +02:00
Florent Rougon
680f940378 Revert commit "Make fatalMessageBox() end with std::abort() [...]"
This reverts commit 9e6a3ebc6b ("Make
fatalMessageBox() end with std::abort() and declare it [[noreturn]]").

After reflexion, it seems better to let fatalMessageBox() return,
because there is existing code that appears to be relying on this aspect
to do some work after having called fatalMessageBox() (cf. main() in
bootstrap.cxx). Also, the way of exiting from fatalMessageBox() after
commit 9e6a3ebc6b (std::abort()) was probably too brutal for a
controlled exit---as opposed to a terminate handler.
2017-04-10 02:29:48 +02:00
James Turner
09dd24c139 Fix build with Qt 5.2 2017-04-09 23:55:47 +01:00
Florent Rougon
9e6a3ebc6b Make fatalMessageBox() end with std::abort() and declare it [[noreturn]]
Many places calling fatalMessageBox() assume it doesn't return, so make
it behave this way. See discussion around:

  https://sourceforge.net/p/flightgear/mailman/message/35766691/

for some context.
2017-04-08 14:34:26 +02:00
Florent Rougon
5040e6c7f0 Don't call fatalMessageBox() from fg_terminate(), make it end with std::abort()
Basically, this is because fatalMessageBox() is only safe to call from
the GUI thread, however it seems fg_terminate() can be called from any
thread (according to C++11 semantics). Additionally, fatalMessageBox()
typically requires some work to happen in the GUI thread (event loop) in
order to display something, but we can't realistically expect this while
running a terminate handler just before the program dies.

See messages around
<https://sourceforge.net/p/flightgear/mailman/message/35775803/> for a
discussion of this subject.

+ Minor header cleanup (<locale.h> replaced with <clocale>, etc.)
2017-04-08 14:03:48 +02:00
Gary Preston
8958b4d130 Cleanup unused variable warning.
Remove, comment out or relocate variables as appropriate to silence
unused variable warning.
2017-04-06 18:26:18 +09:00
Gary Preston
d2ca422c8b Adjust if/else indentation to fix -Wmisleading-indentation 2017-04-06 18:26:01 +09:00
James Turner
dd0d03ea1d Fix build on Windows. 2017-04-05 21:34:48 +09:00
Richard Harrison
9ba1fbdb35 MP2017.2 V2 protocol enhancements
/sim/multiplay/protocol-version is either 1 or 2 and controls how packets are sent. V2 packets will only have the (motioninfo) basic properties visible to older clients.

New string encoding that is efficient.
Support short int encoding (pack a property and value into 4 bytes).
Allow properties to be transmitted using a different encoding to the property type in the tree.
Support scaled floats; most of the floats we transmit are small and thus can fit into a scaled short.
V2 protocol uses transmit so most properties are either scaled floats or short ints.

Allow the client to request a larger visibility range by setting /sim/multiplay/visibility-range-nm. This will transmit in the repurposed header field ReplyAddress - which has been renamed to RequestedRangeNm. This will require support from fgms to actually do anything.

Extra debugging options. The most useful (for aircraft developers) is the loopback bit, as this allows model multiplay testing without running two instances.
Update property /sim/multiplay/last-xmit-packet-len with the size of the packet transmitted

Debug level bits in property /sim/multiplay/debug-level
  bit 1 - loopback (show your own model as an MP model)
  bit 2 - dump outgoing packets
  bit 3 - dump incoming packets
  bit 4 - hexdump outgoing packets
2017-04-02 15:30:49 +02:00
Richard Harrison
fc78ef2e4e Fix null reference - happened to me once. 2017-04-02 13:54:40 +02:00
Richard Harrison
b020db5ce7 Multiplayer: ensure that avionics sounds are null for MP models. 2017-04-02 13:54:03 +02:00
Richard Harrison
5d2e596043 Multiplayer protocol enhancements (MP2017.2 V2)
/sim/multiplay/protocol-version is either 1 or 2 and controls how packets are sent. V2 packets will only have the (motioninfo) basic properties visible to older clients.

New string encoding that is efficient.
Support short int encoding (pack a property and value into 4 bytes).
Allow properties to be transmitted using a different encoding to the property type in the tree.
Support scaled floats; most of the floats we transmit are small and thus can fit into a scaled short.
V2 protocol uses transmit so most properties are either scaled floats or short ints.

Allow the client to request a larger visibility range by setting /sim/multiplay/visibility-range-nm. This will transmit in the repurposed header field ReplyAddress - which has been renamed to RequestedRangeNm. This will require support from fgms to actually do anything.

Extra debugging options. The most useful (for aircraft developers) is the loopback bit, as this allows model multiplay testing without running two instances.
Update property /sim/multiplay/last-xmit-packet-len with the size of the packet transmitted

Debug level bits in property /sim/multiplay/debug-level
  bit 1 - loopback (show your own model as an MP model)
  bit 2 - dump outgoing packets
  bit 3 - dump incoming packets
  bit 4 - hexdump outgoing packets
2017-04-02 13:52:43 +02:00
Richard Harrison
8494462a96 Fixed another crash in MP interpolation when data isn't available. 2017-04-02 02:22:52 +02:00
Richard Harrison
48b93ff982 Fix comments in message header to identify the reuse of an obsolete field 2017-04-02 02:22:51 +02:00
Richard Harrison
239334f4d1 The conditions were swapped for the total output and the hexdump 2017-04-02 02:22:50 +02:00
Richard Harrison
c5cc666288 Merge branch 'next-2' into multiplayer-dev 2017-04-02 02:22:48 +02:00
Richard Harrison
5d23fa71ff OSG 3.5.x compatibility fix
OSG 3.5 (and maybe before) declares that ThreadSafeRefenceCounting is no longer required and it has been removed.
2017-04-02 02:09:38 +02:00
James Turner
f6f2c3b89a Merge /u/jsb1685/flightgear/ branch yasim into next
https://sourceforge.net/p/flightgear/flightgear/merge-requests/84/
2017-03-29 15:49:16 +00:00
James Turner
6cd39818c6 Whoops, missed a file. 2017-03-27 16:05:45 +01:00
James Turner
58a7f2c5c2 Unit-test for initPosition.
Only basic, but can be expanded incrementally now
2017-03-27 15:38:05 +01:00
Stuart Buchanan
feb5d599d0 Replace "tile-manager" with "scenery" 2017-03-26 21:49:26 +01:00
James Turner
31e933d836 Kill the Aircraft/foo path warning.
We probably need a warning for cross-aircraft paths, but leaving that
for a separate change since I’m worried it will warn on MP aircraft.

Maybe better checked in the Python scripts than in the app?
2017-03-25 15:40:11 +00:00
James Turner
9e122eaf81 Partial testing framework.
Compile a useful subset of FG as a shared library, and add two basic
uses of this to exercise some Flightplan / RoutePath / navaid
functions.

The test framework can/will be expanded incrementally from here, this
is just a starting point.
2017-03-25 15:35:26 +00:00
James Turner
7adb2fa851 RoutePath fixes.
Should fix:

https://sourceforge.net/p/flightgear/codetickets/1703/
https://sourceforge.net/p/flightgear/codetickets/1939/

Although both of these I had trouble reproducing directly.
2017-03-25 15:34:10 +00:00
James Turner
c2da881010 Fix a crash in NavList
(Tests are good)
2017-03-25 15:34:10 +00:00
James Turner
4f020602e6 Missing config.h includes
This is about to become much more important.
2017-03-25 15:34:10 +00:00
Stuart Buchanan
43a2b6fdac Rotate through tips based on execution count. 2017-03-23 21:11:46 +00:00
James Turner
74e2849293 Move some commands to a separate file.
This simplifies building a subset of the code for testing.
2017-03-22 21:13:40 +01:00
Henning Stahlke
50110b0cd6 YASIM: minor change to allow RigidBody addMass and setMass to trigger aggregation correctly. (not a problem up to now, just to be safe in future) 2017-03-21 22:47:07 +01:00
Henning Stahlke
f7359d9699 YASim: add bug warning messages. 2017-03-21 22:46:33 +01:00
Henning Stahlke
53103ac15e YASim: update CLI usage message. 2017-03-21 22:43:01 +01:00
Stuart Buchanan
3135d87218 Stop TTS from playing over itself.
Simple blocking of the SGSubsystem until the current
TTS sample has finished playing, allowing a 0.5s
gap between transmissions.  Good radio comms!
2017-03-20 22:27:10 +00:00
James Turner
63d8c2fd83 Enable —-metar runway selection.
Thanks to Florent for the catch.
2017-03-19 22:41:07 +00:00
James Turner
b1fa31fa09 Restore METAR-based runway selection.
As part of this, add the ability to distinguish default vs explicit
airport selection via a new /sim/presets/airport-requested flag. This
enables us to more cleanly handle different combinations of startup,
especially the case where the user requests an airport but no runway
(wants auto selection), ensuring we don’t look for the default airport’s
runway (from location-presets.xml) in that case.
2017-03-19 11:55:10 +00:00
James Turner
962ede1c43 Fix how launcher resets heading-deg.
This ensures finalisePosition logic runs as expected, ensuring
real-world METAR usage kicks in.
2017-03-19 11:55:10 +00:00
Erik Hofman
2393fd647d Merge /u/jsb1685/flightgear/ branch yasim into next
https://sourceforge.net/p/flightgear/flightgear/merge-requests/78/
2017-03-19 07:49:26 +00:00
Henning Stahlke
dc63307965 YASim: fix segmentation fault in yasim CLI tool 2017-03-18 23:17:19 +01:00
Henning Stahlke
0f472efe9b YASim parser: add support for metric and imperial attibutes, e.g. mass-lbs, mass-kg 2017-03-18 21:28:26 +01:00
Henning Stahlke
cecdfd0832 YASim FGFDM.hpp correction of pointer declarations. 2017-03-18 21:19:24 +01:00
James Turner
6880761f7b Launcher diagram: faster boundary computation.
No need to completely rebuild in these cases.
2017-03-16 22:42:58 +00:00
James Turner
a1bc99ec84 Fix slow launcher diagram with bad airport data. 2017-03-16 22:41:59 +00:00
James Turner
b13dd05aca Fix bug on Windows, time() is UTC there also.
This renders sgGMTime obsolete, it will go away shortly. Thanks to 
Ron H for help tracking this down and Richard Harrison for his
knowledge of Windows APIs in confirming the issue.
2017-03-16 21:26:43 +00:00