new_docker_build.sh gains Group 12 (212 GUI/Data plugins); fixes LtsUtilsGuiDds visibility (LTO-stripped exports), LtsProjectionWorkstation unity name shadow, 6 unity-off dirs (dup file-scope statics, ddsftc INTERFACE sources) and reconfigures BUILD_FILTERMANAGEMENT/BUILD_PLUGINS_SERVICEMONITOR=ON
58 lines
1.5 KiB
C++
Executable File
58 lines
1.5 KiB
C++
Executable File
/**
|
|
* Convert db structures to dds structures
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
* Created by Christian Ehrlicher, SLSE, 2017-07-20
|
|
*/
|
|
#pragma once
|
|
|
|
#include <ParticipantManagement/ppm_db.h>
|
|
#include <ParticipantManagement/ppm.hpp>
|
|
|
|
#include <LtsUtilsCore/dds_vector.h>
|
|
#include <limits>
|
|
namespace ParticipantManagement
|
|
{
|
|
namespace Database
|
|
{
|
|
inline Type convert(const PpmType &data)
|
|
{
|
|
Type ddsData;
|
|
|
|
ddsData.id = data.id;
|
|
ddsData.typeClass = data.typeClassId;
|
|
ddsData.equipmentTypeId = data.equipmentTypeId.isNull() ? 0 : data.equipmentTypeId.toInt();
|
|
ddsData.name = data.name.toStdString();
|
|
ddsData.symbol = data.symbol.toStdString();
|
|
ddsData.radioCount = data.radioCount;
|
|
ddsData.hierarchyLevel = data.hierarchyLevel;
|
|
ddsData.isDeleted = data.isDeleted;
|
|
#ifdef Q_OS_WIN
|
|
ddsData.disEntities = data.disEntities();
|
|
#else
|
|
ddsData.disEntities = data.disEntities();
|
|
#endif
|
|
ddsData.properties = data.properties.toStdString();
|
|
|
|
return ddsData;
|
|
}
|
|
inline EquipmentType convert(const PpmEquipmentType &db)
|
|
{
|
|
EquipmentType et;
|
|
et.id = db.id;
|
|
et.name = db.name.toStdString();
|
|
{ // equipment value are save in the db as int, but in dds unsigned short is used.
|
|
et.minEquipNo = db.minEquipNo < USHRT_MAX ? db.minEquipNo : USHRT_MAX;
|
|
et.maxEquipNo = db.maxEquipNo < USHRT_MAX ? db.maxEquipNo : USHRT_MAX;
|
|
}
|
|
et.traVulnerabilityModelId = db.traVulnerabilityModelId;
|
|
et.traPlayerTypeId = db.traPlayerTypeId;
|
|
et.wmsTypeClass = db.wmsTypeClassId;
|
|
et.deletedInWms = db.deletedInWms;
|
|
return et;
|
|
}
|
|
|
|
}
|
|
}
|