feat(ui): DatasetDetailPage 原数据/网格切换+叠加开关+异常联动
This commit is contained in:
parent
535db496c4
commit
b8c74962e8
|
|
@ -28,6 +28,7 @@ add_executable(geopro_desktop WIN32
|
||||||
panels/ObjectExceptionPanel.cpp
|
panels/ObjectExceptionPanel.cpp
|
||||||
panels/chart/DatasetChartView.cpp
|
panels/chart/DatasetChartView.cpp
|
||||||
panels/AnomalyTablePanel.cpp
|
panels/AnomalyTablePanel.cpp
|
||||||
|
panels/DatasetDetailPage.cpp
|
||||||
CentralScene.cpp
|
CentralScene.cpp
|
||||||
ProjectListDialog.cpp
|
ProjectListDialog.cpp
|
||||||
SettingsDialog.cpp)
|
SettingsDialog.cpp)
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,52 @@
|
||||||
|
#include "panels/DatasetDetailPage.hpp"
|
||||||
|
#include <QVBoxLayout>
|
||||||
|
#include <QHBoxLayout>
|
||||||
|
#include <QLabel>
|
||||||
|
#include <QToolButton>
|
||||||
|
#include <QButtonGroup>
|
||||||
|
#include <QCheckBox>
|
||||||
|
#include "panels/chart/DatasetChartView.hpp"
|
||||||
|
#include "panels/AnomalyTablePanel.hpp"
|
||||||
|
namespace geopro::app {
|
||||||
|
|
||||||
|
DatasetDetailPage::DatasetDetailPage(QWidget* parent) : QWidget(parent) {
|
||||||
|
auto* lay = new QVBoxLayout(this);
|
||||||
|
auto* bar = new QHBoxLayout();
|
||||||
|
auto* origin = new QToolButton(this); origin->setText("原数据"); origin->setCheckable(true);
|
||||||
|
auto* grid = new QToolButton(this); grid->setText("网格数据"); grid->setCheckable(true);
|
||||||
|
grid->setChecked(true);
|
||||||
|
auto* grp = new QButtonGroup(this); grp->setExclusive(true); grp->addButton(origin); grp->addButton(grid);
|
||||||
|
auto* showAnom = new QCheckBox("显示异常", this); showAnom->setChecked(true);
|
||||||
|
auto* showLines = new QCheckBox("显示等值线", this); showLines->setChecked(true);
|
||||||
|
bar->addWidget(origin); bar->addWidget(grid); bar->addStretch();
|
||||||
|
bar->addWidget(showAnom); bar->addWidget(showLines);
|
||||||
|
lay->addLayout(bar);
|
||||||
|
|
||||||
|
chart_ = new DatasetChartView(this);
|
||||||
|
anomalyTable_ = new AnomalyTablePanel(this);
|
||||||
|
lay->addWidget(chart_, 3);
|
||||||
|
lay->addWidget(anomalyTable_, 1);
|
||||||
|
|
||||||
|
connect(grid, &QToolButton::clicked, this, [this] { gridMode_ = true; showGridMode(); });
|
||||||
|
connect(origin, &QToolButton::clicked, this, [this] { gridMode_ = false; showScatterMode(); });
|
||||||
|
connect(showAnom, &QCheckBox::toggled, chart_, [this](bool on) { chart_->setShowAnomalies(on); });
|
||||||
|
connect(showLines, &QCheckBox::toggled, chart_, [this](bool on) {
|
||||||
|
chart_->setShowContourLines(on); if (gridMode_) showGridMode(); });
|
||||||
|
connect(anomalyTable_, &AnomalyTablePanel::hiddenChanged, chart_,
|
||||||
|
[this](const std::set<int>& h) { chart_->setHiddenAnomalies(h); });
|
||||||
|
}
|
||||||
|
|
||||||
|
void DatasetDetailPage::setData(const geopro::controller::DatasetDetailController::ChartData& d) {
|
||||||
|
dsId_ = d.dsId; data_ = d;
|
||||||
|
chart_->setAnomalies(d.anomalies);
|
||||||
|
anomalyTable_->setAnomalies(d.anomalies, {}, {}); // 创建时间/备注可后续从 VO 补
|
||||||
|
if (gridMode_) showGridMode(); else showScatterMode();
|
||||||
|
}
|
||||||
|
void DatasetDetailPage::showGridMode() {
|
||||||
|
geopro::render::ContourOptions opt; // 默认 2x+smooth+simplify0.5
|
||||||
|
chart_->showContour(data_.grid, data_.gridScale, opt);
|
||||||
|
}
|
||||||
|
void DatasetDetailPage::showScatterMode() {
|
||||||
|
chart_->showScatter(data_.scatter, data_.scatterScale);
|
||||||
|
}
|
||||||
|
} // namespace geopro::app
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
#pragma once
|
||||||
|
#include <QWidget>
|
||||||
|
#include "DatasetDetailController.hpp" // ChartData
|
||||||
|
namespace geopro::app {
|
||||||
|
class DatasetChartView; class AnomalyTablePanel;
|
||||||
|
|
||||||
|
// 单个数据集详情页:标题 + 原数据/网格数据 切换 + 叠加开关 + 图表 + 异常表。
|
||||||
|
class DatasetDetailPage : public QWidget {
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
explicit DatasetDetailPage(QWidget* parent = nullptr);
|
||||||
|
void setData(const geopro::controller::DatasetDetailController::ChartData& d);
|
||||||
|
QString dsId() const { return dsId_; }
|
||||||
|
private:
|
||||||
|
void showScatterMode(); void showGridMode();
|
||||||
|
QString dsId_;
|
||||||
|
geopro::controller::DatasetDetailController::ChartData data_;
|
||||||
|
DatasetChartView* chart_;
|
||||||
|
AnomalyTablePanel* anomalyTable_;
|
||||||
|
bool gridMode_ = true;
|
||||||
|
};
|
||||||
|
} // namespace geopro::app
|
||||||
Loading…
Reference in New Issue