From 7b646610c50d973f79accc0d63521e6ce4dde74f Mon Sep 17 00:00:00 2001 From: Roland Winklmeier Date: Fri, 7 Feb 2014 22:31:32 +0100 Subject: [PATCH 1/4] fixes #130 missing const declarator in IContext::hasObject --- src/blackmisc/context.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/blackmisc/context.h b/src/blackmisc/context.h index 9134a1eda..55c833b69 100644 --- a/src/blackmisc/context.h +++ b/src/blackmisc/context.h @@ -93,8 +93,8 @@ namespace BlackMisc */ template bool hasObject(const QString &name = T::staticMetaObject.className()) const { - QObject *qobj = getQObjectNothrow(name); - return qobj && qobject_cast(qobj); + const QObject *qobj = getQObjectNothrow(name); + return qobj && qobject_cast(qobj); } /*! From 07879cf5a7e9fa4339292637a28a4fd3d76324db Mon Sep 17 00:00:00 2001 From: Roland Winklmeier Date: Fri, 7 Feb 2014 22:39:40 +0100 Subject: [PATCH 2/4] Remove dummy simulator driver projects refs #90 --- client.pro | 3 -- src/driver/CMakeLists.txt | 3 -- src/driver/fs9/driver_fs9.cpp | 33 ------------------- src/driver/fs9/driver_fs9.h | 17 ---------- src/driver/fs9/driver_fs9.pro | 17 ---------- src/driver/fsx/CMakeLists.txt | 20 ------------ src/driver/fsx/driver_fsx.cpp | 49 ----------------------------- src/driver/fsx/driver_fsx.h | 35 --------------------- src/driver/fsx/driver_fsx.pro | 17 ---------- src/driver/xplane/driver_xplane.cpp | 31 ------------------ src/driver/xplane/driver_xplane.h | 15 --------- src/driver/xplane/driver_xplane.pro | 17 ---------- 12 files changed, 257 deletions(-) delete mode 100644 src/driver/CMakeLists.txt delete mode 100644 src/driver/fs9/driver_fs9.cpp delete mode 100644 src/driver/fs9/driver_fs9.h delete mode 100644 src/driver/fs9/driver_fs9.pro delete mode 100644 src/driver/fsx/CMakeLists.txt delete mode 100644 src/driver/fsx/driver_fsx.cpp delete mode 100644 src/driver/fsx/driver_fsx.h delete mode 100644 src/driver/fsx/driver_fsx.pro delete mode 100644 src/driver/xplane/driver_xplane.cpp delete mode 100644 src/driver/xplane/driver_xplane.h delete mode 100644 src/driver/xplane/driver_xplane.pro diff --git a/client.pro b/client.pro index 9a18458c7..962a93d8d 100644 --- a/client.pro +++ b/client.pro @@ -11,9 +11,6 @@ WITH_BLACKSOUND = ON WITH_SAMPLES = ON WITH_UNITTESTS = ON -#WITH_DRIVER_FSX = ON -#WITH_DRIVER_FS9 = ON -#WITH_DRIVER_XPLANE = ON #WITH_DOXYGEN = ON equals(WITH_BLACKMISC, ON) { diff --git a/src/driver/CMakeLists.txt b/src/driver/CMakeLists.txt deleted file mode 100644 index 397430dc9..000000000 --- a/src/driver/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -IF(WITH_DRIVER_FSX) - ADD_SUBDIRECTORY(fsx) -ENDIF(WITH_DRIVER_FSX) diff --git a/src/driver/fs9/driver_fs9.cpp b/src/driver/fs9/driver_fs9.cpp deleted file mode 100644 index 3e6096209..000000000 --- a/src/driver/fs9/driver_fs9.cpp +++ /dev/null @@ -1,33 +0,0 @@ -#include "driver_fs9.h" - -extern "C" -{ - Q_DECL_EXPORT ISimulator* BB_createISimulatorInstance () - { - return new CDriverFSX; - } - - Q_DECL_EXPORT quint32 BB_InterfaceVersionMajor () - { - return ISimulator::InterfaceVersionMajor; - } - - Q_DECL_EXPORT quint32 BB_InterfaceVersionMinor () - { - return ISimulator::InterfaceVersionMinor; - } -} - - -CDriverFS9::CDriverFS9() -{ -} - -void CDriverFS9::setLibraryContext(BlackMisc::IContext *context) -{ -#ifdef Q_OS_WIN - bAssert(!BlackMisc::IContext::isContextInitialised()); -#endif - - m_libraryContext = new BlackMisc::CLibraryContext(*context); -} diff --git a/src/driver/fs9/driver_fs9.h b/src/driver/fs9/driver_fs9.h deleted file mode 100644 index a77a39c5e..000000000 --- a/src/driver/fs9/driver_fs9.h +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef DRIVER_FS9_H -#define DRIVER_FS9_H - -#include - -class CDriverFS9 : public ISimulator -{ -public: - CDriverFS9(); - virtual int init() { return 1;} - -protected: - - BlackMisc::CLibraryContext *m_libraryContext; -}; - -#endif // DRIVER_FS9_H diff --git a/src/driver/fs9/driver_fs9.pro b/src/driver/fs9/driver_fs9.pro deleted file mode 100644 index ed91f1d0a..000000000 --- a/src/driver/fs9/driver_fs9.pro +++ /dev/null @@ -1,17 +0,0 @@ -TARGET = bb_driver_fs9 -TEMPLATE = lib -CONFIG += dll c++11 - -INCLUDEPATH += .. ../../ - -DESTDIR = ../../../bin - -DEPENDPATH += . - -HEADERS += *.h - -SOURCES += *.cpp - - - - diff --git a/src/driver/fsx/CMakeLists.txt b/src/driver/fsx/CMakeLists.txt deleted file mode 100644 index bb9a16c8d..000000000 --- a/src/driver/fsx/CMakeLists.txt +++ /dev/null @@ -1,20 +0,0 @@ -FILE(GLOB driver_fsx_SOURCES *.cpp) -FILE(GLOB driver_fsx_HEADERS *.h) -SET(driver_fsx_HEADERS_QOBJECT ) - -QT4_WRAP_CPP(driver_fsx_HEADERS_MOC ${driver_fsx_HEADERS_QOBJECT}) - -SOURCE_GROUP(QtGeneratedMocSrc FILES ${driver_fsx_HEADERS_MOC}) -SOURCE_GROUP (Headers FILES ${driver_fsx_HEADERS}) - -INCLUDE_DIRECTORIES(${SIMCONNECT_INCLUDE_DIR}) -LINK_DIRECTORIES(${SIMCONNECT_LIBRARY_DIR}) - -IF(WITH_STATIC_DRIVERS) - ADD_LIBRARY(bb_driver_fsx STATIC ${driver_fsx_SOURCES} ${driver_fsx_HEADERS_MOC} ) -ELSE(WITH_STATIC_DRIVERS) - ADD_LIBRARY(bb_driver_fsx SHARED ${driver_fsx_SOURCES} ${driver_fsx_HEADERS_MOC} ) -ENDIF(WITH_STATIC_DRIVERS) - -TARGET_LINK_LIBRARIES(bb_driver_fsx blackmisc blackcore SimConnect.lib ${QT_LIBRARIES}) -SET_TARGET_PROPERTIES(bb_driver_fsx PROPERTIES PROJECT_LABEL "Driver - FSX") \ No newline at end of file diff --git a/src/driver/fsx/driver_fsx.cpp b/src/driver/fsx/driver_fsx.cpp deleted file mode 100644 index 989f07c34..000000000 --- a/src/driver/fsx/driver_fsx.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2013 by Roland Winklmeier * - * roland.m.winklmeier@googlemail.com * - * * - * For license information see LICENSE in the root folder of the * - * source code. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU Lesser General Public License for more details. * - * * - ***************************************************************************/ - -#include - -#include "driver_fsx.h" - -extern "C" -{ - Q_DECL_EXPORT ISimulator* BB_createISimulatorInstance () - { - return new CDriverFSX; - } - - Q_DECL_EXPORT quint32 BB_InterfaceVersionMajor () - { - return ISimulator::InterfaceVersionMajor; - } - - Q_DECL_EXPORT quint32 BB_InterfaceVersionMinor () - { - return ISimulator::InterfaceVersionMinor; - } -} - -CDriverFSX::CDriverFSX() -{ - -} - -void CDriverFSX::setLibraryContext(BlackMisc::IContext *context) -{ -#ifdef Q_OS_WIN - bAssert(!BlackMisc::IContext::isContextInitialised()); -#endif - - m_libraryContext = new BlackMisc::CLibraryContext(*context); -} diff --git a/src/driver/fsx/driver_fsx.h b/src/driver/fsx/driver_fsx.h deleted file mode 100644 index e2eda0ace..000000000 --- a/src/driver/fsx/driver_fsx.h +++ /dev/null @@ -1,35 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2013 by Roland Winklmeier * - * roland.m.winklmeier@googlemail.com * - * * - * For license information see LICENSE in the root folder of the * - * source code. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU Lesser General Public License for more details. * - * * - ***************************************************************************/ - -#ifndef DRIVER_FSX_H -#define DRIVER_FSX_H - -#include -#include - -class CDriverFSX : public BlackCore::ISimulator -{ -public: - CDriverFSX(); - - virtual void setLibraryContext(BlackMisc::IContext *context); - - virtual int init() { return 0; } - -protected: - - BlackMisc::CLibraryContext *m_libraryContext; -}; - -#endif // DRIVER_FSX_H diff --git a/src/driver/fsx/driver_fsx.pro b/src/driver/fsx/driver_fsx.pro deleted file mode 100644 index 98f2cfdc8..000000000 --- a/src/driver/fsx/driver_fsx.pro +++ /dev/null @@ -1,17 +0,0 @@ -TARGET = bb_driver_fsx -TEMPLATE = lib -CONFIG += dll c++11 - -INCLUDEPATH += .. ../../ - -DESTDIR = ../../../bin - -DEPENDPATH += . - -HEADERS += *.h - -SOURCES += *.cpp - - - - diff --git a/src/driver/xplane/driver_xplane.cpp b/src/driver/xplane/driver_xplane.cpp deleted file mode 100644 index 09d003ea1..000000000 --- a/src/driver/xplane/driver_xplane.cpp +++ /dev/null @@ -1,31 +0,0 @@ -#include "driver_xplane.h" - -extern "C" -{ - Q_DECL_EXPORT ISimulator* BB_createISimulatorInstance() - { - return new CDriverXPlane; - } -} - -CDriverXPlane::CDriverXPlane() -{ -} - -CDriverXPlane::~CDriverXPlane() -{ -} - -int CDriverXPlane::init() -{ - return 1; -} - -void CDriverXPlane::setLibraryContext(BlackMisc::IContext *context) -{ -#ifdef Q_OS_WIN - bAssert(!BlackMisc::IContext::isContextInitialised()); -#endif - - mLibraryContext = new BlackMisc::CLibraryContext(*context); -} diff --git a/src/driver/xplane/driver_xplane.h b/src/driver/xplane/driver_xplane.h deleted file mode 100644 index c707aba48..000000000 --- a/src/driver/xplane/driver_xplane.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef DRIVER_XPLANE_H -#define DRIVER_XPLANE_H - -#include - -class CDriverXPlane : public ISimulator -{ -public: - CDriverXPlane(); - virtual ~CDriverXPlane(); - - virtual int init(); -}; - -#endif // DRIVER_XPLANE_H diff --git a/src/driver/xplane/driver_xplane.pro b/src/driver/xplane/driver_xplane.pro deleted file mode 100644 index 21a93cfe0..000000000 --- a/src/driver/xplane/driver_xplane.pro +++ /dev/null @@ -1,17 +0,0 @@ -TARGET = bb_driver_xplane -TEMPLATE = lib -CONFIG += dll c++11 - -INCLUDEPATH += .. ../../ - -DESTDIR = ../../../bin - -DEPENDPATH += . - -HEADERS += *.h - -SOURCES += *.cpp - - - - From 0a6030f5dfc074259ee07ee48dd11d1a3d260794 Mon Sep 17 00:00:00 2001 From: Mathew Sutcliffe Date: Fri, 7 Feb 2014 22:45:35 +0000 Subject: [PATCH 3/4] refs #92 fixing warnings when compiling for 64bits due to conversions between size_t and int --- src/blackcore/network_vatlib.cpp | 2 +- src/blackcore/pluginmgr.cpp | 8 ++++---- src/blackcore/pluginmgr.h | 20 ++++++++++---------- src/blackmisc/mathmatrixbase.cpp | 6 +++--- src/blackmisc/mathmatrixbase.h | 10 +++++----- src/blackmisc/mathvector3dbase.cpp | 6 +++--- src/blackmisc/mathvector3dbase.h | 10 +++++----- 7 files changed, 31 insertions(+), 31 deletions(-) diff --git a/src/blackcore/network_vatlib.cpp b/src/blackcore/network_vatlib.cpp index 7e3c15aaa..7ea29c5c0 100644 --- a/src/blackcore/network_vatlib.cpp +++ b/src/blackcore/network_vatlib.cpp @@ -402,7 +402,7 @@ namespace BlackCore // I could send the same message to n frequencies in one step // if this is really required, I need to group by message // currently I send individual messages - std::vector freqsVec; + QVector freqsVec; freqsVec.push_back(message.getFrequency().value(CFrequencyUnit::kHz())); m_net->SendRadioTextMessage(freqsVec.size(), freqsVec.data(), toFSD(message.getMessage())); } diff --git a/src/blackcore/pluginmgr.cpp b/src/blackcore/pluginmgr.cpp index 928a4a216..f8a00c9f0 100644 --- a/src/blackcore/pluginmgr.cpp +++ b/src/blackcore/pluginmgr.cpp @@ -63,7 +63,7 @@ namespace BlackCore } } - const CPluginManager::PluginEntry &CPluginManager::getEntry(size_t index) const + const CPluginManager::PluginEntry &CPluginManager::getEntry(int index) const { Q_ASSERT_X(index < getPluginCount(), "Plugin manager", "Plugin index out of bounds"); @@ -80,17 +80,17 @@ namespace BlackCore return entry; } - const QString CPluginManager::getName(size_t index) const + const QString CPluginManager::getName(int index) const { return getFactory(index)->getName(); } - const QString CPluginManager::getDescription(size_t index) const + const QString CPluginManager::getDescription(int index) const { return getFactory(index)->getDescription(); } - BlackMisc::IPlugin *CPluginManager::constructPlugin(size_t index) + BlackMisc::IPlugin *CPluginManager::constructPlugin(int index) { BlackMisc::IPlugin *plugin = getFactory(index)->create(BlackMisc::IContext::getInstance()); if (! plugin->isValid()) diff --git a/src/blackcore/pluginmgr.h b/src/blackcore/pluginmgr.h index e791d8ab8..b10c4433c 100644 --- a/src/blackcore/pluginmgr.h +++ b/src/blackcore/pluginmgr.h @@ -45,7 +45,7 @@ namespace BlackCore Return the total number of plugins loaded so far. \return */ - size_t getPluginCount() const + int getPluginCount() const { return m_plugins.size(); } @@ -55,14 +55,14 @@ namespace BlackCore \param index the plugin's index in the vector of plugins. \return */ - const QString getName(size_t index) const; + const QString getName(int index) const; /*! Return the description of a plugin. \param index the plugin's index in the vector of plugins. \return */ - const QString getDescription(size_t index) const; + const QString getDescription(int index) const; /*! Construct a plugin. @@ -70,14 +70,14 @@ namespace BlackCore \return a pointer to the newly created plugin. \warning You must release this pointer with IPluginFactory::destroy(). */ - BlackMisc::IPlugin *constructPlugin(size_t index); + BlackMisc::IPlugin *constructPlugin(int index); /*! Direct access to the factory. You don't usually need this. \param index \return */ - BlackMisc::IPluginFactory *getFactory(size_t index) + BlackMisc::IPluginFactory *getFactory(int index) { return const_cast(static_cast(this)->getFactory(index)); } @@ -87,7 +87,7 @@ namespace BlackCore \param index \return */ - const BlackMisc::IPluginFactory *getFactory(size_t index) const + const BlackMisc::IPluginFactory *getFactory(int index) const { return getEntry(index).factory; } @@ -97,7 +97,7 @@ namespace BlackCore \param index \return */ - QPluginLoader *getLoader(size_t index) + QPluginLoader *getLoader(int index) { return const_cast(static_cast(this)->getLoader(index)); } @@ -107,7 +107,7 @@ namespace BlackCore \param index \return */ - const QPluginLoader *getLoader(size_t index) const + const QPluginLoader *getLoader(int index) const { return getEntry(index).loader.data(); } @@ -123,12 +123,12 @@ namespace BlackCore QVector m_plugins; - PluginEntry &getEntry(size_t index) + PluginEntry &getEntry(int index) { return const_cast(static_cast(this)->getEntry(index)); } - const PluginEntry &getEntry(size_t index) const; + const PluginEntry &getEntry(int index) const; }; } // namespace BlackCore diff --git a/src/blackmisc/mathmatrixbase.cpp b/src/blackmisc/mathmatrixbase.cpp index 676500bb2..6ceba0ce0 100644 --- a/src/blackmisc/mathmatrixbase.cpp +++ b/src/blackmisc/mathmatrixbase.cpp @@ -16,7 +16,7 @@ namespace BlackMisc /* * Get element by column / row */ - template double CMatrixBase::getElement(size_t row, size_t column) const + template double CMatrixBase::getElement(int row, int column) const { this->checkRange(row, column); return this->m_matrix(row, column); @@ -25,7 +25,7 @@ namespace BlackMisc /* * Set element by column / row */ - template void CMatrixBase::setElement(size_t row, size_t column, double value) + template void CMatrixBase::setElement(int row, int column, double value) { this->checkRange(row, column); this->m_matrix(row, column) = value; @@ -34,7 +34,7 @@ namespace BlackMisc /* * Check range */ - template void CMatrixBase::checkRange(size_t row, size_t column) const + template void CMatrixBase::checkRange(int row, int column) const { bool valid = (row < Rows && column < Columns); Q_ASSERT_X(valid, "getElement()", "Row or column invalid"); diff --git a/src/blackmisc/mathmatrixbase.h b/src/blackmisc/mathmatrixbase.h index d06ad3c30..c6c48d55b 100644 --- a/src/blackmisc/mathmatrixbase.h +++ b/src/blackmisc/mathmatrixbase.h @@ -324,7 +324,7 @@ namespace BlackMisc * \param column * \return */ - double getElement(size_t row, size_t column) const; + double getElement(int row, int column) const; /*! * \brief Get element @@ -332,7 +332,7 @@ namespace BlackMisc * \param column * \param value */ - void setElement(size_t row, size_t column, double value); + void setElement(int row, int column, double value); /*! * \brief Get element by operator () modifying @@ -340,7 +340,7 @@ namespace BlackMisc * \param column * \return */ - double &operator()(size_t row, size_t column) + double &operator()(int row, int column) { this->checkRange(row, column); return this->m_matrix(row, column); @@ -352,7 +352,7 @@ namespace BlackMisc * \param column * \return */ - double operator()(size_t row, size_t column) const + double operator()(int row, int column) const { return this->getElement(row, column); } @@ -369,7 +369,7 @@ namespace BlackMisc * \param column * \throws std::range_error if index out of bounds */ - void checkRange(size_t row, size_t column) const; + void checkRange(int row, int column) const; }; } // namespace diff --git a/src/blackmisc/mathvector3dbase.cpp b/src/blackmisc/mathvector3dbase.cpp index d73e2ca74..26def4f35 100644 --- a/src/blackmisc/mathvector3dbase.cpp +++ b/src/blackmisc/mathvector3dbase.cpp @@ -81,7 +81,7 @@ namespace BlackMisc /* * Element (return by reference) */ - template double &CVector3DBase::getElement(size_t row) + template double &CVector3DBase::getElement(int row) { switch (row) { @@ -100,7 +100,7 @@ namespace BlackMisc /* * Element */ - template double CVector3DBase::getElement(size_t row) const + template double CVector3DBase::getElement(int row) const { return const_cast*>(this)->getElement(row); } @@ -108,7 +108,7 @@ namespace BlackMisc /* * Set given element */ - template void CVector3DBase::setElement(size_t row, double value) + template void CVector3DBase::setElement(int row, double value) { switch (row) { diff --git a/src/blackmisc/mathvector3dbase.h b/src/blackmisc/mathvector3dbase.h index 7552134b9..a0f1e035d 100644 --- a/src/blackmisc/mathvector3dbase.h +++ b/src/blackmisc/mathvector3dbase.h @@ -71,7 +71,7 @@ namespace BlackMisc * \param row * \return Mutable reference */ - double &getElement(size_t row); + double &getElement(int row); /*! * \brief String for converter @@ -152,28 +152,28 @@ namespace BlackMisc * \param row * \return */ - double getElement(size_t row) const; + double getElement(int row) const; /*! * \brief Set element * \param row * \param value */ - void setElement(size_t row, double value); + void setElement(int row, double value); /*! * \brief Operator [] * \param row * \return */ - double operator[](size_t row) const { return this->getElement(row); } + double operator[](int row) const { return this->getElement(row); } /*! * \brief Operator [] * \param row * \return Mutable reference */ - double &operator[](size_t row) { return this->getElement(row); } + double &operator[](int row) { return this->getElement(row); } /*! * \brief Equal operator == From e7af80abf308c49e08005397ed2a6b8f1edff7e3 Mon Sep 17 00:00:00 2001 From: Roland Winklmeier Date: Sat, 8 Feb 2014 01:39:54 +0100 Subject: [PATCH 4/4] Remove left driver references in client.pro --- client.pro | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/client.pro b/client.pro index 962a93d8d..5a458339f 100644 --- a/client.pro +++ b/client.pro @@ -30,18 +30,6 @@ equals(WITH_BLACKGUI, ON) { SUBDIRS += src/blackgui } -equals(WITH_DRIVER_FSX, ON) { - SUBDIRS += src/driver/fsx/driver_fsx.pro -} - -equals(WITH_DRIVER_FS9, ON) { - SUBDIRS += src/driver/fs9/driver_fs9.pro -} - -equals(WITH_DRIVER_XPLANE, ON) { - SUBDIRS += src/driver/xplane/driver_xplane.pro -} - equals(WITH_SAMPLES, ON) { SUBDIRS += samples/cli_client/sample_cli_client.pro SUBDIRS += samples/interpolator/sample_interpolator.pro