Fix FileManagement Build-Fehler (BUILD_RTI=OFF)
- flm_db.h: Stub-Header mit Folder/FileContent Klassen erstellt - flm_enums.hpp: MainFolder Enum hinzugefügt (None=0) - flm_translation.h: toInt() entfernt, trFolderName() angepasst - Plugin-Interfaces erstellt (flm, opm, exm) - Viewer-Dialogs: QString-Konvertierungen behoben - AdvancedSymbology CMakeLists.txt: Ungültige Pfade entfernt - ism_mounting_point.cpp: Redundante Definitionen entfernt Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
1 parent
c21083700a
commit
e5d8bfa432
15 files changed
+815
-91
No files matched your search
@@ -15,8 +15,6 @@ ADD_SUBDIRECTORY(Helper)
|
||||
ADD_INTERFACE_LIBRARY(AsbDataPluginInterface
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/asb_data_plugin_interface.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/..
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../Viewer/SituationMap
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../Viewer/SituationMap/Symbology
|
||||
DataPluginInterface
|
||||
advancedSymbology
|
||||
Qt6::Gui
|
||||
|
||||
+1
-58
@@ -146,66 +146,9 @@ void MountingPoint::setHasAssociatedAssetDefect(bool hasDefect) {
|
||||
m_hasAssociatedAssetDefect = hasDefect;
|
||||
}
|
||||
|
||||
MountingPointState MountingPoint::getNextMountingPointState(MountingPointState currState) const {
|
||||
MountingPointState MountingPoint::getNextMountingPointState(MountingPointState currState) {
|
||||
Q_UNUSED(currState);
|
||||
return MountingPointState();
|
||||
}
|
||||
|
||||
const StructureElement &MountingPoint::data() const {
|
||||
return m_data;
|
||||
}
|
||||
|
||||
void MountingPoint::updateData(const StructureElement &data, int floorId) {
|
||||
m_data = data;
|
||||
m_floor = floorId;
|
||||
}
|
||||
|
||||
int32_t MountingPoint::associatedAssetId() const {
|
||||
return m_associatedAssetId;
|
||||
}
|
||||
|
||||
bool MountingPoint::hasAssociatedAsset() const {
|
||||
return m_associatedAssetId >= 0;
|
||||
}
|
||||
|
||||
bool MountingPoint::hasAssociatedAssetDefect() const {
|
||||
return m_hasAssociatedAssetDefect;
|
||||
}
|
||||
|
||||
MountingPointState MountingPoint::aimState() const {
|
||||
return m_aimState;
|
||||
}
|
||||
|
||||
void MountingPoint::setAimState(const MountingPointState &mps) {
|
||||
m_aimState = mps;
|
||||
}
|
||||
|
||||
bool MountingPoint::isValid() const {
|
||||
return m_isValid;
|
||||
}
|
||||
|
||||
Core::RelativePosition MountingPoint::relPosition() const {
|
||||
return m_data.relPosition();
|
||||
}
|
||||
|
||||
int32_t MountingPoint::buildingId() const {
|
||||
return m_data.mainStructureElementId();
|
||||
}
|
||||
|
||||
int MountingPoint::floor() const {
|
||||
return m_floor;
|
||||
}
|
||||
|
||||
void MountingPoint::setFloor(int floor) {
|
||||
m_floor = floor;
|
||||
}
|
||||
|
||||
QByteArray MountingPoint::properties() const {
|
||||
return QByteArray::fromStdString(m_data.properties());
|
||||
}
|
||||
|
||||
QString MountingPoint::type() const {
|
||||
return QString::number(static_cast<int>(m_data.mountingPointTypeId()));
|
||||
}
|
||||
|
||||
} // namespace InfrastructureManagement
|
||||
@@ -88,7 +88,7 @@ QVariant DialogModelFile::data(const QModelIndex &index, int role) const
|
||||
switch (index.column())
|
||||
{
|
||||
case NAME:
|
||||
return QString::fromStdString(fl.name());
|
||||
return fl.name();
|
||||
case ISTEMPLATE:
|
||||
return fl.isTemplate() ? tr("Yes") : tr("No");
|
||||
case FOLDER:
|
||||
@@ -110,7 +110,7 @@ QVariant DialogModelFile::data(const QModelIndex &index, int role) const
|
||||
case USES:
|
||||
return QString::fromStdString(fl.usedBy());
|
||||
case LASTMODIFIED:
|
||||
return DTG::toStringMSec(fl.lastModified());
|
||||
return DTG::toStringMSec(fl.lastModified().toMSecsSinceEpoch());
|
||||
case PROPERTIES:
|
||||
return QString::fromStdString(fl.properties());
|
||||
default:
|
||||
@@ -136,7 +136,7 @@ int DialogModelFile::findFileIdFromName(const QString &fileName) const
|
||||
for (int row = 0; row < rc; ++row)
|
||||
{
|
||||
const FileManagement::FileContent &fl = this->getRowData(row);
|
||||
if (QString::fromStdString(fl.name()) == fileName)
|
||||
if (fl.name() == fileName)
|
||||
{
|
||||
return fl.id();
|
||||
}
|
||||
|
||||
@@ -152,7 +152,7 @@ bool DialogModelFolder::initModel(int exerciseId, const QVector<FileManagement::
|
||||
}
|
||||
}
|
||||
FileManagement::MainFolder mainFolder = static_cast<FileManagement::MainFolder>(data.path()[0]);
|
||||
//qCritical() << "Folder = " << QString::fromStdString(data.name()) << ", mainFolder = " << mainFolder.underlying();
|
||||
//qCritical() << "Folder = " << data.name() << ", mainFolder = " << mainFolder.underlying();
|
||||
if (!mainFolders.contains(mainFolder))
|
||||
{
|
||||
// qCritical() << "Excluded id = " << data.id();
|
||||
@@ -243,7 +243,7 @@ bool DialogModelFolder::onDeleteRow(const QModelIndex &idx, bool isFirstItem)
|
||||
{
|
||||
NGLTreeItem *item = privateData(idx);
|
||||
FileManagement::Folder data = item->data().value<FileManagement::Folder>();
|
||||
data.isDeleted(true);
|
||||
data.setDeleted(true);
|
||||
}
|
||||
removeRow(idx.row(), idx.parent());
|
||||
|
||||
@@ -289,9 +289,9 @@ bool DialogModelProxyFolder::lessThan(const QModelIndex &source_left, const QMod
|
||||
return FileManagement::toInt(folderLeft.mainFolder()) < FileManagement::toInt(folderRight.mainFolder());
|
||||
}
|
||||
|
||||
if (QString::fromStdString(folderLeft.name()) != QString::fromStdString(folderRight.name()))
|
||||
if (folderLeft.name() != folderRight.name())
|
||||
{
|
||||
return (QString::fromStdString(folderLeft.name()) < QString::fromStdString(folderRight.name()));
|
||||
return (folderLeft.name() < folderRight.name());
|
||||
}
|
||||
|
||||
return folderLeft.id() < folderRight.id();
|
||||
|
||||
@@ -314,7 +314,7 @@ void LtsFileDialogWidget::enaDisa()
|
||||
if (idxFile.isValid())
|
||||
{
|
||||
m_selectedFileContent = m_modelFile->getRowData(m_ui->widgetFiles->currentIndex().row());
|
||||
m_fileName = QString::fromStdString(m_selectedFileContent.name());
|
||||
m_fileName = m_selectedFileContent.name();
|
||||
m_ui->leFile->setText(m_fileName);
|
||||
}
|
||||
else
|
||||
@@ -352,7 +352,7 @@ bool LtsFileDialogWidget::showFile(const FileManagement::FileContent &fc, const
|
||||
const auto &fldPath = fld.path();
|
||||
|
||||
// filter in USER DOCUMENTS folder and subfolders
|
||||
if (LtsUtils::isInVector(fldPath, FileManagement::MainFolder::UserDocuments))
|
||||
if (LtsUtils::isInVector(fldPath, static_cast<int>(FileManagement::MainFolder::UserDocuments)))
|
||||
{
|
||||
const int operatorId = LtsSessionData::LtsSessionData::getInstance()->getOperatorId();
|
||||
// filter on User Category and OperatorId
|
||||
@@ -362,7 +362,7 @@ bool LtsFileDialogWidget::showFile(const FileManagement::FileContent &fc, const
|
||||
}
|
||||
|
||||
// filter in EXERCISE DOCUMENTS folder and subfolders
|
||||
if (LtsUtils::isInVector(fldPath, FileManagement::MainFolder::ExerciseDocuments))
|
||||
if (LtsUtils::isInVector(fldPath, static_cast<int>(FileManagement::MainFolder::ExerciseDocuments)))
|
||||
{
|
||||
// filter on Category = Exercise
|
||||
if (fc.fileCategory() != FileManagement::FileCategory::Exercise)
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* HMI Plugin for Exercisemanagemt (Interface for access from other Plugins)
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <PluginInterfaces/data_plugin_interface.h>
|
||||
#include <ExerciseManagement/exm_dtc.h>
|
||||
#include <ExerciseManagement/exm_ftc.h>
|
||||
#include <memory>
|
||||
|
||||
namespace ExerciseManagement
|
||||
{
|
||||
/**
|
||||
* @brief The DataInterface class provides the Topics Clients only for the GUI Plugins
|
||||
*/
|
||||
class DataInterface : public DataPluginBase::Interface
|
||||
{
|
||||
public:
|
||||
using DataPluginBase::Interface::Interface;
|
||||
|
||||
virtual std::shared_ptr<ExerciseManagement::Interface::Dtc> getDtc() = 0;
|
||||
virtual std::shared_ptr<ExerciseManagement::Interface::Ftc> getFtc() = 0;
|
||||
};
|
||||
|
||||
} // namespace ExerciseManagement
|
||||
@@ -0,0 +1,110 @@
|
||||
/**
|
||||
* ExerciseManagement Function Topic Client interface
|
||||
* STUB-HEADER: Diese Datei wird normalerweise von DDS generiert
|
||||
* Für die Migration erstellen wir minimale Implementierungen
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
#include <QObject>
|
||||
|
||||
namespace DDSConnector
|
||||
{
|
||||
class DdsConnector;
|
||||
}
|
||||
|
||||
namespace ExerciseManagement
|
||||
{
|
||||
namespace Interface
|
||||
{
|
||||
|
||||
// Forward declaration
|
||||
class Ftc;
|
||||
|
||||
// Reply Handler stub classes for Function Topics
|
||||
// These are normally generated from DDS IDL definitions
|
||||
|
||||
class GetExerciseDataReplyHandler
|
||||
{
|
||||
public:
|
||||
GetExerciseDataReplyHandler() = default;
|
||||
virtual ~GetExerciseDataReplyHandler() = default;
|
||||
virtual void onGetExerciseData(const void* /*reply*/) {}
|
||||
};
|
||||
|
||||
class ModifyExerciseDataReplyHandler
|
||||
{
|
||||
public:
|
||||
ModifyExerciseDataReplyHandler() = default;
|
||||
virtual ~ModifyExerciseDataReplyHandler() = default;
|
||||
virtual void onModifyExerciseData(const void* /*reply*/) {}
|
||||
};
|
||||
|
||||
class GetExercisePhaseDataReplyHandler
|
||||
{
|
||||
public:
|
||||
GetExercisePhaseDataReplyHandler() = default;
|
||||
virtual ~GetExercisePhaseDataReplyHandler() = default;
|
||||
virtual void onGetExercisePhaseData(const void* /*reply*/) {}
|
||||
};
|
||||
|
||||
// Ftc - Function Topic Client interface for ExerciseManagement
|
||||
class Ftc : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
virtual ~Ftc() = default;
|
||||
|
||||
/**
|
||||
* Create a new instance for ExerciseManagement::Interface::Ftc.
|
||||
* STUB: Returns nullptr - actual implementation would require DDS
|
||||
*/
|
||||
static std::shared_ptr<Ftc> create(const std::shared_ptr<DDSConnector::DdsConnector>& /*ddsConnector*/, bool /*forceCreate*/ = false)
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/**
|
||||
* A unique identifier for this FTC
|
||||
*/
|
||||
static inline const char* identifier() { return "ExerciseManagement.Interface.Ftc"; }
|
||||
|
||||
/**
|
||||
* Initialize this Ftc instance with all function topic clients
|
||||
*/
|
||||
virtual bool enableAll(bool /*enable*/ = true) { return false; }
|
||||
|
||||
/**
|
||||
* Enable/disable specific function topic clients
|
||||
*/
|
||||
virtual bool enableGetExerciseData(bool /*enable*/ = true) { return false; }
|
||||
virtual bool isGetExerciseDataEnabled() const { return false; }
|
||||
|
||||
virtual bool enableModifyExerciseData(bool /*enable*/ = true) { return false; }
|
||||
virtual bool isModifyExerciseDataEnabled() const { return false; }
|
||||
|
||||
virtual bool enableGetExercisePhaseData(bool /*enable*/ = true) { return false; }
|
||||
virtual bool isGetExercisePhaseDataEnabled() const { return false; }
|
||||
|
||||
/**
|
||||
* Request methods with reply handlers
|
||||
* STUB: Return -1 to indicate no request was sent
|
||||
*/
|
||||
virtual int64_t requestGetExerciseData(const void* /*request*/, GetExerciseDataReplyHandler* /*handler*/) { return -1; }
|
||||
virtual int64_t requestGetExerciseData(const void* /*request*/, const std::function<void(const void*)>& /*cb*/) { return -1; }
|
||||
virtual int64_t lastGetExerciseDataUniqueId() const { return -1; }
|
||||
|
||||
virtual int64_t requestModifyExerciseData(const void* /*request*/, ModifyExerciseDataReplyHandler* /*handler*/) { return -1; }
|
||||
virtual int64_t requestModifyExerciseData(const void* /*request*/, const std::function<void(const void*)>& /*cb*/) { return -1; }
|
||||
virtual int64_t lastModifyExerciseDataUniqueId() const { return -1; }
|
||||
|
||||
virtual int64_t requestGetExercisePhaseData(const void* /*request*/, GetExercisePhaseDataReplyHandler* /*handler*/) { return -1; }
|
||||
virtual int64_t requestGetExercisePhaseData(const void* /*request*/, const std::function<void(const void*)>& /*cb*/) { return -1; }
|
||||
virtual int64_t lastGetExercisePhaseDataUniqueId() const { return -1; }
|
||||
};
|
||||
|
||||
} // namespace Interface
|
||||
} // namespace ExerciseManagement
|
||||
@@ -0,0 +1,36 @@
|
||||
# Stub CMakeLists.txt für FileManagement Headers
|
||||
# Diese Datei stellt eine leere Library bereit damit andere Module linken können
|
||||
# ohne die vollständigen DDS-basierten Services zu benötigen
|
||||
|
||||
# FileManagement Stub Library mit Dtc-Implementierung
|
||||
add_library(FileManagement_Stub STATIC
|
||||
flm_dtc.cpp
|
||||
)
|
||||
target_include_directories(FileManagement_Stub
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
target_link_libraries(FileManagement_Stub
|
||||
PUBLIC
|
||||
Qt6::Core
|
||||
)
|
||||
set_target_properties(FileManagement_Stub PROPERTIES
|
||||
AUTOMOC ON
|
||||
)
|
||||
|
||||
# svcFlmCommon als ALIAS zu FileManagement_Stub für Kompatibilität
|
||||
add_library(svcFlmCommon ALIAS FileManagement_Stub)
|
||||
|
||||
# Leere Header-Only Library als Platzhalter für svcOpmCommon
|
||||
add_library(svcOpmCommon INTERFACE)
|
||||
target_include_directories(svcOpmCommon
|
||||
INTERFACE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../OperatorManagement/
|
||||
)
|
||||
|
||||
# Leere Header-Only Library als Platzhalter für svcExmCommon
|
||||
add_library(svcExmCommon INTERFACE)
|
||||
target_include_directories(svcExmCommon
|
||||
INTERFACE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../ExerciseManagement/
|
||||
)
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* FileManagement Explorer Interface for access from other Plugins
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Mike Wille, SLSE, 2017-03-31
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <PluginInterfaces/data_plugin_interface.h>
|
||||
#include <FileManagement/flm_dtc.h>
|
||||
#include <FileManagement/flm_ftc.h>
|
||||
|
||||
namespace FileManagement
|
||||
{
|
||||
/**
|
||||
* @brief The DataInterface class provides the Topics Clients only for the GUI Plugins
|
||||
*/
|
||||
class DataInterface : public DataPluginBase::Interface
|
||||
{
|
||||
public:
|
||||
using DataPluginBase::Interface::Interface;
|
||||
|
||||
virtual std::shared_ptr<FileManagement::Interface::Dtc> getDtc() = 0;
|
||||
virtual std::shared_ptr<FileManagement::Interface::Ftc> getFtc() = 0;
|
||||
};
|
||||
|
||||
} // namespace FileManagement
|
||||
@@ -0,0 +1,181 @@
|
||||
#pragma once
|
||||
|
||||
// STUB-HEADER: Diese Datei wird normalerweise von DDS/RTI Codegen generiert
|
||||
// Für die Migration mit BUILD_RTI=OFF erstellen wir minimale Implementierungen
|
||||
|
||||
#include "flm_enums.hpp"
|
||||
#include <QString>
|
||||
#include <QDateTime>
|
||||
#include <QByteArray>
|
||||
#include <vector>
|
||||
#include <cstdint>
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
|
||||
namespace FileManagement
|
||||
{
|
||||
|
||||
// Forward declarations
|
||||
class Folder;
|
||||
class FileContent;
|
||||
|
||||
/**
|
||||
* @brief Folder class - Stub für DDS-generierten Code
|
||||
*
|
||||
* Diese Klasse wird normalerweise von DDS aus flm_service.xml generiert.
|
||||
* Für BUILD_RTI=OFF verwenden wir diese minimale Implementierung.
|
||||
*/
|
||||
class Folder
|
||||
{
|
||||
public:
|
||||
Folder() : m_id(0), m_parentId(0), m_mainFolder(MainFolder::None), m_operatorId(0) {}
|
||||
|
||||
// Getter
|
||||
int32_t id() const { return m_id; }
|
||||
std::string name() const { return m_name.toStdString(); }
|
||||
int32_t parentId() const { return m_parentId; }
|
||||
std::vector<int32_t> path() const { return m_path; }
|
||||
QDateTime created() const { return m_created; }
|
||||
QDateTime modified() const { return m_modified; }
|
||||
MainFolder mainFolder() const { return m_mainFolder; }
|
||||
int32_t operatorId() const { return m_operatorId; }
|
||||
bool isHidden() const { return m_hidden; }
|
||||
bool isEditable() const { return m_editable; }
|
||||
bool isDeleted() const { return m_deleted; }
|
||||
|
||||
// Setter
|
||||
void setId(int32_t id) { m_id = id; }
|
||||
void setName(const QString& name) { m_name = name; }
|
||||
void setName(const std::string& name) { m_name = QString::fromStdString(name); }
|
||||
void setParentId(int32_t parentId) { m_parentId = parentId; }
|
||||
void setPath(const std::vector<int32_t>& path) { m_path = path; }
|
||||
void setCreated(const QDateTime& created) { m_created = created; }
|
||||
void setModified(const QDateTime& modified) { m_modified = modified; }
|
||||
void setMainFolder(MainFolder mainFolder) { m_mainFolder = mainFolder; }
|
||||
void setOperatorId(int32_t operatorId) { m_operatorId = operatorId; }
|
||||
void setHidden(bool hidden) { m_hidden = hidden; }
|
||||
void setEditable(bool editable) { m_editable = editable; }
|
||||
void setDeleted(bool deleted) { m_deleted = deleted; }
|
||||
|
||||
// Utility
|
||||
bool isValid() const { return m_id > 0; }
|
||||
|
||||
private:
|
||||
int32_t m_id;
|
||||
QString m_name;
|
||||
int32_t m_parentId;
|
||||
std::vector<int32_t> m_path;
|
||||
QDateTime m_created;
|
||||
QDateTime m_modified;
|
||||
MainFolder m_mainFolder;
|
||||
int32_t m_operatorId;
|
||||
bool m_hidden = false;
|
||||
bool m_editable = true;
|
||||
bool m_deleted = false;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief FileContent class - Stub für DDS-generierten Code
|
||||
*
|
||||
* Diese Klasse wird normalerweise von DDS aus flm_service.xml generiert.
|
||||
* Für BUILD_RTI=OFF verwenden wir diese minimale Implementierung.
|
||||
*/
|
||||
class FileContent
|
||||
{
|
||||
public:
|
||||
FileContent()
|
||||
: m_id(0)
|
||||
, m_fileId(0)
|
||||
, m_folderId(0)
|
||||
, m_operatorId(0)
|
||||
, m_exerciseId(std::nullopt)
|
||||
, m_phaseId(std::nullopt)
|
||||
, m_size(0)
|
||||
, m_fileStatus(FileStatus::Valid)
|
||||
, m_fileCategory(FileCategory::Global)
|
||||
, m_fileType(FileType::Unknown)
|
||||
, m_isTemplate(false)
|
||||
, m_mainFolder(MainFolder::None)
|
||||
, m_hidden(false)
|
||||
, m_used(false)
|
||||
{
|
||||
}
|
||||
|
||||
// Getter
|
||||
int32_t id() const { return m_id; }
|
||||
int32_t fileId() const { return m_fileId; }
|
||||
int32_t folderId() const { return m_folderId; }
|
||||
int32_t operatorId() const { return m_operatorId; }
|
||||
std::optional<int32_t> exerciseId() const { return m_exerciseId; }
|
||||
std::optional<int32_t> phaseId() const { return m_phaseId; }
|
||||
QString name() const { return m_fileName; }
|
||||
QString fileName() const { return m_fileName; }
|
||||
QString mimeType() const { return m_mimeType; }
|
||||
int64_t size() const { return m_size; }
|
||||
QByteArray content() const { return m_content; }
|
||||
std::string properties() const { return m_properties; }
|
||||
QDateTime created() const { return m_created; }
|
||||
QDateTime modified() const { return m_modified; }
|
||||
QDateTime lastModified() const { return m_modified; }
|
||||
FileStatus fileStatus() const { return m_fileStatus; }
|
||||
FileCategory fileCategory() const { return m_fileCategory; }
|
||||
FileType fileType() const { return m_fileType; }
|
||||
bool isTemplate() const { return m_isTemplate; }
|
||||
bool isDeleted() const { return m_fileStatus == FileStatus::Deleted; }
|
||||
bool isHidden() const { return m_hidden; }
|
||||
bool isUsedBy() const { return m_used; }
|
||||
std::string usedBy() const { return m_usedBy; }
|
||||
MainFolder mainFolder() const { return m_mainFolder; }
|
||||
|
||||
// Setter
|
||||
void setId(int32_t id) { m_id = id; }
|
||||
void setFileId(int32_t fileId) { m_fileId = fileId; }
|
||||
void setFolderId(int32_t folderId) { m_folderId = folderId; }
|
||||
void setOperatorId(int32_t operatorId) { m_operatorId = operatorId; }
|
||||
void setExerciseId(std::optional<int32_t> exerciseId) { m_exerciseId = exerciseId; }
|
||||
void setPhaseId(std::optional<int32_t> phaseId) { m_phaseId = phaseId; }
|
||||
void setName(const QString& fileName) { m_fileName = fileName; }
|
||||
void setFileName(const QString& fileName) { m_fileName = fileName; }
|
||||
void setMimeType(const QString& mimeType) { m_mimeType = mimeType; }
|
||||
void setSize(int64_t size) { m_size = size; }
|
||||
void setContent(const QByteArray& content) { m_content = content; }
|
||||
void setProperties(const std::string& properties) { m_properties = properties; }
|
||||
void setCreated(const QDateTime& created) { m_created = created; }
|
||||
void setModified(const QDateTime& modified) { m_modified = modified; }
|
||||
void setFileStatus(FileStatus status) { m_fileStatus = status; }
|
||||
void setFileCategory(FileCategory category) { m_fileCategory = category; }
|
||||
void setFileType(FileType type) { m_fileType = type; }
|
||||
void setTemplate(bool isTemplate) { m_isTemplate = isTemplate; }
|
||||
void setHidden(bool hidden) { m_hidden = hidden; }
|
||||
void setUsedBy(bool used) { m_used = used; }
|
||||
void setUsedBy(const std::string& usedBy) { m_usedBy = usedBy; m_used = !usedBy.empty(); }
|
||||
void setMainFolder(MainFolder mainFolder) { m_mainFolder = mainFolder; }
|
||||
|
||||
// Utility
|
||||
bool isValid() const { return m_id > 0; }
|
||||
|
||||
private:
|
||||
int32_t m_id;
|
||||
int32_t m_fileId;
|
||||
int32_t m_folderId;
|
||||
int32_t m_operatorId;
|
||||
std::optional<int32_t> m_exerciseId;
|
||||
std::optional<int32_t> m_phaseId;
|
||||
QString m_fileName;
|
||||
QString m_mimeType;
|
||||
int64_t m_size;
|
||||
QByteArray m_content;
|
||||
std::string m_properties;
|
||||
QDateTime m_created;
|
||||
QDateTime m_modified;
|
||||
FileStatus m_fileStatus;
|
||||
FileCategory m_fileCategory;
|
||||
FileType m_fileType;
|
||||
bool m_isTemplate;
|
||||
MainFolder m_mainFolder;
|
||||
bool m_hidden;
|
||||
bool m_used;
|
||||
std::string m_usedBy;
|
||||
};
|
||||
|
||||
} // namespace FileManagement
|
||||
@@ -1,34 +1,152 @@
|
||||
#pragma once
|
||||
|
||||
// STUB-HEADER: Diese Datei wird normalerweise von ddsdtc generiert
|
||||
// Für die Migration erstellen wir minimale Typ-Definitionen
|
||||
// Für die Migration erstellen wir minimale Typ-Definitionen basierend auf flm_service.xml
|
||||
|
||||
#include <QtCore/QString>
|
||||
|
||||
namespace FileManagement
|
||||
{
|
||||
// Placeholder enums - werden durch echte DDS-Typen ersetzt
|
||||
enum class SymbolAppearance : int { Solid = 0, Dashed = 1, Dotted = 2 };
|
||||
// Enums aus flm_service.xml
|
||||
enum class FileStatus : int { Valid = 0, Deleted = 1 };
|
||||
|
||||
enum class SymbolVisibility : int { Visible = 0, Hidden = 1 };
|
||||
enum class FileCategory : int { Global = 1, Exercise = 2, User = 3 };
|
||||
|
||||
// STUB: FileType enum
|
||||
enum class FileType : int { Unknown = 0, Image = 1, Video = 2, Audio = 3, Document = 4 };
|
||||
|
||||
// STUB: FileContent struct
|
||||
struct FileContent
|
||||
{
|
||||
int id = 0;
|
||||
int fileId = 0;
|
||||
FileType type = FileType::Unknown;
|
||||
QString fileName;
|
||||
QByteArray data;
|
||||
enum class FileType : int {
|
||||
Unknown = 0,
|
||||
Text = 1,
|
||||
Xml = 2,
|
||||
Pdf = 3,
|
||||
Jpg = 4,
|
||||
Png = 5,
|
||||
TacticalPlan = 6,
|
||||
OperatorFavourite = 7,
|
||||
OperatorDefinedSymbol = 8,
|
||||
OpenOfficeDocument = 9,
|
||||
OpenOfficeSpreadsheet = 10,
|
||||
OpenOfficePresentation = 11,
|
||||
MSOfficeDocument = 12,
|
||||
MSOfficeDocument97 = 13,
|
||||
MSOfficeSpreadsheet = 14,
|
||||
MSOfficeSpreadsheet97 = 15,
|
||||
MSOfficePresentation = 16,
|
||||
MSOfficePresentation97 = 17,
|
||||
Zip = 18,
|
||||
Gif = 19,
|
||||
Bmp = 20,
|
||||
Tiff = 21,
|
||||
Wmf = 22,
|
||||
Emf = 23,
|
||||
Rtf = 24,
|
||||
Html = 25,
|
||||
Hlp = 26,
|
||||
Wps = 27,
|
||||
Wpd = 28,
|
||||
Wk3 = 29,
|
||||
Wk4 = 30,
|
||||
Wks = 31,
|
||||
Wr1 = 32,
|
||||
Wr3 = 33,
|
||||
Wq1 = 34,
|
||||
Wq2 = 35,
|
||||
Dif = 36,
|
||||
Dbf = 37,
|
||||
Slk = 38,
|
||||
Xlk = 39,
|
||||
Doc = 40,
|
||||
Dot = 41,
|
||||
Xls = 42,
|
||||
Xlt = 43,
|
||||
Ppt = 44,
|
||||
Pps = 45,
|
||||
Pot = 46,
|
||||
Accdb = 47,
|
||||
Accde = 48,
|
||||
Mwcd = 49,
|
||||
Mwct = 50,
|
||||
Mwcz = 51,
|
||||
Mwcu = 52,
|
||||
Ods = 53,
|
||||
Odt = 54,
|
||||
Odp = 55,
|
||||
Odg = 56,
|
||||
Odf = 57,
|
||||
Odc = 58,
|
||||
Odi = 59,
|
||||
Odm = 60,
|
||||
Otg = 61,
|
||||
Oth = 62,
|
||||
Ots = 63,
|
||||
Ott = 64,
|
||||
Oxt = 65,
|
||||
Six = 66,
|
||||
Msg = 67,
|
||||
Vsd = 68,
|
||||
Vdx = 69,
|
||||
Vsx = 70,
|
||||
Vtx = 71,
|
||||
Vss = 72,
|
||||
Vst = 73,
|
||||
Vsw = 74,
|
||||
VsdX = 75,
|
||||
VssX = 76,
|
||||
VstX = 77,
|
||||
VdxX = 78,
|
||||
VsxX = 79,
|
||||
VtxX = 80,
|
||||
Dwg = 81,
|
||||
Dxf = 82,
|
||||
Dgn = 83,
|
||||
Cgm = 84,
|
||||
Cal = 85,
|
||||
Mil = 86,
|
||||
Img = 87,
|
||||
Grib = 88,
|
||||
Grb2 = 89,
|
||||
Wkt = 90,
|
||||
Shp = 91,
|
||||
Tab = 92,
|
||||
Mif = 93,
|
||||
E00 = 94,
|
||||
Aml = 95,
|
||||
Coverage = 96,
|
||||
Tin = 97,
|
||||
Grid = 98,
|
||||
Lyr = 99,
|
||||
Lrx = 100,
|
||||
Pmf = 101,
|
||||
Pmz = 102,
|
||||
Sxd = 103,
|
||||
Sxm = 104,
|
||||
Sxg = 105,
|
||||
Sxi = 106,
|
||||
Sxc = 107,
|
||||
Sxw = 108,
|
||||
Stw = 109,
|
||||
Sxv = 110,
|
||||
Sxd2 = 111,
|
||||
Sxm2 = 112,
|
||||
Sxg2 = 113,
|
||||
Sxi2 = 114,
|
||||
Sxc2 = 115,
|
||||
Sxw2 = 116,
|
||||
Stw2 = 117,
|
||||
Sxv2 = 118,
|
||||
Video = 119,
|
||||
Audio = 120,
|
||||
Flash = 121,
|
||||
Svg = 122,
|
||||
Svgz = 123
|
||||
};
|
||||
|
||||
struct UnitSymbolPosition
|
||||
{
|
||||
double x = 0.0;
|
||||
double y = 0.0;
|
||||
double z = 0.0;
|
||||
};
|
||||
// MainFolder Enum
|
||||
enum class MainFolder : int { None = 0, GlobalDocuments = 1, UserDocuments = 2, ExerciseDocuments = 3 };
|
||||
|
||||
// Helper-Funktion
|
||||
inline int toInt(MainFolder folder) { return static_cast<int>(folder); }
|
||||
|
||||
// Forward declarations
|
||||
class Folder;
|
||||
class FileContent;
|
||||
class Ftc;
|
||||
} // namespace FileManagement
|
||||
@@ -0,0 +1,20 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* FileManagement Topic Client Stub (BUILD_RTI=OFF)
|
||||
* Normally generated from flm_service.xml by DDS Code Generator
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace FileManagement
|
||||
{
|
||||
namespace Interface
|
||||
{
|
||||
|
||||
// Forward declaration - actual implementation provided by DDS when BUILD_RTI=ON
|
||||
class Ftc;
|
||||
|
||||
} // namespace Interface
|
||||
} // namespace FileManagement
|
||||
@@ -0,0 +1,73 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* Convert DSS enumerations to translatable strings
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
// filename: flm_translation.h
|
||||
|
||||
#include "flm_enums.hpp"
|
||||
#include <QString>
|
||||
|
||||
namespace FileManagement
|
||||
{
|
||||
// Translatable enumerations:
|
||||
inline QString toString(FileType state)
|
||||
{
|
||||
switch (state) {
|
||||
case FileType::Unknown: return QStringLiteral("Unknown");
|
||||
case FileType::Text: return QStringLiteral("Text");
|
||||
case FileType::Xml: return QStringLiteral("XML");
|
||||
case FileType::Pdf: return QStringLiteral("PDF");
|
||||
case FileType::Jpg: return QStringLiteral("Image");
|
||||
case FileType::Png: return QStringLiteral("Image");
|
||||
case FileType::Gif: return QStringLiteral("Image");
|
||||
case FileType::Bmp: return QStringLiteral("Image");
|
||||
case FileType::Tiff: return QStringLiteral("Image");
|
||||
case FileType::Video: return QStringLiteral("Video");
|
||||
case FileType::Audio: return QStringLiteral("Audio");
|
||||
case FileType::MSOfficeDocument:
|
||||
case FileType::MSOfficeDocument97:
|
||||
case FileType::OpenOfficeDocument:
|
||||
case FileType::Doc:
|
||||
case FileType::Odt:
|
||||
case FileType::Ods:
|
||||
case FileType::Odp:
|
||||
return QStringLiteral("Document");
|
||||
case FileType::TacticalPlan: return QStringLiteral("TacticalPlan");
|
||||
case FileType::OperatorFavourite: return QStringLiteral("OperatorFavourite");
|
||||
case FileType::OperatorDefinedSymbol: return QStringLiteral("OperatorDefinedSymbol");
|
||||
default: return QStringLiteral("Unknown");
|
||||
}
|
||||
}
|
||||
|
||||
inline QString toString(FileCategory state)
|
||||
{
|
||||
switch (state) {
|
||||
case FileCategory::Global: return QStringLiteral("Global");
|
||||
case FileCategory::Exercise: return QStringLiteral("Exercise");
|
||||
case FileCategory::User: return QStringLiteral("User");
|
||||
default: return QStringLiteral("Unknown");
|
||||
}
|
||||
}
|
||||
|
||||
inline QString toString(FileStatus state)
|
||||
{
|
||||
switch (state) {
|
||||
case FileStatus::Valid: return QStringLiteral("Valid");
|
||||
case FileStatus::Deleted: return QStringLiteral("Deleted");
|
||||
default: return QStringLiteral("Unknown");
|
||||
}
|
||||
}
|
||||
|
||||
// Translatable struct members:
|
||||
inline QString trFolderName(const QString &text)
|
||||
{
|
||||
return text;
|
||||
}
|
||||
|
||||
} // namespace FileManagement
|
||||
+145
@@ -0,0 +1,145 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* The MountingPoint class wraps all information from InfrastructureManagement which defines a mounting point
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Hannes Baeuerle, SLSE, 2017-01-16
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "ismshared_export.h"
|
||||
#include "ism.hpp"
|
||||
#include <QImage>
|
||||
|
||||
|
||||
namespace dds
|
||||
{
|
||||
namespace core
|
||||
{
|
||||
static inline uint qHash(const InfrastructureManagement::MountingPointType &mpt)
|
||||
{
|
||||
return ::qHash(static_cast<int32_t>(mpt));
|
||||
}
|
||||
} // namespace core
|
||||
} // namespace dds
|
||||
|
||||
namespace InfrastructureManagement
|
||||
{
|
||||
|
||||
class ISMSHARED_EXPORT MountingPoint
|
||||
{
|
||||
public:
|
||||
explicit MountingPoint();
|
||||
explicit MountingPoint(const StructureElement &data, int floorId);
|
||||
static void init();
|
||||
|
||||
const StructureElement &data() const { return m_data; }
|
||||
void updateData(const StructureElement &data, int floorId) { m_data = data; m_floor = floorId; }
|
||||
int32_t id() const { return m_data.id(); }
|
||||
int32_t associatedAssetId() const { return m_associatedAssetId; }
|
||||
bool hasAssociatedAsset() const { return m_associatedAssetId > 0; }
|
||||
bool hasAssociatedAssetDefect() const { return m_hasAssociatedAssetDefect; }
|
||||
|
||||
/*! \name aimState depends on the (loaded) plan/schedule!!! */
|
||||
//@{
|
||||
|
||||
//! \brief aimState of currently loaded schedule!!!
|
||||
//! \return aimState
|
||||
MountingPointState aimState() const { return m_aimState; }
|
||||
void setAimState(const MountingPointState &mps) { m_aimState = mps;}
|
||||
|
||||
//@}
|
||||
|
||||
bool isValid() const { return m_isValid; }
|
||||
Core::GeoPosition geoPosition() const { return m_data.geoPosition(); }
|
||||
Core::RelativePosition relPosition() const { return m_data.relPosition(); }
|
||||
MountingPointType type() const { return m_data.mountingPointTypeId(); }
|
||||
int32_t buildingId() const { return m_data.mainStructureElementId(); }
|
||||
QString name() const;
|
||||
QString fileName() const;
|
||||
QByteArray properties() const { return m_data.properties().c_str(); }
|
||||
|
||||
QImage toImage(int32_t edgeLength = 100) const;
|
||||
bool writeFile(int32_t edgeLength = 25) const;
|
||||
int floor() const { return m_floor; }
|
||||
void setFloor(int floor) { m_floor = floor; }
|
||||
|
||||
void setAssociatedAssetId(int32_t id);
|
||||
void setHasAssociatedAssetDefect(bool hasAssociatedAssetDefect);
|
||||
MountingPointState getNextMountingPointState(const MountingPointState currState);
|
||||
|
||||
private: // methods
|
||||
|
||||
private: // attributes
|
||||
StructureElement m_data;
|
||||
int32_t m_associatedAssetId;
|
||||
MountingPointState m_aimState;
|
||||
bool m_hasAssociatedAssetDefect;
|
||||
bool m_isValid;
|
||||
int m_floor;
|
||||
|
||||
public:
|
||||
|
||||
enum class MpColor
|
||||
{
|
||||
GRAY,
|
||||
BLUE,
|
||||
RED,
|
||||
GREEN,
|
||||
ORANGE
|
||||
};
|
||||
static QString mpColorToString(MpColor mpColor);
|
||||
static QString mpColorToPostfix(MpColor mpColor);
|
||||
|
||||
struct NameImagePair
|
||||
{
|
||||
NameImagePair(const QString &name = QString(),
|
||||
const QImage &img = QImage())
|
||||
: m_name(name), m_img(img)
|
||||
{}
|
||||
QString m_name; // like announcement_BLUE
|
||||
QImage m_img;
|
||||
};
|
||||
struct MpNameImageData
|
||||
{
|
||||
NameImagePair nipGray;
|
||||
NameImagePair nipBlue;
|
||||
NameImagePair nipRed;
|
||||
NameImagePair nipGreen;
|
||||
NameImagePair nipOrange;
|
||||
};
|
||||
|
||||
//
|
||||
// Some methods regarding ImageTable:
|
||||
//
|
||||
static QMap<MountingPointType_def::type, MpNameImageData> &getImageTable(); // contains images in good quality (100*100px)
|
||||
|
||||
static bool getImageAttributePlanActivity(const MountingPoint& mp,
|
||||
QImage &imgOut, QString &attribNameOut);
|
||||
static bool getImageAttributePlanDefinition(const MountingPoint& mp,
|
||||
QImage &imgOut, QString &attribNameOut);
|
||||
|
||||
static bool getImageAttribute(const MountingPoint& mp, MpColor mpColor,
|
||||
QImage &img, QString &attribName);
|
||||
|
||||
private:
|
||||
static QMap<MountingPointType_def::type, MpNameImageData> &getImageTableInternal();
|
||||
static void insertHelper(MountingPointType_def::type type,
|
||||
const QString &name,
|
||||
const QString &colorCodeGray,
|
||||
const QString &colorCodeGreen,
|
||||
const QString &colorCodeRed,
|
||||
const QString &colorCodeOrange,
|
||||
const QString &defName = QString());
|
||||
|
||||
static QImage getImage(const MountingPoint &mp);
|
||||
|
||||
static const MpNameImageData *getNameImageData(const MountingPoint&mp);
|
||||
static const NameImagePair *getNameImagePair(const MountingPoint&mp);
|
||||
|
||||
|
||||
}; // class MountingPoint
|
||||
|
||||
} // namespace InfrastructureManagement
|
||||
@@ -0,0 +1,43 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* Data Plugin Interface for OperatorManagement (Interface for access from other Plugins)
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <PluginInterfaces/data_plugin_interface.h>
|
||||
#include <OperatorManagement/opm_dtc.h>
|
||||
#include <OperatorManagement/opm_ftc.h>
|
||||
#include <memory>
|
||||
|
||||
namespace OperatorManagement
|
||||
{
|
||||
class ForeignDataInterface;
|
||||
|
||||
/**
|
||||
* @brief The DataInterface class provides the Topics Clients only for the GUI Plugins
|
||||
*/
|
||||
class DataInterface : public DataPluginBase::Interface
|
||||
{
|
||||
public:
|
||||
using DataPluginBase::Interface::Interface;
|
||||
|
||||
virtual std::shared_ptr<OperatorManagement::Interface::Dtc> getDtc() = 0;
|
||||
virtual std::shared_ptr<OperatorManagement::Interface::Ftc> getFtc() = 0;
|
||||
virtual std::shared_ptr<ForeignDataInterface> getForeignDataInterface() = 0;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief The ForeignInterface class provides methods and signals for foreign plugins, that need
|
||||
* access to the data of this DataPlugin
|
||||
*/
|
||||
class ForeignDataInterface
|
||||
{
|
||||
public:
|
||||
ForeignDataInterface() = default;
|
||||
virtual ~ForeignDataInterface() = default;
|
||||
|
||||
virtual void onSendKeepAlive() = 0;
|
||||
};
|
||||
|
||||
} // namespace OperatorManagement
|
||||
Reference in new issue
Block a user