mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-04 00:16:51 +08:00
@@ -7,6 +7,8 @@
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
//! \cond PRIVATE
|
||||
|
||||
#include "audiodevicevatlib.h"
|
||||
#include "blackmisc/logmessage.h"
|
||||
|
||||
@@ -16,11 +18,13 @@ using namespace BlackMisc::Aviation;
|
||||
|
||||
namespace BlackCore
|
||||
{
|
||||
//! Cast void* to a pointer of CAudioInputDeviceVatlib
|
||||
CAudioInputDeviceVatlib *cbvar_cast_inputDevice(void *cbvar)
|
||||
{
|
||||
return static_cast<CAudioInputDeviceVatlib *>(cbvar);
|
||||
}
|
||||
|
||||
//! Cast void* to a pointer of CAudioOutputDeviceVatlib
|
||||
CAudioOutputDeviceVatlib *cbvar_cast_outputDevice(void *cbvar)
|
||||
{
|
||||
return static_cast<CAudioOutputDeviceVatlib *>(cbvar);
|
||||
@@ -129,3 +133,5 @@ namespace BlackCore
|
||||
cbvar_cast_outputDevice(cbVar)->m_devices.push_back(outputDevice);
|
||||
}
|
||||
}
|
||||
|
||||
//! \endcond
|
||||
|
||||
@@ -3,6 +3,11 @@
|
||||
|
||||
//! \file
|
||||
|
||||
/*!
|
||||
* \defgroup blackcore BlackCore Library
|
||||
* Backend services of the swift project, like dealing with the network or the simulators.
|
||||
*/
|
||||
|
||||
/*!
|
||||
* \namespace BlackCore
|
||||
* Backend services of the swift project, like dealing with the network or the simulators.
|
||||
@@ -23,8 +28,9 @@
|
||||
* Network settings traits.
|
||||
*/
|
||||
|
||||
/**
|
||||
/*!
|
||||
* \defgroup dbus DBus related functions, classes, or definitions.
|
||||
* \ingroup blackcore
|
||||
*/
|
||||
|
||||
#endif // guard
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
//! \cond PRIVATE
|
||||
|
||||
#include "networkvatlib.h"
|
||||
#include "blackmisc/project.h"
|
||||
#include "blackmisc/logmessage.h"
|
||||
@@ -154,6 +156,7 @@ namespace BlackCore
|
||||
}
|
||||
}
|
||||
|
||||
//! Convert vatlib status code to INetwork::ConnectionStatus
|
||||
INetwork::ConnectionStatus convertConnectionStatus(VatConnectionStatus status)
|
||||
{
|
||||
switch (status)
|
||||
@@ -640,6 +643,7 @@ namespace BlackCore
|
||||
/********************************** shimlib callbacks ************************************/
|
||||
/********************************** * * * * * * * * * * * * * * * * * * * ************************************/
|
||||
|
||||
//! Cast void* to a pointer of CNetworkVatlib
|
||||
CNetworkVatlib *cbvar_cast(void *cbvar)
|
||||
{
|
||||
return static_cast<CNetworkVatlib *>(cbvar);
|
||||
@@ -1018,3 +1022,5 @@ namespace BlackCore
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
//! \endcond
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
//! \cond PRIVATE
|
||||
|
||||
#include "voicechannelvatlib.h"
|
||||
#include "blackmisc/logmessage.h"
|
||||
|
||||
@@ -177,6 +179,7 @@ namespace BlackCore
|
||||
emit connectionStatusChanged(oldStatus, m_roomStatus);
|
||||
}
|
||||
|
||||
//! Cast void* to a pointer of CVoiceChannelVatlib
|
||||
CVoiceChannelVatlib *cbvar_cast_voiceChannel(void *cbvar)
|
||||
{
|
||||
return static_cast<CVoiceChannelVatlib *>(cbvar);
|
||||
@@ -206,3 +209,5 @@ namespace BlackCore
|
||||
obj->updateRoomStatus(channel, oldStatus, newStatus);
|
||||
}
|
||||
} // ns
|
||||
|
||||
//! \endcond
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
//! \cond PRIVATE
|
||||
|
||||
#include "webreaderflags.h"
|
||||
|
||||
using namespace BlackMisc::Network;
|
||||
@@ -47,7 +49,7 @@ namespace BlackCore
|
||||
return f;
|
||||
}
|
||||
|
||||
bool CWebReaderFlags::isFromSwiftDb(CEntityFlags::Entity entity)
|
||||
bool CWebReaderFlags::isFromSwiftDb(BlackMisc::Network::CEntityFlags::Entity entity)
|
||||
{
|
||||
return isFromSwiftDb(entityToReader(entity));
|
||||
}
|
||||
@@ -58,3 +60,5 @@ namespace BlackCore
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
//! \endcond
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
//! \cond PRIVATE
|
||||
|
||||
#include "datacache.h"
|
||||
#include "blackmisc/logmessage.h"
|
||||
#include "blackmisc/identifier.h"
|
||||
@@ -16,6 +18,7 @@
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
|
||||
class CDataCacheRevision::LockGuard
|
||||
{
|
||||
public:
|
||||
@@ -445,3 +448,5 @@ namespace BlackMisc
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
//! \endcond
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
//! \cond PRIVATE
|
||||
|
||||
#include "icons.h"
|
||||
#include "blackmisc/project.h"
|
||||
#include "blackmisc/fileutils.h"
|
||||
@@ -1173,3 +1175,5 @@ namespace BlackMisc
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
//! \endcond
|
||||
|
||||
@@ -36,8 +36,10 @@ namespace BlackMisc
|
||||
|
||||
namespace Private
|
||||
{
|
||||
//! \cond PRIVATE
|
||||
//! \private
|
||||
BLACKMISC_EXPORT QMutex *atomicSharedPtrMutex();
|
||||
//! \endcond
|
||||
|
||||
//! \private
|
||||
template <typename T>
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
//! \cond PRIVATE
|
||||
|
||||
#include "loghandler.h"
|
||||
#include "algorithm.h"
|
||||
#include "worker.h"
|
||||
@@ -23,6 +25,7 @@ namespace BlackMisc
|
||||
return g_handler;
|
||||
}
|
||||
|
||||
//! Qt message handler
|
||||
void messageHandler(QtMsgType type, const QMessageLogContext &context, const QString &message)
|
||||
{
|
||||
CStatusMessage statusMessage(type, context, message);
|
||||
@@ -264,3 +267,5 @@ namespace BlackMisc
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//! \endcond
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
//! \cond PRIVATE
|
||||
|
||||
#include "logmessage.h"
|
||||
#include "blackmiscfreefunctions.h"
|
||||
#include "indexsequence.h"
|
||||
@@ -155,11 +157,13 @@ namespace BlackMisc
|
||||
}
|
||||
}
|
||||
|
||||
//! Does category contain flag?
|
||||
bool hasFlag(const QString &category, const QString &flag)
|
||||
{
|
||||
return category.section("/", 1, -1).split("/").contains(flag);
|
||||
}
|
||||
|
||||
//! Add flag to category
|
||||
QString addFlag(QString category, const QString &flag)
|
||||
{
|
||||
if (category.isEmpty() || hasFlag(category, flag)) return category;
|
||||
@@ -188,3 +192,5 @@ namespace BlackMisc
|
||||
}
|
||||
}
|
||||
} // ns
|
||||
|
||||
//! \endcond
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace BlackMisc
|
||||
}
|
||||
}
|
||||
|
||||
QString CEntityFlags::flagToString(Entity flag)
|
||||
QString CEntityFlags::flagToString(BlackMisc::Network::CEntityFlags::Entity flag)
|
||||
{
|
||||
QStringList list;
|
||||
if (flag.testFlag(NoEntity)) list << "no data";
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
//! \cond PRIVATE
|
||||
|
||||
#include "project.h"
|
||||
#include "blackmisc/fileutils.h"
|
||||
#include "blackmisc/stringutils.h"
|
||||
@@ -310,6 +312,7 @@ namespace BlackMisc
|
||||
return QProcessEnvironment::systemEnvironment().value(envVarPrivateSetupDir());
|
||||
}
|
||||
|
||||
//! Get application directory
|
||||
QString getApplicationDirImpl()
|
||||
{
|
||||
QFileInfo executable(QCoreApplication::applicationFilePath());
|
||||
@@ -323,6 +326,7 @@ namespace BlackMisc
|
||||
return s;
|
||||
}
|
||||
|
||||
//! Get swift resource directory
|
||||
QString getSwiftResourceDirImpl()
|
||||
{
|
||||
QDir dir(CProject::getApplicationDir());
|
||||
@@ -347,6 +351,7 @@ namespace BlackMisc
|
||||
return dir;
|
||||
}
|
||||
|
||||
//! Get static database directory
|
||||
QString getSwiftStaticDbFilesDirImpl()
|
||||
{
|
||||
QString d(CProject::getSwiftResourceDir());
|
||||
@@ -362,6 +367,7 @@ namespace BlackMisc
|
||||
return s;
|
||||
}
|
||||
|
||||
//! Get images directory
|
||||
QString getImagesDirImpl()
|
||||
{
|
||||
QString d(CProject::getSwiftResourceDir());
|
||||
@@ -452,3 +458,5 @@ namespace BlackMisc
|
||||
|
||||
#undef BLACK_VERSION_STR
|
||||
#undef BLACK_VERSION_STR_X
|
||||
|
||||
//! \endcond
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
//! \cond PRIVATE
|
||||
|
||||
#include "propertyindexvariantmap.h"
|
||||
#include "propertyindexlist.h"
|
||||
#include "dictionary.h"
|
||||
@@ -125,3 +127,5 @@ namespace BlackMisc
|
||||
return BlackMisc::calculateHash(h, "CPropertyIndexVariantMap");
|
||||
}
|
||||
} // namespace
|
||||
|
||||
//! \endcond
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
//! \cond PRIVATE
|
||||
|
||||
#include "blackmisc/valuecache.h"
|
||||
#include "blackmisc/identifier.h"
|
||||
#include "blackmisc/logmessage.h"
|
||||
@@ -21,7 +23,7 @@ namespace BlackMisc
|
||||
|
||||
using Private::CValuePage;
|
||||
|
||||
// Used in asserts to protect against signed integer overflow.
|
||||
//! Used in asserts to protect against signed integer overflow.
|
||||
template <typename T>
|
||||
bool isSafeToIncrement(const T &value) { return value < std::numeric_limits<T>::max(); }
|
||||
|
||||
@@ -557,3 +559,5 @@ namespace BlackMisc
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//! \endcond
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
//! \cond PRIVATE
|
||||
|
||||
#include "variant.h"
|
||||
#include "blackmiscfreefunctions.h"
|
||||
#include "icon.h"
|
||||
@@ -238,9 +240,14 @@ namespace BlackMisc
|
||||
}
|
||||
}
|
||||
|
||||
// 2 functions required for unmarshallFromDbus
|
||||
/*!
|
||||
* 2 functions required for unmarshallFromDbus
|
||||
* \internal
|
||||
*/
|
||||
//! @{
|
||||
QVariant fixQVariantFromDbusArgument(const QVariant &variant, int localUserType);
|
||||
QVariant complexQtTypeFromDbusArgument(const QDBusArgument &argument, int type);
|
||||
//! @}
|
||||
|
||||
void CVariant::unmarshallFromDbus(const QDBusArgument &arg)
|
||||
{
|
||||
@@ -416,3 +423,5 @@ namespace BlackMisc
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
//! \endcond
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
//! \cond PRIVATE
|
||||
|
||||
#include "metardecoder.h"
|
||||
#include "blackmiscfreefunctions.h"
|
||||
#include "blackmisc/logmessage.h"
|
||||
@@ -804,7 +806,6 @@ namespace BlackMisc
|
||||
virtual QString getDecoderType() const override { return "WindShear"; }
|
||||
};
|
||||
|
||||
|
||||
CMetarDecoder::CMetarDecoder()
|
||||
{
|
||||
allocateDecoders();
|
||||
@@ -854,3 +855,5 @@ namespace BlackMisc
|
||||
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
//! \endcond
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "blackmisc/logmessage.h"
|
||||
#include "blackmisc/simulation/fscommon/modelmappingsprovidervpilot.h"
|
||||
#include "blackmisc/blackmiscfreefunctions.h"
|
||||
#include "blackmisc/makeunique.h"
|
||||
|
||||
using namespace BlackMisc::PhysicalQuantities;
|
||||
using namespace BlackMisc::Simulation;
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
//! \cond PRIVATE
|
||||
|
||||
#include "menus.h"
|
||||
#include "blackmisc/blackmiscfreefunctions.h"
|
||||
#include "blackmisc/makeunique.h"
|
||||
@@ -16,14 +18,16 @@
|
||||
|
||||
namespace XBus
|
||||
{
|
||||
template <typename T> void *voidptr_cast(T i) // "safe" cast from integer to void*
|
||||
//! "safe" cast from integer to void*
|
||||
template <typename T> void *voidptr_cast(T i)
|
||||
{
|
||||
static_assert(std::is_integral<T>::value, "voidptr_cast expects an integer");
|
||||
typedef typename std::conditional<std::is_signed<T>::value, intptr_t, uintptr_t>::type intptr_type;
|
||||
return reinterpret_cast<void *>(static_cast<intptr_type>(i));
|
||||
}
|
||||
|
||||
template <typename T> T intptr_cast(void *p) // "safe" cast from void* to integer
|
||||
//! "safe" cast from void* to integer
|
||||
template <typename T> T intptr_cast(void *p)
|
||||
{
|
||||
static_assert(std::is_integral<T>::value, "voidptr_cast returns an integer");
|
||||
typedef typename std::conditional<std::is_signed<T>::value, intptr_t, uintptr_t>::type intptr_type;
|
||||
@@ -119,3 +123,5 @@ namespace XBus
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//! \endcond
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
//! \cond PRIVATE
|
||||
|
||||
#ifndef NOMINMAX
|
||||
#define NOMINMAX
|
||||
#endif
|
||||
@@ -17,6 +19,7 @@
|
||||
namespace XBus
|
||||
{
|
||||
|
||||
|
||||
const int c_screenWidth = 1024;
|
||||
const int c_screenHeight = 768;
|
||||
const int c_boxLeft = 128;
|
||||
@@ -141,3 +144,5 @@ namespace XBus
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//! \endcond
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
//! \cond PRIVATE
|
||||
|
||||
#ifndef NOMINMAX
|
||||
#define NOMINMAX
|
||||
#endif
|
||||
@@ -38,9 +40,11 @@ namespace XBus
|
||||
surfaces.lights.timeOffset = static_cast<quint16>(qrand() % 0xffff);
|
||||
}
|
||||
|
||||
|
||||
QString g_xplanePath;
|
||||
QString g_sep;
|
||||
|
||||
//! Init global xplane path
|
||||
void initXPlanePath()
|
||||
{
|
||||
char xplanePath[512];
|
||||
@@ -297,7 +301,7 @@ namespace XBus
|
||||
}
|
||||
}
|
||||
|
||||
// memcmp function which ignores the header ("size" member) and compares only the payload (the rest of the struct)
|
||||
//! memcmp function which ignores the header ("size" member) and compares only the payload (the rest of the struct)
|
||||
template <typename T>
|
||||
int memcmpPayload(T *dst, T *src)
|
||||
{
|
||||
@@ -306,7 +310,7 @@ namespace XBus
|
||||
sizeof(*dst) - sizeof(dst->size));
|
||||
}
|
||||
|
||||
// linearly interpolate angle in degrees
|
||||
//! linearly interpolate angle in degrees
|
||||
template <typename T>
|
||||
T lerpDegrees(T from, T to, double factor)
|
||||
{
|
||||
@@ -394,3 +398,5 @@ namespace XBus
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//! \endcond
|
||||
|
||||
@@ -7,12 +7,15 @@
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
//! \cond PRIVATE
|
||||
|
||||
#include "weather.h"
|
||||
#include <QDebug>
|
||||
|
||||
namespace XBus
|
||||
{
|
||||
|
||||
//! Set cloud layer
|
||||
template <class T>
|
||||
void setCloudLayerImpl(T &layer, int base, int tops, int type, int coverage)
|
||||
{
|
||||
@@ -33,6 +36,7 @@ namespace XBus
|
||||
}
|
||||
}
|
||||
|
||||
//! Set wind layer
|
||||
template <class T>
|
||||
void setWindLayerImpl(T &layer, int altitude, float direction, int speed, int shearDirection, int shearSpeed, int turbulence)
|
||||
{
|
||||
@@ -56,3 +60,5 @@ namespace XBus
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//! \endcond
|
||||
|
||||
Reference in New Issue
Block a user