Add BUILD_RTI guards to InfrastructureManagement and AudioVideoManagement DDS handlers
- ism_dtc_impl_custom.h/cpp: Wrap all DDS-dependent method declarations and implementations with BUILD_RTI guards - dds_handler.cpp (InfrastructureManagement): Guard RTI DDS initialization code - dds_handler.h/cpp (AudioVideoManagement): Guard DomainParticipant types and methods - Enables building without RTI Connext DDS dependencies (BUILD_RTI=OFF) - Stub types used when guards are disabled Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
1 parent
3cc3129de0
commit
93020295ad
5 files changed
+80
-11
No files matched your search
+47
-6
@@ -285,6 +285,7 @@ int DtcImplCustom::getOpticalCodeFromAssetId(int assetId) const
|
||||
|
||||
}
|
||||
|
||||
#if BUILD_RTI
|
||||
int DtcImplCustom::getAssetIdFromOpticalCode(int opticalCode) const
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "getAssetIdFromOpticalCode: opticalCode=" << opticalCode;
|
||||
@@ -330,6 +331,7 @@ int DtcImplCustom::getAssetIdFromMountingPointId(int mainStructureElementId, in
|
||||
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -474,6 +476,7 @@ bool DtcImplCustom::getStructureElementByBuildingIdAndMountingPointId(int mainSt
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
#if BUILD_RTI
|
||||
bool DtcImplCustom::getAllAssetsPerRoom(const std::function<bool(const InstrumentationAsset &)> &predicate,
|
||||
QMap<int, QVector<InstrumentationAsset> > &allAssets)
|
||||
{
|
||||
@@ -523,7 +526,6 @@ bool DtcImplCustom::getAllAssetsPerRoom(const std::function<bool(const Instrumen
|
||||
return true;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
bool DtcImplCustom::getAllAssetsPerBuilding(const std::function<bool(const InstrumentationAsset &)> &predicate,
|
||||
QMap<int, QVector<InstrumentationAsset> > &allAssets) const
|
||||
{
|
||||
@@ -562,7 +564,6 @@ bool DtcImplCustom::getAllAssetsPerBuilding(const std::function<bool(const Instr
|
||||
}
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
bool DtcImplCustom::getBuildingId(int structureElementId, int &buildingId) const
|
||||
{
|
||||
for (const auto &sample : m_dtcMainStructureElement->readAlive())
|
||||
@@ -579,8 +580,11 @@ bool DtcImplCustom::getBuildingId(int structureElementId, int &buildingId) const
|
||||
buildingId = 0;
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
#if BUILD_RTI
|
||||
QList<int> DtcImplCustom::getSections()
|
||||
{
|
||||
QList<int> sections;
|
||||
@@ -591,6 +595,7 @@ QList<int> DtcImplCustom::getSections()
|
||||
}
|
||||
return sections;
|
||||
}
|
||||
#endif
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
QString DtcImplCustom::getBuildingDisplayName(int buildingId)
|
||||
@@ -614,6 +619,7 @@ QString DtcImplCustom::getBuildingDisplayName(const MainStructureElement &mse) c
|
||||
}
|
||||
|
||||
|
||||
#if BUILD_RTI
|
||||
MountingPointPlan DtcImplCustom::getMountingPointPlan(int scheduleId, int structureElementId) const
|
||||
{
|
||||
for (const auto &sample : m_dtcMainSchedule->readAlive())
|
||||
@@ -629,6 +635,7 @@ MountingPointPlan DtcImplCustom::getMountingPointPlan(int scheduleId, int struct
|
||||
}
|
||||
return MountingPointPlan();
|
||||
}
|
||||
#endif
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
int DtcImplCustom::getBuildingRoomsCount(int buildingId)
|
||||
@@ -666,6 +673,7 @@ BridgeStatus DtcImplCustom::getBridgeStatus(int buildingId)
|
||||
|
||||
// this is just a quicker method to determine if a plan is complete or not
|
||||
//---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
#if BUILD_RTI
|
||||
bool DtcImplCustom::checkSchedule(int scheduleId)
|
||||
{
|
||||
const MainSchedule schedule = mainSchedule(scheduleId);
|
||||
@@ -699,8 +707,10 @@ bool DtcImplCustom::getScheduleDifferences(int scheduleId, QList<MountingPointPl
|
||||
}
|
||||
return diffList.isEmpty();
|
||||
}
|
||||
#endif
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------
|
||||
#if BUILD_RTI
|
||||
int DtcImplCustom::getMountedAssetId(int structureElementId) const
|
||||
{
|
||||
// Norbert Thoden, 12.12.2022:
|
||||
@@ -721,7 +731,6 @@ int DtcImplCustom::getMountedAssetId(int structureElementId) const
|
||||
return -1;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------
|
||||
int DtcImplCustom::getStructueElementIdFromAssetId(int assetId) const
|
||||
{
|
||||
|
||||
@@ -739,8 +748,10 @@ int DtcImplCustom::getStructueElementIdFromAssetId(int assetId) const
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------
|
||||
#if BUILD_RTI
|
||||
QMap<int, MainFootprint> DtcImplCustom::getFootprintsByExerciseId(int exerciseId)
|
||||
{
|
||||
QMap<int, MainFootprint> footprints;
|
||||
@@ -755,7 +766,10 @@ QMap<int, MainFootprint> DtcImplCustom::getFootprintsByExerciseId(int exerciseId
|
||||
|
||||
return footprints;
|
||||
}
|
||||
#endif
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------
|
||||
#if BUILD_RTI
|
||||
QMap<int, QPolygonF> DtcImplCustom::getUtmFootprintsByExerciseId(int exerciseId, int &zone, bool isGroundLevel)
|
||||
{
|
||||
QMap<int, QPolygonF> footprints;
|
||||
@@ -796,6 +810,7 @@ QMap<int, QPolygonF> DtcImplCustom::getUtmFootprintsByExerciseId(int exerciseId,
|
||||
DEBUG_LOG(m_logger) << "getUtmFootprintsByExerciseId footprints.size=" << footprints.size();
|
||||
return footprints;
|
||||
}
|
||||
#endif
|
||||
|
||||
// returns absolut utm positions of the footprint
|
||||
QPolygonF DtcImplCustom::getUtmFootprintById(int mseId, int &zoneOut, bool isGroundLevel)
|
||||
@@ -867,8 +882,10 @@ QPolygonF DtcImplCustom::getUtmFootprintById(int mseId, int &zoneOut, bool isGro
|
||||
|
||||
// return retPolyUtm;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------
|
||||
#if BUILD_RTI
|
||||
// returns all building IDs that have an intersection with the area under the polygon and are assigned to the specified exercise.
|
||||
// Parameter: completeEnclosed true = Only buildings that are completely enclosed by the polygon are taken into account.
|
||||
// false = All buildings that are completely enclosed by the polygon and that have an overlap with the polygon are taken into account.
|
||||
@@ -936,7 +953,10 @@ QVector <int> DtcImplCustom::getBuildingByPolygon(int exerciseId, const QPolygon
|
||||
|
||||
return result;
|
||||
}
|
||||
#endif
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------
|
||||
#if BUILD_RTI
|
||||
// returns building ID surrounds the polygon and is assigned to the specified exercise.
|
||||
// returns -1 if no building found
|
||||
int DtcImplCustom::getSurroundingBuildingByPolygon(int exerciseId, const QPolygonF &polygon, bool isGroundLevel)
|
||||
@@ -1000,7 +1020,10 @@ int DtcImplCustom::getSurroundingBuildingByPolygon(int exerciseId, const QPolygo
|
||||
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------
|
||||
#if BUILD_RTI
|
||||
/*!
|
||||
* \brief DtcImplCustom::getBuildingIdAtPosition
|
||||
* \param exerciseId
|
||||
@@ -1024,7 +1047,12 @@ int DtcImplCustom::getBuildingIdAtPosition(int exerciseId, const QPointF &utmPos
|
||||
}
|
||||
return bldId;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------
|
||||
#if BUILD_RTI
|
||||
// The floors list is sorted according to height.
|
||||
QVector <int> DtcImplCustom::getFloorIdsFromBuilding(int buildingId)
|
||||
{
|
||||
@@ -1064,7 +1092,10 @@ QList <StructureElement> DtcImplCustom::getFloorsFromBuilding(int buildingId)
|
||||
std::sort(floors.begin(), floors.end(), structureElementHeightComparator);
|
||||
return floors;
|
||||
}
|
||||
#endif
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------
|
||||
#if BUILD_RTI
|
||||
double DtcImplCustom::getHalfFloorHeight(int buildingId, int floorId)
|
||||
{
|
||||
QList <StructureElement> floorHeights = getFloorsFromBuilding(buildingId);
|
||||
@@ -1090,7 +1121,10 @@ double DtcImplCustom::getHalfFloorHeight(int buildingId, int floorId)
|
||||
|
||||
return 0.0;
|
||||
}
|
||||
#endif
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------
|
||||
#if BUILD_RTI
|
||||
QVector <int> DtcImplCustom::getRoomIdsFromFloorId(int buildingId, int floorId)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "getRoomIdsFromFloorId "
|
||||
@@ -1117,7 +1151,10 @@ QVector <int> DtcImplCustom::getRoomIdsFromFloorId(int buildingId, int floorId)
|
||||
}
|
||||
return rooms;
|
||||
}
|
||||
#endif
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------
|
||||
#if BUILD_RTI
|
||||
QVector <int> DtcImplCustom::getBuildingIdsByExercise ( int exerciseId)
|
||||
{
|
||||
QVector <int> result;
|
||||
@@ -1132,7 +1169,10 @@ QVector <int> DtcImplCustom::getBuildingIdsByExercise ( int exerciseId)
|
||||
|
||||
return result;
|
||||
}
|
||||
#endif
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------
|
||||
#if BUILD_RTI
|
||||
QByteArray DtcImplCustom::getVulnerabilityModelData( int buildingId)
|
||||
{
|
||||
const MainStructureElement &mse = mainStructureElement(buildingId);
|
||||
@@ -1148,12 +1188,13 @@ QByteArray DtcImplCustom::getVulnerabilityModelData( int buildingId)
|
||||
QFile f(vulnerabilityModelFilename);
|
||||
if (!f.open(QIODevice::ReadOnly))
|
||||
{
|
||||
WARNING_LOG(m_logger) << "Could not open file '" << vulnerabilityModelFilename << "' for reading: " << f.errorString();
|
||||
WARNING_LOG(m_logger) << "Could not open file '" << vulnerabilityModelModelFilename << "' for reading: " << f.errorString();
|
||||
}
|
||||
|
||||
QByteArray dataBa = f.readAll();
|
||||
return dataBa;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
} // namespace Interface
|
||||
|
||||
Reference in new issue
Block a user