修改ROI点击多个时 界面显示多条 修改效率刻度界面

This commit is contained in:
anxinglong 2026-07-14 17:56:37 +08:00
parent f3eb0cbf59
commit 36f05cb098
16 changed files with 214 additions and 114 deletions

View File

@ -31,7 +31,7 @@
#include <qwt_matrix_raster_data.h>
#include "csv.h"
#include <GlobalDefine.h>
//二维符合谱
class HeatMapColorMap : public QwtLinearColorMap {
public:
HeatMapColorMap()
@ -454,6 +454,17 @@ QwtPlotMarker *TwoDSpectralCompliance::createVLine(double x, Qt::GlobalColor col
return marker;
}
void TwoDSpectralCompliance::clearAllRoiMarkers()
{
for (auto marker : _roiMarkers)
{
marker->detach(); // 从绘图面板解绑
delete marker; // 销毁对象
}
_roiMarkers.clear();
_plot->replot(); // 刷新画布清除线条
}
void TwoDSpectralCompliance::onSelection(const QRectF& rect)
{
// 忽略过小的选区(可能是误点击)
@ -494,21 +505,23 @@ void TwoDSpectralCompliance::onActionPlotConfigure()
void TwoDSpectralCompliance::onActionRoiTriggered()
{
clearAllRoiMarkers();
_roi->show();
}
void TwoDSpectralCompliance::slot_roi_data(ROIItem &item)
{
clearAllRoiMarkers();
// 第一组起始1、结束1 红色竖线,必须存在才插入,所以一定绘制
createVLine(item.s1, Qt::red, 1.2);
createVLine(item.e1, Qt::red, 1.2);
_roiMarkers.append(createVLine(item.s1, Qt::red, 1.2));
_roiMarkers.append(createVLine(item.e1, Qt::red, 1.2));
// 第二组起始2、结束2 有有效数值才绘制,无值跳过
bool secondGroupValid = !(qIsNaN(item.s2) || qIsNaN(item.e2) || (item.s2 == 0 && item.e2 == 0));
if (secondGroupValid)
{
createVLine(item.s2, Qt::blue, 1.2);
createVLine(item.e2, Qt::blue, 1.2);
_roiMarkers.append(createVLine(item.s2, Qt::blue, 1.2));
_roiMarkers.append(createVLine(item.e2, Qt::blue, 1.2));
}
_plot->replot();
}
@ -550,7 +563,8 @@ void TwoDSpectralCompliance:: updateInfoContent()
}
}
if (totalPoints == 0) {
if (totalPoints == 0)
{
m_totalEventsEdit->setText(QStringLiteral(u"0"));
m_totalPointsEdit->setText(QStringLiteral(u"0"));
m_maxCountEdit->setText(QStringLiteral(u"0"));

View File

@ -61,6 +61,7 @@ private:
void updateToggleButtonPosition();
void updateShowButtonPosition();
QwtPlotMarker* createVLine(double x, Qt::GlobalColor color, double lineWidth = 1.0); // 创建垂直标记竖线
void clearAllRoiMarkers(); // 清空所有ROI竖线标记
private slots:
void showFloatingWidget();
@ -112,6 +113,7 @@ private:
double m_globalYMin = 0.0, m_globalYMax = 0.0;
RegionOfInterest *_roi;
QList<QwtPlotMarker*> _roiMarkers;
};
#endif // TWODSPECTRALCOMPLIANCE_H

View File

@ -142,27 +142,41 @@ void AntiConformEnergySpectrumView::loadAndProcess()
load_thread->start();
}
void AntiConformEnergySpectrumView::clearAllRoiMarkers()
{
for (auto marker : _roiMarkers)
{
marker->detach(); // 从绘图面板解绑
delete marker; // 销毁对象
}
_roiMarkers.clear();
_plot->replot(); // 刷新画布清除线条
}
void AntiConformEnergySpectrumView::onActionPlotConfigure()
{
}
void AntiConformEnergySpectrumView::onActionRoiTriggered()
{
clearAllRoiMarkers();
_roi->show();
}
void AntiConformEnergySpectrumView::slot_roi_data(ROIItem &item)
{
clearAllRoiMarkers();
// 第一组起始1、结束1 红色竖线,必须存在才插入,所以一定绘制
createVLine(item.s1, Qt::red, 1.2);
createVLine(item.e1, Qt::red, 1.2);
_roiMarkers.append(createVLine(item.s1, Qt::red, 1.2));
_roiMarkers.append(createVLine(item.e1, Qt::red, 1.2));
// 第二组起始2、结束2 有有效数值才绘制,无值跳过
bool secondGroupValid = !(qIsNaN(item.s2) || qIsNaN(item.e2) || (item.s2 == 0 && item.e2 == 0));
if (secondGroupValid)
{
createVLine(item.s2, Qt::blue, 1.2);
createVLine(item.e2, Qt::blue, 1.2);
_roiMarkers.append(createVLine(item.s2, Qt::blue, 1.2));
_roiMarkers.append(createVLine(item.e2, Qt::blue, 1.2));
}
_plot->replot();
}

