mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 19:50:05 +00:00
added **BASIC** unit handling to radius field.
This commit is contained in:
parent
b421251bcd
commit
c53836e91a
6 changed files with 95 additions and 4 deletions
|
|
@ -8,6 +8,8 @@
|
|||
#include <scwx/util/logger.hpp>
|
||||
#include <scwx/qt/config/radar_site.hpp>
|
||||
#include <scwx/qt/settings/general_settings.hpp>
|
||||
#include <scwx/qt/settings/unit_settings.hpp>
|
||||
#include <scwx/qt/types/unit_types.hpp>
|
||||
|
||||
#include <boost/asio/post.hpp>
|
||||
#include <boost/asio/thread_pool.hpp>
|
||||
|
|
@ -138,12 +140,19 @@ void AlertManager::Impl::HandleAlert(const types::TextEventKey& key,
|
|||
}
|
||||
|
||||
settings::AudioSettings& audioSettings = settings::AudioSettings::Instance();
|
||||
settings::UnitSettings& unitSettings = settings::UnitSettings::Instance();
|
||||
types::LocationMethod locationMethod = types::GetLocationMethod(
|
||||
audioSettings.alert_location_method().GetValue());
|
||||
common::Coordinate currentCoordinate = CurrentCoordinate(locationMethod);
|
||||
std::string alertCounty = audioSettings.alert_county().GetValue();
|
||||
auto alertRadius =
|
||||
units::length::meters<double>(audioSettings.alert_radius().GetValue());
|
||||
|
||||
types::DistanceUnits radiusUnits =
|
||||
types::GetDistanceUnitsFromName(unitSettings.distance_units().GetValue());
|
||||
double radiusScale = types::GetDistanceUnitsScale(radiusUnits);
|
||||
auto alertRadius = units::length::kilometers<double>(
|
||||
audioSettings.alert_radius().GetValue() / radiusScale);
|
||||
|
||||
logger_->debug("alertRadius: {}", (double)alertRadius);
|
||||
|
||||
auto message = textEventManager_->message_list(key).at(messageIndex);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue