Commit Graph

46 Commits

Author SHA1 Message Date
Roland Winklmeier
9bb75a6f2e Rotate camera in follow plane view only if space key is pressed
This commits merges the two orbit plane functions together in CTraffic.
The separation was necessary since XSwiftBus needed to be started manually
and until started, the pointer to CTraffic was invalid. Since XSwiftBus
is started automatically, it can be merged into one function again.
This commit also adds the feature to rotate the camera only if the space key
is pressed. This is equal to how FSX/P3D do it. Using the right mouse was
not possible, since X-Plane SDK does not offer that option.

ref T360
2018-11-04 17:42:42 +01:00
Roland Winklmeier
f3f3ebc306 Cleanup aircraft in X-Plane after DBusConnection drops
ref T392
2018-10-07 16:17:25 +02:00
Roland Winklmeier
ebe23a694b Fix GCC7 fallthrough warnings 2018-10-05 17:39:58 +02:00
Roland Winklmeier
616cc241f4 [XSwiftBus] Convert setPlanesTransponders to list setter
ref T374
2018-10-03 03:03:41 +02:00
Roland Winklmeier
65d00dca6e [XSwiftBus] Fix plural in CTraffic::setPlanesSurfaces 2018-10-03 03:03:41 +02:00
Roland Winklmeier
cfc9c3166e Decouple flightloop processing from DBus
There are needs to not only run DBus tasks, but also different generic
tasks during the processing loop.
2018-10-03 03:03:40 +02:00
Roland Winklmeier
f637b2996d Fix floating point comparison 2018-08-07 20:40:59 +02:00
Roland Winklmeier
05e0480bb4 Move XPlane gnd flag handling from parts to situation
ref T276
2018-08-07 20:40:57 +02:00
Roland Winklmeier
59da68da5e Delay setting the DBusConnection for a DBusObject
Previously, the DBusconnection had to be set at construction time and could
not be changed over the DBusObject life time. Now a new connection can be
set anytime and as often as required.
The shared ownership is now also properly implemented by shared pointers.

ref T291
2018-08-07 20:40:40 +02:00
Roland Winklmeier
ef8c7d7d1c Fix rare crash and swift not being notified about a failed plane adding
This fixes are rare case, that no XPMP plane could be created (no model
was found) and this was not signaled to swift.
2018-08-07 20:40:36 +02:00
Roland Winklmeier
dc9b2a42f7 Fix the correct naming of altitude and elevation 2018-08-07 20:40:34 +02:00
Klaus Basan
52513db63f Ref T290, XPlane refactoring
* typo getRemoteAircraftsData -> getRemoteAircraftData (no "s")
* typo getEelevationAtPosition (double "Ee")
* get functions "const"
* added unit for some variables such as latitudeDeg
2018-07-17 19:04:50 +02:00
Roland Winklmeier
128edcd118 Update libxplanemp 2018-06-18 03:04:27 +02:00
Roland Winklmeier
87ba7183cc Add new command to jump to previous plane in follow plane view
ref T269
2018-06-18 03:04:25 +02:00
Roland Winklmeier
e55103ccdf Rename all variables and functions to be similar to followPlaneView 2018-06-18 03:04:24 +02:00
Roland Winklmeier
10b8cf5fea Add new command to jump to next plane in follow plane view
ref T269
2018-06-18 03:04:22 +02:00
Roland Winklmeier
0b607f9e0b Add own aircraft to X-Plane plane view menu
ref T269
2018-06-13 13:59:17 +02:00
Roland Winklmeier
654cc1621e Align the position and surface variable names to plural 2018-06-13 13:59:16 +02:00
Roland Winklmeier
33963041cc Implement followAircraft for X-Plane
ref T266
2018-06-13 13:59:13 +02:00
Roland Winklmeier
dab41045d3 [xswiftbus] Check if plane exists already before adding a new one 2018-05-12 21:40:02 +02:00
Roland Winklmeier
2fd4d286d6 Refactor retrieving remote aircraft data
Instead of requesting it individually for each callsign and waiting for a
signal from xswiftbus, pass in a list of callsigns and use async callback
to read the data.
2018-05-08 16:06:57 +02:00
Roland Winklmeier
bf8ed5c006 Load X-Plane remote aircrafts one by one sequentially 2018-05-08 16:06:57 +02:00
Roland Winklmeier
7de5c06c7a [xswiftbus] Fix destroying of removed menu items 2018-05-08 16:06:57 +02:00
Roland Winklmeier
848da69fe1 Group sending of all plane positions and surfaces into a single DBus call 2018-05-08 16:06:56 +02:00
Klaus Basan
75c481228f Missing include, fixing missing M_PI
Using the little "PI = std::acos(-1);" trick to avoid include issues
2018-05-08 16:06:31 +02:00
Roland Winklmeier
37e592759c [xswiftbus] Plane View Menu
FSX/P3D have a nice feature to follow a remote aircraft with the camera.
X-Plane was missing this feature, since for X-Plane the remote aircrafts
are not known. However, from a plugin point of view, we know them and where
they are. So we can manually control the camera and provide a similar
feature.
This is still very simple. As soon as you move the mouse, the PoV angle will
change. In future updates, it should be change only while the right mouse
button is pressed.
2018-05-08 16:06:30 +02:00
Roland Winklmeier
6a8ae67e06 [xswiftbus] Make xswiftbus completely Qt free 2018-05-08 16:06:30 +02:00
Roland Winklmeier
b0a8fcaa45 [xswiftbus] Remove BlackMisc dependency
There were only very few classes used from Blackmisc after the interpolator
was moved to the driver. Therefore replace those few classes with
a simple alternative and remove BlackMisc from xswiftbus.
2018-05-08 16:06:30 +02:00
Roland Winklmeier
d77931e5ec [xswiftbus] Replace QtDBus with a libevent driven C++ wrapper on top of libdbus
QtDBus was the main component of xswiftbus' Qt dependency. This is the
first preparation step to get xswiftbus Qt free.
The new implementation is based on the low level libdbus library, which
was also in use by QtDBus itself. But instead of QtDBus, we use now a thin
C++ wrapper. To keep DBus handling async, libevent is used to monitor
timeouts and fds.
2018-05-08 16:06:29 +02:00
Roland Winklmeier
e1538573fe Remove old xswiftbus interpolator code
ref T259
2018-04-13 23:37:45 +02:00
Klaus Basan
9abc57bb3d Ref T259, Ref T243 remove aircraft parts and situations from interpolator
* no longer using the add parts/situations signals
* will use the remote aircraft provider parts directly

