Remove modules not compiled by this branch's release build

Lts/Common: drop the 17 submodules excluded from the RELEASE_BUILD
branch of Lts/Common/CMakeLists.txt (CodeGen, LtsAppManager, LtsBotan,
LtsCoordinate, LtsElevation, LtsLogin, LtsMultiMonitor,
LtsPluginManager, LtsPrinting, LtsProjectionWorkstation,
LtsScriptTimeline, LtsSession, LtsTimeline, LtsTimelineClassic,
LtsVirtualKeyboard, LtsWidgets, TopicEditorBase). Only the 13
subdirectories actually built remain.

TrainingAreaBase: drop sources of targets excluded by
IF(NOT RELEASE_BUILD) / IF(BUILD_RTI) (svcTabClient, svcTabServer,
svcTrainingAreaBase exe, RecordReplayPlugin customization) and the 7
plugin directories not added in the release path (AdlerJson,
ApacheHlaJson, DebugJsonDir, HlaJson, Nmea, UAS, WlsTetra). Only
tabTelegrams, svcTabCommon and the TetraJson plugin are compiled.

Cross-checked: no kept compiled source includes headers from the
removed modules (GuiPluginInterface - the only LtsWidgets consumer -
is itself NOT RELEASE_BUILD-guarded).
This commit is contained in:
berrux-dev committed 2026-10-13 19:19:55 +02:00
1 parent eb4d067365
commit 855b0a6101
765 files changed
-128732

No files matched your search

@@ -1,156 +0,0 @@
#
# $Id$
# $HeadURL$
# $Author$
# Created by Mike Wille, SLSE, 2016-05-15
#
# RTI Connext DDS - uses IMPORTED targets from parent CMakeLists.txt
# Make ${Qt6_Gui} optional
if(QT6_GUI_AVAILABLE AND TARGET Qt6::Gui)
set(Qt6_Gui ${Qt6_Gui})
else()
set(Qt6_Gui "")
endif()
# BUILD_RTI is set by parent CMakeLists.txt - do not override here
# RTI paths are also set by parent and imported targets are available
# LtsSessionDataDds (always built, with stub implementation for non-RTI builds)
SET(LtsSessionDataDds_SRCS
lts_session_data_dds.cpp
lts_session_data_dds.h
)
NGL_ADD_LIBRARY2(WS LtsSessionDataDds SHARED ${LtsSessionDataDds_SRCS})
set_target_properties(LtsSessionDataDds PROPERTIES AUTOMOC ON)
NGL_TARGET_INCLUDE_DIRECTORIES(LtsSessionDataDds
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
)
NGL_TARGET_LINK_LIBRARIES(LtsSessionDataDds
PRIVATE
$<$<BOOL:${BUILD_RTI}>:$<IF:$<TARGET_EXISTS:ddsconnector>,ddsconnector,>>
PUBLIC
$<$<BOOL:${BUILD_RTI}>:RTI::nddscore>
$<$<BOOL:${BUILD_RTI}>:ddsQoS>
# Generated Core type support (topic_type_support<Core::PartitionTime>, ...)
$<$<BOOL:${BUILD_RTI}>:$<IF:$<TARGET_EXISTS:ddscore>,ddscore,>>
NGLLogger
Qt6::Core
)
IF(BUILD_RTI)
NGL_TARGET_INCLUDE_DIRECTORIES(LtsSessionDataDds
PUBLIC
${RTI_INCLUDE_DIR}
${CMAKE_SOURCE_DIR}/Lts
${CMAKE_SOURCE_DIR}/include
${CMAKE_BINARY_DIR}/Lts/DDS
)
# ddscore target generates core_dtc_types.h
ADD_DEPENDENCIES(LtsSessionDataDds ddscore)
NGL_TARGET_LINK_DIRECTORIES(LtsSessionDataDds
PRIVATE
${RTI_LIB_DIR}
)
ENDIF()
IF(BUILD_RTI)
TARGET_COMPILE_DEFINITIONS(LtsSessionDataDds PUBLIC BUILD_RTI)
ENDIF()
# LtsSession (RTI dependencies optional)
SET(ltssession_SRCS
lts_session.h
lts_session.cpp
lts_session_lock_handler.h
lts_session_manager.h
lts_session_manager.cpp
lts_session_lock_handler.cpp
)
NGL_ADD_LIBRARY2(WS LtsSession SHARED ${ltssession_SRCS})
NGL_TARGET_INCLUDE_DIRECTORIES(LtsSession
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/../
${CMAKE_CURRENT_BINARY_DIR}/../
${CMAKE_CURRENT_SOURCE_DIR}/../LtsUtils/LtsUtilsGui
)
# Optional external dependencies
# Prefer the in-tree target: a fresh build tree does not have svcCoreClient
# installed in /usr/local/lib, and the Core::Interface::Ftc::create symbols
# referenced at link time live in libsvcCoreClient.so
IF(TARGET svcCoreClient)
SET(SVCCORECLIENT_LIBRARY svcCoreClient)
ELSE()
FIND_LIBRARY(SVCCORECLIENT_LIBRARY NAMES svcCoreClient PATHS /usr/local/lib /usr/lib NO_DEFAULT_PATH)
ENDIF()
FIND_LIBRARY(OHPONLINEHELP_LIBRARY NAMES OhpOnlineHelpViewerGuiPluginInterface PATHS /usr/local/lib /usr/lib NO_DEFAULT_PATH)
SET(LtsSession_PRIVATE_LIBS
Qt6::Network
LtsMultiMonitor
LtsSessionData
LtsUtilsGuiDds # ReqHelpr & for Debug Menu ! TODO: rm on release!
LtsNotification
$<IF:$<TARGET_EXISTS:Qt6::Svg>,Qt6::Svg,>
)
IF(SVCCORECLIENT_LIBRARY)
LIST(APPEND LtsSession_PRIVATE_LIBS ${SVCCORECLIENT_LIBRARY})
ENDIF()
IF(OHPONLINEHELP_LIBRARY)
LIST(APPEND LtsSession_PRIVATE_LIBS ${OHPONLINEHELP_LIBRARY})
ENDIF()
NGL_TARGET_LINK_LIBRARIES(LtsSession
PRIVATE
${LtsSession_PRIVATE_LIBS}
PUBLIC
LtsWidgets
Qt6::Core
GuiPluginInterface
DataPluginInterface
NGLLogger
ProjectConfig
LtsSessionDataDds # Always link, even in stub mode
)
IF(BUILD_RTI)
NGL_TARGET_LINK_LIBRARIES(LtsSession
PRIVATE
ddsconnector
PUBLIC
RTI::nddscore
)
TARGET_COMPILE_DEFINITIONS(LtsSession PUBLIC BUILD_RTI)
ENDIF()
# LtsSessionData (avoid cross-deps between AppManager, Session and PluginManager)
SET(LtsSessionData_SRCS
lts_session_data.cpp
lts_session_data.h
)
NGL_ADD_LIBRARY2(WS TOOLSSV TOOLSWS LtsSessionData SHARED ${LtsSessionData_SRCS})
NGL_TARGET_INCLUDE_DIRECTORIES(LtsSessionData
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/../
)
if(QT6_GUI_AVAILABLE)
NGL_TARGET_LINK_LIBRARIES(LtsSessionData
PUBLIC
Qt6::Core
Qt6::Gui # QPixmap as Storage for Profile Picture
)
endif()
IF(BUILD_RTI)
NGL_TARGET_LINK_LIBRARIES(LtsSessionData
PUBLIC
RTI::nddscore
)
TARGET_COMPILE_DEFINITIONS(LtsSessionData PUBLIC BUILD_RTI)
ENDIF()
File diff suppressed because it is too large. Load diff
@@ -1,497 +0,0 @@
/**
* @RDE_HEADER@
* Keeps the DDS Connector and common data about the session
* $Id$
* $HeadURL$
* $Author$
*
* Created by Mike Wille, SLSE, 2016-05-15
*/
#pragma once
#include "lts_session_data_dds.h"
#ifdef BUILD_RTI
#include "lts_session_manager.h"
#endif
#include <LtsAppDescriptor/lts_app_descriptor.h>
#include <LtsSession/ltssession_export.h>
#include <LtsWidgets/lts_base.h>
#include <QtCore/QDebug>
#include <QtCore/QJsonObject>
#include <QtCore/QMap>
#include <QtCore/QObject>
#include <QtCore/QPointer>
#include <QtCore/QVector>
#include <memory>
namespace LtsWidgets
{
class LtsBackgroundWidget;
class LtsTabWidget;
class LtsBaseLayoutWidget;
struct ExerciseData;
class LtsDialog;
class LtsDragIcon;
} // namespace LtsWidgets
namespace LtsNotification
{
class LtsNotification;
class LtsNotificationController;
} // namespace LtsNotification
namespace LtsPluginManager
{
struct PluginInstance;
struct AppPluginInstance;
} // namespace LtsPluginManager
namespace DeveloperTools
{
class DevDialog;
class AppWidget;
} // namespace DeveloperTools
namespace Core
{
namespace Interface
{
class Ftc;
}
} // namespace Core
namespace OnlineHelp
{
class ForeignOnlineHelpViewerGuiInterface;
}
namespace LtsSession
{
class LTSSESSION_EXPORT LtsSession : public LtsSessionDataDds
{
Q_OBJECT
public:
static bool s_valgrind;
static int s_nextSessionId;
enum class PluginInstanceStatus {
UNKNOWN = 0,
LOADED,
FAILED, // e.g. fetchInterfaces gone wrong
};
static QString appToString(LtsAppDescriptor::App app);
static QString appIconFilename(LtsAppDescriptor::App app);
static QIcon appToIcon(LtsAppDescriptor::App app);
#ifdef BUILD_RTI
explicit LtsSession(LtsSessionManager* sessionManager);
#else
explicit LtsSession();
#endif
~LtsSession();
QString toString() const;
#ifdef BUILD_RTI
LtsSessionManager* getSessionManager();
#endif
bool init(const DdsConnectionParams& connParams, const QVector<LtsPluginManager::AppPluginInstance>& dataPluginList,
const QVector<LtsPluginManager::AppPluginInstance>& guiPluginList, bool hidden);
#ifdef BUILD_RTI
bool init(const dds::domain::DomainParticipant& dp, const DdsConnectionParams& connParams,
const QVector<LtsPluginManager::AppPluginInstance>& dataPluginList,
const QVector<LtsPluginManager::AppPluginInstance>& guiPluginList);
#endif
#ifdef BUILD_RTI
void makeVisible();
#else
void makeVisible(); // no-op when BUILD_RTI=OFF
#endif
void setPayloadsEnabled()
{
m_payloads = true;
} // cannot be reverted
void aboutToClose();
bool isInitializationDone() const
{
return m_initDone;
}
void presetBaseLayoutAsSecondaryWidget()
{
m_presetBaseLayoutAsSecondaryWidget = true;
}
/**
* @brief addAction - IMPORTANT: Actions have to be translated on retranslate by adding the same action (with same
* identifier) but with translated text & menu group! This replaces the text & menu group only. The pointer to the
* action stays the same.
* @param plData
* @param isFirstRun
* @return
*/
LtsWidgets::LtsDragIcon* addAction(const LtsWidgets::PluginData& plData, bool isFirstRun = false);
void setMenuVisible(bool visible = true);
#ifdef BUILD_RTI
bool removeMenuAction(LtsWidgets::LtsDragIcon* icon);
#endif
int screenId() const;
int screenContainerId() const;
int screenTypeId() const;
LtsAppDescriptor::App app() const;
void setScreenIdPreset(int screenId)
{
m_screenIdPreset = screenId;
}
void setScreenContainerIdPreset(int screenPart)
{
m_screenContainerIdPreset = screenPart;
}
bool isForeverInvisible() const
{
return m_foreverInvisible;
}
LtsNotification::LtsNotification* createNotification(const QString& identifier);
/**
* @brief setExerciseData is called by the ExerciseManagement plugin and sets the human reabale name of the exercise
* and puts the text into all base layouts of this session
* @param exerciseData the human reable exercise name of the current exercise
*/
#ifdef BUILD_RTI
void setExerciseData(const LtsWidgets::ExerciseData& exerciseData);
const LtsWidgets::ExerciseData* exerciseData() const;
void setProfilePicture(const QPixmap& pixmap);
#else
void setExerciseData(const LtsWidgets::ExerciseData& exerciseData) { Q_UNUSED(exerciseData) }
const LtsWidgets::ExerciseData* exerciseData() const { return nullptr; }
void setProfilePicture(const QPixmap& pixmap) { Q_UNUSED(pixmap) }
#endif
void setBaseLayoutVisible()
{
m_hasBaseLayout = true;
} // cannot be reverted after base layout was created (creation begins after all payloads have been executed OR if
// makeVisible was called)!
bool isVisible() const
{
return (m_baseLayout != nullptr);
}
const QString& name() const
{
return m_name;
}
void setName(const QString& name)
{
m_name = name;
}
/**
* @brief isChildOfSession can be used to check if a fiven QWidget is part of the current Session's application
*
* @param child widget to check against.
* @return true if widget is child of session baselayout
*/
bool isChildOfSession(QWidget* child);
#ifdef BUILD_RTI
LtsWidgets::LtsBaseLayoutWidget* baseLayout()
{
return m_baseLayout;
}
#else
void* baseLayout() const { return nullptr; }
#endif
QWidget* baseLayoutWidget(); // prevents some classes to include LtsBaseLayoutWidget.h just to specify the blw as a
// parent widget
void setMarkForDeletion()
{
m_markedForDeletion = true;
} // session not needed anymore after payloads? then mark for deletion and after payloads, this session will be
// deleted(Later)
void doneInitializingSession(); // TODO: private
bool notifyUnsavedChanges(); // true if NO unsaved changes
const QVector<LtsWidgets::LtsBackgroundWidget*>& bgWidgets() const
{
return m_bgWidgets;
}
// checks if a widget with the given data already exists
bool widgetExists(const QString& menuGroup, const QString& identifier, LtsWidgets::LayoutArea area) const;
/**
* @brief addWidget <exact copy of addWidget in LtsBaseLayoutWidget [is redirected to the coherent
* LtsBaseLayoutWidget]> keep identifier empty to prevent checking for existing tabs
* @return (see addWidget in LtsBaseLayoutWidget)
*/
bool addWidget(LtsWidgets::LtsDialog* widget, const QString& menuGroup, const QString& identifier,
LtsWidgets::LayoutArea area = LtsWidgets::LayoutArea::eUnknown, bool setClosable = true);
LtsWidgets::LtsDialog* getWidget(const QString& menuGroup, const QString& identifier, LtsWidgets::LayoutArea area);
bool focusTab(const QString& menuGroup, const QString& identifier, LtsWidgets::LayoutArea area);
/** WARNING: do not save the returned value, as baseLayouts can die (which kills LtsTabWidget also), so reuse this
* method instead of saving the pointer to the LtsTabWidget
* @brief locateWidget locates the given widget 'widget' and returning the TabWidget on which it is on - widgets can
* be available in one of many LayoutAreas (TabWidgets) of many LtsBaseLayoutWidgets
* @param widgetToLocate the widget to look for in the given layoutArea which is located in one of many
* LtsBaseLayoutWidget
* @param area the area the widget is located
* @return LtsTabWidget on which the widget is located
*/
LtsWidgets::LtsTabWidget* locateWidget(QWidget* widgetToLocate, LtsWidgets::LayoutArea area);
/**
* @brief enable/disable baseLayout menu
* @param on if true enable otherwise disable
*/
void enableBaseLayoutMenu(bool on = true);
/**
* @brief enable/disable LayoutArea
* @param area the area to enable/disable
* @param on if true enable otherwise disable
*/
void enableBaseLayoutArea(LtsWidgets::LayoutArea area, bool on = true);
/**
* @brief Return the workstation ip for this workstation (== full ipv4 adress) - workstation id comes later from Asm
*/
static int workstationIp(); // really in LtsSession?
/**
* @brief Return the workstation name
*/
static QString workstationName(); // really in LtsSession?
/**
* @brief missingRightActions Do not use.
* @return
*/
/*const*/ QVector<LtsWidgets::PluginData>& missingRightActions() /*const*/
{
return m_missingRightActions;
}
void setSavegame(const QJsonObject& sg)
{
m_savegame = sg;
}
const QJsonObject& getSavegame() const
{
return m_savegame;
}
void setHidden()
{
m_hidden = true;
}
const QString workspaceId() const;
void setWorkspaceId(const QString& newWorkspaceId);
#ifdef BUILD_RTI
LtsWidgets::ExcState exerciseState() const;
#else
LtsWidgets::ExcState exerciseState() const { return LtsWidgets::ExerciseState::eUnknown; }
#endif // BUILD_RTI
void setLoadedFromSavegame()
{
m_loadedFromSavegame = true;
}
bool isLoadedFromSavegame() const
{
return m_loadedFromSavegame;
}
void addDeveloperActions();
#ifdef BUILD_RTI
void refetchActions(); // Do not use.
#else
void refetchActions(); // Do not use. (no-op when BUILD_RTI=OFF)
#endif
void setDependency(LtsSession* session)
{
#ifdef BUILD_RTI
if (m_dependency)
{
ERROR_LOG(m_logger) << "Tried to set session dependency on self";
return;
}
m_dependency = session;
#else
Q_UNUSED(session)
#endif
}
bool hasDependency(LtsSession* session)
{
return (m_dependency.data() == session);
}
LtsSession* dependency() const
{
return m_dependency;
}
// bogus.
void setNeedsToBeSuccessfullyPlaced(bool needed = true)
{
m_needsToBeSuccessfullyPlaced = needed;
} // works even after session creation as 'slotStartPluginInit', which finalizes the session (creates blw, etc.) is
// called async!
int id() const
{
return m_id;
}
public slots:
#ifdef BUILD_RTI
void slotExecuteNextPayload(); // NEVER call this directly, queue a signal to this slot !
void slotPluginInitDone(); // NEVER call this directly, queue a signal to this slot !
#endif
void slotShowOnlineHelp(const QString& fileName);
// void takeOverBdv();
private slots:
#ifdef BUILD_RTI
void slotShowOperatorSettings();
#endif
void slotSwap();
void slotStapleTopicLockHandler(LtsWidgets::LtsDialog* widget);
void slotStopWaitDialog();
#ifdef BUILD_RTI
void slotStartPluginInit();
void slotMonitorSelected();
void delayScriptEditorStart();
#endif
signals:
void signalInitializationAborted();
void _signalDoneInitializingSession(); // internal
void signalDoneInitializingSession(); // is called AFTER all payloads have been executed (on no payloads, called
// after session was created) FOR LTSLOGIN !
void signalClose(); // tells the session manager to close this session
void signalLogout();
void signalQuit(); // for payloads, so that they can quit an app
void signalStillAlive();
void signalExerciseDataChanged();
void signalScreenIdChanged(int screenId, int screenContainerId, int screenTypeId);
void sessionAboutToBeDestroyed(LtsSession* session);
void workspaceIdChanged(const QString& newWorkspaceId);
void signalTakeOverBdv();
void hideAllOtherBLWs(QObject* caller);
void taskSwitch(QObject* caller);
private:
friend class DeveloperTools::DevDialog;
friend class DeveloperTools::AppWidget;
#ifdef BUILD_RTI
friend class LtsSessionManager;
#endif
#ifdef BUILD_RTI
bool event(QEvent* e) override;
#endif
void createBaseLayout();
#ifdef BUILD_RTI
void initializePlugins(const QVector<LtsPluginManager::AppPluginInstance>& dataPluginList,
const QVector<LtsPluginManager::AppPluginInstance>& guiPluginList);
void initializeDataPlugins(const QVector<LtsPluginManager::AppPluginInstance>& dataPluginList);
void initializeGuiPlugins(const QVector<LtsPluginManager::AppPluginInstance>& guiPluginList);
bool tryInitGuiPlugin(const QString& guiPluginKey, std::shared_ptr<GuiPluginBase::Interface>& guiPlugin);
void clearDataPluginInterfaces();
void clearGuiPluginInterfaces();
void executePayloads();
#endif
void connectOnlineHelpButton(LtsWidgets::LtsDialog* widget);
// TODO: AFTER FAT !! void stapleWidget(LtsWidgets::LtsDialog *dialog); // FIXME: HACK: because an LtsDialog can
// directly add widgets to the base layout and misses the staples...
void aboutToCloseTab(LtsWidgets::LayoutArea area);
#ifdef BUILD_RTI
QPointer<LtsSessionManager> m_sessionManager;
#endif
#ifdef BUILD_RTI
QMap<int /*priority*/, std::shared_ptr<GuiPluginBase::Interface>>
m_payloadPriorityMap; // QMap automatically sorts by key on iteration and overwrites multiple occurences with
// the latest)
QList<std::shared_ptr<GuiPluginBase::Interface>>
m_payloadList; // for payloads that don't care when they are executed (prio '9999' plugins)
#endif
LtsWidgets::LtsBackgroundWidget* m_mainBackground;
bool m_hasBaseLayout;
#ifdef BUILD_RTI
LtsWidgets::LtsBaseLayoutWidget* m_baseLayout;
#else
void* m_baseLayout{nullptr}; // stub for non-RTI build
#endif
bool m_markedForDeletion;
bool m_payloads;
QVector<LtsNotification::LtsNotificationController*> m_notiCtlList;
bool m_initDone; // set by doneInitializingSession / signalDoneInitializingSession
#ifdef BUILD_RTI
bool m_payloadsDone{false}; // for debug
#endif
bool m_menuVisible;
// bool m_ignoreSignalInLoop = false;
bool m_firstActionsFetch;
#ifdef BUILD_RTI
LtsWidgets::ExerciseData* m_exerciseData;
#else
void* m_exerciseData{nullptr}; // stub for non-RTI build
#endif
QVector<LtsWidgets::PluginData> m_missingRightActions;
std::shared_ptr<Core::Interface::Ftc> m_coreFtc;
#ifdef BUILD_RTI
GuiPluginBase::Interface* m_currentInitIfc; // not owning
bool m_slotPluginInitDoneMutex;
bool m_pluginInitDone; // set by slotPluginInitDone
#endif
QJsonObject m_savegame;
bool m_hidden; // if true, does not create BLW
int m_screenId{-1};
int m_screenContainerId{-1};
int m_screenIdPreset{-1};
int m_screenContainerIdPreset{-1};
bool m_loadedFromSavegame;
std::shared_ptr<OnlineHelp::ForeignOnlineHelpViewerGuiInterface> m_ohvIfc;
bool m_foreverInvisible; // if true, creates BLW but hides it and does not use MMM
#ifdef BUILD_RTI
QStringList m_failedFetches;
#endif
QVector<LtsWidgets::LtsBackgroundWidget*> m_bgWidgets;
QString m_workspaceId;
bool m_needsToBeSuccessfullyPlaced{
true /* ALWAYS! */ /*false*/}; // if set to true, 'signalDoneInitializingSession' will only be called after the
// blw was successfully placed by MMM (even works if MMM inavtive (off))
QString m_name;
QTimer* m_blub{nullptr};
QTimer* m_scriptEditorTimer{nullptr};
int m_blub2;
QPointer<LtsSession> m_dependency; // when MMM iprovides the screen selection for this app, it isn't allowed to
// replace apps that are dependencies of this app (e.g. logout bug)
bool m_presetBaseLayoutAsSecondaryWidget{false};
int m_id;
};
} // namespace LtsSession
@@ -1,92 +0,0 @@
#include "lts_session_data.h"
namespace LtsSessionData
{
struct LtsSessionDataHandler
{
LtsSessionData ltsSessionData;
};
Q_GLOBAL_STATIC(LtsSessionDataHandler, s_ltsSessionData)
LtsSessionData::LtsSessionData()
: m_domainIdPreset(-1), m_partitionIdPreset(-1), m_partitionTypePreset(IDL::PartitionType::Any), m_operatorId(-1),
m_scriptId(0), m_showTerminalWindow(false), m_requestedAppId(LtsAppDescriptor::App::Login), m_workstationId(-1),
m_isTablet(false), m_placeScriptScreens(false)
{
// setAsTablet(true); // IMPORTANT: if you want to set this to true for testing, you have to set TABLET_MODE cmake
// flag to true, otherwise this will crash
setAsTablet(false);
clear();
}
LtsSessionData* LtsSessionData::getInstance()
{
return &s_ltsSessionData->ltsSessionData;
}
void LtsSessionData::loggedOut()
{
m_operatorId = -1;
m_operatorRights.clear();
m_operatorName.clear();
m_showTerminalWindow = false;
m_profilePicture = QPixmap();
m_visibleParties.clear();
}
void LtsSessionData::removePresets()
{
// m_domainIdPreset = -1; keep domain ID !
m_partitionIdPreset = -1;
m_partitionTypePreset = IDL::PartitionType::Any; // FIXME: make invalid !?
m_operatorNamePreset.clear();
m_passwordPreset.clear();
}
void LtsSessionData::clear()
{
removePresets();
loggedOut();
}
bool LtsSessionData::hasOperatorRight(int operatorRight) const
{
if (operatorRight == 0)
return true;
if (m_operatorRights.contains(operatorRight))
return true;
return m_operatorRights.contains(-1);
}
bool LtsSessionData::isVisibleParty(int exerciseId, int partyId) const
{
for (const auto& visibleParties : m_visibleParties)
{
if (visibleParties.exerciseId != exerciseId)
continue;
return visibleParties.visibleParties.contains(partyId);
}
return false;
}
const QVector<int> LtsSessionData::getVisibleParties(int exerciseId) const
{
for (auto visibleParties : m_visibleParties)
{
if (visibleParties.exerciseId == exerciseId)
return visibleParties.visibleParties;
}
return {};
}
void LtsSessionData::setAsTablet(bool isTablet)
{
m_isTablet = isTablet;
// m_debugFlags.insert(QStringLiteral("isTablet"), isTablet);
}
} // namespace LtsSessionData
@@ -1,277 +0,0 @@
#pragma once
#include <Lts/Common/ProjectConfig/project_defines.h>
#include <LtsAppDescriptor/lts_app_descriptor.h>
#include <LtsSession/ltssessiondata_export.h>
#include <QtCore/QMap>
#include <QtCore/QObject>
#include <QtGui/QPixmap>
#include <QtCore/QSet>
#include <QtCore/QUrl>
#include <QtCore/QVariant>
#include <QtCore/qglobal.h>
namespace LtsSessionData
{
struct PartiesByExercise
{
int exerciseId = 0;
QVector<int> visibleParties;
};
class LTSSESSIONDATA_EXPORT LtsSessionData
{
public:
static LtsSessionData* getInstance();
// Presets:
const QString& getOperatorNamePreset() const
{
return m_operatorNamePreset;
}
const QString& getPasswordPreset() const
{
return m_passwordPreset;
}
void setOperatorPreset(const QString& operatorName, const QString& password)
{
m_operatorNamePreset = operatorName;
m_passwordPreset = password;
}
int getDomainIdPreset() const
{
return m_domainIdPreset;
}
void setDomainIdPreset(int domainIdPreset)
{
m_domainIdPreset = domainIdPreset;
}
QStringList getQosFile() const
{
return m_qosFile;
}
void setQosFile(const QStringList& qosFile)
{
m_qosFile = qosFile;
}
int getPartitionIdPreset() const
{
return m_partitionIdPreset;
}
IDL::PartitionType getPartitionTypePreset() const
{
return m_partitionTypePreset;
}
void setPartitionPreset(const int partitionId, IDL::PartitionType partitionType)
{
m_partitionIdPreset = partitionId;
m_partitionTypePreset = partitionType;
}
/**
* @brief removePresets IMPORTANT: call removePresets after using a Preset, otherwise other apps / sessions will
* pick these old Presets up..
*/
void removePresets();
// Other:
int getScriptId() const
{
return m_scriptId;
}
void setScriptId(int scriptId)
{
m_scriptId = scriptId;
}
int getOperatorId() const
{
return m_operatorId;
}
void setOperatorId(int operatorId)
{
m_operatorId = operatorId;
}
const QString& getOperatorName() const
{
return m_operatorName;
}
void setOperatorName(const QString& operatorName)
{
m_operatorName = operatorName;
}
const QSet<int>& getOperatorRights() const
{
return m_operatorRights;
}
void setOperatorRights(const QSet<int>& operatorRights)
{
m_operatorRights = operatorRights;
} // Todo: Emit newOperatorRights() if changed?
bool hasOperatorRight(int operatorRight) const;
const QPixmap& getProfilePicture() const
{
return m_profilePicture;
}
void setProfilePicture(const QPixmap& profilePicture)
{
m_profilePicture = profilePicture;
}
bool isVisibleParty(int exerciseId, int partyId) const;
const QVector<PartiesByExercise>& getVisibleParties() const
{
return m_visibleParties;
}
const QVector<int> getVisibleParties(int exerciseId) const;
void setVisibleParties(const QVector<PartiesByExercise>& visibleParties)
{
m_visibleParties = visibleParties;
}
QUrl getTcpConnectionUrl() const
{
return m_tcpConnectionUrl;
}
void setTcpConnectionUrl(const QUrl& tcpConnectionUrl)
{
m_tcpConnectionUrl = tcpConnectionUrl;
}
bool getShowTerminalWindow() const
{
return m_showTerminalWindow;
}
void setShowTerminalWindow(bool showTerminalWindow)
{
m_showTerminalWindow = showTerminalWindow;
}
LtsAppDescriptor::App getRequestedAppId() const
{
return m_requestedAppId;
}
void setRequestedAppId(LtsAppDescriptor::App requestedAppId)
{
m_requestedAppId = requestedAppId;
}
int getWorkstationId() const
{
return m_workstationId;
}
void setWorkstationId(int workstationId)
{
m_workstationId = workstationId;
}
bool isTablet() const
{
return m_isTablet;
}
void setAsTablet(bool isTablet = true);
bool getPlaceScriptScreens() const
{
return m_placeScriptScreens;
}
void setPlaceScriptScreens(bool placeScriptScreens)
{
m_placeScriptScreens = placeScriptScreens;
}
bool hasDebugFlag(const QString& debugFlag) const
{
return m_debugFlags.constEnd() != m_debugFlags.constFind(debugFlag);
}
QVariant debugFlagValue(const QString& debugFlag) const
{
QVariant result;
auto it = m_debugFlags.constFind(debugFlag);
if (it != m_debugFlags.constEnd())
result = *it;
return result;
}
void setDebugFlagValue(const QString& debugFlag, const QVariant& value)
{
m_debugFlags.insert(debugFlag, value);
}
const QMap<QString, QVariant>& debugFlags() const
{
return m_debugFlags;
}
void removeDebugFlag(const QString& debugFlag)
{
m_debugFlags.remove(debugFlag);
}
void clear();
void loggedOut();
private:
LtsSessionData();
~LtsSessionData() = default;
friend struct LtsSessionDataHandler;
// Presets to skip some Payloads
QString m_operatorNamePreset;
QString m_passwordPreset;
QStringList m_qosFile;
QUrl m_tcpConnectionUrl;
int m_domainIdPreset;
int m_partitionIdPreset;
IDL::PartitionType m_partitionTypePreset;
int m_operatorId;
int m_scriptId;
QString m_operatorName;
bool m_showTerminalWindow;
QSet<int> m_operatorRights;
QPixmap m_profilePicture;
QVector<PartiesByExercise> m_visibleParties;
QMap<QString, QVariant> m_debugFlags;
LtsAppDescriptor::App m_requestedAppId;
int m_workstationId;
bool m_isTablet;
bool m_placeScriptScreens;
};
static inline bool hasOperatorRight(int operatorRight)
{
auto instance = LtsSessionData::getInstance();
return instance->hasOperatorRight(operatorRight);
}
} // namespace LtsSessionData
@@ -1,479 +0,0 @@
/**
* @RDE_HEADER@
* DDS specific parts for a session
* $Id$
* $HeadURL$
* $Author$
*
* Created by Christian Ehrlicher, SLSE, 2017-02-27
*/
#include "lts_session_data_dds.h"
#ifdef BUILD_RTI
#include <DDS/DDSConnector/dds_connector.h>
#include <DDS/DTC/generic_dtc_impl.h>
#include <DDS/QosProfile/DDS_DefaultQos.h>
#include <Lts/Common/ProjectConfig/project_defines.h>
#include <NGLLogger/NGLLoggerBootstrap.h>
#include <QtCore/QDebug>
#include <QtCore/QSet>
#include <QtCore/QVector>
namespace LtsSession
{
/**
* We have to make sure that only one DdsConnector for a specific domain/partion/tye/connStr
* exists because we don't want to have more than one DomainParticipant and Publisher/Subscriber
* per domain/partion/tye/connStr. Therefore this ugly-looking key
*/
//
// DdsConnectionContainer
//
class DdsConnectionContainer
{
struct DdsConnection : public DdsConnectionParams
{
std::weak_ptr<DDSConnector::DdsConnector> ddsConnector = std::weak_ptr<DDSConnector::DdsConnector>();
DdsConnection() = default;
explicit DdsConnection(const DdsConnectionParams& p) : DdsConnectionParams(p) {}
};
QVector<DdsConnection> ddsConnections;
public:
std::shared_ptr<DDSConnector::DdsConnector> findGlobalConnection()
{
for (int i = ddsConnections.size() - 1; i >= 0; --i)
{
const DdsConnection& conn = ddsConnections.at(i);
if (conn.partitionType != IDL::PartitionType::Global)
continue;
auto ret = conn.ddsConnector.lock();
if (ret != nullptr)
return ret;
// ddsConnector is a nullptr -> useless -> remove
ddsConnections.removeAt(i);
}
Q_ASSERT(false);
return std::shared_ptr<DDSConnector::DdsConnector>();
}
std::shared_ptr<DDSConnector::DdsConnector> findConnection(const DdsConnectionParams& connParams)
{
for (int i = ddsConnections.size() - 1; i >= 0; --i)
{
const DdsConnection& conn = ddsConnections.at(i);
if (conn != connParams)
continue;
auto ret = conn.ddsConnector.lock();
if (ret != nullptr)
return ret;
// ddsConnector is a nullptr -> useless -> remove
ddsConnections.removeAt(i);
}
return std::shared_ptr<DDSConnector::DdsConnector>();
}
dds::domain::DomainParticipant findMatchingDomainParticipant(const DdsConnectionParams& connParams)
{
for (int i = ddsConnections.size() - 1; i >= 0; --i)
{
const DdsConnection& conn = ddsConnections.at(i);
if (!connParams.hasSameDomainParams(conn))
continue;
auto ret = conn.ddsConnector.lock();
if (ret != nullptr)
return ret->getDomainParticipant();
// ddsConnector is a nullptr -> useless -> remove
ddsConnections.removeAt(i);
}
return nullptr;
}
void insertConnection(const DdsConnectionParams& connParams,
const std::shared_ptr<DDSConnector::DdsConnector>& ddsConnector)
{
DdsConnection val(connParams);
val.ddsConnector = ddsConnector;
ddsConnections += val;
}
};
Q_GLOBAL_STATIC(DdsConnectionContainer, s_ddsConnections)
class DataPluginContainer
{
public:
struct DataPluginValue
{
QString identifier;
std::weak_ptr<DataPluginBase::Interface> weakIfc;
bool operator==(const DataPluginValue& o) const
{
return identifier == o.identifier && weakIfc.lock().get() == o.weakIfc.lock().get();
}
};
QMap<DdsConnectionParams, QSet<DataPluginValue>> m_dataPlugins;
public:
QMap<QString, std::shared_ptr<DataPluginBase::Interface>> findDataPlugins(const DdsConnectionParams& connParams);
void insertDataPlugins(const DdsConnectionParams& connParams,
const QMap<QString, std::shared_ptr<DataPluginBase::Interface>>& dataPlugins);
};
uint qHash(const DataPluginContainer::DataPluginValue& val)
{
qint64 ptr = reinterpret_cast<qint64>(val.weakIfc.lock().get());
return ::qHash(val.identifier) ^ ::qHash(ptr);
}
QMap<QString, std::shared_ptr<DataPluginBase::Interface>>
DataPluginContainer::findDataPlugins(const DdsConnectionParams& connParams)
{
QMap<QString, std::shared_ptr<DataPluginBase::Interface>> ret;
DdsConnectionParams key(connParams);
key.exerciseId = 0;
auto it = m_dataPlugins.find(key);
if (it != m_dataPlugins.end())
{
QSet<DataPluginValue>& cont = it.value();
auto itCont = cont.begin();
while (itCont != cont.end())
{
auto spPlugin = itCont->weakIfc.lock();
if (spPlugin)
{
ret[itCont->identifier] = spPlugin;
++itCont;
}
else
{
itCont = cont.erase(itCont);
}
}
}
return ret;
}
void DataPluginContainer::insertDataPlugins(
const DdsConnectionParams& connParams, const QMap<QString, std::shared_ptr<DataPluginBase::Interface>>& dataPlugins)
{
DdsConnectionParams key(connParams);
key.exerciseId = 0;
QSet<DataPluginValue> cont;
cont.reserve(dataPlugins.size());
for (auto it = dataPlugins.begin(); it != dataPlugins.end(); ++it)
{
DataPluginValue val;
val.identifier = it.key();
val.weakIfc = it.value();
cont += val;
}
m_dataPlugins[key].unite(cont);
}
Q_GLOBAL_STATIC(DataPluginContainer, s_dataPlugins)
//
// LtsSessionDataDds
//
LtsSessionDataDds::LtsSessionDataDds(QObject* parent)
: QObject(parent), m_exerciseId(-1), m_emittedTime(0), m_curMSecSinceEpoch(0), m_active(true), m_fetcher(nullptr),
m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger().getNGLLogger("LtsSession.Session"))
{
}
LtsSessionDataDds::~LtsSessionDataDds()
{
m_dtcPartitionTime = nullptr;
m_ddsConnector = nullptr;
delete m_fetcher;
}
bool LtsSessionDataDds::init(const DdsConnectionParams& connParams)
{
m_ddsConnector = s_ddsConnections->findConnection(connParams);
m_exerciseId = connParams.exerciseId;
m_qosFileList = QStringList(connParams.qos_file);
if (m_ddsConnector == nullptr)
{
// maybe we can at least find a useful DomainParticipant?
dds::domain::DomainParticipant dp = s_ddsConnections->findMatchingDomainParticipant(connParams);
if (dp != nullptr)
return init(dp, connParams);
#ifdef WIN_32
DDS::QosProfile::ConnectionType type = DDS::QosProfile::ConnectionType::Tablet;
#else
DDS::QosProfile::ConnectionType type = DDS::QosProfile::ConnectionType::Client;
#endif
m_ddsConnector = std::make_shared<DDSConnector::DdsConnector>(
connParams.domainId, connParams.partitionType, connParams.partitionId,
connParams.exerciseId, // same as partition Id in live but not in replay
type);
s_ddsConnections()->insertConnection(connParams, m_ddsConnector);
}
return initInternal();
}
bool LtsSessionDataDds::init(const dds::domain::DomainParticipant& dp, const DdsConnectionParams& connParams)
{
Q_ASSERT(dp.domain_id() == connParams.domainId);
m_ddsConnector = s_ddsConnections->findConnection(connParams);
m_exerciseId = connParams.exerciseId;
QStringList qosList;
if (!connParams.qos_file.isEmpty())
{
qosList.append(connParams.qos_file);
}
if (!qosList.isEmpty())
m_qosFileList = qosList;
else
m_qosFileList.clear();
#ifdef WIN_32
DDS::QosProfile::ConnectionType type = DDS::QosProfile::ConnectionType::Tablet;
#else
DDS::QosProfile::ConnectionType type = DDS::QosProfile::ConnectionType::Client;
#endif
if (m_ddsConnector == nullptr)
{
m_ddsConnector =
std::make_shared<DDSConnector::DdsConnector>(dp, connParams.partitionType, type, connParams.partitionId);
s_ddsConnections()->insertConnection(connParams, m_ddsConnector);
}
return initInternal();
}
Fetcher* LtsSessionDataDds::fetcher(const QString& yourPluginsName)
{
if (m_fetcher == nullptr)
m_fetcher = new Fetcher(this, yourPluginsName);
return m_fetcher;
}
QString LtsSessionDataDds::partitionTypeString(IDL::PartitionType partitionType)
{
switch (partitionType)
{
case IDL::PartitionType::AllExercises:
return QStringLiteral("AllExercises");
case IDL::PartitionType::Any:
return QStringLiteral("Any");
case IDL::PartitionType::Exercise:
return QStringLiteral("Exercise");
case IDL::PartitionType::Global:
return QStringLiteral("Global");
case IDL::PartitionType::Replay:
return QStringLiteral("Replay");
default:
break;
}
return QStringLiteral("Invalid (%1)").arg(int(partitionType));
}
QString LtsSessionDataDds::toString() const
{
return QStringLiteral("(LtsSessionDataDds: id=%1, partitionId=%2, partitionType=%3(%4), exerciseId=%5)")
.arg((qulonglong)this)
.arg(partitionId())
.arg(static_cast<int>(partitionType()))
.arg(partitionTypeString(partitionType()))
.arg(exerciseId());
}
int LtsSessionDataDds::domainId() const
{
return m_ddsConnector ? m_ddsConnector->getDomainId() : -1;
}
int LtsSessionDataDds::exerciseId() const
{
return m_exerciseId;
}
int LtsSessionDataDds::partitionId() const
{
return m_ddsConnector ? m_ddsConnector->getPartitionId() : -1;
}
IDL::PartitionType LtsSessionDataDds::partitionType() const
{
return m_ddsConnector ? m_ddsConnector->getPartitionType() : IDL::PartitionType::Global;
}
QStringList LtsSessionDataDds::qosFile() const
{
return m_ddsConnector ? m_qosFileList : QStringList();
}
QUrl LtsSessionDataDds::tcpConnectionUrl() const
{
return m_ddsConnector ? m_ddsConnector->getTcpConnectionUrl() : QUrl();
}
DdsConnectionParams LtsSessionDataDds::connParams() const
{
DdsConnectionParams connParams;
connParams.domainId = domainId();
connParams.exerciseId = exerciseId();
connParams.partitionId = partitionId();
connParams.partitionType = partitionType();
connParams.qos_file = qosFile();
connParams.tcpConnectionUrl = tcpConnectionUrl();
return connParams;
}
bool LtsSessionDataDds::initInternal()
{
if (!m_ddsConnector || !m_ddsConnector->init(m_qosFileList))
{
ERROR_LOG(m_logger) << "DDS connector could not be initialized - session aborted!";
m_ddsConnector = nullptr;
return false;
}
m_ddsConnector->initPublisherSubscriber();
m_ddsConnectorGlobal = s_ddsConnections->findGlobalConnection();
if (!m_ddsConnectorGlobal)
m_ddsConnectorGlobal = m_ddsConnector;
m_dtcPartitionTime.reset(m_ddsConnector->createDTC<DTC::PartitionTimeImpl>());
assert(m_dtcPartitionTime.get());
m_dtcPartitionTime->setSubscriberCallback([this](const Core::PartitionTime& data, DataModification) {
m_curMSecSinceEpoch = data.timeStamp;
emit partitionTimeChangedInternal();
});
connect(this, &LtsSessionDataDds::partitionTimeChangedInternal, this,
&LtsSessionDataDds::onPartitionTimeChangedInternal, Qt::QueuedConnection);
return true;
}
void LtsSessionDataDds::onPartitionTimeChangedInternal()
{
if (!m_active)
return;
if (m_emittedTime == m_curMSecSinceEpoch)
return;
m_emittedTime = m_curMSecSinceEpoch;
emit partitionTimeChanged(m_curMSecSinceEpoch);
}
QMap<QString, std::shared_ptr<DataPluginBase::Interface>> LtsSessionDataDds::availableDataPluginInterfaces() const
{
return s_dataPlugins->findDataPlugins(connParams());
}
void LtsSessionDataDds::addAvailablaeDataPluginInterfaces(
const QMap<QString, std::shared_ptr<DataPluginBase::Interface>>& dataPlugins)
{
s_dataPlugins->insertDataPlugins(connParams(), dataPlugins);
}
} // namespace LtsSession
#else // !BUILD_RTI - Stub implementation for non-RTI builds
namespace LtsSession
{
LtsSessionDataDds::LtsSessionDataDds(QObject* parent)
: QObject(parent), m_exerciseId(-1), m_emittedTime(0), m_curMSecSinceEpoch(0), m_active(true), m_fetcher(nullptr)
{
}
LtsSessionDataDds::~LtsSessionDataDds()
{
// m_fetcher is void* in stub mode, no deletion needed
}
bool LtsSessionDataDds::init(const DdsConnectionParams& /*connParams*/)
{
return false;
}
bool LtsSessionDataDds::init(const void* /*dp*/, const DdsConnectionParams& /*connParams*/)
{
return false;
}
void* LtsSessionDataDds::fetcher(const QString& /*yourPluginsName*/)
{
return nullptr;
}
QString LtsSessionDataDds::partitionTypeString(PartitionType /*partitionType*/)
{
return QString();
}
QString LtsSessionDataDds::toString() const
{
return QStringLiteral("(LtsSessionDataDds: STUB - no RTI support)");
}
int LtsSessionDataDds::domainId() const
{
return -1;
}
int LtsSessionDataDds::exerciseId() const
{
return -1;
}
int LtsSessionDataDds::partitionId() const
{
return -1;
}
PartitionType LtsSessionDataDds::partitionType() const
{
return PartitionType::Global;
}
QStringList LtsSessionDataDds::qosFile() const
{
return QStringList();
}
QUrl LtsSessionDataDds::tcpConnectionUrl() const
{
return QUrl();
}
DdsConnectionParams LtsSessionDataDds::connParams() const
{
return DdsConnectionParams();
}
bool LtsSessionDataDds::initInternal()
{
return false;
}
void LtsSessionDataDds::onPartitionTimeChangedInternal()
{
}
} // namespace LtsSession
#endif // BUILD_RTI
@@ -1,356 +0,0 @@
/**
* @RDE_HEADER@
* DDS specific parts for a session
* $Id$
* $HeadURL$
* $Author$
*
* Created by Christian Ehrlicher, SLSE, 2017-02-27
*/
#pragma once
#include <QObject>
#include <QMap>
#include <QUrl>
#include <memory>
#include <DDS/Core/core_dtc_types.h>
//#include <NGLLogger/INGLLogger.h>
#include <NGLLogger/NGLLoggerBootstrap.h>
#include <Common/ProjectConfig/project_defines.h>
#include <LtsSession/ltssessiondatadds_export.h>
namespace DataPluginBase { class Interface; }
namespace DDSConnector { class DdsConnector; }
namespace GuiPluginBase { class Interface; }
namespace LtsSession
{
struct DdsConnectionParams
{
int domainId = -1;
int partitionId = 0;
int exerciseId = 0;
IDL::PartitionType partitionType = IDL::PartitionType::Any;
QUrl tcpConnectionUrl;
QStringList qos_file;
DdsConnectionParams() = default;
explicit DdsConnectionParams(const Core::ReplayPartition &rp)
: domainId(rp.domainId)
, partitionId(rp.id)
, exerciseId(rp.exerciseId)
, partitionType(IDL::PartitionType::Replay)
{
setTcpConnectionUrl(rp.tcpConnectionUrl);
}
bool isValid() const { return domainId >= 0 && partitionType != IDL::PartitionType::Any; }
bool hasSameDomainParams(const DdsConnectionParams &o) const
{
return domainId == o.domainId &&
tcpConnectionUrl == o.tcpConnectionUrl;
}
bool operator==(const DdsConnectionParams &o) const
{
return domainId == o.domainId &&
partitionId == o.partitionId &&
exerciseId == o.exerciseId &&
qos_file == o.qos_file &&
partitionType == o.partitionType &&
tcpConnectionUrl == o.tcpConnectionUrl;
}
bool operator !=(const DdsConnectionParams &o) const
{
return !operator==(o);
}
bool operator <(const DdsConnectionParams &o) const
{
if (domainId != o.domainId)
return domainId < o.domainId;
if (partitionId != o.partitionId)
return partitionId < o.partitionId;
if (exerciseId != o.exerciseId)
return exerciseId < o.exerciseId;
if (qos_file != o.qos_file)
return qos_file < o.qos_file;
if (partitionType != o.partitionType)
return partitionType < o.partitionType;
return tcpConnectionUrl.toString() < o.tcpConnectionUrl.toString();
}
void setTcpConnectionUrl(const std::string &url)
{
tcpConnectionUrl = QUrl::fromUserInput(QString::fromStdString(url));
}
};
class Fetcher;
class LTSSESSIONDATADDS_EXPORT LtsSessionDataDds /* FIXME: Name ist irrefuehrend. "LtsSessionData" hat mit "LtsSessionDataDds" nichts zu tun, klingen aber fast identisch. */
: public QObject
{
Q_OBJECT
protected:
// only used from LtsSession, no direct instantiation
explicit LtsSessionDataDds(QObject *parent = nullptr);
public:
~LtsSessionDataDds();
bool init(const DdsConnectionParams &connParams);
bool init(const dds::domain::DomainParticipant &dp,
const DdsConnectionParams &connParams);
std::shared_ptr<DDSConnector::DdsConnector> ddsConnector() { return m_ddsConnector; }
std::shared_ptr<DDSConnector::DdsConnector> ddsConnectorGlobal() { return m_ddsConnectorGlobal; }
int domainId() const;
int exerciseId() const;
int partitionId() const;
QStringList qosFile() const;
IDL::PartitionType partitionType() const;
static QString partitionTypeString(IDL::PartitionType partitionType);
bool isExercisePartition() const { return (partitionType() == IDL::PartitionType::Exercise); }
bool isReplayPartition() const { return (partitionType() == IDL::PartitionType::Replay); }
QString toString() const;
Fetcher *fetcher(const QString &yourPluginsName);
QUrl tcpConnectionUrl() const;
DdsConnectionParams connParams() const;
qint64 partitionTime() const { return m_curMSecSinceEpoch; }
// retrieve DTC/FTC inside DataPlugin::createDataInterface()
template<typename T>
bool createTopicClient(std::shared_ptr<T> &member, bool bEnableAll = false, bool bGlobal = false)
{
member = T::create(bGlobal ? m_ddsConnectorGlobal : m_ddsConnector);
if ( bEnableAll && !member->enableAll())
{
member = nullptr;
ERROR_LOG(m_logger) << "Error initializing dtc/ftc for service " << T::identifier();
return false;
}
return true;
}
template<typename T, typename S>
bool createTopicClient(std::shared_ptr<T> &dtc, std::shared_ptr<S> &ftc, bool bEnableAll = false, bool bGlobal = false)
{
dtc = T::create(bGlobal ? m_ddsConnectorGlobal : m_ddsConnector);
ftc = S::create(bGlobal ? m_ddsConnectorGlobal : m_ddsConnector);
if ( (bEnableAll && !dtc->enableAll()) || !ftc->enableAll())
{
dtc = nullptr;
ftc = nullptr;
ERROR_LOG(m_logger) << "Error initializing dtc/ftc for service " << T::identifier();
return false;
}
return true;
}
template<typename T, typename S>
bool getDtc(std::shared_ptr<S> &val) const
{
for (const auto &i : m_dataPluginInterfaces)
{
auto ifc = std::dynamic_pointer_cast<T>(i);
if (ifc)
{
val = ifc->getDtc();
return val != nullptr;
}
}
val.reset();
DEBUG_LOG(m_logger) << "Trying to load dtc " << typeid(T).name() << " - " << typeid(S).name() << " failed!"
<< ", m_dataPluginInterfaces.size() = " << m_dataPluginInterfaces.size() << " - " << this;
return false;
}
// TODO: merge with getDtc() --> std::is_same, std::enable_if
template<typename T, typename S>
bool getFtc(std::shared_ptr<S> &val) const
{
for (const auto &i : m_dataPluginInterfaces)
{
auto ifc = std::dynamic_pointer_cast<T>(i);
if (ifc)
{
val = ifc->getFtc();
return val != nullptr;
}
}
val.reset();
DEBUG_LOG(m_logger) << "Trying to load ftc " << typeid(T).name() << " - " << typeid(S).name() << " failed!"
<< ", m_dataPluginInterfaces.size() = " << m_dataPluginInterfaces.size() << " - " << this;
return false;
}
// TODO: merge with getDtc() --> std::is_same, std::enable_if
template<typename T, typename S>
bool getForeignDataInterface(std::shared_ptr<S> &val) const
{
//qWarning() << "getForeignDataInterface is deprecated! get the plugin's dtc/ftc directly with getDtc or getFtc!";
for (const auto &i : m_dataPluginInterfaces)
{
auto ifc = std::dynamic_pointer_cast<T>(i);
if (ifc)
{
val = ifc->getForeignDataInterface();
return val != nullptr;
}
}
val.reset();
DEBUG_LOG(m_logger) << "Trying to load foreign data ifc " << typeid(T).name() << " - " << typeid(S).name() << " failed!"
<< ", m_dataPluginInterfaces.size() = " << m_dataPluginInterfaces.size() << " - " << this;
return false;
}
/* MWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMW */
/* MW DEPRECATED - DO NOT USE IN NEW IMPLEMENTATIONS - CAN BE REMOVED AT ANY TIME WITHOUT WARNING ! MW */
/* MWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMW */
/* MW */ /* MW */
/* MW */ template<typename S> /* MW */
/* MW */ bool getForeignDataInterface_NEW(std::shared_ptr<S> &val) const /* MW */
/* MW */ { /* MW */
/* MW */ //qWarning() << "getForeignDataInterface is deprecated! get the plugin's dtc/ftc directly with getDtc or getFtc!"; /* MW */
/* MW */ /* MW */
/* MW */ for (const auto &i : m_dataPluginInterfaces) /* MW */
/* MW */ { /* MW */
/* MW */ val = std::dynamic_pointer_cast<S>(i); /* MW */
/* MW */ if (val) /* MW */
/* MW */ return true; /* MW */
/* MW */ } /* MW */
/* MW */ val.reset(); /* MW */
/* MW */ DEBUG_LOG(m_logger) << "Trying to load foreign data ifc " << typeid(S).name() << " failed!" /* MW */
/* MW */ << ", m_guiPluginInterfaces.size() = " << m_guiPluginInterfaces.size() << " - " << this; /* MW */
/* MW */ return false; /* MW */
/* MW */ } /* MW */
/* MW */ /* MW */
/* MWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMW */
template<typename S>
bool getForeignGuiInterface(std::shared_ptr<S> &val) const
{
for (const auto &i : m_guiPluginInterfaces)
{
val = std::dynamic_pointer_cast<S>(i);
if (val)
return true;
}
val.reset();
DEBUG_LOG(m_logger) << "Cannot find foreign gui ifc " << typeid(S).name() << " in " << toString();
return false;
}
template<typename T, typename S>
bool interfaceFromGui(std::shared_ptr<S> &val) const // for generic gui interfaces
{
for (const auto &i : m_guiPluginInterfaces)
{
val = std::dynamic_pointer_cast<T>(i);
if (val)
return true;
}
val.reset();
DEBUG_LOG(m_logger) << "Trying to load foreign gui ifc #2 " << typeid(S).name() << " failed!"
<< ", m_guiPluginInterfaces.size() = " << m_guiPluginInterfaces.size() << " - " << this;
return false;
}
signals:
void partitionTimeChanged(qint64 newPartitionTime);
void partitionTimeChangedInternal();
private:
void onPartitionTimeChangedInternal();
bool initInternal();
protected:
std::shared_ptr<DDSConnector::DdsConnector> m_ddsConnector;
std::shared_ptr<DDSConnector::DdsConnector> m_ddsConnectorGlobal;
int m_exerciseId;
std::shared_ptr<DTC::PartitionTime> m_dtcPartitionTime;
qint64 m_emittedTime;
qint64 m_curMSecSinceEpoch;
bool m_active;
void setInactive() { m_active = false; }
QMap<QString, std::shared_ptr<DataPluginBase::Interface>> availableDataPluginInterfaces() const;
void addAvailablaeDataPluginInterfaces(const QMap<QString, std::shared_ptr<DataPluginBase::Interface>> &dataPlugins);
QMap<QString, std::shared_ptr<DataPluginBase::Interface>> m_dataPluginInterfaces;
QMap<QString, std::shared_ptr<GuiPluginBase::Interface>> m_guiPluginInterfaces;
QMap<QString, std::shared_ptr<GuiPluginBase::Interface>> m_initializeThesePlugins;
Fetcher *m_fetcher;
QStringList m_qosFileList;
NGL::INGLLogger &m_logger;
};
class Fetcher
{
public:
Fetcher(LtsSessionDataDds *sessionDataDds, const QString &caller)
: m_sessionDataDds(sessionDataDds)
, m_errors(false)
, m_caller(caller)
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger().getNGLLogger("LtsSession.Fetcher"))
, m_optional(false)
{
}
LtsSessionDataDds *m_sessionDataDds;
bool m_errors;
QString m_caller;
QString m_whatWillNotWork;
NGL::INGLLogger &m_logger;
bool m_optional;
QString m_resultType;
QString m_getterFunctionType;
template <typename ForeignGuiInterface>
void getForeignGuiInterface(std::shared_ptr<ForeignGuiInterface> &foreignGuiInterface, const QString &whatWillNotWork /* only fill if optional */, bool optional)
{
if (!m_sessionDataDds->getForeignGuiInterface(foreignGuiInterface))
{
m_whatWillNotWork = whatWillNotWork;
m_optional = optional;
m_resultType = QString::fromUtf8(typeid(ForeignGuiInterface).name());
m_getterFunctionType = QStringLiteral("gui interface");
print();
}
}
bool status() const
{
return !m_errors;
}
void print()
{
m_errors = true;
QString msg(QStringLiteral("%1 cannot find '%2' in %3 %4"));
if (m_optional)
{
INFO_LOG(m_logger) << msg.arg(m_caller, m_resultType, m_sessionDataDds->toString(), QStringLiteral("' - optional but %1 will not work").arg(m_whatWillNotWork));
}
else // critical
{
ERROR_LOG(m_logger) << msg.arg(m_caller, m_resultType, m_sessionDataDds->toString(), QStringLiteral(" which is required"));
}
}
};
} // namespace LtsSession
@@ -1,95 +0,0 @@
#include "lts_session_lock_handler.h"
#include <QtCore/QDebug>
namespace LtsSession
{
// STUB implementations - RTI Connext DDS not available.
// The topic-lock feature depends on the RTI DDS backend (Core::Interface::Ftc),
// which is an optional dependency not present in this build. These definitions
// exist so that LtsSession links; the moc-generated qt_metacall references every
// slot, so each slot needs a body. Semantics reflect an unavailable backend:
// init reports failure (the caller logs a warning and skips wiring the handler)
// and the handler is never locked.
TopicLockHandler::TopicLockHandler()
: m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger().getNGLLogger("LtsSession.TopicLockHandler"))
{
}
TopicLockHandler::~TopicLockHandler() {}
bool TopicLockHandler::init(const std::shared_ptr<Core::Interface::Ftc> &coreFtc, int exerciseId)
{
Q_UNUSED(coreFtc);
Q_UNUSED(exerciseId);
return false; // RTI DDS backend unavailable
}
void TopicLockHandler::slotTryLock(const LtsWidgets::TopicInfo &topicInfo)
{
Q_UNUSED(topicInfo);
}
bool TopicLockHandler::slotUnlock()
{
return true; // nothing is locked (no DDS backend)
}
void TopicLockHandler::slotFinalize() {}
bool TopicLockHandler::lock()
{
return false; // no DDS backend to lock against
}
bool TopicLockHandler::unlock()
{
return true; // nothing to unlock
}
std::string TopicLockHandler::objStateAsString() const
{
return "stub (RTI DDS not available)";
}
TopicLockHanderData::TopicLockHanderData() {}
TopicLockHanderData::~TopicLockHanderData() {}
void TopicLockHanderData::init(const std::shared_ptr<Core::Interface::Ftc> &coreFtc, int exerciseId)
{
Q_UNUSED(coreFtc);
Q_UNUSED(exerciseId);
}
void TopicLockHanderData::unlock() {}
void TopicLockHanderData::slotTryLock(const LtsWidgets::TopicInfo &topicInfo)
{
Q_UNUSED(topicInfo);
}
bool TopicLockHanderData::isLocked() const
{
return false; // no DDS backend: never locked
}
LtsWidgets::TopicInfo TopicLockHanderData::getTopicInfo() const
{
return LtsWidgets::TopicInfo();
}
void TopicLockHanderData::slotLock(const QString &lockedBy)
{
m_lockedBy = lockedBy;
}
void TopicLockHanderData::slotUnlock()
{
m_lockedBy.clear();
}
} // namespace LtsSession
@@ -1,106 +0,0 @@
#pragma once
#include <LtsSession/ltssession_export.h>
#include <LtsWidgets/lts_dialog.h>
#include <DDS/Core/core_ftc.h>
#include <QPointer>
#include <memory>
#include <NGLLogger/NGLLoggerBootstrap.h>
/*
Anmerkungen:
slotTryLock
-> slotTryLock
-> tryLockEntityRequest
<- onTryLockEntityReply
emit signalLockDialog | emit signalUnlockDialog
PpmGuiPlugin:
- ParticipantOrganisationDialog (asSupportService==false)
a) avoid disabling by overloading ::lock() -> yes
b) use tryLockTopicNew -> yes
- ParticipantEdit (asSupportService==false||true)
a) avoid disabling by overloading ::lock() -> yes
b) use tryLockTopicNew -> yes
3 TacticalOrganisation
-> left and right <-
onReinitLeft, onReinitRight
*/
namespace LtsSession
{
class LTSSESSION_EXPORT TopicLockHandler : public QObject
{
Q_OBJECT
public:
TopicLockHandler();
~TopicLockHandler();
bool init(const std::shared_ptr<Core::Interface::Ftc> &coreFtc, int exerciseId);
bool isLocked() const { return m_locked; }
LtsWidgets::TopicInfo getTopicInfo() const { return m_topicInfo; }
public slots:
void slotTryLock(const LtsWidgets::TopicInfo &topicInfo);
bool slotUnlock();
void slotFinalize(); // unlock, finally delete
signals:
void signalLockDialog(const QString &lockedBy);
void signalUnlockDialog();
private:
bool lock();
bool unlock();
std::string objStateAsString() const;
std::shared_ptr<Core::Interface::Ftc> m_coreFtc;
LtsWidgets::TopicInfo m_topicInfo;
int m_lockEntityId{0}; // reply.id(); / set by reply of ddsCall
int m_exerciseId{0};
bool m_locked{false};
bool m_askedForLock{false}; // reply does not tell..
bool m_deleteAfterAnswer{false};
NGL::INGLLogger &m_logger;
};
class LTSSESSION_EXPORT TopicLockHanderData : public QObject
{
Q_OBJECT
public:
TopicLockHanderData();
~TopicLockHanderData();
void init(const std::shared_ptr<Core::Interface::Ftc> &coreFtc, int exerciseId);
void unlock();
void slotTryLock(const LtsWidgets::TopicInfo &topicInfo);
bool isLocked() const;
LtsWidgets::TopicInfo getTopicInfo() const;
const QString &getLockedBy() const { return m_lockedBy; }
Q_SIGNALS:
void lockDataChanged();
private Q_SLOTS:
void slotLock(const QString &lockedBy);
void slotUnlock();
public:
QString m_debugName;
private:
QPointer<TopicLockHandler> m_topicLockHandler;
QString m_lockedBy;
};
} // namespace LtsSession
@@ -1,238 +0,0 @@
#ifdef BUILD_RTI
/**
* @RDE_HEADER@
* Manages all the Sessions
* $Id$
* $HeadURL$
* $Author$
*
* Created by Mike Wille, SLSE, 2016-05-15
*/
#include "lts_session_manager.h"
#include "lts_session.h"
#include <LtsPluginManager/lts_plugin_loader.h>
#include <LtsPluginManager/lts_plugin_manager.h>
#include <LtsSession/lts_session_data.h>
#include <LtsWidgets/lts_wait_dialog.h>
#include <NGLLogger/NGLLoggerBootstrap.h>
#include <PluginInterfaces/data_plugin_interface.h>
#include <PluginInterfaces/gui_plugin_interface.h>
#ifdef BUILD_RTI
#include <DDS/DDSConnector/dds_connector.h>
#endif
#include <QtCore/QDebug>
namespace LtsSession
{
LtsSessionManager::LtsSessionManager()
: QObject(), m_appId(LtsAppDescriptor::App::Login), m_headless(false),
m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger().getNGLLogger("LtsSession.Manager"))
{
}
LtsSessionManager::~LtsSessionManager()
{
// qCritical() << "~LtsSessionManager";
for (auto i = m_sessionMap.begin(); i != m_sessionMap.end(); ++i)
{
LtsSession* session = i.value();
session->setInactive();
session->deleteLater();
}
}
bool LtsSessionManager::init(const DdsConnectionParams& connParams,
const QVector<LtsPluginManager::AppPluginInstance>& dataPluginList,
const QVector<LtsPluginManager::AppPluginInstance>& guiPluginList,
LtsAppDescriptor::App appId, const QString& workspaceId, bool headless,
bool hidden) // TODO: what to return ?
{
// TODO: check if maps empty?
m_dataPluginList = dataPluginList;
m_guiPluginList = guiPluginList;
m_appId = appId;
m_headless = headless;
// shortcut: on first login etc. we go through ExerciseChooser to select an exercise
// but when we're already in the exercise and starting an app from within,
// we don't want to have the exercise chooser a second time -> directly go through app
// and show the base layout
// ????? Der Kommentar stimmt leider nicht. Loest leider nicht das Problem.
bool bHasBaseLayout = connParams.exerciseId > 0;
LtsSession* session =
createSession(connParams, bHasBaseLayout, true, hidden); // start Admin Session (for login, etc.)
session->setWorkspaceId(workspaceId);
return session;
}
QVector<LtsSession*> LtsSessionManager::sessions()
{
return m_sessionMap.values().toVector();
// QVector<LtsSession *> result;
// for (auto i = m_sessionMap.begin(); i != m_sessionMap.end(); ++i)
// result.append(i.value());
// return result;
}
void LtsSessionManager::softQuit()
{
for (auto i = m_sessionMap.begin(); i != m_sessionMap.end(); ++i)
{
LtsSession* session = *i;
session->aboutToClose();
session->setInactive();
session->deleteLater();
}
m_sessionMap.clear();
emit hideAllOtherBLWs(nullptr); // for tablet mode! shows another hidden session from some other app or maybe the
// same app, after the visible one was hidden
QMetaObject::invokeMethod(this, &LtsSessionManager::signalQuit,
Qt::QueuedConnection); // wait until all Session's deleteLater is done
}
LtsSession* LtsSessionManager::createSession(const DdsConnectionParams& connParams, bool hasBaseLayout, bool payloads,
bool hidden)
{
LtsSession* session = getSession(connParams.partitionType, connParams.partitionId);
if (session != nullptr)
{
WARNING_LOG(m_logger) << "Tried to create a Session that already exists";
return nullptr;
}
session = new LtsSession(this);
connect(session, &LtsSession::signalQuit, this, &LtsSessionManager::signalQuit);
// QueuedConnection since Qt5.9.1 seems to send the buttonRelease event again when entering an
// eventloop within this slot. Not yet clear why this happens
connect(session, &LtsSession::signalClose, this, &LtsSessionManager::slotCloseSession, Qt::QueuedConnection);
connect(session, &LtsSession::signalLogout, this, &LtsSessionManager::signalLogout);
connect(session, &LtsSession::signalInitializationAborted, this, &LtsSessionManager::signalInitializationAborted);
connect(session, &LtsSession::hideAllOtherBLWs, this, &LtsSessionManager::hideAllOtherBLWs);
connect(session, &LtsSession::taskSwitch, this, &LtsSessionManager::taskSwitch);
#ifdef LTS_DEBUG
connect(session, &LtsSession::signalStillAlive, this, [this]() {
LtsSession* session = qobject_cast<LtsSession*>(sender());
for (auto i = m_sessionMap.constBegin(); i != m_sessionMap.constEnd(); ++i)
{
if (i.value() == session)
return;
}
WARNING_LOG(m_logger) << "Previously deleted Session " << session->partitionId() << "/"
<< session->partitionType() << " is still alive!";
});
#endif
if (hasBaseLayout)
session->setBaseLayoutVisible(); // after payloads are done (if any), the base layout will be created
if (payloads)
session->setPayloadsEnabled();
m_sessionMap[SessionKey(connParams.partitionType, connParams.partitionId)] = session;
LtsSession* globSession = getSession(IDL::PartitionType::Global, 0);
if (globSession && globSession->ddsConnector() && globSession->domainId() == connParams.domainId)
{
dds::domain::DomainParticipant dp = globSession->ddsConnector()->getDomainParticipant();
if (!session->init(dp, connParams, m_dataPluginList,
m_guiPluginList)) // init not successful? return invalid ptr
{
session->deleteLater();
return nullptr;
}
}
else
{
/*
* init SOLLTE asynchron ablaufen.
* init läuft aber synchron, da die Payloads der Plugins DIrectConnections benutzen.
* AUf QueuedCOnnections umbauen ist schwerer, da init mit einem SessionCount von 0 rechnet, da init blocking
* ist und es daher nicht zum aufruf m_sessionMap[...] = ...; kommt......
*/
if (!session->init(connParams, m_dataPluginList, m_guiPluginList,
hidden)) // init not successful? return invalid ptr
{
session->deleteLater();
return nullptr;
}
}
if (session->isInitializationDone())
QMetaObject::invokeMethod(this, &LtsSessionManager::signalInitializationFinished, Qt::QueuedConnection);
else
connect(session, &LtsSession::signalDoneInitializingSession, this,
&LtsSessionManager::signalInitializationFinished, Qt::QueuedConnection);
return session;
}
void LtsSessionManager::slotCloseSession()
{
LtsSession* session = qobject_cast<LtsSession*>(QObject::sender());
if (!session)
{
FATAL_LOG(m_logger)
<< "LtsSessionManager: slot called without object - so it cannot be deleted from the session list!";
return;
}
bool found = false;
for (auto i = m_sessionMap.begin(); i != m_sessionMap.end(); ++i)
{
if (i.value() == session)
{
const auto key = i.key();
session->aboutToClose();
session->setInactive();
session->deleteLater();
m_sessionMap.remove(key); // when destruction takes a long time, a new session may have been added which
// invalidated the iterator
found = true;
break;
}
}
if (!found)
FATAL_LOG(m_logger) << "LtsSessionManager: Cannot find Session in map!";
emit hideAllOtherBLWs(nullptr); // for tablet mode! shows another hidden session from some other app or maybe the
// same app, after the visible one was hidden
if (m_sessionMap.isEmpty()) // quit app if all sessions closed
emit signalQuit();
}
LtsSession* LtsSessionManager::getSession(IDL::PartitionType partitionType, int partitionId)
{
auto it = m_sessionMap.find(SessionKey(partitionType, partitionId));
if (it != m_sessionMap.end()) // session found? return it!
return it.value();
return nullptr; // not found
}
} // namespace LtsSession
#endif // BUILD_RTI
@@ -1,126 +0,0 @@
/**
* @RDE_HEADER@
* Manages all the Sessions
* $Id$
* $HeadURL$
* $Author$
*
* Created by Mike Wille, SLSE, 2016-05-15
*/
#pragma once
#ifdef BUILD_RTI
#include <Lts/Common/ProjectConfig/project_defines.h>
#include <LtsPluginManager/lts_plugin_loader.h>
#include <LtsPluginManager/lts_plugin_manager.h>
#include <LtsSession/ltssession_export.h>
#include <QtCore/QMap>
#include <QtCore/QObject>
#include <QtCore/QString>
#include <QtCore/QVector>
#include <memory>
namespace NGL
{
class INGLLogger;
}
namespace DeveloperTools
{
class AppWidget;
}
namespace LtsSession
{
class LtsSession;
struct DdsConnectionParams;
class LTSSESSION_EXPORT LtsSessionManager : public QObject
{
Q_OBJECT
public:
LtsSessionManager();
~LtsSessionManager();
// create a new session, return old session if already exists [allowClosingSession => true => base layout close =
// close session | false => base layout close = base layout hide + session still open]
LtsSession* createSession(const DdsConnectionParams& connParams, bool hasBaseLayout = true, bool payloads = true,
bool hidden = false);
// return an already created session or null
LtsSession* getSession(IDL::PartitionType partitionType, int partitionId);
bool init(const DdsConnectionParams& connParams, const QVector<LtsPluginManager::AppPluginInstance>& dataPluginList,
const QVector<LtsPluginManager::AppPluginInstance>& guiPluginList, LtsAppDescriptor::App appId,
const QString& workspaceId, bool headless, bool hidden);
int sessionCount() const
{
return m_sessionMap.count();
}
LtsAppDescriptor::App appId() const
{
return m_appId;
}
bool isHeadless() const
{
return m_headless;
}
QVector<LtsSession*> sessions();
void softQuit();
private:
friend class DeveloperTools::DevDialog;
friend class DeveloperTools::AppWidget;
struct SessionKey
{
SessionKey(IDL::PartitionType pt = IDL::PartitionType::Any, int pId = 0) : partitionType(pt), partitionId(pId)
{
}
IDL::PartitionType partitionType;
int partitionId;
bool operator<(const SessionKey& o) const
{
if (partitionType != o.partitionType)
return partitionType < o.partitionType;
return partitionId < o.partitionId;
}
};
void logout();
void addPayloads(LtsSession* session);
QMap<SessionKey, LtsSession*> m_sessionMap;
QVector<LtsPluginManager::AppPluginInstance> m_dataPluginList;
QVector<LtsPluginManager::AppPluginInstance> m_guiPluginList;
LtsAppDescriptor::App m_appId;
bool m_headless;
NGL::INGLLogger& m_logger;
private slots:
void slotCloseSession();
signals:
/**
* @brief signalStopBlock (see slotCloseRequest)
*/
void signalStopBlock();
void signalLogout();
void signalQuit();
void signalInitializationFinished();
void signalInitializationAborted();
void hideAllOtherBLWs(QObject* caller);
void taskSwitch(QObject* caller);
};
} // namespace LtsSession
#endif // BUILD_RTI