能量刻度界面进行修改,gvf转csv 问题解决
This commit is contained in:
parent
1a2afa2416
commit
c4c0e4a26f
File diff suppressed because it is too large
Load Diff
|
|
@ -2,21 +2,104 @@
|
||||||
#define ENERGYSCALEFORM_H
|
#define ENERGYSCALEFORM_H
|
||||||
|
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
|
#include <QMap>
|
||||||
|
#include <QVector>
|
||||||
|
#include <QwtPlotCurve>
|
||||||
|
#include <QwtSymbol>
|
||||||
|
#include <MeasureAnalysisView.h>
|
||||||
|
class CustomQwtPlot;
|
||||||
|
class QListWidgetItem;
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class EnergyScaleForm;
|
class EnergyScaleForm;
|
||||||
}
|
}
|
||||||
|
|
||||||
class EnergyScaleForm : public QWidget
|
struct FitDataRow {
|
||||||
|
double daoSite;//道址
|
||||||
|
double energy;//能量
|
||||||
|
double fittingEnergy;//拟合能量
|
||||||
|
double energyFittingDeviation;//能量拟合偏差
|
||||||
|
double resolution;//分辨率
|
||||||
|
double fitResolution;//拟合分辨率
|
||||||
|
double resolutionFittingDeviation;//分辨率拟合偏差
|
||||||
|
};
|
||||||
|
|
||||||
|
struct ChannelData {
|
||||||
|
int energyFitDegree;//拟合公式
|
||||||
|
QVector<double> energyFitResultCoeffs;//能量拟合系数
|
||||||
|
QVector<FitDataRow> fitData;// 多条拟合数据行
|
||||||
|
QVector<double> fwhmFitResultCoeffs;// FWHM 拟合系数
|
||||||
|
};
|
||||||
|
|
||||||
|
class EnergyScaleForm : public MeasureAnalysisView
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit EnergyScaleForm(QWidget *parent = nullptr);
|
explicit EnergyScaleForm(QWidget *parent = nullptr);
|
||||||
~EnergyScaleForm();
|
~EnergyScaleForm();
|
||||||
|
virtual void InitViewWorkspace(const QString& project_name) override final;
|
||||||
|
virtual void SetAnalyzeDataFilename(const QMap<QString, QVariant>& data_files_set);
|
||||||
|
private:
|
||||||
|
void setupPlot();
|
||||||
|
//加载能量刻度文件夹下所有的文件
|
||||||
|
void loadAllFilesInTheFolder();
|
||||||
|
//读取JSON文件
|
||||||
|
QMap<QString, ChannelData> parseJsonToChannels(const QString &filePath, QString &errorMsg);
|
||||||
|
//初始化通道数
|
||||||
|
void initComboBoxUi();
|
||||||
|
void initScaleDataTable();
|
||||||
|
void showChannelData(const QString channelName);
|
||||||
|
void showCurve();
|
||||||
|
|
||||||
|
void clearPlot();
|
||||||
|
QVector<QPointF> generateFitCurvePoints(const ChannelData &chData);
|
||||||
|
QVector<QPointF> generateFitCurvePoints(const double a = 0,const double b = 0,const double c = 0);
|
||||||
|
|
||||||
|
//计算拟合值和偏差
|
||||||
|
void calculateFitValues(ChannelData &chData);
|
||||||
|
//保存通道数据到JSON文件
|
||||||
|
bool saveChannelDataToJson(const QString &filePath);
|
||||||
|
//检查道址是否重复
|
||||||
|
bool isDaoSiteDuplicated(const QString &channelName, double daoSite);
|
||||||
|
bool fitFwhmModel(ChannelData &chData);
|
||||||
|
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void onItemDoubleClicked(QListWidgetItem *item);
|
||||||
|
void on_comboBox_channel_currentTextChanged(const QString &text);
|
||||||
|
void on_comboBox_fit_type_currentTextChanged(const QString &text);
|
||||||
|
|
||||||
|
void on_pBtn_Add_clicked();
|
||||||
|
|
||||||
|
void on_pBtn_Delete_clicked();
|
||||||
|
|
||||||
|
void on_pBtn_fitting_clicked();
|
||||||
|
|
||||||
|
void on_tablew_scale_data_cellChanged(int row, int column);
|
||||||
|
|
||||||
|
void on_pBtn_SaveAs_clicked();
|
||||||
|
|
||||||
|
void on_pBtn_Save_clicked();
|
||||||
|
|
||||||
|
void on_pBtn_Add_File_clicked();
|
||||||
|
|
||||||
|
void on_pBtn_Delete_File_clicked();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::EnergyScaleForm *ui;
|
Ui::EnergyScaleForm *ui;
|
||||||
|
CustomQwtPlot* _plot = nullptr;
|
||||||
|
QMap<QString, ChannelData> m_channelList;
|
||||||
|
|
||||||
|
QwtPlotCurve *_rawDataCurve; // 原始数据散点曲线
|
||||||
|
QwtPlotCurve *_fitCurve; // 拟合曲线
|
||||||
|
QwtSymbol *_rawDataSymbol; // 原始数据点样式
|
||||||
|
|
||||||
|
// 防止表格填充时触发cellChanged信号
|
||||||
|
bool m_isLoadingTable = false;
|
||||||
|
//记录当前加载的文件路径
|
||||||
|
QString m_currentFilePath;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // ENERGYSCALEFORM_H
|
#endif // ENERGYSCALEFORM_H
|
||||||
|
|
|
||||||
|
|
@ -6,8 +6,8 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>831</width>
|
<width>1086</width>
|
||||||
<height>568</height>
|
<height>584</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
|
|
@ -19,338 +19,347 @@
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>能量刻度</string>
|
<string>能量刻度</string>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QTableWidget" name="tablew_scale_data">
|
<layout class="QHBoxLayout" name="horizontalLayout_2" stretch="1,5">
|
||||||
<property name="geometry">
|
<item>
|
||||||
<rect>
|
<widget class="QGroupBox" name="groupBox_3">
|
||||||
<x>190</x>
|
<property name="title">
|
||||||
<y>420</y>
|
<string>能量刻度管理列表</string>
|
||||||
<width>621</width>
|
</property>
|
||||||
<height>101</height>
|
<layout class="QVBoxLayout" name="verticalLayout_5">
|
||||||
</rect>
|
<property name="leftMargin">
|
||||||
</property>
|
<number>0</number>
|
||||||
<property name="minimumSize">
|
</property>
|
||||||
<size>
|
<property name="topMargin">
|
||||||
<width>0</width>
|
<number>0</number>
|
||||||
<height>0</height>
|
</property>
|
||||||
</size>
|
<property name="rightMargin">
|
||||||
</property>
|
<number>0</number>
|
||||||
<attribute name="horizontalHeaderCascadingSectionResizes">
|
</property>
|
||||||
<bool>true</bool>
|
<property name="bottomMargin">
|
||||||
</attribute>
|
<number>0</number>
|
||||||
<column>
|
</property>
|
||||||
<property name="text">
|
|
||||||
<string>道址</string>
|
|
||||||
</property>
|
|
||||||
</column>
|
|
||||||
<column>
|
|
||||||
<property name="text">
|
|
||||||
<string>能量</string>
|
|
||||||
</property>
|
|
||||||
</column>
|
|
||||||
<column>
|
|
||||||
<property name="text">
|
|
||||||
<string>拟合能量</string>
|
|
||||||
</property>
|
|
||||||
</column>
|
|
||||||
<column>
|
|
||||||
<property name="text">
|
|
||||||
<string>能量拟合偏差</string>
|
|
||||||
</property>
|
|
||||||
</column>
|
|
||||||
<column>
|
|
||||||
<property name="text">
|
|
||||||
<string>分辨率</string>
|
|
||||||
</property>
|
|
||||||
</column>
|
|
||||||
<column>
|
|
||||||
<property name="text">
|
|
||||||
<string>拟合分辨率</string>
|
|
||||||
</property>
|
|
||||||
</column>
|
|
||||||
<column>
|
|
||||||
<property name="text">
|
|
||||||
<string>分辨率拟合偏差</string>
|
|
||||||
</property>
|
|
||||||
</column>
|
|
||||||
</widget>
|
|
||||||
<widget class="QGroupBox" name="groupBox_3">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>20</x>
|
|
||||||
<y>10</y>
|
|
||||||
<width>151</width>
|
|
||||||
<height>531</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="title">
|
|
||||||
<string>能量刻度管理列表</string>
|
|
||||||
</property>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_5">
|
|
||||||
<item>
|
|
||||||
<widget class="QTreeWidget" name="treeWidget">
|
|
||||||
<column>
|
|
||||||
<property name="text">
|
|
||||||
<string notr="true">1</string>
|
|
||||||
</property>
|
|
||||||
</column>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_9">
|
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="pushButton_4">
|
<widget class="QListWidget" name="listWidget"/>
|
||||||
<property name="text">
|
|
||||||
<string>添加</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="pushButton_5">
|
<layout class="QHBoxLayout" name="horizontalLayout_9">
|
||||||
<property name="text">
|
<item>
|
||||||
<string>删除</string>
|
<widget class="QPushButton" name="pBtn_Add_File">
|
||||||
</property>
|
<property name="text">
|
||||||
</widget>
|
<string>添加</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="pBtn_Delete_File">
|
||||||
|
<property name="text">
|
||||||
|
<string>删除</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</widget>
|
||||||
</layout>
|
</item>
|
||||||
</widget>
|
<item>
|
||||||
<widget class="QWidget" name="layoutWidget">
|
<layout class="QVBoxLayout" name="verticalLayout_6" stretch="3,5">
|
||||||
<property name="geometry">
|
<item>
|
||||||
<rect>
|
<layout class="QHBoxLayout" name="horizontalLayout" stretch="1,5">
|
||||||
<x>191</x>
|
<item>
|
||||||
<y>9</y>
|
<layout class="QVBoxLayout" name="verticalLayout_3" stretch="3,1,5,0,1,1">
|
||||||
<width>631</width>
|
|
||||||
<height>338</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_8">
|
|
||||||
<item>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
|
||||||
<item>
|
|
||||||
<widget class="QGroupBox" name="groupBox_2">
|
|
||||||
<property name="title">
|
|
||||||
<string>能量刻度信息</string>
|
|
||||||
</property>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
<widget class="QGroupBox" name="groupBox_2">
|
||||||
|
<property name="title">
|
||||||
|
<string>能量刻度信息</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
|
<item>
|
||||||
|
<layout class="QGridLayout" name="gridLayout" columnstretch="2,3" rowminimumheight="2,3" columnminimumwidth="0,0">
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="label_5">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>85</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>能量刻度命名:</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="1">
|
||||||
|
<widget class="QLineEdit" name="lineEdit_name"/>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QLabel" name="label_6">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>85</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>备注说明:</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignRight|Qt::AlignTop|Qt::AlignTrailing</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="1">
|
||||||
|
<widget class="QPlainTextEdit" name="plainTextEdit_description">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_5">
|
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||||
<property name="minimumSize">
|
<item>
|
||||||
|
<widget class="QLabel" name="label">
|
||||||
|
<property name="text">
|
||||||
|
<string>通道:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QComboBox" name="comboBox_channel"/>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeType">
|
||||||
|
<enum>QSizePolicy::Expanding</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
<size>
|
<size>
|
||||||
<width>85</width>
|
<width>40</width>
|
||||||
<height>0</height>
|
<height>20</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
</spacer>
|
||||||
<string>能量刻度命名:</string>
|
|
||||||
</property>
|
|
||||||
<property name="alignment">
|
|
||||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLineEdit" name="lineEdit_name"/>
|
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="pBtn_Save">
|
||||||
|
<property name="text">
|
||||||
|
<string>保存</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="pBtn_SaveAs">
|
||||||
|
<property name="text">
|
||||||
|
<string>另存为</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QGroupBox" name="groupBox">
|
||||||
|
<property name="title">
|
||||||
|
<string>公式拟合</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_2">
|
||||||
|
<property name="text">
|
||||||
|
<string>拟合公式:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_6">
|
||||||
|
<item>
|
||||||
|
<widget class="QComboBox" name="comboBox_fit_type">
|
||||||
|
<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">
|
||||||
|
<property name="text">
|
||||||
|
<string>拟合</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_fit_type_text">
|
||||||
|
<property name="text">
|
||||||
|
<string>y = a + bx</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_fit_result">
|
||||||
|
<property name="text">
|
||||||
|
<string>a = 1.21823, b = -5.0542</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="Line" name="line">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_3">
|
||||||
|
<property name="text">
|
||||||
|
<string>能量刻度拟合数据</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_7">
|
<layout class="QHBoxLayout" name="horizontalLayout_7">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_7">
|
<widget class="QPushButton" name="pBtn_Add">
|
||||||
<property name="minimumSize">
|
<property name="text">
|
||||||
|
<string>新增</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="pBtn_Delete">
|
||||||
|
<property name="text">
|
||||||
|
<string>删除</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer_2">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
<size>
|
<size>
|
||||||
<width>85</width>
|
<width>40</width>
|
||||||
<height>0</height>
|
<height>20</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
</spacer>
|
||||||
<string>设备测量配置:</string>
|
|
||||||
</property>
|
|
||||||
<property name="alignment">
|
|
||||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QComboBox" name="comboBox_measure_dev_cfg">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="label_6">
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>85</width>
|
|
||||||
<height>0</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>备注说明:</string>
|
|
||||||
</property>
|
|
||||||
<property name="alignment">
|
|
||||||
<set>Qt::AlignRight|Qt::AlignTop|Qt::AlignTrailing</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QPlainTextEdit" name="plainTextEdit_description">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</item>
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
|
||||||
<item>
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="label">
|
|
||||||
<property name="text">
|
|
||||||
<string>通道:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QComboBox" name="comboBox_channel"/>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<spacer name="horizontalSpacer">
|
|
||||||
<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_4">
|
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="pushButton">
|
|
||||||
<property name="text">
|
|
||||||
<string>保存</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="pushButton_2">
|
|
||||||
<property name="text">
|
|
||||||
<string>另存为</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QGroupBox" name="groupBox">
|
|
||||||
<property name="title">
|
|
||||||
<string>公式拟合</string>
|
|
||||||
</property>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="label_2">
|
|
||||||
<property name="text">
|
|
||||||
<string>拟合公式:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_6">
|
|
||||||
<item>
|
|
||||||
<widget class="QComboBox" name="comboBox_fit_type">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="pushButton_3">
|
|
||||||
<property name="text">
|
|
||||||
<string>拟合</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="label_fit_type_text">
|
|
||||||
<property name="text">
|
|
||||||
<string>y = a + bx</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="label_fit_result">
|
|
||||||
<property name="text">
|
|
||||||
<string>a = 1.21823, b = -5.0542</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QWidget" name="widget" native="true">
|
|
||||||
<property name="styleSheet">
|
|
||||||
<string notr="true">background-color: rgb(85, 170, 255);</string>
|
|
||||||
</property>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
|
||||||
<item>
|
<item>
|
||||||
<spacer name="horizontalSpacer_2">
|
<widget class="QWidget" name="widget" native="true">
|
||||||
<property name="orientation">
|
<property name="styleSheet">
|
||||||
<enum>Qt::Horizontal</enum>
|
<string notr="true"/>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizeType">
|
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||||
<enum>QSizePolicy::MinimumExpanding</enum>
|
<property name="spacing">
|
||||||
</property>
|
<number>0</number>
|
||||||
<property name="sizeHint" stdset="0">
|
</property>
|
||||||
<size>
|
<property name="leftMargin">
|
||||||
<width>40</width>
|
<number>0</number>
|
||||||
<height>20</height>
|
</property>
|
||||||
</size>
|
<property name="topMargin">
|
||||||
</property>
|
<number>0</number>
|
||||||
</spacer>
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<layout class="QVBoxLayout" name="layout_fittingCurve">
|
||||||
|
<property name="spacing">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</item>
|
||||||
</item>
|
<item>
|
||||||
</layout>
|
<widget class="QTableWidget" name="tablew_scale_data">
|
||||||
</widget>
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<attribute name="horizontalHeaderCascadingSectionResizes">
|
||||||
|
<bool>true</bool>
|
||||||
|
</attribute>
|
||||||
|
<column>
|
||||||
|
<property name="text">
|
||||||
|
<string>道址</string>
|
||||||
|
</property>
|
||||||
|
</column>
|
||||||
|
<column>
|
||||||
|
<property name="text">
|
||||||
|
<string>能量</string>
|
||||||
|
</property>
|
||||||
|
</column>
|
||||||
|
<column>
|
||||||
|
<property name="text">
|
||||||
|
<string>拟合能量</string>
|
||||||
|
</property>
|
||||||
|
</column>
|
||||||
|
<column>
|
||||||
|
<property name="text">
|
||||||
|
<string>能量拟合偏差</string>
|
||||||
|
</property>
|
||||||
|
</column>
|
||||||
|
<column>
|
||||||
|
<property name="text">
|
||||||
|
<string>分辨率</string>
|
||||||
|
</property>
|
||||||
|
</column>
|
||||||
|
<column>
|
||||||
|
<property name="text">
|
||||||
|
<string>拟合分辨率</string>
|
||||||
|
</property>
|
||||||
|
</column>
|
||||||
|
<column>
|
||||||
|
<property name="text">
|
||||||
|
<string>分辨率拟合偏差</string>
|
||||||
|
</property>
|
||||||
|
</column>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections/>
|
<connections/>
|
||||||
|
|
|
||||||
|
|
@ -196,6 +196,12 @@ void GvfToCsv::convertGVF2CSVAsync(const QString &gvfPath, const QString &csvPat
|
||||||
|
|
||||||
void GvfToCsv::onSqliteOperationCompleted(bool success, const QString &msg)
|
void GvfToCsv::onSqliteOperationCompleted(bool success, const QString &msg)
|
||||||
{
|
{
|
||||||
|
if (!m_sqliteWorker) {
|
||||||
|
setLastError("SQLite 工作对象已被销毁");
|
||||||
|
emit conversionFinished(false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!success) {
|
if (!success) {
|
||||||
setLastError(QString("GVF数据读取失败: %1").arg(msg));
|
setLastError(QString("GVF数据读取失败: %1").arg(msg));
|
||||||
cleanUp();
|
cleanUp();
|
||||||
|
|
@ -219,9 +225,14 @@ void GvfToCsv::onSqliteOperationCompleted(bool success, const QString &msg)
|
||||||
|
|
||||||
void GvfToCsv::processDBData()
|
void GvfToCsv::processDBData()
|
||||||
{
|
{
|
||||||
|
if (!m_sqliteWorker) {
|
||||||
|
throw std::runtime_error("SQLite 工作对象已销毁,无法读取数据");
|
||||||
|
}
|
||||||
|
|
||||||
QVector<DataBaseStruct> dbList = m_sqliteWorker->DataBaseList();
|
QVector<DataBaseStruct> dbList = m_sqliteWorker->DataBaseList();
|
||||||
if (dbList.isEmpty()) {
|
if (dbList.isEmpty()) {
|
||||||
throw std::runtime_error("GVF数据库中无任何记录");
|
throw std::runtime_error("GVF数据库中无任何记录");
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
QFile outFile(m_csvPath);
|
QFile outFile(m_csvPath);
|
||||||
if (!outFile.open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Truncate)) {
|
if (!outFile.open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Truncate)) {
|
||||||
|
|
|
||||||
|
|
@ -100,6 +100,16 @@ void MeasureAnalysisTreeView::onNodeDoubleClicked(const QModelIndex& index)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
|
case AnalysisType::EnergyScale:{
|
||||||
|
MeasureAnalysisProjectModel* project_model = _model->GetProjectModel(project_name);
|
||||||
|
if (project_model) {
|
||||||
|
auto file_name = project_model->GetEnergyScaleFilename();
|
||||||
|
if ( !file_name.isEmpty() ) {
|
||||||
|
data_files_set[QStringLiteral(u"能量刻度")] = file_name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
;break;
|
||||||
case AnalysisType::ParticleData: {
|
case AnalysisType::ParticleData: {
|
||||||
MeasureAnalysisProjectModel* project_model = _model->GetProjectModel(project_name);
|
MeasureAnalysisProjectModel* project_model = _model->GetProjectModel(project_name);
|
||||||
if (project_model) {
|
if (project_model) {
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@
|
||||||
#include "AntiConformEnergySpectrumView.h"
|
#include "AntiConformEnergySpectrumView.h"
|
||||||
#include "CoincidenceEventTimeView.h"
|
#include "CoincidenceEventTimeView.h"
|
||||||
#include "NuclideAnalysisView.h"
|
#include "NuclideAnalysisView.h"
|
||||||
|
#include "EnergyScaleForm.h"
|
||||||
#include <QMap>
|
#include <QMap>
|
||||||
|
|
||||||
MeasureAnalysisView* MeasureAnalysisView::NewAnalyzeView(AnalysisType view_type)
|
MeasureAnalysisView* MeasureAnalysisView::NewAnalyzeView(AnalysisType view_type)
|
||||||
|
|
@ -28,8 +29,8 @@ MeasureAnalysisView* MeasureAnalysisView::NewAnalyzeView(AnalysisType view_type)
|
||||||
new_view->setDeleteOnClose(true);
|
new_view->setDeleteOnClose(true);
|
||||||
} break;
|
} break;
|
||||||
case AnalysisType::EnergyScale: {
|
case AnalysisType::EnergyScale: {
|
||||||
// new_view = new MeasureAnalysisDataTableView;
|
new_view = new EnergyScaleForm;
|
||||||
// new_view->setDeleteOnClose(true);
|
new_view->setDeleteOnClose(true);
|
||||||
} break;
|
} break;
|
||||||
case AnalysisType::EfficiencyScale: {
|
case AnalysisType::EfficiencyScale: {
|
||||||
// new_view = new MeasureAnalysisDataTableView;
|
// new_view = new MeasureAnalysisDataTableView;
|
||||||
|
|
|
||||||
|
|
@ -467,7 +467,7 @@ void ConformityAnalysis::loadHistoryFromFile()
|
||||||
QString binPath = QDir(_workspace).filePath(QString("surface_%1.bin").arg(c));
|
QString binPath = QDir(_workspace).filePath(QString("surface_%1.bin").arg(c));
|
||||||
|
|
||||||
if (!QFile::exists(jsonPath)) {
|
if (!QFile::exists(jsonPath)) {
|
||||||
qDebug() << "[ConformityAnalysis] " << c << "重符合历史文件不存在:" << jsonPath;
|
// qDebug() << "[ConformityAnalysis] " << c << "重符合历史文件不存在:" << jsonPath;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -180,7 +180,7 @@
|
||||||
<widget class="QLabel" name="lineEdit_begin_start">
|
<widget class="QLabel" name="lineEdit_begin_start">
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>106</width>
|
<width>50</width>
|
||||||
<height>21</height>
|
<height>21</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
|
|
@ -200,7 +200,7 @@
|
||||||
<widget class="QLabel" name="lineEdit_begin_end">
|
<widget class="QLabel" name="lineEdit_begin_end">
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>106</width>
|
<width>50</width>
|
||||||
<height>21</height>
|
<height>21</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
|
|
@ -266,7 +266,7 @@
|
||||||
<widget class="QLabel" name="lineEdit_second_start">
|
<widget class="QLabel" name="lineEdit_second_start">
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>106</width>
|
<width>50</width>
|
||||||
<height>21</height>
|
<height>21</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
|
|
@ -286,7 +286,7 @@
|
||||||
<widget class="QLabel" name="lineEdit_second_end">
|
<widget class="QLabel" name="lineEdit_second_end">
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>106</width>
|
<width>50</width>
|
||||||
<height>21</height>
|
<height>21</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
|
|
@ -358,7 +358,7 @@
|
||||||
<widget class="QLabel" name="lineEdit_count">
|
<widget class="QLabel" name="lineEdit_count">
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>150</width>
|
<width>100</width>
|
||||||
<height>21</height>
|
<height>21</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user