Result: all parts/situations are stored only once in memory and in one single place
2018-04-13 23:37:37 +02:00
Klaus Basan
0c06ac26f7 Ref T259, Ref T243 removed interpolation hints
* no longer needed with providers in that form
* pure refactoring commit, just guarantees compilation
* already minor adjustments to use providers
2018-04-13 23:37:18 +02:00
Klaus Basan
333a92ff63 Ref T259, Ref T243 renaming to CInterpolationAndRenderingSetupPerCallsign 2018-04-13 23:36:34 +02:00
Klaus Basan
6fab2fd60f Ref T259, further checks of Plane pointer 2018-04-05 02:53:19 +02:00
Klaus Basan
d4b7d7d181 Ref T259, check if plane object is in m_planesByCallsign 2018-04-05 02:52:56 +02:00
Klaus Basan
9517ce7d7c Ref T259, formatting 2018-04-05 02:52:50 +02:00
Roland Winklmeier
09de945242 Add experimental X-Plane CG offset fetching
ref T231
2018-04-05 02:52:28 +02:00
Roland Winklmeier
72497fdefc Regularly request remote aircraft data from X-Plane
This includes
* ground elevation
* model offset (to be implemented)

ref T259
2018-04-05 02:52:26 +02:00
Roland Winklmeier
2ab6a96d57 Adapt to libxplanemp improvements
* XPMPMultiplayerInit API change
* New CSL command 'VERT_OFFSET'
* OBJ8 objects can have multiple textures now. Therefore use the same model
name convention as with OBJ7.
2018-04-05 02:52:24 +02:00
Roland Winklmeier
4db0b83310 Move X-Plane interpolation into driver
ref T259
2018-04-05 02:52:20 +02:00
Klaus Basan
14fb35a975 Formatting 2018-02-05 03:45:36 +01:00
Klaus Basan
47d1915e17 Ref T231, using fudge factor in XP as CG (same as in FSX/P3D)
Ref T207
2018-01-30 20:31:03 +01:00
Klaus Basan
fae5e6ac0a Ref T229, FS9 and XPlane adjustments for changed CInterpolationStatus
Ref T207, maybe MS should review the XP part
2018-01-30 20:29:56 +01:00
Mathew Sutcliffe
a7124ec589 Removed unused code. 2017-11-12 13:48:09 +00:00
Mathew Sutcliffe
98e0f8c875 T37 T127 Send timestamps to XSwiftBus as separate timestamp and offset
as the offset is needed for reliable interpolation.
2017-09-24 19:52:46 +01:00
Mathew Sutcliffe
4a4dea8d4d Rename xbus to xswiftbus
Summary:
I wanted to rename xbus because its relation to //swift// is not immediately clear from the name.

xswiftbus seems reasonable.

Reviewers: #swift_pilot_client, kbasan

Reviewed By: kbasan

Subscribers: kbasan, jenkins

Tags: #swift_pilot_client

Differential Revision: https://dev.swift-project.org/D14
2017-05-05 23:07:11 +01:00