Initial commit
This commit is contained in:
commit
b7d90b9afe
16245 files changed
+3396666
No files matched your search
+70
@@ -0,0 +1,70 @@
|
||||
/**
|
||||
* @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 <DDS/DTC/generic_dtc.h>
|
||||
#include <DDS/Generic/generic_data_reader.h>
|
||||
|
||||
namespace AssetManagement
|
||||
{
|
||||
namespace Interface
|
||||
{
|
||||
DtcImplCustom::DtcImplCustom(const std::shared_ptr<DDSConnector::DdsConnector> &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
|
||||
|
||||
|
||||
Reference in new issue
Block a user