From 86289e199fbde1fb2217159dce5dfe6d3716c429 2017-10-27 15:32:54 From: Thibaud Rabillard Date: 2017-10-27 15:32:54 Subject: [PATCH] Windows s**t --- diff --git a/app/src/MainWindow.cpp b/app/src/MainWindow.cpp index 09f7870..cb9bd18 100644 --- a/app/src/MainWindow.cpp +++ b/app/src/MainWindow.cpp @@ -52,7 +52,7 @@ const auto LEFTINSPECTORSIDEPANESPLITTERINDEX = 1; const auto VIEWPLITTERINDEX = 2; const auto RIGHTINSPECTORSIDEPANESPLITTERINDEX = 3; const auto RIGHTMAININSPECTORWIDGETSPLITTERINDEX = 4; -} +} // namespace class MainWindow::MainWindowPrivate { public: @@ -237,9 +237,7 @@ MainWindow::MainWindow(QWidget *parent) Qt::DirectConnection); } -MainWindow::~MainWindow() -{ -} +MainWindow::~MainWindow() {} void MainWindow::changeEvent(QEvent *e) { diff --git a/core/include/Common/MetaTypes.h b/core/include/Common/MetaTypes.h index 1fb61b0..2a50127 100644 --- a/core/include/Common/MetaTypes.h +++ b/core/include/Common/MetaTypes.h @@ -13,30 +13,30 @@ struct MetaTypeRegistry { }; /** - * This macro can be used to : - * - declare a type as a Qt meta type - * - and register it (through a static instance) at the launch of SciQlop, so it can be passed in + * This macro can be used to : + * - declare a type as a Qt meta type + * - and register it (through a static instance) at the launch of SciQlop, so it can be passed in * Qt signals/slots - * - * It can be used both in .h or in .cpp files - * - * @param NAME name of the instance under which the type will be registered (in uppercase) - * @param TYPE type to register - * - * Example: - * ~~~cpp - * // The following macro : - * // - declares std::shared_ptr as a Qt meta type - * // - registers it through an instance named VAR_SHARED_PTR - * SCIQLOP_REGISTER_META_TYPE(VAR_SHARED_PTR, std::shared_ptr) - * - * // The following macro : - * // - declares a raw pointer of Variable as a Qt meta type - * // - registers it through an instance named VAR_RAW_PTR - * SCIQLOP_REGISTER_META_TYPE(VAR_RAW_PTR, Variable*) - * ~~~ - * - */ + * + * It can be used both in .h or in .cpp files + * + * @param NAME name of the instance under which the type will be registered (in uppercase) + * @param TYPE type to register + * + * Example: + * ~~~cpp + * // The following macro : + * // - declares std::shared_ptr as a Qt meta type + * // - registers it through an instance named VAR_SHARED_PTR + * SCIQLOP_REGISTER_META_TYPE(VAR_SHARED_PTR, std::shared_ptr) + * + * // The following macro : + * // - declares a raw pointer of Variable as a Qt meta type + * // - registers it through an instance named VAR_RAW_PTR + * SCIQLOP_REGISTER_META_TYPE(VAR_RAW_PTR, Variable*) + * ~~~ + * + */ // clang-format off #define SCIQLOP_REGISTER_META_TYPE(NAME, TYPE) \ Q_DECLARE_METATYPE(TYPE) \ diff --git a/core/include/Common/spimpl.h b/core/include/Common/spimpl.h index b4d5e04..1919e69 100644 --- a/core/include/Common/spimpl.h +++ b/core/include/Common/spimpl.h @@ -89,10 +89,10 @@ using default_copier_t = typename default_copier::type; template struct is_default_manageable - : public std::integral_constant >::value - && std::is_same >::value> { + : public std::integral_constant >::value + && std::is_same >::value> { }; -} +} // namespace details template , @@ -135,7 +135,7 @@ public: && is_default_manageable::value, dummy_t_>::type = dummy_t_()) SPIMPL_NOEXCEPT - : impl_ptr(u, &details::default_delete, &details::default_copy) + : impl_ptr(u, &details::default_delete, &details::default_copy) { } @@ -155,8 +155,8 @@ public: && is_default_manageable::value, dummy_t_>::type = dummy_t_()) SPIMPL_NOEXCEPT - : ptr_(u.release(), &details::default_delete), - copier_(&details::default_copy) + : ptr_(u.release(), &details::default_delete), + copier_(&details::default_copy) { } #endif @@ -234,13 +234,12 @@ public: return operator=(u.clone()); } -// + // #ifdef SPIMPL_HAS_AUTO_PTR template - typename std::enable_if::value - && is_default_manageable::value, - impl_ptr &>::type + typename std::enable_if< + std::is_convertible::value && is_default_manageable::value, impl_ptr &>::type operator=(std::auto_ptr &&u) SPIMPL_NOEXCEPT { return operator=(impl_ptr(std::move(u))); @@ -248,9 +247,8 @@ public: #endif template - typename std::enable_if::value - && is_default_manageable::value, - impl_ptr &>::type + typename std::enable_if< + std::is_convertible::value && is_default_manageable::value, impl_ptr &>::type operator=(std::unique_ptr &&u) SPIMPL_NOEXCEPT { return operator=(impl_ptr(std::move(u))); @@ -442,7 +440,7 @@ inline unique_impl_ptr make_unique_impl(Args &&... args) static_assert(!std::is_array::value, "unique_impl_ptr does not support arrays"); return unique_impl_ptr(new T(std::forward(args)...), &details::default_delete); } -} +} // namespace spimpl namespace std { template @@ -455,6 +453,6 @@ struct hash > { return hash()(p.get()); } }; -} +} // namespace std #endif // SPIMPL_H_ diff --git a/core/src/Data/VectorSeries.cpp b/core/src/Data/VectorSeries.cpp index ab86bad..2d1d7a4 100644 --- a/core/src/Data/VectorSeries.cpp +++ b/core/src/Data/VectorSeries.cpp @@ -43,9 +43,10 @@ std::vector flatten(std::vector xValues, std::vector yVa VectorSeries::VectorSeries(std::vector xAxisData, std::vector xValuesData, std::vector yValuesData, std::vector zValuesData, const Unit &xAxisUnit, const Unit &valuesUnit) - : VectorSeries{std::move(xAxisData), flatten(std::move(xValuesData), std::move(yValuesData), - std::move(zValuesData)), - xAxisUnit, valuesUnit} + : VectorSeries{ + std::move(xAxisData), + flatten(std::move(xValuesData), std::move(yValuesData), std::move(zValuesData)), + xAxisUnit, valuesUnit} { } diff --git a/core/src/DataSource/DataSourceController.cpp b/core/src/DataSource/DataSourceController.cpp index 220945e..22441fe 100644 --- a/core/src/DataSource/DataSourceController.cpp +++ b/core/src/DataSource/DataSourceController.cpp @@ -49,14 +49,14 @@ public: DataSourceController::DataSourceController(QObject *parent) : impl{spimpl::make_unique_impl()} { - qCDebug(LOG_DataSourceController()) << tr("DataSourceController construction") - << QThread::currentThread(); + qCDebug(LOG_DataSourceController()) + << tr("DataSourceController construction") << QThread::currentThread(); } DataSourceController::~DataSourceController() { - qCDebug(LOG_DataSourceController()) << tr("DataSourceController destruction") - << QThread::currentThread(); + qCDebug(LOG_DataSourceController()) + << tr("DataSourceController destruction") << QThread::currentThread(); this->waitForFinish(); } @@ -126,8 +126,8 @@ void DataSourceController::loadProductItem(const QUuid &dataSourceUid, void DataSourceController::initialize() { - qCDebug(LOG_DataSourceController()) << tr("DataSourceController init") - << QThread::currentThread(); + qCDebug(LOG_DataSourceController()) + << tr("DataSourceController init") << QThread::currentThread(); impl->m_WorkingMutex.lock(); qCDebug(LOG_DataSourceController()) << tr("DataSourceController init END"); } diff --git a/core/src/Network/NetworkController.cpp b/core/src/Network/NetworkController.cpp index dcaacc6..002a47a 100644 --- a/core/src/Network/NetworkController.cpp +++ b/core/src/Network/NetworkController.cpp @@ -64,8 +64,8 @@ void NetworkController::onProcessRequested(std::shared_ptr requ impl->unlock(); } - qCDebug(LOG_NetworkController()) << tr("NetworkController onReplyFinished END") - << QThread::currentThread() << reply; + qCDebug(LOG_NetworkController()) + << tr("NetworkController onReplyFinished END") << QThread::currentThread() << reply; }; auto onReplyProgress = [reply, request, this](qint64 bytesRead, qint64 totalBytes) { @@ -73,9 +73,9 @@ void NetworkController::onProcessRequested(std::shared_ptr requ // NOTE: a totalbytes of 0 can happened when a request has been aborted if (totalBytes > 0) { double progress = (bytesRead * 100.0) / totalBytes; - qCDebug(LOG_NetworkController()) << tr("NetworkController onReplyProgress") << progress - << QThread::currentThread() << request.get() << reply - << bytesRead << totalBytes; + qCDebug(LOG_NetworkController()) + << tr("NetworkController onReplyProgress") << progress << QThread::currentThread() + << request.get() << reply << bytesRead << totalBytes; impl->lockRead(); auto it = impl->m_NetworkReplyToId.find(reply); if (it != impl->m_NetworkReplyToId.cend()) { @@ -87,8 +87,8 @@ void NetworkController::onProcessRequested(std::shared_ptr requ impl->unlock(); } - qCDebug(LOG_NetworkController()) << tr("NetworkController onReplyProgress END") - << QThread::currentThread() << reply; + qCDebug(LOG_NetworkController()) + << tr("NetworkController onReplyProgress END") << QThread::currentThread() << reply; } }; @@ -125,8 +125,8 @@ void NetworkController::finalize() void NetworkController::onReplyCanceled(QUuid identifier) { auto findReply = [identifier](const auto &entry) { return identifier == entry.second; }; - qCDebug(LOG_NetworkController()) << tr("NetworkController onReplyCanceled") - << QThread::currentThread() << identifier; + qCDebug(LOG_NetworkController()) + << tr("NetworkController onReplyCanceled") << QThread::currentThread() << identifier; impl->lockRead(); @@ -138,8 +138,8 @@ void NetworkController::onReplyCanceled(QUuid identifier) << QThread::currentThread() << identifier; it->first->abort(); } - qCDebug(LOG_NetworkController()) << tr("NetworkController onReplyCanceled END") - << QThread::currentThread(); + qCDebug(LOG_NetworkController()) + << tr("NetworkController onReplyCanceled END") << QThread::currentThread(); } void NetworkController::waitForFinish() diff --git a/core/src/Plugin/PluginManager.cpp b/core/src/Plugin/PluginManager.cpp index c1fa918..9c548e1 100644 --- a/core/src/Plugin/PluginManager.cpp +++ b/core/src/Plugin/PluginManager.cpp @@ -99,9 +99,7 @@ struct PluginManager::PluginManagerPrivate { QHash m_RegisteredPlugins; }; -PluginManager::PluginManager() : impl{spimpl::make_unique_impl()} -{ -} +PluginManager::PluginManager() : impl{spimpl::make_unique_impl()} {} void PluginManager::loadPlugins(const QDir &pluginDir) { diff --git a/core/src/Variable/Variable.cpp b/core/src/Variable/Variable.cpp index 8d68fa0..3eb44df 100644 --- a/core/src/Variable/Variable.cpp +++ b/core/src/Variable/Variable.cpp @@ -265,8 +265,8 @@ QVector Variable::provideNotInCacheRangeList(const SqpRange &range) co notInCache << SqpRange{impl->m_CacheRange.m_TEnd, range.m_TEnd}; } else { - qCCritical(LOG_Variable()) << tr("Detection of unknown case.") - << QThread::currentThread(); + qCCritical(LOG_Variable()) + << tr("Detection of unknown case.") << QThread::currentThread(); } } } @@ -305,8 +305,8 @@ QVector Variable::provideInCacheRangeList(const SqpRange &range) const inCache << impl->m_CacheRange; } else { - qCCritical(LOG_Variable()) << tr("Detection of unknown case.") - << QThread::currentThread(); + qCCritical(LOG_Variable()) + << tr("Detection of unknown case.") << QThread::currentThread(); } } } @@ -339,8 +339,8 @@ QVector Variable::provideNotInCacheRangeList(const SqpRange &oldRange, notInCache << SqpRange{oldRange.m_TEnd, nextRange.m_TEnd}; } else { - qCCritical(LOG_Variable()) << tr("Detection of unknown case.") - << QThread::currentThread(); + qCCritical(LOG_Variable()) + << tr("Detection of unknown case.") << QThread::currentThread(); } } } @@ -378,8 +378,8 @@ QVector Variable::provideInCacheRangeList(const SqpRange &oldRange, inCache << oldRange; } else { - qCCritical(LOG_Variable()) << tr("Detection of unknown case.") - << QThread::currentThread(); + qCCritical(LOG_Variable()) + << tr("Detection of unknown case.") << QThread::currentThread(); } } } diff --git a/core/src/Variable/VariableAcquisitionWorker.cpp b/core/src/Variable/VariableAcquisitionWorker.cpp index 479293a..f77a6e6 100644 --- a/core/src/Variable/VariableAcquisitionWorker.cpp +++ b/core/src/Variable/VariableAcquisitionWorker.cpp @@ -53,8 +53,8 @@ VariableAcquisitionWorker::VariableAcquisitionWorker(QObject *parent) VariableAcquisitionWorker::~VariableAcquisitionWorker() { - qCInfo(LOG_VariableAcquisitionWorker()) << tr("VariableAcquisitionWorker destruction") - << QThread::currentThread(); + qCInfo(LOG_VariableAcquisitionWorker()) + << tr("VariableAcquisitionWorker destruction") << QThread::currentThread(); this->waitForFinish(); } @@ -71,8 +71,8 @@ QUuid VariableAcquisitionWorker::pushVariableRequest(QUuid varRequestId, QUuid v // Request creation auto acqRequest = AcquisitionRequest{}; - qCDebug(LOG_VariableAcquisitionWorker()) << tr("PushVariableRequest ") << vIdentifier - << varRequestId; + qCDebug(LOG_VariableAcquisitionWorker()) + << tr("PushVariableRequest ") << vIdentifier << varRequestId; acqRequest.m_VarRequestId = varRequestId; acqRequest.m_vIdentifier = vIdentifier; acqRequest.m_DataProviderParameters = parameters; @@ -150,8 +150,8 @@ void VariableAcquisitionWorker::abortProgressRequested(QUuid vIdentifier) void VariableAcquisitionWorker::onVariableRetrieveDataInProgress(QUuid acqIdentifier, double progress) { - qCDebug(LOG_VariableAcquisitionWorker()) << tr("TORM: onVariableRetrieveDataInProgress ") - << acqIdentifier << progress; + qCDebug(LOG_VariableAcquisitionWorker()) + << tr("TORM: onVariableRetrieveDataInProgress ") << acqIdentifier << progress; impl->lockRead(); auto aIdToARit = impl->m_AcqIdentifierToAcqRequestMap.find(acqIdentifier); if (aIdToARit != impl->m_AcqIdentifierToAcqRequestMap.cend()) { @@ -176,16 +176,16 @@ void VariableAcquisitionWorker::onVariableRetrieveDataInProgress(QUuid acqIdenti void VariableAcquisitionWorker::onVariableAcquisitionFailed(QUuid acqIdentifier) { - qCDebug(LOG_VariableAcquisitionWorker()) << tr("onVariableAcquisitionFailed") - << QThread::currentThread(); + qCDebug(LOG_VariableAcquisitionWorker()) + << tr("onVariableAcquisitionFailed") << QThread::currentThread(); impl->lockRead(); auto it = impl->m_AcqIdentifierToAcqRequestMap.find(acqIdentifier); if (it != impl->m_AcqIdentifierToAcqRequestMap.cend()) { auto request = it->second; impl->unlock(); - qCDebug(LOG_VariableAcquisitionWorker()) << tr("onVariableAcquisitionFailed") - << acqIdentifier << request.m_vIdentifier - << QThread::currentThread(); + qCDebug(LOG_VariableAcquisitionWorker()) + << tr("onVariableAcquisitionFailed") << acqIdentifier << request.m_vIdentifier + << QThread::currentThread(); emit variableCanceledRequested(request.m_vIdentifier); } else { @@ -198,8 +198,8 @@ void VariableAcquisitionWorker::onVariableDataAcquired(QUuid acqIdentifier, std::shared_ptr dataSeries, SqpRange dataRangeAcquired) { - qCDebug(LOG_VariableAcquisitionWorker()) << tr("TORM: onVariableDataAcquired on range ") - << acqIdentifier << dataRangeAcquired; + qCDebug(LOG_VariableAcquisitionWorker()) + << tr("TORM: onVariableDataAcquired on range ") << acqIdentifier << dataRangeAcquired; impl->lockWrite(); auto aIdToARit = impl->m_AcqIdentifierToAcqRequestMap.find(acqIdentifier); if (aIdToARit != impl->m_AcqIdentifierToAcqRequestMap.cend()) { @@ -270,8 +270,8 @@ void VariableAcquisitionWorker::onExecuteRequest(QUuid acqIdentifier) void VariableAcquisitionWorker::initialize() { - qCDebug(LOG_VariableAcquisitionWorker()) << tr("VariableAcquisitionWorker init") - << QThread::currentThread(); + qCDebug(LOG_VariableAcquisitionWorker()) + << tr("VariableAcquisitionWorker init") << QThread::currentThread(); impl->m_WorkingMutex.lock(); qCDebug(LOG_VariableAcquisitionWorker()) << tr("VariableAcquisitionWorker init END"); } diff --git a/core/src/Variable/VariableCacheController.cpp b/core/src/Variable/VariableCacheController.cpp index fd1e836..9edc77c 100644 --- a/core/src/Variable/VariableCacheController.cpp +++ b/core/src/Variable/VariableCacheController.cpp @@ -30,8 +30,8 @@ VariableCacheController::VariableCacheController(QObject *parent) void VariableCacheController::addDateTime(std::shared_ptr variable, const SqpRange &dateTime) { - qCDebug(LOG_VariableCacheController()) << "VariableCacheController::addDateTime" - << QThread::currentThread()->objectName(); + qCDebug(LOG_VariableCacheController()) + << "VariableCacheController::addDateTime" << QThread::currentThread()->objectName(); if (variable) { auto findVariableIte = impl->m_VariableToSqpRangeListMap.find(variable); if (findVariableIte == impl->m_VariableToSqpRangeListMap.end()) { @@ -104,8 +104,8 @@ VariableCacheController::provideNotInCacheDateTimeList(std::shared_ptr QVector VariableCacheController::dateCacheList(std::shared_ptr variable) const noexcept { - qCDebug(LOG_VariableCacheController()) << "VariableCacheController::dateCacheList" - << QThread::currentThread()->objectName(); + qCDebug(LOG_VariableCacheController()) + << "VariableCacheController::dateCacheList" << QThread::currentThread()->objectName(); try { return impl->m_VariableToSqpRangeListMap.at(variable); } @@ -215,8 +215,8 @@ void VariableCacheController::displayCache(std::shared_ptr variable) c { auto variableDateTimeList = impl->m_VariableToSqpRangeListMap.find(variable); if (variableDateTimeList != impl->m_VariableToSqpRangeListMap.end()) { - qCInfo(LOG_VariableCacheController()) << tr("VariableCacheController::displayCache") - << variableDateTimeList->second; + qCInfo(LOG_VariableCacheController()) + << tr("VariableCacheController::displayCache") << variableDateTimeList->second; } else { qCWarning(LOG_VariableCacheController()) diff --git a/core/src/Variable/VariableController.cpp b/core/src/Variable/VariableController.cpp index 5377542..16668b8 100644 --- a/core/src/Variable/VariableController.cpp +++ b/core/src/Variable/VariableController.cpp @@ -76,7 +76,7 @@ SqpRange computeSynchroRangeRequested(const SqpRange &varRange, const SqpRange & return varRangeRequested; } -} +} // namespace enum class VariableRequestHandlerState { OFF, RUNNING, PENDING }; @@ -165,8 +165,8 @@ struct VariableController::VariableControllerPrivate { VariableController::VariableController(QObject *parent) : QObject{parent}, impl{spimpl::make_unique_impl(this)} { - qCDebug(LOG_VariableController()) << tr("VariableController construction") - << QThread::currentThread(); + qCDebug(LOG_VariableController()) + << tr("VariableController construction") << QThread::currentThread(); connect(impl->m_VariableModel, &VariableModel::abortProgessRequested, this, &VariableController::onAbortProgressRequested); @@ -193,8 +193,8 @@ VariableController::VariableController(QObject *parent) VariableController::~VariableController() { - qCDebug(LOG_VariableController()) << tr("VariableController destruction") - << QThread::currentThread(); + qCDebug(LOG_VariableController()) + << tr("VariableController destruction") << QThread::currentThread(); this->waitForFinish(); } @@ -361,8 +361,8 @@ VariableController::createVariable(const QString &name, const QVariantHash &meta void VariableController::onDateTimeOnSelection(const SqpRange &dateTime) { // NOTE: Even if acquisition request is aborting, the graphe range will be changed - qCDebug(LOG_VariableController()) << "VariableController::onDateTimeOnSelection" - << QThread::currentThread()->objectName(); + qCDebug(LOG_VariableController()) + << "VariableController::onDateTimeOnSelection" << QThread::currentThread()->objectName(); auto selectedRows = impl->m_VariableSelectionModel->selectedRows(); // NOTE we only permit the time modification for one variable @@ -483,9 +483,9 @@ void VariableController::onAbortAcquisitionRequested(QUuid vIdentifier) void VariableController::onAddSynchronizationGroupId(QUuid synchronizationGroupId) { - qCDebug(LOG_VariableController()) << "TORM: VariableController::onAddSynchronizationGroupId" - << QThread::currentThread()->objectName() - << synchronizationGroupId; + qCDebug(LOG_VariableController()) + << "TORM: VariableController::onAddSynchronizationGroupId" + << QThread::currentThread()->objectName() << synchronizationGroupId; auto vSynchroGroup = std::make_shared(); impl->m_GroupIdToVariableSynchronizationGroupMap.insert( std::make_pair(synchronizationGroupId, vSynchroGroup)); @@ -500,8 +500,8 @@ void VariableController::onAddSynchronized(std::shared_ptr variable, QUuid synchronizationGroupId) { - qCDebug(LOG_VariableController()) << "TORM: VariableController::onAddSynchronized" - << synchronizationGroupId; + qCDebug(LOG_VariableController()) + << "TORM: VariableController::onAddSynchronized" << synchronizationGroupId; auto varToVarIdIt = impl->m_VariableToIdentifierMap.find(variable); if (varToVarIdIt != impl->m_VariableToIdentifierMap.cend()) { auto groupIdToVSGIt @@ -565,9 +565,9 @@ void VariableController::onRequestDataLoading(QVector } auto varRequestId = QUuid::createUuid(); - qCDebug(LOG_VariableController()) << "VariableController::onRequestDataLoading" - << QThread::currentThread()->objectName() << varRequestId - << range << synchronise; + qCDebug(LOG_VariableController()) + << "VariableController::onRequestDataLoading" << QThread::currentThread()->objectName() + << varRequestId << range << synchronise; if (!synchronise) { auto varIds = std::list{}; @@ -577,8 +577,8 @@ void VariableController::onRequestDataLoading(QVector } impl->m_VarGroupIdToVarIds.insert(std::make_pair(varRequestId, varIds)); for (const auto &var : variables) { - qCDebug(LOG_VariableController()) << "processRequest for" << var->name() << varRequestId - << varIds.size(); + qCDebug(LOG_VariableController()) + << "processRequest for" << var->name() << varRequestId << varIds.size(); impl->processRequest(var, range, varRequestId); } } @@ -603,8 +603,8 @@ void VariableController::onRequestDataLoading(QVector // Don't process already processed var if (var != nullptr) { - qCDebug(LOG_VariableController()) << "processRequest synchro for" << var->name() - << varRequestId; + qCDebug(LOG_VariableController()) + << "processRequest synchro for" << var->name() << varRequestId; auto vSyncRangeRequested = variables.contains(var) ? range @@ -706,26 +706,26 @@ void VariableController::VariableControllerPrivate::processRequest(std::shared_p switch (varHandler->m_State) { case VariableRequestHandlerState::OFF: { - qCDebug(LOG_VariableController()) << tr("Process Request OFF") - << varRequest.m_RangeRequested - << varRequest.m_CacheRangeRequested; + qCDebug(LOG_VariableController()) + << tr("Process Request OFF") << varRequest.m_RangeRequested + << varRequest.m_CacheRangeRequested; varHandler->m_RunningVarRequest = varRequest; varHandler->m_State = VariableRequestHandlerState::RUNNING; executeVarRequest(var, varRequest); break; } case VariableRequestHandlerState::RUNNING: { - qCDebug(LOG_VariableController()) << tr("Process Request RUNNING") - << varRequest.m_RangeRequested - << varRequest.m_CacheRangeRequested; + qCDebug(LOG_VariableController()) + << tr("Process Request RUNNING") << varRequest.m_RangeRequested + << varRequest.m_CacheRangeRequested; varHandler->m_State = VariableRequestHandlerState::PENDING; varHandler->m_PendingVarRequest = varRequest; break; } case VariableRequestHandlerState::PENDING: { - qCDebug(LOG_VariableController()) << tr("Process Request PENDING") - << varRequest.m_RangeRequested - << varRequest.m_CacheRangeRequested; + qCDebug(LOG_VariableController()) + << tr("Process Request PENDING") << varRequest.m_RangeRequested + << varRequest.m_CacheRangeRequested; auto variableGroupIdToCancel = varHandler->m_PendingVarRequest.m_VariableGroupId; cancelVariableRequest(variableGroupIdToCancel); // Cancel variable can make state downgrade @@ -762,8 +762,8 @@ VariableController::VariableControllerPrivate::findVariable(QUuid vIdentifier) std::shared_ptr VariableController::VariableControllerPrivate::retrieveDataSeries( const QVector acqDataPacketVector) { - qCDebug(LOG_VariableController()) << tr("TORM: retrieveDataSeries acqDataPacketVector size") - << acqDataPacketVector.size(); + qCDebug(LOG_VariableController()) + << tr("TORM: retrieveDataSeries acqDataPacketVector size") << acqDataPacketVector.size(); std::shared_ptr dataSeries; if (!acqDataPacketVector.isEmpty()) { dataSeries = acqDataPacketVector[0].m_DateSeries; @@ -780,8 +780,8 @@ void VariableController::VariableControllerPrivate::registerProvider( std::shared_ptr provider) { if (m_ProviderSet.find(provider) == m_ProviderSet.end()) { - qCDebug(LOG_VariableController()) << tr("Registering of a new provider") - << provider->objectName(); + qCDebug(LOG_VariableController()) + << tr("Registering of a new provider") << provider->objectName(); m_ProviderSet.insert(provider); connect(provider.get(), &IDataProvider::dataProvided, m_VariableAcquisitionWorker.get(), &VariableAcquisitionWorker::onVariableDataAcquired); @@ -816,8 +816,8 @@ QUuid VariableController::VariableControllerPrivate::acceptVariableRequest( // Element traité, on a déjà toutes les données necessaires auto varGroupId = varHandler->m_RunningVarRequest.m_VariableGroupId; - qCDebug(LOG_VariableController()) << "Variable::acceptVariableRequest" << varGroupId - << m_VarGroupIdToVarIds.size(); + qCDebug(LOG_VariableController()) + << "Variable::acceptVariableRequest" << varGroupId << m_VarGroupIdToVarIds.size(); return varHandler->m_RunningVarRequest.m_VariableGroupId; } @@ -837,8 +837,8 @@ void VariableController::VariableControllerPrivate::updateVariables(QUuid varReq auto &varIds = varGroupIdToVarIdsIt->second; auto varIdsEnd = varIds.end(); bool processVariableUpdate = true; - qCDebug(LOG_VariableController()) << "VariableControllerPrivate::updateVariables" - << varRequestId << varIds.size(); + qCDebug(LOG_VariableController()) + << "VariableControllerPrivate::updateVariables" << varRequestId << varIds.size(); for (auto varIdsIt = varIds.begin(); (varIdsIt != varIdsEnd) && processVariableUpdate; ++varIdsIt) { auto itVarHandler = m_VarIdToVarRequestHandler.find(*varIdsIt); @@ -856,15 +856,15 @@ void VariableController::VariableControllerPrivate::updateVariables(QUuid varReq auto &varRequest = itVarHandler->second->m_RunningVarRequest; var->setRange(varRequest.m_RangeRequested); var->setCacheRange(varRequest.m_CacheRangeRequested); - qCDebug(LOG_VariableController()) << tr("1: onDataProvided") - << varRequest.m_RangeRequested - << varRequest.m_CacheRangeRequested; - qCDebug(LOG_VariableController()) << tr("2: onDataProvided var points before") - << var->nbPoints() - << varRequest.m_DataSeries->nbPoints(); + qCDebug(LOG_VariableController()) + << tr("1: onDataProvided") << varRequest.m_RangeRequested + << varRequest.m_CacheRangeRequested; + qCDebug(LOG_VariableController()) + << tr("2: onDataProvided var points before") << var->nbPoints() + << varRequest.m_DataSeries->nbPoints(); var->mergeDataSeries(varRequest.m_DataSeries); - qCDebug(LOG_VariableController()) << tr("3: onDataProvided var points after") - << var->nbPoints(); + qCDebug(LOG_VariableController()) + << tr("3: onDataProvided var points after") << var->nbPoints(); emit var->updated(); qCDebug(LOG_VariableController()) << tr("Update OK"); diff --git a/core/src/Visualization/VisualizationController.cpp b/core/src/Visualization/VisualizationController.cpp index 0f4d9fd..e6c5e98 100644 --- a/core/src/Visualization/VisualizationController.cpp +++ b/core/src/Visualization/VisualizationController.cpp @@ -18,21 +18,21 @@ public: VisualizationController::VisualizationController(QObject *parent) : impl{spimpl::make_unique_impl()} { - qCDebug(LOG_VisualizationController()) << tr("VisualizationController construction") - << QThread::currentThread(); + qCDebug(LOG_VisualizationController()) + << tr("VisualizationController construction") << QThread::currentThread(); } VisualizationController::~VisualizationController() { - qCDebug(LOG_VisualizationController()) << tr("VisualizationController destruction") - << QThread::currentThread(); + qCDebug(LOG_VisualizationController()) + << tr("VisualizationController destruction") << QThread::currentThread(); this->waitForFinish(); } void VisualizationController::initialize() { - qCDebug(LOG_VisualizationController()) << tr("VisualizationController init") - << QThread::currentThread(); + qCDebug(LOG_VisualizationController()) + << tr("VisualizationController init") << QThread::currentThread(); impl->m_WorkingMutex.lock(); qCDebug(LOG_VisualizationController()) << tr("VisualizationController init END"); } diff --git a/core/tests/Data/TestDataSeries.cpp b/core/tests/Data/TestDataSeries.cpp index 15a9f10..e1d4c4c 100644 --- a/core/tests/Data/TestDataSeries.cpp +++ b/core/tests/Data/TestDataSeries.cpp @@ -652,8 +652,8 @@ void TestDataSeries::testValuesBoundsScalar_data() QTest::newRow("scalarBounds4") << createScalarSeries({1., 2., 3., 4., 5.}, {100., 200., 300., 400., 500.}) << 5.1 << 6. << false << nan << nan; - QTest::newRow("scalarBounds5") << createScalarSeries({1.}, {100.}) << 0. << 2. << true << 100. - << 100.; + QTest::newRow("scalarBounds5") + << createScalarSeries({1.}, {100.}) << 0. << 2. << true << 100. << 100.; QTest::newRow("scalarBounds6") << createScalarSeries({}, {}) << 0. << 2. << false << nan << nan; // Tests with NaN values: NaN values are not included in min/max search diff --git a/core/tests/Data/TestTwoDimArrayData.cpp b/core/tests/Data/TestTwoDimArrayData.cpp index b608a98..14eacf4 100644 --- a/core/tests/Data/TestTwoDimArrayData.cpp +++ b/core/tests/Data/TestTwoDimArrayData.cpp @@ -81,14 +81,13 @@ void TestTwoDimArrayData::testCtor_data() QTest::addColumn("expectedData"); // expected array data (when success) // Test cases - QTest::newRow("validInput") << flatten(Container{{1., 2., 3., 4., 5.}, - {6., 7., 8., 9., 10.}, - {11., 12., 13., 14., 15.}}) - << true << Container{{1., 2., 3., 4., 5.}, - {6., 7., 8., 9., 10.}, - {11., 12., 13., 14., 15.}}; - QTest::newRow("invalidInput (invalid data size") << InputData{{1., 2., 3., 4., 5., 6., 7.}, 3} - << false << Container{{}, {}, {}}; + QTest::newRow("validInput") + << flatten( + Container{{1., 2., 3., 4., 5.}, {6., 7., 8., 9., 10.}, {11., 12., 13., 14., 15.}}) + << true + << Container{{1., 2., 3., 4., 5.}, {6., 7., 8., 9., 10.}, {11., 12., 13., 14., 15.}}; + QTest::newRow("invalidInput (invalid data size") + << InputData{{1., 2., 3., 4., 5., 6., 7.}, 3} << false << Container{{}, {}, {}}; QTest::newRow("invalidInput (less than two components") << flatten(Container{{1., 2., 3., 4., 5.}}) << false << Container{{}, {}, {}}; } diff --git a/core/tests/Variable/TestVariableSync.cpp b/core/tests/Variable/TestVariableSync.cpp index 9cd53d6..9e0e4f8 100644 --- a/core/tests/Variable/TestVariableSync.cpp +++ b/core/tests/Variable/TestVariableSync.cpp @@ -398,10 +398,10 @@ void testSyncOnVarCase1() // Go back to initial range moveOp(initialRange, initialRange, 300); - QTest::newRow("syncOnVarCase1") << syncId << initialRange << std::move(creations) - << std::move(iterations); -} + QTest::newRow("syncOnVarCase1") + << syncId << initialRange << std::move(creations) << std::move(iterations); } +} // namespace void TestVariableSync::testSync_data() { diff --git a/gui/include/DataSource/DataSourceWidget.h b/gui/include/DataSource/DataSourceWidget.h index 615adfd..d384750 100644 --- a/gui/include/DataSource/DataSourceWidget.h +++ b/gui/include/DataSource/DataSourceWidget.h @@ -5,7 +5,7 @@ namespace Ui { class DataSourceWidget; -} // Ui +} // namespace Ui class DataSourceItem; diff --git a/gui/include/Settings/SqpSettingsDialog.h b/gui/include/Settings/SqpSettingsDialog.h index a08b477..7e0a682 100644 --- a/gui/include/Settings/SqpSettingsDialog.h +++ b/gui/include/Settings/SqpSettingsDialog.h @@ -7,7 +7,7 @@ namespace Ui { class SqpSettingsDialog; -} // Ui +} // namespace Ui /** * @brief The SqpSettingsDialog class represents the dialog in which the parameters of SciQlop are diff --git a/gui/include/Settings/SqpSettingsGeneralWidget.h b/gui/include/Settings/SqpSettingsGeneralWidget.h index 02f3f96..124fbcd 100644 --- a/gui/include/Settings/SqpSettingsGeneralWidget.h +++ b/gui/include/Settings/SqpSettingsGeneralWidget.h @@ -7,7 +7,7 @@ namespace Ui { class SqpSettingsGeneralWidget; -} // Ui +} // namespace Ui /** * @brief The SqpSettingsGeneralWidget class represents the general settings of SciQlop diff --git a/gui/include/SidePane/SqpSidePane.h b/gui/include/SidePane/SqpSidePane.h index 9e0b6fb..a4db1b1 100644 --- a/gui/include/SidePane/SqpSidePane.h +++ b/gui/include/SidePane/SqpSidePane.h @@ -5,7 +5,7 @@ namespace Ui { class SqpSidePane; -} // Ui +} // namespace Ui class QToolBar; diff --git a/gui/include/TimeWidget/TimeWidget.h b/gui/include/TimeWidget/TimeWidget.h index 575ebd7..82e4341 100644 --- a/gui/include/TimeWidget/TimeWidget.h +++ b/gui/include/TimeWidget/TimeWidget.h @@ -7,7 +7,7 @@ namespace Ui { class TimeWidget; -} // Ui +} // namespace Ui class TimeWidget : public QWidget { Q_OBJECT diff --git a/gui/include/Variable/RenameVariableDialog.h b/gui/include/Variable/RenameVariableDialog.h index 5098cd6..3d434ff 100644 --- a/gui/include/Variable/RenameVariableDialog.h +++ b/gui/include/Variable/RenameVariableDialog.h @@ -5,7 +5,7 @@ namespace Ui { class RenameVariableDialog; -} // Ui +} // namespace Ui /** * @brief The RenameVariableDialog class represents the dialog to rename a variable diff --git a/gui/include/Variable/VariableInspectorWidget.h b/gui/include/Variable/VariableInspectorWidget.h index f8e249c..b6a2b19 100644 --- a/gui/include/Variable/VariableInspectorWidget.h +++ b/gui/include/Variable/VariableInspectorWidget.h @@ -15,7 +15,7 @@ class QProgressBarItemDelegate; namespace Ui { class VariableInspectorWidget; -} // Ui +} // namespace Ui /** * @brief The VariableInspectorWidget class representes represents the variable inspector, from diff --git a/gui/include/Variable/VariableMenuHeaderWidget.h b/gui/include/Variable/VariableMenuHeaderWidget.h index 009b0c5..b4d150c 100644 --- a/gui/include/Variable/VariableMenuHeaderWidget.h +++ b/gui/include/Variable/VariableMenuHeaderWidget.h @@ -8,7 +8,7 @@ namespace Ui { class VariableMenuHeaderWidget; -} // Ui +} // namespace Ui class Variable; diff --git a/gui/include/Visualization/qcustomplot.h b/gui/include/Visualization/qcustomplot.h index 2e2e6e7..af54bfd 100644 --- a/gui/include/Visualization/qcustomplot.h +++ b/gui/include/Visualization/qcustomplot.h @@ -5423,11 +5423,11 @@ protected: bool mGradientImageInvalidated; // re-using some methods of QCPAxisRect to make them available to friend class QCPColorScale using QCPAxisRect::calculateAutoMargin; - using QCPAxisRect::mousePressEvent; using QCPAxisRect::mouseMoveEvent; + using QCPAxisRect::mousePressEvent; using QCPAxisRect::mouseReleaseEvent; - using QCPAxisRect::wheelEvent; using QCPAxisRect::update; + using QCPAxisRect::wheelEvent; virtual void draw(QCPPainter *painter) Q_DECL_OVERRIDE; void updateGradientImage(); Q_SLOT void axisSelectionChanged(QCPAxis::SelectableParts selectedParts); diff --git a/gui/src/DragDropHelper.cpp b/gui/src/DragDropHelper.cpp index 7e91e83..5e720e8 100644 --- a/gui/src/DragDropHelper.cpp +++ b/gui/src/DragDropHelper.cpp @@ -176,9 +176,7 @@ struct DragDropHelper::DragDropHelperPrivate { }; -DragDropHelper::DragDropHelper() : impl{spimpl::make_unique_impl()} -{ -} +DragDropHelper::DragDropHelper() : impl{spimpl::make_unique_impl()} {} DragDropHelper::~DragDropHelper() { diff --git a/gui/src/SqpApplication.cpp b/gui/src/SqpApplication.cpp index 09ee43b..7eaec69 100644 --- a/gui/src/SqpApplication.cpp +++ b/gui/src/SqpApplication.cpp @@ -120,13 +120,9 @@ SqpApplication::SqpApplication(int &argc, char **argv) impl->m_VisualizationControllerThread.start(); } -SqpApplication::~SqpApplication() -{ -} +SqpApplication::~SqpApplication() {} -void SqpApplication::initialize() -{ -} +void SqpApplication::initialize() {} DataSourceController &SqpApplication::dataSourceController() noexcept { diff --git a/gui/src/Visualization/VisualizationGraphWidget.cpp b/gui/src/Visualization/VisualizationGraphWidget.cpp index 5956f76..3de472c 100644 --- a/gui/src/Visualization/VisualizationGraphWidget.cpp +++ b/gui/src/Visualization/VisualizationGraphWidget.cpp @@ -73,9 +73,10 @@ VisualizationGraphWidget::VisualizationGraphWidget(const QString &name, QWidget &VisualizationGraphWidget::onMouseRelease); connect(ui->widget, &QCustomPlot::mouseMove, this, &VisualizationGraphWidget::onMouseMove); connect(ui->widget, &QCustomPlot::mouseWheel, this, &VisualizationGraphWidget::onMouseWheel); - connect(ui->widget->xAxis, static_cast( - &QCPAxis::rangeChanged), - this, &VisualizationGraphWidget::onRangeChanged, Qt::DirectConnection); + connect( + ui->widget->xAxis, + static_cast(&QCPAxis::rangeChanged), + this, &VisualizationGraphWidget::onRangeChanged, Qt::DirectConnection); // Activates menu when right clicking on the graph ui->widget->setContextMenuPolicy(Qt::CustomContextMenu); @@ -290,9 +291,9 @@ void VisualizationGraphWidget::onGraphMenuRequested(const QPoint &pos) noexcept void VisualizationGraphWidget::onRangeChanged(const QCPRange &t1, const QCPRange &t2) { - qCDebug(LOG_VisualizationGraphWidget()) << tr("TORM: VisualizationGraphWidget::onRangeChanged") - << QThread::currentThread()->objectName() << "DoAcqui" - << impl->m_DoAcquisition; + qCDebug(LOG_VisualizationGraphWidget()) + << tr("TORM: VisualizationGraphWidget::onRangeChanged") + << QThread::currentThread()->objectName() << "DoAcqui" << impl->m_DoAcquisition; auto graphRange = SqpRange{t1.lower, t1.upper}; auto oldGraphRange = SqpRange{t2.lower, t2.upper}; diff --git a/gui/src/Visualization/VisualizationZoneWidget.cpp b/gui/src/Visualization/VisualizationZoneWidget.cpp index ec39bdd..ae8f9d8 100644 --- a/gui/src/Visualization/VisualizationZoneWidget.cpp +++ b/gui/src/Visualization/VisualizationZoneWidget.cpp @@ -160,10 +160,10 @@ VisualizationGraphWidget *VisualizationZoneWidget::createGraph(std::shared_ptrenableAcquisition(false); - qCDebug(LOG_VisualizationZoneWidget()) << tr("TORM: Range before: ") - << graphChild->graphRange(); - qCDebug(LOG_VisualizationZoneWidget()) << tr("TORM: Range after : ") - << graphChildRange; + qCDebug(LOG_VisualizationZoneWidget()) + << tr("TORM: Range before: ") << graphChild->graphRange(); + qCDebug(LOG_VisualizationZoneWidget()) + << tr("TORM: Range after : ") << graphChildRange; qCDebug(LOG_VisualizationZoneWidget()) << tr("TORM: child dt") << graphChildRange.m_TEnd - graphChildRange.m_TStart; graphChild->setGraphRange(graphChildRange); diff --git a/gui/src/Visualization/qcustomplot.cpp b/gui/src/Visualization/qcustomplot.cpp index 5be83c0..3cc5dc4 100644 --- a/gui/src/Visualization/qcustomplot.cpp +++ b/gui/src/Visualization/qcustomplot.cpp @@ -108,33 +108,25 @@ /*! Creates a QCPVector2D object and initializes the x and y coordinates to 0. */ -QCPVector2D::QCPVector2D() : mX(0), mY(0) -{ -} +QCPVector2D::QCPVector2D() : mX(0), mY(0) {} /*! Creates a QCPVector2D object and initializes the \a x and \a y coordinates with the specified values. */ -QCPVector2D::QCPVector2D(double x, double y) : mX(x), mY(y) -{ -} +QCPVector2D::QCPVector2D(double x, double y) : mX(x), mY(y) {} /*! Creates a QCPVector2D object and initializes the x and y coordinates respective coordinates of the specified \a point. */ -QCPVector2D::QCPVector2D(const QPoint &point) : mX(point.x()), mY(point.y()) -{ -} +QCPVector2D::QCPVector2D(const QPoint &point) : mX(point.x()), mY(point.y()) {} /*! Creates a QCPVector2D object and initializes the x and y coordinates respective coordinates of the specified \a point. */ -QCPVector2D::QCPVector2D(const QPointF &point) : mX(point.x()), mY(point.y()) -{ -} +QCPVector2D::QCPVector2D(const QPointF &point) : mX(point.x()), mY(point.y()) {} /*! Normalizes this vector. After this operation, the length of the vector is equal to 1. @@ -565,9 +557,7 @@ QCPAbstractPaintBuffer::QCPAbstractPaintBuffer(const QSize &size, double deviceP { } -QCPAbstractPaintBuffer::~QCPAbstractPaintBuffer() -{ -} +QCPAbstractPaintBuffer::~QCPAbstractPaintBuffer() {} /*! Sets the paint buffer size. @@ -648,9 +638,7 @@ QCPPaintBufferPixmap::QCPPaintBufferPixmap(const QSize &size, double devicePixel QCPPaintBufferPixmap::reallocateBuffer(); } -QCPPaintBufferPixmap::~QCPPaintBufferPixmap() -{ -} +QCPPaintBufferPixmap::~QCPPaintBufferPixmap() {} /* inherits documentation from base class */ QCPPainter *QCPPaintBufferPixmap::startPainting() @@ -1049,8 +1037,9 @@ QCPLayer::~QCPLayer() mChildren.last()->setLayer(0); // removes itself from mChildren via removeChild() if (mParentPlot->currentLayer() == this) - qDebug() << Q_FUNC_INFO << "The parent plot's mCurrentLayer will be a dangling pointer. " - "Should have been set to a valid layer or 0 beforehand."; + qDebug() << Q_FUNC_INFO + << "The parent plot's mCurrentLayer will be a dangling pointer. " + "Should have been set to a valid layer or 0 beforehand."; } /*! @@ -1574,10 +1563,7 @@ void QCPLayerable::applyAntialiasingHint(QCPPainter *painter, bool localAntialia \see initializeParentPlot */ -void QCPLayerable::parentPlotInitialized(QCustomPlot *parentPlot) -{ - Q_UNUSED(parentPlot) -} +void QCPLayerable::parentPlotInitialized(QCustomPlot *parentPlot){Q_UNUSED(parentPlot)} /*! \internal @@ -1878,9 +1864,7 @@ const double QCPRange::maxRange = 1e250; /*! Constructs a range with \a lower and \a upper set to zero. */ -QCPRange::QCPRange() : lower(0), upper(0) -{ -} +QCPRange::QCPRange() : lower(0), upper(0) {} /*! \overload @@ -2200,18 +2184,14 @@ bool QCPRange::validRange(const QCPRange &range) /*! Creates an empty QCPDataRange, with begin and end set to 0. */ -QCPDataRange::QCPDataRange() : mBegin(0), mEnd(0) -{ -} +QCPDataRange::QCPDataRange() : mBegin(0), mEnd(0) {} /*! Creates a QCPDataRange, initialized with the specified \a begin and \a end. No checks or corrections are made to ensure the resulting range is valid (\ref isValid). */ -QCPDataRange::QCPDataRange(int begin, int end) : mBegin(begin), mEnd(end) -{ -} +QCPDataRange::QCPDataRange(int begin, int end) : mBegin(begin), mEnd(end) {} /*! Returns a data range that matches this data range, except that parts exceeding \a other are @@ -2354,9 +2334,7 @@ bool QCPDataRange::contains(const QCPDataRange &other) const /*! Creates an empty QCPDataSelection. */ -QCPDataSelection::QCPDataSelection() -{ -} +QCPDataSelection::QCPDataSelection() {} /*! Creates a QCPDataSelection containing the provided \a range. @@ -3486,9 +3464,7 @@ int QCPLayoutElement::calculateAutoMargin(QCP::MarginSide side) The default implementation does nothing. */ -void QCPLayoutElement::layoutChanged() -{ -} +void QCPLayoutElement::layoutChanged() {} //////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////// QCPLayout @@ -3567,9 +3543,7 @@ void QCPLayoutElement::layoutChanged() Creates an instance of QCPLayout and sets default values. Note that since QCPLayout is an abstract base class, it can't be instantiated directly. */ -QCPLayout::QCPLayout() -{ -} +QCPLayout::QCPLayout() {} /*! If \a phase is \ref upLayout, calls \ref updateLayout, which subclasses may reimplement to @@ -3622,9 +3596,7 @@ QList QCPLayout::elements(bool recursive) const Not all layouts need simplification. For example, QCPLayoutInset doesn't use explicit simplification while QCPLayoutGrid does. */ -void QCPLayout::simplify() -{ -} +void QCPLayout::simplify() {} /*! Removes and deletes the element at the provided \a index. Returns true on success. If \a index is @@ -3712,9 +3684,7 @@ void QCPLayout::sizeConstraintsChanged() const \see update */ -void QCPLayout::updateLayout() -{ -} +void QCPLayout::updateLayout() {} /*! \internal @@ -4724,9 +4694,7 @@ void QCPLayoutGrid::getMaximumRowColSizes(QVector *maxColWidths, /*! Creates an instance of QCPLayoutInset and sets default values. */ -QCPLayoutInset::QCPLayoutInset() -{ -} +QCPLayoutInset::QCPLayoutInset() {} QCPLayoutInset::~QCPLayoutInset() { @@ -5041,9 +5009,7 @@ void QCPLayoutInset::addElement(QCPLayoutElement *element, const QRectF &rect) /*! Creates a QCPLineEnding instance with default values (style \ref esNone). */ -QCPLineEnding::QCPLineEnding() : mStyle(esNone), mWidth(8), mLength(10), mInverted(false) -{ -} +QCPLineEnding::QCPLineEnding() : mStyle(esNone), mWidth(8), mLength(10), mInverted(false) {} /*! Creates a QCPLineEnding instance with the specified values. @@ -5359,13 +5325,9 @@ void QCPLineEnding::draw(QCPPainter *painter, const QCPVector2D &pos, double ang Constructs the ticker and sets reasonable default values. Axis tickers are commonly created managed by a QSharedPointer, which then can be passed to QCPAxis::setTicker. */ -QCPAxisTicker::QCPAxisTicker() : mTickStepStrategy(tssReadability), mTickCount(5), mTickOrigin(0) -{ -} +QCPAxisTicker::QCPAxisTicker() : mTickStepStrategy(tssReadability), mTickCount(5), mTickOrigin(0) {} -QCPAxisTicker::~QCPAxisTicker() -{ -} +QCPAxisTicker::~QCPAxisTicker() {} /*! Sets which strategy the axis ticker follows when choosing the size of the tick step. For the @@ -6424,9 +6386,7 @@ void QCPAxisTickerTime::replaceUnit(QString &text, QCPAxisTickerTime::TimeUnit u Constructs the ticker and sets reasonable default values. Axis tickers are commonly created managed by a QSharedPointer, which then can be passed to QCPAxis::setTicker. */ -QCPAxisTickerFixed::QCPAxisTickerFixed() : mTickStep(1.0), mScaleStrategy(ssNone) -{ -} +QCPAxisTickerFixed::QCPAxisTickerFixed() : mTickStep(1.0), mScaleStrategy(ssNone) {} /*! Sets the fixed tick interval to \a step. @@ -6539,9 +6499,7 @@ double QCPAxisTickerFixed::getTickStep(const QCPRange &range) Constructs the ticker and sets reasonable default values. Axis tickers are commonly created managed by a QSharedPointer, which then can be passed to QCPAxis::setTicker. */ -QCPAxisTickerText::QCPAxisTickerText() : mSubTickCount(0) -{ -} +QCPAxisTickerText::QCPAxisTickerText() : mSubTickCount(0) {} /*! \overload @@ -8496,8 +8454,9 @@ void QCPAxis::scaleRange(double factor, double center) mRange = newRange.sanitizedForLogScale(); } else - qDebug() << Q_FUNC_INFO << "Center of scaling operation doesn't lie in same " - "logarithmic sign domain as range:" + qDebug() << Q_FUNC_INFO + << "Center of scaling operation doesn't lie in same " + "logarithmic sign domain as range:" << center; } emit rangeChanged(mRange); @@ -9283,9 +9242,7 @@ QCPAxisPainterPrivate::QCPAxisPainterPrivate(QCustomPlot *parentPlot) { } -QCPAxisPainterPrivate::~QCPAxisPainterPrivate() -{ -} +QCPAxisPainterPrivate::~QCPAxisPainterPrivate() {} /*! \internal @@ -9394,14 +9351,16 @@ void QCPAxisPainterPrivate::draw(QCPPainter *painter) painter->setBrush(QBrush(basePen.color())); QCPVector2D baseLineVector(baseLine.dx(), baseLine.dy()); if (lowerEnding.style() != QCPLineEnding::esNone) - lowerEnding.draw(painter, QCPVector2D(baseLine.p1()) - - baseLineVector.normalized() * lowerEnding.realLength() - * (lowerEnding.inverted() ? -1 : 1), + lowerEnding.draw(painter, + QCPVector2D(baseLine.p1()) + - baseLineVector.normalized() * lowerEnding.realLength() + * (lowerEnding.inverted() ? -1 : 1), -baseLineVector); if (upperEnding.style() != QCPLineEnding::esNone) - upperEnding.draw(painter, QCPVector2D(baseLine.p2()) - + baseLineVector.normalized() * upperEnding.realLength() - * (upperEnding.inverted() ? -1 : 1), + upperEnding.draw(painter, + QCPVector2D(baseLine.p2()) + + baseLineVector.normalized() * upperEnding.realLength() + * (upperEnding.inverted() ? -1 : 1), baseLineVector); painter->setAntialiasing(antialiasingBackup); @@ -9710,14 +9669,16 @@ void QCPAxisPainterPrivate::placeTickLabel(QCPPainter *painter, double position, bool labelClippedByBorder = false; if (tickLabelSide == QCPAxis::lsOutside) { if (QCPAxis::orientation(type) == Qt::Horizontal) - labelClippedByBorder = finalPosition.x() + (labelData.rotatedTotalBounds.width() - + labelData.rotatedTotalBounds.left()) + labelClippedByBorder = finalPosition.x() + + (labelData.rotatedTotalBounds.width() + + labelData.rotatedTotalBounds.left()) > viewportRect.right() || finalPosition.x() + labelData.rotatedTotalBounds.left() < viewportRect.left(); else - labelClippedByBorder = finalPosition.y() + (labelData.rotatedTotalBounds.height() - + labelData.rotatedTotalBounds.top()) + labelClippedByBorder = finalPosition.y() + + (labelData.rotatedTotalBounds.height() + + labelData.rotatedTotalBounds.top()) > viewportRect.bottom() || finalPosition.y() + labelData.rotatedTotalBounds.top() < viewportRect.top(); @@ -10521,9 +10482,7 @@ QCPSelectionDecorator::QCPSelectionDecorator() { } -QCPSelectionDecorator::~QCPSelectionDecorator() -{ -} +QCPSelectionDecorator::~QCPSelectionDecorator() {} /*! Sets the pen that will be used by the parent plottable to draw selected data segments. @@ -12669,8 +12628,9 @@ double QCPAbstractItem::rectDistance(const QRectF &rect, const QPointF &pos, boo */ QPointF QCPAbstractItem::anchorPixelPosition(int anchorId) const { - qDebug() << Q_FUNC_INFO << "called on item which shouldn't have any anchors (this method not " - "reimplemented). anchorId" + qDebug() << Q_FUNC_INFO + << "called on item which shouldn't have any anchors (this method not " + "reimplemented). anchorId" << anchorId; return QPointF(); } @@ -13605,9 +13565,10 @@ void QCustomPlot::setOpenGl(bool enabled, int multisampling) setupPaintBuffers(); #else Q_UNUSED(enabled) - qDebug() << Q_FUNC_INFO << "QCustomPlot can't use OpenGL because QCUSTOMPLOT_USE_OPENGL was " - "not defined during compilation (add 'DEFINES += " - "QCUSTOMPLOT_USE_OPENGL' to your qmake .pro file)"; + qDebug() << Q_FUNC_INFO + << "QCustomPlot can't use OpenGL because QCUSTOMPLOT_USE_OPENGL was " + "not defined during compilation (add 'DEFINES += " + "QCUSTOMPLOT_USE_OPENGL' to your qmake .pro file)"; #endif } @@ -13964,8 +13925,9 @@ QCPGraph *QCustomPlot::addGraph(QCPAxis *keyAxis, QCPAxis *valueAxis) if (!valueAxis) valueAxis = yAxis; if (!keyAxis || !valueAxis) { - qDebug() << Q_FUNC_INFO << "can't use default QCustomPlot xAxis or yAxis, because at least " - "one is invalid (has been deleted)"; + qDebug() << Q_FUNC_INFO + << "can't use default QCustomPlot xAxis or yAxis, because at least " + "one is invalid (has been deleted)"; return 0; } if (keyAxis->parentPlot() != this || valueAxis->parentPlot() != this) { @@ -15398,8 +15360,9 @@ QCPAbstractPaintBuffer *QCustomPlot::createPaintBuffer() return new QCPPaintBufferGlPbuffer(viewport().size(), mBufferDevicePixelRatio, mOpenGlMultisamples); #else - qDebug() << Q_FUNC_INFO << "OpenGL enabled even though no support for it compiled in, this " - "shouldn't have happened. Falling back to pixmap paint buffer."; + qDebug() << Q_FUNC_INFO + << "OpenGL enabled even though no support for it compiled in, this " + "shouldn't have happened. Falling back to pixmap paint buffer."; return new QCPPaintBufferPixmap(viewport().size(), mBufferDevicePixelRatio); #endif } @@ -16630,8 +16593,9 @@ void QCPColorGradient::updateColorBuffer() hue -= 1.0; if (useAlpha) { const QRgb rgb - = QColor::fromHsvF(hue, (1 - t) * lowHsv.saturationF() - + t * highHsv.saturationF(), + = QColor::fromHsvF(hue, + (1 - t) * lowHsv.saturationF() + + t * highHsv.saturationF(), (1 - t) * lowHsv.valueF() + t * highHsv.valueF()) .rgb(); const float alpha = (1 - t) * lowHsv.alphaF() + t * highHsv.alphaF(); @@ -16640,8 +16604,9 @@ void QCPColorGradient::updateColorBuffer() } else { mColorBuffer[i] - = QColor::fromHsvF(hue, (1 - t) * lowHsv.saturationF() - + t * highHsv.saturationF(), + = QColor::fromHsvF(hue, + (1 - t) * lowHsv.saturationF() + + t * highHsv.saturationF(), (1 - t) * lowHsv.valueF() + t * highHsv.valueF()) .rgb(); } @@ -16703,9 +16668,7 @@ QCPSelectionDecoratorBracket::QCPSelectionDecoratorBracket() { } -QCPSelectionDecoratorBracket::~QCPSelectionDecoratorBracket() -{ -} +QCPSelectionDecoratorBracket::~QCPSelectionDecoratorBracket() {} /*! Sets the pen that will be used to draw the brackets at the beginning and end of each selected @@ -18734,7 +18697,7 @@ void QCPLegend::setIconSize(const QSize &size) } /*! \overload -*/ + */ void QCPLegend::setIconSize(int width, int height) { mIconSize.setWidth(width); @@ -20338,16 +20301,12 @@ void QCPColorScaleAxisRectPrivate::axisSelectableChanged(QCPAxis::SelectablePart /*! Constructs a data point with key and value set to zero. */ -QCPGraphData::QCPGraphData() : key(0), value(0) -{ -} +QCPGraphData::QCPGraphData() : key(0), value(0) {} /*! Constructs a data point with the specified \a key and \a value. */ -QCPGraphData::QCPGraphData(double key, double value) : key(key), value(value) -{ -} +QCPGraphData::QCPGraphData(double key, double value) : key(key), value(value) {} //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -20432,9 +20391,7 @@ QCPGraph::QCPGraph(QCPAxis *keyAxis, QCPAxis *valueAxis) setAdaptiveSampling(true); } -QCPGraph::~QCPGraph() -{ -} +QCPGraph::~QCPGraph() {} /*! \overload @@ -22291,16 +22248,12 @@ int QCPGraph::findIndexBelowY(const QVector *data, double y) const /*! Constructs a curve data point with t, key and value set to zero. */ -QCPCurveData::QCPCurveData() : t(0), key(0), value(0) -{ -} +QCPCurveData::QCPCurveData() : t(0), key(0), value(0) {} /*! Constructs a curve data point with the specified \a t, \a key and \a value. */ -QCPCurveData::QCPCurveData(double t, double key, double value) : t(t), key(key), value(value) -{ -} +QCPCurveData::QCPCurveData(double t, double key, double value) : t(t), key(key), value(value) {} //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -22379,9 +22332,7 @@ QCPCurve::QCPCurve(QCPAxis *keyAxis, QCPAxis *valueAxis) setScatterSkip(0); } -QCPCurve::~QCPCurve() -{ -} +QCPCurve::~QCPCurve() {} /*! \overload @@ -24461,16 +24412,12 @@ double QCPBarsGroup::getPixelSpacing(const QCPBars *bars, double keyCoord) /*! Constructs a bar data point with key and value set to zero. */ -QCPBarsData::QCPBarsData() : key(0), value(0) -{ -} +QCPBarsData::QCPBarsData() : key(0), value(0) {} /*! Constructs a bar data point with the specified \a key and \a value. */ -QCPBarsData::QCPBarsData(double key, double value) : key(key), value(value) -{ -} +QCPBarsData::QCPBarsData(double key, double value) : key(key), value(value) {} //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -27239,9 +27186,7 @@ void QCPColorMap::drawLegendIcon(QCPPainter *painter, const QRectF &rect) const /*! Constructs a data point with key and all values set to zero. */ -QCPFinancialData::QCPFinancialData() : key(0), open(0), high(0), low(0), close(0) -{ -} +QCPFinancialData::QCPFinancialData() : key(0), open(0), high(0), low(0), close(0) {} /*! Constructs a data point with the specified \a key and OHLC values. @@ -27343,9 +27288,7 @@ QCPFinancial::QCPFinancial(QCPAxis *keyAxis, QCPAxis *valueAxis) mSelectionDecorator->setBrush(QBrush(QColor(160, 160, 255))); } -QCPFinancial::~QCPFinancial() -{ -} +QCPFinancial::~QCPFinancial() {} /*! \overload @@ -28240,16 +28183,12 @@ QRectF QCPFinancial::selectionHitBox(QCPFinancialDataContainer::const_iterator i /*! Constructs an error bar with errors set to zero. */ -QCPErrorBarsData::QCPErrorBarsData() : errorMinus(0), errorPlus(0) -{ -} +QCPErrorBarsData::QCPErrorBarsData() : errorMinus(0), errorPlus(0) {} /*! Constructs an error bar with equal \a error in both negative and positive direction. */ -QCPErrorBarsData::QCPErrorBarsData(double error) : errorMinus(error), errorPlus(error) -{ -} +QCPErrorBarsData::QCPErrorBarsData(double error) : errorMinus(error), errorPlus(error) {} /*! Constructs an error bar with negative and positive errors set to \a errorMinus and \a errorPlus, @@ -28331,9 +28270,7 @@ QCPErrorBars::QCPErrorBars(QCPAxis *keyAxis, QCPAxis *valueAxis) setBrush(Qt::NoBrush); } -QCPErrorBars::~QCPErrorBars() -{ -} +QCPErrorBars::~QCPErrorBars() {} /*! \overload @@ -29228,9 +29165,7 @@ QCPItemStraightLine::QCPItemStraightLine(QCustomPlot *parentPlot) setSelectedPen(QPen(Qt::blue, 2)); } -QCPItemStraightLine::~QCPItemStraightLine() -{ -} +QCPItemStraightLine::~QCPItemStraightLine() {} /*! Sets the pen that will be used to draw the line @@ -29419,9 +29354,7 @@ QCPItemLine::QCPItemLine(QCustomPlot *parentPlot) setSelectedPen(QPen(Qt::blue, 2)); } -QCPItemLine::~QCPItemLine() -{ -} +QCPItemLine::~QCPItemLine() {} /*! Sets the pen that will be used to draw the line @@ -29657,9 +29590,7 @@ QCPItemCurve::QCPItemCurve(QCustomPlot *parentPlot) setSelectedPen(QPen(Qt::blue, 2)); } -QCPItemCurve::~QCPItemCurve() -{ -} +QCPItemCurve::~QCPItemCurve() {} /*! Sets the pen that will be used to draw the line @@ -29817,9 +29748,7 @@ QCPItemRect::QCPItemRect(QCustomPlot *parentPlot) setSelectedBrush(Qt::NoBrush); } -QCPItemRect::~QCPItemRect() -{ -} +QCPItemRect::~QCPItemRect() {} /*! Sets the pen that will be used to draw the line of the rectangle @@ -29993,9 +29922,7 @@ QCPItemText::QCPItemText(QCustomPlot *parentPlot) setSelectedColor(Qt::blue); } -QCPItemText::~QCPItemText() -{ -} +QCPItemText::~QCPItemText() {} /*! Sets the color of the text. @@ -30351,9 +30278,7 @@ QCPItemEllipse::QCPItemEllipse(QCustomPlot *parentPlot) setSelectedBrush(Qt::NoBrush); } -QCPItemEllipse::~QCPItemEllipse() -{ -} +QCPItemEllipse::~QCPItemEllipse() {} /*! Sets the pen that will be used to draw the line of the ellipse @@ -30555,9 +30480,7 @@ QCPItemPixmap::QCPItemPixmap(QCustomPlot *parentPlot) setSelectedPen(QPen(Qt::blue)); } -QCPItemPixmap::~QCPItemPixmap() -{ -} +QCPItemPixmap::~QCPItemPixmap() {} /*! Sets the pixmap that will be displayed. @@ -30841,9 +30764,7 @@ QCPItemTracer::QCPItemTracer(QCustomPlot *parentPlot) setSelectedPen(QPen(Qt::blue, 2)); } -QCPItemTracer::~QCPItemTracer() -{ -} +QCPItemTracer::~QCPItemTracer() {} /*! Sets the pen that will be used to draw the line of the tracer @@ -31197,9 +31118,7 @@ QCPItemBracket::QCPItemBracket(QCustomPlot *parentPlot) setSelectedPen(QPen(Qt::blue, 2)); } -QCPItemBracket::~QCPItemBracket() -{ -} +QCPItemBracket::~QCPItemBracket() {} /*! Sets the pen that will be used to draw the bracket. diff --git a/plugins/amda/src/AmdaProvider.cpp b/plugins/amda/src/AmdaProvider.cpp index 4ced6bb..37171a4 100644 --- a/plugins/amda/src/AmdaProvider.cpp +++ b/plugins/amda/src/AmdaProvider.cpp @@ -57,8 +57,9 @@ AmdaProvider::AmdaProvider() qCDebug(LOG_AmdaProvider()) << tr("AmdaProvider::AmdaProvider") << QThread::currentThread(); if (auto app = sqpApp) { auto &networkController = app->networkController(); - connect(this, SIGNAL(requestConstructed(std::shared_ptr, QUuid, - std::function)), + connect(this, + SIGNAL(requestConstructed(std::shared_ptr, QUuid, + std::function)), &networkController, SLOT(onProcessRequested(std::shared_ptr, QUuid, std::function))); @@ -83,8 +84,8 @@ void AmdaProvider::requestDataLoading(QUuid acqIdentifier, const DataProviderPar const auto times = parameters.m_Times; const auto data = parameters.m_Data; for (const auto &dateTime : qAsConst(times)) { - qCDebug(LOG_AmdaProvider()) << tr("TORM AmdaProvider::requestDataLoading ") << acqIdentifier - << dateTime; + qCDebug(LOG_AmdaProvider()) + << tr("TORM AmdaProvider::requestDataLoading ") << acqIdentifier << dateTime; this->retrieveData(acqIdentifier, dateTime, data); diff --git a/plugins/amda/tests/TestAmdaAcquisition.cpp b/plugins/amda/tests/TestAmdaAcquisition.cpp index ca3b239..7e8c3bf 100644 --- a/plugins/amda/tests/TestAmdaAcquisition.cpp +++ b/plugins/amda/tests/TestAmdaAcquisition.cpp @@ -57,7 +57,7 @@ bool compareDataSeries(std::shared_ptr candidate, SqpRange candidat return false; } } -} +} // namespace class TestAmdaAcquisition : public QObject { Q_OBJECT @@ -159,6 +159,6 @@ int main(int argc, char *argv[]) return QTest::qExec(&tc, argc, argv); } -// QTEST_MAIN(TestAmdaAcquisition) + // QTEST_MAIN(TestAmdaAcquisition) #include "TestAmdaAcquisition.moc" diff --git a/plugins/amda/tests/TestAmdaParser.cpp b/plugins/amda/tests/TestAmdaParser.cpp index d2779a2..e2023f9 100644 --- a/plugins/amda/tests/TestAmdaParser.cpp +++ b/plugins/amda/tests/TestAmdaParser.cpp @@ -142,14 +142,14 @@ void TestAmdaParser::testReadJson_data() QTest::newRow("Valid file") << QStringLiteral("ValidFile1.json") << validResults1(); // Invalid files - QTest::newRow("Invalid file (unexisting file)") << QStringLiteral("UnexistingFile.json") - << invalidResults(); - QTest::newRow("Invalid file (two root objects)") << QStringLiteral("TwoRootsFile.json") - << invalidResults(); - QTest::newRow("Invalid file (wrong root key)") << QStringLiteral("WrongRootKey.json") - << invalidResults(); - QTest::newRow("Invalid file (wrong root type)") << QStringLiteral("WrongRootType.json") - << invalidResults(); + QTest::newRow("Invalid file (unexisting file)") + << QStringLiteral("UnexistingFile.json") << invalidResults(); + QTest::newRow("Invalid file (two root objects)") + << QStringLiteral("TwoRootsFile.json") << invalidResults(); + QTest::newRow("Invalid file (wrong root key)") + << QStringLiteral("WrongRootKey.json") << invalidResults(); + QTest::newRow("Invalid file (wrong root type)") + << QStringLiteral("WrongRootType.json") << invalidResults(); } void TestAmdaParser::testReadJson() diff --git a/plugins/amda/tests/TestAmdaResultParser.cpp b/plugins/amda/tests/TestAmdaResultParser.cpp index e51de2b..23b5617 100644 --- a/plugins/amda/tests/TestAmdaResultParser.cpp +++ b/plugins/amda/tests/TestAmdaResultParser.cpp @@ -234,11 +234,11 @@ void TestAmdaResultParser::testReadScalarTxt_data() QVector{}, QVector{}}; // Invalid files - QTest::newRow("Invalid file (unexisting file)") << QStringLiteral("UnexistingFile.txt") - << ExpectedResults{}; + QTest::newRow("Invalid file (unexisting file)") + << QStringLiteral("UnexistingFile.txt") << ExpectedResults{}; - QTest::newRow("Invalid file (file not found on server)") << QStringLiteral("FileNotFound.txt") - << ExpectedResults{}; + QTest::newRow("Invalid file (file not found on server)") + << QStringLiteral("FileNotFound.txt") << ExpectedResults{}; } void TestAmdaResultParser::testReadScalarTxt() diff --git a/plugins/mockplugin/src/CosinusProvider.cpp b/plugins/mockplugin/src/CosinusProvider.cpp index 827f7f7..afdf53e 100644 --- a/plugins/mockplugin/src/CosinusProvider.cpp +++ b/plugins/mockplugin/src/CosinusProvider.cpp @@ -145,9 +145,9 @@ std::shared_ptr CosinusProvider::retrieveData(QUuid acqIdentifier, progress = currentProgress; emit dataProvidedProgress(acqIdentifier, progress); - qCDebug(LOG_CosinusProvider()) << "TORM: CosinusProvider::retrieveData" - << QThread::currentThread()->objectName() - << progress; + qCDebug(LOG_CosinusProvider()) + << "TORM: CosinusProvider::retrieveData" + << QThread::currentThread()->objectName() << progress; // NOTE: Try to use multithread if possible } } @@ -172,8 +172,8 @@ void CosinusProvider::requestDataLoading(QUuid acqIdentifier, { // TODO: Add Mutex m_VariableToEnableProvider[acqIdentifier] = true; - qCDebug(LOG_CosinusProvider()) << "TORM: CosinusProvider::requestDataLoading" - << QThread::currentThread()->objectName(); + qCDebug(LOG_CosinusProvider()) + << "TORM: CosinusProvider::requestDataLoading" << QThread::currentThread()->objectName(); // NOTE: Try to use multithread if possible const auto times = parameters.m_Times; diff --git a/plugins/mockplugin/tests/TestCosinusAcquisition.cpp b/plugins/mockplugin/tests/TestCosinusAcquisition.cpp index d6b4bd2..c3c8f9c 100644 --- a/plugins/mockplugin/tests/TestCosinusAcquisition.cpp +++ b/plugins/mockplugin/tests/TestCosinusAcquisition.cpp @@ -17,9 +17,9 @@ namespace { /// Path for the tests -const auto TESTS_RESOURCES_PATH = QFileInfo{ - QString{MOCKPLUGIN_TESTS_RESOURCES_DIR}, - "TestCosinusAcquisition"}.absoluteFilePath(); +const auto TESTS_RESOURCES_PATH + = QFileInfo{QString{MOCKPLUGIN_TESTS_RESOURCES_DIR}, "TestCosinusAcquisition"} + .absoluteFilePath(); /// Format of dates in data files const auto DATETIME_FORMAT = QStringLiteral("yyyy/MM/dd hh:mm:ss:zzz");