Apply clang-format to Lts/Common and DTC/enum headers
- Formatted all CodeGen module files (9 files) - Formatted LtsAppDescriptor module files - Formatted LtsAppManager/AppChooser files - Applied clang-format to all DTC and enum headers across modules - Removed coordTransTests from CommonUnitTestsPlaceholder (moved to tests/) Cosmetic changes only, no functional modifications. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
848 files changed
+89305
-100020
No files matched your search
Executable → Regular
+123
-219
@@ -1,22 +1,20 @@
|
||||
|
||||
|
||||
|
||||
#include "lts_plugin_manager.h"
|
||||
#include <utility>
|
||||
|
||||
#include "Ui/lts_plugin_manager_dialog.h"
|
||||
|
||||
#include <LtsSession/lts_session_data_dds.h>
|
||||
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||
#include <LtsWidgets/lts_wait_dialog.h>
|
||||
#include <LtsPluginManager/lts_plugin_loader.h>
|
||||
#include <LtsSession/lts_session_manager.h>
|
||||
#include <LtsSession/lts_session_data.h>
|
||||
#include <LtsSession/lts_session_data_dds.h>
|
||||
#include <LtsSession/lts_session_manager.h>
|
||||
#include <LtsWidgets/lts_wait_dialog.h>
|
||||
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||
#include <PluginInterfaces/data_plugin_interface.h>
|
||||
#include <PluginInterfaces/gui_plugin_interface.h>
|
||||
|
||||
#include <QTimer>
|
||||
#include <QDebug>
|
||||
|
||||
#include <QTimer>
|
||||
#include <utility>
|
||||
|
||||
namespace LtsPluginManager
|
||||
{
|
||||
@@ -26,262 +24,168 @@ LtsPluginManager::LtsPluginManager()
|
||||
.getNGLLogger("LtsPluginManager"))
|
||||
, m_markedForDeletion(false)
|
||||
{
|
||||
connect(m_sessionManager, &LtsSession::LtsSessionManager::signalQuit,
|
||||
this, &LtsPluginManager::signalQuit);
|
||||
connect(m_sessionManager, &LtsSession::LtsSessionManager::signalLogout,
|
||||
this, &LtsPluginManager::signalLogout);
|
||||
connect(m_sessionManager, &LtsSession::LtsSessionManager::signalInitializationFinished,
|
||||
this, &LtsPluginManager::signalInitializationFinished);
|
||||
connect(m_sessionManager, &LtsSession::LtsSessionManager::signalInitializationAborted,
|
||||
this, &LtsPluginManager::signalInitializationAborted);
|
||||
connect(m_sessionManager, &LtsSession::LtsSessionManager::signalInitializationFinished,
|
||||
this, &LtsPluginManager::slotInitializationFinished);
|
||||
connect(m_sessionManager, &LtsSession::LtsSessionManager::taskSwitch,
|
||||
this, &LtsPluginManager::taskSwitch);
|
||||
connect(m_sessionManager, &LtsSession::LtsSessionManager::hideAllOtherBLWs,
|
||||
this, &LtsPluginManager::hideAllOtherBLWs);
|
||||
connect(m_sessionManager, &LtsSession::LtsSessionManager::signalQuit, this, &LtsPluginManager::signalQuit);
|
||||
connect(m_sessionManager, &LtsSession::LtsSessionManager::signalLogout, this, &LtsPluginManager::signalLogout);
|
||||
connect(m_sessionManager, &LtsSession::LtsSessionManager::signalInitializationFinished, this,
|
||||
&LtsPluginManager::signalInitializationFinished);
|
||||
connect(m_sessionManager, &LtsSession::LtsSessionManager::signalInitializationAborted, this,
|
||||
&LtsPluginManager::signalInitializationAborted);
|
||||
connect(m_sessionManager, &LtsSession::LtsSessionManager::signalInitializationFinished, this,
|
||||
&LtsPluginManager::slotInitializationFinished);
|
||||
connect(m_sessionManager, &LtsSession::LtsSessionManager::taskSwitch, this, &LtsPluginManager::taskSwitch);
|
||||
connect(m_sessionManager, &LtsSession::LtsSessionManager::hideAllOtherBLWs, this,
|
||||
&LtsPluginManager::hideAllOtherBLWs);
|
||||
|
||||
QTimer *t = new QTimer(this);
|
||||
t->setInterval(1000);
|
||||
connect(t, &QTimer::timeout,
|
||||
this, &LtsPluginManager::signalStillAlive);
|
||||
t->start();
|
||||
QTimer* t = new QTimer(this);
|
||||
t->setInterval(1000);
|
||||
connect(t, &QTimer::timeout, this, &LtsPluginManager::signalStillAlive);
|
||||
t->start();
|
||||
}
|
||||
|
||||
|
||||
LtsPluginManager::~LtsPluginManager()
|
||||
{
|
||||
|
||||
|
||||
delete m_sessionManager;
|
||||
delete m_sessionManager;
|
||||
}
|
||||
|
||||
|
||||
void LtsPluginManager::softQuit()
|
||||
{
|
||||
emit signalSoftQuit();
|
||||
emit signalSoftQuit();
|
||||
}
|
||||
|
||||
|
||||
void LtsPluginManager::_softQuit()
|
||||
{
|
||||
m_sessionManager->softQuit();
|
||||
m_sessionManager->softQuit();
|
||||
}
|
||||
|
||||
|
||||
QVector<LtsSession::LtsSession *> LtsPluginManager::sessions() const
|
||||
QVector<LtsSession::LtsSession*> LtsPluginManager::sessions() const
|
||||
{
|
||||
return m_sessionManager->sessions();
|
||||
return m_sessionManager->sessions();
|
||||
}
|
||||
|
||||
bool LtsPluginManager::hasSituationMapInstance(const LtsAppDescriptor::AppDescription &appDescription, bool alsoTestForScriptApp)
|
||||
bool LtsPluginManager::hasSituationMapInstance(const LtsAppDescriptor::AppDescription& appDescription,
|
||||
bool alsoTestForScriptApp)
|
||||
{
|
||||
if (alsoTestForScriptApp && appDescription.id == LtsAppDescriptor::App::Scripts)
|
||||
return true;
|
||||
if (alsoTestForScriptApp && appDescription.id == LtsAppDescriptor::App::Scripts)
|
||||
return true;
|
||||
|
||||
for (const LtsAppDescriptor::PluginInfo &pluginInfo : std::as_const(appDescription.pluginInfos))
|
||||
{
|
||||
if (pluginInfo.flags.testFlag(LtsAppDescriptor::PluginInfo::Flag::ACTIONS) &&
|
||||
(pluginInfo.iid == QStringLiteral("sitmap")))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
for (const LtsAppDescriptor::PluginInfo& pluginInfo : std::as_const(appDescription.pluginInfos))
|
||||
{
|
||||
if (pluginInfo.flags.testFlag(LtsAppDescriptor::PluginInfo::Flag::ACTIONS) &&
|
||||
(pluginInfo.iid == QStringLiteral("sitmap")))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool LtsPluginManager::hasSituationMapInstance() const
|
||||
{
|
||||
return hasSituationMapInstance(m_app);
|
||||
return hasSituationMapInstance(m_app);
|
||||
}
|
||||
|
||||
LtsSession::LtsSession *LtsPluginManager::getSession(IDL::PartitionType partitionType, int partitionId)
|
||||
LtsSession::LtsSession* LtsPluginManager::getSession(IDL::PartitionType partitionType, int partitionId)
|
||||
{
|
||||
return m_sessionManager->getSession(partitionType, partitionId);
|
||||
return m_sessionManager->getSession(partitionType, partitionId);
|
||||
}
|
||||
|
||||
|
||||
bool LtsPluginManager::startApp(const LtsAppDescriptor::AppDescription &app, bool headless,
|
||||
const LtsSession::DdsConnectionParams &connParams, const QString &workspaceId,
|
||||
bool LtsPluginManager::startApp(const LtsAppDescriptor::AppDescription& app, bool headless,
|
||||
const LtsSession::DdsConnectionParams& connParams, const QString& workspaceId,
|
||||
bool hidden)
|
||||
{
|
||||
|
||||
|
||||
|
||||
LtsWidgets::LtsWaitDialogContainer wait;
|
||||
LtsWidgets::LtsWaitDialogContainer wait;
|
||||
|
||||
m_app = app;
|
||||
LtsPluginLoader *pluginLoader = LtsPluginLoader::getInstance();
|
||||
m_app = app;
|
||||
LtsPluginLoader* pluginLoader = LtsPluginLoader::getInstance();
|
||||
|
||||
QVector<PluginInstance> dataPlugins;
|
||||
auto cb = [&](const PluginInstance& pi) {
|
||||
dataPlugins.append(pi);
|
||||
return true;
|
||||
};
|
||||
|
||||
|
||||
QVector<PluginInstance> dataPlugins;
|
||||
auto cb = [&](const PluginInstance &pi)
|
||||
{
|
||||
dataPlugins.append(pi);
|
||||
return true;
|
||||
};
|
||||
|
||||
if (!pluginLoader->loadPlugins(PluginType::DATA, cb))
|
||||
{
|
||||
WARNING_LOG(m_logger) << "PluginLoader failed to load data plugins - abort!";
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
QVector<PluginInstance> guiPlugins;
|
||||
auto cbLoadPlugins = [&](const PluginInstance &pi)
|
||||
{
|
||||
guiPlugins.append(pi);
|
||||
return true;
|
||||
};
|
||||
|
||||
if (!pluginLoader->loadPlugins(PluginType::GUI, cbLoadPlugins))
|
||||
{
|
||||
WARNING_LOG(m_logger) << "PluginLoader failed to load gui plugins - abort!";
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
QVector<AppPluginInstance> dataApiList;
|
||||
for (auto i = dataPlugins.constBegin(); i != dataPlugins.constEnd(); ++i)
|
||||
{
|
||||
const PluginInstance &pi = *i;
|
||||
|
||||
AppPluginInstance api;
|
||||
api.pluginInstance = pi;
|
||||
api.m_appName = m_app.appName;
|
||||
api.m_appId = m_app.id;
|
||||
|
||||
|
||||
dataApiList.append(api);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
QVector<AppPluginInstance> guiApiList;
|
||||
for (auto i = guiPlugins.constBegin(); i != guiPlugins.constEnd(); ++i)
|
||||
{
|
||||
const PluginInstance &pi = *i;
|
||||
|
||||
AppPluginInstance api;
|
||||
api.pluginInstance = pi;
|
||||
api.m_appName = m_app.appName;
|
||||
api.m_appId = m_app.id;
|
||||
|
||||
|
||||
|
||||
for (auto i2 = app.pluginInfos.constBegin(); i2 != app.pluginInfos.constEnd(); ++i2)
|
||||
if (!pluginLoader->loadPlugins(PluginType::DATA, cb))
|
||||
{
|
||||
const LtsAppDescriptor::PluginInfo &rp = *i2;
|
||||
|
||||
|
||||
if (rp.type == LtsAppDescriptor::PluginInfo::PluginType::GUI
|
||||
&& rp.iid == pi.pluginName)
|
||||
{
|
||||
|
||||
api.m_flags = rp.flags;
|
||||
api.m_options = rp.options;
|
||||
|
||||
break;
|
||||
}
|
||||
WARNING_LOG(m_logger) << "PluginLoader failed to load data plugins - abort!";
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
QVector<PluginInstance> guiPlugins;
|
||||
auto cbLoadPlugins = [&](const PluginInstance& pi) {
|
||||
guiPlugins.append(pi);
|
||||
return true;
|
||||
};
|
||||
|
||||
guiApiList.append(api);
|
||||
}
|
||||
if (!pluginLoader->loadPlugins(PluginType::GUI, cbLoadPlugins))
|
||||
{
|
||||
WARNING_LOG(m_logger) << "PluginLoader failed to load gui plugins - abort!";
|
||||
return false;
|
||||
}
|
||||
|
||||
QVector<AppPluginInstance> dataApiList;
|
||||
for (auto i = dataPlugins.constBegin(); i != dataPlugins.constEnd(); ++i)
|
||||
{
|
||||
const PluginInstance& pi = *i;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
AppPluginInstance api;
|
||||
api.pluginInstance = pi;
|
||||
api.m_appName = m_app.appName;
|
||||
api.m_appId = m_app.id;
|
||||
|
||||
dataApiList.append(api);
|
||||
}
|
||||
|
||||
LtsSession::DdsConnectionParams connParamsNew(connParams);
|
||||
if (!connParamsNew.isValid())
|
||||
{
|
||||
INFO_LOG(m_logger) << "Invalid connection params given - using default parameter";
|
||||
|
||||
connParamsNew.domainId = LtsSessionData::LtsSessionData::getInstance()->getDomainIdPreset();
|
||||
connParamsNew.partitionId = 0;
|
||||
connParamsNew.exerciseId = 0;
|
||||
connParamsNew.partitionType = IDL::PartitionType::Global;
|
||||
QVector<AppPluginInstance> guiApiList;
|
||||
for (auto i = guiPlugins.constBegin(); i != guiPlugins.constEnd(); ++i)
|
||||
{
|
||||
const PluginInstance& pi = *i;
|
||||
|
||||
AppPluginInstance api;
|
||||
api.pluginInstance = pi;
|
||||
api.m_appName = m_app.appName;
|
||||
api.m_appId = m_app.id;
|
||||
|
||||
connParamsNew.tcpConnectionUrl = LtsSessionData::LtsSessionData::getInstance()->getTcpConnectionUrl();
|
||||
}
|
||||
if (LtsSessionData::LtsSessionData::getInstance()->getQosFile().size() > 0 && LtsSessionData::LtsSessionData::getInstance()->getQosFile().at(0).size() > 0)
|
||||
connParamsNew.qos_file = LtsSessionData::LtsSessionData::getInstance()->getQosFile();
|
||||
else
|
||||
connParamsNew.qos_file = QStringList();
|
||||
if (!m_sessionManager->init(connParamsNew,
|
||||
dataApiList,
|
||||
guiApiList,
|
||||
m_app.id,
|
||||
workspaceId,
|
||||
headless,
|
||||
hidden))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Could not create Global Session - abort.";
|
||||
return false;
|
||||
}
|
||||
for (auto i2 = app.pluginInfos.constBegin(); i2 != app.pluginInfos.constEnd(); ++i2)
|
||||
{
|
||||
const LtsAppDescriptor::PluginInfo& rp = *i2;
|
||||
|
||||
return true;
|
||||
if (rp.type == LtsAppDescriptor::PluginInfo::PluginType::GUI && rp.iid == pi.pluginName)
|
||||
{
|
||||
|
||||
api.m_flags = rp.flags;
|
||||
api.m_options = rp.options;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
guiApiList.append(api);
|
||||
}
|
||||
|
||||
LtsSession::DdsConnectionParams connParamsNew(connParams);
|
||||
if (!connParamsNew.isValid())
|
||||
{
|
||||
INFO_LOG(m_logger) << "Invalid connection params given - using default parameter";
|
||||
|
||||
connParamsNew.domainId = LtsSessionData::LtsSessionData::getInstance()->getDomainIdPreset();
|
||||
connParamsNew.partitionId = 0;
|
||||
connParamsNew.exerciseId = 0;
|
||||
connParamsNew.partitionType = IDL::PartitionType::Global;
|
||||
|
||||
connParamsNew.tcpConnectionUrl = LtsSessionData::LtsSessionData::getInstance()->getTcpConnectionUrl();
|
||||
}
|
||||
if (LtsSessionData::LtsSessionData::getInstance()->getQosFile().size() > 0 &&
|
||||
LtsSessionData::LtsSessionData::getInstance()->getQosFile().at(0).size() > 0)
|
||||
connParamsNew.qos_file = LtsSessionData::LtsSessionData::getInstance()->getQosFile();
|
||||
else
|
||||
connParamsNew.qos_file = QStringList();
|
||||
if (!m_sessionManager->init(connParamsNew, dataApiList, guiApiList, m_app.id, workspaceId, headless, hidden))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Could not create Global Session - abort.";
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
} // namespace LtsPluginManager
|
||||
Reference in new issue
Block a user