添加峰拟合视图初步实现;优化其他一直BUG;
This commit is contained in:
parent
7219460e45
commit
a3bfaa3333
|
|
@ -54,10 +54,12 @@ QList<QwtPlotCurve *> CustomQwtPlot::GetCurveList() const
|
||||||
return _curves.values();
|
return _curves.values();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CustomQwtPlot::AddCurve(QwtPlotCurve *curve)
|
void CustomQwtPlot::AddCurve(QwtPlotCurve *curve, bool auto_color)
|
||||||
{
|
{
|
||||||
if (curve) {
|
if (curve) {
|
||||||
|
if ( auto_color ) {
|
||||||
curve->setPen(QPen(getDistinctColorForManyCurves(_curves.count()), 1));
|
curve->setPen(QPen(getDistinctColorForManyCurves(_curves.count()), 1));
|
||||||
|
}
|
||||||
curve->setZ(0);
|
curve->setZ(0);
|
||||||
curve->attach(this);
|
curve->attach(this);
|
||||||
_curves[curve->title().text()] = curve;
|
_curves[curve->title().text()] = curve;
|
||||||
|
|
@ -212,14 +214,17 @@ void CustomQwtPlot::showEvent(QShowEvent *event)
|
||||||
{
|
{
|
||||||
Q_UNUSED(event);
|
Q_UNUSED(event);
|
||||||
this->updateAxes();
|
this->updateAxes();
|
||||||
double x_min = this->axisScaleDiv(QwtPlot::xBottom).lowerBound();
|
if ((0 == this->_init_x_max) && (0 == this->_init_y_max)) {
|
||||||
|
// double x_min = this->axisScaleDiv(QwtPlot::xBottom).lowerBound();
|
||||||
double x_max = this->axisScaleDiv(QwtPlot::xBottom).upperBound();
|
double x_max = this->axisScaleDiv(QwtPlot::xBottom).upperBound();
|
||||||
double y_min = this->axisScaleDiv(QwtPlot::yLeft).lowerBound();
|
double y_min = this->axisScaleDiv(QwtPlot::yLeft).lowerBound();
|
||||||
double y_max = this->axisScaleDiv(QwtPlot::yLeft).upperBound();
|
double y_max = this->axisScaleDiv(QwtPlot::yLeft).upperBound();
|
||||||
this->_init_x_min = x_min;
|
this->_init_x_min = 0;
|
||||||
this->_init_x_max = x_max;
|
this->_init_x_max = x_max;
|
||||||
this->_init_y_min = y_min;
|
this->_init_y_min = y_min;
|
||||||
this->_init_y_max = y_max;
|
this->_init_y_max = y_max;
|
||||||
|
this->setAxisScale(QwtPlot::xBottom, 0, x_max);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CustomQwtPlotXaxisPanner::CustomQwtPlotXaxisPanner(QWidget *canvas)
|
CustomQwtPlotXaxisPanner::CustomQwtPlotXaxisPanner(QWidget *canvas)
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ public:
|
||||||
|
|
||||||
QwtPlotCurve* GetCurve(const QString& curve_name);
|
QwtPlotCurve* GetCurve(const QString& curve_name);
|
||||||
QList<QwtPlotCurve*> GetCurveList() const;
|
QList<QwtPlotCurve*> GetCurveList() const;
|
||||||
void AddCurve(QwtPlotCurve* curve);
|
void AddCurve(QwtPlotCurve* curve, bool auto_color = true);
|
||||||
|
|
||||||
QwtPlotMarker* GetMarker(const QString& marker_name, const QString& postion);
|
QwtPlotMarker* GetMarker(const QString& marker_name, const QString& postion);
|
||||||
QList<QwtPlotMarker*> GetMarkerList() const;
|
QList<QwtPlotMarker*> GetMarkerList() const;
|
||||||
|
|
@ -42,8 +42,8 @@ protected:
|
||||||
bool eventFilter(QObject *obj, QEvent *event) override;
|
bool eventFilter(QObject *obj, QEvent *event) override;
|
||||||
virtual void showEvent(QShowEvent *event) override;
|
virtual void showEvent(QShowEvent *event) override;
|
||||||
private:
|
private:
|
||||||
double _init_x_min = 0, _init_x_max = 10;
|
double _init_x_min = 0, _init_x_max = 0;
|
||||||
double _init_y_min = 0, _init_y_max = 10;
|
double _init_y_min = 0, _init_y_max = 0;
|
||||||
bool _is_dragging = false;
|
bool _is_dragging = false;
|
||||||
QPoint _last_pos;
|
QPoint _last_pos;
|
||||||
std::function<bool(QObject*, QEvent*)> _event_filter_func = nullptr;
|
std::function<bool(QObject*, QEvent*)> _event_filter_func = nullptr;
|
||||||
|
|
|
||||||
|
|
@ -57,8 +57,6 @@ void EnergyCountPlotView::SetAnalyzeDataFilename(const QMap<QString, QVariant> &
|
||||||
|
|
||||||
void EnergyCountPlotView::setupPlot()
|
void EnergyCountPlotView::setupPlot()
|
||||||
{
|
{
|
||||||
_plot->setTitle(QString(QStringLiteral(u"能量计数谱")));
|
|
||||||
|
|
||||||
_plot->setCanvasBackground(Qt::white);
|
_plot->setCanvasBackground(Qt::white);
|
||||||
QwtPlotCanvas* canvas = qobject_cast<QwtPlotCanvas*>(_plot->canvas());
|
QwtPlotCanvas* canvas = qobject_cast<QwtPlotCanvas*>(_plot->canvas());
|
||||||
canvas->setFrameStyle(QFrame::NoFrame);
|
canvas->setFrameStyle(QFrame::NoFrame);
|
||||||
|
|
|
||||||
|
|
@ -120,10 +120,10 @@ void MainWindow::initMainWindow()
|
||||||
MeasureAnalysisHistoryForm* measure_analysis_history_form = new MeasureAnalysisHistoryForm;
|
MeasureAnalysisHistoryForm* measure_analysis_history_form = new MeasureAnalysisHistoryForm;
|
||||||
CDockWidget* central_dock_widget = _dock_manager->createDockWidget(QStringLiteral(u"测量分析记录"));
|
CDockWidget* central_dock_widget = _dock_manager->createDockWidget(QStringLiteral(u"测量分析记录"));
|
||||||
central_dock_widget->setWidget(measure_analysis_history_form);
|
central_dock_widget->setWidget(measure_analysis_history_form);
|
||||||
central_dock_widget->setFeature(ads::CDockWidget::AllDockWidgetFeatures, true);
|
// central_dock_widget->setFeature(ads::CDockWidget::AllDockWidgetFeatures, true);
|
||||||
_central_dock_area = _dock_manager->setCentralWidget(central_dock_widget);
|
_central_dock_area = _dock_manager->setCentralWidget(central_dock_widget);
|
||||||
_action_central_dock_widget = central_dock_widget->toggleViewAction();
|
_action_central_dock_widget = central_dock_widget->toggleViewAction();
|
||||||
_action_central_dock_widget->setCheckable(false);
|
// _action_central_dock_widget->setCheckable(false);
|
||||||
ui->menu_view->addAction(_action_central_dock_widget);
|
ui->menu_view->addAction(_action_central_dock_widget);
|
||||||
|
|
||||||
// 构建测量分析工程树视图
|
// 构建测量分析工程树视图
|
||||||
|
|
|
||||||
|
|
@ -187,6 +187,15 @@ void MeasureAnalysisTreeView::onNodeDoubleClicked(const QModelIndex& index)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
|
case AnalysisType::EnergyPeakFitView: {
|
||||||
|
MeasureAnalysisProjectModel* project_model = _model->GetProjectModel(project_name);
|
||||||
|
if (project_model) {
|
||||||
|
auto all_ch_energy_count_file_name = project_model->GetAllChannelEnergyTotalCountDataFilename();
|
||||||
|
if (!all_ch_energy_count_file_name.isEmpty()) {
|
||||||
|
data_files_set[QStringLiteral(u"测量能谱")] = all_ch_energy_count_file_name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} break;
|
||||||
case AnalysisType::ParticleInTimeView: {
|
case AnalysisType::ParticleInTimeView: {
|
||||||
MeasureAnalysisProjectModel* project_model = _model->GetProjectModel(project_name);
|
MeasureAnalysisProjectModel* project_model = _model->GetProjectModel(project_name);
|
||||||
if (project_model) {
|
if (project_model) {
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,8 @@
|
||||||
#include "EnergyCountPlotView.h"
|
#include "EnergyCountPlotView.h"
|
||||||
#include "ParticleTimePoorView.h"
|
#include "ParticleTimePoorView.h"
|
||||||
#include "ConformityAnalysis.h"
|
#include "ConformityAnalysis.h"
|
||||||
|
#include "EnergyCountPeakFitView.h"
|
||||||
|
|
||||||
MeasureAnalysisView *MeasureAnalysisView::NewAnalyzeView(AnalysisType view_type)
|
MeasureAnalysisView *MeasureAnalysisView::NewAnalyzeView(AnalysisType view_type)
|
||||||
{
|
{
|
||||||
MeasureAnalysisView* new_view = nullptr;
|
MeasureAnalysisView* new_view = nullptr;
|
||||||
|
|
@ -72,8 +74,8 @@ MeasureAnalysisView *MeasureAnalysisView::NewAnalyzeView(AnalysisType view_type)
|
||||||
new_view->setDeleteOnClose(false);
|
new_view->setDeleteOnClose(false);
|
||||||
} break;
|
} break;
|
||||||
case AnalysisType::EnergyPeakFitView: {
|
case AnalysisType::EnergyPeakFitView: {
|
||||||
// new_view = new MeasureAnalysisDataTableView;
|
new_view = new EnergyCountPeakFitView;
|
||||||
// new_view->setDeleteOnClose(false);
|
new_view->setDeleteOnClose(false);
|
||||||
} break;
|
} break;
|
||||||
case AnalysisType::NuclideAnalysisView: {
|
case AnalysisType::NuclideAnalysisView: {
|
||||||
// new_view = new MeasureAnalysisDataTableView;
|
// new_view = new MeasureAnalysisDataTableView;
|
||||||
|
|
|
||||||
|
|
@ -152,8 +152,6 @@ void ParticleCountPlotView::setupMenu()
|
||||||
|
|
||||||
void ParticleCountPlotView::setupPlot()
|
void ParticleCountPlotView::setupPlot()
|
||||||
{
|
{
|
||||||
_plot->setTitle(QString(QStringLiteral(u"粒子计数谱")));
|
|
||||||
|
|
||||||
_plot->setCanvasBackground(Qt::white);
|
_plot->setCanvasBackground(Qt::white);
|
||||||
QwtPlotCanvas* canvas = qobject_cast<QwtPlotCanvas*>(_plot->canvas());
|
QwtPlotCanvas* canvas = qobject_cast<QwtPlotCanvas*>(_plot->canvas());
|
||||||
canvas->setFrameStyle(QFrame::NoFrame);
|
canvas->setFrameStyle(QFrame::NoFrame);
|
||||||
|
|
|
||||||
10
src/src.pro
10
src/src.pro
|
|
@ -37,7 +37,8 @@ INCLUDEPATH += \
|
||||||
$${PWD}/EnergyCountPlotView \
|
$${PWD}/EnergyCountPlotView \
|
||||||
$${PWD}/CountRateAnalysisView \
|
$${PWD}/CountRateAnalysisView \
|
||||||
$${PWD}/ParticleTimePoorView \
|
$${PWD}/ParticleTimePoorView \
|
||||||
$${PWD}/ThreeDimensionalConformityAnalysisView
|
$${PWD}/ThreeDimensionalConformityAnalysisView \
|
||||||
|
$${PWD}/EnergyCountPeakFitView
|
||||||
|
|
||||||
DEPENDPATH += \
|
DEPENDPATH += \
|
||||||
$${PWD}/MeasureAnalysisParticleCountPlotView \
|
$${PWD}/MeasureAnalysisParticleCountPlotView \
|
||||||
|
|
@ -46,13 +47,15 @@ DEPENDPATH += \
|
||||||
$${PWD}/EnergyCountPlotView \
|
$${PWD}/EnergyCountPlotView \
|
||||||
$${PWD}/CountRateAnalysisView \
|
$${PWD}/CountRateAnalysisView \
|
||||||
$${PWD}/ParticleTimePoorView \
|
$${PWD}/ParticleTimePoorView \
|
||||||
$${PWD}/ThreeDimensionalConformityAnalysisView
|
$${PWD}/ThreeDimensionalConformityAnalysisView \
|
||||||
|
$${PWD}/EnergyCountPeakFitView
|
||||||
|
|
||||||
SOURCES += \
|
SOURCES += \
|
||||||
AboutDlg.cpp \
|
AboutDlg.cpp \
|
||||||
CountRateAnalysisView/CountRateAnalysisView.cpp \
|
CountRateAnalysisView/CountRateAnalysisView.cpp \
|
||||||
CustomQwtPlot.cpp \
|
CustomQwtPlot.cpp \
|
||||||
DataProcessWorkPool.cpp \
|
DataProcessWorkPool.cpp \
|
||||||
|
EnergyCountPeakFitView/EnergyCountPeakFitView.cpp \
|
||||||
EnergyCountPlotView/EnergyCountPlotView.cpp \
|
EnergyCountPlotView/EnergyCountPlotView.cpp \
|
||||||
EnergyScaleDataModel.cpp \
|
EnergyScaleDataModel.cpp \
|
||||||
EnergyScaleForm.cpp \
|
EnergyScaleForm.cpp \
|
||||||
|
|
@ -77,6 +80,7 @@ SOURCES += \
|
||||||
ThreeDimensionalConformityAnalysisView/DetectorStatusSummary.cpp \
|
ThreeDimensionalConformityAnalysisView/DetectorStatusSummary.cpp \
|
||||||
ThreeDimensionalConformityAnalysisView/ParticleDataStatistics.cpp \
|
ThreeDimensionalConformityAnalysisView/ParticleDataStatistics.cpp \
|
||||||
ThreeDimensionalConformityAnalysisView/ThreeDDisplay.cpp \
|
ThreeDimensionalConformityAnalysisView/ThreeDDisplay.cpp \
|
||||||
|
EnergyCountPeakFitView/EnergyCountPeakFitView.cpp \
|
||||||
main.cpp
|
main.cpp
|
||||||
|
|
||||||
HEADERS += \
|
HEADERS += \
|
||||||
|
|
@ -85,6 +89,7 @@ HEADERS += \
|
||||||
CountRateAnalysisView/CountRateAnalysisView.h \
|
CountRateAnalysisView/CountRateAnalysisView.h \
|
||||||
CustomQwtPlot.h \
|
CustomQwtPlot.h \
|
||||||
DataProcessWorkPool.h \
|
DataProcessWorkPool.h \
|
||||||
|
EnergyCountPeakFitView/EnergyCountPeakFitView.h \
|
||||||
EnergyCountPlotView/EnergyCountPlotView.h \
|
EnergyCountPlotView/EnergyCountPlotView.h \
|
||||||
EnergyScaleDataModel.h \
|
EnergyScaleDataModel.h \
|
||||||
EnergyScaleForm.h \
|
EnergyScaleForm.h \
|
||||||
|
|
@ -111,6 +116,7 @@ HEADERS += \
|
||||||
ThreeDimensionalConformityAnalysisView/DetectorStatusSummary.h \
|
ThreeDimensionalConformityAnalysisView/DetectorStatusSummary.h \
|
||||||
ThreeDimensionalConformityAnalysisView/ParticleDataStatistics.h \
|
ThreeDimensionalConformityAnalysisView/ParticleDataStatistics.h \
|
||||||
ThreeDimensionalConformityAnalysisView/ThreeDDisplay.h \
|
ThreeDimensionalConformityAnalysisView/ThreeDDisplay.h \
|
||||||
|
EnergyCountPeakFitView/EnergyCountPeakFitView.h
|
||||||
|
|
||||||
|
|
||||||
FORMS += \
|
FORMS += \
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user