Merge branch 'dev' of http://git.hivekion.com:3000/xuhai_cpp/EnergySpectrumAnalyer into dev_axl
This commit is contained in:
commit
209be2b040
|
|
@ -9,6 +9,7 @@ enum class AnalysisType {
|
||||||
EfficiencyScale, // 效率刻度
|
EfficiencyScale, // 效率刻度
|
||||||
ParticleData, // 粒子数据
|
ParticleData, // 粒子数据
|
||||||
AddressCountData, // 粒子道址计数数据
|
AddressCountData, // 粒子道址计数数据
|
||||||
|
ParticleEnergyData, // 粒子数据
|
||||||
EnergyCountData, // 能量计数数据
|
EnergyCountData, // 能量计数数据
|
||||||
ChannelEnergyCountData, // 通道能量计数数据
|
ChannelEnergyCountData, // 通道能量计数数据
|
||||||
CoincidenceParticleEnergyData, // 符合粒子能量数据
|
CoincidenceParticleEnergyData, // 符合粒子能量数据
|
||||||
|
|
@ -19,7 +20,7 @@ enum class AnalysisType {
|
||||||
CountingRateView, // 计数率视图
|
CountingRateView, // 计数率视图
|
||||||
EnergyPeakFitView, // 能量峰拟合视图
|
EnergyPeakFitView, // 能量峰拟合视图
|
||||||
NuclideAnalysisView, // 核分析视图
|
NuclideAnalysisView, // 核分析视图
|
||||||
ParticleInTimeView, // 粒子在时间视图
|
ParticleInTimeView, // 粒子射入时间视图
|
||||||
ParticleTimeDiffView, // 粒子时间差视图
|
ParticleTimeDiffView, // 粒子时间差视图
|
||||||
CoincidenceEventTimeView, // 符合事件时间视图
|
CoincidenceEventTimeView, // 符合事件时间视图
|
||||||
CoincidenceParticleEnergySpectrumView, // 符合粒子能量谱视图
|
CoincidenceParticleEnergySpectrumView, // 符合粒子能量谱视图
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ arma::vec EnergyEfficiencyFit::SemiEmpiricalFit(const arma::vec &E, const arma::
|
||||||
{
|
{
|
||||||
// 输入数据有效性检查
|
// 输入数据有效性检查
|
||||||
if (E.n_elem != eps.n_elem) {
|
if (E.n_elem != eps.n_elem) {
|
||||||
throw(string("错误:能量数据和效率数据长度不匹配!"));
|
throw(string("错误:能量数据和效率数据长度不匹配!"));
|
||||||
}
|
}
|
||||||
if (E.n_elem <= order) {
|
if (E.n_elem <= order) {
|
||||||
stringstream ss_error;
|
stringstream ss_error;
|
||||||
|
|
@ -22,7 +22,7 @@ arma::vec EnergyEfficiencyFit::SemiEmpiricalFit(const arma::vec &E, const arma::
|
||||||
}
|
}
|
||||||
if (order < 0) {
|
if (order < 0) {
|
||||||
stringstream ss_error;
|
stringstream ss_error;
|
||||||
ss_error << "错误:多项式阶数不能为负数!";
|
ss_error << "错误:多项式阶数不能为负数!";
|
||||||
throw(ss_error.str());
|
throw(ss_error.str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#include "GaussPolyCoe.h"
|
#include "GaussPolyCoe.h"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
|
|
@ -78,10 +78,11 @@ vector<double> GaussPolyCoe::PolynomialFit(const vector<double>& x, const vector
|
||||||
|
|
||||||
double GaussPolyCoe::Predict(const vector<double>& coeffs, double x)
|
double GaussPolyCoe::Predict(const vector<double>& coeffs, double x)
|
||||||
{
|
{
|
||||||
double result = 0.0;
|
double result = 0.0f;
|
||||||
for (int i = 0; i < coeffs.size(); ++i) {
|
for (int i = 0; i < coeffs.size(); ++i) {
|
||||||
result += coeffs[i] * pow(x, i);
|
result += coeffs[i] * pow(x, i);
|
||||||
}
|
}
|
||||||
|
result = round(result * 1000) / 1000.0f;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,9 @@ double FwhmModel(double E, const vec& p)
|
||||||
{
|
{
|
||||||
double k = p(0);
|
double k = p(0);
|
||||||
double c = p(1);
|
double c = p(1);
|
||||||
return k * sqrt(E) + c;
|
double fwhm = k * sqrt(E) + c;
|
||||||
|
fwhm = round(fwhm * 1000) / 1000.0f;
|
||||||
|
return fwhm;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 高斯模型: y = A * exp(-pow(x - mu, 2) / (2 * pow(sigma, 2)))
|
// 高斯模型: y = A * exp(-pow(x - mu, 2) / (2 * pow(sigma, 2)))
|
||||||
|
|
@ -235,7 +237,7 @@ double EfficiencyExperimentalCalc(int N, double A, double P, double t)
|
||||||
double EnergyEfficiency(double E, const vec &coeffs)
|
double EnergyEfficiency(double E, const vec &coeffs)
|
||||||
{
|
{
|
||||||
if (E <= 0) {
|
if (E <= 0) {
|
||||||
throw std::string("能量数据必须为正数!");
|
throw std::string("能量数据必须为正数!");
|
||||||
}
|
}
|
||||||
|
|
||||||
double tmp_value = 0.0f;
|
double tmp_value = 0.0f;
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,8 @@
|
||||||
#include <QVariant>
|
#include <QVariant>
|
||||||
#include <QFuture>
|
#include <QFuture>
|
||||||
#include <QtConcurrent>
|
#include <QtConcurrent>
|
||||||
|
#include <QProcess>
|
||||||
|
#include <QProcessEnvironment>
|
||||||
#include "DataCalcProcess/MathModelDefine.h"
|
#include "DataCalcProcess/MathModelDefine.h"
|
||||||
#include "DataCalcProcess/FindPeaksBySvd.h"
|
#include "DataCalcProcess/FindPeaksBySvd.h"
|
||||||
#include "DataCalcProcess/GaussPolyCoe.h"
|
#include "DataCalcProcess/GaussPolyCoe.h"
|
||||||
|
|
@ -62,16 +64,24 @@ void DataProcessTask::run()
|
||||||
if (!IsValidSetWorkParameters()) {
|
if (!IsValidSetWorkParameters()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
bool task_ok = processTask();
|
||||||
if (!processTask()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((GetFinishedNotifier() != nullptr) && (GetFinishedNotifierProcess() != nullptr)) {
|
if ((GetFinishedNotifier() != nullptr) && (GetFinishedNotifierProcess() != nullptr)) {
|
||||||
QMetaObject::invokeMethod(_finished_notifier, _finished_notifier_process, Qt::QueuedConnection, Q_ARG(QString, _project_name));
|
QMetaObject::invokeMethod(
|
||||||
|
_finished_notifier,
|
||||||
|
_finished_notifier_process,
|
||||||
|
Qt::QueuedConnection,
|
||||||
|
Q_ARG(bool, task_ok),
|
||||||
|
Q_ARG(QString, _project_name),
|
||||||
|
Q_ARG(QVariant, _task_result_data)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DataProcessTask::updateTaskResultData(const QVariant &task_result_data)
|
||||||
|
{
|
||||||
|
this->_task_result_data = task_result_data;
|
||||||
|
}
|
||||||
|
|
||||||
void ParticleDataTask::SetAllChannelParticleDataFilename(const QString& all_channel_particle_data_filename)
|
void ParticleDataTask::SetAllChannelParticleDataFilename(const QString& all_channel_particle_data_filename)
|
||||||
{
|
{
|
||||||
this->_all_channel_particle_data_filename = all_channel_particle_data_filename;
|
this->_all_channel_particle_data_filename = all_channel_particle_data_filename;
|
||||||
|
|
@ -139,14 +149,12 @@ bool EveryChannelParticleDataSeparateTask::processEveryChannelParticleData()
|
||||||
uint address;
|
uint address;
|
||||||
unsigned long long time;
|
unsigned long long time;
|
||||||
while (reader.read_row(board_id, channel_id, address, time)) {
|
while (reader.read_row(board_id, channel_id, address, time)) {
|
||||||
|
|
||||||
// 板卡和通道号计算,通道号 = 板卡号 * 4 + 通道号
|
// 板卡和通道号计算,通道号 = 板卡号 * 4 + 通道号
|
||||||
int channel_num = (board_id) * 4 + (channel_id + 1);
|
int channel_num = (board_id) * 4 + (channel_id + 1);
|
||||||
QString particle_data_filename = result_data_output_dir.filePath(QStringLiteral(u"通道%1粒子数据.csv").arg(channel_num));
|
QString particle_data_filename = result_data_output_dir.filePath(QStringLiteral(u"通道%1粒子数据.csv").arg(channel_num));
|
||||||
if (!particle_data_filename_list.contains(channel_num)) {
|
if (!particle_data_filename_list.contains(channel_num)) {
|
||||||
particle_data_filename_list.insert(channel_num, particle_data_filename);
|
particle_data_filename_list.insert(channel_num, particle_data_filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ch_particle_data_of_list.contains(channel_num)) {
|
if (!ch_particle_data_of_list.contains(channel_num)) {
|
||||||
std::shared_ptr<std::ofstream> out(
|
std::shared_ptr<std::ofstream> out(
|
||||||
new std::ofstream(QStrToSysPath(particle_data_filename), std::ios::out | std::ios::app),
|
new std::ofstream(QStrToSysPath(particle_data_filename), std::ios::out | std::ios::app),
|
||||||
|
|
@ -228,7 +236,7 @@ bool EveryChannelParticleCountDataTask::processEveryChannelParticleData()
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// 统计每个通道的粒子计数(相同板卡号通道号相同道址)
|
// 统计每个通道的粒子计数(相同板卡号通道号相同道址)
|
||||||
QMap<uint, QMap<uint, uint>> channel_address_counts; // 通道号 -> 地址 -> 计数
|
QMap<uint, QMap<uint, unsigned long long>> channel_address_counts; // 通道号 -> 地址 -> 计数
|
||||||
|
|
||||||
// 统计所有通道的粒子计数(不同板卡号通道号相同道址)
|
// 统计所有通道的粒子计数(不同板卡号通道号相同道址)
|
||||||
// QMap<uint, uint> all_channel_address_counts; // 地址 -> 计数
|
// QMap<uint, uint> all_channel_address_counts; // 地址 -> 计数
|
||||||
|
|
@ -257,7 +265,7 @@ bool EveryChannelParticleCountDataTask::processEveryChannelParticleData()
|
||||||
|
|
||||||
// 统计每个通道的粒子计数
|
// 统计每个通道的粒子计数
|
||||||
if (!channel_address_counts.contains(channel_num)) {
|
if (!channel_address_counts.contains(channel_num)) {
|
||||||
channel_address_counts[channel_num] = QMap<uint, uint>();
|
channel_address_counts[channel_num] = QMap<uint, unsigned long long>();
|
||||||
}
|
}
|
||||||
channel_address_counts[channel_num][address]++;
|
channel_address_counts[channel_num][address]++;
|
||||||
|
|
||||||
|
|
@ -283,12 +291,12 @@ bool EveryChannelParticleCountDataTask::processEveryChannelParticleData()
|
||||||
// 批量写入数据
|
// 批量写入数据
|
||||||
for (auto channel_it = channel_address_counts.begin(); channel_it != channel_address_counts.end(); ++channel_it) {
|
for (auto channel_it = channel_address_counts.begin(); channel_it != channel_address_counts.end(); ++channel_it) {
|
||||||
uint channel_num = channel_it.key();
|
uint channel_num = channel_it.key();
|
||||||
const QMap<uint, uint>& address_counts = channel_it.value();
|
const QMap<uint, unsigned long long>& address_counts = channel_it.value();
|
||||||
auto out_stream = channel_file_streams[channel_num];
|
auto out_stream = channel_file_streams[channel_num];
|
||||||
|
|
||||||
for (auto address_it = address_counts.begin(); address_it != address_counts.end(); ++address_it) {
|
for (auto address_it = address_counts.begin(); address_it != address_counts.end(); ++address_it) {
|
||||||
uint address = address_it.key();
|
uint address = address_it.key();
|
||||||
uint count = address_it.value();
|
unsigned long long count = address_it.value();
|
||||||
*out_stream << address << "," << count << std::endl;
|
*out_stream << address << "," << count << std::endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -336,7 +344,8 @@ bool EveryChannelParticleCountDataTask::processEveryChannelParticleData()
|
||||||
// 更新项目模型中的所有通道粒子总计数数据文件名
|
// 更新项目模型中的所有通道粒子总计数数据文件名
|
||||||
// project_model->SetAllChannelParticleTotalCountDataFilename(all_channel_total_count_filename);
|
// project_model->SetAllChannelParticleTotalCountDataFilename(all_channel_total_count_filename);
|
||||||
}
|
}
|
||||||
|
const QString& info = QStringLiteral(u"所有通道粒子计数处理完成.");
|
||||||
|
LOG_INFO(info);
|
||||||
return ret_ok;
|
return ret_ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -389,17 +398,16 @@ std::vector<std::string> splitFile(const std::string& input_file, size_t chunk_s
|
||||||
> reader(input_file);
|
> reader(input_file);
|
||||||
reader.read_header(io::ignore_extra_column, board_id_str, channel_id_str, address_str, time_str);
|
reader.read_header(io::ignore_extra_column, board_id_str, channel_id_str, address_str, time_str);
|
||||||
|
|
||||||
int chunkIndex = 0;
|
int chunk_index = 0;
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
std::vector<CsvRow> rows;
|
std::vector<CsvRow> rows;
|
||||||
size_t currentSize = 0;
|
size_t current_size = 0;
|
||||||
|
|
||||||
uint board_id;
|
uint board_id;
|
||||||
uint channel_id;
|
uint channel_id;
|
||||||
uint address;
|
uint address;
|
||||||
unsigned long long time;
|
unsigned long long time;
|
||||||
|
|
||||||
while (reader.read_row(board_id, channel_id, address, time)) {
|
while (reader.read_row(board_id, channel_id, address, time)) {
|
||||||
CsvRow row;
|
CsvRow row;
|
||||||
row.board_id = board_id;
|
row.board_id = board_id;
|
||||||
|
|
@ -408,63 +416,56 @@ std::vector<std::string> splitFile(const std::string& input_file, size_t chunk_s
|
||||||
row.time = time;
|
row.time = time;
|
||||||
|
|
||||||
// Estimate row size
|
// Estimate row size
|
||||||
currentSize += std::to_string(board_id).size() + std::to_string(channel_id).size() + std::to_string(address).size() + std::to_string(time).size() + 4; // +4 for commas
|
current_size += std::to_string(board_id).size() + std::to_string(channel_id).size() + std::to_string(address).size() + std::to_string(time).size() + 4;
|
||||||
|
if (current_size > chunk_size && !rows.empty()) {
|
||||||
if (currentSize > chunk_size && !rows.empty()) {
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
rows.push_back(row);
|
rows.push_back(row);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rows.empty())
|
if (rows.empty())
|
||||||
break;
|
break;
|
||||||
|
|
||||||
std::sort(rows.begin(), rows.end(), [](const CsvRow& a, const CsvRow& b) {
|
std::sort(rows.begin(), rows.end(), [](const CsvRow& a, const CsvRow& b) {
|
||||||
return a.time < b.time;
|
return a.time < b.time;
|
||||||
});
|
});
|
||||||
|
std::string chunk_file = input_file + ".chunk" + std::to_string(chunk_index);
|
||||||
std::string chunkFile = input_file + ".chunk" + std::to_string(chunkIndex);
|
std::ofstream out_file(chunk_file);
|
||||||
std::ofstream outFile(chunkFile);
|
|
||||||
for (const auto& row : rows) {
|
for (const auto& row : rows) {
|
||||||
outFile << row.board_id << "," << row.channel_id << "," << row.address << "," << row.time << "\n";
|
out_file << row.board_id << "," << row.channel_id << "," << row.address << "," << row.time << "\n";
|
||||||
}
|
}
|
||||||
outFile.close();
|
out_file.close();
|
||||||
|
chunks.push_back(chunk_file);
|
||||||
chunks.push_back(chunkFile);
|
chunk_index++;
|
||||||
chunkIndex++;
|
|
||||||
}
|
}
|
||||||
} catch (const std::exception& e) {
|
} catch (const std::exception& e) {
|
||||||
throw(e);
|
throw(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
return chunks;
|
return chunks;
|
||||||
}
|
}
|
||||||
|
|
||||||
void mergeChunks(const std::vector<std::string>& chunks, const std::string& output_file)
|
void mergeChunks(const std::vector<std::string>& chunks, const std::string& output_file)
|
||||||
{
|
{
|
||||||
std::vector<std::unique_ptr<io::CSVReader<4>>> chunkReaders;
|
std::vector<std::unique_ptr<io::CSVReader<4>>> chunk_readers;
|
||||||
std::priority_queue<CsvRow> minHeap;
|
std::priority_queue<CsvRow> min_heap;
|
||||||
|
|
||||||
for (const auto& chunk : chunks) {
|
for (const auto& chunk : chunks) {
|
||||||
auto reader = std::make_unique<io::CSVReader<4>>(chunk);
|
auto reader = std::make_unique<io::CSVReader<4>>(chunk);
|
||||||
chunkReaders.push_back(std::move(reader));
|
chunk_readers.push_back(std::move(reader));
|
||||||
}
|
}
|
||||||
|
|
||||||
for (size_t i = 0; i < chunkReaders.size(); i++) {
|
for (size_t i = 0; i < chunk_readers.size(); i++) {
|
||||||
uint board_id;
|
uint board_id;
|
||||||
uint channel_id;
|
uint channel_id;
|
||||||
uint address;
|
uint address;
|
||||||
unsigned long long time;
|
unsigned long long time;
|
||||||
|
|
||||||
if (chunkReaders[i]->read_row(board_id, channel_id, address, time)) {
|
if (chunk_readers[i]->read_row(board_id, channel_id, address, time)) {
|
||||||
CsvRow row;
|
CsvRow row;
|
||||||
row.board_id = board_id;
|
row.board_id = board_id;
|
||||||
row.channel_id = channel_id;
|
row.channel_id = channel_id;
|
||||||
row.address = address;
|
row.address = address;
|
||||||
row.time = time;
|
row.time = time;
|
||||||
row.chunk_index = i;
|
row.chunk_index = i;
|
||||||
minHeap.push(row);
|
min_heap.push(row);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -475,35 +476,33 @@ void mergeChunks(const std::vector<std::string>& chunks, const std::string& outp
|
||||||
std::ofstream outFile(output_file);
|
std::ofstream outFile(output_file);
|
||||||
outFile << board_id_str << "," << channel_id_str << "," << address_str << "," << time_str << "\n";
|
outFile << board_id_str << "," << channel_id_str << "," << address_str << "," << time_str << "\n";
|
||||||
|
|
||||||
while (!minHeap.empty()) {
|
while (!min_heap.empty()) {
|
||||||
CsvRow current = minHeap.top();
|
CsvRow current = min_heap.top();
|
||||||
minHeap.pop();
|
min_heap.pop();
|
||||||
|
|
||||||
outFile << current.board_id << "," << current.channel_id << "," << current.address << "," << current.time << "\n";
|
outFile << current.board_id << "," << current.channel_id << "," << current.address << "," << current.time << "\n";
|
||||||
|
|
||||||
size_t chunk_index = current.chunk_index;
|
size_t chunk_index = current.chunk_index;
|
||||||
if (chunkReaders[chunk_index]) {
|
if (chunk_readers[chunk_index]) {
|
||||||
uint board_id;
|
uint board_id;
|
||||||
uint channel_id;
|
uint channel_id;
|
||||||
uint address;
|
uint address;
|
||||||
unsigned long long time;
|
unsigned long long time;
|
||||||
|
|
||||||
if (chunkReaders[chunk_index]->read_row(board_id, channel_id, address, time)) {
|
if (chunk_readers[chunk_index]->read_row(board_id, channel_id, address, time)) {
|
||||||
CsvRow row;
|
CsvRow row;
|
||||||
row.board_id = board_id;
|
row.board_id = board_id;
|
||||||
row.channel_id = channel_id;
|
row.channel_id = channel_id;
|
||||||
row.address = address;
|
row.address = address;
|
||||||
row.time = time;
|
row.time = time;
|
||||||
row.chunk_index = chunk_index;
|
row.chunk_index = chunk_index;
|
||||||
minHeap.push(row);
|
min_heap.push(row);
|
||||||
} else {
|
} else {
|
||||||
chunkReaders[chunk_index].reset();
|
chunk_readers[chunk_index].reset();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
outFile.close();
|
outFile.close();
|
||||||
|
|
||||||
for (const auto& chunk : chunks) {
|
for (const auto& chunk : chunks) {
|
||||||
std::remove(chunk.c_str());
|
std::remove(chunk.c_str());
|
||||||
}
|
}
|
||||||
|
|
@ -517,7 +516,7 @@ bool ParticleDataSortTask::processEveryChannelParticleData()
|
||||||
sorted_result_output_dir.mkpath(sorted_result_dir);
|
sorted_result_output_dir.mkpath(sorted_result_dir);
|
||||||
|
|
||||||
const QString& all_channel_particle_data_filename = GetAllChannelParticleDataFilename();
|
const QString& all_channel_particle_data_filename = GetAllChannelParticleDataFilename();
|
||||||
QString sorted_output_filename = sorted_result_output_dir.filePath(QStringLiteral(u"粒子数据[已排序].csv"));
|
QString sorted_output_filename = sorted_result_output_dir.filePath(QStringLiteral(u"粒子数据.csv"));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const size_t CHUNK_SIZE = 100 * 1024 * 1024; // 100MB chunks
|
const size_t CHUNK_SIZE = 100 * 1024 * 1024; // 100MB chunks
|
||||||
|
|
@ -538,24 +537,61 @@ bool ParticleDataSortTask::processEveryChannelParticleData()
|
||||||
|
|
||||||
} catch (const std::exception& e) {
|
} catch (const std::exception& e) {
|
||||||
const QString& e_what = QString::fromLatin1(e.what());
|
const QString& e_what = QString::fromLatin1(e.what());
|
||||||
QString error = QString(QStringLiteral(u"处理%1异常:%2")).arg(all_channel_particle_data_filename).arg(QString::fromStdString(e.what()));
|
QString error = QString(QStringLiteral(u"处理%1异常:%2")).arg(all_channel_particle_data_filename).arg(e_what);
|
||||||
LOG_ERROR(error)
|
LOG_ERROR(error);
|
||||||
ret_ok = false;
|
ret_ok = false;
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
QString error = QString(QStringLiteral(u"处理%1未知异常.")).arg(all_channel_particle_data_filename);
|
QString error = QString(QStringLiteral(u"处理%1未知异常.")).arg(all_channel_particle_data_filename);
|
||||||
LOG_ERROR(error)
|
LOG_ERROR(error);
|
||||||
ret_ok = false;
|
ret_ok = false;
|
||||||
}
|
}
|
||||||
|
this->updateTaskResultData(QVariant(sorted_output_filename));
|
||||||
|
return ret_ok;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool ParticleDataSortByMinimysTask::processEveryChannelParticleData()
|
||||||
|
{
|
||||||
|
bool ret_ok = true;
|
||||||
|
const QString& sorted_result_dir = GetSortedResultDir();
|
||||||
|
QDir sorted_result_output_dir(sorted_result_dir);
|
||||||
|
sorted_result_output_dir.mkpath(sorted_result_dir);
|
||||||
|
|
||||||
|
const QString& data_filename = GetAllChannelParticleDataFilename();
|
||||||
|
QString output_filename = sorted_result_output_dir.filePath(QStringLiteral(u"粒子数据.csv"));
|
||||||
|
QString minimsys = QDir(qApp->applicationDirPath()).filePath(QString("minimsys"));
|
||||||
|
QString bash = QDir(minimsys).filePath(QString("bash"));
|
||||||
|
QString head = QDir(minimsys).filePath(QString("head"));
|
||||||
|
QString tail = QDir(minimsys).filePath(QString("tail"));
|
||||||
|
QString sort = QDir(minimsys).filePath(QString("sort"));
|
||||||
|
QString cmd = QString("(%1 -n 1 %4 && %2 -n +2 %4 | %3 -t ',' -k4 -n --parallel=8 -S 4G) > %5").arg(head).arg(tail).arg(sort).arg(data_filename).arg(output_filename);
|
||||||
|
QProcess proc;
|
||||||
|
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
|
||||||
|
env.clear();
|
||||||
|
env.insert("PATH", minimsys);
|
||||||
|
proc.setProcessEnvironment(env);
|
||||||
|
proc.setWorkingDirectory(minimsys);
|
||||||
|
proc.start(bash, { "-c", cmd });
|
||||||
|
proc.waitForFinished(-1);
|
||||||
|
if (proc.exitCode() != 0) {
|
||||||
|
QString process_error = QString(proc.readAllStandardError());
|
||||||
|
QString error = QStringLiteral(u"处理%1异常:%2").arg(data_filename).arg(process_error);
|
||||||
|
LOG_ERROR(error);
|
||||||
|
ret_ok = false;
|
||||||
|
}
|
||||||
|
this->updateTaskResultData(QVariant(output_filename));
|
||||||
|
return ret_ok;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CoincidenceEventAnalysisTask::processTask()
|
||||||
|
{
|
||||||
const QString& project_name = GetProjectName();
|
const QString& project_name = GetProjectName();
|
||||||
MeasureAnalysisProjectModel* project_model = ProjectList::Instance()->GetProjectModel(project_name);
|
MeasureAnalysisProjectModel* project_model = ProjectList::Instance()->GetProjectModel(project_name);
|
||||||
if (project_model == nullptr) {
|
if (project_model == nullptr) {
|
||||||
ret_ok = false;
|
return false;
|
||||||
} else {
|
|
||||||
project_model->SetSortedParticleDataFilename(sorted_output_filename);
|
|
||||||
}
|
}
|
||||||
|
const QString& info = QStringLiteral(u"粒子符合事件数据处理完成.");
|
||||||
return ret_ok;
|
LOG_INFO(info);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AutoFindPeaksTask::SetAnalysisType(AnalysisType analysis_type)
|
void AutoFindPeaksTask::SetAnalysisType(AnalysisType analysis_type)
|
||||||
|
|
@ -639,7 +675,7 @@ bool AutoFindPeaksTask::processTask()
|
||||||
const QString& error = QStringLiteral(u"%1自动寻峰异常!").arg(ch_count_data_name);
|
const QString& error = QStringLiteral(u"%1自动寻峰异常!").arg(ch_count_data_name);
|
||||||
LOG_WARN(error);
|
LOG_WARN(error);
|
||||||
}
|
}
|
||||||
const QString& info = QStringLiteral(u"%1自动寻峰完成").arg(ch_count_data_name);
|
const QString& info = QStringLiteral(u"%1自动寻峰完成.").arg(ch_count_data_name);
|
||||||
LOG_INFO(info);
|
LOG_INFO(info);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -651,13 +687,12 @@ bool AutoFindPeaksTask::processTask()
|
||||||
} else {
|
} else {
|
||||||
project_model->SetAnalysisCustomData(this->_analysis_type, QString("AutoFindPeaksResult"), result_filename);
|
project_model->SetAnalysisCustomData(this->_analysis_type, QString("AutoFindPeaksResult"), result_filename);
|
||||||
}
|
}
|
||||||
const QString& info = QStringLiteral(u"自动寻峰完成");
|
const QString& info = QStringLiteral(u"自动寻峰完成.");
|
||||||
LOG_INFO(info);
|
LOG_INFO(info);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChannelEnergyScaleFittingTask::SetData(
|
void ChannelEnergyScaleFittingTask::SetData(const FitDataMap& channel_energy_scale_fit_data_map, const QMap<QString, int>& fit_degree_map)
|
||||||
const FitDataMap& channel_energy_scale_fit_data_map, const QMap<QString, int>& fit_degree_map)
|
|
||||||
{
|
{
|
||||||
this->_channel_energy_scale_fit_data_map = channel_energy_scale_fit_data_map;
|
this->_channel_energy_scale_fit_data_map = channel_energy_scale_fit_data_map;
|
||||||
this->_fit_degree_map = fit_degree_map;
|
this->_fit_degree_map = fit_degree_map;
|
||||||
|
|
@ -742,3 +777,149 @@ bool ChannelEnergyScaleFittingTask::processTask()
|
||||||
LOG_INFO(info);
|
LOG_INFO(info);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool EnergyScaleParticleDataTask::processTask()
|
||||||
|
{
|
||||||
|
const QString& project_name = GetProjectName();
|
||||||
|
MeasureAnalysisProjectModel* project_model = ProjectList::Instance()->GetProjectModel(project_name);
|
||||||
|
if (project_model == nullptr) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
EnergyScaleDataModel energy_scale_data_model(project_model->GetEnergyScaleFilename());
|
||||||
|
if (!energy_scale_data_model.LoadData()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!energy_scale_data_model.IsValid()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
const QString& all_channel_particle_data_filename = project_model->GetAllChannelParticleDataFilename();
|
||||||
|
if (all_channel_particle_data_filename.isEmpty()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
const QString& energy_spectrum_filename = QDir(project_model->GetProjectDir()).filePath(QStringLiteral(u"能谱数据.csv"));
|
||||||
|
std::string board_id_str = QString(QStringLiteral(u"板卡号")).toStdString();
|
||||||
|
std::string channel_id_str = QString(QStringLiteral(u"通道号")).toStdString();
|
||||||
|
std::string address_str = QString(QStringLiteral(u"道址")).toStdString();
|
||||||
|
std::string energy_str = QString(QStringLiteral(u"能量(KeV)")).toStdString();
|
||||||
|
std::string time_str = QString(QStringLiteral(u"时间计数")).toStdString();
|
||||||
|
std::ofstream out(QStrToSysPath(energy_spectrum_filename));
|
||||||
|
out << board_id_str << "," << channel_id_str << "," << energy_str << "," << time_str<< "\n" ;
|
||||||
|
try {
|
||||||
|
io::CSVReader<
|
||||||
|
4,
|
||||||
|
io::trim_chars<' ', '\t'>,
|
||||||
|
io::double_quote_escape<',', '"'>,
|
||||||
|
io::throw_on_overflow,
|
||||||
|
io::empty_line_comment>
|
||||||
|
reader(QStrToSysPath(all_channel_particle_data_filename));
|
||||||
|
reader.read_header(io::ignore_extra_column, board_id_str, channel_id_str, address_str, time_str);
|
||||||
|
uint board_id;
|
||||||
|
uint channel_id;
|
||||||
|
uint address;
|
||||||
|
unsigned long long time;
|
||||||
|
while (reader.read_row(board_id, channel_id, address, time)) {
|
||||||
|
int channel_num = (board_id) * 4 + (channel_id + 1);
|
||||||
|
const QString& channel_name = QStringLiteral(u"通道%1").arg(channel_num);
|
||||||
|
auto coeffs = energy_scale_data_model.GetEnergyFitResultCoeffs(channel_name);
|
||||||
|
if (!coeffs.empty()) {
|
||||||
|
double energy = GaussPolyCoe::Predict(coeffs, address);
|
||||||
|
out << board_id << "," << channel_id << "," << energy << "," << time << "\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
out.close();
|
||||||
|
} catch (const std::exception& e) {
|
||||||
|
out.close();
|
||||||
|
std::remove(QStrToSysPath(energy_spectrum_filename));
|
||||||
|
const QString& e_what = QString::fromStdString(e.what());
|
||||||
|
LOG_WARN(QStringLiteral(u"能谱数据异常:%1").arg(e_what));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
const QString& info = QStringLiteral(u"能谱数据处理完成.");
|
||||||
|
LOG_INFO(info);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool EnergyCountProcessTask::processTask()
|
||||||
|
{
|
||||||
|
const QString& project_name = GetProjectName();
|
||||||
|
MeasureAnalysisProjectModel* project_model = ProjectList::Instance()->GetProjectModel(project_name);
|
||||||
|
if (project_model == nullptr) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
EnergyScaleDataModel energy_scale_data_model(project_model->GetEnergyScaleFilename());
|
||||||
|
if (!energy_scale_data_model.LoadData()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!energy_scale_data_model.IsValid()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
const QMap<uint, QString>& ch_addr_count_filename_list = project_model->GetChannelAddressCountDataFilenameList();
|
||||||
|
if (ch_addr_count_filename_list.isEmpty()) {
|
||||||
|
LOG_WARN(QStringLiteral(u"能量计数统计需要的通道道址计数文件异常!"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
const QString& out_path = QDir(project_model->GetProjectDir()).filePath(QStringLiteral(u"能量计数"));
|
||||||
|
if ( !QDir(out_path).mkpath(out_path) ) {
|
||||||
|
LOG_WARN(QStringLiteral(u"创建能量计数数据目录\"%1\"异常!").arg(out_path));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
for (const uint& channel_num : ch_addr_count_filename_list.keys()) {
|
||||||
|
const QString& channel_name = QStringLiteral(u"通道%1").arg(channel_num);
|
||||||
|
const QString& data_filename = ch_addr_count_filename_list[channel_num];
|
||||||
|
std::string address_str = QString(QStringLiteral(u"道址")).toStdString();
|
||||||
|
std::string energy_str = QString(QStringLiteral(u"能量(KeV)")).toStdString();
|
||||||
|
std::string count_str = QString(QStringLiteral(u"计数")).toStdString();
|
||||||
|
const QString& out_filename = QDir(out_path).filePath(channel_name + ".csv");
|
||||||
|
std::ofstream out(QStrToSysPath(out_filename));
|
||||||
|
out << energy_str << "," << count_str << "\n" ;
|
||||||
|
try {
|
||||||
|
io::CSVReader<
|
||||||
|
2,
|
||||||
|
io::trim_chars<' ', '\t'>,
|
||||||
|
io::double_quote_escape<',', '"'>,
|
||||||
|
io::throw_on_overflow,
|
||||||
|
io::empty_line_comment>
|
||||||
|
reader(QStrToSysPath(data_filename));
|
||||||
|
reader.read_header(io::ignore_extra_column, address_str, count_str);
|
||||||
|
uint address;
|
||||||
|
unsigned long long count;
|
||||||
|
while (reader.read_row(address, count)) {
|
||||||
|
auto coeffs = energy_scale_data_model.GetEnergyFitResultCoeffs(channel_name);
|
||||||
|
if (!coeffs.empty()) {
|
||||||
|
double energy = GaussPolyCoe::Predict(coeffs, address);
|
||||||
|
out << energy << "," << count << "\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
out.close();
|
||||||
|
project_model->SetChannelEnergyCountDataFilename(channel_num, out_filename);
|
||||||
|
} catch (const std::exception& e) {
|
||||||
|
out.close();
|
||||||
|
std::remove(QStrToSysPath(out_filename));
|
||||||
|
const QString& e_what = QString::fromStdString(e.what());
|
||||||
|
LOG_WARN(QStringLiteral(u"%1能量计数异常:%2").arg(channel_name).arg(e_what));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const QString& info = QStringLiteral(u"能量计数处理完成.");
|
||||||
|
LOG_INFO(info);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool EnergyScaleCoincidenceEventDataTask::processTask()
|
||||||
|
{
|
||||||
|
const QString& project_name = GetProjectName();
|
||||||
|
MeasureAnalysisProjectModel* project_model = ProjectList::Instance()->GetProjectModel(project_name);
|
||||||
|
if (project_model == nullptr) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
EnergyScaleDataModel energy_scale_data_model(project_model->GetEnergyScaleFilename());
|
||||||
|
if (!energy_scale_data_model.LoadData()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!energy_scale_data_model.IsValid()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
const QString& info = QStringLiteral(u"符合能谱数据处理完成.");
|
||||||
|
LOG_INFO(info);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,9 @@
|
||||||
#include <QMap>
|
#include <QMap>
|
||||||
#include <QVariant>
|
#include <QVariant>
|
||||||
|
|
||||||
|
class EnergyScaleDataModel;
|
||||||
|
class MeasureAnalysisProjectModel;
|
||||||
|
|
||||||
namespace DataProcessWorkPool
|
namespace DataProcessWorkPool
|
||||||
{
|
{
|
||||||
class DataProcessTask : public QRunnable
|
class DataProcessTask : public QRunnable
|
||||||
|
|
@ -23,6 +26,9 @@ namespace DataProcessWorkPool
|
||||||
|
|
||||||
virtual void run() override final;
|
virtual void run() override final;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void updateTaskResultData(const QVariant& task_result_data);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
virtual bool processTask() = 0;
|
virtual bool processTask() = 0;
|
||||||
|
|
||||||
|
|
@ -30,6 +36,7 @@ namespace DataProcessWorkPool
|
||||||
QObject* _finished_notifier { nullptr };
|
QObject* _finished_notifier { nullptr };
|
||||||
const char* _finished_notifier_process { nullptr };
|
const char* _finished_notifier_process { nullptr };
|
||||||
QString _project_name;
|
QString _project_name;
|
||||||
|
QVariant _task_result_data;
|
||||||
};
|
};
|
||||||
|
|
||||||
class ParticleDataTask : public DataProcessTask
|
class ParticleDataTask : public DataProcessTask
|
||||||
|
|
@ -90,6 +97,17 @@ namespace DataProcessWorkPool
|
||||||
QString _sorted_result_dir;
|
QString _sorted_result_dir;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class ParticleDataSortByMinimysTask : public ParticleDataSortTask
|
||||||
|
{
|
||||||
|
virtual bool processEveryChannelParticleData() override;
|
||||||
|
};
|
||||||
|
|
||||||
|
class CoincidenceEventAnalysisTask : public DataProcessTask
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
virtual bool processTask() override;
|
||||||
|
};
|
||||||
|
|
||||||
class AutoFindPeaksTask : public DataProcessTask {
|
class AutoFindPeaksTask : public DataProcessTask {
|
||||||
public:
|
public:
|
||||||
void SetAnalysisType(AnalysisType analysis_type);
|
void SetAnalysisType(AnalysisType analysis_type);
|
||||||
|
|
@ -120,6 +138,24 @@ namespace DataProcessWorkPool
|
||||||
FitDataMap _channel_energy_scale_fit_data_map;
|
FitDataMap _channel_energy_scale_fit_data_map;
|
||||||
QMap<QString, int> _fit_degree_map;
|
QMap<QString, int> _fit_degree_map;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class EnergyScaleParticleDataTask : public DataProcessTask
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
virtual bool processTask() override;
|
||||||
|
};
|
||||||
|
|
||||||
|
class EnergyCountProcessTask : public DataProcessTask
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
virtual bool processTask() override;
|
||||||
|
};
|
||||||
|
|
||||||
|
class EnergyScaleCoincidenceEventDataTask : public DataProcessTask
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
virtual bool processTask() override;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // DATAPROCESSWORKPOOL_H
|
#endif // DATAPROCESSWORKPOOL_H
|
||||||
|
|
|
||||||
|
|
@ -62,6 +62,26 @@ bool EnergyScaleDataModel::IsValid()
|
||||||
return b_is_valid;
|
return b_is_valid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void EnergyScaleDataModel::SetName(const QString &name)
|
||||||
|
{
|
||||||
|
_energy_scale_data_map["Name"] = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString EnergyScaleDataModel::GetName()
|
||||||
|
{
|
||||||
|
return _energy_scale_data_map.value("Name", QString()).toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
void EnergyScaleDataModel::SetDescription(const QString &description)
|
||||||
|
{
|
||||||
|
_energy_scale_data_map["Description"] = description;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString EnergyScaleDataModel::GetDescription()
|
||||||
|
{
|
||||||
|
return _energy_scale_data_map.value("Description", QString()).toString();
|
||||||
|
}
|
||||||
|
|
||||||
void EnergyScaleDataModel::SetChannelEnergyScaleDataMap(const QString& channel_name, const QVariantMap& ch_energy_scale_data_map)
|
void EnergyScaleDataModel::SetChannelEnergyScaleDataMap(const QString& channel_name, const QVariantMap& ch_energy_scale_data_map)
|
||||||
{
|
{
|
||||||
if (!ch_energy_scale_data_map.isEmpty()) {
|
if (!ch_energy_scale_data_map.isEmpty()) {
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,12 @@ public:
|
||||||
bool SaveData();
|
bool SaveData();
|
||||||
bool IsValid();
|
bool IsValid();
|
||||||
|
|
||||||
|
void SetName(const QString& name);
|
||||||
|
QString GetName();
|
||||||
|
|
||||||
|
void SetDescription(const QString& description);
|
||||||
|
QString GetDescription();
|
||||||
|
|
||||||
void SetChannelEnergyScaleDataMap(const QString& channel_name, const QVariantMap& ch_energy_scale_data_map);
|
void SetChannelEnergyScaleDataMap(const QString& channel_name, const QVariantMap& ch_energy_scale_data_map);
|
||||||
QVariantMap GetChannelEnergyScaleDataMap(const QString& channel_name);
|
QVariantMap GetChannelEnergyScaleDataMap(const QString& channel_name);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -151,32 +151,18 @@ void MainWindow::initAction()
|
||||||
{
|
{
|
||||||
auto new_measurement_analysis_handler = [this]() {
|
auto new_measurement_analysis_handler = [this]() {
|
||||||
NewMeasureAnalysisDlg new_measure_analysis_dlg;
|
NewMeasureAnalysisDlg new_measure_analysis_dlg;
|
||||||
// new_measure_analysis_dlg.exec();
|
|
||||||
if (QDialog::Accepted == new_measure_analysis_dlg.exec()) {
|
if (QDialog::Accepted == new_measure_analysis_dlg.exec()) {
|
||||||
ProjectList* project_list_model = ProjectList::Instance();
|
ProjectList* project_list_model = ProjectList::Instance();
|
||||||
auto project_model = project_list_model->GetCurrentProjectModel();
|
auto project_model = project_list_model->GetCurrentProjectModel();
|
||||||
if (project_model->GetIsMeasureComplete()) {
|
const QString& all_channel_particle_data_filename = project_model->GetAllChannelParticleDataFilename();
|
||||||
const QString& project_name = project_model->GetProjectName();
|
if (!all_channel_particle_data_filename.isEmpty()) {
|
||||||
|
|
||||||
// const QString& result_data_dir = QDir(project_model->GetProjectDir()).filePath("EveryChannelParticleData");
|
|
||||||
// auto separate_task = new DataProcessWorkPool::EveryChannelParticleDataSeparateTask;
|
|
||||||
// separate_task->SetAllChannelParticleDataFilename(project_model->GetAllChannelParticleDataFilename());
|
|
||||||
// separate_task->SetResultDataDir(result_data_dir);
|
|
||||||
// separate_task->SetFinishedNotifier(this->_tree_measure_analysis, "onFinishedSeparateEveryChannelParticleData", project_name);
|
|
||||||
// separate_task->StartTask();
|
|
||||||
|
|
||||||
// auto separate_task = new DataProcessWorkPool::ParticleDataSortTask;
|
|
||||||
// separate_task->SetAllChannelParticleDataFilename(project_model->GetAllChannelParticleDataFilename());
|
|
||||||
// separate_task->SetSortedResultDir(project_model->GetProjectDir());
|
|
||||||
// separate_task->StartTask();
|
|
||||||
|
|
||||||
const QString& all_ch_count_dir = project_model->GetProjectDir();
|
const QString& all_ch_count_dir = project_model->GetProjectDir();
|
||||||
const QString& every_ch_count_dir = QDir(project_model->GetProjectDir()).filePath(QStringLiteral(u"通道道址计数"));
|
const QString& every_ch_count_dir = QDir(project_model->GetProjectDir()).filePath(QStringLiteral(u"通道道址计数"));
|
||||||
auto count_task = new DataProcessWorkPool::EveryChannelParticleCountDataTask;
|
auto count_task = new DataProcessWorkPool::EveryChannelParticleCountDataTask;
|
||||||
count_task->SetAllChannelParticleDataFilename(project_model->GetAllChannelParticleDataFilename());
|
count_task->SetAllChannelParticleDataFilename(all_channel_particle_data_filename);
|
||||||
count_task->SetAllChannelCountResultDir(all_ch_count_dir);
|
count_task->SetAllChannelCountResultDir(all_ch_count_dir);
|
||||||
count_task->SetEveryChannelCountResultDir(every_ch_count_dir);
|
count_task->SetEveryChannelCountResultDir(every_ch_count_dir);
|
||||||
count_task->SetFinishedNotifier(project_list_model, "onChannelAddressCountProcessFinished", project_name);
|
count_task->SetFinishedNotifier(project_list_model, "onChannelAddressCountProcessFinished", project_model->GetProjectName());
|
||||||
count_task->StartTask();
|
count_task->StartTask();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -189,7 +175,7 @@ void MainWindow::initAction()
|
||||||
}
|
}
|
||||||
QFileInfo file_info(filename);
|
QFileInfo file_info(filename);
|
||||||
if (file_info.size() == 0) {
|
if (file_info.size() == 0) {
|
||||||
QMessageBox::warning(this, QStringLiteral(u"警告"), QStringLiteral(u"选择的测量分析项目文件为空文件!"));
|
QMessageBox::warning(this, QStringLiteral(u"警告"), QStringLiteral(u"选择的测量分析项目文件为空文件!"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
MeasureAnalysisProjectModel* model = new MeasureAnalysisProjectModel;
|
MeasureAnalysisProjectModel* model = new MeasureAnalysisProjectModel;
|
||||||
|
|
@ -206,7 +192,7 @@ void MainWindow::initAction()
|
||||||
const QString& info_text = QStringLiteral(u"保存测量分析项目\"%1\"完成.").arg(project_name);
|
const QString& info_text = QStringLiteral(u"保存测量分析项目\"%1\"完成.").arg(project_name);
|
||||||
LOG_INFO(info_text);
|
LOG_INFO(info_text);
|
||||||
} else {
|
} else {
|
||||||
const QString& warn_text = QStringLiteral(u"保存测量分析项目\"%1\"失败!").arg(project_name);
|
const QString& warn_text = QStringLiteral(u"保存测量分析项目\"%1\"失败!").arg(project_name);
|
||||||
LOG_WARN(warn_text);
|
LOG_WARN(warn_text);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -257,10 +243,13 @@ void MainWindow::initAction()
|
||||||
for (auto it = dock_widget_list.constBegin(); it != dock_widget_list.constEnd(); ++it) {
|
for (auto it = dock_widget_list.constBegin(); it != dock_widget_list.constEnd(); ++it) {
|
||||||
CDockWidget* dock_widget = *it;
|
CDockWidget* dock_widget = *it;
|
||||||
if (dock_widget) {
|
if (dock_widget) {
|
||||||
if ( dock_widget->widget() == view ) {
|
MeasureAnalysisView* dock_view = dynamic_cast<MeasureAnalysisView*>(dock_widget->widget());
|
||||||
dock_widget->toggleView();
|
if ( dock_view ) {
|
||||||
dock_widget->raise();
|
if (dock_view->GetViewName() == view->GetViewName()) {
|
||||||
view_exist = true;
|
dock_widget->toggleView();
|
||||||
|
dock_widget->raise();
|
||||||
|
view_exist = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -269,7 +258,17 @@ void MainWindow::initAction()
|
||||||
dock_widget->setWidget(view);
|
dock_widget->setWidget(view);
|
||||||
dock_widget->setMinimumSizeHintMode(ads::CDockWidget::MinimumSizeHintFromDockWidget);
|
dock_widget->setMinimumSizeHintMode(ads::CDockWidget::MinimumSizeHintFromDockWidget);
|
||||||
if (view->IsDeleteOnClose()) {
|
if (view->IsDeleteOnClose()) {
|
||||||
dock_widget->setFeatures(dock_widget->features() | ads::CDockWidget::DockWidgetDeleteOnClose);
|
// dock_widget->setFeatures(dock_widget->features() | ads::CDockWidget::DockWidgetDeleteOnClose);
|
||||||
|
dock_widget->setFeatures(dock_widget->features() | ads::CDockWidget::CustomCloseHandling);
|
||||||
|
connect(dock_widget, &CDockWidget::closeRequested, [this, dock_widget, view](){
|
||||||
|
MeasureAnalysisView* dock_view = dynamic_cast<MeasureAnalysisView*>(dock_widget->widget());
|
||||||
|
if ( dock_view ) {
|
||||||
|
const QString& view_name = view->GetViewName();
|
||||||
|
if (dock_view->GetViewName() == view_name) {
|
||||||
|
_tree_measure_analysis->RemoveItemView(view_name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
if ( view->GetViewType() == MeasureAnalysisView::DataTable ) {
|
if ( view->GetViewType() == MeasureAnalysisView::DataTable ) {
|
||||||
_menu_view_data_table_list->addAction(dock_widget->toggleViewAction());
|
_menu_view_data_table_list->addAction(dock_widget->toggleViewAction());
|
||||||
|
|
|
||||||
|
|
@ -318,9 +318,13 @@ void BatchEnergyScaleDialog::onFitBtnClickedProcess()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void BatchEnergyScaleDialog::onEnergyScaleFitFinished(const QString &project_name)
|
void BatchEnergyScaleDialog::onEnergyScaleFitFinished(bool ok, const QString &project_name, const QVariant& data)
|
||||||
{
|
{
|
||||||
Q_UNUSED(project_name);
|
Q_UNUSED(project_name);
|
||||||
|
Q_UNUSED(data);
|
||||||
|
if ( !ok )
|
||||||
|
return;
|
||||||
|
|
||||||
QDir result_dir(this->_workspace);
|
QDir result_dir(this->_workspace);
|
||||||
const QString& result_filename = result_dir.filePath(QStringLiteral(u"多通道能量刻度拟合结果.json"));
|
const QString& result_filename = result_dir.filePath(QStringLiteral(u"多通道能量刻度拟合结果.json"));
|
||||||
EnergyScaleDataModel result_model(result_filename);
|
EnergyScaleDataModel result_model(result_filename);
|
||||||
|
|
@ -343,12 +347,21 @@ void BatchEnergyScaleDialog::applyEnergyScaleFitResultData()
|
||||||
}
|
}
|
||||||
QDir project_dir(project_model->GetProjectDir());
|
QDir project_dir(project_model->GetProjectDir());
|
||||||
const QString& energy_scale_data_filename = project_dir.filePath(QStringLiteral(u"能量刻度.json"));
|
const QString& energy_scale_data_filename = project_dir.filePath(QStringLiteral(u"能量刻度.json"));
|
||||||
|
if ( QFileInfo(energy_scale_data_filename).exists() ) {
|
||||||
|
if ( !QFile::remove(energy_scale_data_filename) ) {
|
||||||
|
LOG_WARN(QStringLiteral(u"应用能量刻度异常,无法清除测量分析[%1]存在的能量刻度数据!").arg(project_model->GetProjectName()));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
const QString& energy_scale_result_filename = this->_energy_scale_data_model->GetDataFilename();
|
const QString& energy_scale_result_filename = this->_energy_scale_data_model->GetDataFilename();
|
||||||
if (QFile::copy(energy_scale_result_filename, energy_scale_data_filename)) {
|
if (QFile::copy(energy_scale_result_filename, energy_scale_data_filename)) {
|
||||||
project_model->SetEnergyScaleFilename(energy_scale_data_filename);
|
project_model->SetEnergyScaleFilename(energy_scale_data_filename);
|
||||||
|
ProjectList::Instance()->ApplyEnergyScale(this->_project_name);
|
||||||
|
} else {
|
||||||
|
LOG_WARN(QStringLiteral(u"应用能量刻度异常,无法配置到测量分析[%1]!").arg(project_model->GetProjectName()));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
QMessageBox::warning(this, QStringLiteral(u"警告"), QStringLiteral(u"不能应用非完整的能量刻度!"));
|
QMessageBox::warning(this, QStringLiteral(u"警告"), QStringLiteral(u"不能应用非完整的能量刻度!"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ public slots:
|
||||||
void onSelectedScaleRange(double min, double max);
|
void onSelectedScaleRange(double min, double max);
|
||||||
void onFitBtnClickedProcess();
|
void onFitBtnClickedProcess();
|
||||||
private slots:
|
private slots:
|
||||||
void onEnergyScaleFitFinished(const QString& project_name);
|
void onEnergyScaleFitFinished(bool ok, const QString& project_name, const QVariant &data);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void insertSetEnergyValueToFilter(double energy);
|
void insertSetEnergyValueToFilter(double energy);
|
||||||
|
|
@ -37,7 +37,7 @@ private:
|
||||||
void energyScaleDataChanged(const QStringList& channel_name_list);
|
void energyScaleDataChanged(const QStringList& channel_name_list);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void applyEnergyScale();
|
void applyEnergyScale(const QString& project_name);
|
||||||
void close();
|
void close();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
|
||||||
|
|
@ -114,8 +114,20 @@ FindPeaksResultDialog::FindPeaksResultDialog(QWidget *parent)
|
||||||
connect(_peaks_result_table, &QTableWidget::currentItemChanged, [this](QTableWidgetItem* current, QTableWidgetItem* previous) {
|
connect(_peaks_result_table, &QTableWidget::currentItemChanged, [this](QTableWidgetItem* current, QTableWidgetItem* previous) {
|
||||||
bool is_watch_item_changed = _peaks_result_table->property("WatchItemChanged").toBool();
|
bool is_watch_item_changed = _peaks_result_table->property("WatchItemChanged").toBool();
|
||||||
if (is_watch_item_changed) {
|
if (is_watch_item_changed) {
|
||||||
emit peakInfoChanged(peakInfo(previous, false, false));
|
int previous_row = -1;
|
||||||
emit peakInfoChanged(peakInfo(current, true, true));
|
if (previous ) {
|
||||||
|
previous_row = previous->row();
|
||||||
|
}
|
||||||
|
int current_row = -1;
|
||||||
|
if (current) {
|
||||||
|
current_row = current->row();
|
||||||
|
}
|
||||||
|
if ((previous_row >= 0) && (previous_row != current_row) ) {
|
||||||
|
emit peakInfoChanged(peakInfo(previous, false, false));
|
||||||
|
}
|
||||||
|
if (current_row >= 0) {
|
||||||
|
emit peakInfoChanged(peakInfo(current, true, true));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -200,9 +212,9 @@ void FindPeaksResultDialog::UpdatePeakResult()
|
||||||
QPushButton* btn_remove_row = new QPushButton(QStringLiteral(u"删除"));
|
QPushButton* btn_remove_row = new QPushButton(QStringLiteral(u"删除"));
|
||||||
btn_remove_row->setMaximumWidth(35);
|
btn_remove_row->setMaximumWidth(35);
|
||||||
connect(btn_remove_row, &QPushButton::clicked, [this, item, btn_remove_row]() {
|
connect(btn_remove_row, &QPushButton::clicked, [this, item, btn_remove_row]() {
|
||||||
item->setCheckState(Qt::Unchecked);
|
|
||||||
emit peakInfoChanged(peakInfo(item, false, false));
|
|
||||||
int remove_row = item->row();
|
int remove_row = item->row();
|
||||||
|
this->_peaks_result_table->item(remove_row, 0)->setCheckState(Qt::Unchecked);
|
||||||
|
emit peakInfoChanged(peakInfo(item, false, false));
|
||||||
this->_peaks_result_table->removeRow(remove_row);
|
this->_peaks_result_table->removeRow(remove_row);
|
||||||
btn_remove_row->deleteLater();
|
btn_remove_row->deleteLater();
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -192,7 +192,6 @@ void MeasureAnalysisParticleCountPlotView::setupEnergyScaleDlg()
|
||||||
connect(_data_selector, &CustomQwtPlotXaxisSelector::selectionFinished, _batch_energy_scale_dlg, &BatchEnergyScaleDialog::onSelectedScaleRange);
|
connect(_data_selector, &CustomQwtPlotXaxisSelector::selectionFinished, _batch_energy_scale_dlg, &BatchEnergyScaleDialog::onSelectedScaleRange);
|
||||||
connect(_batch_energy_scale_dlg, &BatchEnergyScaleDialog::close, [this](){
|
connect(_batch_energy_scale_dlg, &BatchEnergyScaleDialog::close, [this](){
|
||||||
this->_data_selector->setEnabled(false);
|
this->_data_selector->setEnabled(false);
|
||||||
disconnect(_data_selector, &CustomQwtPlotXaxisSelector::selectionFinished, _batch_energy_scale_dlg, &BatchEnergyScaleDialog::onSelectedScaleRange);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -212,8 +211,8 @@ void MeasureAnalysisParticleCountPlotView::loadDataFromFile(const QString& data_
|
||||||
reader.read_header(io::ignore_extra_column, address_str, count_str);
|
reader.read_header(io::ignore_extra_column, address_str, count_str);
|
||||||
|
|
||||||
int address;
|
int address;
|
||||||
int particle_count;
|
unsigned long long particle_count;
|
||||||
QVector<float> x, y;
|
QVector<double> x, y;
|
||||||
|
|
||||||
while (reader.read_row(address, particle_count)) {
|
while (reader.read_row(address, particle_count)) {
|
||||||
x.push_back(address);
|
x.push_back(address);
|
||||||
|
|
@ -280,9 +279,13 @@ void MeasureAnalysisParticleCountPlotView::updatePlotPeakInfo(const QVariantMap
|
||||||
this->_plot->replot();
|
this->_plot->replot();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MeasureAnalysisParticleCountPlotView::onAutoFindPeaksFinished(const QString& project_name)
|
void MeasureAnalysisParticleCountPlotView::onAutoFindPeaksFinished(bool ok, const QString &project_name, const QVariant& data)
|
||||||
{
|
{
|
||||||
Q_UNUSED(project_name);
|
Q_UNUSED(project_name);
|
||||||
|
Q_UNUSED(data);
|
||||||
|
if ( !ok )
|
||||||
|
return;
|
||||||
|
|
||||||
this->_plot->CleanMarkers();
|
this->_plot->CleanMarkers();
|
||||||
this->_plot->replot();
|
this->_plot->replot();
|
||||||
if (this->_find_peaks_result_dlg) {
|
if (this->_find_peaks_result_dlg) {
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ private:
|
||||||
void updatePlotPeakInfo(const QVariantMap& peak_infos);
|
void updatePlotPeakInfo(const QVariantMap& peak_infos);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void onAutoFindPeaksFinished(const QString& project_name);
|
void onAutoFindPeaksFinished(bool ok, const QString &project_name, const QVariant& data);
|
||||||
private slots:
|
private slots:
|
||||||
void onActionCurveShowSetting();
|
void onActionCurveShowSetting();
|
||||||
void onActionFindPeaksResult();
|
void onActionFindPeaksResult();
|
||||||
|
|
@ -44,6 +44,9 @@ private slots:
|
||||||
void onActionEnergyScale();
|
void onActionEnergyScale();
|
||||||
void onActionPlotConfigure();
|
void onActionPlotConfigure();
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void applyEnergyScale();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString _workspace;
|
QString _workspace;
|
||||||
CustomQwtPlot* _plot = nullptr;
|
CustomQwtPlot* _plot = nullptr;
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QJsonDocument>
|
#include <QJsonDocument>
|
||||||
#include <QJsonObject>
|
#include <QJsonObject>
|
||||||
|
#include "DataProcessWorkPool.h"
|
||||||
|
|
||||||
|
|
||||||
MeasureAnalysisProjectModel::~MeasureAnalysisProjectModel()
|
MeasureAnalysisProjectModel::~MeasureAnalysisProjectModel()
|
||||||
|
|
@ -72,11 +73,6 @@ void MeasureAnalysisProjectModel::SetAllChannelParticleDataFilename(const QStrin
|
||||||
this->_all_channel_particle_data_filename = filename;
|
this->_all_channel_particle_data_filename = filename;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MeasureAnalysisProjectModel::SetSortedParticleDataFilename(const QString& filename)
|
|
||||||
{
|
|
||||||
this->_sorted_particle_data_filename = filename;
|
|
||||||
}
|
|
||||||
|
|
||||||
// void MeasureAnalysisProjectModel::SetChannelParticleDataFilename(uint channel, const QString& filename)
|
// void MeasureAnalysisProjectModel::SetChannelParticleDataFilename(uint channel, const QString& filename)
|
||||||
// {
|
// {
|
||||||
// this->_channel_particle_data_filename_list[channel] = filename;
|
// this->_channel_particle_data_filename_list[channel] = filename;
|
||||||
|
|
@ -102,11 +98,21 @@ void MeasureAnalysisProjectModel::SetAllChannelEnergyTotalCountDataFilename(cons
|
||||||
this->_all_channel_energy_total_count_data_filename = filename;
|
this->_all_channel_energy_total_count_data_filename = filename;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MeasureAnalysisProjectModel::SetParticleEnergyDataFilename(const QString &filename)
|
||||||
|
{
|
||||||
|
this->_particle_energy_data_filename = filename;
|
||||||
|
}
|
||||||
|
|
||||||
void MeasureAnalysisProjectModel::SetTimeWinConformParticleData(uint time_win, uint conform_particle_count, const QString& filename)
|
void MeasureAnalysisProjectModel::SetTimeWinConformParticleData(uint time_win, uint conform_particle_count, const QString& filename)
|
||||||
{
|
{
|
||||||
this->_time_win_conform_particle_data[time_win][conform_particle_count] = filename;
|
this->_time_win_conform_particle_data[time_win][conform_particle_count] = filename;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MeasureAnalysisProjectModel::SetTimeWinConformEnergyData(uint time_win, uint conform_particle_count, const QString& filename)
|
||||||
|
{
|
||||||
|
this->_time_win_conform_energy_data[time_win][conform_particle_count] = filename;
|
||||||
|
}
|
||||||
|
|
||||||
void MeasureAnalysisProjectModel::SetAnalysisCustomData(AnalysisType analysis_type, const QString &data_item_name, const QString &data_filename)
|
void MeasureAnalysisProjectModel::SetAnalysisCustomData(AnalysisType analysis_type, const QString &data_item_name, const QString &data_filename)
|
||||||
{
|
{
|
||||||
this->_analysis_custom_data_set[analysis_type][data_item_name] = data_filename;
|
this->_analysis_custom_data_set[analysis_type][data_item_name] = data_filename;
|
||||||
|
|
@ -172,11 +178,6 @@ const QString& MeasureAnalysisProjectModel::GetAllChannelParticleDataFilename()
|
||||||
return this->_all_channel_particle_data_filename;
|
return this->_all_channel_particle_data_filename;
|
||||||
}
|
}
|
||||||
|
|
||||||
const QString& MeasureAnalysisProjectModel::GetSortAllChannelParticleDataFilename() const
|
|
||||||
{
|
|
||||||
return this->_sorted_particle_data_filename;
|
|
||||||
}
|
|
||||||
|
|
||||||
// const QMap<uint, QString>& MeasureAnalysisProjectModel::GetChannelParticleDataFilenameList() const
|
// const QMap<uint, QString>& MeasureAnalysisProjectModel::GetChannelParticleDataFilenameList() const
|
||||||
// {
|
// {
|
||||||
// return this->_channel_particle_data_filename_list;
|
// return this->_channel_particle_data_filename_list;
|
||||||
|
|
@ -225,6 +226,11 @@ const QString& MeasureAnalysisProjectModel::GetAllChannelEnergyTotalCountDataFil
|
||||||
return this->_all_channel_energy_total_count_data_filename;
|
return this->_all_channel_energy_total_count_data_filename;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const QString MeasureAnalysisProjectModel::GetParticleEnergyDataFilename() const
|
||||||
|
{
|
||||||
|
return this->_particle_energy_data_filename;
|
||||||
|
}
|
||||||
|
|
||||||
const QMap<uint, QString> MeasureAnalysisProjectModel::GetTimeWinConformParticleDataFilenameList(uint time_win) const
|
const QMap<uint, QString> MeasureAnalysisProjectModel::GetTimeWinConformParticleDataFilenameList(uint time_win) const
|
||||||
{
|
{
|
||||||
QMap<uint, QString> conform_particle_data;
|
QMap<uint, QString> conform_particle_data;
|
||||||
|
|
@ -234,6 +240,15 @@ const QMap<uint, QString> MeasureAnalysisProjectModel::GetTimeWinConformParticle
|
||||||
return conform_particle_data;
|
return conform_particle_data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const QMap<uint, QString> MeasureAnalysisProjectModel::GetTimeWinConformEnergyDataFilenameList(uint time_win) const
|
||||||
|
{
|
||||||
|
QMap<uint, QString> conform_energy_data;
|
||||||
|
if ( this->_time_win_conform_energy_data.contains(time_win) ) {
|
||||||
|
conform_energy_data = this->_time_win_conform_energy_data[time_win];
|
||||||
|
}
|
||||||
|
return conform_energy_data;
|
||||||
|
}
|
||||||
|
|
||||||
const QString MeasureAnalysisProjectModel::GetAnalysisCustomData(AnalysisType analysis_type, const QString &data_item_name)
|
const QString MeasureAnalysisProjectModel::GetAnalysisCustomData(AnalysisType analysis_type, const QString &data_item_name)
|
||||||
{
|
{
|
||||||
return this->_analysis_custom_data_set.value(analysis_type).value(data_item_name);
|
return this->_analysis_custom_data_set.value(analysis_type).value(data_item_name);
|
||||||
|
|
@ -304,24 +319,19 @@ bool MeasureAnalysisProjectModel::LoadProjectModel(const QString& project_filena
|
||||||
this->_measure_device_params_cfg_filename = ProjectAbsFilename(json_obj["MeasureDeviceParamsCfgFilename"].toString());
|
this->_measure_device_params_cfg_filename = ProjectAbsFilename(json_obj["MeasureDeviceParamsCfgFilename"].toString());
|
||||||
this->_energy_scale_filename = ProjectAbsFilename(json_obj["EnergyScaleFilename"].toString());
|
this->_energy_scale_filename = ProjectAbsFilename(json_obj["EnergyScaleFilename"].toString());
|
||||||
this->_efficiency_scale_filename = ProjectAbsFilename(json_obj["EfficiencyScaleFilename"].toString());
|
this->_efficiency_scale_filename = ProjectAbsFilename(json_obj["EfficiencyScaleFilename"].toString());
|
||||||
|
|
||||||
this->_all_channel_particle_data_filename = ProjectAbsFilename(json_obj["AllChannelParticleDataFilename"].toString());
|
this->_all_channel_particle_data_filename = ProjectAbsFilename(json_obj["AllChannelParticleDataFilename"].toString());
|
||||||
this->_sorted_particle_data_filename = ProjectAbsFilename(json_obj["SortedParticleDataFilename"].toString());
|
|
||||||
|
|
||||||
const auto& address_count_data_filename_list = json_obj["ChannelAddressCountDataFilenameList"].toObject().toVariantMap();
|
const auto& address_count_data_filename_list = json_obj["ChannelAddressCountDataFilenameList"].toObject().toVariantMap();
|
||||||
for (auto it = address_count_data_filename_list.constBegin(); it!=address_count_data_filename_list.constEnd(); ++it) {
|
for (auto it = address_count_data_filename_list.constBegin(); it!=address_count_data_filename_list.constEnd(); ++it) {
|
||||||
uint channel_num = it.key().toUInt();
|
uint channel_num = it.key().toUInt();
|
||||||
this->_channel_address_count_data_filename_list[channel_num] = ProjectAbsFilename(it.value().toString());
|
this->_channel_address_count_data_filename_list[channel_num] = ProjectAbsFilename(it.value().toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto& energy_count_data_filename_list = json_obj["ChannelEnergyCountDataFilenameList"].toObject().toVariantMap();
|
const auto& energy_count_data_filename_list = json_obj["ChannelEnergyCountDataFilenameList"].toObject().toVariantMap();
|
||||||
for (auto it = energy_count_data_filename_list.constBegin(); it!=energy_count_data_filename_list.constEnd(); ++it) {
|
for (auto it = energy_count_data_filename_list.constBegin(); it!=energy_count_data_filename_list.constEnd(); ++it) {
|
||||||
uint channel_num = it.key().toUInt();
|
uint channel_num = it.key().toUInt();
|
||||||
this->_channel_energy_count_data_filename_list[channel_num] = ProjectAbsFilename(it.value().toString());
|
this->_channel_energy_count_data_filename_list[channel_num] = ProjectAbsFilename(it.value().toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
this->_all_channel_energy_total_count_data_filename = ProjectAbsFilename(json_obj["AllChannelEnergyTotalCountDataFilename"].toString());
|
this->_all_channel_energy_total_count_data_filename = ProjectAbsFilename(json_obj["AllChannelEnergyTotalCountDataFilename"].toString());
|
||||||
|
this->_particle_energy_data_filename = ProjectAbsFilename(json_obj["ParticleEnergyDataFilename"].toString());
|
||||||
const auto& time_win_conform_particle_data = json_obj["TimeWinConformParticleData"].toObject().toVariantMap();
|
const auto& time_win_conform_particle_data = json_obj["TimeWinConformParticleData"].toObject().toVariantMap();
|
||||||
for (auto it = time_win_conform_particle_data.constBegin(); it!=time_win_conform_particle_data.constEnd(); ++it) {
|
for (auto it = time_win_conform_particle_data.constBegin(); it!=time_win_conform_particle_data.constEnd(); ++it) {
|
||||||
uint time_win = it.key().toUInt();
|
uint time_win = it.key().toUInt();
|
||||||
|
|
@ -333,7 +343,6 @@ bool MeasureAnalysisProjectModel::LoadProjectModel(const QString& project_filena
|
||||||
// }
|
// }
|
||||||
this->_time_win_conform_particle_data[time_win] = conform_particle_data;
|
this->_time_win_conform_particle_data[time_win] = conform_particle_data;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -368,7 +377,6 @@ bool MeasureAnalysisProjectModel::SaveProjectModel()
|
||||||
project_json_obj_map["EnergyScaleFilename"] = ProjectRelativeFilename(this->_energy_scale_filename);
|
project_json_obj_map["EnergyScaleFilename"] = ProjectRelativeFilename(this->_energy_scale_filename);
|
||||||
project_json_obj_map["EfficiencyScaleFilename"] = ProjectRelativeFilename(this->_efficiency_scale_filename);
|
project_json_obj_map["EfficiencyScaleFilename"] = ProjectRelativeFilename(this->_efficiency_scale_filename);
|
||||||
project_json_obj_map["AllChannelParticleDataFilename"] = ProjectRelativeFilename(this->_all_channel_particle_data_filename);
|
project_json_obj_map["AllChannelParticleDataFilename"] = ProjectRelativeFilename(this->_all_channel_particle_data_filename);
|
||||||
project_json_obj_map["SortedParticleDataFilename"] = ProjectRelativeFilename(this->_sorted_particle_data_filename);
|
|
||||||
QVariantMap channel_address_count_data_filename_list;
|
QVariantMap channel_address_count_data_filename_list;
|
||||||
for (auto it = this->_channel_address_count_data_filename_list.constBegin(); it != this->_channel_address_count_data_filename_list.constEnd(); ++it) {
|
for (auto it = this->_channel_address_count_data_filename_list.constBegin(); it != this->_channel_address_count_data_filename_list.constEnd(); ++it) {
|
||||||
channel_address_count_data_filename_list[QString::number(it.key())] = ProjectRelativeFilename(it.value());
|
channel_address_count_data_filename_list[QString::number(it.key())] = ProjectRelativeFilename(it.value());
|
||||||
|
|
@ -388,6 +396,7 @@ bool MeasureAnalysisProjectModel::SaveProjectModel()
|
||||||
}
|
}
|
||||||
time_win_conform_particle_data[QString::number(it.key())] = conform_particle_data;
|
time_win_conform_particle_data[QString::number(it.key())] = conform_particle_data;
|
||||||
}
|
}
|
||||||
|
project_json_obj_map["ParticleEnergyDataFilename"] = ProjectRelativeFilename(this->_particle_energy_data_filename);
|
||||||
project_json_obj_map["TimeWinConformParticleData"] = time_win_conform_particle_data;
|
project_json_obj_map["TimeWinConformParticleData"] = time_win_conform_particle_data;
|
||||||
|
|
||||||
// 将项目模型保存到json文件
|
// 将项目模型保存到json文件
|
||||||
|
|
@ -430,15 +439,17 @@ MeasureAnalysisProjectModelList::~MeasureAnalysisProjectModelList()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MeasureAnalysisProjectModelList::AddProjectModel(MeasureAnalysisProjectModel* model)
|
bool MeasureAnalysisProjectModelList::AddProjectModel(MeasureAnalysisProjectModel* model, bool save)
|
||||||
{
|
{
|
||||||
bool ok = true;
|
bool ok = true;
|
||||||
const QString& project_name = model->GetProjectName();
|
const QString& project_name = model->GetProjectName();
|
||||||
if (!_project_models.contains(project_name)) {
|
if (!_project_models.contains(project_name)) {
|
||||||
_project_models[project_name] = model;
|
_project_models[project_name] = model;
|
||||||
intiProjectNodeStruce(model);
|
intiProjectNodeStruce(model);
|
||||||
SetCurrentProjectModel(project_name);
|
if (save) {
|
||||||
model->SaveProjectModel();
|
this->SetCurrentProjectModel(project_name);
|
||||||
|
model->SaveProjectModel();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
delete model;
|
delete model;
|
||||||
ok &= false;
|
ok &= false;
|
||||||
|
|
@ -531,8 +542,8 @@ QStandardItem* MeasureAnalysisProjectModelList::GetItemFromIndex(const QModelInd
|
||||||
}
|
}
|
||||||
|
|
||||||
QStandardItem* MeasureAnalysisProjectModelList::AddChildNode(
|
QStandardItem* MeasureAnalysisProjectModelList::AddChildNode(
|
||||||
QStandardItem* parent_item, const QString& node_name, const QString& status,
|
QStandardItem* parent_item, const QString& node_name, const QString& status_text,
|
||||||
const QVariant& user_data, bool is_fixed)
|
const QVariant& user_data, bool is_fixed, bool state_ok)
|
||||||
{
|
{
|
||||||
if (!parent_item)
|
if (!parent_item)
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
@ -540,9 +551,15 @@ QStandardItem* MeasureAnalysisProjectModelList::AddChildNode(
|
||||||
QStandardItem* name_item = new QStandardItem(node_name);
|
QStandardItem* name_item = new QStandardItem(node_name);
|
||||||
name_item->setData(user_data, NodeType);
|
name_item->setData(user_data, NodeType);
|
||||||
name_item->setData(is_fixed, Fixed);
|
name_item->setData(is_fixed, Fixed);
|
||||||
|
QStandardItem* status_item = new QStandardItem(status_text);
|
||||||
QStandardItem* status_item = new QStandardItem(status);
|
status_item->setData(state_ok, Qt::UserRole);
|
||||||
|
if (state_ok) {
|
||||||
|
name_item->setForeground(Qt::black);
|
||||||
|
status_item->setForeground(Qt::black);
|
||||||
|
} else {
|
||||||
|
name_item->setForeground(Qt::gray);
|
||||||
|
status_item->setForeground(Qt::gray);
|
||||||
|
}
|
||||||
QList<QStandardItem*> row_items;
|
QList<QStandardItem*> row_items;
|
||||||
row_items << name_item << status_item;
|
row_items << name_item << status_item;
|
||||||
parent_item->appendRow(row_items);
|
parent_item->appendRow(row_items);
|
||||||
|
|
@ -588,7 +605,7 @@ QVariant MeasureAnalysisProjectModelList::GetNodeUserData(QStandardItem* item, U
|
||||||
return (item && item->column() == NameColumn) ? item->data(data_type) : QVariant();
|
return (item && item->column() == NameColumn) ? item->data(data_type) : QVariant();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MeasureAnalysisProjectModelList::SetNodeStatus(QStandardItem* item, const QString& status)
|
void MeasureAnalysisProjectModelList::SetNodeStatus(QStandardItem* item, const QString& status, bool state_ok)
|
||||||
{
|
{
|
||||||
if (!item || item->column() != NameColumn)
|
if (!item || item->column() != NameColumn)
|
||||||
return;
|
return;
|
||||||
|
|
@ -597,36 +614,70 @@ void MeasureAnalysisProjectModelList::SetNodeStatus(QStandardItem* item, const Q
|
||||||
: invisibleRootItem()->child(item->row(), StatusColumn);
|
: invisibleRootItem()->child(item->row(), StatusColumn);
|
||||||
if (status_item) {
|
if (status_item) {
|
||||||
status_item->setText(status);
|
status_item->setText(status);
|
||||||
|
status_item->setData(state_ok, Qt::UserRole);
|
||||||
|
if (state_ok) {
|
||||||
|
status_item->setForeground(Qt::black);
|
||||||
|
} else {
|
||||||
|
status_item->setForeground(Qt::gray);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QString MeasureAnalysisProjectModelList::GetNodeStatus(QStandardItem* item) const
|
bool MeasureAnalysisProjectModelList::GetNodeStatus(QStandardItem* item) const
|
||||||
{
|
{
|
||||||
if (!item || item->column() != NameColumn)
|
if (!item || item->column() != NameColumn)
|
||||||
return QString();
|
return false;
|
||||||
QStandardItem* status_item = item->parent()
|
QStandardItem* status_item = item->parent()
|
||||||
? item->parent()->child(item->row(), StatusColumn)
|
? item->parent()->child(item->row(), StatusColumn)
|
||||||
: invisibleRootItem()->child(item->row(), StatusColumn);
|
: invisibleRootItem()->child(item->row(), StatusColumn);
|
||||||
return status_item ? status_item->text() : QString();
|
if ( !status_item )
|
||||||
|
return false;
|
||||||
|
return status_item->data(Qt::UserRole).toBool();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MeasureAnalysisProjectModelList::onChannelAddressCountProcessFinished(const QString& project_name)
|
void MeasureAnalysisProjectModelList::ApplyEnergyScale(const QString &project_name)
|
||||||
{
|
{
|
||||||
if (this->_project_models.contains(project_name)) {
|
if (this->_project_models.contains(project_name)) {
|
||||||
auto pro_model = this->_project_models[project_name];
|
auto pro_model = this->_project_models[project_name];
|
||||||
const QMap<uint, QString>& filename_list = pro_model->GetChannelAddressCountDataFilenameList();
|
const QString& energy_scale_filename = pro_model->GetEnergyScaleFilename();
|
||||||
|
QString status = QStringLiteral(u"未配置");
|
||||||
|
if (!energy_scale_filename.isEmpty()) {
|
||||||
|
status = QStringLiteral(u"已配置");
|
||||||
|
auto& node_map = this->_project_node_items[project_name];
|
||||||
|
const QString& energy_scale_item_name = QStringLiteral(u"能量刻度");
|
||||||
|
if (node_map.contains(energy_scale_item_name)) {
|
||||||
|
auto energy_scale_item = node_map[energy_scale_item_name];
|
||||||
|
this->SetNodeStatus(energy_scale_item, status);
|
||||||
|
}
|
||||||
|
pro_model->SaveProjectModel();
|
||||||
|
|
||||||
|
auto apply_erergy_scale_fit_task = new DataProcessWorkPool::EnergyScaleParticleDataTask;
|
||||||
|
apply_erergy_scale_fit_task->SetFinishedNotifier(this, "onEnergyScaleParticleDataFinished", project_name);
|
||||||
|
apply_erergy_scale_fit_task->StartTask();
|
||||||
|
auto energy_count_process_task = new DataProcessWorkPool::EnergyCountProcessTask;
|
||||||
|
energy_count_process_task->SetFinishedNotifier(this, "onEnergyCountProcessFinished", project_name);
|
||||||
|
energy_count_process_task->StartTask();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void MeasureAnalysisProjectModelList::onChannelAddressCountProcessFinished(bool ok, const QString& project_name, const QVariant &data)
|
||||||
|
{
|
||||||
|
Q_UNUSED(data);
|
||||||
|
if ( !ok )
|
||||||
|
return;
|
||||||
|
if (this->_project_models.contains(project_name)) {
|
||||||
|
auto pro_model = this->_project_models[project_name];
|
||||||
|
const QMap<uint, QString>& filename_list = pro_model->GetChannelAddressCountDataFilenameList();
|
||||||
QString status = QStringLiteral(u"无效");
|
QString status = QStringLiteral(u"无效");
|
||||||
if (!filename_list.isEmpty()) {
|
if (!filename_list.isEmpty()) {
|
||||||
status = QStringLiteral(u"有效");
|
status = QStringLiteral(u"有效");
|
||||||
}
|
}
|
||||||
|
|
||||||
auto& node_map = this->_project_node_items[project_name];
|
auto& node_map = this->_project_node_items[project_name];
|
||||||
const QString& adrr_count_item_name = QStringLiteral(u"道址计数");
|
const QString& adrr_count_item_name = QStringLiteral(u"道址计数");
|
||||||
if (node_map.contains(adrr_count_item_name)) {
|
if (node_map.contains(adrr_count_item_name)) {
|
||||||
auto adrr_count_item = node_map[adrr_count_item_name];
|
auto adrr_count_item = node_map[adrr_count_item_name];
|
||||||
this->SetNodeStatus(adrr_count_item, status);
|
this->SetNodeStatus(adrr_count_item, status);
|
||||||
|
|
||||||
for (auto it = filename_list.begin(); it != filename_list.end(); ++it) {
|
for (auto it = filename_list.begin(); it != filename_list.end(); ++it) {
|
||||||
uint ch_num = it.key();
|
uint ch_num = it.key();
|
||||||
QString item_name = QStringLiteral(u"通道%1道址计数").arg(ch_num);
|
QString item_name = QStringLiteral(u"通道%1道址计数").arg(ch_num);
|
||||||
|
|
@ -637,13 +688,166 @@ void MeasureAnalysisProjectModelList::onChannelAddressCountProcessFinished(const
|
||||||
node_map[item_name] = node_item;
|
node_map[item_name] = node_item;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const QString& adrr_count_spec_item_name = QStringLiteral(u"道址计数谱");
|
const QString& adrr_count_spec_item_name = QStringLiteral(u"道址计数谱");
|
||||||
if (node_map.contains(adrr_count_spec_item_name)) {
|
if (node_map.contains(adrr_count_spec_item_name)) {
|
||||||
auto adrr_count_spec_item = node_map[adrr_count_spec_item_name];
|
auto adrr_count_spec_item = node_map[adrr_count_spec_item_name];
|
||||||
this->SetNodeStatus(adrr_count_spec_item, status);
|
this->SetNodeStatus(adrr_count_spec_item, status);
|
||||||
}
|
}
|
||||||
|
pro_model->SaveProjectModel();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void MeasureAnalysisProjectModelList::onEnergyScaleParticleDataFinished(bool ok, const QString &project_name, const QVariant &data)
|
||||||
|
{
|
||||||
|
Q_UNUSED(data);
|
||||||
|
if ( !ok )
|
||||||
|
return;
|
||||||
|
if (this->_project_models.contains(project_name)) {
|
||||||
|
auto pro_model = this->_project_models[project_name];
|
||||||
|
auto& node_map = this->_project_node_items[project_name];
|
||||||
|
QString status = QStringLiteral(u"无效");
|
||||||
|
|
||||||
|
const QString& energy_total_count_filename = pro_model->GetAllChannelEnergyTotalCountDataFilename();
|
||||||
|
if (!energy_total_count_filename.isEmpty()) {
|
||||||
|
status = QStringLiteral(u"有效");
|
||||||
|
const QString& energy_total_count_item_name = QStringLiteral(u"能量计数");
|
||||||
|
if (node_map.contains(energy_total_count_item_name)) {
|
||||||
|
auto energy_total_count_item = node_map[energy_total_count_item_name];
|
||||||
|
this->SetNodeStatus(energy_total_count_item, status);
|
||||||
|
const QMap<uint, QString>& channel_energy_count_filename_list = pro_model->GetChannelEnergyCountDataFilenameList();
|
||||||
|
for (auto it = channel_energy_count_filename_list.constBegin(); it != channel_energy_count_filename_list.constEnd(); ++it) {
|
||||||
|
uint ch_num = it.key();
|
||||||
|
QString item_name = QStringLiteral(u"通道%1能量计数").arg(ch_num);
|
||||||
|
const QVariant& analys_type = QVariant::fromValue(AnalysisType::EnergyCountData);
|
||||||
|
QStandardItem* node_item = AddChildNode(energy_total_count_item, item_name, status, analys_type, true);
|
||||||
|
node_item->setData(project_name, ProjectName);
|
||||||
|
node_item->setData(ch_num, ChannelNum);
|
||||||
|
node_map[item_name] = node_item;
|
||||||
|
}
|
||||||
|
const QString& adrr_count_spec_item_name = QStringLiteral(u"能量计数谱");
|
||||||
|
if (node_map.contains(adrr_count_spec_item_name)) {
|
||||||
|
auto adrr_count_spec_item = node_map[adrr_count_spec_item_name];
|
||||||
|
this->SetNodeStatus(adrr_count_spec_item, status);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
pro_model->SaveProjectModel();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void MeasureAnalysisProjectModelList::onEnergyCountProcessFinished(bool ok, const QString &project_name, const QVariant &data)
|
||||||
|
{
|
||||||
|
Q_UNUSED(data);
|
||||||
|
if ( !ok )
|
||||||
|
return;
|
||||||
|
if (this->_project_models.contains(project_name)) {
|
||||||
|
auto pro_model = this->_project_models[project_name];
|
||||||
|
auto& node_map = this->_project_node_items[project_name];
|
||||||
|
bool status_ok = false;
|
||||||
|
QString status = QStringLiteral(u"无效");
|
||||||
|
const QString& energy_total_count_filename = pro_model->GetAllChannelEnergyTotalCountDataFilename();
|
||||||
|
if (!energy_total_count_filename.isEmpty()) {
|
||||||
|
status_ok = true;
|
||||||
|
status = QStringLiteral(u"有效");
|
||||||
|
const QString& energy_total_count_item_name = QStringLiteral(u"能量计数");
|
||||||
|
if (node_map.contains(energy_total_count_item_name)) {
|
||||||
|
auto energy_total_count_item = node_map[energy_total_count_item_name];
|
||||||
|
this->SetNodeStatus(energy_total_count_item, status, status_ok);
|
||||||
|
const QMap<uint, QString>& channel_energy_count_filename_list = pro_model->GetChannelEnergyCountDataFilenameList();
|
||||||
|
for (auto it = channel_energy_count_filename_list.constBegin(); it != channel_energy_count_filename_list.constEnd(); ++it) {
|
||||||
|
uint ch_num = it.key();
|
||||||
|
QString item_name = QStringLiteral(u"通道%1能量计数").arg(ch_num);
|
||||||
|
if ( !node_map.contains(item_name) ) {
|
||||||
|
const QVariant& analys_type = QVariant::fromValue(AnalysisType::EnergyCountData);
|
||||||
|
QStandardItem* node_item = AddChildNode(energy_total_count_item, item_name, status, analys_type, true, status_ok);
|
||||||
|
node_item->setData(project_name, ProjectName);
|
||||||
|
node_item->setData(ch_num, ChannelNum);
|
||||||
|
node_map[item_name] = node_item;
|
||||||
|
} else {
|
||||||
|
auto ch_energy_count_item = node_map[item_name];
|
||||||
|
this->SetNodeStatus(ch_energy_count_item, status, status_ok);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const auto& ch_energy_count_data_list = pro_model->GetChannelEnergyCountDataFilenameList();
|
||||||
|
if (!ch_energy_count_data_list.isEmpty()) {
|
||||||
|
const QString& adrr_count_spec_item_name = QStringLiteral(u"能量计数谱");
|
||||||
|
if (node_map.contains(adrr_count_spec_item_name)) {
|
||||||
|
auto adrr_count_spec_item = node_map[adrr_count_spec_item_name];
|
||||||
|
this->SetNodeStatus(adrr_count_spec_item, status);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const QString& particle_energy_data_filename = pro_model->GetParticleEnergyDataFilename();
|
||||||
|
if (!particle_energy_data_filename.isEmpty()) {
|
||||||
|
status_ok = true;
|
||||||
|
status = QStringLiteral(u"有效");
|
||||||
|
const QString& count_rate_analysis_item_name = QStringLiteral(u"计数率分析");
|
||||||
|
if (node_map.contains(count_rate_analysis_item_name)) {
|
||||||
|
auto energy_total_count_spec_item = node_map[count_rate_analysis_item_name];
|
||||||
|
this->SetNodeStatus(energy_total_count_spec_item, status, status_ok);
|
||||||
|
}
|
||||||
|
const QString& peak_fit_analysis_item_name = QStringLiteral(u"峰拟合分析");
|
||||||
|
if (node_map.contains(peak_fit_analysis_item_name)) {
|
||||||
|
auto energy_total_count_spec_item = node_map[peak_fit_analysis_item_name];
|
||||||
|
this->SetNodeStatus(energy_total_count_spec_item, status, status_ok);
|
||||||
|
}
|
||||||
|
const QString& nuclide_analysis_item_name = QStringLiteral(u"核素分析");
|
||||||
|
if (node_map.contains(nuclide_analysis_item_name)) {
|
||||||
|
auto energy_total_count_spec_item = node_map[nuclide_analysis_item_name];
|
||||||
|
this->SetNodeStatus(energy_total_count_spec_item, status, status_ok);
|
||||||
|
}
|
||||||
|
const QString& particle_in_time_analysis_item_name = QStringLiteral(u"粒子入射时间分析");
|
||||||
|
if (node_map.contains(particle_in_time_analysis_item_name)) {
|
||||||
|
auto energy_total_count_spec_item = node_map[particle_in_time_analysis_item_name];
|
||||||
|
this->SetNodeStatus(energy_total_count_spec_item, status, status_ok);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
pro_model->SaveProjectModel();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void MeasureAnalysisProjectModelList::onCoincidenceProcessFinished(bool ok, const QString &project_name, const QVariant &data)
|
||||||
|
{
|
||||||
|
Q_UNUSED(data);
|
||||||
|
if ( !ok )
|
||||||
|
return;
|
||||||
|
if (this->_project_models.contains(project_name)) {
|
||||||
|
auto pro_model = this->_project_models[project_name];
|
||||||
|
auto& node_map = this->_project_node_items[project_name];
|
||||||
|
bool status_ok = false;
|
||||||
|
QString status = QStringLiteral(u"无效");
|
||||||
|
uint conform_time_win = pro_model->GetConformTimeWin();
|
||||||
|
const auto& Conform_energy_data_filename_list = pro_model->GetTimeWinConformEnergyDataFilenameList(conform_time_win);
|
||||||
|
if (!Conform_energy_data_filename_list.isEmpty()) {
|
||||||
|
status_ok = true;
|
||||||
|
status = QStringLiteral(u"有效");
|
||||||
|
QString item_name = QStringLiteral(u"符合事件时间分析");
|
||||||
|
if (node_map.contains(item_name)) {
|
||||||
|
auto energy_total_count_item = node_map[item_name];
|
||||||
|
this->SetNodeStatus(energy_total_count_item, status, status_ok);
|
||||||
|
}
|
||||||
|
item_name = QStringLiteral(u"符合能谱[%1ns]").arg(conform_time_win);
|
||||||
|
if (node_map.contains(item_name)) {
|
||||||
|
auto energy_total_count_spec_item = node_map[item_name];
|
||||||
|
this->SetNodeStatus(energy_total_count_spec_item, status, status_ok);
|
||||||
|
}
|
||||||
|
item_name = QStringLiteral(u"反符合能谱[%1ns]").arg(conform_time_win);
|
||||||
|
if (node_map.contains(item_name)) {
|
||||||
|
auto energy_total_count_spec_item = node_map[item_name];
|
||||||
|
this->SetNodeStatus(energy_total_count_spec_item, status, status_ok);
|
||||||
|
}
|
||||||
|
item_name = QStringLiteral(u"二维符合能谱[%1ns]").arg(conform_time_win);
|
||||||
|
if (node_map.contains(item_name)) {
|
||||||
|
auto energy_total_count_spec_item = node_map[item_name];
|
||||||
|
this->SetNodeStatus(energy_total_count_spec_item, status, status_ok);
|
||||||
|
}
|
||||||
|
item_name = QStringLiteral(u"三维符合能谱[%1ns]").arg(conform_time_win);
|
||||||
|
if (node_map.contains(item_name)) {
|
||||||
|
auto energy_total_count_spec_item = node_map[item_name];
|
||||||
|
this->SetNodeStatus(energy_total_count_spec_item, status, status_ok);
|
||||||
|
}
|
||||||
|
}
|
||||||
pro_model->SaveProjectModel();
|
pro_model->SaveProjectModel();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -660,57 +864,60 @@ void MeasureAnalysisProjectModelList::intiProjectNodeStruce(MeasureAnalysisProje
|
||||||
const QString& project_name = pro_model->GetProjectName();
|
const QString& project_name = pro_model->GetProjectName();
|
||||||
QString status = pro_model->GetIsMeasureComplete() ? QStringLiteral(u"测量完成") : QStringLiteral(u"未测量");
|
QString status = pro_model->GetIsMeasureComplete() ? QStringLiteral(u"测量完成") : QStringLiteral(u"未测量");
|
||||||
QVariant analys_type = QVariant::fromValue(AnalysisType::Project);
|
QVariant analys_type = QVariant::fromValue(AnalysisType::Project);
|
||||||
QStandardItem* project_item = AddChildNode(root_item, project_name, status, analys_type, false);
|
QStandardItem* project_item = AddChildNode(root_item, project_name, status, analys_type, false, true);
|
||||||
project_item->setData(project_name, ProjectName);
|
project_item->setData(project_name, ProjectName);
|
||||||
node_map[project_name] = project_item;
|
node_map[project_name] = project_item;
|
||||||
|
|
||||||
// 测量控制
|
// 测量控制
|
||||||
QString item_name = QStringLiteral(u"测量控制");
|
QString item_name = QStringLiteral(u"测量控制");
|
||||||
QStandardItem* measure_ctrl_item = AddChildNode(project_item, item_name, QString(), QVariant(), true);
|
QStandardItem* measure_ctrl_item = AddChildNode(project_item, item_name, QString(), QVariant(), true, true);
|
||||||
measure_ctrl_item->setData(project_name, ProjectName);
|
measure_ctrl_item->setData(project_name, ProjectName);
|
||||||
node_map[item_name] = measure_ctrl_item;
|
node_map[item_name] = measure_ctrl_item;
|
||||||
|
|
||||||
if (!pro_model->GetIsMeasureComplete()) {
|
const QString& measure_device_params_cfg_filename = pro_model->GetMeasureDeviceParamsCfgFilename();
|
||||||
const QString& measure_device_params_cfg_filename = pro_model->GetMeasureDeviceParamsCfgFilename();
|
bool state_ok = !measure_device_params_cfg_filename.isEmpty();
|
||||||
status = measure_device_params_cfg_filename.isEmpty() ? QStringLiteral(u"未配置") : QStringLiteral(u"已配置");
|
status = state_ok ? QStringLiteral(u"已配置") : QStringLiteral(u"未配置");
|
||||||
analys_type = QVariant::fromValue(AnalysisType::DeviceParamsCfg);
|
analys_type = QVariant::fromValue(AnalysisType::DeviceParamsCfg);
|
||||||
item_name = QStringLiteral(u"设备配置参数");
|
item_name = QStringLiteral(u"设备配置参数");
|
||||||
QStandardItem* node_item = AddChildNode(measure_ctrl_item, item_name, status, analys_type, true);
|
QStandardItem* node_item = AddChildNode(measure_ctrl_item, item_name, status, analys_type, true, state_ok);
|
||||||
node_item->setData(project_name, ProjectName);
|
|
||||||
node_map[item_name] = node_item;
|
|
||||||
}
|
|
||||||
|
|
||||||
status = pro_model->GetEnergyScaleFilename().isEmpty() ? QStringLiteral(u"未配置") : QStringLiteral(u"已配置");
|
|
||||||
analys_type = QVariant::fromValue(AnalysisType::EnergyScale);
|
|
||||||
item_name = QStringLiteral(u"能量刻度");
|
|
||||||
QStandardItem* node_item = AddChildNode(measure_ctrl_item, item_name, status, analys_type, true);
|
|
||||||
node_item->setData(project_name, ProjectName);
|
node_item->setData(project_name, ProjectName);
|
||||||
node_map[item_name] = node_item;
|
node_map[item_name] = node_item;
|
||||||
|
|
||||||
status = pro_model->GetEfficiencyScaleFilename().isEmpty() ? QStringLiteral(u"未配置") : QStringLiteral(u"已配置");
|
state_ok = !pro_model->GetEnergyScaleFilename().isEmpty();
|
||||||
|
status = state_ok ? QStringLiteral(u"已配置") : QStringLiteral(u"未配置");
|
||||||
|
analys_type = QVariant::fromValue(AnalysisType::EnergyScale);
|
||||||
|
item_name = QStringLiteral(u"能量刻度");
|
||||||
|
node_item = AddChildNode(measure_ctrl_item, item_name, status, analys_type, true, state_ok);
|
||||||
|
node_item->setData(project_name, ProjectName);
|
||||||
|
node_map[item_name] = node_item;
|
||||||
|
|
||||||
|
state_ok = !pro_model->GetEfficiencyScaleFilename().isEmpty();
|
||||||
|
status = state_ok ? QStringLiteral(u"已配置") : QStringLiteral(u"未配置");
|
||||||
analys_type = QVariant::fromValue(AnalysisType::EfficiencyScale);
|
analys_type = QVariant::fromValue(AnalysisType::EfficiencyScale);
|
||||||
item_name = QStringLiteral(u"效率刻度");
|
item_name = QStringLiteral(u"效率刻度");
|
||||||
node_item = AddChildNode(measure_ctrl_item, item_name, status, analys_type, true);
|
node_item = AddChildNode(measure_ctrl_item, item_name, status, analys_type, true, state_ok);
|
||||||
node_item->setData(project_name, ProjectName);
|
node_item->setData(project_name, ProjectName);
|
||||||
node_map[item_name] = node_item;
|
node_map[item_name] = node_item;
|
||||||
|
|
||||||
// 分析数据
|
// 分析数据
|
||||||
item_name = QStringLiteral(u"分析数据");
|
item_name = QStringLiteral(u"分析数据");
|
||||||
QStandardItem* analysis_data_item = AddChildNode(project_item, item_name, QString(), QVariant(), true);
|
QStandardItem* analysis_data_item = AddChildNode(project_item, item_name, QString(), QVariant(), true, true);
|
||||||
analysis_data_item->setData(project_name, ProjectName);
|
analysis_data_item->setData(project_name, ProjectName);
|
||||||
node_map[item_name] = node_item;
|
node_map[item_name] = node_item;
|
||||||
|
|
||||||
status = pro_model->GetAllChannelParticleDataFilename().isEmpty() ? QStringLiteral(u"无效") : QStringLiteral(u"有效");
|
state_ok = !pro_model->GetAllChannelParticleDataFilename().isEmpty();
|
||||||
|
status = state_ok ? QStringLiteral(u"有效") : QStringLiteral(u"无效");
|
||||||
analys_type = QVariant::fromValue(AnalysisType::ParticleData);
|
analys_type = QVariant::fromValue(AnalysisType::ParticleData);
|
||||||
item_name = QStringLiteral(u"测量粒子数据");
|
item_name = QStringLiteral(u"测量粒子数据");
|
||||||
node_item = AddChildNode(analysis_data_item, item_name, status, analys_type, true);
|
node_item = AddChildNode(analysis_data_item, item_name, status, analys_type, true, state_ok);
|
||||||
node_item->setData(project_name, ProjectName);
|
node_item->setData(project_name, ProjectName);
|
||||||
node_map[item_name] = node_item;
|
node_map[item_name] = node_item;
|
||||||
|
|
||||||
item_name = QStringLiteral(u"道址计数");
|
|
||||||
const auto& ch_addr_count_data_filename_list = pro_model->GetChannelAddressCountDataFilenameList();
|
const auto& ch_addr_count_data_filename_list = pro_model->GetChannelAddressCountDataFilenameList();
|
||||||
status = ch_addr_count_data_filename_list.isEmpty() ? QStringLiteral(u"无效") : QStringLiteral(u"有效");
|
state_ok = !ch_addr_count_data_filename_list.isEmpty();
|
||||||
node_item = AddChildNode(analysis_data_item, item_name, status, QVariant(), true);
|
status = state_ok ? QStringLiteral(u"有效") : QStringLiteral(u"无效");
|
||||||
|
item_name = QStringLiteral(u"道址计数");
|
||||||
|
node_item = AddChildNode(analysis_data_item, item_name, status, QVariant(), true, state_ok);
|
||||||
node_item->setData(project_name, ProjectName);
|
node_item->setData(project_name, ProjectName);
|
||||||
node_map[item_name] = node_item;
|
node_map[item_name] = node_item;
|
||||||
QStandardItem* adrr_count_item = node_item;
|
QStandardItem* adrr_count_item = node_item;
|
||||||
|
|
@ -718,128 +925,147 @@ void MeasureAnalysisProjectModelList::intiProjectNodeStruce(MeasureAnalysisProje
|
||||||
uint ch_num = it.key();
|
uint ch_num = it.key();
|
||||||
QString item_name = QStringLiteral(u"通道%1道址计数").arg(ch_num);
|
QString item_name = QStringLiteral(u"通道%1道址计数").arg(ch_num);
|
||||||
const QVariant& analys_type = QVariant::fromValue(AnalysisType::AddressCountData);
|
const QVariant& analys_type = QVariant::fromValue(AnalysisType::AddressCountData);
|
||||||
QStandardItem* node_item = AddChildNode(adrr_count_item, item_name, status, analys_type, true);
|
QStandardItem* node_item = AddChildNode(adrr_count_item, item_name, status, analys_type, true, state_ok);
|
||||||
node_item->setData(project_name, ProjectName);
|
node_item->setData(project_name, ProjectName);
|
||||||
node_item->setData(ch_num, ChannelNum);
|
node_item->setData(ch_num, ChannelNum);
|
||||||
node_map[item_name] = node_item;
|
node_map[item_name] = node_item;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
state_ok = !pro_model->GetParticleEnergyDataFilename().isEmpty();
|
||||||
|
status = state_ok ? QStringLiteral(u"有效") : QStringLiteral(u"无效");
|
||||||
|
analys_type = QVariant::fromValue(AnalysisType::ParticleEnergyData);
|
||||||
|
item_name = QStringLiteral(u"粒子能量数据");
|
||||||
|
node_item = AddChildNode(analysis_data_item, item_name, status, analys_type, true, state_ok);
|
||||||
|
node_item->setData(project_name, ProjectName);
|
||||||
|
node_map[item_name] = node_item;
|
||||||
|
|
||||||
|
state_ok = !pro_model->GetAllChannelEnergyTotalCountDataFilename().isEmpty();
|
||||||
|
status = state_ok ? QStringLiteral(u"有效") : QStringLiteral(u"无效");
|
||||||
item_name = QStringLiteral(u"能量计数");
|
item_name = QStringLiteral(u"能量计数");
|
||||||
status = pro_model->GetAllChannelEnergyTotalCountDataFilename().isEmpty() ? QStringLiteral(u"无效") : QStringLiteral(u"有效");
|
|
||||||
analys_type = QVariant::fromValue(AnalysisType::EnergyCountData);
|
analys_type = QVariant::fromValue(AnalysisType::EnergyCountData);
|
||||||
node_item = AddChildNode(analysis_data_item, item_name, status, analys_type, true);
|
node_item = AddChildNode(analysis_data_item, item_name, status, analys_type, true, state_ok);
|
||||||
node_item->setData(project_name, ProjectName);
|
node_item->setData(project_name, ProjectName);
|
||||||
node_map[item_name] = node_item;
|
node_map[item_name] = node_item;
|
||||||
QStandardItem* energy_count_item = node_item;
|
QStandardItem* energy_count_item = node_item;
|
||||||
const auto& ch_energy_count_data_filename_list = pro_model->GetChannelEnergyCountDataFilenameList();
|
const auto& ch_energy_count_data_filename_list = pro_model->GetChannelEnergyCountDataFilenameList();
|
||||||
|
state_ok = !ch_energy_count_data_filename_list.isEmpty();
|
||||||
for (auto it = ch_energy_count_data_filename_list.begin(); it != ch_energy_count_data_filename_list.end(); ++it) {
|
for (auto it = ch_energy_count_data_filename_list.begin(); it != ch_energy_count_data_filename_list.end(); ++it) {
|
||||||
uint ch_num = it.key();
|
uint ch_num = it.key();
|
||||||
QString item_name = QStringLiteral(u"通道%1能量计数").arg(ch_num);
|
QString item_name = QStringLiteral(u"通道%1能量计数").arg(ch_num);
|
||||||
const QVariant& analys_type = QVariant::fromValue(AnalysisType::EnergyCountData);
|
const QVariant& analys_type = QVariant::fromValue(AnalysisType::EnergyCountData);
|
||||||
QStandardItem* node_item = AddChildNode(energy_count_item, item_name, status, analys_type, true);
|
QStandardItem* node_item = AddChildNode(energy_count_item, item_name, status, analys_type, true, state_ok);
|
||||||
node_item->setData(project_name, ProjectName);
|
node_item->setData(project_name, ProjectName);
|
||||||
node_item->setData(ch_num, ChannelNum);
|
node_item->setData(ch_num, ChannelNum);
|
||||||
node_map[item_name] = node_item;
|
node_map[item_name] = node_item;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint conform_time_win = pro_model->GetConformTimeWin();
|
uint conform_time_win = pro_model->GetConformTimeWin();
|
||||||
status = pro_model->GetTimeWinConformParticleDataFilenameList(conform_time_win).isEmpty() ? QStringLiteral(u"无效") : QStringLiteral(u"有效");
|
state_ok = !pro_model->GetTimeWinConformParticleDataFilenameList(conform_time_win).isEmpty();
|
||||||
|
status = state_ok ? QStringLiteral(u"有效") : QStringLiteral(u"无效");
|
||||||
analys_type = QVariant::fromValue(AnalysisType::CoincidenceParticleEnergyData);
|
analys_type = QVariant::fromValue(AnalysisType::CoincidenceParticleEnergyData);
|
||||||
item_name = QStringLiteral(u"符合粒子数据[%1ns]").arg(conform_time_win);
|
item_name = QStringLiteral(u"符合粒子数据[%1ns]").arg(conform_time_win);
|
||||||
node_item = AddChildNode(analysis_data_item, item_name, status, analys_type, true);
|
node_item = AddChildNode(analysis_data_item, item_name, status, analys_type, true, state_ok);
|
||||||
node_item->setData(project_name, ProjectName);
|
node_item->setData(project_name, ProjectName);
|
||||||
node_map[item_name] = node_item;
|
node_map[item_name] = node_item;
|
||||||
|
|
||||||
// 交互分析
|
// 交互分析
|
||||||
item_name = QStringLiteral(u"交互分析");
|
item_name = QStringLiteral(u"交互分析");
|
||||||
QStandardItem* interactive_analysis_item = AddChildNode(project_item, item_name, QString(), QVariant(), true);
|
QStandardItem* interactive_analysis_item = AddChildNode(project_item, item_name, QString(), QVariant(), true, true);
|
||||||
interactive_analysis_item->setData(project_name, ProjectName);
|
interactive_analysis_item->setData(project_name, ProjectName);
|
||||||
node_map[item_name] = interactive_analysis_item;
|
node_map[item_name] = interactive_analysis_item;
|
||||||
|
|
||||||
status = pro_model->GetChannelAddressCountDataFilenameList().isEmpty() ? QStringLiteral(u"无效") : QStringLiteral(u"有效");
|
state_ok = !pro_model->GetChannelAddressCountDataFilenameList().isEmpty();
|
||||||
|
status = state_ok ? QStringLiteral(u"有效") : QStringLiteral(u"无效");
|
||||||
analys_type = QVariant::fromValue(AnalysisType::AddressCountSpectrumView);
|
analys_type = QVariant::fromValue(AnalysisType::AddressCountSpectrumView);
|
||||||
item_name = QStringLiteral(u"道址计数谱");
|
item_name = QStringLiteral(u"道址计数谱");
|
||||||
node_item = AddChildNode(interactive_analysis_item, item_name, status, analys_type, true);
|
node_item = AddChildNode(interactive_analysis_item, item_name, status, analys_type, true, state_ok);
|
||||||
node_item->setData(project_name, ProjectName);
|
node_item->setData(project_name, ProjectName);
|
||||||
node_map[item_name] = node_item;
|
node_map[item_name] = node_item;
|
||||||
|
|
||||||
status = pro_model->GetChannelEnergyCountDataFilenameList().isEmpty() ? QStringLiteral(u"无效") : QStringLiteral(u"有效");
|
state_ok = !pro_model->GetAllChannelEnergyTotalCountDataFilename().isEmpty();
|
||||||
analys_type = QVariant::fromValue(AnalysisType::EnergyCountSpectrumView);
|
state_ok &= pro_model->GetChannelEnergyCountDataFilenameList().isEmpty();
|
||||||
item_name = QStringLiteral(u"通道能量计数谱");
|
status = state_ok ? QStringLiteral(u"有效") : QStringLiteral(u"无效");
|
||||||
node_item = AddChildNode(interactive_analysis_item, item_name, status, analys_type, true);
|
|
||||||
node_item->setData(project_name, ProjectName);
|
|
||||||
node_map[item_name] = node_item;
|
|
||||||
|
|
||||||
status = pro_model->GetAllChannelEnergyTotalCountDataFilename().isEmpty() ? QStringLiteral(u"无效") : QStringLiteral(u"有效");
|
|
||||||
analys_type = QVariant::fromValue(AnalysisType::EnergyCountSpectrumView);
|
analys_type = QVariant::fromValue(AnalysisType::EnergyCountSpectrumView);
|
||||||
item_name = QStringLiteral(u"能量计数谱");
|
item_name = QStringLiteral(u"能量计数谱");
|
||||||
node_item = AddChildNode(interactive_analysis_item, item_name, status, analys_type, true);
|
node_item = AddChildNode(interactive_analysis_item, item_name, status, analys_type, true, state_ok);
|
||||||
node_item->setData(project_name, ProjectName);
|
node_item->setData(project_name, ProjectName);
|
||||||
node_map[item_name] = node_item;
|
node_map[item_name] = node_item;
|
||||||
|
|
||||||
status = pro_model->GetSortAllChannelParticleDataFilename().isEmpty() ? QStringLiteral(u"无效") : QStringLiteral(u"有效");
|
state_ok = !pro_model->GetParticleEnergyDataFilename().isEmpty();
|
||||||
|
status = state_ok ? QStringLiteral(u"有效") : QStringLiteral(u"无效");
|
||||||
analys_type = QVariant::fromValue(AnalysisType::CountingRateView);
|
analys_type = QVariant::fromValue(AnalysisType::CountingRateView);
|
||||||
item_name = QStringLiteral(u"计数率分析");
|
item_name = QStringLiteral(u"计数率分析");
|
||||||
node_item = AddChildNode(interactive_analysis_item, item_name, status, analys_type, true);
|
node_item = AddChildNode(interactive_analysis_item, item_name, status, analys_type, true, state_ok);
|
||||||
node_item->setData(project_name, ProjectName);
|
node_item->setData(project_name, ProjectName);
|
||||||
node_map[item_name] = node_item;
|
node_map[item_name] = node_item;
|
||||||
|
|
||||||
status = pro_model->GetAllChannelEnergyTotalCountDataFilename().isEmpty() ? QStringLiteral(u"无效") : QStringLiteral(u"有效");
|
state_ok = !pro_model->GetParticleEnergyDataFilename().isEmpty();
|
||||||
|
status = state_ok ? QStringLiteral(u"有效") : QStringLiteral(u"无效");
|
||||||
analys_type = QVariant::fromValue(AnalysisType::EnergyPeakFitView);
|
analys_type = QVariant::fromValue(AnalysisType::EnergyPeakFitView);
|
||||||
item_name = QStringLiteral(u"峰拟合分析");
|
item_name = QStringLiteral(u"峰拟合分析");
|
||||||
node_item = AddChildNode(interactive_analysis_item, item_name, status, analys_type, true);
|
node_item = AddChildNode(interactive_analysis_item, item_name, status, analys_type, true, state_ok);
|
||||||
node_item->setData(project_name, ProjectName);
|
node_item->setData(project_name, ProjectName);
|
||||||
node_map[item_name] = node_item;
|
node_map[item_name] = node_item;
|
||||||
|
|
||||||
status = pro_model->GetAllChannelEnergyTotalCountDataFilename().isEmpty() ? QStringLiteral(u"无效") : QStringLiteral(u"有效");
|
state_ok = !pro_model->GetParticleEnergyDataFilename().isEmpty();
|
||||||
|
status = state_ok ? QStringLiteral(u"有效") : QStringLiteral(u"无效");
|
||||||
analys_type = QVariant::fromValue(AnalysisType::NuclideAnalysisView);
|
analys_type = QVariant::fromValue(AnalysisType::NuclideAnalysisView);
|
||||||
item_name = QStringLiteral(u"核素分析");
|
item_name = QStringLiteral(u"核素分析");
|
||||||
node_item = AddChildNode(interactive_analysis_item, item_name, status, analys_type, true);
|
node_item = AddChildNode(interactive_analysis_item, item_name, status, analys_type, true, state_ok);
|
||||||
node_item->setData(project_name, ProjectName);
|
node_item->setData(project_name, ProjectName);
|
||||||
node_map[item_name] = node_item;
|
node_map[item_name] = node_item;
|
||||||
|
|
||||||
status = pro_model->GetSortAllChannelParticleDataFilename().isEmpty() ? QStringLiteral(u"无效") : QStringLiteral(u"有效");
|
state_ok = !pro_model->GetParticleEnergyDataFilename().isEmpty();
|
||||||
|
status = state_ok ? QStringLiteral(u"有效") : QStringLiteral(u"无效");
|
||||||
analys_type = QVariant::fromValue(AnalysisType::ParticleInTimeView);
|
analys_type = QVariant::fromValue(AnalysisType::ParticleInTimeView);
|
||||||
item_name = QStringLiteral(u"粒子入射时间分析");
|
item_name = QStringLiteral(u"粒子入射时间分析");
|
||||||
node_item = AddChildNode(interactive_analysis_item, item_name, status, analys_type, true);
|
node_item = AddChildNode(interactive_analysis_item, item_name, status, analys_type, true, state_ok);
|
||||||
node_item->setData(project_name, ProjectName);
|
node_item->setData(project_name, ProjectName);
|
||||||
node_map[item_name] = node_item;
|
node_map[item_name] = node_item;
|
||||||
|
|
||||||
status = pro_model->GetSortAllChannelParticleDataFilename().isEmpty() ? QStringLiteral(u"无效") : QStringLiteral(u"有效");
|
state_ok = !pro_model->GetAllChannelParticleDataFilename().isEmpty();
|
||||||
|
status = state_ok ? QStringLiteral(u"有效") : QStringLiteral(u"无效");
|
||||||
analys_type = QVariant::fromValue(AnalysisType::ParticleTimeDiffView);
|
analys_type = QVariant::fromValue(AnalysisType::ParticleTimeDiffView);
|
||||||
item_name = QStringLiteral(u"粒子时间差分析");
|
item_name = QStringLiteral(u"粒子时间差分析");
|
||||||
node_item = AddChildNode(interactive_analysis_item, item_name, status, analys_type, true);
|
node_item = AddChildNode(interactive_analysis_item, item_name, status, analys_type, true, state_ok);
|
||||||
node_item->setData(project_name, ProjectName);
|
node_item->setData(project_name, ProjectName);
|
||||||
node_map[item_name] = node_item;
|
node_map[item_name] = node_item;
|
||||||
|
|
||||||
status = pro_model->GetTimeWinConformParticleDataFilenameList(conform_time_win).isEmpty() ? QStringLiteral(u"无效") : QStringLiteral(u"有效");
|
state_ok = !pro_model->GetTimeWinConformEnergyDataFilenameList(conform_time_win).isEmpty();
|
||||||
|
status = state_ok ? QStringLiteral(u"有效") : QStringLiteral(u"无效");
|
||||||
analys_type = QVariant::fromValue(AnalysisType::CoincidenceEventTimeView);
|
analys_type = QVariant::fromValue(AnalysisType::CoincidenceEventTimeView);
|
||||||
item_name = QStringLiteral(u"符合事件时间分析");
|
item_name = QStringLiteral(u"符合事件时间分析");
|
||||||
node_item = AddChildNode(interactive_analysis_item, item_name, status, analys_type, true);
|
node_item = AddChildNode(interactive_analysis_item, item_name, status, analys_type, true, state_ok);
|
||||||
node_item->setData(project_name, ProjectName);
|
node_item->setData(project_name, ProjectName);
|
||||||
node_map[item_name] = node_item;
|
node_map[item_name] = node_item;
|
||||||
|
|
||||||
|
state_ok = !pro_model->GetTimeWinConformEnergyDataFilenameList(conform_time_win).isEmpty();
|
||||||
|
status = state_ok ? QStringLiteral(u"有效") : QStringLiteral(u"无效");
|
||||||
analys_type = QVariant::fromValue(AnalysisType::CoincidenceParticleEnergySpectrumView);
|
analys_type = QVariant::fromValue(AnalysisType::CoincidenceParticleEnergySpectrumView);
|
||||||
item_name = QStringLiteral(u"符合能谱[%1ns]").arg(conform_time_win);
|
item_name = QStringLiteral(u"符合能谱[%1ns]").arg(conform_time_win);
|
||||||
node_item = AddChildNode(interactive_analysis_item, item_name, status, analys_type, true);
|
node_item = AddChildNode(interactive_analysis_item, item_name, status, analys_type, true, state_ok);
|
||||||
node_item->setData(project_name, ProjectName);
|
node_item->setData(project_name, ProjectName);
|
||||||
node_map[item_name] = node_item;
|
node_map[item_name] = node_item;
|
||||||
|
|
||||||
analys_type = QVariant::fromValue(AnalysisType::AntiCoincidenceSpectrumView);
|
analys_type = QVariant::fromValue(AnalysisType::AntiCoincidenceSpectrumView);
|
||||||
item_name = QStringLiteral(u"反符合能谱[%1ns]").arg(conform_time_win);
|
item_name = QStringLiteral(u"反符合能谱[%1ns]").arg(conform_time_win);
|
||||||
node_item = AddChildNode(interactive_analysis_item, item_name, status, analys_type, true);
|
node_item = AddChildNode(interactive_analysis_item, item_name, status, analys_type, true, state_ok);
|
||||||
node_item->setData(project_name, ProjectName);
|
node_item->setData(project_name, ProjectName);
|
||||||
node_map[item_name] = node_item;
|
node_map[item_name] = node_item;
|
||||||
|
|
||||||
|
state_ok = !pro_model->GetTimeWinConformEnergyDataFilenameList(conform_time_win).isEmpty();
|
||||||
|
status = state_ok ? QStringLiteral(u"有效") : QStringLiteral(u"无效");
|
||||||
analys_type = QVariant::fromValue(AnalysisType::CoincidenceParticleEnergySpectrum2DView);
|
analys_type = QVariant::fromValue(AnalysisType::CoincidenceParticleEnergySpectrum2DView);
|
||||||
item_name = QStringLiteral(u"二维符合能谱[%1ns]").arg(conform_time_win);
|
item_name = QStringLiteral(u"二维符合能谱[%1ns]").arg(conform_time_win);
|
||||||
node_item = AddChildNode(interactive_analysis_item, item_name, status, analys_type, true);
|
node_item = AddChildNode(interactive_analysis_item, item_name, status, analys_type, true, state_ok);
|
||||||
node_item->setData(project_name, ProjectName);
|
node_item->setData(project_name, ProjectName);
|
||||||
node_map[item_name] = node_item;
|
node_map[item_name] = node_item;
|
||||||
|
|
||||||
|
state_ok = !pro_model->GetTimeWinConformEnergyDataFilenameList(conform_time_win).isEmpty();
|
||||||
|
status = state_ok ? QStringLiteral(u"有效") : QStringLiteral(u"无效");
|
||||||
analys_type = QVariant::fromValue(AnalysisType::CoincidenceParticleEnergySpectrum3DView);
|
analys_type = QVariant::fromValue(AnalysisType::CoincidenceParticleEnergySpectrum3DView);
|
||||||
item_name = QStringLiteral(u"三维符合能谱[%1ns]").arg(conform_time_win);
|
item_name = QStringLiteral(u"三维符合能谱[%1ns]").arg(conform_time_win);
|
||||||
node_item = AddChildNode(interactive_analysis_item, item_name, status, analys_type, true);
|
node_item = AddChildNode(interactive_analysis_item, item_name, status, analys_type, true, state_ok);
|
||||||
node_item->setData(project_name, ProjectName);
|
node_item->setData(project_name, ProjectName);
|
||||||
node_map[item_name] = node_item;
|
node_map[item_name] = node_item;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,23 +28,18 @@ public:
|
||||||
void SetMeasurePresetTime(ulong measure_preset_time);
|
void SetMeasurePresetTime(ulong measure_preset_time);
|
||||||
void SetConformTimeWin(uint conform_time_win);
|
void SetConformTimeWin(uint conform_time_win);
|
||||||
void SetIsMeasureComplete(bool is_measure_complete);
|
void SetIsMeasureComplete(bool is_measure_complete);
|
||||||
|
|
||||||
void SetMeasureDeviceParamsCfgFilename(const QString& filename);
|
void SetMeasureDeviceParamsCfgFilename(const QString& filename);
|
||||||
void SetEnergyScaleFilename(const QString& filename);
|
void SetEnergyScaleFilename(const QString& filename);
|
||||||
void SetEfficiencyScaleFilename(const QString& filename);
|
void SetEfficiencyScaleFilename(const QString& filename);
|
||||||
|
|
||||||
void SetAllChannelParticleDataFilename(const QString& filename);
|
void SetAllChannelParticleDataFilename(const QString& filename);
|
||||||
void SetSortedParticleDataFilename(const QString& filename);
|
|
||||||
// void SetChannelParticleDataFilename(uint channel, const QString& filename);
|
// void SetChannelParticleDataFilename(uint channel, const QString& filename);
|
||||||
|
|
||||||
void SetChannelAddressCountDataFilename(uint channel, const QString& filename);
|
void SetChannelAddressCountDataFilename(uint channel, const QString& filename);
|
||||||
// void SetAllChannelParticleTotalCountDataFilename(const QString& filename);
|
// void SetAllChannelParticleTotalCountDataFilename(const QString& filename);
|
||||||
|
|
||||||
void SetChannelEnergyCountDataFilename(uint channel, const QString& filename);
|
void SetChannelEnergyCountDataFilename(uint channel, const QString& filename);
|
||||||
void SetAllChannelEnergyTotalCountDataFilename(const QString& filename);
|
void SetAllChannelEnergyTotalCountDataFilename(const QString& filename);
|
||||||
|
void SetParticleEnergyDataFilename(const QString& filename);
|
||||||
void SetTimeWinConformParticleData(uint time_win, uint conform_particle_count, const QString& filename);
|
void SetTimeWinConformParticleData(uint time_win, uint conform_particle_count, const QString& filename);
|
||||||
|
void SetTimeWinConformEnergyData(uint time_win, uint conform_particle_count, const QString& filename);
|
||||||
void SetAnalysisCustomData(AnalysisType analysis_type, const QString& data_item_name, const QString& data_filename);
|
void SetAnalysisCustomData(AnalysisType analysis_type, const QString& data_item_name, const QString& data_filename);
|
||||||
|
|
||||||
const QString& GetProjectDir() const;
|
const QString& GetProjectDir() const;
|
||||||
|
|
@ -58,23 +53,18 @@ public:
|
||||||
const QString& GetMeasureDeviceParamsCfgFilename() const;
|
const QString& GetMeasureDeviceParamsCfgFilename() const;
|
||||||
const QString& GetEnergyScaleFilename() const;
|
const QString& GetEnergyScaleFilename() const;
|
||||||
const QString& GetEfficiencyScaleFilename() const;
|
const QString& GetEfficiencyScaleFilename() const;
|
||||||
|
|
||||||
const QString& GetAllChannelParticleDataFilename() const;
|
const QString& GetAllChannelParticleDataFilename() const;
|
||||||
const QString& GetSortAllChannelParticleDataFilename() const;
|
|
||||||
|
|
||||||
// const QMap<uint, QString>& GetChannelParticleDataFilenameList() const;
|
// const QMap<uint, QString>& GetChannelParticleDataFilenameList() const;
|
||||||
// const QString& GetChannelParticleDataFilename(uint channel) const;
|
// const QString& GetChannelParticleDataFilename(uint channel) const;
|
||||||
|
|
||||||
const QMap<uint, QString>& GetChannelAddressCountDataFilenameList() const;
|
const QMap<uint, QString>& GetChannelAddressCountDataFilenameList() const;
|
||||||
const QString GetChannelAddressCountDataFilename(uint channel) const;
|
const QString GetChannelAddressCountDataFilename(uint channel) const;
|
||||||
// const QString& GetAllChannelParticleTotalCountDataFilename() const;
|
// const QString& GetAllChannelParticleTotalCountDataFilename() const;
|
||||||
|
|
||||||
const QMap<uint, QString>& GetChannelEnergyCountDataFilenameList() const;
|
const QMap<uint, QString>& GetChannelEnergyCountDataFilenameList() const;
|
||||||
const QString GetChannelEnergyCountDataFilename(uint channel) const;
|
const QString GetChannelEnergyCountDataFilename(uint channel) const;
|
||||||
const QString& GetAllChannelEnergyTotalCountDataFilename() const;
|
const QString& GetAllChannelEnergyTotalCountDataFilename() const;
|
||||||
|
const QString GetParticleEnergyDataFilename() const;
|
||||||
const QMap<uint, QString> GetTimeWinConformParticleDataFilenameList(uint time_win) const;
|
const QMap<uint, QString> GetTimeWinConformParticleDataFilenameList(uint time_win) const;
|
||||||
|
const QMap<uint, QString> GetTimeWinConformEnergyDataFilenameList(uint time_win) const;
|
||||||
const QString GetAnalysisCustomData(AnalysisType analysis_type, const QString& data_item_name);
|
const QString GetAnalysisCustomData(AnalysisType analysis_type, const QString& data_item_name);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
@ -85,25 +75,20 @@ private:
|
||||||
QString _description_info;
|
QString _description_info;
|
||||||
ulong _measure_preset_time = 0;
|
ulong _measure_preset_time = 0;
|
||||||
uint _conform_time_win = 50;
|
uint _conform_time_win = 50;
|
||||||
|
|
||||||
bool _is_measure_complete = false;
|
bool _is_measure_complete = false;
|
||||||
|
|
||||||
QString _measure_device_params_cfg_filename;
|
QString _measure_device_params_cfg_filename;
|
||||||
QString _energy_scale_filename;
|
QString _energy_scale_filename;
|
||||||
QString _efficiency_scale_filename;
|
QString _efficiency_scale_filename;
|
||||||
|
|
||||||
QString _all_channel_particle_data_filename;
|
QString _all_channel_particle_data_filename;
|
||||||
QString _sorted_particle_data_filename;
|
|
||||||
// QMap<uint, QString> _channel_particle_data_filename_list;
|
// QMap<uint, QString> _channel_particle_data_filename_list;
|
||||||
|
|
||||||
QMap<uint, QString> _channel_address_count_data_filename_list;
|
QMap<uint, QString> _channel_address_count_data_filename_list;
|
||||||
// QString _all_channel_particle_total_count_data_filename;
|
// QString _all_channel_particle_total_count_data_filename;
|
||||||
|
|
||||||
QMap<uint, QString> _channel_energy_count_data_filename_list;
|
QMap<uint, QString> _channel_energy_count_data_filename_list;
|
||||||
QString _all_channel_energy_total_count_data_filename;
|
QString _all_channel_energy_total_count_data_filename;
|
||||||
|
QString _particle_energy_data_filename;
|
||||||
QMap<uint, QMap<uint, QString> > _time_win_conform_particle_data;
|
QMap<uint, QMap<uint, QString> > _time_win_conform_particle_data;
|
||||||
|
QMap<uint, QMap<uint, QString> > _time_win_conform_energy_data;
|
||||||
QMap<AnalysisType, QMap<QString, QString> > _analysis_custom_data_set;
|
QMap<AnalysisType, QMap<QString, QString> > _analysis_custom_data_set;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
@ -131,7 +116,7 @@ public:
|
||||||
static MeasureAnalysisProjectModelList* Instance();
|
static MeasureAnalysisProjectModelList* Instance();
|
||||||
virtual ~MeasureAnalysisProjectModelList();
|
virtual ~MeasureAnalysisProjectModelList();
|
||||||
|
|
||||||
bool AddProjectModel(MeasureAnalysisProjectModel* model);
|
bool AddProjectModel(MeasureAnalysisProjectModel* model, bool save = true);
|
||||||
bool RmProjectModel(const QString& project_name);
|
bool RmProjectModel(const QString& project_name);
|
||||||
|
|
||||||
MeasureAnalysisProjectModel* GetProjectModel(const QString& project_name);
|
MeasureAnalysisProjectModel* GetProjectModel(const QString& project_name);
|
||||||
|
|
@ -143,17 +128,23 @@ public:
|
||||||
QStandardItem* GetItemFromIndex(const QModelIndex &index) const;
|
QStandardItem* GetItemFromIndex(const QModelIndex &index) const;
|
||||||
QStandardItem* AddChildNode(QStandardItem *parent_item,
|
QStandardItem* AddChildNode(QStandardItem *parent_item,
|
||||||
const QString &node_name,
|
const QString &node_name,
|
||||||
const QString &status = QString(),
|
const QString &status_text = QString(),
|
||||||
const QVariant &user_data = QVariant(),
|
const QVariant &user_data = QVariant(),
|
||||||
bool is_fixed = false);
|
bool is_fixed = false,
|
||||||
|
bool state_ok = false);
|
||||||
bool RemoveNode(QStandardItem *item);
|
bool RemoveNode(QStandardItem *item);
|
||||||
void SetNodeUserData(QStandardItem* item, const QVariant& data);
|
void SetNodeUserData(QStandardItem* item, const QVariant& data);
|
||||||
QVariant GetNodeUserData(QStandardItem* item, UserDataType data_type = NodeType) const;
|
QVariant GetNodeUserData(QStandardItem* item, UserDataType data_type = NodeType) const;
|
||||||
void SetNodeStatus(QStandardItem* item, const QString& status);
|
void SetNodeStatus(QStandardItem* item, const QString& status, bool state_ok = false);
|
||||||
QString GetNodeStatus(QStandardItem* item) const;
|
bool GetNodeStatus(QStandardItem* item) const;
|
||||||
|
|
||||||
|
void ApplyEnergyScale(const QString& project_name);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void onChannelAddressCountProcessFinished(const QString& project_name);
|
void onChannelAddressCountProcessFinished(bool ok, const QString& project_name, const QVariant& data);
|
||||||
|
void onEnergyScaleParticleDataFinished(bool ok, const QString& project_name, const QVariant& data);
|
||||||
|
void onEnergyCountProcessFinished(bool ok, const QString& project_name, const QVariant& data);
|
||||||
|
void onCoincidenceProcessFinished(bool ok, const QString& project_name, const QVariant& data);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void intiProjectNodeStruce(MeasureAnalysisProjectModel *pro_model);
|
void intiProjectNodeStruce(MeasureAnalysisProjectModel *pro_model);
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,20 @@ MeasureAnalysisTreeView::MeasureAnalysisTreeView(QWidget* parent)
|
||||||
connect(this, &QTreeView::doubleClicked, this, &MeasureAnalysisTreeView::onNodeDoubleClicked);
|
connect(this, &QTreeView::doubleClicked, this, &MeasureAnalysisTreeView::onNodeDoubleClicked);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MeasureAnalysisTreeView::RemoveItemView(const QString &item_name)
|
||||||
|
{
|
||||||
|
for (auto it = _item_views.constBegin(); it!=_item_views.constEnd(); ++it ) {
|
||||||
|
MeasureAnalysisView* view = it.value();
|
||||||
|
if (view) {
|
||||||
|
if ( view->GetViewName() == item_name ) {
|
||||||
|
emit removeItemView(view);
|
||||||
|
_item_views.remove(it.key());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void MeasureAnalysisTreeView::onCustomContextMenuRequested(const QPoint& pos)
|
void MeasureAnalysisTreeView::onCustomContextMenuRequested(const QPoint& pos)
|
||||||
{
|
{
|
||||||
QModelIndex index = indexAt(pos);
|
QModelIndex index = indexAt(pos);
|
||||||
|
|
@ -56,85 +70,73 @@ void MeasureAnalysisTreeView::onNodeDoubleClicked(const QModelIndex& index)
|
||||||
if (!analysis_type_data.isValid())
|
if (!analysis_type_data.isValid())
|
||||||
return;
|
return;
|
||||||
AnalysisType analysis_type = analysis_type_data.value<AnalysisType>();
|
AnalysisType analysis_type = analysis_type_data.value<AnalysisType>();
|
||||||
|
QMap<QString, QVariant> data_files_set;
|
||||||
switch(analysis_type) {
|
MeasureAnalysisView* view = nullptr;
|
||||||
case AnalysisType::ParticleData: {
|
if ( _item_views.contains(item) ) {
|
||||||
MeasureAnalysisProjectModel* project_model = _model->GetProjectModel(project_name);
|
view = _item_views[item];
|
||||||
if (project_model) {
|
} else {
|
||||||
auto file_name = project_model->GetAllChannelParticleDataFilename();
|
switch(analysis_type) {
|
||||||
if ( !file_name.isEmpty() ) {
|
case AnalysisType::ParticleData: {
|
||||||
QMap<QString, QVariant> data_files_set;
|
|
||||||
data_files_set[QStringLiteral(u"粒子数据")] = file_name;
|
|
||||||
MeasureAnalysisView* view = MeasureAnalysisView::NewAnalyzeView(analysis_type);
|
|
||||||
if ( view ) {
|
|
||||||
view->SetProjectName(project_name);
|
|
||||||
const auto& view_name = QStringLiteral(u"%1 [%2]").arg(item_text).arg(project_name);
|
|
||||||
view->SetViewName(view_name);
|
|
||||||
view->SetViewDescription(view_name);
|
|
||||||
view->InitViewWorkspace(project_name);
|
|
||||||
view->SetAnalyzeDataFilename(data_files_set);
|
|
||||||
emit currentItemView(view);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} break;
|
|
||||||
case AnalysisType::AddressCountData: {
|
|
||||||
QVariant ch_num_data = _model->GetNodeUserData(item, ProjectList::ChannelNum);
|
|
||||||
if (ch_num_data.isValid()) {
|
|
||||||
int ch_num = ch_num_data.toInt();
|
|
||||||
MeasureAnalysisProjectModel* project_model = _model->GetProjectModel(project_name);
|
MeasureAnalysisProjectModel* project_model = _model->GetProjectModel(project_name);
|
||||||
if (project_model) {
|
if (project_model) {
|
||||||
auto file_name = project_model->GetChannelAddressCountDataFilename(ch_num);
|
auto file_name = project_model->GetAllChannelParticleDataFilename();
|
||||||
if ( !file_name.isEmpty() ) {
|
if ( !file_name.isEmpty() ) {
|
||||||
QMap<QString, QVariant> data_files_set;
|
data_files_set[QStringLiteral(u"粒子数据")] = file_name;
|
||||||
data_files_set[QStringLiteral(u"通道%1道址计数").arg(ch_num)] = file_name;
|
|
||||||
MeasureAnalysisView* view = MeasureAnalysisView::NewAnalyzeView(analysis_type);
|
|
||||||
if ( view ) {
|
|
||||||
view->SetProjectName(project_name);
|
|
||||||
const auto& view_name = QStringLiteral(u"%1[%2]").arg(item_text).arg(project_name);
|
|
||||||
view->SetViewName(view_name);
|
|
||||||
view->SetViewDescription(view_name);
|
|
||||||
view->InitViewWorkspace(project_name);
|
|
||||||
view->SetAnalyzeDataFilename(data_files_set);
|
|
||||||
emit currentItemView(view);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} break;
|
||||||
} break;
|
case AnalysisType::AddressCountData: {
|
||||||
case AnalysisType::AddressCountSpectrumView: {
|
QVariant ch_num_data = _model->GetNodeUserData(item, ProjectList::ChannelNum);
|
||||||
MeasureAnalysisProjectModel* project_model = _model->GetProjectModel(project_name);
|
if (ch_num_data.isValid()) {
|
||||||
if (project_model) {
|
int ch_num = ch_num_data.toInt();
|
||||||
auto file_name_list = project_model->GetChannelAddressCountDataFilenameList();
|
MeasureAnalysisProjectModel* project_model = _model->GetProjectModel(project_name);
|
||||||
if ( !file_name_list.isEmpty() ) {
|
if (project_model) {
|
||||||
QMap<QString, QVariant> data_files_set;
|
auto file_name = project_model->GetChannelAddressCountDataFilename(ch_num);
|
||||||
auto ch_num_list = file_name_list.keys();
|
|
||||||
for(auto ch_num : ch_num_list) {
|
|
||||||
auto file_name = file_name_list[ch_num];
|
|
||||||
if ( !file_name.isEmpty() ) {
|
if ( !file_name.isEmpty() ) {
|
||||||
data_files_set[QStringLiteral(u"通道%1").arg(ch_num)] = file_name;
|
data_files_set[QStringLiteral(u"通道%1道址计数").arg(ch_num)] = file_name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
MeasureAnalysisView* view = nullptr;
|
}
|
||||||
if ( _item_views.contains(item) ) {
|
} break;
|
||||||
view = _item_views[item];
|
case AnalysisType::ParticleEnergyData: {
|
||||||
} else {
|
MeasureAnalysisProjectModel* project_model = _model->GetProjectModel(project_name);
|
||||||
view = MeasureAnalysisView::NewAnalyzeView(analysis_type);
|
if (project_model) {
|
||||||
view->SetProjectName(project_name);
|
auto file_name = project_model->GetParticleEnergyDataFilename();
|
||||||
const auto& view_name = QStringLiteral(u"%1[%2]").arg(item_text).arg(project_name);
|
if ( !file_name.isEmpty() ) {
|
||||||
view->SetViewName(view_name);
|
data_files_set[QStringLiteral(u"粒子能量数据")] = file_name;
|
||||||
view->SetViewDescription(view_name);
|
|
||||||
view->InitViewWorkspace(project_name);
|
|
||||||
view->SetAnalyzeDataFilename(data_files_set);
|
|
||||||
}
|
|
||||||
if ( view ) {
|
|
||||||
_item_views[item] = view;
|
|
||||||
emit currentItemView(view);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} break;
|
||||||
|
case AnalysisType::AddressCountSpectrumView: {
|
||||||
|
MeasureAnalysisProjectModel* project_model = _model->GetProjectModel(project_name);
|
||||||
|
if (project_model) {
|
||||||
|
auto file_name_list = project_model->GetChannelAddressCountDataFilenameList();
|
||||||
|
if ( !file_name_list.isEmpty() ) {
|
||||||
|
auto ch_num_list = file_name_list.keys();
|
||||||
|
for(auto ch_num : ch_num_list) {
|
||||||
|
auto file_name = file_name_list[ch_num];
|
||||||
|
if ( !file_name.isEmpty() ) {
|
||||||
|
data_files_set[QStringLiteral(u"通道%1").arg(ch_num)] = file_name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
} break;
|
if (!data_files_set.isEmpty()) {
|
||||||
default:
|
view = MeasureAnalysisView::NewAnalyzeView(analysis_type);
|
||||||
break;
|
view->SetProjectName(project_name);
|
||||||
|
const auto& view_name = QStringLiteral(u"%1[%2]").arg(item_text).arg(project_name);
|
||||||
|
view->SetViewName(view_name);
|
||||||
|
view->SetViewDescription(view_name);
|
||||||
|
view->InitViewWorkspace(project_name);
|
||||||
|
view->SetAnalyzeDataFilename(data_files_set);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ( view ) {
|
||||||
|
_item_views[item] = view;
|
||||||
|
emit currentItemView(view);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@ class MeasureAnalysisTreeView : public QTreeView
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit MeasureAnalysisTreeView(QWidget *parent = nullptr);
|
explicit MeasureAnalysisTreeView(QWidget *parent = nullptr);
|
||||||
|
void RemoveItemView(const QString& item_name);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void onCustomContextMenuRequested(const QPoint &pos);
|
void onCustomContextMenuRequested(const QPoint &pos);
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,10 @@ MeasureAnalysisView *MeasureAnalysisView::NewAnalyzeView(AnalysisType view_type)
|
||||||
new_view = new MeasureAnalysisDataTableView;
|
new_view = new MeasureAnalysisDataTableView;
|
||||||
new_view->setDeleteOnClose(true);
|
new_view->setDeleteOnClose(true);
|
||||||
} break;
|
} break;
|
||||||
|
case AnalysisType::ParticleEnergyData: {
|
||||||
|
new_view = new MeasureAnalysisDataTableView;
|
||||||
|
new_view->setDeleteOnClose(true);
|
||||||
|
} break;
|
||||||
case AnalysisType::AddressCountData: {
|
case AnalysisType::AddressCountData: {
|
||||||
new_view = new MeasureAnalysisDataTableView;
|
new_view = new MeasureAnalysisDataTableView;
|
||||||
new_view->setDeleteOnClose(true);
|
new_view->setDeleteOnClose(true);
|
||||||
|
|
@ -72,8 +76,8 @@ MeasureAnalysisView *MeasureAnalysisView::NewAnalyzeView(AnalysisType view_type)
|
||||||
// new_view->setDeleteOnClose(false);
|
// new_view->setDeleteOnClose(false);
|
||||||
} break;
|
} break;
|
||||||
case AnalysisType::ParticleInTimeView: {
|
case AnalysisType::ParticleInTimeView: {
|
||||||
// new_view = new MeasureAnalysisDataTableView;
|
new_view = new MeasureAnalysisDataTableView;
|
||||||
// new_view->setDeleteOnClose(false);
|
new_view->setDeleteOnClose(false);
|
||||||
} break;
|
} break;
|
||||||
case AnalysisType::ParticleTimeDiffView: {
|
case AnalysisType::ParticleTimeDiffView: {
|
||||||
// new_view = new MeasureAnalysisParticleCountPlotView;
|
// new_view = new MeasureAnalysisParticleCountPlotView;
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,8 @@
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
|
#include <QTimer>
|
||||||
|
#include "DataProcessWorkPool.h"
|
||||||
|
|
||||||
NewMeasureAnalysisDlg::NewMeasureAnalysisDlg(QWidget *parent)
|
NewMeasureAnalysisDlg::NewMeasureAnalysisDlg(QWidget *parent)
|
||||||
: QDialog(parent)
|
: QDialog(parent)
|
||||||
|
|
@ -12,6 +14,15 @@ NewMeasureAnalysisDlg::NewMeasureAnalysisDlg(QWidget *parent)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
initialization();
|
initialization();
|
||||||
|
|
||||||
|
this->_task_wait_timer = new QTimer(this);
|
||||||
|
this->_task_wait_timer->setInterval(200);
|
||||||
|
connect(this->_task_wait_timer, &QTimer::timeout, [this](){
|
||||||
|
int progress = ui->progressBar->value();
|
||||||
|
if ( progress >= ui->progressBar->maximum() )
|
||||||
|
progress = 0;
|
||||||
|
ui->progressBar->setValue(progress + 10);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
NewMeasureAnalysisDlg::~NewMeasureAnalysisDlg()
|
NewMeasureAnalysisDlg::~NewMeasureAnalysisDlg()
|
||||||
|
|
@ -21,6 +32,8 @@ NewMeasureAnalysisDlg::~NewMeasureAnalysisDlg()
|
||||||
|
|
||||||
void NewMeasureAnalysisDlg::initialization()
|
void NewMeasureAnalysisDlg::initialization()
|
||||||
{
|
{
|
||||||
|
ui->progressBar->setVisible(false);
|
||||||
|
|
||||||
QRegExp rx(R"(^[^\\/:*?"<>|]+$)");
|
QRegExp rx(R"(^[^\\/:*?"<>|]+$)");
|
||||||
QValidator *validator = new QRegExpValidator(rx, this);
|
QValidator *validator = new QRegExpValidator(rx, this);
|
||||||
ui->lineEdit_name->setValidator(validator);
|
ui->lineEdit_name->setValidator(validator);
|
||||||
|
|
@ -53,7 +66,7 @@ void NewMeasureAnalysisDlg::initialization()
|
||||||
}
|
}
|
||||||
QFileInfo file_info(filename);
|
QFileInfo file_info(filename);
|
||||||
if (file_info.size() == 0) {
|
if (file_info.size() == 0) {
|
||||||
QMessageBox::warning(this, QStringLiteral(u"警告"), QStringLiteral(u"选择的粒子数据文件为空文件!"));
|
QMessageBox::warning(this, QStringLiteral(u"警告"), QStringLiteral(u"选择的粒子数据文件为空文件!"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ui->lineEdit_filename->setText(file_info.fileName());
|
ui->lineEdit_filename->setText(file_info.fileName());
|
||||||
|
|
@ -102,54 +115,24 @@ void NewMeasureAnalysisDlg::initialization()
|
||||||
connect(ui->btn_cancel, &QPushButton::clicked, this, &NewMeasureAnalysisDlg::reject);
|
connect(ui->btn_cancel, &QPushButton::clicked, this, &NewMeasureAnalysisDlg::reject);
|
||||||
}
|
}
|
||||||
|
|
||||||
void NewMeasureAnalysisDlg::on_btn_ok_clicked()
|
void NewMeasureAnalysisDlg::newProject(const QString& particle_data_filename)
|
||||||
{
|
{
|
||||||
const QString& project_name = ui->lineEdit_name->text();
|
const QString& project_name = ui->lineEdit_name->text();
|
||||||
if (project_name.isEmpty()) {
|
|
||||||
QMessageBox::warning(this, QStringLiteral(u"警告"), QStringLiteral(u"请输入测量分析名称!"));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
QString projects_dir_path = QDir(qApp->applicationDirPath()).filePath("Projects");
|
QString projects_dir_path = QDir(qApp->applicationDirPath()).filePath("Projects");
|
||||||
QDir projects_dir(projects_dir_path);
|
QDir projects_dir(projects_dir_path);
|
||||||
QString project_dir_path = projects_dir.filePath(project_name);
|
QString project_dir_path = projects_dir.filePath(project_name);
|
||||||
QDir project_dir(project_dir_path);
|
|
||||||
if (project_dir.exists()) {
|
bool is_std_source = ui->checkBox_is_std_source->isChecked();
|
||||||
QMessageBox::warning(this, QStringLiteral(u"警告"), QStringLiteral(u"测量分析名称已存在,请重新输入!"));
|
ulong measure_preset_time = ui->spinBox_measure_preset_time->value();
|
||||||
return;
|
uint conform_time_win = ui->spinBox_conform_time->value();
|
||||||
}
|
QString description_info = ui->plainTextEdit_description->toPlainText();
|
||||||
MeasureAnalysisProjectModel::SpectrumType spec_type = MeasureAnalysisProjectModel::SpectrumType::None;
|
MeasureAnalysisProjectModel::SpectrumType spec_type = MeasureAnalysisProjectModel::SpectrumType::None;
|
||||||
if (ui->rbtn_sample_spec->isChecked()) {
|
if (ui->rbtn_sample_spec->isChecked()) {
|
||||||
spec_type = MeasureAnalysisProjectModel::SpectrumType::Sample;
|
spec_type = MeasureAnalysisProjectModel::SpectrumType::Sample;
|
||||||
} else if (ui->rbtn_background_spec->isChecked()) {
|
} else if (ui->rbtn_background_spec->isChecked()) {
|
||||||
spec_type = MeasureAnalysisProjectModel::SpectrumType::Background;
|
spec_type = MeasureAnalysisProjectModel::SpectrumType::Background;
|
||||||
}
|
}
|
||||||
bool is_std_source = ui->checkBox_is_std_source->isChecked();
|
bool is_measure_complete = true;
|
||||||
ulong measure_preset_time = ui->spinBox_measure_preset_time->value();
|
|
||||||
uint conform_time_win = ui->spinBox_conform_time->value();
|
|
||||||
QString description_info = ui->plainTextEdit_description->toPlainText();
|
|
||||||
bool is_measure_complete = false;
|
|
||||||
|
|
||||||
QString data_file_path;
|
|
||||||
if (ui->checkBox_file_data->isChecked()) {
|
|
||||||
data_file_path = ui->lineEdit_filename->property("data_file_path").toString();
|
|
||||||
if (data_file_path.isEmpty()) {
|
|
||||||
QMessageBox::warning(this, QStringLiteral(u"警告"), QStringLiteral(u"请选择粒子数据文件!"));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
project_dir.mkpath(project_dir_path);
|
|
||||||
// 拷贝粒子数据文件到项目目录
|
|
||||||
QFileInfo data_file_info(data_file_path);
|
|
||||||
QString all_channel_particle_data_filename = project_dir.filePath(data_file_info.fileName());
|
|
||||||
if (!QFile::copy(data_file_path, all_channel_particle_data_filename)) {
|
|
||||||
QMessageBox::warning(this, QStringLiteral(u"警告"), QStringLiteral(u"载入粒子数据文件到项目目录失败!"));
|
|
||||||
project_dir.removeRecursively();
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
is_measure_complete = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
MeasureAnalysisProjectModel* model = new MeasureAnalysisProjectModel;
|
MeasureAnalysisProjectModel* model = new MeasureAnalysisProjectModel;
|
||||||
model->SetProjectDir(project_dir_path);
|
model->SetProjectDir(project_dir_path);
|
||||||
model->SetProjectName(project_name);
|
model->SetProjectName(project_name);
|
||||||
|
|
@ -158,10 +141,88 @@ void NewMeasureAnalysisDlg::on_btn_ok_clicked()
|
||||||
model->SetMeasurePresetTime(measure_preset_time);
|
model->SetMeasurePresetTime(measure_preset_time);
|
||||||
model->SetConformTimeWin(conform_time_win);
|
model->SetConformTimeWin(conform_time_win);
|
||||||
model->SetDescriptionInfo(description_info);
|
model->SetDescriptionInfo(description_info);
|
||||||
model->SetAllChannelParticleDataFilename(all_channel_particle_data_filename);
|
model->SetAllChannelParticleDataFilename(particle_data_filename);
|
||||||
model->SetIsMeasureComplete(is_measure_complete);
|
model->SetIsMeasureComplete(is_measure_complete);
|
||||||
|
|
||||||
ProjectList::Instance()->AddProjectModel(model);
|
ProjectList::Instance()->AddProjectModel(model);
|
||||||
|
|
||||||
NewMeasureAnalysisDlg::accept();
|
NewMeasureAnalysisDlg::accept();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void NewMeasureAnalysisDlg::onNewProjectFromFileFinished(bool ok, const QString& project_name, const QVariant &data)
|
||||||
|
{
|
||||||
|
QString projects_dir_path = QDir(qApp->applicationDirPath()).filePath("Projects");
|
||||||
|
QDir projects_dir(projects_dir_path);
|
||||||
|
QString project_dir_path = projects_dir.filePath(project_name);
|
||||||
|
QDir project_dir(project_dir_path);
|
||||||
|
if (ok) {
|
||||||
|
QString all_channel_particle_data_filename = data.toString();
|
||||||
|
QFileInfo data_file_info(all_channel_particle_data_filename);
|
||||||
|
if ( data_file_info.exists(all_channel_particle_data_filename) ) {
|
||||||
|
this->newProject(all_channel_particle_data_filename);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
project_dir.removeRecursively();
|
||||||
|
const QString& data_file_path = ui->lineEdit_filename->property("data_file_path").toString();
|
||||||
|
QMessageBox::warning(this, QStringLiteral(u"警告"), QStringLiteral(u"粒子数据%1异常,创建测量分析项目失败!").arg(data_file_path));
|
||||||
|
}
|
||||||
|
this->_task_wait_timer->stop();
|
||||||
|
ui->progressBar->setVisible(false);
|
||||||
|
|
||||||
|
ui->stackedWidget->setEnabled(true);
|
||||||
|
ui->label_note->setEnabled(true);
|
||||||
|
ui->plainTextEdit_description->setEnabled(true);
|
||||||
|
ui->btn_previous_step->setEnabled(true);
|
||||||
|
ui->btn_next_step->setEnabled(true);
|
||||||
|
ui->btn_ok->setEnabled(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
void NewMeasureAnalysisDlg::on_btn_ok_clicked()
|
||||||
|
{
|
||||||
|
const QString& project_name = ui->lineEdit_name->text();
|
||||||
|
if (project_name.isEmpty()) {
|
||||||
|
QMessageBox::warning(this, QStringLiteral(u"警告"), QStringLiteral(u"请输入测量分析名称!"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
QString projects_dir_path = QDir(qApp->applicationDirPath()).filePath("Projects");
|
||||||
|
QDir projects_dir(projects_dir_path);
|
||||||
|
QString project_dir_path = projects_dir.filePath(project_name);
|
||||||
|
QDir project_dir(project_dir_path);
|
||||||
|
if (project_dir.exists()) {
|
||||||
|
QMessageBox::warning(this, QStringLiteral(u"警告"), QStringLiteral(u"测量分析名称已存在,请重新输入!"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if ( !project_dir.mkpath(project_dir_path) ) {
|
||||||
|
QMessageBox::warning(this, QStringLiteral(u"警告"), QStringLiteral(u"创建测量分析项目工作目录失败:\n%1!").arg(project_dir_path));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if ( ui->checkBox_file_data->isChecked() ) {
|
||||||
|
const QString& data_file_path = ui->lineEdit_filename->property("data_file_path").toString();
|
||||||
|
if (data_file_path.isEmpty()) {
|
||||||
|
QMessageBox::warning(this, QStringLiteral(u"警告"), QStringLiteral(u"请选择粒子数据文件!"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
auto separate_task = new DataProcessWorkPool::ParticleDataSortByMinimysTask;
|
||||||
|
separate_task->SetAllChannelParticleDataFilename(data_file_path);
|
||||||
|
separate_task->SetSortedResultDir(project_dir_path);
|
||||||
|
separate_task->SetFinishedNotifier(this, "onNewProjectFromFileFinished", project_name);
|
||||||
|
separate_task->StartTask();
|
||||||
|
|
||||||
|
ui->stackedWidget->setEnabled(false);
|
||||||
|
ui->label_note->setEnabled(false);
|
||||||
|
ui->plainTextEdit_description->setEnabled(false);
|
||||||
|
ui->btn_previous_step->setEnabled(false);
|
||||||
|
ui->btn_next_step->setEnabled(false);
|
||||||
|
ui->btn_ok->setEnabled(false);
|
||||||
|
|
||||||
|
ui->progressBar->setVisible(true);
|
||||||
|
this->_task_wait_timer->start();
|
||||||
|
} else {
|
||||||
|
this->newProject();
|
||||||
|
}
|
||||||
|
|
||||||
|
// const QString& result_data_dir = QDir(project_model->GetProjectDir()).filePath("EveryChannelParticleData");
|
||||||
|
// auto separate_task = new DataProcessWorkPool::EveryChannelParticleDataSeparateTask;
|
||||||
|
// separate_task->SetAllChannelParticleDataFilename(project_model->GetAllChannelParticleDataFilename());
|
||||||
|
// separate_task->SetResultDataDir(result_data_dir);
|
||||||
|
// separate_task->SetFinishedNotifier(this->_tree_measure_analysis, "onFinishedSeparateEveryChannelParticleData", project_name);
|
||||||
|
// separate_task->StartTask();
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,8 @@
|
||||||
|
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
|
|
||||||
|
class QTimer;
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class NewMeasureAnalysisDlg;
|
class NewMeasureAnalysisDlg;
|
||||||
}
|
}
|
||||||
|
|
@ -17,12 +19,15 @@ public:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void initialization();
|
void initialization();
|
||||||
|
void newProject(const QString &particle_data_filename = QString());
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
void onNewProjectFromFileFinished(bool ok, const QString& project_name, const QVariant &data);
|
||||||
void on_btn_ok_clicked();
|
void on_btn_ok_clicked();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::NewMeasureAnalysisDlg *ui;
|
Ui::NewMeasureAnalysisDlg *ui;
|
||||||
|
QTimer* _task_wait_timer = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // NEWMEASUREANALYSISDLG_H
|
#endif // NEWMEASUREANALYSISDLG_H
|
||||||
|
|
|
||||||
|
|
@ -6,8 +6,8 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>534</width>
|
<width>550</width>
|
||||||
<height>279</height>
|
<height>278</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
|
|
@ -36,7 +36,7 @@
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label">
|
<widget class="QLabel" name="label_project_name">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
|
|
@ -68,7 +68,7 @@
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_2">
|
<widget class="QLabel" name="label_spec_type">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
|
|
@ -501,7 +501,7 @@
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_8">
|
<layout class="QHBoxLayout" name="horizontalLayout_8">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_8">
|
<widget class="QLabel" name="label_note">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Fixed" vsizetype="Expanding">
|
<sizepolicy hsizetype="Fixed" vsizetype="Expanding">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
|
|
@ -542,14 +542,45 @@
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||||
|
<item>
|
||||||
|
<widget class="QProgressBar" name="progressBar">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>200</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="value">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignCenter</set>
|
||||||
|
</property>
|
||||||
|
<property name="textVisible">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="invertedAppearance">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="format">
|
||||||
|
<string>数据加载中······</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<spacer name="horizontalSpacer">
|
<spacer name="horizontalSpacer">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Horizontal</enum>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="sizeType">
|
||||||
|
<enum>QSizePolicy::Expanding</enum>
|
||||||
|
</property>
|
||||||
<property name="sizeHint" stdset="0">
|
<property name="sizeHint" stdset="0">
|
||||||
<size>
|
<size>
|
||||||
<width>40</width>
|
<width>1</width>
|
||||||
<height>20</height>
|
<height>20</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user