Migrates AreaEffectSimulation to generated rtiddsgen API
Converts accessor calls to plain member access across aes service and plugin.
This commit is contained in:
102 files changed
+3307
-3313
No files matched your search
+20
-20
@@ -37,38 +37,38 @@ MeteoDataManagement::MeteoData MeteoDataProvider::getStaticWeather()
|
||||
}
|
||||
// default values from wikipedia for aviations
|
||||
MeteoDataManagement::MeteoData dummyWeather;
|
||||
dummyWeather.pressure(1013.25);
|
||||
dummyWeather.temperature(15);
|
||||
dummyWeather.humidity(0);
|
||||
dummyWeather.pressure = 1013.25;
|
||||
dummyWeather.temperature = 15;
|
||||
dummyWeather.humidity = 0;
|
||||
|
||||
dummyWeather.timeStamp(m_mainHandler->dds()->currentPartitionTimeMSec());
|
||||
dummyWeather.windDirection(0);
|
||||
dummyWeather.windSpeed(0);
|
||||
dummyWeather.windOk(true);
|
||||
dummyWeather.climateOk(true);
|
||||
dummyWeather.timeStamp = m_mainHandler->dds()->currentPartitionTimeMSec();
|
||||
dummyWeather.windDirection = 0;
|
||||
dummyWeather.windSpeed = 0;
|
||||
dummyWeather.windOk = true;
|
||||
dummyWeather.climateOk = true;
|
||||
return dummyWeather;
|
||||
}
|
||||
|
||||
MeteoDataManagement::MeteoData MeteoDataProvider::getNearestWeather(const Core::GeoPosition2D &pos)
|
||||
{
|
||||
initWeatherData();
|
||||
LtsCoordTrans::UtmCoordinate utm(LtsCoordTrans::UtmCoordinate::fromGeographic(pos.lon(), pos.lat()));
|
||||
LtsCoordTrans::UtmCoordinate utm(LtsCoordTrans::UtmCoordinate::fromGeographic(pos.lon, pos.lat));
|
||||
double nearestDistanceSquared = std::numeric_limits<double>::max();
|
||||
MeteoDataManagement::MeteoData retMd;
|
||||
for (const auto &md : qAsConst(m_meteoData))
|
||||
{
|
||||
if (md.isStaticMeteoData())
|
||||
if (md.isStaticMeteoData)
|
||||
continue;
|
||||
if (QDateTime::fromMSecsSinceEpoch(md.timeStamp()).addMSecs(Settings::getValidityPeriodWeatherData()) < m_mainHandler->dds()->currentPartitionTime())
|
||||
if (QDateTime::fromMSecsSinceEpoch(md.timeStamp).addMSecs(Settings::getValidityPeriodWeatherData()) < m_mainHandler->dds()->currentPartitionTime())
|
||||
continue;
|
||||
const double distanceSquared = LtsCoordTrans::squareDistance(utm, md.pos().lon(), md.pos().lat());
|
||||
const double distanceSquared = LtsCoordTrans::squareDistance(utm, md.pos.lon, md.pos.lat);
|
||||
if (distanceSquared < nearestDistanceSquared)
|
||||
{
|
||||
retMd = md;
|
||||
nearestDistanceSquared = distanceSquared;
|
||||
}
|
||||
}
|
||||
return (retMd.id() > 0) ? retMd : getStaticWeather();
|
||||
return (retMd.id > 0) ? retMd : getStaticWeather();
|
||||
}
|
||||
|
||||
void MeteoDataProvider::meteoDataChanged(const MeteoDataManagement::MeteoData &data, DataModification modType)
|
||||
@@ -76,15 +76,15 @@ void MeteoDataProvider::meteoDataChanged(const MeteoDataManagement::MeteoData &d
|
||||
switch (modType)
|
||||
{
|
||||
case DataModification::eRemoved:
|
||||
m_meteoData.remove(data.id());
|
||||
if (m_staticWeatherId == data.id())
|
||||
m_meteoData.remove(data.id);
|
||||
if (m_staticWeatherId == data.id)
|
||||
m_staticWeatherId = 0;
|
||||
break;
|
||||
case DataModification::eAdded:
|
||||
case DataModification::eModified:
|
||||
m_meteoData[data.id()] = data;
|
||||
if (data.isStaticMeteoData())
|
||||
m_staticWeatherId = data.id();
|
||||
m_meteoData[data.id] = data;
|
||||
if (data.isStaticMeteoData)
|
||||
m_staticWeatherId = data.id;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -96,9 +96,9 @@ void MeteoDataProvider::initWeatherData()
|
||||
m_mdmDtc->waitForHistoricalDataMeteoData();
|
||||
m_meteoData = m_mdmDtc->meteoDatas();
|
||||
for (const auto &data : qAsConst(m_meteoData))
|
||||
if (data.isStaticMeteoData())
|
||||
if (data.isStaticMeteoData)
|
||||
{
|
||||
m_staticWeatherId = data.id();
|
||||
m_staticWeatherId = data.id;
|
||||
return;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user