Major Changes:
- Merged latest Qt5 devel content from dlbo (292 files changed, 7 new dirs)
- Consolidated forward-declarations and include folders
- Removed unneeded modules per Niklas' repo check list
Build System Fixes:
- Fixed CMake VERSION_GREATER syntax in ParticipantManagement/CMakeLists.txt
- Added VLC packages (libvlc-dev, vlc-plugin-base) to docker_build.sh
- Added PostgreSQL dev packages (libpq-dev, postgresql-server-dev-all) to Dockerfile
- Fixed locale warnings (ANSI_X3.4-1968 → C.UTF-8)
- Fixed ArcGIS SDK path warnings when BUILD_ARCGIS=OFF
Code Generation Fixes:
- Fixed IDL enum collisions (PortType→CorePortType/DdsutPortType, PdmEventType)
- Fixed Grantlee template svc_translation.cpp.grantlee:
- Changed {{ idl_enum.name }}_def:: to {{ idl_enum.name }}::
- Fixed .underlying() calls for C++11 scoped enums (enum class)
- Removed generated files from repo (moc_*, *_dtc.h, *_ftc.h)
Validation:
- BUILD_RTI=ON: SUCCESS
- BUILD_RTI=OFF: SUCCESS
- C++17 standard maintained for RTI 7.7 compatibility
- Ubuntu 26.04 Docker environment verified
Remaining Warnings (expected):
- BgViewer, KDChart, KDReports, Poppler-Qt6 not found (optional features)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
428 lines
13 KiB
C++
428 lines
13 KiB
C++
/**
|
|
* @RDE_HEADER@
|
|
* Template for 'real' structures including insert/update/delete functions for db
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
*/
|
|
|
|
|
|
// filename: pdm_db_structs.h
|
|
#pragma once
|
|
|
|
#include <QDateTime>
|
|
#include <QJsonArray>
|
|
#include <QJsonObject>
|
|
#include <QJsonValue>
|
|
#include <QPointF>
|
|
#include <QString>
|
|
#include <QVariant>
|
|
#include <QVector>
|
|
|
|
|
|
#include <LtsUtilsCore/pgarray.h>
|
|
|
|
|
|
#include <ProjectDataManagement/pdm_export.h>
|
|
#include <pdm_enums.hpp>
|
|
|
|
|
|
#include </workspace/qt-migration-legatus/qt6-after/qt6-migrated-legatus/build4/Lts/DDS/Core/core.hpp>
|
|
|
|
|
|
namespace ProjectDataManagement
|
|
{
|
|
namespace Database
|
|
{
|
|
|
|
// PdmAvmFrequencyPlanTransmissionReason
|
|
struct PdmAvmFrequencyPlanTransmissionReason
|
|
{
|
|
qint32 id = 0;
|
|
QString name;
|
|
};
|
|
// PdmBiteComponentText
|
|
struct PdmBiteComponentText
|
|
{
|
|
qint32 id = 0;
|
|
qint32 canDeviceId = 0;
|
|
qint32 subDeviceId = 0;
|
|
qint32 errorNumber = 0;
|
|
QString name;
|
|
};
|
|
// PdmBuildingChargeEffect
|
|
struct PdmBuildingChargeEffect
|
|
{
|
|
qint32 id = 0;
|
|
qint32 chargeTypeId = 0;
|
|
qint32 destructiveFactor = 0;
|
|
qint32 penetrationFactor = 0;
|
|
qint32 hitSound = 0;
|
|
bool difcueLight = false;
|
|
bool difcuePyro = false;
|
|
};
|
|
// PdmCanComponentString
|
|
struct PdmCanComponentString
|
|
{
|
|
qint32 id = 0;
|
|
qint64 bitMask = 0;
|
|
qint32 canDeviceId = 0;
|
|
qint32 subDeviceId = 0;
|
|
QString name;
|
|
};
|
|
// PdmChargeType
|
|
struct PdmChargeType
|
|
{
|
|
qint32 id = 0;
|
|
QString name;
|
|
QString shortName;
|
|
QString predefinedName;
|
|
QString disEntity;
|
|
QString properties = QLatin1String("{}");
|
|
qint32 chargeLegacyId = 0;
|
|
};
|
|
// PdmChargeTypeIgniterTypeIgniterFunction
|
|
struct PdmChargeTypeIgniterTypeIgniterFunction
|
|
{
|
|
qint32 id = 0;
|
|
qint32 chargeTypeId = 0;
|
|
ProjectDataManagement::IgniterFunctionBase igniterFunctionBaseId = ProjectDataManagement::IgniterFunctionBase::IfbDefault;
|
|
qint32 igniterTypeId = 0;
|
|
qint32 igniterFunctionId = 0;
|
|
QString impactArea = QLatin1String("{}");
|
|
qint32 impactRadius = 0;
|
|
qint32 hazardDistance = 0;
|
|
qint32 chargeLegacyId = 0;
|
|
QString properties = QLatin1String("{}");
|
|
};
|
|
// PdmChargeTypeLoadType
|
|
struct PdmChargeTypeLoadType
|
|
{
|
|
qint32 id = 0;
|
|
qint32 chargeTypeId = 0;
|
|
qint32 loadTypeId = 0;
|
|
LtsUtils::IntArray numbers;
|
|
QString properties = QLatin1String("{}");
|
|
};
|
|
// PdmEquipmentSystemEventFilter
|
|
struct PdmEquipmentSystemEventFilter
|
|
{
|
|
qint32 id = 0;
|
|
qint32 equipmentFunctionalId = 0;
|
|
qint32 subDeviceId = 0;
|
|
qint32 deviceSpecificCode = 0;
|
|
ProjectDataManagement::HgrMineSearchFilterType hgrMineSearchFilterTypeId = ProjectDataManagement::HgrMineSearchFilterType::HgrMineSearchFilterType_Unknown;
|
|
};
|
|
// PdmEventFilterHgrMineSearch
|
|
struct PdmEventFilterHgrMineSearch
|
|
{
|
|
qint32 id = 0;
|
|
ProjectDataManagement::HgrMineSearchFilterType hgrMineSearchFilterTypeId = ProjectDataManagement::HgrMineSearchFilterType::HgrMineSearchFilterType_Unknown;
|
|
qint32 chargeTypeId = 0;
|
|
};
|
|
// PdmFirePurpose
|
|
struct PdmFirePurpose
|
|
{
|
|
qint32 id = 0;
|
|
QString name;
|
|
QString description;
|
|
QString properties = QLatin1String("{}");
|
|
};
|
|
// PdmGearType
|
|
struct PdmGearType
|
|
{
|
|
qint32 id = 0;
|
|
QString name;
|
|
ProjectDataManagement::GearClass gearClassId = ProjectDataManagement::GearClass::GearClass_Unknown;
|
|
qint32 tasCode = 0;
|
|
QString properties = QLatin1String("{}");
|
|
};
|
|
// PdmGearTypeChargeType
|
|
struct PdmGearTypeChargeType
|
|
{
|
|
qint32 id = 0;
|
|
qint32 gearTypeId = 0;
|
|
qint32 chargeTypeId = 0;
|
|
qint32 maxRange = 0;
|
|
QString properties = QLatin1String("{}");
|
|
};
|
|
// PdmIgniterFunction
|
|
struct PdmIgniterFunction
|
|
{
|
|
qint32 id = 0;
|
|
QString name;
|
|
QString shortName;
|
|
QString properties = QLatin1String("{}");
|
|
};
|
|
// PdmIgniterType
|
|
struct PdmIgniterType
|
|
{
|
|
qint32 id = 0;
|
|
QString name;
|
|
QString shortName;
|
|
QString properties = QLatin1String("{}");
|
|
};
|
|
// PdmLanguage
|
|
struct PdmLanguage
|
|
{
|
|
qint32 id = 0;
|
|
QString name;
|
|
QString isoCode;
|
|
QString dbLocale;
|
|
};
|
|
// PdmLanguageXdu
|
|
struct PdmLanguageXdu
|
|
{
|
|
qint32 id = 0;
|
|
QString name;
|
|
QString isoCode;
|
|
};
|
|
// PdmLoadType
|
|
struct PdmLoadType
|
|
{
|
|
qint32 id = 0;
|
|
QString name;
|
|
QString shortName;
|
|
QString properties = QLatin1String("{}");
|
|
};
|
|
// PdmNuclearPreset
|
|
struct PdmNuclearPreset
|
|
{
|
|
qint32 id = 0;
|
|
QString name;
|
|
double detonationValue = 0.0;
|
|
double impactRadius = 0.0;
|
|
double borderLengthInner = 0.0;
|
|
double borderLengthOuter = 0.0;
|
|
};
|
|
// PdmRadioGroup
|
|
struct PdmRadioGroup
|
|
{
|
|
qint32 id = 0;
|
|
QString name;
|
|
bool baseGroup = false;
|
|
qint32 issi = 0;
|
|
qint32 groupIssi1 = 0;
|
|
qint32 groupIssi2 = 0;
|
|
QString radioHostname;
|
|
qint32 radioPort = 0;
|
|
QString radioBackupHostname;
|
|
qint32 radioBackupPort = 0;
|
|
};
|
|
// PdmSanitationInjury
|
|
struct PdmSanitationInjury
|
|
{
|
|
qint32 id = 0;
|
|
QString name;
|
|
qint32 kind = 0;
|
|
qint32 place1 = 0;
|
|
qint32 place2 = 0;
|
|
qint32 vbg = 0;
|
|
};
|
|
// PdmSanitationInjuryKind
|
|
struct PdmSanitationInjuryKind
|
|
{
|
|
qint32 id = 0;
|
|
QString name;
|
|
QString version;
|
|
};
|
|
// PdmSanitationInjuryPlace1
|
|
struct PdmSanitationInjuryPlace1
|
|
{
|
|
qint32 id = 0;
|
|
QString name;
|
|
QString version;
|
|
};
|
|
// PdmSanitationInjuryPlace2
|
|
struct PdmSanitationInjuryPlace2
|
|
{
|
|
qint32 id = 0;
|
|
QString name;
|
|
QString version;
|
|
};
|
|
// PdmSanitationMaterial
|
|
struct PdmSanitationMaterial
|
|
{
|
|
qint32 id = 0;
|
|
QString name;
|
|
QString description;
|
|
QString version;
|
|
};
|
|
// PdmSanitationProcedures
|
|
struct PdmSanitationProcedures
|
|
{
|
|
qint32 id = 0;
|
|
QString name;
|
|
QString type;
|
|
qint32 typeId = 0;
|
|
qint32 minimumQualification = 0;
|
|
QString longName;
|
|
qint64 dataCode = 0;
|
|
QString version;
|
|
};
|
|
// PdmTargetSubType
|
|
struct PdmTargetSubType
|
|
{
|
|
qint32 id = 0;
|
|
QString name;
|
|
QString abbreviation;
|
|
QString properties = QLatin1String("{}");
|
|
};
|
|
// PdmTargetType
|
|
struct PdmTargetType
|
|
{
|
|
qint32 id = 0;
|
|
QString name;
|
|
QString abbreviation;
|
|
QString properties = QLatin1String("{}");
|
|
};
|
|
// PdmTargetTypeTargetSubType
|
|
struct PdmTargetTypeTargetSubType
|
|
{
|
|
qint32 id = 0;
|
|
qint32 targetTypeId = 0;
|
|
qint32 targetSubtypeId = 0;
|
|
QString properties = QLatin1String("{}");
|
|
};
|
|
// PdmTranslation
|
|
struct PdmTranslation
|
|
{
|
|
qint32 id = 0;
|
|
QString isoCode;
|
|
QString context;
|
|
QString key;
|
|
QString disambiguation;
|
|
QString translation;
|
|
};
|
|
// PdmVulnerabilityKind
|
|
struct PdmVulnerabilityKind
|
|
{
|
|
qint32 taVulnerabilityKind = 0;
|
|
qint32 playerTypeClassId = 0;
|
|
ProjectDataManagement::VulnerabilityClass vulnerabilityClassId = ProjectDataManagement::VulnerabilityClass::VulnerabilityClass_Unknown;
|
|
QString name;
|
|
};
|
|
|
|
|
|
|
|
// converting DbStructs to/from JSON
|
|
template<typename T>
|
|
T fromJson(const QJsonValue &value);
|
|
|
|
// PdmAvmFrequencyPlanTransmissionReason
|
|
template <> PDM_COMMON_EXPORT PdmAvmFrequencyPlanTransmissionReason fromJson(const QJsonValue &value);
|
|
PDM_COMMON_EXPORT QJsonObject toJson(const PdmAvmFrequencyPlanTransmissionReason &element);
|
|
// PdmBiteComponentText
|
|
template <> PDM_COMMON_EXPORT PdmBiteComponentText fromJson(const QJsonValue &value);
|
|
PDM_COMMON_EXPORT QJsonObject toJson(const PdmBiteComponentText &element);
|
|
// PdmBuildingChargeEffect
|
|
template <> PDM_COMMON_EXPORT PdmBuildingChargeEffect fromJson(const QJsonValue &value);
|
|
PDM_COMMON_EXPORT QJsonObject toJson(const PdmBuildingChargeEffect &element);
|
|
// PdmCanComponentString
|
|
template <> PDM_COMMON_EXPORT PdmCanComponentString fromJson(const QJsonValue &value);
|
|
PDM_COMMON_EXPORT QJsonObject toJson(const PdmCanComponentString &element);
|
|
// PdmChargeType
|
|
template <> PDM_COMMON_EXPORT PdmChargeType fromJson(const QJsonValue &value);
|
|
PDM_COMMON_EXPORT QJsonObject toJson(const PdmChargeType &element);
|
|
// PdmChargeTypeIgniterTypeIgniterFunction
|
|
template <> PDM_COMMON_EXPORT PdmChargeTypeIgniterTypeIgniterFunction fromJson(const QJsonValue &value);
|
|
PDM_COMMON_EXPORT QJsonObject toJson(const PdmChargeTypeIgniterTypeIgniterFunction &element);
|
|
// PdmChargeTypeLoadType
|
|
template <> PDM_COMMON_EXPORT PdmChargeTypeLoadType fromJson(const QJsonValue &value);
|
|
PDM_COMMON_EXPORT QJsonObject toJson(const PdmChargeTypeLoadType &element);
|
|
// PdmEquipmentSystemEventFilter
|
|
template <> PDM_COMMON_EXPORT PdmEquipmentSystemEventFilter fromJson(const QJsonValue &value);
|
|
PDM_COMMON_EXPORT QJsonObject toJson(const PdmEquipmentSystemEventFilter &element);
|
|
// PdmEventFilterHgrMineSearch
|
|
template <> PDM_COMMON_EXPORT PdmEventFilterHgrMineSearch fromJson(const QJsonValue &value);
|
|
PDM_COMMON_EXPORT QJsonObject toJson(const PdmEventFilterHgrMineSearch &element);
|
|
// PdmFirePurpose
|
|
template <> PDM_COMMON_EXPORT PdmFirePurpose fromJson(const QJsonValue &value);
|
|
PDM_COMMON_EXPORT QJsonObject toJson(const PdmFirePurpose &element);
|
|
// PdmGearType
|
|
template <> PDM_COMMON_EXPORT PdmGearType fromJson(const QJsonValue &value);
|
|
PDM_COMMON_EXPORT QJsonObject toJson(const PdmGearType &element);
|
|
// PdmGearTypeChargeType
|
|
template <> PDM_COMMON_EXPORT PdmGearTypeChargeType fromJson(const QJsonValue &value);
|
|
PDM_COMMON_EXPORT QJsonObject toJson(const PdmGearTypeChargeType &element);
|
|
// PdmIgniterFunction
|
|
template <> PDM_COMMON_EXPORT PdmIgniterFunction fromJson(const QJsonValue &value);
|
|
PDM_COMMON_EXPORT QJsonObject toJson(const PdmIgniterFunction &element);
|
|
// PdmIgniterType
|
|
template <> PDM_COMMON_EXPORT PdmIgniterType fromJson(const QJsonValue &value);
|
|
PDM_COMMON_EXPORT QJsonObject toJson(const PdmIgniterType &element);
|
|
// PdmLanguage
|
|
template <> PDM_COMMON_EXPORT PdmLanguage fromJson(const QJsonValue &value);
|
|
PDM_COMMON_EXPORT QJsonObject toJson(const PdmLanguage &element);
|
|
// PdmLanguageXdu
|
|
template <> PDM_COMMON_EXPORT PdmLanguageXdu fromJson(const QJsonValue &value);
|
|
PDM_COMMON_EXPORT QJsonObject toJson(const PdmLanguageXdu &element);
|
|
// PdmLoadType
|
|
template <> PDM_COMMON_EXPORT PdmLoadType fromJson(const QJsonValue &value);
|
|
PDM_COMMON_EXPORT QJsonObject toJson(const PdmLoadType &element);
|
|
// PdmNuclearPreset
|
|
template <> PDM_COMMON_EXPORT PdmNuclearPreset fromJson(const QJsonValue &value);
|
|
PDM_COMMON_EXPORT QJsonObject toJson(const PdmNuclearPreset &element);
|
|
// PdmRadioGroup
|
|
template <> PDM_COMMON_EXPORT PdmRadioGroup fromJson(const QJsonValue &value);
|
|
PDM_COMMON_EXPORT QJsonObject toJson(const PdmRadioGroup &element);
|
|
// PdmSanitationInjury
|
|
template <> PDM_COMMON_EXPORT PdmSanitationInjury fromJson(const QJsonValue &value);
|
|
PDM_COMMON_EXPORT QJsonObject toJson(const PdmSanitationInjury &element);
|
|
// PdmSanitationInjuryKind
|
|
template <> PDM_COMMON_EXPORT PdmSanitationInjuryKind fromJson(const QJsonValue &value);
|
|
PDM_COMMON_EXPORT QJsonObject toJson(const PdmSanitationInjuryKind &element);
|
|
// PdmSanitationInjuryPlace1
|
|
template <> PDM_COMMON_EXPORT PdmSanitationInjuryPlace1 fromJson(const QJsonValue &value);
|
|
PDM_COMMON_EXPORT QJsonObject toJson(const PdmSanitationInjuryPlace1 &element);
|
|
// PdmSanitationInjuryPlace2
|
|
template <> PDM_COMMON_EXPORT PdmSanitationInjuryPlace2 fromJson(const QJsonValue &value);
|
|
PDM_COMMON_EXPORT QJsonObject toJson(const PdmSanitationInjuryPlace2 &element);
|
|
// PdmSanitationMaterial
|
|
template <> PDM_COMMON_EXPORT PdmSanitationMaterial fromJson(const QJsonValue &value);
|
|
PDM_COMMON_EXPORT QJsonObject toJson(const PdmSanitationMaterial &element);
|
|
// PdmSanitationProcedures
|
|
template <> PDM_COMMON_EXPORT PdmSanitationProcedures fromJson(const QJsonValue &value);
|
|
PDM_COMMON_EXPORT QJsonObject toJson(const PdmSanitationProcedures &element);
|
|
// PdmTargetSubType
|
|
template <> PDM_COMMON_EXPORT PdmTargetSubType fromJson(const QJsonValue &value);
|
|
PDM_COMMON_EXPORT QJsonObject toJson(const PdmTargetSubType &element);
|
|
// PdmTargetType
|
|
template <> PDM_COMMON_EXPORT PdmTargetType fromJson(const QJsonValue &value);
|
|
PDM_COMMON_EXPORT QJsonObject toJson(const PdmTargetType &element);
|
|
// PdmTargetTypeTargetSubType
|
|
template <> PDM_COMMON_EXPORT PdmTargetTypeTargetSubType fromJson(const QJsonValue &value);
|
|
PDM_COMMON_EXPORT QJsonObject toJson(const PdmTargetTypeTargetSubType &element);
|
|
// PdmTranslation
|
|
template <> PDM_COMMON_EXPORT PdmTranslation fromJson(const QJsonValue &value);
|
|
PDM_COMMON_EXPORT QJsonObject toJson(const PdmTranslation &element);
|
|
// PdmVulnerabilityKind
|
|
template <> PDM_COMMON_EXPORT PdmVulnerabilityKind fromJson(const QJsonValue &value);
|
|
PDM_COMMON_EXPORT QJsonObject toJson(const PdmVulnerabilityKind &element);
|
|
|
|
// vector of database struct to/from JSON-array
|
|
template<typename T>
|
|
QJsonArray toJson(const QVector<T> &dataVec)
|
|
{
|
|
QJsonArray arr;
|
|
for (const T &data : dataVec)
|
|
arr.append(QJsonValue(toJson(data)));
|
|
|
|
return arr;
|
|
}
|
|
|
|
template<typename T>
|
|
std::vector<T> fromJson(const QJsonArray &arr)
|
|
{
|
|
std::vector<T> dataVec;
|
|
dataVec.reserve(arr.size());
|
|
for (const QJsonValue &val : arr)
|
|
dataVec.push_back(fromJson<T>(val));
|
|
|
|
return dataVec;
|
|
}
|
|
};// namespace Database
|
|
|
|
} // namespace ProjectDataManagement
|
|
|