View File

@ -24,6 +24,7 @@ protected:
private:
void setupMenu();
void loadAndProcess(); // 读取CSV执行符合处理绘制能谱折线图
void clearAllRoiMarkers(); // 清空所有ROI竖线标记
private slots:
void onActionPlotConfigure();
@ -36,6 +37,8 @@ private:
QwtPlotCurve* _curve = nullptr;
QString _data_filename;
RegionOfInterest *_roi;
QList<QwtPlotMarker*> _roiMarkers;
};
#endif // ANTICONFORMENERGYSPECTRUMVIEW_H

View File

@ -181,6 +181,17 @@ void ConformToTheEnergySpectrum::loadAndProcess()
load_thread->start();
}
void ConformToTheEnergySpectrum::clearAllRoiMarkers()
{
for (auto marker : _roiMarkers)
{
marker->detach(); // 从绘图面板解绑
delete marker; // 销毁对象
}
_roiMarkers.clear();
_plot->replot(); // 刷新画布清除线条
}
void ConformToTheEnergySpectrum::onActionPlotConfigure()
{
@ -189,21 +200,22 @@ void ConformToTheEnergySpectrum::onActionPlotConfigure()
void ConformToTheEnergySpectrum::slot_roi_data(ROIItem &item)
{
// 第一组起始1、结束1 红色竖线,必须存在才插入,所以一定绘制
createVLine(item.s1, Qt::red, 1.2);
createVLine(item.e1, Qt::red, 1.2);
_roiMarkers.append(createVLine(item.s1, Qt::red, 1.2));
_roiMarkers.append(createVLine(item.e1, Qt::red, 1.2));
// 第二组起始2、结束2 有有效数值才绘制,无值跳过
bool secondGroupValid = !(qIsNaN(item.s2) || qIsNaN(item.e2) || (item.s2 == 0 && item.e2 == 0));
if (secondGroupValid)
{
createVLine(item.s2, Qt::blue, 1.2);
createVLine(item.e2, Qt::blue, 1.2);
_roiMarkers.append(createVLine(item.s2, Qt::blue, 1.2));
_roiMarkers.append(createVLine(item.e2, Qt::blue, 1.2));
}
_plot->replot();
}
void ConformToTheEnergySpectrum::onActionRoiTriggered()
{
clearAllRoiMarkers();
_roi->show();
}

View File

@ -24,6 +24,7 @@ protected:
private:
void setupMenu();
void loadAndProcess(); // 读取CSV执行符合处理绘制能谱折线图
void clearAllRoiMarkers(); // 清空所有ROI竖线标记
private slots:
void onActionPlotConfigure();
@ -37,6 +38,8 @@ private:
QStringList _data_filenames;
RegionOfInterest *_roi;
QList<QwtPlotMarker*> _roiMarkers;
};
#endif // CONFORMTOTHEENERGYSPECTRUM_H

View File

