Commit Graph

3700 Commits

Author SHA1 Message Date
Roland Winklmeier
ffa0b503a8 Handle addresses larger than 2 GB for MinGW builds
Before this commit, the default memory limit was around 2 GB and
our MinGW built executables hit this limit. Swift and all 3rd party
libraries are 64 bit safe, so it is also safe to use the
large-address-aware linker flag. This allows memory allocation up
to 4 GB.

refs #788
2016-12-06 09:46:55 +01:00
Mathew Sutcliffe
c9ddb2ba39 Added missing methods in CSequence. 2016-12-06 09:46:53 +01:00
Mathew Sutcliffe
e25785d09b Fixed wrong CLogMessage constructor being used
nullptr was being implicitly converted to a null C-style string
via the initializer_list constructor of CLogCategoryList.

refs #790
2016-12-06 09:46:52 +01:00
Mathew Sutcliffe
b5dfd15d66 When dealing with pitch and bank as signed ints, it is desirable to
round down, rather than toward zero, to get a linear distribution.

refs #790
2016-12-06 09:46:51 +01:00
Mathew Sutcliffe
f4d7474941 [FS9] Removed needless constructors 2016-12-06 09:46:50 +01:00
Mathew Sutcliffe
c427052354 [FS9] Using auto to avoid mindless duplication 2016-12-06 09:46:49 +01:00
Roland Winklmeier
dd0d9f1133 Fix cmd line arguments to allow passing client id and key pair
Before this commit, a user was able to pass a FSD key only via command
line arguments. However, changing the key itself is not enough. The key
always needs to be set together with its corresponding id.

refs #795
2016-12-06 09:46:48 +01:00
Mathew Sutcliffe
969c077182 Fixed possible memory leak in BlackMisc::singleShot. 2016-12-06 09:46:47 +01:00
Roland Winklmeier
6f5193a74f [FS9] Read and update own aircraft model via FSUIPC
FS9 plugin did not detect own aircraft model under all circumstances.
FS9 does not initially send it when connecting - only
during initial selection and if it is changed later. In order
to get the initial model if swift is started while FS9 was already
running, read it regularly from FSUIPC.
2016-12-06 09:46:46 +01:00
Roland Winklmeier
55b19d2f74 [FS9] Move MPChangePlayerPlane sending into its own member function 2016-12-06 09:46:45 +01:00
Roland Winklmeier
a13f7eb1d4 [FS9] Add missing null termination when serializing QStrings
The produced QByteArray was missing the null terminating character,
since QByteArray::append() only added up to and not including '\0'.
This was also the reason why sometimes planes did not change their
aircraft models properly.
2016-12-06 09:46:44 +01:00
Roland Winklmeier
ea561cf723 Warn in case pitch value from simulator is out of limits
refs #790
2016-12-06 09:46:43 +01:00
Roland Winklmeier
eb58450e8c Remove unnecessary limit checking
A signed 10 bit integer has a range of [-512, +511]. After applying
the multiplicator, neither pitch nor bank will every be outside of
those ranges.

refs #790
2016-12-06 09:46:42 +01:00
Roland Winklmeier
7f90652b2f Use bitwise negation operator to invert integer pitch and bank angles
refs #790
2016-12-06 09:46:41 +01:00
Roland Winklmeier
5d7eff0797 Fix incorrect integer signedness in FS9 SDK
refs #790
2016-12-06 09:46:40 +01:00
Mathew Sutcliffe
5035e7b5fb refs #782 CAtomicFile on Windows: flush buffer before attempting to rename,
and use ReplaceFile to rename if target already exists.
2016-12-06 09:46:39 +01:00
Klaus Basan
52cd84dd99 refs #787, display shared files timestamp in UI 2016-12-06 09:46:19 +01:00
Klaus Basan
ff394f4785 refs #787, support for Header / shared files in database reader / web services
* split JsonDatastoreResponse in subclass HeaderResponse
* support for request newtwork request duration ("started") in application
* removed ps_setupChanged because it was unused
2016-12-06 09:35:02 +01:00
Klaus Basan
5379215dd5 Unrelated typo/formatting fixes 2016-12-06 09:35:01 +01:00
Klaus Basan
dcaa745e7b refs #787, utility functions for shared files
* entity to shared file, shared file for DB Info
* CUrl path function
* removed redundant code in CDbInfo::getEntity() and fixed CEntityFlags::singleEntityByName
2016-12-06 09:35:00 +01:00
Klaus Basan
cbcb307748 Clang warning reported by MS (slack) 2016-12-06 09:34:59 +01:00
Klaus Basan
4c1890dbd2 refs #793, renamed function in simulator common 2016-12-06 09:34:57 +01:00
Klaus Basan
72fdf7c5bc refs #793, added function to reset model (after it was manually changed)
* located in context since context owns matcher object
* call from GUI
* some code formatting to indicate the cross simulator slots connected in runtime

