/** * @RDE_HEADER@ * Custom asm dtc functions (extends asm_dtc_impl.cpp/.h) * $Id$ * $HeadURL$ * $Author$ * Created by Iuliana Ojog, 2022-04-25 */ #include "asm_dtc_impl_custom.h" #include #include namespace AssetManagement { namespace Interface { DtcImplCustom::DtcImplCustom(const std::shared_ptr &ddsConnector) : DtcImpl(ddsConnector) { } bool DtcImplCustom::isAARWorkstation(const QString &wsName) { if (!isAssetEnabled()) { enableAsset(); waitForHistoricalDataAsset(4000); } int wsId = -1; for (const auto &at : m_dtcAsset->readAlive()) { if (at.data().assetTypeId() == AssetManagement::AssetType::MobileAfterActionVehicle && QString::fromStdString(at.data().name()).toUpper() == wsName.toUpper()) { wsId = at.data().id(); break; } } return (wsId > 0); } int DtcImplCustom::getAssetId(const QString &wsName) { if (!isAssetEnabled()) { enableAsset(); waitForHistoricalDataAsset(4000); } int wsId = -1; for (const auto &at : m_dtcAsset->readAlive()) { if ( QString::fromStdString(at.data().name()).toUpper() == wsName.toUpper()) { wsId = at.data().id(); break; } } return (wsId); } }//Interface }//namespace AssetManagement