mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 20:20:06 +00:00
Add button for setting default radar products
This commit is contained in:
parent
443f5a3615
commit
ac3c986568
3 changed files with 86 additions and 52 deletions
|
|
@ -267,6 +267,7 @@ MainWindow::MainWindow(QWidget* parent) :
|
||||||
ui->vcpLabel->setVisible(false);
|
ui->vcpLabel->setVisible(false);
|
||||||
ui->vcpValueLabel->setVisible(false);
|
ui->vcpValueLabel->setVisible(false);
|
||||||
ui->vcpDescriptionLabel->setVisible(false);
|
ui->vcpDescriptionLabel->setVisible(false);
|
||||||
|
ui->saveRadarProductsButton->setVisible(true);
|
||||||
|
|
||||||
p->radarSitePresetsMenu_ = new QMenu(this);
|
p->radarSitePresetsMenu_ = new QMenu(this);
|
||||||
ui->radarSitePresetsButton->setMenu(p->radarSitePresetsMenu_);
|
ui->radarSitePresetsButton->setMenu(p->radarSitePresetsMenu_);
|
||||||
|
|
@ -326,6 +327,8 @@ MainWindow::MainWindow(QWidget* parent) :
|
||||||
ui->smoothRadarDataCheckBox);
|
ui->smoothRadarDataCheckBox);
|
||||||
p->mapSettingsGroup_->GetContentsLayout()->addWidget(
|
p->mapSettingsGroup_->GetContentsLayout()->addWidget(
|
||||||
ui->trackLocationCheckBox);
|
ui->trackLocationCheckBox);
|
||||||
|
p->mapSettingsGroup_->GetContentsLayout()->addWidget(
|
||||||
|
ui->saveRadarProductsButton);
|
||||||
ui->radarToolboxScrollAreaContents->layout()->replaceWidget(
|
ui->radarToolboxScrollAreaContents->layout()->replaceWidget(
|
||||||
ui->mapSettingsGroupBox, p->mapSettingsGroup_);
|
ui->mapSettingsGroupBox, p->mapSettingsGroup_);
|
||||||
ui->mapSettingsGroupBox->setVisible(false);
|
ui->mapSettingsGroupBox->setVisible(false);
|
||||||
|
|
@ -1124,6 +1127,22 @@ void MainWindowImpl::ConnectOtherSignals()
|
||||||
// Turn on location tracking
|
// Turn on location tracking
|
||||||
positionManager_->TrackLocation(trackingEnabled);
|
positionManager_->TrackLocation(trackingEnabled);
|
||||||
});
|
});
|
||||||
|
connect(mainWindow_->ui->saveRadarProductsButton,
|
||||||
|
&QAbstractButton::clicked,
|
||||||
|
mainWindow_,
|
||||||
|
[this]()
|
||||||
|
{
|
||||||
|
auto& mapSettings = settings::MapSettings::Instance();
|
||||||
|
for (std::size_t i = 0; i < maps_.size(); i++)
|
||||||
|
{
|
||||||
|
const auto& map = maps_.at(i);
|
||||||
|
mapSettings.radar_product_group(i).StageValue(
|
||||||
|
common::GetRadarProductGroupName(
|
||||||
|
map->GetRadarProductGroup()));
|
||||||
|
mapSettings.radar_product(i).StageValue(
|
||||||
|
map->GetRadarProductName());
|
||||||
|
}
|
||||||
|
});
|
||||||
connect(level2ProductsWidget_,
|
connect(level2ProductsWidget_,
|
||||||
&ui::Level2ProductsWidget::RadarProductSelected,
|
&ui::Level2ProductsWidget::RadarProductSelected,
|
||||||
mainWindow_,
|
mainWindow_,
|
||||||
|
|
@ -1509,6 +1528,8 @@ void MainWindowImpl::UpdateRadarProductSettings()
|
||||||
void MainWindowImpl::UpdateRadarSite()
|
void MainWindowImpl::UpdateRadarSite()
|
||||||
{
|
{
|
||||||
std::shared_ptr<config::RadarSite> radarSite = activeMap_->GetRadarSite();
|
std::shared_ptr<config::RadarSite> radarSite = activeMap_->GetRadarSite();
|
||||||
|
const std::string homeRadarSite =
|
||||||
|
settings::GeneralSettings::Instance().default_radar_site().GetValue();
|
||||||
|
|
||||||
if (radarSite != nullptr)
|
if (radarSite != nullptr)
|
||||||
{
|
{
|
||||||
|
|
@ -1523,6 +1544,9 @@ void MainWindowImpl::UpdateRadarSite()
|
||||||
radarSite->location_name().c_str());
|
radarSite->location_name().c_str());
|
||||||
|
|
||||||
timelineManager_->SetRadarSite(radarSite->id());
|
timelineManager_->SetRadarSite(radarSite->id());
|
||||||
|
|
||||||
|
mainWindow_->ui->saveRadarProductsButton->setVisible(
|
||||||
|
radarSite->id() == homeRadarSite);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -1530,6 +1554,7 @@ void MainWindowImpl::UpdateRadarSite()
|
||||||
|
|
||||||
mainWindow_->ui->radarSiteValueLabel->setVisible(false);
|
mainWindow_->ui->radarSiteValueLabel->setVisible(false);
|
||||||
mainWindow_->ui->radarLocationLabel->setVisible(false);
|
mainWindow_->ui->radarLocationLabel->setVisible(false);
|
||||||
|
mainWindow_->ui->saveRadarProductsButton->setVisible(false);
|
||||||
|
|
||||||
timelineManager_->SetRadarSite("?");
|
timelineManager_->SetRadarSite("?");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -155,8 +155,8 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>190</width>
|
<width>205</width>
|
||||||
<height>680</height>
|
<height>701</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_6">
|
<layout class="QVBoxLayout" name="verticalLayout_6">
|
||||||
|
|
@ -181,32 +181,24 @@
|
||||||
<enum>QFrame::Shadow::Raised</enum>
|
<enum>QFrame::Shadow::Raised</enum>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout" columnstretch="0,0,0,0,0">
|
<layout class="QGridLayout" name="gridLayout" columnstretch="0,0,0,0,0">
|
||||||
<item row="0" column="2">
|
<item row="3" column="2" colspan="3">
|
||||||
<widget class="QLabel" name="radarSiteValueLabel">
|
<widget class="QLabel" name="vcpValueLabel">
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string notr="true">KLSX</string>
|
<string notr="true">35</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="0" colspan="2">
|
<item row="4" column="2" colspan="3">
|
||||||
<widget class="QLabel" name="vcpLabel">
|
<widget class="QLabel" name="vcpDescriptionLabel">
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="toolTip">
|
|
||||||
<string>Volume Coverage Pattern</string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>VCP</string>
|
<string>Clear Air Mode</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="2" colspan="3">
|
||||||
|
<widget class="QLabel" name="radarLocationLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string notr="true">St. Louis, MO</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
@ -271,34 +263,6 @@
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="0" colspan="2">
|
|
||||||
<widget class="QLabel" name="radarSiteLabel">
|
|
||||||
<property name="text">
|
|
||||||
<string>Radar Site</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="2" colspan="3">
|
|
||||||
<widget class="QLabel" name="radarLocationLabel">
|
|
||||||
<property name="text">
|
|
||||||
<string notr="true">St. Louis, MO</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="3" column="2" colspan="3">
|
|
||||||
<widget class="QLabel" name="vcpValueLabel">
|
|
||||||
<property name="text">
|
|
||||||
<string notr="true">35</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="4" column="2" colspan="3">
|
|
||||||
<widget class="QLabel" name="vcpDescriptionLabel">
|
|
||||||
<property name="text">
|
|
||||||
<string>Clear Air Mode</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="3">
|
<item row="0" column="3">
|
||||||
<widget class="QToolButton" name="radarSiteSelectButton">
|
<widget class="QToolButton" name="radarSiteSelectButton">
|
||||||
<property name="maximumSize">
|
<property name="maximumSize">
|
||||||
|
|
@ -312,6 +276,42 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="3" column="0" colspan="2">
|
||||||
|
<widget class="QLabel" name="vcpLabel">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Volume Coverage Pattern</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>VCP</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="0" colspan="2">
|
||||||
|
<widget class="QLabel" name="radarSiteLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>Radar Site</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="2">
|
||||||
|
<widget class="QLabel" name="radarSiteValueLabel">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string notr="true">KLSX</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
@ -345,6 +345,13 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="saveRadarProductsButton">
|
||||||
|
<property name="text">
|
||||||
|
<string>Set As Default Products</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
|
||||||
|
|
@ -76,7 +76,7 @@ public:
|
||||||
{
|
{
|
||||||
common::RadarProductGroup radarProductGroup =
|
common::RadarProductGroup radarProductGroup =
|
||||||
common::GetRadarProductGroup(
|
common::GetRadarProductGroup(
|
||||||
map_.at(i).radarProductGroup_.GetValue());
|
map_.at(i).radarProductGroup_.GetStagedOrValue());
|
||||||
|
|
||||||
if (radarProductGroup == common::RadarProductGroup::Level2)
|
if (radarProductGroup == common::RadarProductGroup::Level2)
|
||||||
{
|
{
|
||||||
|
|
@ -193,6 +193,8 @@ bool MapSettings::Shutdown()
|
||||||
|
|
||||||
dataChanged |= mapRecordSettings.mapStyle_.Commit();
|
dataChanged |= mapRecordSettings.mapStyle_.Commit();
|
||||||
dataChanged |= mapRecordSettings.smoothingEnabled_.Commit();
|
dataChanged |= mapRecordSettings.smoothingEnabled_.Commit();
|
||||||
|
dataChanged |= mapRecordSettings.radarProductGroup_.Commit();
|
||||||
|
dataChanged |= mapRecordSettings.radarProduct_.Commit();
|
||||||
}
|
}
|
||||||
|
|
||||||
return dataChanged;
|
return dataChanged;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue