修改三维视图显示
This commit is contained in:
parent
aaf6883f4d
commit
93225c466e
|
|
@ -1,25 +1,17 @@
|
||||||
#include "ConformityAnalysis.h"
|
#include "ConformityAnalysis.h"
|
||||||
#include "ui_ConformityAnalysis.h"
|
#include "ui_ConformityAnalysis.h"
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
#include <GlobalDefine.h>
|
||||||
|
|
||||||
ConformityAnalysis::ConformityAnalysis(QWidget *parent) :
|
ConformityAnalysis::ConformityAnalysis(QWidget *parent) :
|
||||||
MeasureAnalysisView(parent),
|
MeasureAnalysisView(parent),
|
||||||
ui(new Ui::ConformityAnalysis)
|
ui(new Ui::ConformityAnalysis)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
memset(m_boardChannel, 0, sizeof(m_boardChannel)); // 新增
|
memset(m_boardChannel, 0, sizeof(m_boardChannel)); // 新增
|
||||||
//// // 获取当前可执行文件的路径
|
connect(ui->widget,SIGNAL(Signal_ClickedBoard(int,int)),this,SLOT(slot_ClickedBoard(int,int)));
|
||||||
//// QString executablePath = QCoreApplication::applicationDirPath() + "/test.csv";
|
connect(ui->widget,SIGNAL(Signal_InitialState()),this,SLOT(slot_InitialState()));
|
||||||
// connect(ui->widget,SIGNAL(Signal_ClickedBoard(int,int)),this,SLOT(slot_ClickedBoard(int,int)));
|
|
||||||
// connect(ui->widget,SIGNAL(Signal_InitialState()),this,SLOT(slot_InitialState()));
|
|
||||||
//// qDebug()<<"可执行文件:"<< executablePath;
|
|
||||||
// setCsvFile(m_fileName);
|
|
||||||
// readCsv();
|
|
||||||
// handleBoard();
|
|
||||||
// m_FirstParticle = statisticsFirstParticleQuantity();
|
|
||||||
// setAllBoardData();
|
|
||||||
// calculateFirstSecondRange();
|
|
||||||
// setThreeUiData();
|
|
||||||
// generateSurfaceData(m_CoincidenceEventVector);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ConformityAnalysis::~ConformityAnalysis()
|
ConformityAnalysis::~ConformityAnalysis()
|
||||||
|
|
@ -37,7 +29,6 @@ void ConformityAnalysis::SetAnalyzeDataFilename(const QMap<QString, QVariant> &d
|
||||||
QStringList ch_count_data_name = data_files_set.keys();
|
QStringList ch_count_data_name = data_files_set.keys();
|
||||||
int conformCount = ui->comboBox->currentIndex() + 2;
|
int conformCount = ui->comboBox->currentIndex() + 2;
|
||||||
for (const QString& ch_count_data_name : ch_count_data_name) {
|
for (const QString& ch_count_data_name : ch_count_data_name) {
|
||||||
qDebug()<<data_files_set[ch_count_data_name];
|
|
||||||
if(conformCount == ch_count_data_name.toInt())
|
if(conformCount == ch_count_data_name.toInt())
|
||||||
{
|
{
|
||||||
setCsvFile(data_files_set[ch_count_data_name].toString());
|
setCsvFile(data_files_set[ch_count_data_name].toString());
|
||||||
|
|
@ -47,14 +38,9 @@ void ConformityAnalysis::SetAnalyzeDataFilename(const QMap<QString, QVariant> &d
|
||||||
setAllBoardData();
|
setAllBoardData();
|
||||||
calculateFirstSecondRange();
|
calculateFirstSecondRange();
|
||||||
setThreeUiData();
|
setThreeUiData();
|
||||||
generateSurfaceData(m_CoincidenceEventVector);
|
generateSurfaceData(_spectrumDataList);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// QString path = data_files_set.first().toString();
|
|
||||||
// qDebug()<<path;
|
|
||||||
// setCsvFile(path);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConformityAnalysis::setCsvFile(QString fileName)
|
void ConformityAnalysis::setCsvFile(QString fileName)
|
||||||
|
|
@ -66,49 +52,35 @@ void ConformityAnalysis::readCsv()
|
||||||
{
|
{
|
||||||
qDebug()<<m_fileName;
|
qDebug()<<m_fileName;
|
||||||
// 创建 CSVReader 对象,指定列数(5列)
|
// 创建 CSVReader 对象,指定列数(5列)
|
||||||
io::CSVReader<5> reader(m_fileName.toStdString());
|
io::CSVReader<5> reader(QStrToSysPath(m_fileName));
|
||||||
qDebug()<<"板卡号:";
|
reader.read_header(io::ignore_extra_column, "事件ID","板卡号", "通道号", "能量(KeV)", "时间计数");
|
||||||
// 符合事件变量
|
|
||||||
int id = 0;
|
|
||||||
std::vector<F2t9Order::SpectrumData> SpectrumDataList;
|
|
||||||
// 逐行读取数据
|
// 逐行读取数据
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
int comply = 0;
|
particleCoincidenceEvent *SpectrumData = new particleCoincidenceEvent;
|
||||||
F2t9Order::SpectrumData SpectrumData;
|
bool flag = reader.read_row(SpectrumData->eventId,SpectrumData->board, SpectrumData->channel, SpectrumData->energy,SpectrumData->timeCounter);
|
||||||
bool flag = reader.read_row(/*EventData.coincidence_order*/comply,SpectrumData.board_id, SpectrumData.channel_id, SpectrumData.energy,SpectrumData.timestamp);
|
|
||||||
qDebug()<<"符合事件:"<<comply<<"板卡号:"<<SpectrumData.board_id<<"通道号:"<<SpectrumData.board_id<<"能量:"<<SpectrumData.energy<<"时间戳:"<<SpectrumData.timestamp;
|
|
||||||
if(!flag)
|
if(!flag)
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
SpectrumDataList.push_back(SpectrumData);
|
// qDebug()<< SpectrumData->eventId << " " << SpectrumData->board<<" "<<SpectrumData->channel;
|
||||||
if(comply != id)
|
_spectrumDataList.push_back(SpectrumData);
|
||||||
{
|
|
||||||
F2t9Order::CoincidenceEvent EventData;
|
|
||||||
EventData.coincidence_order = comply;
|
|
||||||
EventData.events = SpectrumDataList;
|
|
||||||
m_CoincidenceEventVector.push_back(EventData);
|
|
||||||
qDebug()<<"符合事件里面的vector:"<<EventData.events.size();
|
|
||||||
id = EventData.coincidence_order;
|
|
||||||
SpectrumDataList.clear();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
qDebug()<<"符合事件数:"<<m_CoincidenceEventVector.size();
|
|
||||||
}
|
|
||||||
|
|
||||||
void ConformityAnalysis::slot_InitialState()
|
void ConformityAnalysis::slot_InitialState()
|
||||||
{
|
{
|
||||||
setAllBoardData();
|
setAllBoardData();
|
||||||
calculateFirstSecondRange();
|
calculateFirstSecondRange();
|
||||||
setThreeUiData();
|
setThreeUiData();
|
||||||
generateSurfaceData(m_CoincidenceEventVector);
|
generateSurfaceData(_spectrumDataList);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConformityAnalysis::slot_ClickedBoard(int board,int channel)
|
void ConformityAnalysis::slot_ClickedBoard(int board,int channel)
|
||||||
{
|
{
|
||||||
//获取当前板卡的初级粒子数据
|
//获取当前板卡的初级粒子数据
|
||||||
std::vector<F2t9Order::CoincidenceEvent> data = handleBasicSubordinate(m_CoincidenceEventVector,board,channel);
|
QVector<particleCoincidenceEvent*> data = handleBasicSubordinate(board,channel);
|
||||||
if(data.size() <= 0) return;
|
if(data.size() <= 0) return;
|
||||||
generateSurfaceData(data);
|
generateSurfaceData(data);
|
||||||
m_subordinate = handleSubordinate(data, board, channel);
|
m_subordinate = handleSubordinate(data, board, channel);
|
||||||
|
|
@ -125,12 +97,9 @@ void ConformityAnalysis::slot_ClickedBoard(int board,int channel)
|
||||||
|
|
||||||
void ConformityAnalysis::handleBoard()
|
void ConformityAnalysis::handleBoard()
|
||||||
{
|
{
|
||||||
for (int i = 0; i < m_CoincidenceEventVector.size(); i++)
|
for(auto spetruData:_spectrumDataList)
|
||||||
{
|
{
|
||||||
for(auto spetruData:m_CoincidenceEventVector.at(i).events)
|
m_boardChannel[spetruData->board][spetruData->channel]++;
|
||||||
{
|
|
||||||
m_boardChannel[spetruData.channel_id][spetruData.board_id]++;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -146,16 +115,18 @@ QMap<QString, int> ConformityAnalysis::statisticsFirstParticleQuantity()
|
||||||
firstParticleCount[key] = 0;
|
firstParticleCount[key] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (_spectrumDataList.empty()) return firstParticleCount;
|
||||||
|
|
||||||
|
int eventId = 0;
|
||||||
// 遍历所有符合事件
|
// 遍历所有符合事件
|
||||||
for (const auto& event : m_CoincidenceEventVector)
|
for (const auto& event : _spectrumDataList)
|
||||||
{
|
{
|
||||||
if (event.events.empty()) continue;
|
|
||||||
|
|
||||||
// 第一个事件是初级粒子
|
// 第一个事件是初级粒子
|
||||||
const auto& firstParticle = event.events[0];
|
const auto& firstParticle = event;
|
||||||
int boardId = firstParticle.board_id + 1; // 转换为1-based
|
int boardId = firstParticle->board + 1;
|
||||||
int channelId = firstParticle.channel_id + 1; // 转换为1-based
|
int channelId = firstParticle->channel + 1;
|
||||||
|
if(firstParticle->eventId == eventId) continue;
|
||||||
|
eventId = firstParticle->eventId;
|
||||||
if (boardId >= 1 && boardId <= 8 && channelId >= 1 && channelId <= 4) {
|
if (boardId >= 1 && boardId <= 8 && channelId >= 1 && channelId <= 4) {
|
||||||
QString key = QString("widget_%1_%2").arg(boardId).arg(channelId);
|
QString key = QString("widget_%1_%2").arg(boardId).arg(channelId);
|
||||||
firstParticleCount[key]++;
|
firstParticleCount[key]++;
|
||||||
|
|
@ -164,23 +135,38 @@ QMap<QString, int> ConformityAnalysis::statisticsFirstParticleQuantity()
|
||||||
return firstParticleCount;
|
return firstParticleCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<F2t9Order::CoincidenceEvent> ConformityAnalysis::handleBasicSubordinate(std::vector<F2t9Order::CoincidenceEvent> &eventData, int Board, int Channel)
|
QVector<particleCoincidenceEvent*> ConformityAnalysis::handleBasicSubordinate(int Board, int Channel)
|
||||||
{
|
{
|
||||||
std::vector<F2t9Order::CoincidenceEvent> EventVector;//所有的初级粒子符合事件
|
QVector<particleCoincidenceEvent*> EventVector;//所有的初级粒子符合事件
|
||||||
for (int i = 0; i < eventData.size(); i++)
|
int eventId = 0;
|
||||||
|
for(auto data:_spectrumDataList)
|
||||||
{
|
{
|
||||||
F2t9Order::CoincidenceEvent EventData = eventData.at(i);
|
if(eventId == data->eventId)
|
||||||
F2t9Order::SpectrumData data = EventData.events.at(0);
|
{
|
||||||
if (data.board_id == Board - 1&& data.channel_id == Channel - 1)
|
EventVector.push_back(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(data->board == Board - 1&& data->channel == Channel - 1)
|
||||||
{
|
{
|
||||||
EventVector.push_back(EventData);
|
|
||||||
m_beginVector.push_back(data);
|
m_beginVector.push_back(data);
|
||||||
|
EventVector.push_back(data);
|
||||||
|
eventId = data->eventId;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// for (int i = 0; i < eventData.size(); i++)
|
||||||
|
// {
|
||||||
|
// F2t9Order::CoincidenceEvent EventData = eventData.at(i);
|
||||||
|
// F2t9Order::SpectrumData data = EventData.events.at(0);
|
||||||
|
// if (data.board_id == Board - 1&& data.channel_id == Channel - 1)
|
||||||
|
// {
|
||||||
|
// EventVector.push_back(EventData);
|
||||||
|
// m_beginVector.push_back(data);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
return EventVector;
|
return EventVector;
|
||||||
}
|
}
|
||||||
|
|
||||||
QMap<QString, int> ConformityAnalysis::handleSubordinate(std::vector<F2t9Order::CoincidenceEvent> &eventData,int Board, int Channel)
|
QMap<QString, int> ConformityAnalysis::handleSubordinate(QVector<particleCoincidenceEvent*> &eventData,int Board, int Channel)
|
||||||
{
|
{
|
||||||
m_secondVector.clear();
|
m_secondVector.clear();
|
||||||
QMap<QString, int> data;
|
QMap<QString, int> data;
|
||||||
|
|
@ -190,15 +176,11 @@ QMap<QString, int> ConformityAnalysis::handleSubordinate(std::vector<F2t9Order::
|
||||||
{
|
{
|
||||||
QString key = QString("widget_%1_%2").arg(board).arg(channel);
|
QString key = QString("widget_%1_%2").arg(board).arg(channel);
|
||||||
data[key] = 0;
|
data[key] = 0;
|
||||||
for (int j = 0; j < eventData.size(); j++)
|
for(auto dataSpectrum : eventData)
|
||||||
{
|
{
|
||||||
std::vector<F2t9Order::SpectrumData> dataVector = eventData.at(j).events;
|
if (dataSpectrum->board == Board - 1 && dataSpectrum->channel == Channel - 1)
|
||||||
for (int k = 0; k < dataVector.size(); k++)
|
|
||||||
{
|
|
||||||
F2t9Order::SpectrumData dataSpectrum = dataVector.at(k);
|
|
||||||
if (dataSpectrum.board_id == Board - 1 && dataSpectrum.channel_id == Channel - 1)
|
|
||||||
continue;
|
continue;
|
||||||
if (dataSpectrum.board_id == board - 1 && dataSpectrum.channel_id == channel - 1)
|
if (dataSpectrum->board == board - 1 && dataSpectrum->channel == channel - 1)
|
||||||
{
|
{
|
||||||
data[key]++;
|
data[key]++;
|
||||||
m_secondVector.push_back(dataSpectrum);
|
m_secondVector.push_back(dataSpectrum);
|
||||||
|
|
@ -206,7 +188,30 @@ QMap<QString, int> ConformityAnalysis::handleSubordinate(std::vector<F2t9Order::
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
// for (int board = 1; board <= 8; ++board)
|
||||||
|
// {
|
||||||
|
// for (int channel = 1; channel <= 4; ++channel)
|
||||||
|
// {
|
||||||
|
// QString key = QString("widget_%1_%2").arg(board).arg(channel);
|
||||||
|
// data[key] = 0;
|
||||||
|
// for (int j = 0; j < eventData.size(); j++)
|
||||||
|
// {
|
||||||
|
// std::vector<F2t9Order::SpectrumData> dataVector = eventData.at(j).events;
|
||||||
|
// for (int k = 0; k < dataVector.size(); k++)
|
||||||
|
// {
|
||||||
|
// F2t9Order::SpectrumData dataSpectrum = dataVector.at(k);
|
||||||
|
// if (dataSpectrum.board_id == Board - 1 && dataSpectrum.channel_id == Channel - 1)
|
||||||
|
// continue;
|
||||||
|
// if (dataSpectrum.board_id == board - 1 && dataSpectrum.channel_id == channel - 1)
|
||||||
|
// {
|
||||||
|
// data[key]++;
|
||||||
|
// m_secondVector.push_back(dataSpectrum);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -227,23 +232,21 @@ void ConformityAnalysis::calculateFirstSecondRange()
|
||||||
|
|
||||||
double minSecondVal = 11111111.1111;
|
double minSecondVal = 11111111.1111;
|
||||||
double maxSecondVal = 0.0;
|
double maxSecondVal = 0.0;
|
||||||
for (int i = 0; i < m_CoincidenceEventVector.size(); i++)
|
|
||||||
|
m_iComply = _spectrumDataList.size();
|
||||||
|
for (int j = 0; j < _spectrumDataList.size(); j++)
|
||||||
{
|
{
|
||||||
F2t9Order::CoincidenceEvent data = m_CoincidenceEventVector.at(i);
|
particleCoincidenceEvent *spectrum = _spectrumDataList.at(j);
|
||||||
m_iComply += data.events.size();
|
|
||||||
for (int j = 0; j < data.events.size(); j++)
|
|
||||||
{
|
|
||||||
F2t9Order::SpectrumData spectrum = data.events.at(j);
|
|
||||||
if (j == 0)
|
if (j == 0)
|
||||||
{
|
{
|
||||||
if (spectrum.energy < minFirstVal) minFirstVal = spectrum.energy;
|
if (spectrum->energy < minFirstVal) minFirstVal = spectrum->energy;
|
||||||
if (spectrum.energy > maxFirstVal) maxFirstVal = spectrum.energy;
|
if (spectrum->energy > maxFirstVal) maxFirstVal = spectrum->energy;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (spectrum.energy < minSecondVal) minSecondVal = spectrum.energy;
|
if (spectrum->energy < minSecondVal) minSecondVal = spectrum->energy;
|
||||||
if (spectrum.energy > maxSecondVal) maxSecondVal = spectrum.energy;
|
if (spectrum->energy > maxSecondVal) maxSecondVal = spectrum->energy;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
m_dFirstStart = minFirstVal;
|
m_dFirstStart = minFirstVal;
|
||||||
m_dFirstEnd = maxFirstVal;
|
m_dFirstEnd = maxFirstVal;
|
||||||
m_dSecondStart = minSecondVal;
|
m_dSecondStart = minSecondVal;
|
||||||
|
|
@ -274,25 +277,34 @@ void ConformityAnalysis::setThreeUiData()
|
||||||
ui->widget_3D->setComplyWithEvent(m_iComply);
|
ui->widget_3D->setComplyWithEvent(m_iComply);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConformityAnalysis::generateSurfaceData(const std::vector<F2t9Order::CoincidenceEvent>& events)
|
void ConformityAnalysis::generateSurfaceData(const QVector<particleCoincidenceEvent*> events)
|
||||||
{
|
{
|
||||||
m_surfaceData.clear();
|
m_surfaceData.clear();
|
||||||
|
if (events.empty()) return;
|
||||||
|
int eventId = 0;
|
||||||
|
|
||||||
|
float primaryEnergy = 0.0f;
|
||||||
|
float secondaryEnergySum = 0.0f;
|
||||||
for (const auto& event : events)
|
for (const auto& event : events)
|
||||||
{
|
{
|
||||||
if (event.events.empty()) continue;
|
|
||||||
|
|
||||||
float primaryEnergy = event.events[0].energy;
|
if(eventId != event->eventId)
|
||||||
|
{
|
||||||
float secondaryEnergySum = 0.0f;
|
|
||||||
for (size_t i = 1; i < event.events.size(); i++) {
|
|
||||||
secondaryEnergySum += event.events[i].energy;
|
|
||||||
}
|
|
||||||
SurfacePoint point;
|
SurfacePoint point;
|
||||||
point.primaryEnergy = primaryEnergy;
|
point.primaryEnergy = primaryEnergy;
|
||||||
point.secondaryEnergySum = secondaryEnergySum;
|
point.secondaryEnergySum = secondaryEnergySum;
|
||||||
point.count = 1;
|
point.count = 1;
|
||||||
|
|
||||||
m_surfaceData.append(point);
|
m_surfaceData.append(point);
|
||||||
|
primaryEnergy = 0.0f;
|
||||||
|
secondaryEnergySum = 0.0f;
|
||||||
|
primaryEnergy = event->energy;
|
||||||
|
eventId = event->eventId;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
secondaryEnergySum += event->energy;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
ui->widget_3D->setSurfaceData(m_surfaceData);
|
ui->widget_3D->setSurfaceData(m_surfaceData);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,13 +8,22 @@
|
||||||
#include "csv.h"
|
#include "csv.h"
|
||||||
#include "CoincidenceSpectrumProcess.h"
|
#include "CoincidenceSpectrumProcess.h"
|
||||||
#include "MeasureAnalysisView.h"
|
#include "MeasureAnalysisView.h"
|
||||||
|
#include <QVector>
|
||||||
using namespace CoincidenceSpectrum;
|
using namespace CoincidenceSpectrum;
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class ConformityAnalysis;
|
class ConformityAnalysis;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
typedef struct particleCoincidenceEvent
|
||||||
|
{
|
||||||
|
int eventId;//事件ID
|
||||||
|
int board;//板卡号
|
||||||
|
int channel;//通道号
|
||||||
|
double energy;//能量
|
||||||
|
qulonglong timeCounter;//时间计数
|
||||||
|
}PARTICLECOINCIDENCEEVENT;
|
||||||
|
|
||||||
class ConformityAnalysis : public MeasureAnalysisView
|
class ConformityAnalysis : public MeasureAnalysisView
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
@ -22,8 +31,8 @@ class ConformityAnalysis : public MeasureAnalysisView
|
||||||
private:
|
private:
|
||||||
QMap<QString, int> m_FirstParticle;
|
QMap<QString, int> m_FirstParticle;
|
||||||
QMap<QString, int> m_subordinate;
|
QMap<QString, int> m_subordinate;
|
||||||
std::vector<F2t9Order::SpectrumData> m_beginVector;
|
QVector<particleCoincidenceEvent*> m_beginVector;
|
||||||
std::vector<F2t9Order::SpectrumData> m_secondVector;
|
QVector<particleCoincidenceEvent*> m_secondVector;
|
||||||
QVector<SurfacePoint> m_surfaceData;
|
QVector<SurfacePoint> m_surfaceData;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
@ -48,9 +57,9 @@ private:
|
||||||
//统计每个板卡的初级粒子计数
|
//统计每个板卡的初级粒子计数
|
||||||
QMap<QString, int> statisticsFirstParticleQuantity();
|
QMap<QString, int> statisticsFirstParticleQuantity();
|
||||||
//处理当前板卡初级粒子信息
|
//处理当前板卡初级粒子信息
|
||||||
std::vector<F2t9Order::CoincidenceEvent> handleBasicSubordinate(std::vector<F2t9Order::CoincidenceEvent> &eventData,int Board, int Channel);
|
QVector<particleCoincidenceEvent*> handleBasicSubordinate(int Board, int Channel);
|
||||||
//处理次级粒子信息
|
//处理次级粒子信息
|
||||||
QMap<QString,int> handleSubordinate(std::vector<F2t9Order::CoincidenceEvent> &eventData, int Board, int Channel);
|
QMap<QString,int> handleSubordinate(QVector<particleCoincidenceEvent*> &eventData, int Board, int Channel);
|
||||||
// 获取最大值
|
// 获取最大值
|
||||||
int getMaxValue();
|
int getMaxValue();
|
||||||
//计算全部的初级粒子范围 和 次级粒子范围
|
//计算全部的初级粒子范围 和 次级粒子范围
|
||||||
|
|
@ -60,7 +69,7 @@ private:
|
||||||
//设置符合事件相关信息
|
//设置符合事件相关信息
|
||||||
void setThreeUiData();
|
void setThreeUiData();
|
||||||
//全部谱图数据处理
|
//全部谱图数据处理
|
||||||
void generateSurfaceData(const std::vector<F2t9Order::CoincidenceEvent>& events);
|
void generateSurfaceData(const QVector<particleCoincidenceEvent*> events);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::ConformityAnalysis *ui;
|
Ui::ConformityAnalysis *ui;
|
||||||
|
|
@ -71,8 +80,7 @@ private:
|
||||||
|
|
||||||
int m_boardChannel[MAX_BOARD][MAX_CHANNEL];
|
int m_boardChannel[MAX_BOARD][MAX_CHANNEL];
|
||||||
|
|
||||||
|
QVector<particleCoincidenceEvent*> _spectrumDataList;//所有的能谱符合处理
|
||||||
|
|
||||||
double m_dFirstStart = 0.0;//初级粒子起始能量
|
double m_dFirstStart = 0.0;//初级粒子起始能量
|
||||||
double m_dFirstEnd = 0.0;//初级粒子终止能量
|
double m_dFirstEnd = 0.0;//初级粒子终止能量
|
||||||
double m_dSecondStart = 0.0;//初级粒子起始能量
|
double m_dSecondStart = 0.0;//初级粒子起始能量
|
||||||
|
|
|
||||||
|
|
@ -204,7 +204,13 @@ void ThreeDDisplay::_updateSurfaceData()
|
||||||
|
|
||||||
float ThreeDDisplay::getMaxCount(const QVector<QVector<float> > &dataMatrix)
|
float ThreeDDisplay::getMaxCount(const QVector<QVector<float> > &dataMatrix)
|
||||||
{
|
{
|
||||||
return 0.0;
|
float maxVal = 0;
|
||||||
|
for (const auto& row : dataMatrix) {
|
||||||
|
for (float val : row) {
|
||||||
|
maxVal = std::max(maxVal, val);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return maxVal + 1; // 加1以便显示
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -276,6 +282,7 @@ void ThreeDDisplay::_resetView()
|
||||||
|
|
||||||
void ThreeDDisplay::setSurfaceData(const QVector<SurfacePoint> &surfaceData)
|
void ThreeDDisplay::setSurfaceData(const QVector<SurfacePoint> &surfaceData)
|
||||||
{
|
{
|
||||||
|
m_surfaceData.clear();
|
||||||
m_surfaceData = surfaceData;
|
m_surfaceData = surfaceData;
|
||||||
_updateSurfaceData();
|
_updateSurfaceData();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user