mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 16:40:05 +00:00
initial basic WFO base alert location method
This commit is contained in:
parent
6b4045081e
commit
bf24dac317
7 changed files with 198 additions and 140 deletions
|
|
@ -39,6 +39,7 @@ public:
|
|||
alertLongitude_.SetDefault(0.0);
|
||||
alertRadius_.SetDefault(0.0);
|
||||
alertRadarSite_.SetDefault("default");
|
||||
alertWFO_.SetDefault("");
|
||||
ignoreMissingCodecs_.SetDefault(false);
|
||||
|
||||
alertLatitude_.SetMinimum(-90.0);
|
||||
|
|
@ -62,6 +63,14 @@ public:
|
|||
config::CountyDatabase::GetCountyName(value) != value;
|
||||
});
|
||||
|
||||
alertWFO_.SetValidator(
|
||||
[](const std::string& value)
|
||||
{
|
||||
return value.empty() ||
|
||||
config::CountyDatabase::GetWFOs().count(value) != 0;
|
||||
});
|
||||
|
||||
|
||||
auto& alertAudioPhenomena = types::GetAlertAudioPhenomena();
|
||||
alertEnabled_.reserve(alertAudioPhenomena.size() + 1);
|
||||
|
||||
|
|
@ -94,6 +103,7 @@ public:
|
|||
SettingsVariable<std::string> alertRadarSite_ {"alert_radar_site"};
|
||||
SettingsVariable<double> alertRadius_ {"alert_radius"};
|
||||
SettingsVariable<std::string> alertCounty_ {"alert_county"};
|
||||
SettingsVariable<std::string> alertWFO_ {"alert_wfo"};
|
||||
SettingsVariable<bool> ignoreMissingCodecs_ {"ignore_missing_codecs"};
|
||||
|
||||
std::unordered_map<awips::Phenomenon, SettingsVariable<bool>>
|
||||
|
|
@ -111,6 +121,7 @@ AudioSettings::AudioSettings() :
|
|||
&p->alertRadarSite_,
|
||||
&p->alertRadius_,
|
||||
&p->alertCounty_,
|
||||
&p->alertWFO_,
|
||||
&p->ignoreMissingCodecs_});
|
||||
RegisterVariables(p->variables_);
|
||||
SetDefaults();
|
||||
|
|
@ -157,6 +168,11 @@ SettingsVariable<std::string>& AudioSettings::alert_county() const
|
|||
return p->alertCounty_;
|
||||
}
|
||||
|
||||
SettingsVariable<std::string>& AudioSettings::alert_wfo() const
|
||||
{
|
||||
return p->alertWFO_;
|
||||
}
|
||||
|
||||
SettingsVariable<bool>&
|
||||
AudioSettings::alert_enabled(awips::Phenomenon phenomenon) const
|
||||
{
|
||||
|
|
@ -188,6 +204,7 @@ bool operator==(const AudioSettings& lhs, const AudioSettings& rhs)
|
|||
lhs.p->alertRadarSite_ == rhs.p->alertRadarSite_ &&
|
||||
lhs.p->alertRadius_ == rhs.p->alertRadius_ &&
|
||||
lhs.p->alertCounty_ == rhs.p->alertCounty_ &&
|
||||
lhs.p->alertWFO_ == rhs.p->alertWFO_ &&
|
||||
lhs.p->alertEnabled_ == rhs.p->alertEnabled_);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ public:
|
|||
SettingsVariable<double>& alert_radius() const;
|
||||
SettingsVariable<std::string>& alert_radar_site() const;
|
||||
SettingsVariable<std::string>& alert_county() const;
|
||||
SettingsVariable<std::string>& alert_wfo() const;
|
||||
SettingsVariable<bool>& alert_enabled(awips::Phenomenon phenomenon) const;
|
||||
SettingsVariable<bool>& ignore_missing_codecs() const;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue