Migrates EffectShow and AssetManagement to generated rtiddsgen API
Converts accessor calls to plain member access across esc and asm services.
This commit is contained in:
39 files changed
+818
-818
No files matched your search
+32
-32
@@ -35,7 +35,7 @@ Database::EsmEffectShow EffectShowExplosionCluster::getEffectShow(int idx)
|
||||
|
||||
Database::EsmEffectShow esmEffectShow;
|
||||
|
||||
if (!m_handlerPdmData->isSmoke(m_explosionCluster.chargeStruct()))
|
||||
if (!m_handlerPdmData->isSmoke(m_explosionCluster.chargeStruct))
|
||||
{
|
||||
int indX = idx % m_areasWidth.numOfAreas;
|
||||
int indY = idx / m_areasWidth.numOfAreas;
|
||||
@@ -62,15 +62,15 @@ Database::EsmEffectShow EffectShowExplosionCluster::getEffectShow(int idx)
|
||||
|
||||
esmEffectShow.id = 0;
|
||||
esmEffectShow.name = QStringLiteral("EXP");
|
||||
esmEffectShow.startTime = m_explosionCluster.effectStart().is_set() ? m_explosionCluster.effectStart().get() : 0;
|
||||
esmEffectShow.duration = m_explosionCluster.effectDuration();
|
||||
esmEffectShow.startTime = m_explosionCluster.effectStart.is_set() ? m_explosionCluster.effectStart.get() : 0;
|
||||
esmEffectShow.duration = m_explosionCluster.effectDuration;
|
||||
esmEffectShow.centerPosition = centerPosRotated.geographic();
|
||||
esmEffectShow.idAreaEffectSimulation = m_explosionCluster.id();
|
||||
esmEffectShow.idAreaEffectSimulation = m_explosionCluster.id;
|
||||
esmEffectShow.esmParticipantId = -1;
|
||||
esmEffectShow.nameAreaEfffectSimulation = QString::fromStdString(m_explosionCluster.name());
|
||||
esmEffectShow.nameAreaEfffectSimulation = QString::fromStdString(m_explosionCluster.name);
|
||||
esmEffectShow.numOfVolley = getNumberOfVolley();
|
||||
esmEffectShow.shotsPerVolley = getShotsPerArea() / esmEffectShow.numOfVolley;
|
||||
esmEffectShow.typeOfAmmunition = m_explosionCluster.chargeStruct().chargeTypeId();
|
||||
esmEffectShow.typeOfAmmunition = m_explosionCluster.chargeStruct.chargeTypeId;
|
||||
// can there be more then 48 shoots?
|
||||
|
||||
if (esmEffectShow.shotsPerVolley > 48)
|
||||
@@ -80,10 +80,10 @@ Database::EsmEffectShow EffectShowExplosionCluster::getEffectShow(int idx)
|
||||
esmEffectShow.lowerLeftPosition = lowerLeftPosRotated.geographic();
|
||||
esmEffectShow.areaWidth = m_areasWidth.side(indX);
|
||||
esmEffectShow.areaDepth = m_areasDepth.side(indY);
|
||||
esmEffectShow.areaRotation = m_explosionCluster.area().rotation() + 90;
|
||||
esmEffectShow.areaRotation = m_explosionCluster.area.rotation + 90;
|
||||
|
||||
|
||||
DEBUG_LOG(m_logger) << "\nWidth: " << m_explosionCluster.area().width() << " Height: " << m_explosionCluster.area().height()
|
||||
DEBUG_LOG(m_logger) << "\nWidth: " << m_explosionCluster.area.width << " Height: " << m_explosionCluster.area.height
|
||||
<< "\nRotated LL Pos: " << lowerLeftPosRotated.mgrs()
|
||||
<< "\nRotated Center Pos: " << centerPosRotated.mgrs()
|
||||
<< "\nOffset x,y: " << x_off << " , " << y_off
|
||||
@@ -100,30 +100,30 @@ Database::EsmEffectShow EffectShowExplosionCluster::getEffectShow(int idx)
|
||||
|
||||
// calculate center position
|
||||
LtsCoordTrans::UtmCoordinate centerPos = lowerLeftPosRotated;
|
||||
centerPos.x = centerPos.x + m_explosionCluster.area().width() / 2.;
|
||||
centerPos.y = centerPos.y + m_explosionCluster.area().height() / 2.;
|
||||
centerPos.x = centerPos.x + m_explosionCluster.area.width / 2.;
|
||||
centerPos.y = centerPos.y + m_explosionCluster.area.height / 2.;
|
||||
LtsCoordTrans::UtmCoordinate centerPosRotated = rotate(centerPos, m_lowerLeftPos, rotationRad());
|
||||
|
||||
esmEffectShow.id = 0;
|
||||
esmEffectShow.name = QStringLiteral("EXP");
|
||||
esmEffectShow.startTime = m_explosionCluster.effectStart().is_set() ? m_explosionCluster.effectStart().get() : 0;
|
||||
esmEffectShow.duration = m_explosionCluster.effectDuration();
|
||||
esmEffectShow.startTime = m_explosionCluster.effectStart.is_set() ? m_explosionCluster.effectStart.get() : 0;
|
||||
esmEffectShow.duration = m_explosionCluster.effectDuration;
|
||||
esmEffectShow.centerPosition = centerPosRotated.geographic();
|
||||
esmEffectShow.idAreaEffectSimulation = m_explosionCluster.id();
|
||||
esmEffectShow.idAreaEffectSimulation = m_explosionCluster.id;
|
||||
esmEffectShow.esmParticipantId = -1;
|
||||
esmEffectShow.nameAreaEfffectSimulation = QString::fromStdString(m_explosionCluster.name());
|
||||
esmEffectShow.typeOfAmmunition = m_explosionCluster.chargeStruct().chargeTypeId();
|
||||
esmEffectShow.nameAreaEfffectSimulation = QString::fromStdString(m_explosionCluster.name);
|
||||
esmEffectShow.typeOfAmmunition = m_explosionCluster.chargeStruct.chargeTypeId;
|
||||
esmEffectShow.numOfVolley = 1;
|
||||
esmEffectShow.shotsPerVolley = 1;
|
||||
esmEffectShow.lowerLeftPosition = lowerLeftPosRotated.geographic();
|
||||
esmEffectShow.areaWidth = m_explosionCluster.area().width();
|
||||
esmEffectShow.areaDepth = m_explosionCluster.area().height();
|
||||
esmEffectShow.areaRotation = m_explosionCluster.area().rotation() + 90;
|
||||
esmEffectShow.areaWidth = m_explosionCluster.area.width;
|
||||
esmEffectShow.areaDepth = m_explosionCluster.area.height;
|
||||
esmEffectShow.areaRotation = m_explosionCluster.area.rotation + 90;
|
||||
|
||||
DEBUG_LOG(m_logger) << "\nWidth: " << m_explosionCluster.area().width() << " Height: " << m_explosionCluster.area().height()
|
||||
DEBUG_LOG(m_logger) << "\nWidth: " << m_explosionCluster.area.width << " Height: " << m_explosionCluster.area.height
|
||||
<< "\nRotated LL Pos: " << lowerLeftPosRotated.mgrs()
|
||||
<< "\nRotated Center Pos: " << centerPosRotated.mgrs()
|
||||
<< "\nSide x,y: " << m_explosionCluster.area().width() << " , " << m_explosionCluster.area().height();
|
||||
<< "\nSide x,y: " << m_explosionCluster.area.width << " , " << m_explosionCluster.area.height;
|
||||
}
|
||||
|
||||
return esmEffectShow;
|
||||
@@ -133,27 +133,27 @@ void EffectShowExplosionCluster::updateEffectShow(Database::EsmEffectShow &data)
|
||||
{
|
||||
|
||||
DEBUG_LOG(m_logger) << "update EffectSHow for (" << data.id << ")";
|
||||
data.nameAreaEfffectSimulation = QString::fromStdString(m_explosionCluster.name());
|
||||
data.startTime = m_explosionCluster.effectStart().is_set() ? m_explosionCluster.effectStart().get() : 0;
|
||||
data.duration = m_explosionCluster.effectDuration();
|
||||
data.nameAreaEfffectSimulation = QString::fromStdString(m_explosionCluster.name);
|
||||
data.startTime = m_explosionCluster.effectStart.is_set() ? m_explosionCluster.effectStart.get() : 0;
|
||||
data.duration = m_explosionCluster.effectDuration;
|
||||
|
||||
if (data.shotsPerVolley > 48)
|
||||
data.shotsPerVolley = 48;//(48 / data.numOfVolley);
|
||||
if (data.shotsPerVolley <= 0)
|
||||
data.shotsPerVolley = 1;
|
||||
|
||||
data.typeOfAmmunition = m_explosionCluster.chargeStruct().chargeTypeId();
|
||||
data.typeOfAmmunition = m_explosionCluster.chargeStruct.chargeTypeId;
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
void EffectShowExplosionCluster::calculateSquare()
|
||||
{
|
||||
Core::GeoPosition2D geoPos = m_explosionCluster.area().cornerBottomLeft();
|
||||
m_lowerLeftPos = LtsCoordTrans::UtmCoordinate::fromGeographic(geoPos.lon(), geoPos.lat());
|
||||
Core::GeoPosition2D geoPos = m_explosionCluster.area.cornerBottomLeft;
|
||||
m_lowerLeftPos = LtsCoordTrans::UtmCoordinate::fromGeographic(geoPos.lon, geoPos.lat);
|
||||
|
||||
// Calculate squares.
|
||||
m_areasWidth = getAreasSideLength(m_explosionCluster.area().width()); // Squares in x-direction
|
||||
m_areasDepth = getAreasSideLength(m_explosionCluster.area().height()); // Squares in y-direction
|
||||
m_numOfEffectShows = m_handlerPdmData->effectShowCount(m_explosionCluster.chargeStruct());
|
||||
m_areasWidth = getAreasSideLength(m_explosionCluster.area.width); // Squares in x-direction
|
||||
m_areasDepth = getAreasSideLength(m_explosionCluster.area.height); // Squares in y-direction
|
||||
m_numOfEffectShows = m_handlerPdmData->effectShowCount(m_explosionCluster.chargeStruct);
|
||||
}
|
||||
//static ----------------------------------------------------------------------
|
||||
LtsCoordTrans::UtmCoordinate EffectShowExplosionCluster::rotate(const LtsCoordTrans::UtmCoordinate &p, const LtsCoordTrans::UtmCoordinate &c, double angle)
|
||||
@@ -198,7 +198,7 @@ int EffectShowExplosionCluster::getShotsPerArea() const
|
||||
{
|
||||
if (!m_numOfEffectShows)
|
||||
return 0;
|
||||
int v = m_explosionCluster.impactCount(); //cannonCount() * m_explosionCluster.cannonRounds();
|
||||
int v = m_explosionCluster.impactCount; //cannonCount() * m_explosionCluster.cannonRounds();
|
||||
return v / m_numOfEffectShows; //split even across all effect shows
|
||||
}
|
||||
|
||||
@@ -206,7 +206,7 @@ int EffectShowExplosionCluster::getShotsPerArea(int areas) const
|
||||
{
|
||||
if (areas == 0)
|
||||
return 0;
|
||||
int v = m_explosionCluster.impactCount();//cannonCount() * m_explosionCluster.cannonRounds();
|
||||
int v = m_explosionCluster.impactCount;//cannonCount() * m_explosionCluster.cannonRounds();
|
||||
|
||||
return v / areas;
|
||||
}
|
||||
@@ -232,7 +232,7 @@ int EffectShowExplosionCluster::getNumberOfVolley(int v)
|
||||
//-----------------------------------------------------------------------------
|
||||
double EffectShowExplosionCluster::rotationRad() const
|
||||
{
|
||||
return -m_explosionCluster.area().rotation() * LtsCoordTrans::deg2rad();
|
||||
return -m_explosionCluster.area.rotation * LtsCoordTrans::deg2rad();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
Reference in new issue
Block a user