修改ROI点击多个时 界面显示多条 修改效率刻度界面
This commit is contained in:
parent
f3eb0cbf59
commit
36f05cb098
|
|
@ -31,7 +31,7 @@
|
||||||
#include <qwt_matrix_raster_data.h>
|
#include <qwt_matrix_raster_data.h>
|
||||||
#include "csv.h"
|
#include "csv.h"
|
||||||
#include <GlobalDefine.h>
|
#include <GlobalDefine.h>
|
||||||
|
//二维符合谱
|
||||||
class HeatMapColorMap : public QwtLinearColorMap {
|
class HeatMapColorMap : public QwtLinearColorMap {
|
||||||
public:
|
public:
|
||||||
HeatMapColorMap()
|
HeatMapColorMap()
|
||||||
|
|
@ -454,6 +454,17 @@ QwtPlotMarker *TwoDSpectralCompliance::createVLine(double x, Qt::GlobalColor col
|
||||||
return marker;
|
return marker;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TwoDSpectralCompliance::clearAllRoiMarkers()
|
||||||
|
{
|
||||||
|
for (auto marker : _roiMarkers)
|
||||||
|
{
|
||||||
|
marker->detach(); // 从绘图面板解绑
|
||||||
|
delete marker; // 销毁对象
|
||||||
|
}
|
||||||
|
_roiMarkers.clear();
|
||||||
|
_plot->replot(); // 刷新画布清除线条
|
||||||
|
}
|
||||||
|
|
||||||
void TwoDSpectralCompliance::onSelection(const QRectF& rect)
|
void TwoDSpectralCompliance::onSelection(const QRectF& rect)
|
||||||
{
|
{
|
||||||
// 忽略过小的选区(可能是误点击)
|
// 忽略过小的选区(可能是误点击)
|
||||||
|
|
@ -494,21 +505,23 @@ void TwoDSpectralCompliance::onActionPlotConfigure()
|
||||||
|
|
||||||
void TwoDSpectralCompliance::onActionRoiTriggered()
|
void TwoDSpectralCompliance::onActionRoiTriggered()
|
||||||
{
|
{
|
||||||
|
clearAllRoiMarkers();
|
||||||
_roi->show();
|
_roi->show();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TwoDSpectralCompliance::slot_roi_data(ROIItem &item)
|
void TwoDSpectralCompliance::slot_roi_data(ROIItem &item)
|
||||||
{
|
{
|
||||||
|
clearAllRoiMarkers();
|
||||||
// 第一组:起始1、结束1 红色竖线,必须存在才插入,所以一定绘制
|
// 第一组:起始1、结束1 红色竖线,必须存在才插入,所以一定绘制
|
||||||
createVLine(item.s1, Qt::red, 1.2);
|
_roiMarkers.append(createVLine(item.s1, Qt::red, 1.2));
|
||||||
createVLine(item.e1, Qt::red, 1.2);
|
_roiMarkers.append(createVLine(item.e1, Qt::red, 1.2));
|
||||||
|
|
||||||
// 第二组:起始2、结束2 有有效数值才绘制,无值跳过
|
// 第二组:起始2、结束2 有有效数值才绘制,无值跳过
|
||||||
bool secondGroupValid = !(qIsNaN(item.s2) || qIsNaN(item.e2) || (item.s2 == 0 && item.e2 == 0));
|
bool secondGroupValid = !(qIsNaN(item.s2) || qIsNaN(item.e2) || (item.s2 == 0 && item.e2 == 0));
|
||||||
if (secondGroupValid)
|
if (secondGroupValid)
|
||||||
{
|
{
|
||||||
createVLine(item.s2, Qt::blue, 1.2);
|
_roiMarkers.append(createVLine(item.s2, Qt::blue, 1.2));
|
||||||
createVLine(item.e2, Qt::blue, 1.2);
|
_roiMarkers.append(createVLine(item.e2, Qt::blue, 1.2));
|
||||||
}
|
}
|
||||||
_plot->replot();
|
_plot->replot();
|
||||||
}
|
}
|
||||||
|
|
@ -550,7 +563,8 @@ void TwoDSpectralCompliance:: updateInfoContent()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (totalPoints == 0) {
|
if (totalPoints == 0)
|
||||||
|
{
|
||||||
m_totalEventsEdit->setText(QStringLiteral(u"0"));
|
m_totalEventsEdit->setText(QStringLiteral(u"0"));
|
||||||
m_totalPointsEdit->setText(QStringLiteral(u"0"));
|
m_totalPointsEdit->setText(QStringLiteral(u"0"));
|
||||||
m_maxCountEdit->setText(QStringLiteral(u"0"));
|
m_maxCountEdit->setText(QStringLiteral(u"0"));
|
||||||
|
|
|
||||||
|
|
@ -61,6 +61,7 @@ private:
|
||||||
void updateToggleButtonPosition();
|
void updateToggleButtonPosition();
|
||||||
void updateShowButtonPosition();
|
void updateShowButtonPosition();
|
||||||
QwtPlotMarker* createVLine(double x, Qt::GlobalColor color, double lineWidth = 1.0); // 创建垂直标记竖线
|
QwtPlotMarker* createVLine(double x, Qt::GlobalColor color, double lineWidth = 1.0); // 创建垂直标记竖线
|
||||||
|
void clearAllRoiMarkers(); // 清空所有ROI竖线标记
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void showFloatingWidget();
|
void showFloatingWidget();
|
||||||
|
|
@ -112,6 +113,7 @@ private:
|
||||||
double m_globalYMin = 0.0, m_globalYMax = 0.0;
|
double m_globalYMin = 0.0, m_globalYMax = 0.0;
|
||||||
|
|
||||||
RegionOfInterest *_roi;
|
RegionOfInterest *_roi;
|
||||||
|
QList<QwtPlotMarker*> _roiMarkers;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // TWODSPECTRALCOMPLIANCE_H
|
#endif // TWODSPECTRALCOMPLIANCE_H
|
||||||
|
|
@ -142,27 +142,41 @@ void AntiConformEnergySpectrumView::loadAndProcess()
|
||||||
load_thread->start();
|
load_thread->start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AntiConformEnergySpectrumView::clearAllRoiMarkers()
|
||||||
|
{
|
||||||
|
for (auto marker : _roiMarkers)
|
||||||
|
{
|
||||||
|
marker->detach(); // 从绘图面板解绑
|
||||||
|
delete marker; // 销毁对象
|
||||||
|
}
|
||||||
|
_roiMarkers.clear();
|
||||||
|
_plot->replot(); // 刷新画布清除线条
|
||||||
|
}
|
||||||
|
|
||||||
void AntiConformEnergySpectrumView::onActionPlotConfigure()
|
void AntiConformEnergySpectrumView::onActionPlotConfigure()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void AntiConformEnergySpectrumView::onActionRoiTriggered()
|
void AntiConformEnergySpectrumView::onActionRoiTriggered()
|
||||||
{
|
{
|
||||||
|
clearAllRoiMarkers();
|
||||||
_roi->show();
|
_roi->show();
|
||||||
}
|
}
|
||||||
|
|
||||||
void AntiConformEnergySpectrumView::slot_roi_data(ROIItem &item)
|
void AntiConformEnergySpectrumView::slot_roi_data(ROIItem &item)
|
||||||
{
|
{
|
||||||
|
clearAllRoiMarkers();
|
||||||
|
|
||||||
// 第一组:起始1、结束1 红色竖线,必须存在才插入,所以一定绘制
|
// 第一组:起始1、结束1 红色竖线,必须存在才插入,所以一定绘制
|
||||||
createVLine(item.s1, Qt::red, 1.2);
|
_roiMarkers.append(createVLine(item.s1, Qt::red, 1.2));
|
||||||
createVLine(item.e1, Qt::red, 1.2);
|
_roiMarkers.append(createVLine(item.e1, Qt::red, 1.2));
|
||||||
|
|
||||||
// 第二组:起始2、结束2 有有效数值才绘制,无值跳过
|
// 第二组:起始2、结束2 有有效数值才绘制,无值跳过
|
||||||
bool secondGroupValid = !(qIsNaN(item.s2) || qIsNaN(item.e2) || (item.s2 == 0 && item.e2 == 0));
|
bool secondGroupValid = !(qIsNaN(item.s2) || qIsNaN(item.e2) || (item.s2 == 0 && item.e2 == 0));
|
||||||
if (secondGroupValid)
|
if (secondGroupValid)
|
||||||
{
|
{
|
||||||
createVLine(item.s2, Qt::blue, 1.2);
|
_roiMarkers.append(createVLine(item.s2, Qt::blue, 1.2));
|
||||||
createVLine(item.e2, Qt::blue, 1.2);
|
_roiMarkers.append(createVLine(item.e2, Qt::blue, 1.2));
|
||||||
}
|
}
|
||||||
_plot->replot();
|
_plot->replot();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@ protected:
|
||||||
private:
|
private:
|
||||||
void setupMenu();
|
void setupMenu();
|
||||||
void loadAndProcess(); // 读取CSV,执行符合处理,绘制能谱折线图
|
void loadAndProcess(); // 读取CSV,执行符合处理,绘制能谱折线图
|
||||||
|
void clearAllRoiMarkers(); // 清空所有ROI竖线标记
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void onActionPlotConfigure();
|
void onActionPlotConfigure();
|
||||||
|
|
@ -36,6 +37,8 @@ private:
|
||||||
QwtPlotCurve* _curve = nullptr;
|
QwtPlotCurve* _curve = nullptr;
|
||||||
QString _data_filename;
|
QString _data_filename;
|
||||||
RegionOfInterest *_roi;
|
RegionOfInterest *_roi;
|
||||||
|
QList<QwtPlotMarker*> _roiMarkers;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // ANTICONFORMENERGYSPECTRUMVIEW_H
|
#endif // ANTICONFORMENERGYSPECTRUMVIEW_H
|
||||||
|
|
|
||||||
|
|
@ -181,6 +181,17 @@ void ConformToTheEnergySpectrum::loadAndProcess()
|
||||||
load_thread->start();
|
load_thread->start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ConformToTheEnergySpectrum::clearAllRoiMarkers()
|
||||||
|
{
|
||||||
|
for (auto marker : _roiMarkers)
|
||||||
|
{
|
||||||
|
marker->detach(); // 从绘图面板解绑
|
||||||
|
delete marker; // 销毁对象
|
||||||
|
}
|
||||||
|
_roiMarkers.clear();
|
||||||
|
_plot->replot(); // 刷新画布清除线条
|
||||||
|
}
|
||||||
|
|
||||||
void ConformToTheEnergySpectrum::onActionPlotConfigure()
|
void ConformToTheEnergySpectrum::onActionPlotConfigure()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
@ -189,21 +200,22 @@ void ConformToTheEnergySpectrum::onActionPlotConfigure()
|
||||||
void ConformToTheEnergySpectrum::slot_roi_data(ROIItem &item)
|
void ConformToTheEnergySpectrum::slot_roi_data(ROIItem &item)
|
||||||
{
|
{
|
||||||
// 第一组:起始1、结束1 红色竖线,必须存在才插入,所以一定绘制
|
// 第一组:起始1、结束1 红色竖线,必须存在才插入,所以一定绘制
|
||||||
createVLine(item.s1, Qt::red, 1.2);
|
_roiMarkers.append(createVLine(item.s1, Qt::red, 1.2));
|
||||||
createVLine(item.e1, Qt::red, 1.2);
|
_roiMarkers.append(createVLine(item.e1, Qt::red, 1.2));
|
||||||
|
|
||||||
// 第二组:起始2、结束2 有有效数值才绘制,无值跳过
|
// 第二组:起始2、结束2 有有效数值才绘制,无值跳过
|
||||||
bool secondGroupValid = !(qIsNaN(item.s2) || qIsNaN(item.e2) || (item.s2 == 0 && item.e2 == 0));
|
bool secondGroupValid = !(qIsNaN(item.s2) || qIsNaN(item.e2) || (item.s2 == 0 && item.e2 == 0));
|
||||||
if (secondGroupValid)
|
if (secondGroupValid)
|
||||||
{
|
{
|
||||||
createVLine(item.s2, Qt::blue, 1.2);
|
_roiMarkers.append(createVLine(item.s2, Qt::blue, 1.2));
|
||||||
createVLine(item.e2, Qt::blue, 1.2);
|
_roiMarkers.append(createVLine(item.e2, Qt::blue, 1.2));
|
||||||
}
|
}
|
||||||
_plot->replot();
|
_plot->replot();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConformToTheEnergySpectrum::onActionRoiTriggered()
|
void ConformToTheEnergySpectrum::onActionRoiTriggered()
|
||||||
{
|
{
|
||||||
|
clearAllRoiMarkers();
|
||||||
_roi->show();
|
_roi->show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@ protected:
|
||||||
private:
|
private:
|
||||||
void setupMenu();
|
void setupMenu();
|
||||||
void loadAndProcess(); // 读取CSV,执行符合处理,绘制能谱折线图
|
void loadAndProcess(); // 读取CSV,执行符合处理,绘制能谱折线图
|
||||||
|
void clearAllRoiMarkers(); // 清空所有ROI竖线标记
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void onActionPlotConfigure();
|
void onActionPlotConfigure();
|
||||||
|
|
@ -37,6 +38,8 @@ private:
|
||||||
QStringList _data_filenames;
|
QStringList _data_filenames;
|
||||||
|
|
||||||
RegionOfInterest *_roi;
|
RegionOfInterest *_roi;
|
||||||
|
QList<QwtPlotMarker*> _roiMarkers;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // CONFORMTOTHEENERGYSPECTRUM_H
|
#endif // CONFORMTOTHEENERGYSPECTRUM_H
|
||||||
|
|
|
||||||
|
|
@ -91,7 +91,7 @@ void CountRateAnalysisView::setData(QVector<ParticleInjectTime> data)
|
||||||
const qint64 ns = (info.dTime * 5) / NS_PER_SECOND;
|
const qint64 ns = (info.dTime * 5) / NS_PER_SECOND;
|
||||||
const int nidx = static_cast<int>(ns / nInv); // 整数除法,速度快
|
const int nidx = static_cast<int>(ns / nInv); // 整数除法,速度快
|
||||||
if (nidx < nVecSize) {
|
if (nidx < nVecSize) {
|
||||||
++vec[nidx]; // 使用 ++ 而非 vec[nidx]++
|
++vec[nidx];
|
||||||
if ( y_max < vec[nidx] )
|
if ( y_max < vec[nidx] )
|
||||||
y_max = vec[nidx];
|
y_max = vec[nidx];
|
||||||
}
|
}
|
||||||
|
|
@ -118,7 +118,6 @@ void CountRateAnalysisView::setData(QVector<ParticleInjectTime> data)
|
||||||
|
|
||||||
// 刷新绘图
|
// 刷新绘图
|
||||||
plot->replot();
|
plot->replot();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QVector<ParticleInjectTime> CountRateAnalysisView::getParticleInjectTimeData(QString path)
|
QVector<ParticleInjectTime> CountRateAnalysisView::getParticleInjectTimeData(QString path)
|
||||||
|
|
|
||||||
|
|
@ -6,20 +6,20 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>1173</width>
|
<width>1498</width>
|
||||||
<height>709</height>
|
<height>890</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>Dialog</string>
|
<string>Dialog</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_2" stretch="2,7">
|
<layout class="QHBoxLayout" name="horizontalLayout_22" stretch="1,5">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QGroupBox" name="groupBox_3">
|
<widget class="QGroupBox" name="groupBox_7">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>效率刻度管理列表</string>
|
<string>效率刻度管理列表</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_5">
|
<layout class="QVBoxLayout" name="verticalLayout_18">
|
||||||
<property name="leftMargin">
|
<property name="leftMargin">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
|
|
@ -33,19 +33,19 @@
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QListWidget" name="listWidget"/>
|
<widget class="QListWidget" name="listWidget_3"/>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_9">
|
<layout class="QHBoxLayout" name="horizontalLayout_21">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="pBtn_Add_File">
|
<widget class="QPushButton" name="pBtn_Add_File_3">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>添加</string>
|
<string>添加</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="pBtn_Delete_File">
|
<widget class="QPushButton" name="pBtn_Delete_File_3">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>删除</string>
|
<string>删除</string>
|
||||||
</property>
|
</property>
|
||||||
|
|
@ -57,21 +57,21 @@
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_6" stretch="3,5">
|
<layout class="QVBoxLayout" name="verticalLayout_13" stretch="0,5">
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout" stretch="1,4">
|
<layout class="QHBoxLayout" name="horizontalLayout_15" stretch="1,4">
|
||||||
<item>
|
<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>
|
<item>
|
||||||
<widget class="QGroupBox" name="groupBox_2">
|
<widget class="QGroupBox" name="groupBox_5">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>效率刻度信息</string>
|
<string>效率刻度信息</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout_15">
|
||||||
<item>
|
<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">
|
<item row="0" column="0">
|
||||||
<widget class="QLabel" name="label_5">
|
<widget class="QLabel" name="label_11">
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>85</width>
|
<width>85</width>
|
||||||
|
|
@ -87,10 +87,10 @@
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="1">
|
<item row="0" column="1">
|
||||||
<widget class="QLineEdit" name="lineEdit_name"/>
|
<widget class="QLineEdit" name="lineEdit_name_3"/>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0">
|
<item row="1" column="0">
|
||||||
<widget class="QLabel" name="label_6">
|
<widget class="QLabel" name="label_12">
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>85</width>
|
<width>85</width>
|
||||||
|
|
@ -106,7 +106,7 @@
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="1">
|
<item row="1" column="1">
|
||||||
<widget class="QPlainTextEdit" name="plainTextEdit_description">
|
<widget class="QPlainTextEdit" name="plainTextEdit_description_3">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
|
|
@ -121,18 +121,48 @@
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
<layout class="QHBoxLayout" name="horizontalLayout_16">
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
<layout class="QHBoxLayout" name="horizontalLayout_17">
|
||||||
<item>
|
<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">
|
<property name="text">
|
||||||
<string>保存</string>
|
<string>保存</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="pBtn_SaveAs">
|
<widget class="QPushButton" name="pBtn_SaveAs_3">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>另存为</string>
|
<string>另存为</string>
|
||||||
</property>
|
</property>
|
||||||
|
|
@ -143,22 +173,22 @@
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QGroupBox" name="groupBox">
|
<widget class="QGroupBox" name="groupBox_6">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>公式拟合</string>
|
<string>公式拟合</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
<layout class="QVBoxLayout" name="verticalLayout_16">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_2">
|
<widget class="QLabel" name="label_14">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>拟合公式:</string>
|
<string>拐点以上拟合公式:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_6">
|
<layout class="QHBoxLayout" name="horizontalLayout_23">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QComboBox" name="comboBox_fit_type">
|
<widget class="QComboBox" name="comboBox_fit_type_4">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
|
|
@ -168,7 +198,7 @@
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="pBtn_fitting">
|
<widget class="QPushButton" name="pBtn_fitting_4">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>拟合</string>
|
<string>拟合</string>
|
||||||
</property>
|
</property>
|
||||||
|
|
@ -177,66 +207,68 @@
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_fit_type_text">
|
<widget class="QLabel" name="label_16">
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>287</width>
|
|
||||||
<height>0</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>y = a + bx</string>
|
<string>拐点以下拟合公式:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_fit_result">
|
<layout class="QHBoxLayout" name="horizontalLayout_19">
|
||||||
<property name="minimumSize">
|
<item>
|
||||||
<size>
|
<widget class="QComboBox" name="comboBox_fit_type_3">
|
||||||
<width>287</width>
|
<property name="sizePolicy">
|
||||||
<height>0</height>
|
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||||
</size>
|
<horstretch>0</horstretch>
|
||||||
</property>
|
<verstretch>0</verstretch>
|
||||||
<property name="text">
|
</sizepolicy>
|
||||||
<string>a = 1.21823, b = -5.0542</string>
|
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="pBtn_fitting_3">
|
||||||
|
<property name="text">
|
||||||
|
<string>拟合</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="Line" name="line">
|
<widget class="Line" name="line_3">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Horizontal</enum>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_3">
|
<widget class="QLabel" name="label_15">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>效率刻度拟合数据</string>
|
<string>效率刻度拟合数据</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_7">
|
<layout class="QHBoxLayout" name="horizontalLayout_20">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="pBtn_Add">
|
<widget class="QPushButton" name="pBtn_Add_3">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>新增</string>
|
<string>新增</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="pBtn_Delete">
|
<widget class="QPushButton" name="pBtn_Delete_3">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>删除</string>
|
<string>删除</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<spacer name="horizontalSpacer_2">
|
<spacer name="horizontalSpacer_6">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Horizontal</enum>
|
||||||
</property>
|
</property>
|
||||||
|
|
@ -253,11 +285,11 @@
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QWidget" name="widget" native="true">
|
<widget class="QWidget" name="widget_3" native="true">
|
||||||
<property name="styleSheet">
|
<property name="styleSheet">
|
||||||
<string notr="true"/>
|
<string notr="true"/>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
<layout class="QVBoxLayout" name="verticalLayout_17">
|
||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
|
|
@ -274,7 +306,7 @@
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QVBoxLayout" name="layout_fittingCurve">
|
<layout class="QVBoxLayout" name="layout_fittingCurve_3">
|
||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
|
|
@ -286,7 +318,7 @@
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QTableWidget" name="tablew_scale_data">
|
<widget class="QTableWidget" name="tablew_scale_data_3">
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>0</width>
|
<width>0</width>
|
||||||
|
|
@ -298,17 +330,7 @@
|
||||||
</attribute>
|
</attribute>
|
||||||
<column>
|
<column>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>序号</string>
|
<string>能量</string>
|
||||||
</property>
|
|
||||||
</column>
|
|
||||||
<column>
|
|
||||||
<property name="text">
|
|
||||||
<string>能量(key)</string>
|
|
||||||
</property>
|
|
||||||
</column>
|
|
||||||
<column>
|
|
||||||
<property name="text">
|
|
||||||
<string>净计数率</string>
|
|
||||||
</property>
|
</property>
|
||||||
</column>
|
</column>
|
||||||
<column>
|
<column>
|
||||||
|
|
|
||||||
|
|
@ -754,6 +754,17 @@ void EnergyCountPeakFitView::updateHistoryDialogWithSelection(const QList<Displa
|
||||||
LOG_DEBUG(QStringLiteral(u"历史对话框已更新"));
|
LOG_DEBUG(QStringLiteral(u"历史对话框已更新"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void EnergyCountPeakFitView::clearAllRoiMarkers()
|
||||||
|
{
|
||||||
|
for (auto marker : _roiMarkers)
|
||||||
|
{
|
||||||
|
marker->detach(); // 从绘图面板解绑
|
||||||
|
delete marker; // 销毁对象
|
||||||
|
}
|
||||||
|
_roiMarkers.clear();
|
||||||
|
_plot->replot(); // 刷新画布清除线条
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void EnergyCountPeakFitView::clearFitCurves()
|
void EnergyCountPeakFitView::clearFitCurves()
|
||||||
{
|
{
|
||||||
|
|
@ -1599,21 +1610,23 @@ void EnergyCountPeakFitView::onHistoryDlgClosed()
|
||||||
|
|
||||||
void EnergyCountPeakFitView::onActionRoiTriggered()
|
void EnergyCountPeakFitView::onActionRoiTriggered()
|
||||||
{
|
{
|
||||||
|
clearAllRoiMarkers();
|
||||||
_roi->show();
|
_roi->show();
|
||||||
}
|
}
|
||||||
|
|
||||||
void EnergyCountPeakFitView::slot_roi_data(ROIItem &item)
|
void EnergyCountPeakFitView::slot_roi_data(ROIItem &item)
|
||||||
{
|
{
|
||||||
|
clearAllRoiMarkers();
|
||||||
// 第一组:起始1、结束1 红色竖线,必须存在才插入,所以一定绘制
|
// 第一组:起始1、结束1 红色竖线,必须存在才插入,所以一定绘制
|
||||||
createVLine(item.s1, Qt::red, 1.2);
|
_roiMarkers.append(createVLine(item.s1, Qt::red, 1.2));
|
||||||
createVLine(item.e1, Qt::red, 1.2);
|
_roiMarkers.append(createVLine(item.e1, Qt::red, 1.2));
|
||||||
|
|
||||||
// 第二组:起始2、结束2 有有效数值才绘制,无值跳过
|
// 第二组:起始2、结束2 有有效数值才绘制,无值跳过
|
||||||
bool secondGroupValid = !(qIsNaN(item.s2) || qIsNaN(item.e2) || (item.s2 == 0 && item.e2 == 0));
|
bool secondGroupValid = !(qIsNaN(item.s2) || qIsNaN(item.e2) || (item.s2 == 0 && item.e2 == 0));
|
||||||
if (secondGroupValid)
|
if (secondGroupValid)
|
||||||
{
|
{
|
||||||
createVLine(item.s2, Qt::blue, 1.2);
|
_roiMarkers.append(createVLine(item.s2, Qt::blue, 1.2));
|
||||||
createVLine(item.e2, Qt::blue, 1.2);
|
_roiMarkers.append(createVLine(item.e2, Qt::blue, 1.2));
|
||||||
}
|
}
|
||||||
_plot->replot();
|
_plot->replot();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -133,6 +133,7 @@ private:
|
||||||
QList<QwtPlotCurve*> createFitCurve(const PeakFitResult& result, arma::vec xVec);
|
QList<QwtPlotCurve*> createFitCurve(const PeakFitResult& result, arma::vec xVec);
|
||||||
// 更新历史对话框并保持指定的选中状态
|
// 更新历史对话框并保持指定的选中状态
|
||||||
void updateHistoryDialogWithSelection(const QList<DisplayedCurveRef>& selectedRefs);
|
void updateHistoryDialogWithSelection(const QList<DisplayedCurveRef>& selectedRefs);
|
||||||
|
void clearAllRoiMarkers(); // 清空所有ROI竖线标记
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void newFitResultAdded();
|
void newFitResultAdded();
|
||||||
|
|
@ -172,6 +173,8 @@ private:
|
||||||
|
|
||||||
RegionOfInterest *_roi;
|
RegionOfInterest *_roi;
|
||||||
|
|
||||||
|
QList<QwtPlotMarker *> _roiMarkers;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // ENERGYCOUNTPEAKFITVIEW_H
|
#endif // ENERGYCOUNTPEAKFITVIEW_H
|
||||||
|
|
|
||||||
|
|
@ -165,6 +165,17 @@ QwtPlotMarker *EnergyCountPlotView::createVLine(double x, Qt::GlobalColor color,
|
||||||
return marker;
|
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)
|
void EnergyCountPlotView::updateView(const QMap<QString, QVariant>& data_files_set)
|
||||||
{
|
{
|
||||||
// 清除现有所有曲线
|
// 清除现有所有曲线
|
||||||
|
|
@ -279,21 +290,24 @@ void EnergyCountPlotView::onActionPlotConfigure()
|
||||||
|
|
||||||
void EnergyCountPlotView::onActionRoiTriggered()
|
void EnergyCountPlotView::onActionRoiTriggered()
|
||||||
{
|
{
|
||||||
|
clearAllRoiMarkers();
|
||||||
_roi->show();
|
_roi->show();
|
||||||
}
|
}
|
||||||
|
|
||||||
void EnergyCountPlotView::slot_roi_data(ROIItem &item)
|
void EnergyCountPlotView::slot_roi_data(ROIItem &item)
|
||||||
{
|
{
|
||||||
|
clearAllRoiMarkers();
|
||||||
|
|
||||||
// 第一组:起始1、结束1 红色竖线,必须存在才插入,所以一定绘制
|
// 第一组:起始1、结束1 红色竖线,必须存在才插入,所以一定绘制
|
||||||
createVLine(item.s1, Qt::red, 1.2);
|
_roiMarkers.append(createVLine(item.s1, Qt::red, 1.2));
|
||||||
createVLine(item.e1, Qt::red, 1.2);
|
_roiMarkers.append(createVLine(item.e1, Qt::red, 1.2));
|
||||||
|
|
||||||
// 第二组:起始2、结束2 有有效数值才绘制,无值跳过
|
// 第二组:起始2、结束2 有有效数值才绘制,无值跳过
|
||||||
bool secondGroupValid = !(qIsNaN(item.s2) || qIsNaN(item.e2) || (item.s2 == 0 && item.e2 == 0));
|
bool secondGroupValid = !(qIsNaN(item.s2) || qIsNaN(item.e2) || (item.s2 == 0 && item.e2 == 0));
|
||||||
if (secondGroupValid)
|
if (secondGroupValid)
|
||||||
{
|
{
|
||||||
createVLine(item.s2, Qt::blue, 1.2);
|
_roiMarkers.append(createVLine(item.s2, Qt::blue, 1.2));
|
||||||
createVLine(item.e2, Qt::blue, 1.2);
|
_roiMarkers.append(createVLine(item.e2, Qt::blue, 1.2));
|
||||||
}
|
}
|
||||||
_plot->replot();
|
_plot->replot();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@ private:
|
||||||
void setupMenu();
|
void setupMenu();
|
||||||
void loadDataFromFile(const QString &data_name, const QString& filename);
|
void loadDataFromFile(const QString &data_name, const QString& filename);
|
||||||
QwtPlotMarker* createVLine(double x, Qt::GlobalColor color, double lineWidth = 1.0); // 创建垂直标记竖线
|
QwtPlotMarker* createVLine(double x, Qt::GlobalColor color, double lineWidth = 1.0); // 创建垂直标记竖线
|
||||||
|
void clearAllRoiMarkers(); // 清空所有ROI竖线标记
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void onActionCurveShowSetting();
|
void onActionCurveShowSetting();
|
||||||
|
|
@ -40,6 +41,8 @@ private:
|
||||||
double _x_max = 0.0f;
|
double _x_max = 0.0f;
|
||||||
double _y_max = 0.0f;
|
double _y_max = 0.0f;
|
||||||
RegionOfInterest *_roi;
|
RegionOfInterest *_roi;
|
||||||
|
QList<QwtPlotMarker*> _roiMarkers;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // ENERGYCOUNTPLOTVIEW_H
|
#endif // ENERGYCOUNTPLOTVIEW_H
|
||||||
|
|
|
||||||
|
|
@ -220,7 +220,6 @@ QMap<QString, ChannelData> EnergyScaleForm::parseJsonToChannels(const QString &f
|
||||||
} else {
|
} else {
|
||||||
errorMsg += QString("通道 %1 缺少 FwhmFitResultCoeffs 字段\n").arg(channelName);
|
errorMsg += QString("通道 %1 缺少 FwhmFitResultCoeffs 字段\n").arg(channelName);
|
||||||
}
|
}
|
||||||
|
|
||||||
result.insert(channelName, chData);
|
result.insert(channelName, chData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -357,7 +356,6 @@ void EnergyScaleForm::clearPlot()
|
||||||
_fitCurve->detach();
|
_fitCurve->detach();
|
||||||
_plot->detachItems(QwtPlotItem::Rtti_PlotCurve, false);
|
_plot->detachItems(QwtPlotItem::Rtti_PlotCurve, false);
|
||||||
_plot->replot();
|
_plot->replot();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QVector<QPointF> EnergyScaleForm::generateFitCurvePoints(const ChannelData &chData)
|
QVector<QPointF> EnergyScaleForm::generateFitCurvePoints(const ChannelData &chData)
|
||||||
|
|
|
||||||
|
|
@ -752,11 +752,11 @@ void MainWindow::onParticleDatarefresh()
|
||||||
ProjectList::Instance()->SetNodeStatus(particleData,status,true);
|
ProjectList::Instance()->SetNodeStatus(particleData,status,true);
|
||||||
updataTable();
|
updataTable();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::onAddressCountViewNeedRefresh()
|
void MainWindow::onAddressCountViewNeedRefresh()
|
||||||
{
|
{
|
||||||
MeasureAnalysisProjectModel *pro_model = ProjectList::Instance()->GetCurrentProjectModel();
|
MeasureAnalysisProjectModel *pro_model = ProjectList::Instance()->GetCurrentProjectModel();
|
||||||
if (!pro_model) return;
|
if (!pro_model) return;
|
||||||
|
|
||||||
bool status_ok = !pro_model->GetChannelAddressCountDataFilenameList().isEmpty();
|
bool status_ok = !pro_model->GetChannelAddressCountDataFilenameList().isEmpty();
|
||||||
QString status = status_ok ? QStringLiteral(u"有效") : QStringLiteral(u"无效");
|
QString status = status_ok ? QStringLiteral(u"有效") : QStringLiteral(u"无效");
|
||||||
QString item_name = QStringLiteral(u"道址计数谱");
|
QString item_name = QStringLiteral(u"道址计数谱");
|
||||||
|
|
@ -879,6 +879,11 @@ void MainWindow::onParticleEnergyDataUpdated(const QString &energySpectrumFilena
|
||||||
}
|
}
|
||||||
void MainWindow::on_action_analysisReport_triggered()
|
void MainWindow::on_action_analysisReport_triggered()
|
||||||
{
|
{
|
||||||
|
auto project_model = ProjectList::Instance()->GetCurrentProjectModel();
|
||||||
|
if (project_model == nullptr) {
|
||||||
|
QMessageBox::information(this, "提示:", "请先加载项目!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
ReportWidget *widget = new ReportWidget();
|
ReportWidget *widget = new ReportWidget();
|
||||||
widget->show();
|
widget->show();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -194,7 +194,6 @@ void NuclideAnalysisView::setupPlot()
|
||||||
_plot->canvas()->setMouseTracking(true);
|
_plot->canvas()->setMouseTracking(true);
|
||||||
// 给canvas安装事件过滤器,捕获鼠标点击
|
// 给canvas安装事件过滤器,捕获鼠标点击
|
||||||
_plot->canvas()->installEventFilter(this);
|
_plot->canvas()->installEventFilter(this);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void NuclideAnalysisView::setupMenu()
|
void NuclideAnalysisView::setupMenu()
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ void ReportWidget::setupUi()
|
||||||
|
|
||||||
// 顶部按钮栏
|
// 顶部按钮栏
|
||||||
auto* btnLayout = new QHBoxLayout();
|
auto* btnLayout = new QHBoxLayout();
|
||||||
m_sampleBtn = new QPushButton("加载示例数据", this);
|
m_sampleBtn = new QPushButton("加载数据", this);
|
||||||
m_refreshBtn = new QPushButton("刷新报告", this);
|
m_refreshBtn = new QPushButton("刷新报告", this);
|
||||||
m_exportHtmlBtn = new QPushButton("导出HTML", this);
|
m_exportHtmlBtn = new QPushButton("导出HTML", this);
|
||||||
m_exportWordBtn = new QPushButton("导出Word", this);
|
m_exportWordBtn = new QPushButton("导出Word", this);
|
||||||
|
|
@ -472,10 +472,6 @@ void ReportWidget::exportText()
|
||||||
void ReportWidget::loadSampleData()
|
void ReportWidget::loadSampleData()
|
||||||
{
|
{
|
||||||
auto project_model = ProjectList::Instance()->GetCurrentProjectModel();
|
auto project_model = ProjectList::Instance()->GetCurrentProjectModel();
|
||||||
if (project_model == nullptr) {
|
|
||||||
QMessageBox::information(this, "提示:", "请先加载项目!");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
//获取当前可执行目录下
|
//获取当前可执行目录下
|
||||||
QString jsonPath = project_model->GetProjectDir() + "/report_params.json";
|
QString jsonPath = project_model->GetProjectDir() + "/report_params.json";
|
||||||
m_data.loadReportParamsJson(jsonPath);
|
m_data.loadReportParamsJson(jsonPath);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user