Removes FileManagement stub headers superseded by codegen
This commit is contained in:
1 parent
619c7683d4
commit
5d6807f256
9 files changed
-645
No files matched your search
@@ -1,36 +0,0 @@
|
|||||||
# 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/
|
|
||||||
)
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
/**
|
|
||||||
* @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
|
|
||||||
@@ -1,181 +0,0 @@
|
|||||||
#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,104 +0,0 @@
|
|||||||
/**
|
|
||||||
* @RDE_HEADER@
|
|
||||||
* Stub header for CODEGEN_DATABASE generated code (BUILD_RTI=OFF)
|
|
||||||
* This file is generated by CODEGEN_DATABASE macro when BUILD_RTI=ON
|
|
||||||
* For BUILD_RTI=OFF builds, this stub provides the minimal interface
|
|
||||||
*/
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include <QString>
|
|
||||||
#include <FileManagement/flm_db.h>
|
|
||||||
#include <ngldb/nsqlquery.h>
|
|
||||||
|
|
||||||
// Minimal Logger stub for BUILD_RTI=OFF
|
|
||||||
namespace NGL
|
|
||||||
{
|
|
||||||
enum class LogLevel
|
|
||||||
{
|
|
||||||
Undefined = 0,
|
|
||||||
Trace = 64,
|
|
||||||
Debug = 96,
|
|
||||||
Info = 128,
|
|
||||||
Warning = 150,
|
|
||||||
Error = 182,
|
|
||||||
Fatal = 214,
|
|
||||||
};
|
|
||||||
|
|
||||||
class Logger
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
bool isTraceEnabled() const { return false; }
|
|
||||||
bool isDebugEnabled() const { return true; }
|
|
||||||
bool isInfoEnabled() const { return true; }
|
|
||||||
bool isWarningEnabled() const { return true; }
|
|
||||||
bool isErrorEnabled() const { return true; }
|
|
||||||
bool isFatalEnabled() const { return true; }
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
// Logger macros (simplified for Qt6) - work with pointer
|
|
||||||
#define LOGFUNCTION Q_FUNC_INFO
|
|
||||||
|
|
||||||
#ifdef LTS_DEBUG
|
|
||||||
#define TRACE_LOG(logger) \
|
|
||||||
for (bool log_level_enabled = (logger)->isDebugEnabled(); log_level_enabled; log_level_enabled = false) \
|
|
||||||
qDebug() << "[TRACE]" << __FILE__ << ":" << __LINE__ << Q_FUNC_INFO
|
|
||||||
#else
|
|
||||||
#define TRACE_LOG(logger) \
|
|
||||||
if (false) qDebug()
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define DEBUG_LOG(logger) \
|
|
||||||
if (!(logger)->isDebugEnabled()) {} else qDebug() << "[DEBUG]" << __FILE__ << ":" << __LINE__ << Q_FUNC_INFO
|
|
||||||
|
|
||||||
#define INFO_LOG(logger) \
|
|
||||||
if (!(logger)->isInfoEnabled()) {} else qDebug() << "[INFO]" << __FILE__ << ":" << __LINE__ << Q_FUNC_INFO
|
|
||||||
|
|
||||||
#define WARNING_LOG(logger) \
|
|
||||||
if (!(logger)->isWarningEnabled()) {} else qWarning() << "[WARNING]" << __FILE__ << ":" << __LINE__ << Q_FUNC_INFO
|
|
||||||
|
|
||||||
#define ERROR_LOG(logger) \
|
|
||||||
if (!(logger)->isErrorEnabled()) {} else qCritical() << "[ERROR]" << __FILE__ << ":" << __LINE__ << Q_FUNC_INFO
|
|
||||||
|
|
||||||
#define FATAL_LOG(logger) \
|
|
||||||
if (!(logger)->isFatalEnabled()) {} else qCritical() << "[FATAL]" << __FILE__ << ":" << __LINE__ << Q_FUNC_INFO
|
|
||||||
|
|
||||||
namespace FileManagement
|
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Base class for database interface implementation
|
|
||||||
*
|
|
||||||
* This class is normally generated by CODEGEN_DATABASE macro.
|
|
||||||
* This stub provides minimal interface for BUILD_RTI=OFF builds.
|
|
||||||
*/
|
|
||||||
class DatabaseInterfaceImpl
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
DatabaseInterfaceImpl()
|
|
||||||
: m_logger(nullptr)
|
|
||||||
, m_query(nullptr)
|
|
||||||
{
|
|
||||||
m_logger = new NGL::Logger();
|
|
||||||
m_query = new NSqlQuery(QSqlDatabase());
|
|
||||||
}
|
|
||||||
virtual ~DatabaseInterfaceImpl()
|
|
||||||
{
|
|
||||||
delete m_logger;
|
|
||||||
delete m_query;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Virtual methods that can be overridden by custom implementations
|
|
||||||
virtual bool updateStatus(int fileId, const FileStatus &status, int operatorId) = 0;
|
|
||||||
virtual bool setUsedBy(int fileId, const bool &usedBy, int usedNo, int operatorId) = 0;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
// Member variables expected by custom implementations
|
|
||||||
NGL::Logger* m_logger;
|
|
||||||
NSqlQuery* m_query;
|
|
||||||
|
|
||||||
// Helper methods expected by custom implementations
|
|
||||||
QString getTableName(const QString &baseName) const { return baseName; }
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace FileManagement
|
|
||||||
@@ -1,76 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
// STUB-HEADER: Diese Datei wird normalerweise von ddsdtc generiert
|
|
||||||
// Für die Migration erstellen wir minimale Implementierungen
|
|
||||||
|
|
||||||
#include <functional>
|
|
||||||
#include <QObject>
|
|
||||||
#include "flm_db.h"
|
|
||||||
|
|
||||||
namespace FileManagement
|
|
||||||
{
|
|
||||||
namespace Interface
|
|
||||||
{
|
|
||||||
|
|
||||||
// DataModification Enum (aus DDS generiert)
|
|
||||||
enum class DataModification
|
|
||||||
{
|
|
||||||
eAdded,
|
|
||||||
eModified,
|
|
||||||
eRemoved
|
|
||||||
};
|
|
||||||
|
|
||||||
// Callback types
|
|
||||||
using FolderCallback = std::function<void(const std::vector<Folder>&, const std::vector<int32_t>&, DataModification)>;
|
|
||||||
using FileContentCallback = std::function<void(const std::vector<FileContent>&, const std::vector<int32_t>&, DataModification)>;
|
|
||||||
|
|
||||||
// Dtc - Data Transfer Component interface for FileManagement
|
|
||||||
class Dtc : public QObject
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
|
||||||
virtual ~Dtc() = default;
|
|
||||||
|
|
||||||
// Initialization methods
|
|
||||||
virtual void enableFolder() {}
|
|
||||||
virtual void waitForHistoricalDataFolder() {}
|
|
||||||
virtual void enableFileContent() {}
|
|
||||||
virtual void waitForHistoricalDataFileContent() {}
|
|
||||||
|
|
||||||
// Folder operations
|
|
||||||
virtual void folders(FolderCallback callback) const
|
|
||||||
{
|
|
||||||
// STUB-Implementierung - keine Ordner vorhanden
|
|
||||||
std::vector<Folder> emptyFolders;
|
|
||||||
std::vector<int32_t> emptyIds;
|
|
||||||
callback(emptyFolders, emptyIds, DataModification::eModified);
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual std::shared_ptr<Folder> folder(int32_t /*folderId*/) const
|
|
||||||
{
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
// FileContent operations
|
|
||||||
virtual void fileContents(FileContentCallback callback) const
|
|
||||||
{
|
|
||||||
// STUB-Implementierung
|
|
||||||
std::vector<FileContent> emptyContents;
|
|
||||||
std::vector<int32_t> emptyIds;
|
|
||||||
callback(emptyContents, emptyIds, DataModification::eModified);
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual std::shared_ptr<FileContent> fileContent(int32_t /*fileContentId*/) const
|
|
||||||
{
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
signals:
|
|
||||||
void folderChanged(const FileManagement::Folder &folder, DataModification modification);
|
|
||||||
void fileContentChanged(const FileManagement::FileContent &fileContent, DataModification modification);
|
|
||||||
};
|
|
||||||
|
|
||||||
class Ftc;
|
|
||||||
} // namespace Interface
|
|
||||||
} // namespace FileManagement
|
|
||||||
@@ -1,86 +0,0 @@
|
|||||||
/**
|
|
||||||
* @RDE_HEADER@
|
|
||||||
* FileManagement DTC Implementation
|
|
||||||
* $Id$
|
|
||||||
* $HeadURL$
|
|
||||||
* $Author$
|
|
||||||
* Stub-Header für Qt6-Migration - ersetzt DDS-generierten Header
|
|
||||||
*/
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include <FileManagement/flm_db_impl.h>
|
|
||||||
#include <DDS/DTC/generic_dtc.h>
|
|
||||||
#include <memory>
|
|
||||||
|
|
||||||
// Forward declarations für DDS
|
|
||||||
namespace DDSConnector
|
|
||||||
{
|
|
||||||
class DdsConnector;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Stub für DDS DataReader - wird normalerweise von DDS generiert
|
|
||||||
template<typename T>
|
|
||||||
class DdsDataReaderStub
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
struct LoanedSamplesWrapper
|
|
||||||
{
|
|
||||||
auto begin() { return m_samples.begin(); }
|
|
||||||
auto end() { return m_samples.end(); }
|
|
||||||
std::vector<T> m_samples;
|
|
||||||
};
|
|
||||||
|
|
||||||
LoanedSamplesWrapper readAlive() { return LoanedSamplesWrapper{}; }
|
|
||||||
};
|
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------------------------------
|
|
||||||
namespace FileManagement
|
|
||||||
{
|
|
||||||
namespace Interface
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* @brief DtcImpl - Basisklasse für FileManagement DTC
|
|
||||||
*
|
|
||||||
* Stellt Logger und DDS-DataReader für Custom-Implementierungen bereit
|
|
||||||
* Erbt von DatabaseInterfaceImpl für Datenbank-Zugriff
|
|
||||||
*/
|
|
||||||
class DtcImpl : public DatabaseInterfaceImpl
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
explicit DtcImpl(const std::shared_ptr<DDSConnector::DdsConnector> &ddsConnector)
|
|
||||||
: DatabaseInterfaceImpl()
|
|
||||||
, m_ddsConnector(ddsConnector)
|
|
||||||
, m_dtcFileContent(std::make_unique<DdsDataReaderStub<FileContent>>())
|
|
||||||
, m_dtcFolder(std::make_unique<DdsDataReaderStub<Folder>>())
|
|
||||||
{
|
|
||||||
// Logger wird von DatabaseInterfaceImpl bereitgestellt
|
|
||||||
// m_logger ist in DatabaseInterfaceImpl definiert
|
|
||||||
}
|
|
||||||
|
|
||||||
~DtcImpl() override = default;
|
|
||||||
|
|
||||||
// Virtuelle Methoden für Custom-Implementierung
|
|
||||||
virtual bool getAllTemplates(QList<FileContent> &allTemplates) = 0;
|
|
||||||
virtual bool getAllFiles(const FileType &fileType, int folderId, QStringList &allFiles, bool showHidden = false) = 0;
|
|
||||||
virtual bool getFilesOperator(const FileType &fileType, int folderId, int operatorId, QStringList &allFiles) = 0;
|
|
||||||
virtual bool getFile(const FileType &fileType, int folderId, const QString &fileName, FileContent &fileMetadata) = 0;
|
|
||||||
virtual int getExerciseId(int folderId) = 0;
|
|
||||||
virtual int getFileId(const FileType &fileType, const QString &fileName, int exerciseId, int phaseId) = 0;
|
|
||||||
virtual int findFolder(int parentId, const QString &name) const = 0;
|
|
||||||
virtual int getExerciseFolderId(int exerciseId) const = 0;
|
|
||||||
virtual int getPhaseFolderId(int exerciseId, int phaseId) const = 0;
|
|
||||||
virtual int getPartyFolderId(int exerciseId, int partyId) const = 0;
|
|
||||||
|
|
||||||
// Default-Implementierungen für Namen-Helper
|
|
||||||
virtual QString getExerciseFolderName(int exerciseId) const { return QLatin1String("$EX_") + QString::number(exerciseId); }
|
|
||||||
virtual QString getPartyFolderName(int partyId) const { return QLatin1String("$PY_") + QString::number(partyId); }
|
|
||||||
virtual QString getPhaseFolderName(int phaseId) const { return QLatin1String("$PH_") + QString::number(phaseId); }
|
|
||||||
|
|
||||||
protected:
|
|
||||||
std::shared_ptr<DDSConnector::DdsConnector> m_ddsConnector;
|
|
||||||
std::unique_ptr<DdsDataReaderStub<FileContent>> m_dtcFileContent;
|
|
||||||
std::unique_ptr<DdsDataReaderStub<Folder>> m_dtcFolder;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace Interface
|
|
||||||
} // namespace FileManagement
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
// Stub file for flm_enums.hpp - used when BUILD_RTI=OFF
|
|
||||||
#ifndef FLM_ENUMS_HPP
|
|
||||||
#define FLM_ENUMS_HPP
|
|
||||||
|
|
||||||
#include <cstdint>
|
|
||||||
|
|
||||||
namespace FileManagement {
|
|
||||||
|
|
||||||
enum class FileType : std::int32_t {
|
|
||||||
Unknown = 0,
|
|
||||||
Document = 1,
|
|
||||||
Image = 2,
|
|
||||||
Video = 3,
|
|
||||||
Audio = 4
|
|
||||||
};
|
|
||||||
|
|
||||||
enum class FileStatus : std::int32_t {
|
|
||||||
Available = 0,
|
|
||||||
Downloading = 1,
|
|
||||||
Error = 2,
|
|
||||||
Valid = 3,
|
|
||||||
Deleted = 4
|
|
||||||
};
|
|
||||||
|
|
||||||
enum class MainFolder : std::int32_t {
|
|
||||||
None = 0,
|
|
||||||
Global = 1,
|
|
||||||
Local = 2
|
|
||||||
};
|
|
||||||
|
|
||||||
enum class FileCategory : std::int32_t {
|
|
||||||
Global = 0,
|
|
||||||
Local = 1,
|
|
||||||
Personal = 2
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace FileManagement
|
|
||||||
|
|
||||||
#endif // FLM_ENUMS_HPP
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
/**
|
|
||||||
* @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
|
|
||||||
@@ -1,73 +0,0 @@
|
|||||||
/**
|
|
||||||
* @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
|
|
||||||
Reference in new issue
Block a user