修改符合能谱加载动画控制
This commit is contained in:
parent
653ee44f1a
commit
b3c78ad0d3
|
|
@ -86,10 +86,10 @@ void ConformToTheEnergySpectrum::SetAnalyzeDataFilename(const QMap<QString, QVar
|
||||||
|
|
||||||
void ConformToTheEnergySpectrum::loadAndProcess()
|
void ConformToTheEnergySpectrum::loadAndProcess()
|
||||||
{
|
{
|
||||||
|
_busy_indicator->Start();
|
||||||
auto functionToRun = [this]() {
|
auto functionToRun = [this]() {
|
||||||
if (_data_filename.isEmpty()) return;
|
if (_data_filename.isEmpty())
|
||||||
|
return;
|
||||||
_busy_indicator->Start();
|
|
||||||
|
|
||||||
std::vector<SpectrumData> rawData;
|
std::vector<SpectrumData> rawData;
|
||||||
io::CSVReader<4> in(QStrToSysPath(_data_filename));
|
io::CSVReader<4> in(QStrToSysPath(_data_filename));
|
||||||
|
|
@ -112,34 +112,16 @@ void ConformToTheEnergySpectrum::loadAndProcess()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rawData.empty()) {
|
if (rawData.empty()) {
|
||||||
_busy_indicator->Stop();
|
QMetaObject::invokeMethod(this, [this]() {
|
||||||
|
_busy_indicator->Stop();
|
||||||
|
}, Qt::QueuedConnection);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// const uint64_t TIME_WINDOW_NS = 50;
|
|
||||||
// const int MIN_ORDER = 2;
|
|
||||||
// const int MAX_ORDER = 9;
|
|
||||||
// std::vector<CoincidenceEvent> coincidences = processCoincidence(rawData, TIME_WINDOW_NS, MIN_ORDER, MAX_ORDER);
|
|
||||||
|
|
||||||
// if (coincidences.empty()) {
|
|
||||||
// _busy_indicator->Stop();
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// const int STEP = 1;
|
|
||||||
// std::map<int, double> hist;
|
|
||||||
|
|
||||||
// for (const auto& ev : coincidences) {
|
|
||||||
// for (const auto& spdt : ev.events) {
|
|
||||||
// int idx = static_cast<int>(spdt.energy) / STEP;
|
|
||||||
// hist[idx] += 1.0;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
const int STEP = 1;
|
const int STEP = 1;
|
||||||
std::map<int, double> hist;
|
std::map<int, double> hist;
|
||||||
|
|
||||||
for (const auto& spdt : rawData) {
|
for (const SpectrumData& spdt : rawData) {
|
||||||
int idx = static_cast<int>(spdt.energy) / STEP;
|
int idx = static_cast<int>(spdt.energy) / STEP;
|
||||||
hist[idx] += 1.0;
|
hist[idx] += 1.0;
|
||||||
}
|
}
|
||||||
|
|
@ -151,7 +133,9 @@ void ConformToTheEnergySpectrum::loadAndProcess()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (vx.isEmpty()) {
|
if (vx.isEmpty()) {
|
||||||
_busy_indicator->Stop();
|
QMetaObject::invokeMethod(this, [this]() {
|
||||||
|
_busy_indicator->Stop();
|
||||||
|
}, Qt::QueuedConnection);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user