Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Radar Smoothing #322

Merged
merged 33 commits into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
13a015c
Refactoring Level2ProductViewImpl to Level2ProductView::Impl
dpaulat Dec 1, 2024
84f0003
Compute smoothed coordinates
dpaulat Dec 1, 2024
1c8d7f5
Update vertices for smoothing
dpaulat Dec 1, 2024
1ac85e2
Begin logic for smoothed data moment values
dpaulat Dec 1, 2024
608b1af
Update smoothing data moment calculations
dpaulat Dec 1, 2024
5be8d7b
Fix iterator advancement
dpaulat Dec 1, 2024
e93697b
Get rid of white/max reflectivity bins due to unsigned integer underflow
dpaulat Dec 2, 2024
80d5be9
Clean up smoothed data moment population
dpaulat Dec 2, 2024
1b07c6f
Data moments should not have GLSL flat qualifiers to be sampled more …
dpaulat Dec 2, 2024
a5919ac
The last smoothed radial needs the first radial to render
dpaulat Dec 3, 2024
e0cd361
An extra empty radial is still needed for incomplete data when smoothing
dpaulat Dec 3, 2024
d3ae404
Delta angles must be normalized before they can be scaled
dpaulat Dec 3, 2024
a8132ef
Allow selection of radar smoothing
dpaulat Dec 3, 2024
9f7026b
Add pre-caluclated smoothed coordinates
dpaulat Dec 4, 2024
57f6b41
Level 3 radial product smoothing
dpaulat Dec 4, 2024
b93c76e
Merge branch 'develop' into feature/radar-smoothing
dpaulat Dec 4, 2024
44f91a3
Level 3 raster smoothing
dpaulat Dec 6, 2024
40149ae
Fix integer comparison signedness
dpaulat Dec 6, 2024
ac48ac2
Fix level 2 16-bit data moment references
dpaulat Dec 8, 2024
c492f11
Perform level 2 data moment remapping when smoothing
dpaulat Dec 8, 2024
b7970bb
Perform level 3 data moment remapping when smoothing
dpaulat Dec 8, 2024
82ea0da
Merge branch 'develop' into feature/radar-smoothing
dpaulat Dec 14, 2024
172203e
Fix 1 degree smooth coordinates location
dpaulat Dec 14, 2024
3e681ab
Add smoothing settings
dpaulat Dec 15, 2024
77e02b7
Toggle for smoothed range folding in settings dialog
dpaulat Dec 15, 2024
f010ea8
Add radar wireframe debug menu selection
dpaulat Dec 15, 2024
cc0ebcd
Save radar smoothing state in settings
dpaulat Dec 15, 2024
a65504a
Disable range folding display by default when smoothing
dpaulat Dec 15, 2024
57b773d
Linting fixes
dpaulat Dec 15, 2024
a3eb53a
Additional clang-tidy action cleanup
dpaulat Dec 16, 2024
80c3cb7
Level2ProductView::Impl is not movable (thread pool is not movable)
dpaulat Dec 16, 2024
0c17744
More clang-tidy cleanup
dpaulat Dec 16, 2024
88b1d5c
Remove unused kDataWordSize16_
dpaulat Dec 16, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Checks:
- 'misc-*'
- 'modernize-*'
- 'performance-*'
- '-cppcoreguidelines-pro-type-reinterpret-cast'
- '-misc-include-cleaner'
- '-misc-non-private-member-variables-in-classes'
- '-modernize-use-trailing-return-type'
Expand Down
6 changes: 3 additions & 3 deletions scwx-qt/gl/radar.frag
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ uniform float uDataMomentScale;

uniform bool uCFPEnabled;

flat in uint dataMoment;
flat in uint cfpMoment;
in float dataMoment;
in float cfpMoment;

layout (location = 0) out vec4 fragColor;

