更改粒子时间差视图代码命名
This commit is contained in:
parent
3f9fe830ec
commit
f8f553ccd5
|
|
@ -762,7 +762,7 @@ bool EnergyScaleParticleDataTask::processTask()
|
||||||
out.close();
|
out.close();
|
||||||
std::remove(QStrToSysPath(energy_spectrum_filename));
|
std::remove(QStrToSysPath(energy_spectrum_filename));
|
||||||
const QString& e_what = QString::fromStdString(e.what());
|
const QString& e_what = QString::fromStdString(e.what());
|
||||||
LOG_WARN(QStringLiteral(u"能谱数据异常:%1").arg(e_what));
|
LOG_WARN(QStringLiteral(u"能谱数据处理异常:%1").arg(e_what));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
const QString& info = QStringLiteral(u"能谱数据处理完成.");
|
const QString& info = QStringLiteral(u"能谱数据处理完成.");
|
||||||
|
|
@ -935,4 +935,3 @@ bool EnergyScaleCoincidenceDataTask::processTask()
|
||||||
LOG_INFO(info);
|
LOG_INFO(info);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -224,7 +224,7 @@ void MeasureAnalysisTreeView::onNodeDoubleClicked(const QModelIndex& index)
|
||||||
if (project_model) {
|
if (project_model) {
|
||||||
auto file_name = project_model->GetAllChannelParticleDataFilename();
|
auto file_name = project_model->GetAllChannelParticleDataFilename();
|
||||||
if ( !file_name.isEmpty() ) {
|
if ( !file_name.isEmpty() ) {
|
||||||
data_files_set[QStringLiteral(u"粒子时间差")] = file_name;
|
data_files_set[QStringLiteral(u"粒子数据")] = file_name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
|
|
@ -241,11 +241,7 @@ void MeasureAnalysisTreeView::onNodeDoubleClicked(const QModelIndex& index)
|
||||||
MeasureAnalysisProjectModel* project_model = _model->GetProjectModel(project_name);
|
MeasureAnalysisProjectModel* project_model = _model->GetProjectModel(project_name);
|
||||||
if (project_model) {
|
if (project_model) {
|
||||||
QString file_name = project_model->GetMeasureDeviceParamsCfgFilename();
|
QString file_name = project_model->GetMeasureDeviceParamsCfgFilename();
|
||||||
if (!file_name.isEmpty()) {
|
data_files_set[QStringLiteral(u"设备参数配置")] = file_name;
|
||||||
data_files_set[QStringLiteral(u"设备参数配置")] = file_name;
|
|
||||||
} else {
|
|
||||||
data_files_set[QStringLiteral(u"设备参数配置")] = QString("");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
default:
|
default:
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,16 @@
|
||||||
#include "MeasureAnalysisView.h"
|
#include "MeasureAnalysisView.h"
|
||||||
#include <QMap>
|
#include "ConformityAnalysis.h"
|
||||||
|
#include "CountRateAnalysisView.h"
|
||||||
|
#include "DeviceConfigView.h"
|
||||||
|
#include "EnergyCountPeakFitView.h"
|
||||||
|
#include "EnergyCountPlotView.h"
|
||||||
#include "MeasureAnalysisDataTableView.h"
|
#include "MeasureAnalysisDataTableView.h"
|
||||||
#include "ParticleCountPlotView.h"
|
#include "ParticleCountPlotView.h"
|
||||||
#include "ParticleInjectTimeAnalysisView.h"
|
#include "ParticleInjectTimeAnalysisView.h"
|
||||||
#include "CountRateAnalysisView.h"
|
#include "ParticleTimeDifferenceView.h"
|
||||||
#include "EnergyCountPlotView.h"
|
#include <QMap>
|
||||||
#include "ParticleTimePoorView.h"
|
|
||||||
#include "ConformityAnalysis.h"
|
MeasureAnalysisView* MeasureAnalysisView::NewAnalyzeView(AnalysisType view_type)
|
||||||
#include "EnergyCountPeakFitView.h"
|
|
||||||
#include "DeviceConfigView.h"
|
|
||||||
MeasureAnalysisView *MeasureAnalysisView::NewAnalyzeView(AnalysisType view_type)
|
|
||||||
{
|
{
|
||||||
MeasureAnalysisView* new_view = nullptr;
|
MeasureAnalysisView* new_view = nullptr;
|
||||||
switch (view_type) {
|
switch (view_type) {
|
||||||
|
|
@ -18,8 +19,8 @@ MeasureAnalysisView *MeasureAnalysisView::NewAnalyzeView(AnalysisType view_type)
|
||||||
// new_view->setDeleteOnClose(true);
|
// new_view->setDeleteOnClose(true);
|
||||||
} break;
|
} break;
|
||||||
case AnalysisType::DeviceParamsCfg: {
|
case AnalysisType::DeviceParamsCfg: {
|
||||||
new_view = new DeviceConfigView;
|
new_view = new DeviceConfigView;
|
||||||
new_view->setDeleteOnClose(true);
|
new_view->setDeleteOnClose(true);
|
||||||
} break;
|
} break;
|
||||||
case AnalysisType::EnergyScale: {
|
case AnalysisType::EnergyScale: {
|
||||||
// new_view = new MeasureAnalysisDataTableView;
|
// new_view = new MeasureAnalysisDataTableView;
|
||||||
|
|
@ -66,12 +67,12 @@ MeasureAnalysisView *MeasureAnalysisView::NewAnalyzeView(AnalysisType view_type)
|
||||||
// new_view->setDeleteOnClose(false);
|
// new_view->setDeleteOnClose(false);
|
||||||
} break;
|
} break;
|
||||||
case AnalysisType::CoincidenceParticleEnergySpectrum3DView: {
|
case AnalysisType::CoincidenceParticleEnergySpectrum3DView: {
|
||||||
new_view = new ConformityAnalysis;
|
new_view = new ConformityAnalysis;
|
||||||
new_view->setDeleteOnClose(false);
|
new_view->setDeleteOnClose(false);
|
||||||
} break;
|
} break;
|
||||||
case AnalysisType::CountingRateView: {
|
case AnalysisType::CountingRateView: {
|
||||||
new_view = new CountRateAnalysisView;
|
new_view = new CountRateAnalysisView;
|
||||||
new_view->setDeleteOnClose(false);
|
new_view->setDeleteOnClose(false);
|
||||||
} break;
|
} break;
|
||||||
case AnalysisType::EnergyPeakFitView: {
|
case AnalysisType::EnergyPeakFitView: {
|
||||||
new_view = new EnergyCountPeakFitView;
|
new_view = new EnergyCountPeakFitView;
|
||||||
|
|
@ -86,8 +87,8 @@ MeasureAnalysisView *MeasureAnalysisView::NewAnalyzeView(AnalysisType view_type)
|
||||||
new_view->setDeleteOnClose(false);
|
new_view->setDeleteOnClose(false);
|
||||||
} break;
|
} break;
|
||||||
case AnalysisType::ParticleTimeDiffView: {
|
case AnalysisType::ParticleTimeDiffView: {
|
||||||
new_view = new ParticleTimePoorView;
|
new_view = new ParticleTimeDifferenceView;
|
||||||
new_view->setDeleteOnClose(false);
|
new_view->setDeleteOnClose(false);
|
||||||
} break;
|
} break;
|
||||||
case AnalysisType::CoincidenceEventTimeView: {
|
case AnalysisType::CoincidenceEventTimeView: {
|
||||||
// new_view = new MeasureAnalysisParticleCountPlotView;
|
// new_view = new MeasureAnalysisParticleCountPlotView;
|
||||||
|
|
@ -104,7 +105,7 @@ MeasureAnalysisView *MeasureAnalysisView::NewAnalyzeView(AnalysisType view_type)
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if ( new_view ) {
|
if (new_view) {
|
||||||
new_view->setAnalyzeType(view_type);
|
new_view->setAnalyzeType(view_type);
|
||||||
}
|
}
|
||||||
return new_view;
|
return new_view;
|
||||||
|
|
@ -116,12 +117,12 @@ MeasureAnalysisView::MeasureAnalysisView(QWidget* parent)
|
||||||
_analysis_type = AnalysisType::None;
|
_analysis_type = AnalysisType::None;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MeasureAnalysisView::SetProjectName(const QString &project_name)
|
void MeasureAnalysisView::SetProjectName(const QString& project_name)
|
||||||
{
|
{
|
||||||
_project_name = project_name;
|
_project_name = project_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
const QString &MeasureAnalysisView::GetProjectName() const
|
const QString& MeasureAnalysisView::GetProjectName() const
|
||||||
{
|
{
|
||||||
return _project_name;
|
return _project_name;
|
||||||
}
|
}
|
||||||
|
|
@ -141,22 +142,22 @@ MeasureAnalysisView::ViewType MeasureAnalysisView::GetViewType()
|
||||||
return _view_type;
|
return _view_type;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MeasureAnalysisView::SetViewName(const QString &name)
|
void MeasureAnalysisView::SetViewName(const QString& name)
|
||||||
{
|
{
|
||||||
this->_name = name;
|
this->_name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MeasureAnalysisView::SetViewDescription(const QString &description)
|
void MeasureAnalysisView::SetViewDescription(const QString& description)
|
||||||
{
|
{
|
||||||
this->_description = description;
|
this->_description = description;
|
||||||
}
|
}
|
||||||
|
|
||||||
const QString &MeasureAnalysisView::GetViewName() const
|
const QString& MeasureAnalysisView::GetViewName() const
|
||||||
{
|
{
|
||||||
return this->_name;
|
return this->_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
const QString &MeasureAnalysisView::GetViewDescription() const
|
const QString& MeasureAnalysisView::GetViewDescription() const
|
||||||
{
|
{
|
||||||
return this->_description;
|
return this->_description;
|
||||||
}
|
}
|
||||||
|
|
@ -185,4 +186,3 @@ QDataStream& operator>>(QDataStream& in, MeasureAnalysisView& view)
|
||||||
{
|
{
|
||||||
return in;
|
return in;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,264 +0,0 @@
|
||||||
#include "ParticleTimePoorView.h"
|
|
||||||
#include "ui_ParticleTimePoorView.h"
|
|
||||||
#include <QVBoxLayout>
|
|
||||||
#include <QPushButton>
|
|
||||||
#include <QMessageBox>
|
|
||||||
#include <QwtPlotCurve>
|
|
||||||
#include <QwtPlotMarker>
|
|
||||||
#include <QwtPlotZoneItem>
|
|
||||||
#include <QwtPlotCanvas>
|
|
||||||
#include <QwtPlotHistogram>
|
|
||||||
#include <QwtLegend>
|
|
||||||
#include <QwtText>
|
|
||||||
#include <cmath>
|
|
||||||
#include <QtMath>
|
|
||||||
#include "CustomQwtPlot.h"
|
|
||||||
#include <QDebug>
|
|
||||||
#include <GlobalDefine.h>
|
|
||||||
#include <QwtScaleWidget>
|
|
||||||
#include <QPen>
|
|
||||||
ParticleTimePoorView::ParticleTimePoorView(QWidget *parent) :
|
|
||||||
MeasureAnalysisView(parent),
|
|
||||||
ui(new Ui::ParticleTimePoorView)
|
|
||||||
{
|
|
||||||
ui->setupUi(this);
|
|
||||||
this->setViewType(PlotFrame);
|
|
||||||
|
|
||||||
InitUi();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
ParticleTimePoorView::~ParticleTimePoorView()
|
|
||||||
{
|
|
||||||
delete ui;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ParticleTimePoorView::InitViewWorkspace(const QString &project_name)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
void ParticleTimePoorView::SetAnalyzeDataFilename(const QMap<QString, QVariant> &data_files_set)
|
|
||||||
{
|
|
||||||
if (data_files_set.isEmpty()) {
|
|
||||||
LOG_WARN("文件集合为空");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
QString filePath = data_files_set.first().toString();
|
|
||||||
LOG_INFO("读取文件: " + filePath);
|
|
||||||
|
|
||||||
io::CSVReader<4> in(QStrToSysPath(filePath));
|
|
||||||
in.read_header(io::ignore_extra_column, "板卡号", "通道号", "道址", "时间计数");
|
|
||||||
|
|
||||||
int board, channel;
|
|
||||||
double energy, time_count;
|
|
||||||
QVector<uint64_t> timestamps;
|
|
||||||
|
|
||||||
while (in.read_row(board, channel, energy, time_count)) {
|
|
||||||
timestamps.append(static_cast<uint64_t>(time_count / 1e9));
|
|
||||||
}
|
|
||||||
if (timestamps.size() < 2) {
|
|
||||||
qDebug() << "数据不足,无法计算时间差";
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 1. 统计时间差分布
|
|
||||||
const int nNs = 1; // 分组宽度
|
|
||||||
QMap<uint64_t, int> mapVal;
|
|
||||||
for (int i = 0; i < timestamps.size() - 1; ++i) {
|
|
||||||
uint64_t diff = timestamps[i+1] - timestamps[i];
|
|
||||||
if(diff >= 1 )
|
|
||||||
{
|
|
||||||
qDebug()<<timestamps[i+1] << " "<< timestamps[i];
|
|
||||||
|
|
||||||
}
|
|
||||||
uint64_t binIndex = diff / nNs;
|
|
||||||
mapVal[binIndex]++;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 2. 准备直方图数据
|
|
||||||
QVector<QwtIntervalSample> histogramData;
|
|
||||||
double xMin = 0.0, xMax = 0.0; // 用于记录实际数据的最小/最大 x 值
|
|
||||||
int nmaxy = 0;
|
|
||||||
QMap<uint64_t, int>::iterator it = mapVal.begin();
|
|
||||||
for (; it != mapVal.end(); ++it) {
|
|
||||||
uint64_t binIndex = it.key();
|
|
||||||
int count = it.value();
|
|
||||||
|
|
||||||
double center = binIndex * nNs + nNs / 2.0;
|
|
||||||
double halfWidth = (nNs - 1) / 2.0;
|
|
||||||
double left = center - halfWidth;
|
|
||||||
double right = center + halfWidth;
|
|
||||||
|
|
||||||
if (left < xMin) xMin = left;
|
|
||||||
if (right > xMax) xMax = right;
|
|
||||||
|
|
||||||
QwtInterval interval(left, right);
|
|
||||||
histogramData.append(QwtIntervalSample(count, interval));
|
|
||||||
|
|
||||||
if (count > nmaxy) nmaxy = count;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 3. 创建直方图
|
|
||||||
QwtPlotHistogram* histogram = new QwtPlotHistogram();
|
|
||||||
histogram->setSamples(histogramData); // 注意:QwtPlotHistogram 使用 setData()
|
|
||||||
histogram->setBrush(QBrush(QColor(23, 229, 238)));
|
|
||||||
histogram->setStyle(QwtPlotHistogram::Columns);
|
|
||||||
histogram->attach(plot);
|
|
||||||
m_histogram = histogram; // 保存指针以便后续动态调整 y 轴
|
|
||||||
|
|
||||||
// ========== 修改后的 x 轴范围设置 ==========
|
|
||||||
const double MAX_DISPLAY_TIME = 5000.0; // 最大显示时间差 (ns),可根据需求调整
|
|
||||||
|
|
||||||
// 确保 xMin 不为负
|
|
||||||
if (xMin < 0.0) xMin = 0.0;
|
|
||||||
// x 轴显示上限:取实际数据最大值和 MAX_DISPLAY_TIME 的最小值
|
|
||||||
double xDisplayMax = qMin(xMax, MAX_DISPLAY_TIME);
|
|
||||||
// 如果实际数据最大值小于最大显示上限,则使用实际最大值;否则使用限制值
|
|
||||||
if (xDisplayMax <= xMin) xDisplayMax = xMin + 1.0; // 防止空范围
|
|
||||||
|
|
||||||
plot->setAxisScale(QwtPlot::xBottom, xMin, xDisplayMax);
|
|
||||||
plot->setAxisScale(QwtPlot::yLeft, 0, nmaxy * 1.05);
|
|
||||||
// ==========================================
|
|
||||||
|
|
||||||
// 4. 启用水平拖拽
|
|
||||||
QwtPlotPanner* panner = new QwtPlotPanner(plot->canvas());
|
|
||||||
panner->setAxisEnabled(QwtPlot::yLeft, false);
|
|
||||||
panner->setAxisEnabled(QwtPlot::xBottom, true);
|
|
||||||
|
|
||||||
// 获取 x 轴的 QwtScaleWidget
|
|
||||||
QwtScaleWidget* xAxisWidget = plot->axisWidget(QwtPlot::xBottom);
|
|
||||||
if (xAxisWidget) {
|
|
||||||
// 连接 x 轴的 scaleDivChanged 信号(无参版本)
|
|
||||||
connect(xAxisWidget, &QwtScaleWidget::scaleDivChanged, this,
|
|
||||||
[this]() {
|
|
||||||
if (m_histogram) {
|
|
||||||
// 获取当前 x 轴范围
|
|
||||||
const QwtScaleDiv& scaleDiv = plot->axisScaleDiv(QwtPlot::xBottom);
|
|
||||||
double min = scaleDiv.lowerBound();
|
|
||||||
double max = scaleDiv.upperBound();
|
|
||||||
|
|
||||||
// 计算当前 x 可见范围内的最大计数值
|
|
||||||
double maxY = 0.0;
|
|
||||||
const QwtSeriesData<QwtIntervalSample>* data = m_histogram->data();
|
|
||||||
if (data) {
|
|
||||||
for (int i = 0; i < data->size(); ++i) {
|
|
||||||
QwtIntervalSample sample = data->sample(i);
|
|
||||||
if (sample.interval.intersects(QwtInterval(min, max))) {
|
|
||||||
if (sample.value > maxY)
|
|
||||||
maxY = sample.value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (maxY == 0.0) maxY = 1.0;
|
|
||||||
plot->setAxisScale(QwtPlot::yLeft, 0, maxY * 1.05);
|
|
||||||
plot->replot();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// 6. 设置轴标题
|
|
||||||
plot->setAxisTitle(QwtPlot::xBottom, QStringLiteral(u"时间差 (ns)"));
|
|
||||||
plot->setAxisTitle(QwtPlot::yLeft, QStringLiteral(u"粒子计数"));
|
|
||||||
|
|
||||||
plot->replot();
|
|
||||||
LOG_INFO("直方图已添加并刷新");
|
|
||||||
}
|
|
||||||
|
|
||||||
void ParticleTimePoorView::setData(QVector<ParticleInjectTime> data)
|
|
||||||
{
|
|
||||||
// int energyStart = ui->label_energyStart->text().toInt();
|
|
||||||
// int energyEnd = ui->label_energyEnd->text().toInt();
|
|
||||||
|
|
||||||
// QVector<double> x;
|
|
||||||
// QVector<double> y;
|
|
||||||
|
|
||||||
// double minValue = 0;
|
|
||||||
// double maxValue = 0;
|
|
||||||
// for(auto info : data)
|
|
||||||
// {
|
|
||||||
// if(info.dEnergy <= energyStart || info.dEnergy >= energyEnd)
|
|
||||||
// {
|
|
||||||
// continue;
|
|
||||||
// }
|
|
||||||
// x.append(info.index);
|
|
||||||
// y.append(info.dTime);
|
|
||||||
// minValue = qMin(minValue, info.dTime);
|
|
||||||
// maxValue = qMax(maxValue, info.dTime);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// // 创建曲线并设置数据
|
|
||||||
// QwtPlotCurve *curve = new QwtPlotCurve();
|
|
||||||
// curve->setSamples(x, y);
|
|
||||||
// // 将曲线添加到 CustomQwtPlot 中(会自动分配颜色)
|
|
||||||
// plot->AddCurve(curve);
|
|
||||||
// // 设置坐标轴范围和标题
|
|
||||||
//// plot->setAxisScale(QwtPlot::xBottom, 0, x.last());
|
|
||||||
//// plot->setAxisScale(QwtPlot::yLeft,minValue , maxValue);
|
|
||||||
|
|
||||||
// LOG_INFO(QStringLiteral(u"%1数据读取完毕.").arg(this->GetViewName()));
|
|
||||||
|
|
||||||
// // 刷新绘图
|
|
||||||
// plot->replot();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
QVector<ParticleInjectTime> ParticleTimePoorView::getParticleInjectTimeData(QString path)
|
|
||||||
{
|
|
||||||
QVector<ParticleInjectTime> records;
|
|
||||||
|
|
||||||
io::CSVReader<4> in(QStrToSysPath(path));
|
|
||||||
in.read_header(io::ignore_extra_column, "板卡号", "通道号", "能量(KeV)", "时间计数");
|
|
||||||
|
|
||||||
int board, channel;
|
|
||||||
double energy, time_count;
|
|
||||||
int lineNumber = 0;
|
|
||||||
|
|
||||||
// 逐行读取
|
|
||||||
while (in.read_row(board, channel, energy, time_count))
|
|
||||||
{
|
|
||||||
int detector = board + channel * 8;
|
|
||||||
lineNumber++;
|
|
||||||
if(detector >= 32)
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
ParticleInjectTime rec;
|
|
||||||
rec.index = lineNumber;
|
|
||||||
rec.dEnergy = energy;
|
|
||||||
rec.dTime = time_count;
|
|
||||||
records.append(rec);
|
|
||||||
}
|
|
||||||
return records;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ParticleTimePoorView::InitUi()
|
|
||||||
{
|
|
||||||
plot = new CustomQwtPlot();
|
|
||||||
plot->SetXaxisDragScale(true);
|
|
||||||
setupPlot();
|
|
||||||
ui->verticalLayout_2->addWidget(plot);
|
|
||||||
}
|
|
||||||
|
|
||||||
void ParticleTimePoorView::setupPlot()
|
|
||||||
{
|
|
||||||
plot->setCanvasBackground(Qt::white);
|
|
||||||
QwtPlotCanvas* canvas = qobject_cast<QwtPlotCanvas*>(plot->canvas());
|
|
||||||
canvas->setFrameStyle(QFrame::NoFrame);
|
|
||||||
|
|
||||||
plot->setAxisTitle(QwtPlot::xBottom, QStringLiteral(u"粒子计数"));
|
|
||||||
plot->setAxisTitle(QwtPlot::yLeft, QStringLiteral(u"时间差"));
|
|
||||||
// set axis auto scale
|
|
||||||
plot->setAxisAutoScale(QwtPlot::xBottom, true);
|
|
||||||
plot->setAxisAutoScale(QwtPlot::yLeft, true);
|
|
||||||
// 启用网格线
|
|
||||||
plot->enableAxis(QwtPlot::xBottom);
|
|
||||||
plot->enableAxis(QwtPlot::yLeft);
|
|
||||||
|
|
||||||
// // 设置QWT图例
|
|
||||||
// QwtLegend* legend = new QwtLegend();
|
|
||||||
// legend->setDefaultItemMode(QwtLegendData::ReadOnly);
|
|
||||||
// plot->insertLegend(legend, QwtPlot::RightLegend);
|
|
||||||
|
|
||||||
plot->SetXaxisDragScale(true);
|
|
||||||
}
|
|
||||||
|
|
@ -1,44 +0,0 @@
|
||||||
#ifndef PARTICLETIMEPOORVIEW_H
|
|
||||||
#define PARTICLETIMEPOORVIEW_H
|
|
||||||
|
|
||||||
#include <QWidget>
|
|
||||||
#include "qwt.h"
|
|
||||||
#include "CustomQwtPlot.h"
|
|
||||||
#include <QFile>
|
|
||||||
#include <QTextStream>
|
|
||||||
#include "MeasureAnalysisView.h"
|
|
||||||
#include "csv.h"
|
|
||||||
#include <QwtPlotHistogram>
|
|
||||||
|
|
||||||
|
|
||||||
namespace Ui {
|
|
||||||
class ParticleTimePoorView;
|
|
||||||
}
|
|
||||||
|
|
||||||
class ParticleTimePoorView : public MeasureAnalysisView
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
|
||||||
explicit ParticleTimePoorView(QWidget *parent = nullptr);
|
|
||||||
virtual ~ParticleTimePoorView();
|
|
||||||
|
|
||||||
virtual void InitViewWorkspace(const QString& project_name) override final;
|
|
||||||
virtual void SetAnalyzeDataFilename(const QMap<QString, QVariant>& data_files_set);
|
|
||||||
|
|
||||||
void setData(QVector<ParticleInjectTime> data);
|
|
||||||
|
|
||||||
//获取数据
|
|
||||||
QVector<ParticleInjectTime> getParticleInjectTimeData(QString path);
|
|
||||||
private:
|
|
||||||
void InitUi();
|
|
||||||
void setupPlot();
|
|
||||||
|
|
||||||
private:
|
|
||||||
Ui::ParticleTimePoorView *ui;
|
|
||||||
CustomQwtPlot *plot;
|
|
||||||
QVector<ParticleInjectTime> m_AllData;//存储的所有的粒子入射时间数据
|
|
||||||
QwtPlotHistogram* m_histogram;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // PARTICLEINJECTTIMEANALYSIS_H
|
|
||||||
|
|
@ -1,64 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<ui version="4.0">
|
|
||||||
<class>ParticleTimePoorView</class>
|
|
||||||
<widget class="QWidget" name="ParticleTimePoorView">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>0</x>
|
|
||||||
<y>0</y>
|
|
||||||
<width>997</width>
|
|
||||||
<height>307</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="windowTitle">
|
|
||||||
<string>ParticleInjectTimeAnalysis</string>
|
|
||||||
</property>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
|
||||||
<property name="leftMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="topMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="rightMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="bottomMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<item>
|
|
||||||
<widget class="QWidget" name="widget" native="true">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="styleSheet">
|
|
||||||
<string notr="true"/>
|
|
||||||
</property>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
|
||||||
<property name="leftMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="topMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="rightMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="bottomMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<item>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_2"/>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
<layoutdefault spacing="6" margin="11"/>
|
|
||||||
<resources/>
|
|
||||||
<connections/>
|
|
||||||
</ui>
|
|
||||||
|
|
@ -36,10 +36,10 @@ INCLUDEPATH += \
|
||||||
$${PWD}/ParticleInjectTimeView \
|
$${PWD}/ParticleInjectTimeView \
|
||||||
$${PWD}/EnergyCountPlotView \
|
$${PWD}/EnergyCountPlotView \
|
||||||
$${PWD}/CountRateAnalysisView \
|
$${PWD}/CountRateAnalysisView \
|
||||||
$${PWD}/ParticleTimePoorView \
|
|
||||||
$${PWD}/ThreeDimensionalConformityAnalysisView \
|
$${PWD}/ThreeDimensionalConformityAnalysisView \
|
||||||
$${PWD}/EnergyCountPeakFitView \
|
$${PWD}/EnergyCountPeakFitView \
|
||||||
$${PWD}/MeasureAnalysisDataTableView \
|
$${PWD}/MeasureAnalysisDataTableView \
|
||||||
|
$${PWD}/ParticleTimeDifferenceView \
|
||||||
$${PWD}/MeasureAnalysisHistoryForm \
|
$${PWD}/MeasureAnalysisHistoryForm \
|
||||||
$${PWD}/DeviceParameterConfig
|
$${PWD}/DeviceParameterConfig
|
||||||
|
|
||||||
|
|
@ -50,10 +50,10 @@ DEPENDPATH += \
|
||||||
$${PWD}/ParticleInjectTimeView \
|
$${PWD}/ParticleInjectTimeView \
|
||||||
$${PWD}/EnergyCountPlotView \
|
$${PWD}/EnergyCountPlotView \
|
||||||
$${PWD}/CountRateAnalysisView \
|
$${PWD}/CountRateAnalysisView \
|
||||||
$${PWD}/ParticleTimePoorView \
|
|
||||||
$${PWD}/ThreeDimensionalConformityAnalysisView \
|
$${PWD}/ThreeDimensionalConformityAnalysisView \
|
||||||
$${PWD}/EnergyCountPeakFitView \
|
$${PWD}/EnergyCountPeakFitView \
|
||||||
$${PWD}/MeasureAnalysisDataTableView \
|
$${PWD}/MeasureAnalysisDataTableView \
|
||||||
|
$${PWD}/ParticleTimeDifferenceView \
|
||||||
$${PWD}/MeasureAnalysisHistoryForm \
|
$${PWD}/MeasureAnalysisHistoryForm \
|
||||||
$${PWD}/DeviceParameterConfig
|
$${PWD}/DeviceParameterConfig
|
||||||
|
|
||||||
|
|
@ -82,11 +82,11 @@ SOURCES += \
|
||||||
NewMeasureAnalysisDlg.cpp \
|
NewMeasureAnalysisDlg.cpp \
|
||||||
MeasureAnalysisProjectModel.cpp \
|
MeasureAnalysisProjectModel.cpp \
|
||||||
ParticleInjectTimeView/ParticleInjectTimeAnalysisView.cpp \
|
ParticleInjectTimeView/ParticleInjectTimeAnalysisView.cpp \
|
||||||
|
ParticleTimeDifferenceView/ParticleTimeDifferenceView.cpp \
|
||||||
VirtualTable/CsvDataSource.cpp \
|
VirtualTable/CsvDataSource.cpp \
|
||||||
VirtualTable/SampleDataSource.cpp \
|
VirtualTable/SampleDataSource.cpp \
|
||||||
VirtualTable/VirtualTableModel.cpp \
|
VirtualTable/VirtualTableModel.cpp \
|
||||||
VirtualTable/VirtualTableView.cpp \
|
VirtualTable/VirtualTableView.cpp \
|
||||||
ParticleTimePoorView/ParticleTimePoorView.cpp \
|
|
||||||
ThreeDimensionalConformityAnalysisView/ConformityAnalysis.cpp \
|
ThreeDimensionalConformityAnalysisView/ConformityAnalysis.cpp \
|
||||||
ThreeDimensionalConformityAnalysisView/DetectorStatusSummary.cpp \
|
ThreeDimensionalConformityAnalysisView/DetectorStatusSummary.cpp \
|
||||||
ThreeDimensionalConformityAnalysisView/ParticleDataStatistics.cpp \
|
ThreeDimensionalConformityAnalysisView/ParticleDataStatistics.cpp \
|
||||||
|
|
@ -121,12 +121,12 @@ HEADERS += \
|
||||||
NewMeasureAnalysisDlg.h \
|
NewMeasureAnalysisDlg.h \
|
||||||
MeasureAnalysisProjectModel.h \
|
MeasureAnalysisProjectModel.h \
|
||||||
ParticleInjectTimeView/ParticleInjectTimeAnalysisView.h \
|
ParticleInjectTimeView/ParticleInjectTimeAnalysisView.h \
|
||||||
|
ParticleTimeDifferenceView/ParticleTimeDifferenceView.h \
|
||||||
VirtualTable/CsvDataSource.h \
|
VirtualTable/CsvDataSource.h \
|
||||||
VirtualTable/DataSource.h \
|
VirtualTable/DataSource.h \
|
||||||
VirtualTable/SampleDataSource.h \
|
VirtualTable/SampleDataSource.h \
|
||||||
VirtualTable/VirtualTableModel.h \
|
VirtualTable/VirtualTableModel.h \
|
||||||
VirtualTable/VirtualTableView.h\
|
VirtualTable/VirtualTableView.h\
|
||||||
ParticleTimePoorView/ParticleTimePoorView.h \
|
|
||||||
ThreeDimensionalConformityAnalysisView/ConformityAnalysis.h \
|
ThreeDimensionalConformityAnalysisView/ConformityAnalysis.h \
|
||||||
ThreeDimensionalConformityAnalysisView/DetectorStatusSummary.h \
|
ThreeDimensionalConformityAnalysisView/DetectorStatusSummary.h \
|
||||||
ThreeDimensionalConformityAnalysisView/ParticleDataStatistics.h \
|
ThreeDimensionalConformityAnalysisView/ParticleDataStatistics.h \
|
||||||
|
|
@ -146,7 +146,6 @@ FORMS += \
|
||||||
MeasureDeviceParamsCfgForm.ui \
|
MeasureDeviceParamsCfgForm.ui \
|
||||||
NewMeasureAnalysisDlg.ui \
|
NewMeasureAnalysisDlg.ui \
|
||||||
ParticleInjectTimeView/ParticleInjectTimeAnalysisView.ui\
|
ParticleInjectTimeView/ParticleInjectTimeAnalysisView.ui\
|
||||||
ParticleTimePoorView/ParticleTimePoorView.ui \
|
|
||||||
ThreeDimensionalConformityAnalysisView/DetectorStatusSummary.ui \
|
ThreeDimensionalConformityAnalysisView/DetectorStatusSummary.ui \
|
||||||
ThreeDimensionalConformityAnalysisView/ParticleDataStatistics.ui \
|
ThreeDimensionalConformityAnalysisView/ParticleDataStatistics.ui \
|
||||||
ThreeDimensionalConformityAnalysisView/ThreeDDisplay.ui \
|
ThreeDimensionalConformityAnalysisView/ThreeDDisplay.ui \
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user