@ -91,7 +91,7 @@ void CountRateAnalysisView::setData(QVector<ParticleInjectTime> data)
const qint64 ns = (info.dTime * 5) / NS_PER_SECOND;
const int nidx = static_cast<int>(ns / nInv); // 整数除法,速度快
if (nidx < nVecSize) {
++vec[nidx]; // 使用 ++ 而非 vec[nidx]++
++vec[nidx];
if ( y_max < vec[nidx] )
y_max = vec[nidx];
}
@ -118,7 +118,6 @@ void CountRateAnalysisView::setData(QVector<ParticleInjectTime> data)
// 刷新绘图
plot->replot();
}
QVector<ParticleInjectTime> CountRateAnalysisView::getParticleInjectTimeData(QString path)
@ -134,17 +133,17 @@ QVector<ParticleInjectTime> CountRateAnalysisView::getParticleInjectTimeData(QSt
// 逐行读取
while (in.read_row(board, channel, energy, time_count))
{
int detector = board + channel * 8;
lineNumber++;
if(detector >= 32)
{
continue;
}
ParticleInjectTime rec;
rec.index = lineNumber;
rec.dEnergy = energy;
rec.dTime = time_count;
records.append(rec);
int detector = board + channel * 8;
lineNumber++;
if(detector >= 32)
{
continue;
}
ParticleInjectTime rec;
rec.index = lineNumber;
rec.dEnergy = energy;
rec.dTime = time_count;
records.append(rec);
}
return records;

View File

@ -6,20 +6,20 @@
<rect>
<x>0</x>
<y>0</y>
<width>1173</width>
<height>709</height>
<width>1498</width>
<height>890</height>
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2" stretch="2,7">
<layout class="QHBoxLayout" name="horizontalLayout_22" stretch="1,5">
<item>
<widget class="QGroupBox" name="groupBox_3">
<widget class="QGroupBox" name="groupBox_7">
<property name="title">
<string>效率刻度管理列表</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_5">
<layout class="QVBoxLayout" name="verticalLayout_18">
<property name="leftMargin">
<number>0</number>
</property>
@ -33,19 +33,19 @@
<number>0</number>
</property>
<item>
<widget class="QListWidget" name="listWidget"/>
<widget class="QListWidget" name="listWidget_3"/>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_9">
<layout class="QHBoxLayout" name="horizontalLayout_21">
<item>
<widget class="QPushButton" name="pBtn_Add_File">
<widget class="QPushButton" name="pBtn_Add_File_3">
<property name="text">
<string>添加</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pBtn_Delete_File">
<widget class="QPushButton" name="pBtn_Delete_File_3">
<property name="text">
<string>删除</string>
</property>
@ -57,21 +57,21 @@
</widget>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_6" stretch="3,5">
<layout class="QVBoxLayout" name="verticalLayout_13" stretch="0,5">
<item>
<layout class="QHBoxLayout" name="horizontalLayout" stretch="1,4">
<layout class="QHBoxLayout" name="horizontalLayout_15" stretch="1,4">
<item>
<layout class="QVBoxLayout" name="verticalLayout_3" stretch="3,1,5,0,1,1">
<layout class="QVBoxLayout" name="verticalLayout_14" stretch="3,1,5,0,1,1">
<item>
<widget class="QGroupBox" name="groupBox_2">
<widget class="QGroupBox" name="groupBox_5">
<property name="title">
<string>效率刻度信息</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<layout class="QVBoxLayout" name="verticalLayout_15">
<item>
<layout class="QGridLayout" name="gridLayout" columnstretch="2,3" rowminimumheight="2,3" columnminimumwidth="0,0">
<layout class="QGridLayout" name="gridLayout_3" columnstretch="2,3" rowminimumheight="2,3" columnminimumwidth="0,0">
<item row="0" column="0">
<widget class="QLabel" name="label_5">
<widget class="QLabel" name="label_11">
<property name="minimumSize">
<size>
<width>85</width>
@ -87,10 +87,10 @@
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="lineEdit_name"/>
<widget class="QLineEdit" name="lineEdit_name_3"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_6">
<widget class="QLabel" name="label_12">
<property name="minimumSize">
<size>
<width>85</width>
@ -106,7 +106,7 @@
</widget>
</item>
<item row="1" column="1">
<widget class="QPlainTextEdit" name="plainTextEdit_description">
<widget class="QPlainTextEdit" name="plainTextEdit_description_3">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
@ -121,18 +121,48 @@
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_5">
<layout class="QHBoxLayout" name="horizontalLayout_16">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<layout class="QHBoxLayout" name="horizontalLayout_17">
<item>
<widget class="QPushButton" name="pBtn_Save">
<widget class="QLabel" name="label_13">
<property name="text">
<string>通道:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="comboBox_channel_3"/>
</item>
</layout>
</item>
<item>
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_18">
<item>
<widget class="QPushButton" name="pBtn_Save_3">
<property name="text">
<string>保存</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pBtn_SaveAs">
<widget class="QPushButton" name="pBtn_SaveAs_3">
<property name="text">
<string>另存为</string>
</property>
@ -143,22 +173,22 @@
</layout>
</item>
<item>
<widget class="QGroupBox" name="groupBox">
<widget class="QGroupBox" name="groupBox_6">
<property name="title">
<string>公式拟合</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<layout class="QVBoxLayout" name="verticalLayout_16">
<item>
<widget class="QLabel" name="label_2">
<widget class="QLabel" name="label_14">
<property name="text">
<string>拟合公式:</string>
<string>拐点以上拟合公式:</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_6">
<layout class="QHBoxLayout" name="horizontalLayout_23">
<item>
<widget class="QComboBox" name="comboBox_fit_type">
<widget class="QComboBox" name="comboBox_fit_type_4">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
@ -168,7 +198,7 @@
</widget>
</item>
<item>
<widget class="QPushButton" name="pBtn_fitting">
<widget class="QPushButton" name="pBtn_fitting_4">
<property name="text">
<string>拟合</string>
</property>
@ -177,66 +207,68 @@
</layout>
</item>
<item>
<widget class="QLabel" name="label_fit_type_text">
<property name="minimumSize">
<size>
<width>287</width>
<height>0</height>
</size>
</property>
<widget class="QLabel" name="label_16">
<property name="text">
<string>y = a + bx</string>
<string>拐点以下拟合公式:</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_fit_result">
<property name="minimumSize">
<size>
<width>287</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>a = 1.21823, b = -5.0542</string>
</property>
</widget>
<layout class="QHBoxLayout" name="horizontalLayout_19">
<item>
<widget class="QComboBox" name="comboBox_fit_type_3">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pBtn_fitting_3">
<property name="text">
<string>拟合</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<widget class="Line" name="line">
<widget class="Line" name="line_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_3">
<widget class="QLabel" name="label_15">
<property name="text">
<string>效率刻度拟合数据</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_7">
<layout class="QHBoxLayout" name="horizontalLayout_20">
<item>
<widget class="QPushButton" name="pBtn_Add">
<widget class="QPushButton" name="pBtn_Add_3">
<property name="text">
<string>新增</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pBtn_Delete">
<widget class="QPushButton" name="pBtn_Delete_3">
<property name="text">
<string>删除</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<spacer name="horizontalSpacer_6">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
@ -253,11 +285,11 @@
</layout>
</item>
<item>
<widget class="QWidget" name="widget" native="true">
<widget class="QWidget" name="widget_3" native="true">
<property name="styleSheet">
<string notr="true"/>
</property>
<layout class="QVBoxLayout" name="verticalLayout_4">
<layout class="QVBoxLayout" name="verticalLayout_17">
<property name="spacing">
<number>0</number>
</property>
@ -274,7 +306,7 @@
<number>0</number>
</property>
<item>
<layout class="QVBoxLayout" name="layout_fittingCurve">
<layout class="QVBoxLayout" name="layout_fittingCurve_3">
<property name="spacing">
<number>0</number>
</property>
@ -286,7 +318,7 @@
</layout>
</item>
<item>
<widget class="QTableWidget" name="tablew_scale_data">
<widget class="QTableWidget" name="tablew_scale_data_3">
<property name="minimumSize">
<size>
<width>0</width>
@ -298,17 +330,7 @@
</attribute>
<column>
<property name="text">
<string>序号</string>
</property>
</column>
<column>
<property name="text">
<string>能量(key)</string>
</property>
</column>
<column>
<property name="text">
<string>净计数率</string>
<string>能量</string>
</property>
</column>
<column>

View File

@ -754,6 +754,17 @@ void EnergyCountPeakFitView::updateHistoryDialogWithSelection(const QList<Displa
LOG_DEBUG(QStringLiteral(u"历史对话框已更新"));
}
void EnergyCountPeakFitView::clearAllRoiMarkers()
{
for (auto marker : _roiMarkers)
{
marker->detach(); // 从绘图面板解绑
delete marker; // 销毁对象
}
_roiMarkers.clear();
_plot->replot(); // 刷新画布清除线条
}
void EnergyCountPeakFitView::clearFitCurves()
{
@ -1599,21 +1610,23 @@ void EnergyCountPeakFitView::onHistoryDlgClosed()
void EnergyCountPeakFitView::onActionRoiTriggered()
{
clearAllRoiMarkers();
_roi->show();
}
void EnergyCountPeakFitView::slot_roi_data(ROIItem &item)
{
clearAllRoiMarkers();
// 第一组起始1、结束1 红色竖线,必须存在才插入,所以一定绘制
createVLine(item.s1, Qt::red, 1.2);
createVLine(item.e1, Qt::red, 1.2);
_roiMarkers.append(createVLine(item.s1, Qt::red, 1.2));
_roiMarkers.append(createVLine(item.e1, Qt::red, 1.2));
// 第二组起始2、结束2 有有效数值才绘制,无值跳过
bool secondGroupValid = !(qIsNaN(item.s2) || qIsNaN(item.e2) || (item.s2 == 0 && item.e2 == 0));
if (secondGroupValid)
{
createVLine(item.s2, Qt::blue, 1.2);
createVLine(item.e2, Qt::blue, 1.2);
_roiMarkers.append(createVLine(item.s2, Qt::blue, 1.2));
_roiMarkers.append(createVLine(item.e2, Qt::blue, 1.2));
}
_plot->replot();
}

View File

@ -133,6 +133,7 @@ private:
QList<QwtPlotCurve*> createFitCurve(const PeakFitResult& result, arma::vec xVec);
// 更新历史对话框并保持指定的选中状态
void updateHistoryDialogWithSelection(const QList<DisplayedCurveRef>& selectedRefs);
void clearAllRoiMarkers(); // 清空所有ROI竖线标记
signals:
void newFitResultAdded();
@ -172,6 +173,8 @@ private:
RegionOfInterest *_roi;
QList<QwtPlotMarker *> _roiMarkers;
};
#endif // ENERGYCOUNTPEAKFITVIEW_H

View File

@ -165,6 +165,17 @@ QwtPlotMarker *EnergyCountPlotView::createVLine(double x, Qt::GlobalColor color,
return marker;
}
void EnergyCountPlotView::clearAllRoiMarkers()
{
for (auto marker : _roiMarkers)
{
marker->detach(); // 从绘图面板解绑
delete marker; // 销毁对象
}
_roiMarkers.clear();
_plot->replot(); // 刷新画布清除线条
}
void EnergyCountPlotView::updateView(const QMap<QString, QVariant>& data_files_set)
{
// 清除现有所有曲线
@ -279,21 +290,24 @@ void EnergyCountPlotView::onActionPlotConfigure()
void EnergyCountPlotView::onActionRoiTriggered()
{
clearAllRoiMarkers();
_roi->show();
}
void EnergyCountPlotView::slot_roi_data(ROIItem &item)
{
clearAllRoiMarkers();
// 第一组起始1、结束1 红色竖线,必须存在才插入,所以一定绘制
createVLine(item.s1, Qt::red, 1.2);
createVLine(item.e1, Qt::red, 1.2);
_roiMarkers.append(createVLine(item.s1, Qt::red, 1.2));
_roiMarkers.append(createVLine(item.e1, Qt::red, 1.2));
// 第二组起始2、结束2 有有效数值才绘制,无值跳过
bool secondGroupValid = !(qIsNaN(item.s2) || qIsNaN(item.e2) || (item.s2 == 0 && item.e2 == 0));
if (secondGroupValid)
{
createVLine(item.s2, Qt::blue, 1.2);
createVLine(item.e2, Qt::blue, 1.2);
_roiMarkers.append(createVLine(item.s2, Qt::blue, 1.2));
_roiMarkers.append(createVLine(item.e2, Qt::blue, 1.2));
}
_plot->replot();
}

View File

@ -26,6 +26,7 @@ private:
void setupMenu();
void loadDataFromFile(const QString &data_name, const QString& filename);
QwtPlotMarker* createVLine(double x, Qt::GlobalColor color, double lineWidth = 1.0); // 创建垂直标记竖线
void clearAllRoiMarkers(); // 清空所有ROI竖线标记
private slots:
void onActionCurveShowSetting();
@ -40,6 +41,8 @@ private:
double _x_max = 0.0f;
double _y_max = 0.0f;
RegionOfInterest *_roi;
QList<QwtPlotMarker*> _roiMarkers;
};
#endif // ENERGYCOUNTPLOTVIEW_H

View File

@ -220,7 +220,6 @@ QMap<QString, ChannelData> EnergyScaleForm::parseJsonToChannels(const QString &f
} else {
errorMsg += QString("通道 %1 缺少 FwhmFitResultCoeffs 字段\n").arg(channelName);
}
result.insert(channelName, chData);
}
@ -357,7 +356,6 @@ void EnergyScaleForm::clearPlot()
_fitCurve->detach();
_plot->detachItems(QwtPlotItem::Rtti_PlotCurve, false);
_plot->replot();
}
QVector<QPointF> EnergyScaleForm::generateFitCurvePoints(const ChannelData &chData)

View File

@ -752,11 +752,11 @@ void MainWindow::onParticleDatarefresh()
ProjectList::Instance()->SetNodeStatus(particleData,status,true);
updataTable();
}
void MainWindow::onAddressCountViewNeedRefresh()
{
MeasureAnalysisProjectModel *pro_model = ProjectList::Instance()->GetCurrentProjectModel();
if (!pro_model) return;
bool status_ok = !pro_model->GetChannelAddressCountDataFilenameList().isEmpty();
QString status = status_ok ? QStringLiteral(u"有效") : QStringLiteral(u"无效");
QString item_name = QStringLiteral(u"道址计数谱");
@ -879,6 +879,11 @@ void MainWindow::onParticleEnergyDataUpdated(const QString &energySpectrumFilena
}
void MainWindow::on_action_analysisReport_triggered()
{
auto project_model = ProjectList::Instance()->GetCurrentProjectModel();
if (project_model == nullptr) {
QMessageBox::information(this, "提示:", "请先加载项目!");
return;
}
ReportWidget *widget = new ReportWidget();
widget->show();
}

View File

@ -194,7 +194,6 @@ void NuclideAnalysisView::setupPlot()
_plot->canvas()->setMouseTracking(true);
// 给canvas安装事件过滤器捕获鼠标点击
_plot->canvas()->installEventFilter(this);
}
void NuclideAnalysisView::setupMenu()

View File

@ -32,7 +32,7 @@ void ReportWidget::setupUi()
// 顶部按钮栏
auto* btnLayout = new QHBoxLayout();
m_sampleBtn = new QPushButton("加载示例数据", this);
m_sampleBtn = new QPushButton("加载数据", this);
m_refreshBtn = new QPushButton("刷新报告", this);
m_exportHtmlBtn = new QPushButton("导出HTML", this);
m_exportWordBtn = new QPushButton("导出Word", this);
@ -472,10 +472,6 @@ void ReportWidget::exportText()
void ReportWidget::loadSampleData()
{
auto project_model = ProjectList::Instance()->GetCurrentProjectModel();
if (project_model == nullptr) {
QMessageBox::information(this, "提示:", "请先加载项目!");
return;
}
//获取当前可执行目录下
QString jsonPath = project_model->GetProjectDir() + "/report_params.json";
m_data.loadReportParamsJson(jsonPath);