修改初始无ROI区域时 不显示弹框
This commit is contained in:
parent
08eaff9122
commit
8bcb4ecd21
|
|
@ -1615,9 +1615,9 @@ bool ManualFindPeaksTask::processTask()
|
||||||
arma::vec p_fit = NolinearLeastSquaresCurveFit::Lsqcurvefit(
|
arma::vec p_fit = NolinearLeastSquaresCurveFit::Lsqcurvefit(
|
||||||
PhotonPeakModel, armaX, armaY, p0
|
PhotonPeakModel, armaX, armaY, p0
|
||||||
);
|
);
|
||||||
double amplitude = p_fit(0); // 峰振幅
|
double amplitude = p_fit(0);// 峰振幅
|
||||||
double sigma = p_fit(1); // 高斯sigma
|
double sigma = p_fit(1);// 高斯sigma
|
||||||
double center = p_fit(5); // 峰中心(峰位)
|
double center = p_fit(5);// 峰中心(峰位)
|
||||||
double fwhm = sigma * 2.355;
|
double fwhm = sigma * 2.355;
|
||||||
double baseline = p_fit(4); // 本底
|
double baseline = p_fit(4); // 本底
|
||||||
double peakHeight = amplitude + baseline; // 峰高 = 振幅 + 本底
|
double peakHeight = amplitude + baseline; // 峰高 = 振幅 + 本底
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,8 @@ const QString &EnergyScaleDataModel::GetDataFilename() const
|
||||||
bool EnergyScaleDataModel::LoadData()
|
bool EnergyScaleDataModel::LoadData()
|
||||||
{
|
{
|
||||||
QFile json_file(_data_filename);
|
QFile json_file(_data_filename);
|
||||||
if (!json_file.open(QIODevice::ReadOnly | QIODevice::Text)) {
|
if (!json_file.open(QIODevice::ReadOnly | QIODevice::Text))
|
||||||
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
QJsonDocument json_doc = QJsonDocument::fromJson(json_file.readAll());
|
QJsonDocument json_doc = QJsonDocument::fromJson(json_file.readAll());
|
||||||
|
|
|
||||||
|
|
@ -350,13 +350,13 @@ void RegionOfInterest::loadROIFromFile()
|
||||||
QString roiPath = QApplication::applicationDirPath() + "/configure/RegionOfInterest/roiData.json";
|
QString roiPath = QApplication::applicationDirPath() + "/configure/RegionOfInterest/roiData.json";
|
||||||
if (!QFile::exists(roiPath))
|
if (!QFile::exists(roiPath))
|
||||||
{
|
{
|
||||||
QMessageBox::information(this, "提示", "暂无保存的ROI文件");
|
// QMessageBox::information(this, "提示", "暂无保存的ROI文件");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
QJsonArray arr = readAllROIJson();
|
QJsonArray arr = readAllROIJson();
|
||||||
if (arr.isEmpty())
|
if (arr.isEmpty())
|
||||||
{
|
{
|
||||||
QMessageBox::information(this, "提示", "文件内无ROI数据");
|
// QMessageBox::information(this, "提示", "文件内无ROI数据");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// 清空当前界面与内存
|
// 清空当前界面与内存
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user