refs #780
2016-12-06 09:34:56 +01:00
Klaus Basan
55020277b5 refs #793, adjusted model to use network model, also renamed mode to better relect meaning 2016-12-06 09:34:55 +01:00
Klaus Basan
ca6f3b15b7 refs #793, added updateAircraftNetworkModel in provider
* adjusted network context (implementing provider interface)
* and airspace monitor (also implementing provider interface)
* also formatted provider / context to new style (less copydoc)
2016-12-06 09:34:54 +01:00
Klaus Basan
0dd9bce697 refs #793, keep network model (as reverse looked up) 2016-12-06 09:34:53 +01:00
Klaus Basan
7231ec06f3 refs #792, do not reverse lookup a model if it is not 100% identifiable
Instead only use livery, airline, aircraft ICAO
2016-12-06 09:34:52 +01:00
Klaus Basan
ca6d9ce7b2 refs #792, formatting 2016-12-06 09:34:48 +01:00
Mathew Sutcliffe
4ed72706fc refs #794 Utility function to establish a signal/slot connection that auto-disconnects upon the first delivery. 2016-12-06 09:34:47 +01:00
Mathew Sutcliffe
ab8dcbad97 refs #794 Private::invokeSlot needs to ignore arguments of type QPrivateSignal. 2016-12-06 09:34:46 +01:00
Mathew Sutcliffe
f709d959d0 Minor adjustment in CAtomicFile. 2016-12-06 09:34:45 +01:00
Klaus Basan
a1bea9703d refs #777, using feature in launcher
plus bug fix in application
2016-12-06 09:34:44 +01:00
Klaus Basan
4f447cd408 refs #791, further improve reverse lookup
* utility function if web data are already available
* moved setOwnAircraftModel as reverseLookupAndUpdateOwnAircraftModel to CSimulatorCommon
* reverseLookupAndUpdateOwnAircraftModel also handles async lookup when data are not yet available
* removed context ps_allSwiftWebDataRead reverse lookup, done in CSimulatorCommon now
2016-12-06 09:34:43 +01:00
Klaus Basan
4478af119d refs #791, also perform lookup in simulator plugin`s CSimulatorFsCommon::setOwnAircraftModel 2016-12-06 09:34:41 +01:00
Klaus Basan
4e2a01c1e4 refs #791, adjusted own aircraft context
* function for default model and situation in context (so they can be reused as in login component)
* use CDatabaseUtils::consolidateOwnAircraftModelWithDbData for lookup
2016-12-06 09:34:40 +01:00
Klaus Basan
a92b67db6b refs #791, reverse lookup for own model in the utils class 2016-12-06 09:34:39 +01:00
Klaus Basan
0811536e57 refs #791, new ctor by ICAO/livery 2016-12-06 09:34:38 +01:00
Klaus Basan
c02cbcb952 Updated some documentation based on a brief slack discussion with MG 2016-12-06 09:34:37 +01:00
Mathew Sutcliffe
0fd0ce05f0 refs #776 Use pointers instead of references for members of CCached,
to avoid subtle undefined behaviour with the placement-new trick (§3.8¶8.3).
2016-12-06 09:34:36 +01:00
Klaus Basan
de7821ff86 refs #781, use admit in database reader
* added amit functions in readers
* cacheHasChanged functions (needed because data of caches are loaded in background)
* pinned small caches
* CDatabaseReader::readInBackgroundThread uses admitCaches now
2016-12-06 09:34:35 +01:00
Klaus Basan
f385e46d67 refs #781, added admit functions for model caches
* interface constructor protected
* flag for synchronize in ctor
2016-12-06 09:34:33 +01:00
Klaus Basan
c57a9e2e5b Fixed reload all DB data issue reported by MS on slack
* use triggerReloadFromDb
* improved documentation

MS report:
`AllDbEntities` should be `AllDbEntitiesNoInfoObjects` in `CDataInfoAreaComponent::requestUpdateOfAllDbData`?
Otherwise it triggers assert `!whatToRead.testFlag(CEntityFlags::InfoObjectEntity)` in `CWebDataServices::triggerRead`.
2016-12-06 09:34:32 +01:00
Klaus Basan
1678ca8919 refs #780, improved model string completion
* added signatures for completer string (when send via context size matters)
* support of all instaled models in completer
* added BLACKMISC_EXPORT in model cache classes
2016-12-06 09:34:31 +01:00
Klaus Basan
14f3eadc08 refs #766, refs #776 using object name as setting name %OwnerName%
* removed CDockWidgetsSettings (note Widgets, not Widget)
* goal: Use CDockWidgetSettings for all dock widgets

refs #684
2016-12-06 09:34:30 +01:00
Mathew Sutcliffe
1d22bd9acf refs #782 Changes to CAtomicFile::replaceOriginal on Windows:
* Remember to supply canonical paths with native path separators to Win32 API calls.
* Supply the flag to MoveFileEx to wait for the move to really happen.
* Support long paths (more than 260 characters).
2016-12-06 09:34:29 +01:00
Mathew Sutcliffe
d9d16dc8e0 refs #782 Check permissions in CAtomicFile::open to get earlier indication of any problems. 2016-12-06 09:34:28 +01:00
Klaus Basan
49f2d5566c refs #786, improved matching messages 2016-12-06 09:34:27 +01:00
Klaus Basan
c938e2b961 refs #780, allow to reset changed rendered aircraft 2016-12-06 09:34:26 +01:00
Klaus Basan
df60474510 refs #789, added signal when adding models fails
Signatures in context and simulator
2016-12-06 09:34:25 +01:00
Roland Winklmeier
42737faf2c Fix wrong pitch and bank value interpolation
Pitch and bank angle in CAircraftSituation are according to the
common aeronautical convention:
* Bank in degrees, positive = roll right
* Pitch in degrees, positive = pitch up

Microsoft Flight Simulator is using inverted angles, which was incorrectly
adjusted in the interpolator. This caused wrong values for X-Plane.
This angle correction is now moved into the MSFS specific plugins.
Additionally, so far the pitch and bank angles from own aircraft were
not yet corrected for MSFS. So we did send wrong values to the network.

refs #790
2016-12-06 09:34:24 +01:00