void main()
{
float texCoord = float(dataMoment - uDataMomentOffset) / uDataMomentScale;
float texCoord = (dataMoment - float(uDataMomentOffset)) / uDataMomentScale;

if (uCFPEnabled && cfpMoment > 8u)
{
Expand Down
4 changes: 2 additions & 2 deletions scwx-qt/gl/radar.vert
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ layout (location = 2) in uint aCfpMoment;
uniform mat4 uMVPMatrix;
uniform vec2 uMapScreenCoord;

flat out uint dataMoment;
flat out uint cfpMoment;
out float dataMoment;
out float cfpMoment;

vec2 latLngToScreenCoordinate(in vec2 latLng)
{
Expand Down
33 changes: 33 additions & 0 deletions scwx-qt/source/scwx/qt/main/main_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,8 @@ MainWindow::MainWindow(QWidget* parent) :
p->mapSettingsGroup_ = new ui::CollapsibleGroup(tr("Map Settings"), this);
p->mapSettingsGroup_->GetContentsLayout()->addWidget(ui->mapStyleLabel);
p->mapSettingsGroup_->GetContentsLayout()->addWidget(ui->mapStyleComboBox);
p->mapSettingsGroup_->GetContentsLayout()->addWidget(
ui->smoothRadarDataCheckBox);
p->mapSettingsGroup_->GetContentsLayout()->addWidget(
ui->trackLocationCheckBox);
ui->radarToolboxScrollAreaContents->layout()->replaceWidget(
Expand Down Expand Up @@ -642,6 +644,11 @@ void MainWindow::on_actionDumpRadarProductRecords_triggered()
manager::RadarProductManager::DumpRecords();
}

void MainWindow::on_actionRadarWireframe_triggered(bool checked)
{
p->activeMap_->SetRadarWireframeEnabled(checked);
}

void MainWindow::on_actionUserManual_triggered()
{
QDesktopServices::openUrl(QUrl {"https://supercell-wx.readthedocs.io/"});
Expand Down Expand Up @@ -1085,6 +1092,25 @@ void MainWindowImpl::ConnectOtherSignals()
}
}
});
connect(
mainWindow_->ui->smoothRadarDataCheckBox,
&QCheckBox::checkStateChanged,
mainWindow_,
[this](Qt::CheckState state)
{
const bool smoothingEnabled = (state == Qt::CheckState::Checked);

auto it = std::find(maps_.cbegin(), maps_.cend(), activeMap_);
if (it != maps_.cend())
{
const std::size_t i = std::distance(maps_.cbegin(), it);
settings::MapSettings::Instance().smoothing_enabled(i).StageValue(
smoothingEnabled);
}

// Turn on smoothing
activeMap_->SetSmoothingEnabled(smoothingEnabled);
});
connect(mainWindow_->ui->trackLocationCheckBox,
&QCheckBox::checkStateChanged,
mainWindow_,
Expand Down Expand Up @@ -1471,6 +1497,13 @@ void MainWindowImpl::UpdateRadarProductSettings()
{
level2SettingsGroup_->setVisible(false);
}

mainWindow_->ui->smoothRadarDataCheckBox->setCheckState(
activeMap_->GetSmoothingEnabled() ? Qt::CheckState::Checked :
Qt::CheckState::Unchecked);

mainWindow_->ui->actionRadarWireframe->setChecked(
activeMap_->GetRadarWireframeEnabled());
}

void MainWindowImpl::UpdateRadarSite()
Expand Down
3 changes: 2 additions & 1 deletion scwx-qt/source/scwx/qt/main/main_window.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class MainWindow : public QMainWindow
void keyPressEvent(QKeyEvent* ev) override final;
void keyReleaseEvent(QKeyEvent* ev) override final;
void showEvent(QShowEvent* event) override;
void closeEvent(QCloseEvent *event) override;
void closeEvent(QCloseEvent* event) override;

signals:
void ActiveMapMoved(double latitude, double longitude);
Expand All @@ -49,6 +49,7 @@ private slots:
void on_actionImGuiDebug_triggered();
void on_actionDumpLayerList_triggered();
void on_actionDumpRadarProductRecords_triggered();
void on_actionRadarWireframe_triggered(bool checked);
void on_actionUserManual_triggered();
void on_actionDiscord_triggered();
void on_actionGitHubRepository_triggered();
Expand Down
21 changes: 19 additions & 2 deletions scwx-qt/source/scwx/qt/main/main_window.ui
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@
<addaction name="separator"/>
<addaction name="actionDumpLayerList"/>
<addaction name="actionDumpRadarProductRecords"/>
<addaction name="separator"/>
<addaction name="actionRadarWireframe"/>
</widget>
<widget class="QMenu" name="menuTools">
<property name="title">
Expand Down Expand Up @@ -153,8 +155,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>205</width>
<height>701</height>
<width>190</width>
<height>680</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_6">
Expand Down Expand Up @@ -329,6 +331,13 @@
<item>
<widget class="QComboBox" name="mapStyleComboBox"/>
</item>
<item>
<widget class="QCheckBox" name="smoothRadarDataCheckBox">
<property name="text">
<string>Smooth Radar Data</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="trackLocationCheckBox">
<property name="text">
Expand Down Expand Up @@ -497,6 +506,14 @@
<string>Location &amp;Marker Manager</string>
</property>
</action>
<action name="actionRadarWireframe">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>Radar &amp;Wireframe</string>
</property>
</action>
</widget>
<resources>
<include location="../../../../scwx-qt.qrc"/>
Expand Down
Loading