2905 lines
111 KiB
C++
2905 lines
111 KiB
C++
|
#include "gammaanalydatainterface.h"
|
||
|
#include "DataManager_Define.h"
|
||
|
#include "Settings.h"
|
||
|
#include "MyLog4qt.h"
|
||
|
#include "LogFormCreate.h"
|
||
|
#include <QDir>
|
||
|
#define OPERATOR_AUTO QLatin1String("AUTOMATIC")
|
||
|
#define OPERATOR_Interactive QLatin1String("Interactive")
|
||
|
#define T_NUL_LIB_LOCAL QLatin1String("libdata")
|
||
|
#define T_NUL_LINE_LOCAL QLatin1String("lines")
|
||
|
#define T_RELEVANT_LOCAL QLatin1String("relevant")
|
||
|
#define T_BASELINE_LOCAL QLatin1String("BaseLine")
|
||
|
|
||
|
#define T_NUL_LIB_REMOTE QLatin1String("CONFIGURATION.GARDS_NUCL_LIB")
|
||
|
#define T_NUL_LINE_REMOTE QLatin1String("CONFIGURATION.GARDS_NUCL_LINES_LIB")
|
||
|
#define T_RELEVANT_REMOTE QLatin1String("CONFIGURATION.GARDS_RELEVANT_NUCLIDE")
|
||
|
#define T_BASELINE_REMOTE QLatin1String("CONFIGURATION.GARDS_BASELINE")
|
||
|
|
||
|
#define ENERGY_CAL QLatin1String("energy")
|
||
|
#define EFFICIENCY_CAL QLatin1String("efficiency")
|
||
|
#define RESOLUTION_CAL QLatin1String("Resolution")
|
||
|
#define TOTALEFFICIENCY_CAL QLatin1String("TotalEfficiency")
|
||
|
#define PHD QLatin1String("PHD")
|
||
|
|
||
|
#define ARR_NAME_SUFFIX QLatin1String("_rpt")
|
||
|
#define ARR_REPORT_PATH QLatin1String("Arr")
|
||
|
#define SPECTRIM_PATH QLatin1String("Spectrum")
|
||
|
#define PARTICULATES_PATH QLatin1String("Particulates")
|
||
|
#define OTHER_PATH QLatin1String("Other")
|
||
|
#define ERROR_PATH QLatin1String("Error")
|
||
|
#define XENON_PATH QLatin1String("Xenon")
|
||
|
#define XENON_SANNA_PATH QLatin1String("Sauna")
|
||
|
#define XENON_SPALAX_PATH QLatin1String("Spalax")
|
||
|
#define SOH_PATH QLatin1String("Soh")
|
||
|
#define MET_PATH QLatin1String("Met")
|
||
|
#define ALET_PATH QLatin1String("Alert")
|
||
|
#define DB_LOG_FILE QLatin1String("Db")
|
||
|
#define MAIL_SEND_FILE QLatin1String("Mail/Send")
|
||
|
#define QCPHD_PATH QLatin1String("Qcphd")
|
||
|
#define DETBKPHD_PATH QLatin1String("Detbkphd")
|
||
|
#define SAMPLEPHD_PATH QLatin1String("Samplephd")
|
||
|
#define GASBKPHD_PATH QLatin1String("Gasbkphd")
|
||
|
#define DATETYPE_ERROR QLatin1String("Error")
|
||
|
#define SQL_DATA_TYPE_G QLatin1String("G")
|
||
|
#define SQL_DATA_TYPE_S QLatin1String("S")
|
||
|
#define SQL_DATA_TYPE_B QLatin1String("B")
|
||
|
#define SQL_DATA_TYPE_D QLatin1String("D")
|
||
|
#define SQL_DATA_TYPE_C QLatin1String("C")
|
||
|
#define SQL_DATA_TYPE_Q QLatin1String("Q")
|
||
|
#define DATE_TIME_FORMAT QLatin1String("yyyyMMdd_hhmm")
|
||
|
#define FILE_DATE_TIME_FORMAT QLatin1String("yyyy/MM/dd-hh:mm")
|
||
|
|
||
|
#define FILE_DATE_TIME_SPACE_FORMAT QLatin1String("yyyy/MM/dd hh:mm")
|
||
|
|
||
|
#define DATE_TIME_FORMAT_DD QLatin1String("yyyyMMdd")
|
||
|
#define FILE_DATE_TIME_FORMAT_DD QLatin1String("yyyy/MM/dd")
|
||
|
|
||
|
#define CFG_NULIDELIBRARY QLatin1String("/cfg/filesource/")
|
||
|
|
||
|
#define BASELINE_SUFFIX QLatin1String("baseline")
|
||
|
#define LC_SUFFIX QLatin1String("lc")
|
||
|
#define SCAC_SUFFIX QLatin1String("scac")
|
||
|
#define LOG_SUFFIX QLatin1String("log")
|
||
|
|
||
|
|
||
|
#define TYPE_SUFFIX QLatin1String("%TYPE")
|
||
|
#define LT_SUFFIX QLatin1String("%LT")
|
||
|
#define TYPE_SYSTEM QLatin1String("%SYSTEM")
|
||
|
#define SAMPLE_FILE_SUFFIX QString("_S_%1_%2.PHD").arg(TYPE_SUFFIX).arg(LT_SUFFIX)
|
||
|
#define DETA_FILE_SUFFIX QString("_D_%1_%2.PHD").arg(TYPE_SUFFIX).arg(LT_SUFFIX)
|
||
|
#define GAS_FILE_SUFFIX QString("_G_%1_%2.PHD").arg(TYPE_SUFFIX).arg(LT_SUFFIX)
|
||
|
#define Q_FILE_SUFFIX QString("_Q_%1_%2.PHD").arg(TYPE_SUFFIX).arg(LT_SUFFIX)
|
||
|
|
||
|
#define FILE_DATE_TIME_FORMAT2 QLatin1String("yyyy/MM/dd hh:mm:ss.zzz")
|
||
|
#define FILE_DATE_TIME_FORMAT3 QLatin1String("yyyy/MM/dd-hh:mm:ss")
|
||
|
#define FILE_DATE_TIME_FORMAT4 QLatin1String("yyyy/MM/dd-hh:mm:ss.zzz")
|
||
|
#define FILE_DATE_TIME_FORMAT5 QLatin1String("yyyy/MM/dd-hh:mm:ss.z")
|
||
|
#define COLUMN_WIDTH 30
|
||
|
|
||
|
GammaAnalyDataInterface::GammaAnalyDataInterface(QObject *parent):QObject(parent)
|
||
|
{
|
||
|
QString fileName;
|
||
|
fileName=CSettings::Read(CFG_FILE_PATH+CFG_FILE_NAME,GROUP_CFG_FILE,KEY_BG_AUTO_PROCESS);
|
||
|
m_SavefilePath = CSettings::Read(CFG_FILE_PATH+fileName,GROUP_BG_AUTO_DEAL,KEY_BG_AUTO_FILE_SAVE_PATH);
|
||
|
m_SavefileRelationPath = m_SavefilePath;
|
||
|
QDir dir(m_SavefilePath);
|
||
|
m_SavefilePath = dir.absolutePath();
|
||
|
dir.setPath(m_SavefileRelationPath);
|
||
|
m_SavefileRelationPath = dir.path();
|
||
|
|
||
|
|
||
|
fileName=CSettings::Read(CFG_FILE_PATH+CFG_FILE_NAME,GROUP_CFG_FILE,KEY_BG_AUTO_PROCESS);
|
||
|
m_logFilePath = CSettings::Read(CFG_FILE_PATH+fileName,GROUP_BG_AUTO_LOG,KEY_BG_AUTO_LOG_PATH);
|
||
|
m_logFileRelationPath = m_logFilePath;
|
||
|
dir.setPath(m_logFilePath);
|
||
|
m_logFilePath = dir.absolutePath();
|
||
|
|
||
|
dir.setPath(m_logFileRelationPath);
|
||
|
m_logFileRelationPath = dir.path();
|
||
|
|
||
|
MyLog4qt::Instanace();
|
||
|
}
|
||
|
QStringList GammaAnalyDataInterface::GetSysTemSubdir(const QString& _systemType)
|
||
|
{
|
||
|
QStringList subDirSavePath;
|
||
|
if(_systemType.contains(SYSTEMTYPE_B))
|
||
|
{
|
||
|
subDirSavePath.append(SPECTRIM_PATH);
|
||
|
subDirSavePath.append(XENON_PATH);
|
||
|
subDirSavePath.append(XENON_SANNA_PATH);
|
||
|
}
|
||
|
else if(_systemType.contains(SYSTEMTYPE_G))
|
||
|
{
|
||
|
subDirSavePath.append(SPECTRIM_PATH);
|
||
|
subDirSavePath.append(XENON_PATH);
|
||
|
subDirSavePath.append(XENON_SPALAX_PATH);
|
||
|
}
|
||
|
else if(_systemType.contains(SYSTEMTYPE_P))
|
||
|
{
|
||
|
subDirSavePath.append(SPECTRIM_PATH);
|
||
|
subDirSavePath.append(PARTICULATES_PATH);
|
||
|
}
|
||
|
return subDirSavePath;
|
||
|
}
|
||
|
QStringList GammaAnalyDataInterface::GetDateTypeSubdir(const QString& _dateType)
|
||
|
{
|
||
|
QStringList subDirSavePath;
|
||
|
if(_dateType.contains(DATATYPE_SAMPLEPHD))
|
||
|
{
|
||
|
subDirSavePath.append(SAMPLEPHD_PATH);
|
||
|
}
|
||
|
else if(_dateType.contains(DATATYPE_QCPHD))
|
||
|
{
|
||
|
subDirSavePath.append(QCPHD_PATH);
|
||
|
}
|
||
|
else if(_dateType.contains(DATATYPE_DETBKPHD))
|
||
|
{
|
||
|
subDirSavePath.append(DETBKPHD_PATH);
|
||
|
}
|
||
|
else if(_dateType.contains(DATATYPE_GASBKPHD))
|
||
|
{
|
||
|
subDirSavePath.append(GASBKPHD_PATH);
|
||
|
}
|
||
|
else if(_dateType.contains(DATETYPE_SOH))
|
||
|
{
|
||
|
subDirSavePath.append(SOH_PATH);
|
||
|
}
|
||
|
else if(_dateType.contains(DATETYPE_MET))
|
||
|
{
|
||
|
subDirSavePath.append(MET_PATH);
|
||
|
}
|
||
|
else if(_dateType.contains(DATETYPE_ALERT_FLOW)||
|
||
|
_dateType.contains(DATETYPE_ALERT_SYSTEM)||
|
||
|
_dateType.contains(DATETYPE_ALERT_TEMP)||
|
||
|
_dateType.contains(DATETYPE_ALERT_UPS))
|
||
|
{
|
||
|
subDirSavePath.append(ALET_PATH);
|
||
|
}
|
||
|
else if(_dateType.contains(DATETYPE_ERROR))
|
||
|
{
|
||
|
subDirSavePath.append(ERROR_PATH);
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
subDirSavePath.append(OTHER_PATH);
|
||
|
}
|
||
|
return subDirSavePath;
|
||
|
}
|
||
|
void GammaAnalyDataInterface::GetReportFixedWidth(MyReport::reportTableCell& _cell,MyReport::reportTableGroup& _group,int width,QString _data)
|
||
|
{
|
||
|
for(int m=0;m<=_data.size()/width;m++)
|
||
|
{
|
||
|
if(m>0)
|
||
|
{
|
||
|
_cell.Flag="";
|
||
|
}
|
||
|
_cell.Data.clear();
|
||
|
if((m+1)*width<_data.size())
|
||
|
{
|
||
|
_cell.Data<<_data.mid(m*width,width);
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
_cell.Data<<_data.mid(m*width);
|
||
|
}
|
||
|
_group.data.append(_cell);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
QStringList GammaAnalyDataInterface::GetSubDirByFileName(const QString& _fileName)
|
||
|
{
|
||
|
QStringList rData;
|
||
|
int pos = _fileName.indexOf('-');
|
||
|
if(-1 == pos)
|
||
|
{
|
||
|
//
|
||
|
}
|
||
|
else if(_fileName.size()>=pos+7)
|
||
|
{
|
||
|
rData.append(_fileName.mid(pos+1,4));
|
||
|
rData.append(_fileName.mid(pos+5,2));
|
||
|
// rData.append(_fileName.mid(pos+7,2));
|
||
|
|
||
|
}
|
||
|
return rData;
|
||
|
}
|
||
|
QString GammaAnalyDataInterface::GetLCPathFileName()
|
||
|
{
|
||
|
QString data = m_SavefileRelationPath+QDir::separator();
|
||
|
data += m_lcFileName;
|
||
|
return PathStandard(data);
|
||
|
}
|
||
|
QString GammaAnalyDataInterface::GetLCFileName()
|
||
|
{
|
||
|
QDir dir(m_lcFileName);
|
||
|
QString fileName = dir.dirName();
|
||
|
return fileName;
|
||
|
}
|
||
|
QString GammaAnalyDataInterface::GetLCFilePath()
|
||
|
{
|
||
|
QString data;
|
||
|
data += m_lcFileName;
|
||
|
|
||
|
QFileInfo file(data);
|
||
|
QString filePath = file.path();
|
||
|
return PathStandard(filePath);
|
||
|
}
|
||
|
QString GammaAnalyDataInterface::GetBasePathFileName()
|
||
|
{
|
||
|
QString data = m_SavefileRelationPath+QDir::separator();
|
||
|
data += m_baseLineFileName;
|
||
|
|
||
|
return PathStandard(data);
|
||
|
}
|
||
|
QString GammaAnalyDataInterface::GetBaseFileName()
|
||
|
{
|
||
|
|
||
|
QDir dir(m_baseLineFileName);
|
||
|
QString fileName = dir.dirName();
|
||
|
return fileName;
|
||
|
}
|
||
|
QString GammaAnalyDataInterface::GetBaseFilePath()
|
||
|
{
|
||
|
QString data;
|
||
|
data += m_baseLineFileName;
|
||
|
QFileInfo file(data);
|
||
|
QString filePath = file.path();
|
||
|
return PathStandard(filePath);
|
||
|
}
|
||
|
QString GammaAnalyDataInterface::GetScacPathFileName()
|
||
|
{
|
||
|
QString data = m_SavefileRelationPath+QDir::separator();
|
||
|
data += m_scacFileName;
|
||
|
return PathStandard(data);
|
||
|
}
|
||
|
QString GammaAnalyDataInterface::GetScacFileName()
|
||
|
{
|
||
|
QDir dir(m_scacFileName);
|
||
|
QString fileName = dir.dirName();
|
||
|
return fileName;
|
||
|
}
|
||
|
QString GammaAnalyDataInterface::GetScacFilePath()
|
||
|
{
|
||
|
QString data;
|
||
|
data += m_scacFileName;
|
||
|
|
||
|
QFileInfo file(data);
|
||
|
QString filePath = file.path();
|
||
|
return PathStandard(filePath);
|
||
|
}
|
||
|
QString GammaAnalyDataInterface::GetReportPathFileName()
|
||
|
{
|
||
|
QString data = m_SavefileRelationPath+QDir::separator()+ARR_REPORT_PATH+QDir::separator();
|
||
|
data += m_reportFileName;
|
||
|
return PathStandard(data);
|
||
|
}
|
||
|
QString GammaAnalyDataInterface::GetReportFileName()
|
||
|
{
|
||
|
QDir dir(m_reportFileName);
|
||
|
QString fileName = dir.dirName();
|
||
|
return fileName;
|
||
|
}
|
||
|
QString GammaAnalyDataInterface::GetReportFilePath()
|
||
|
{
|
||
|
QString data;
|
||
|
data += m_reportFileName;
|
||
|
|
||
|
QFileInfo file(data);
|
||
|
QString filePath = file.path();
|
||
|
return PathStandard(filePath);
|
||
|
}
|
||
|
QString GammaAnalyDataInterface::GetSavePathFileName()
|
||
|
{
|
||
|
QString data = m_SavefileRelationPath+QDir::separator()+ARR_REPORT_PATH+QDir::separator();
|
||
|
data += m_saveFileName;
|
||
|
return PathStandard(data);
|
||
|
}
|
||
|
QString GammaAnalyDataInterface::GetSaveFileName()
|
||
|
{
|
||
|
QDir dir(m_saveFileName);
|
||
|
QString fileName = dir.dirName();
|
||
|
return fileName;
|
||
|
}
|
||
|
QString GammaAnalyDataInterface::GetSaveFilePath()
|
||
|
{
|
||
|
QString data;
|
||
|
data += m_saveFileName;
|
||
|
|
||
|
QFileInfo file(data);
|
||
|
QString filePath = file.path();
|
||
|
return PathStandard(filePath);
|
||
|
}
|
||
|
QString GammaAnalyDataInterface::GetLogPathFileName()
|
||
|
{
|
||
|
QString data = m_logFileRelationPath+QDir::separator();
|
||
|
data += m_logfileName;
|
||
|
return PathStandard(data);
|
||
|
}
|
||
|
QString GammaAnalyDataInterface::GetLogFileName()
|
||
|
{
|
||
|
QDir dir(m_logfileName);
|
||
|
QString fileName = dir.dirName();
|
||
|
return fileName;
|
||
|
}
|
||
|
QString GammaAnalyDataInterface::GetLogFilePath()
|
||
|
{
|
||
|
QString data;
|
||
|
data += m_logfileName;
|
||
|
|
||
|
QFileInfo file(data);
|
||
|
QString filePath = file.path();
|
||
|
return PathStandard(filePath);
|
||
|
}
|
||
|
QString GammaAnalyDataInterface::PathStandard(const QString& _path)
|
||
|
{
|
||
|
QString rData=_path;
|
||
|
rData.replace('\\','/');
|
||
|
return rData;
|
||
|
}
|
||
|
QString GammaAnalyDataInterface::GetSavefileRelationPathFileName()
|
||
|
{
|
||
|
// QString input_file_name=m_SavefileRelationPath+QDir::separator();
|
||
|
QString input_file_name;
|
||
|
QStringList lst = m_subDir;
|
||
|
for(int pos=0;pos<lst.size();pos++)
|
||
|
{
|
||
|
input_file_name+=lst.at(pos);
|
||
|
input_file_name+=QDir::separator();
|
||
|
}
|
||
|
//添加文件名日期
|
||
|
QStringList dateSub = GetSubDirByFileName(GetDataStandardFileName());
|
||
|
for(int pos=0;pos<dateSub.size();pos++)
|
||
|
{
|
||
|
input_file_name=input_file_name+dateSub.at(pos)+QDir::separator();
|
||
|
}
|
||
|
// input_file_name+=GetDataFileName();
|
||
|
input_file_name+= GetDataStandardFileName();
|
||
|
input_file_name = PathStandard(input_file_name);
|
||
|
// qDebug()<<input_file_name<<CBgDataDeal::GetDataFileName()<<endl;
|
||
|
return input_file_name;
|
||
|
}
|
||
|
QString GammaAnalyDataInterface::GetDataStandardFileName()
|
||
|
{
|
||
|
QDir dir(m_standardFileName);
|
||
|
QString fileName = dir.dirName();
|
||
|
return fileName;
|
||
|
}
|
||
|
void GammaAnalyDataInterface::SetFileDir()
|
||
|
{
|
||
|
// QString input_file_name=m_SavefileRelationPath+QDir::separator();
|
||
|
QString input_file_name;
|
||
|
QStringList lst = m_subDir;
|
||
|
for(int pos=0;pos<lst.size();pos++)
|
||
|
{
|
||
|
input_file_name+=lst.at(pos);
|
||
|
input_file_name+=QDir::separator();
|
||
|
}
|
||
|
//添加文件名日期
|
||
|
QStringList dateSub = GetSubDirByFileName(GetSaveFileName());
|
||
|
for(int pos=0;pos<dateSub.size();pos++)
|
||
|
{
|
||
|
input_file_name=input_file_name+dateSub.at(pos)+QDir::separator();
|
||
|
}
|
||
|
// input_file_name+=GetDataFileName();
|
||
|
QString lc_name;
|
||
|
QString scac_name;
|
||
|
QString baseline_name;
|
||
|
QString log_name;
|
||
|
QString report_name;
|
||
|
QString save_name;
|
||
|
|
||
|
lc_name = input_file_name + GetLCFileName();
|
||
|
scac_name = input_file_name + GetScacFileName();
|
||
|
baseline_name = input_file_name + GetBaseFileName();
|
||
|
log_name =input_file_name + GetLogFileName();
|
||
|
report_name=input_file_name + GetReportFileName();
|
||
|
save_name = input_file_name + GetSaveFileName();
|
||
|
m_lcFileName = PathStandard(lc_name);
|
||
|
m_scacFileName = PathStandard(scac_name);
|
||
|
m_baseLineFileName = PathStandard(baseline_name);
|
||
|
m_logfileName = PathStandard(log_name);
|
||
|
m_reportFileName = PathStandard(report_name);
|
||
|
|
||
|
m_saveFileName = PathStandard(save_name);
|
||
|
// qDebug()<<input_file_name<<CBgDataDeal::GetDataFileName()<<endl;
|
||
|
|
||
|
}
|
||
|
QString GammaAnalyDataInterface::GetDataStandardFile()
|
||
|
{
|
||
|
return PathStandard(m_standardFileName);
|
||
|
}
|
||
|
|
||
|
void GammaAnalyDataInterface::SetSaveSubdir(const QStringList& _data)
|
||
|
{
|
||
|
m_subDir.clear();
|
||
|
m_subDir=_data;
|
||
|
}
|
||
|
void GammaAnalyDataInterface::SetDataFile(const QString& _fileName)
|
||
|
{
|
||
|
m_fileName = _fileName;
|
||
|
m_standardFileName = _fileName;
|
||
|
}
|
||
|
GammaAnalyDataInterface::~GammaAnalyDataInterface()
|
||
|
{
|
||
|
|
||
|
}
|
||
|
QString GammaAnalyDataInterface::GetLastInfo()
|
||
|
{
|
||
|
return m_info;
|
||
|
}
|
||
|
QString GammaAnalyDataInterface::GetAppName()
|
||
|
{
|
||
|
return QLatin1String("AutoDataProcessDemon");
|
||
|
}
|
||
|
|
||
|
QString GammaAnalyDataInterface::GetAppVersion()
|
||
|
{
|
||
|
return QLatin1String("1.0.1");
|
||
|
}
|
||
|
QString GammaAnalyDataInterface::GetAnlyseName()
|
||
|
{
|
||
|
return m_analyst.isEmpty() ? QLatin1String("RNAUTO") : m_analyst;
|
||
|
}
|
||
|
QString GammaAnalyDataInterface::DateTimeStandard(const QDateTime&_data)
|
||
|
{
|
||
|
return _data.toString(DATATIME_FORMAT_SECONDS);
|
||
|
}
|
||
|
double GammaAnalyDataInterface::DoubleLimit(const double& _data)
|
||
|
{
|
||
|
QString limit = QString::number(_data,'f');
|
||
|
double rData=DoubleLimit(limit);
|
||
|
return rData;
|
||
|
}
|
||
|
double GammaAnalyDataInterface::DoubleLimit(const QString& _data)
|
||
|
{
|
||
|
double rData = _data.toDouble();
|
||
|
QString first = _data;
|
||
|
QStringList lstTemp = _data.split('.');
|
||
|
if(lstTemp.size()>1)
|
||
|
{
|
||
|
first = lstTemp.at(0);
|
||
|
// return rData;
|
||
|
}
|
||
|
if(first.size()>3)
|
||
|
{
|
||
|
QString temp=QLatin1String("-");
|
||
|
for(int pos=1;pos<first.size();pos++)
|
||
|
{
|
||
|
temp.append('9');
|
||
|
}
|
||
|
if(temp == first)
|
||
|
{
|
||
|
return -999;
|
||
|
}
|
||
|
}
|
||
|
return rData;
|
||
|
}
|
||
|
QVector<QString> GammaAnalyDataInterface::DoubleLimit(QVector<double> _data)
|
||
|
{
|
||
|
QVector<QString> rdata;
|
||
|
for(int pos=0;pos<_data.size();pos++)
|
||
|
{
|
||
|
if(qIsNaN(_data.at(pos)))
|
||
|
{
|
||
|
rdata<<"NULL";
|
||
|
m_info = QLatin1String("data has NULL");
|
||
|
// test = QString::number(_data.at(pos));
|
||
|
}
|
||
|
else if(qIsInf(_data.at(pos)))
|
||
|
{
|
||
|
rdata<<"NULL";
|
||
|
m_info = QLatin1String("data has INF");
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
rdata<<QString::number(DoubleLimit(_data.at(pos)),'f');
|
||
|
}
|
||
|
}
|
||
|
return rdata;
|
||
|
}
|
||
|
QVector<QString> GammaAnalyDataInterface::DoubleLimit_G(QVector<double> _data)
|
||
|
{
|
||
|
QString test;
|
||
|
QVector<QString> rdata;
|
||
|
for(int pos=0;pos<_data.size();pos++)
|
||
|
{
|
||
|
if(qIsNaN(_data.at(pos)))
|
||
|
{
|
||
|
rdata<<"NULL";
|
||
|
m_info = QLatin1String("data has NULL INF");
|
||
|
// test = QString::number(_data.at(pos));
|
||
|
}
|
||
|
else if(qIsInf(_data.at(pos)))
|
||
|
{
|
||
|
rdata<<"NULL";
|
||
|
m_info = QLatin1String("data has INF");
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
rdata<<QString::number(_data.at(pos),'g',10);
|
||
|
}
|
||
|
}
|
||
|
return rdata;
|
||
|
}
|
||
|
|
||
|
QString GammaAnalyDataInterface::SqlSpecialCharHandle(const QString &str)
|
||
|
{
|
||
|
QString retStr = str;
|
||
|
return retStr.replace("\'", "\'\'");
|
||
|
}
|
||
|
|
||
|
QVector<QString> GammaAnalyDataInterface::DoubleLimit(QVector<QString> &data)
|
||
|
{
|
||
|
for(int pos=0;pos<data.size();pos++)
|
||
|
{
|
||
|
data[pos] = QString::number(DoubleLimit(data.at(pos)),'f');
|
||
|
}
|
||
|
return data;
|
||
|
}
|
||
|
bool GammaAnalyDataInterface::NameStandard(PHDFile& fileAnlyse)
|
||
|
{
|
||
|
QString suffix = GetSuffix(fileAnlyse.msgInfo.data_type,fileAnlyse.header.system_type,fileAnlyse.header.spectrum_quantity,QString::number(fileAnlyse.acq.acquisition_live_time));
|
||
|
NameStandardByName(fileAnlyse.header.measurement_id,suffix);
|
||
|
return true;
|
||
|
}
|
||
|
QString GammaAnalyDataInterface::GetSuffix(const QString& _dataType,const QString& _sysType,const QString& _Fulltype,const QString& _LT)
|
||
|
{
|
||
|
QString rData=GetSuffix(_dataType);
|
||
|
rData.replace(TYPE_SUFFIX,_Fulltype);
|
||
|
rData.replace(LT_SUFFIX,_LT);
|
||
|
// rData.replace(TYPE_SYSTEM,_sysType);
|
||
|
return rData;
|
||
|
}
|
||
|
QString GammaAnalyDataInterface::GetSuffix(const QString& _dataType)
|
||
|
{
|
||
|
QString rData;
|
||
|
if(_dataType.contains(DATATYPE_SAMPLEPHD))
|
||
|
{
|
||
|
rData = SAMPLE_FILE_SUFFIX;
|
||
|
}
|
||
|
else if(_dataType.contains(DATATYPE_GASBKPHD))
|
||
|
{
|
||
|
rData = GAS_FILE_SUFFIX;
|
||
|
}
|
||
|
else if(_dataType.contains(DATATYPE_DETBKPHD))
|
||
|
{
|
||
|
rData = DETA_FILE_SUFFIX;
|
||
|
}
|
||
|
else if(_dataType.contains(DATATYPE_QCPHD))
|
||
|
{
|
||
|
rData = Q_FILE_SUFFIX;
|
||
|
}
|
||
|
|
||
|
return rData;
|
||
|
}
|
||
|
QString GammaAnalyDataInterface::GetFileNameFromDateTime(const QString& _timeString,QString suffix)
|
||
|
{
|
||
|
QString rData;
|
||
|
int pos = _timeString.indexOf('-');
|
||
|
if(-1 == pos)
|
||
|
{
|
||
|
//
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
QString dateTime = _timeString;
|
||
|
dateTime = dateTime.mid(pos+1,16);
|
||
|
dateTime.replace(' ','-');
|
||
|
|
||
|
QString fileHeader = _timeString.mid(0,pos+1);
|
||
|
|
||
|
QString temp = DateTimeStandardToFileFormat(dateTime);
|
||
|
|
||
|
rData = fileHeader+ temp + suffix;
|
||
|
}
|
||
|
return rData;
|
||
|
}
|
||
|
QString GammaAnalyDataInterface::DateTimeStandardToFileFormat(const QString&_data)
|
||
|
{
|
||
|
QString dateTime =QDateTime::fromString(_data,FILE_DATE_TIME_FORMAT).toString(DATE_TIME_FORMAT);
|
||
|
|
||
|
if(dateTime.isEmpty())
|
||
|
{
|
||
|
dateTime =QDateTime::fromString(_data,FILE_DATE_TIME_SPACE_FORMAT).toString(DATE_TIME_FORMAT);
|
||
|
}
|
||
|
|
||
|
if(dateTime.isEmpty())
|
||
|
{
|
||
|
dateTime =QDateTime::fromString(_data,FILE_DATE_TIME_FORMAT_DD).toString(DATE_TIME_FORMAT_DD);
|
||
|
}
|
||
|
|
||
|
|
||
|
return dateTime;
|
||
|
}
|
||
|
QString GammaAnalyDataInterface::GetDataFile()
|
||
|
{
|
||
|
return PathStandard(m_fileName);
|
||
|
}
|
||
|
QString GammaAnalyDataInterface::GetDataFileName()
|
||
|
{
|
||
|
QDir dir(m_fileName);
|
||
|
QString fileName = dir.dirName();
|
||
|
return fileName;
|
||
|
}
|
||
|
QString GammaAnalyDataInterface::GetDataFilePath()
|
||
|
{
|
||
|
QFileInfo file(m_fileName);
|
||
|
QString filePath = file.path();
|
||
|
return PathStandard(filePath);
|
||
|
}
|
||
|
QVector<QString> GammaAnalyDataInterface::GetPercent(QVector<QString> &one,QVector<QString> &two)
|
||
|
{
|
||
|
QVector<QString> rData;
|
||
|
if(one.size() == two.size())
|
||
|
{
|
||
|
for(int m=0;m<one.size();m++)
|
||
|
{
|
||
|
rData.append(QString::number(one.at(m).toDouble()/two.at(m).toDouble()*100,'f',3));
|
||
|
}
|
||
|
}
|
||
|
return rData;
|
||
|
}
|
||
|
QVector<QString> GammaAnalyDataInterface::GetThreePoint(QVector<QString> source)
|
||
|
{
|
||
|
QVector<QString> rData;
|
||
|
for(int m=0;m<source.size();m++)
|
||
|
{
|
||
|
rData.append(QString::number(source.at(m).toDouble(),'f',3));
|
||
|
}
|
||
|
return rData;
|
||
|
}
|
||
|
QVector<QString> GammaAnalyDataInterface::GetPass(QVector<QString> source)
|
||
|
{
|
||
|
QVector<QString> rData;
|
||
|
for(int m=0;m<source.size();m++)
|
||
|
{
|
||
|
rData.append(source.at(m).contains(QLatin1String("0"))?QLatin1String("Fail"):QLatin1String("Pass"));
|
||
|
}
|
||
|
return rData;
|
||
|
}
|
||
|
|
||
|
void GammaAnalyDataInterface::NameStandardByName(const QString&_dateTimeFormat,const QString& _suffix)
|
||
|
{
|
||
|
// QString fileSuffix = CBgDataDeal::GetSuffix(_dataTyple);
|
||
|
|
||
|
QString StandardFileName=GetDataFile();
|
||
|
|
||
|
QString measurementName = GetFileNameFromDateTime(_dateTimeFormat,_suffix);
|
||
|
QString fileDir = GetDataFilePath()+QDir::separator();
|
||
|
if(measurementName != GetDataFileName())
|
||
|
{
|
||
|
StandardFileName = fileDir+measurementName;
|
||
|
}
|
||
|
QFileInfo info(measurementName);
|
||
|
QString suffix = info.suffix();
|
||
|
|
||
|
m_lcFileName = StandardFileName;
|
||
|
m_baseLineFileName = StandardFileName;
|
||
|
m_scacFileName = StandardFileName;
|
||
|
m_logfileName = StandardFileName;
|
||
|
m_reportFileName = StandardFileName;
|
||
|
|
||
|
m_lcFileName.replace(suffix,LC_SUFFIX);
|
||
|
m_baseLineFileName.replace(suffix,BASELINE_SUFFIX);
|
||
|
m_scacFileName.replace(suffix,SCAC_SUFFIX);
|
||
|
m_logfileName.replace(suffix,LOG_SUFFIX);
|
||
|
m_reportFileName.replace(QLatin1String(".")+suffix,ARR_NAME_SUFFIX);
|
||
|
|
||
|
m_saveFileName = StandardFileName;
|
||
|
return ;
|
||
|
}
|
||
|
bool GammaAnalyDataInterface::GetAutoMiddleData(PHDFile& fileAnlyse,QMap<QString, NuclideLines> &nucline,structGStoreMiddleProcessData& middleData)
|
||
|
{
|
||
|
return GetMiddleData(fileAnlyse,nucline,middleData,Auto);
|
||
|
|
||
|
}
|
||
|
bool GammaAnalyDataInterface::GetInterMiddlData(PHDFile& fileAnlyse,structGStoreMiddleProcessData& middleData)
|
||
|
{
|
||
|
bool bRet = true;
|
||
|
QMap<QString, NuclideLines> temp;
|
||
|
bRet = GetMiddleData(fileAnlyse,temp,middleData,InterAction);
|
||
|
middleData.analyses_type =OPERATOR_Interactive;
|
||
|
return bRet;
|
||
|
}
|
||
|
|
||
|
bool GammaAnalyDataInterface::WriteLog(structGStoreMiddleProcessData& middleData)
|
||
|
{
|
||
|
bool bRet=true;
|
||
|
|
||
|
QString logName= m_logFilePath+QDir::separator()+middleData.analyses_LogPath;
|
||
|
MyLog4qt::MakeNewFileLogger(logName);
|
||
|
MyLog4qt::SetLoggerText(logName, GetLogContent(middleData));
|
||
|
MyLog4qt::RemoveLogger(logName);
|
||
|
|
||
|
/*QString logName= m_logFilePath+QDir::separator()+middleData.analyses_LogPath;
|
||
|
MyLog4qt::MakeNewFileLogger(logName);
|
||
|
MyLog4qt::SetLoggerText(logName,CLogFormCreate::AnlyseResultsBegin());
|
||
|
|
||
|
QVector<LOGFORMCREATE::AttributeContext> logAtributeData;
|
||
|
LOGFORMCREATE::AttributeContext logAtributeItem;
|
||
|
|
||
|
logAtributeItem.context.clear();
|
||
|
logAtributeItem.atrribute= QLatin1String("Channel");
|
||
|
logAtributeItem.unit = QLatin1String("");
|
||
|
logAtributeItem.context = GetThreePoint(middleData.calibration_pairs_S_E_xValue);
|
||
|
logAtributeData.append(logAtributeItem);
|
||
|
|
||
|
|
||
|
logAtributeItem.context.clear();
|
||
|
logAtributeItem.atrribute= QLatin1String("Energy");
|
||
|
logAtributeItem.unit = QLatin1String("keV");
|
||
|
logAtributeItem.context = GetThreePoint(middleData.calibration_pairs_S_E_yValue);
|
||
|
logAtributeData.append(logAtributeItem);
|
||
|
|
||
|
logAtributeItem.context.clear();
|
||
|
logAtributeItem.atrribute= QLatin1String("Error");
|
||
|
logAtributeItem.unit = QLatin1String("");
|
||
|
logAtributeItem.context =GetThreePoint(middleData.calibration_pairs_S_E_uncYValue);
|
||
|
logAtributeData.append(logAtributeItem);
|
||
|
|
||
|
MyLog4qt::SetLoggerText(logName,CLogFormCreate::TitleCalibration());
|
||
|
MyLog4qt::SetLoggerText(logName,CLogFormCreate::GSetSampleEnergyChannel(logAtributeData,middleData.sample_id));
|
||
|
|
||
|
logAtributeData.clear();
|
||
|
logAtributeItem.context.clear();
|
||
|
logAtributeItem.atrribute= QLatin1String("Channel");
|
||
|
logAtributeItem.unit = QLatin1String("");
|
||
|
logAtributeItem.context = GetThreePoint(middleData.calibration_pairs_S_EF_xValue);
|
||
|
logAtributeData.append(logAtributeItem);
|
||
|
|
||
|
|
||
|
logAtributeItem.context.clear();
|
||
|
logAtributeItem.atrribute= QLatin1String("Energy");
|
||
|
logAtributeItem.unit = QLatin1String("keV");
|
||
|
logAtributeItem.context = GetThreePoint(middleData.calibration_pairs_S_EF_yValue);
|
||
|
logAtributeData.append(logAtributeItem);
|
||
|
|
||
|
logAtributeItem.context.clear();
|
||
|
logAtributeItem.atrribute= QLatin1String("Error");
|
||
|
logAtributeItem.unit = QLatin1String("");
|
||
|
logAtributeItem.context = GetThreePoint(middleData.calibration_pairs_S_EF_uncYValue);
|
||
|
logAtributeData.append(logAtributeItem);
|
||
|
MyLog4qt::SetLoggerText(logName,CLogFormCreate::GSetSampleEfficiencyChannel(logAtributeData,middleData.sample_id));
|
||
|
|
||
|
logAtributeData.clear();
|
||
|
logAtributeItem.context.clear();
|
||
|
logAtributeItem.atrribute= QLatin1String("Channel");
|
||
|
logAtributeItem.unit = QLatin1String("");
|
||
|
logAtributeItem.context = GetThreePoint(middleData.calibration_pairs_S_R_xValue);
|
||
|
logAtributeData.append(logAtributeItem);
|
||
|
|
||
|
logAtributeItem.context.clear();
|
||
|
logAtributeItem.atrribute= QLatin1String("Energy");
|
||
|
logAtributeItem.unit = QLatin1String("keV");
|
||
|
logAtributeItem.context = GetThreePoint(middleData.calibration_pairs_S_R_yValue);
|
||
|
logAtributeData.append(logAtributeItem);
|
||
|
|
||
|
logAtributeItem.context.clear();
|
||
|
logAtributeItem.atrribute= QLatin1String("Error");
|
||
|
logAtributeItem.unit = QLatin1String("");
|
||
|
logAtributeItem.context = GetThreePoint(middleData.calibration_pairs_S_R_uncYValue);
|
||
|
logAtributeData.append(logAtributeItem);
|
||
|
MyLog4qt::SetLoggerText(logName,CLogFormCreate::GSetSampleResolutionChannel(logAtributeData,middleData.sample_id));
|
||
|
|
||
|
logAtributeData.clear();
|
||
|
logAtributeItem.context.clear();
|
||
|
logAtributeItem.atrribute= QLatin1String("Channel");
|
||
|
logAtributeItem.unit = QLatin1String("");
|
||
|
logAtributeItem.context = middleData.calibration_pairs_S_T_xValue;
|
||
|
logAtributeData.append(logAtributeItem);
|
||
|
|
||
|
logAtributeItem.context.clear();
|
||
|
logAtributeItem.atrribute= QLatin1String("Energy");
|
||
|
logAtributeItem.unit = QLatin1String("keV");
|
||
|
logAtributeItem.context = GetThreePoint(middleData.calibration_pairs_S_T_yValue);
|
||
|
logAtributeData.append(logAtributeItem);
|
||
|
|
||
|
logAtributeItem.context.clear();
|
||
|
logAtributeItem.atrribute= QLatin1String("Error");
|
||
|
logAtributeItem.unit = QLatin1String("");
|
||
|
logAtributeItem.context = GetThreePoint(middleData.calibration_pairs_S_T_uncYValue);
|
||
|
logAtributeData.append(logAtributeItem);
|
||
|
MyLog4qt::SetLoggerText(logName,CLogFormCreate::GSetSampleTotalEfficiencyChannel(logAtributeData,middleData.sample_id));
|
||
|
|
||
|
QStringList lstAtribute;
|
||
|
QStringList lstContext;
|
||
|
lstAtribute<<QLatin1String("Collection Start")
|
||
|
<<QLatin1String("Collection Stop")<<QLatin1String("Sampling Time[h]")
|
||
|
<<QLatin1String("Sample Quantity[m3]")<<QLatin1String("Decay Time[h]")
|
||
|
<<QLatin1String("Acquisition Start")<<QLatin1String("Acquisition Stop")<<QLatin1String("Acquisition Time[s]");
|
||
|
|
||
|
lstContext<<middleData.sample_collection_start<<middleData.sample_collection_stop
|
||
|
<<middleData.sample_time
|
||
|
<<QLatin1String(" ")+middleData.sample_quantity<<middleData.sample_decay_time
|
||
|
<<middleData.sample_acquisiton_start<<middleData.sample_acquistion_stop<<middleData.sample_acquistion_time;
|
||
|
|
||
|
MyLog4qt::SetLoggerText(logName,CLogFormCreate::GGetSampleInfo(lstAtribute,lstContext));
|
||
|
MyLog4qt::SetLoggerText(logName,CLogFormCreate::TitleCalibrationIdEnd());
|
||
|
|
||
|
MyLog4qt::SetLoggerText(logName,CLogFormCreate::GTitleCalibration());
|
||
|
|
||
|
if(middleData.calibration_pairs_E_idCalPoint.size()>0)
|
||
|
{
|
||
|
lstAtribute.clear();
|
||
|
lstContext.clear();
|
||
|
lstAtribute<<QString("Energy Calibration [%1 ]").arg(middleData.calibration_pairs_E_Input)
|
||
|
<<QLatin1String("Function:")<<QLatin1String("E:")
|
||
|
<<QLatin1String("P:")<<QLatin1String("Err:")
|
||
|
<<QLatin1String("Data:");
|
||
|
|
||
|
lstContext<<QString("")<<middleData.calibration_E_functionTypeDef
|
||
|
<<middleData.calibration_E_functionDef<<middleData.calibration_E_coeff_string<<middleData.calibration_E_uncoeff_string<<middleData.calibration_pairs_E_Input;
|
||
|
|
||
|
|
||
|
MyLog4qt::SetLoggerText(logName,CLogFormCreate::GGetCalibration(lstAtribute,lstContext));
|
||
|
}
|
||
|
|
||
|
if(middleData.calibration_pairs_R_idCalPoint.size()>0)
|
||
|
{
|
||
|
lstAtribute.clear();
|
||
|
lstContext.clear();
|
||
|
lstAtribute<<QString("Resolution Calibration [%1 ]").arg(middleData.calibration_pairs_R_Input)
|
||
|
<<QLatin1String("Function:")<<QLatin1String("E:")
|
||
|
<<QLatin1String("P:")<<QLatin1String("Err:")
|
||
|
<<QLatin1String("Data:");
|
||
|
|
||
|
lstContext<<QString("")<<middleData.calibration_R_functionTypeDef
|
||
|
<<middleData.calibration_R_functionDef<<middleData.calibration_R_coeff_string<<middleData.calibration_R_uncoeff_string<<middleData.calibration_pairs_R_Input;
|
||
|
|
||
|
|
||
|
MyLog4qt::SetLoggerText(logName,CLogFormCreate::GGetCalibration(lstAtribute,lstContext));
|
||
|
}
|
||
|
|
||
|
if(middleData.calibration_pairs_EF_idCalPoint.size()>0)
|
||
|
{
|
||
|
lstAtribute.clear();
|
||
|
lstContext.clear();
|
||
|
lstAtribute<<QString("Efficiency Calibration [%1 ]").arg(middleData.calibration_pairs_EF_Input)
|
||
|
<<QLatin1String("Function:")<<QLatin1String("E:")
|
||
|
<<QLatin1String("P:")<<QLatin1String("Err:")
|
||
|
<<QLatin1String("Data:");
|
||
|
|
||
|
lstContext<<QString("")<<middleData.calibration_EF_functionTypeDef
|
||
|
<<middleData.calibration_EF_functionDef<<middleData.calibration_EF_coeff_string<<middleData.calibration_EF_uncoeff_string<<middleData.calibration_pairs_EF_Input;
|
||
|
|
||
|
|
||
|
MyLog4qt::SetLoggerText(logName,CLogFormCreate::GGetCalibration(lstAtribute,lstContext));
|
||
|
}
|
||
|
|
||
|
if(middleData.calibration_pairs_T_idCalPoint.size()>0)
|
||
|
{
|
||
|
lstAtribute.clear();
|
||
|
lstContext.clear();
|
||
|
lstAtribute<<QString("Tot_efficiency Calibration [%1 ]").arg(middleData.calibration_pairs_T_Input)
|
||
|
<<QLatin1String("Function:")<<QString("E")
|
||
|
<<QLatin1String("P:")<<QLatin1String("Err:")
|
||
|
<<QLatin1String("Data:");
|
||
|
|
||
|
lstContext<<QString("")<<middleData.calibration_T_functionTypeDef
|
||
|
<<middleData.calibration_T_functionDef<<middleData.calibration_T_coeff_string<<middleData.calibration_T_uncoeff_string<<middleData.calibration_pairs_T_Input;
|
||
|
|
||
|
MyLog4qt::SetLoggerText(logName,CLogFormCreate::GGetCalibration(lstAtribute,lstContext));
|
||
|
}
|
||
|
|
||
|
MyLog4qt::SetLoggerText(logName,CLogFormCreate::GTitleCalibrationEnd());
|
||
|
|
||
|
MyLog4qt::SetLoggerText(logName,CLogFormCreate::GTitleSpectrum());
|
||
|
|
||
|
lstAtribute.clear();
|
||
|
lstContext.clear();
|
||
|
lstAtribute<<QLatin1String("ECutAnalysis_Low")
|
||
|
<<QLatin1String("ECutAnalysis_High")<<QLatin1String("EnergyTolerance")
|
||
|
<<QLatin1String("BaseImprovePSS")<<QLatin1String("PSS_low")
|
||
|
<<QLatin1String("k_back")<<QLatin1String("k_alpha")<<QLatin1String("k_beta")<<QLatin1String("RiskLevelK")
|
||
|
<<QLatin1String("refTime_act")<<QLatin1String("refTime_conc");
|
||
|
|
||
|
lstContext<<QString::number(middleData.setting_specSetup.ECutAnalysis_Low)<<QString::number(middleData.setting_specSetup.ECutAnalysis_High)<<QString::number(middleData.setting_specSetup.EnergyTolerance)
|
||
|
<<QString::number(middleData.setting_specSetup.BaseImprovePSS)<<QString::number(middleData.setting_specSetup.PSS_low)<<QString::number(middleData.setting_specSetup.k_back)<<QString::number(middleData.setting_specSetup.k_alpha)
|
||
|
<<QString::number(middleData.setting_specSetup.k_beta)<<QString::number(middleData.setting_specSetup.RiskLevelK)<<DateTimeSpaceStandard(middleData.setting_specSetup.refTime_act)<<DateTimeSpaceStandard(middleData.setting_specSetup.refTime_conc);
|
||
|
MyLog4qt::SetLoggerText(logName,CLogFormCreate::GGetPROCESSING(lstAtribute,lstContext));
|
||
|
|
||
|
lstAtribute.clear();
|
||
|
lstContext.clear();
|
||
|
lstAtribute<<QLatin1String("CalibrationPSS_low")
|
||
|
<<QLatin1String("CalibrationPSS_high")<<QLatin1String("bUpdateCal")
|
||
|
<<QLatin1String("KeepCalPeakSearchPeaks");
|
||
|
|
||
|
lstContext<<QString::number(middleData.setting_specSetup.CalibrationPSS_low)<<QString::number(middleData.setting_specSetup.CalibrationPSS_high)<<QString::number(middleData.setting_specSetup.bUpdateCal)
|
||
|
<<QString::number(middleData.setting_specSetup.KeepCalPeakSearchPeaks);
|
||
|
MyLog4qt::SetLoggerText(logName,CLogFormCreate::GGetCALIBRATION(lstAtribute,lstContext));
|
||
|
|
||
|
double peaksUsed = 0;
|
||
|
for(int m=0;m<middleData.peaks_Nuclide_name.size();m++)
|
||
|
{
|
||
|
if(!middleData.peaks_Nuclide_name.at(m).isEmpty())
|
||
|
{
|
||
|
peaksUsed++;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
lstAtribute.clear();
|
||
|
lstContext.clear();
|
||
|
lstAtribute<<QString("%1 peaks reported").arg(middleData.peaks_idPeak.size())
|
||
|
<<QString("%1 peaks with ID (%2%)").arg(peaksUsed).arg(peaksUsed/middleData.peaks_idPeak.size()*100)<<QString("%1 peaks without ID(%2%)").
|
||
|
arg(middleData.peaks_idPeak.size()-peaksUsed).arg(double(middleData.peaks_idPeak.size()-peaksUsed)/middleData.peaks_idPeak.size()*100);
|
||
|
lstContext<<QString("")<<QString("")<<QString("");
|
||
|
MyLog4qt::SetLoggerText(logName,CLogFormCreate::GGetPeakSearchResult(lstAtribute,lstContext));
|
||
|
|
||
|
logAtributeData.clear();
|
||
|
logAtributeItem.context.clear();
|
||
|
logAtributeItem.atrribute= QLatin1String("PeakID");
|
||
|
logAtributeItem.unit = QLatin1String("");
|
||
|
logAtributeItem.context = middleData.peaks_idPeak;
|
||
|
logAtributeData.append(logAtributeItem);
|
||
|
|
||
|
logAtributeItem.context.clear();
|
||
|
logAtributeItem.atrribute= QLatin1String("Energy");
|
||
|
logAtributeItem.unit = QLatin1String("");
|
||
|
logAtributeItem.context = GetThreePoint(middleData.peaks_Energy);
|
||
|
logAtributeData.append(logAtributeItem);
|
||
|
|
||
|
logAtributeItem.context.clear();
|
||
|
logAtributeItem.atrribute= QLatin1String("Centroid");
|
||
|
logAtributeItem.unit = QLatin1String("");
|
||
|
logAtributeItem.context = GetThreePoint(middleData.peaks_peakCentroid);
|
||
|
logAtributeData.append(logAtributeItem);
|
||
|
|
||
|
logAtributeItem.context.clear();
|
||
|
logAtributeItem.atrribute= QLatin1String("FWHM");
|
||
|
logAtributeItem.unit = QLatin1String("");
|
||
|
logAtributeItem.context = GetThreePoint(middleData.peaks_Fwhm);
|
||
|
logAtributeData.append(logAtributeItem);
|
||
|
|
||
|
logAtributeItem.context.clear();
|
||
|
logAtributeItem.atrribute= QLatin1String("NetArea");
|
||
|
logAtributeItem.unit = QLatin1String("");
|
||
|
logAtributeItem.context = GetThreePoint(middleData.peaks_Area);
|
||
|
logAtributeData.append(logAtributeItem);
|
||
|
|
||
|
logAtributeItem.context.clear();
|
||
|
logAtributeItem.atrribute= QLatin1String("NAErr%");
|
||
|
logAtributeItem.unit = QLatin1String("");
|
||
|
logAtributeItem.context = GetThreePoint(GetPercent(middleData.peaks_areaErr,middleData.peaks_Area));
|
||
|
logAtributeData.append(logAtributeItem);
|
||
|
|
||
|
logAtributeItem.context.clear();
|
||
|
logAtributeItem.atrribute= QLatin1String("Signif");
|
||
|
logAtributeItem.unit = QLatin1String("");
|
||
|
logAtributeItem.context = GetThreePoint(middleData.peaks_Significance);
|
||
|
logAtributeData.append(logAtributeItem);
|
||
|
|
||
|
logAtributeItem.context.clear();
|
||
|
logAtributeItem.atrribute= QLatin1String("Sensit");
|
||
|
logAtributeItem.unit = QLatin1String("");
|
||
|
logAtributeItem.context = GetThreePoint(middleData.peaks_Sensitivity);
|
||
|
logAtributeData.append(logAtributeItem);
|
||
|
|
||
|
logAtributeItem.context.clear();
|
||
|
logAtributeItem.atrribute= QLatin1String("Nuclide");
|
||
|
logAtributeItem.unit = QLatin1String("");
|
||
|
logAtributeItem.context = middleData.peaks_Nuclide_name;
|
||
|
logAtributeData.append(logAtributeItem);
|
||
|
|
||
|
MyLog4qt::SetLoggerText(logName,CLogFormCreate::SetAttributeContext(logAtributeData));
|
||
|
|
||
|
|
||
|
lstAtribute.clear();
|
||
|
lstContext.clear();
|
||
|
|
||
|
QString qsNuclidesName;
|
||
|
for(int m=0;m<middleData.nucl_ided_Nuclidename.size()-1;m++)
|
||
|
{
|
||
|
qsNuclidesName = qsNuclidesName+ middleData.nucl_ided_Nuclidename.at(m) + QString(",");
|
||
|
}
|
||
|
if(middleData.nucl_ided_Nuclidename.size()>1)
|
||
|
{
|
||
|
qsNuclidesName = qsNuclidesName+middleData.nucl_ided_Nuclidename.at(middleData.nucl_ided_Nuclidename.size()-1);
|
||
|
}
|
||
|
lstAtribute<<QString("Nuclides Identified")
|
||
|
<<QString("Keyline Activities for Nuclides with defined Reference Line")<<QString("Activity Reference Time")
|
||
|
<<QString("Concentration Reference Time");
|
||
|
lstContext<<qsNuclidesName<<QString("")<<middleData.sample_acquisiton_start<<middleData.sample_collection_start;
|
||
|
|
||
|
MyLog4qt::SetLoggerText(logName,CLogFormCreate::GGetPeakSearchResult(lstAtribute,lstContext));
|
||
|
|
||
|
|
||
|
logAtributeData.clear();
|
||
|
logAtributeItem.context.clear();
|
||
|
logAtributeItem.atrribute= QLatin1String("Nuclide");
|
||
|
logAtributeItem.unit = QLatin1String("");
|
||
|
logAtributeItem.context = middleData.nucl_ided_Nuclidename;
|
||
|
logAtributeData.append(logAtributeItem);
|
||
|
|
||
|
logAtributeItem.context.clear();
|
||
|
logAtributeItem.atrribute= QLatin1String("Halflife");
|
||
|
logAtributeItem.unit = QLatin1String("");
|
||
|
logAtributeItem.context = middleData.nucl_ided_Halflife;
|
||
|
logAtributeData.append(logAtributeItem);
|
||
|
|
||
|
logAtributeItem.context.clear();
|
||
|
logAtributeItem.atrribute= QLatin1String("Activity");
|
||
|
logAtributeItem.unit = QLatin1String("bq");
|
||
|
logAtributeItem.context = GetThreePoint(middleData.nucl_ided_activ_key);
|
||
|
logAtributeData.append(logAtributeItem);
|
||
|
|
||
|
logAtributeItem.context.clear();
|
||
|
logAtributeItem.atrribute= QLatin1String("RelErr");
|
||
|
logAtributeItem.unit = QLatin1String("%");
|
||
|
logAtributeItem.context = GetPercent(middleData.nucl_ided_activ_key_err,middleData.nucl_ided_activ_key);
|
||
|
logAtributeData.append(logAtributeItem);
|
||
|
|
||
|
logAtributeItem.context.clear();
|
||
|
logAtributeItem.atrribute= QLatin1String("Conc");
|
||
|
logAtributeItem.unit = QLatin1String("uBq/m^3");
|
||
|
logAtributeItem.context = middleData.nucl_ided_Concentration;
|
||
|
logAtributeData.append(logAtributeItem);
|
||
|
|
||
|
logAtributeItem.context.clear();
|
||
|
logAtributeItem.atrribute= QLatin1String("MDC");
|
||
|
logAtributeItem.unit = QLatin1String("");
|
||
|
logAtributeItem.context = middleData.nucl_ided_MDC;
|
||
|
logAtributeData.append(logAtributeItem);
|
||
|
MyLog4qt::SetLoggerText(logName,CLogFormCreate::SetAttributeContext(logAtributeData));
|
||
|
|
||
|
|
||
|
|
||
|
logAtributeData.clear();
|
||
|
logAtributeItem.context.clear();
|
||
|
logAtributeItem.atrribute= QLatin1String("Name");
|
||
|
logAtributeItem.unit = QLatin1String("");
|
||
|
logAtributeItem.context = middleData.QC_CHECK_QC_NAME;
|
||
|
logAtributeData.append(logAtributeItem);
|
||
|
|
||
|
logAtributeItem.context.clear();
|
||
|
logAtributeItem.atrribute= QLatin1String("Pass/Fail");
|
||
|
logAtributeItem.unit = QLatin1String("");
|
||
|
logAtributeItem.context = GetPass(middleData.QC_CHECK_QC_RESULT);
|
||
|
logAtributeData.append(logAtributeItem);
|
||
|
|
||
|
logAtributeItem.context.clear();
|
||
|
logAtributeItem.atrribute= QLatin1String("Value");
|
||
|
logAtributeItem.unit = QLatin1String("");
|
||
|
logAtributeItem.context = GetThreePoint(middleData.QC_CHECK_QC_VALUE);
|
||
|
logAtributeData.append(logAtributeItem);
|
||
|
|
||
|
logAtributeItem.context.clear();
|
||
|
logAtributeItem.atrribute= QLatin1String("Test");
|
||
|
logAtributeItem.unit = QLatin1String("");
|
||
|
logAtributeItem.context = middleData.QC_CHECK_QC_STANDARD;
|
||
|
logAtributeData.append(logAtributeItem);
|
||
|
|
||
|
MyLog4qt::SetLoggerText(logName,CLogFormCreate::GSetDataQuality(logAtributeData,middleData.sample_id));
|
||
|
MyLog4qt::SetLoggerText(logName,CLogFormCreate::GTitleSpectrumEnd());
|
||
|
|
||
|
|
||
|
MyLog4qt::SetLoggerText(logName,CLogFormCreate::SqlStore(middleData.dbWriteFlag));
|
||
|
MyLog4qt::SetLoggerText(logName,CLogFormCreate::SetStatus(middleData.dbWriteStatusFlag));
|
||
|
MyLog4qt::SetLoggerText(logName,CLogFormCreate::GSetError(middleData.ErrorInfo));
|
||
|
|
||
|
MyLog4qt::SetLoggerText(logName,CLogFormCreate::AnlyseResultsEnd(bRet));
|
||
|
MyLog4qt::RemoveLogger(logName);*/
|
||
|
|
||
|
return bRet;
|
||
|
}
|
||
|
|
||
|
QString GammaAnalyDataInterface::GetLogContent(structGStoreMiddleProcessData& middleData)
|
||
|
{
|
||
|
///////////////////////////////////////////////////////////////////////
|
||
|
QString strResults = CLogFormCreate::AnlyseResultsBegin();
|
||
|
|
||
|
QVector<LOGFORMCREATE::AttributeContext> logAtributeData;
|
||
|
LOGFORMCREATE::AttributeContext logAtributeItem;
|
||
|
|
||
|
logAtributeItem.context.clear();
|
||
|
logAtributeItem.atrribute= QLatin1String("Channel");
|
||
|
logAtributeItem.unit = QLatin1String("");
|
||
|
logAtributeItem.context = GetThreePoint(middleData.calibration_pairs_S_E_xValue);
|
||
|
logAtributeData.append(logAtributeItem);
|
||
|
|
||
|
logAtributeItem.context.clear();
|
||
|
logAtributeItem.atrribute= QLatin1String("Energy");
|
||
|
logAtributeItem.unit = QLatin1String("keV");
|
||
|
logAtributeItem.context = GetThreePoint(middleData.calibration_pairs_S_E_yValue);
|
||
|
logAtributeData.append(logAtributeItem);
|
||
|
|
||
|
logAtributeItem.context.clear();
|
||
|
logAtributeItem.atrribute= QLatin1String("Error");
|
||
|
logAtributeItem.unit = QLatin1String("");
|
||
|
logAtributeItem.context =GetThreePoint(middleData.calibration_pairs_S_E_uncYValue);
|
||
|
logAtributeData.append(logAtributeItem);
|
||
|
|
||
|
///////////////////////////////////////////////////////////////
|
||
|
strResults += CLogFormCreate::TitleCalibration();
|
||
|
strResults += CLogFormCreate::GSetSampleEnergyChannel(logAtributeData,middleData.sample_id);
|
||
|
|
||
|
logAtributeData.clear();
|
||
|
logAtributeItem.context.clear();
|
||
|
logAtributeItem.atrribute= QLatin1String("Channel");
|
||
|
logAtributeItem.unit = QLatin1String("");
|
||
|
logAtributeItem.context = GetThreePoint(middleData.calibration_pairs_S_EF_xValue);
|
||
|
logAtributeData.append(logAtributeItem);
|
||
|
|
||
|
logAtributeItem.context.clear();
|
||
|
logAtributeItem.atrribute= QLatin1String("Energy");
|
||
|
logAtributeItem.unit = QLatin1String("keV");
|
||
|
logAtributeItem.context = GetThreePoint(middleData.calibration_pairs_S_EF_yValue);
|
||
|
logAtributeData.append(logAtributeItem);
|
||
|
|
||
|
logAtributeItem.context.clear();
|
||
|
logAtributeItem.atrribute= QLatin1String("Error");
|
||
|
logAtributeItem.unit = QLatin1String("");
|
||
|
logAtributeItem.context = GetThreePoint(middleData.calibration_pairs_S_EF_uncYValue);
|
||
|
logAtributeData.append(logAtributeItem);
|
||
|
|
||
|
/////////////////////////////////////////////////////////////////////////////
|
||
|
strResults += CLogFormCreate::GSetSampleEfficiencyChannel(logAtributeData,middleData.sample_id);
|
||
|
|
||
|
logAtributeData.clear();
|
||
|
logAtributeItem.context.clear();
|
||
|
logAtributeItem.atrribute= QLatin1String("Channel");
|
||
|
logAtributeItem.unit = QLatin1String("");
|
||
|
logAtributeItem.context = GetThreePoint(middleData.calibration_pairs_S_R_xValue);
|
||
|
logAtributeData.append(logAtributeItem);
|
||
|
|
||
|
logAtributeItem.context.clear();
|
||
|
logAtributeItem.atrribute= QLatin1String("Energy");
|
||
|
logAtributeItem.unit = QLatin1String("keV");
|
||
|
logAtributeItem.context = GetThreePoint(middleData.calibration_pairs_S_R_yValue);
|
||
|
logAtributeData.append(logAtributeItem);
|
||
|
|
||
|
logAtributeItem.context.clear();
|
||
|
logAtributeItem.atrribute= QLatin1String("Error");
|
||
|
logAtributeItem.unit = QLatin1String("");
|
||
|
logAtributeItem.context = GetThreePoint(middleData.calibration_pairs_S_R_uncYValue);
|
||
|
logAtributeData.append(logAtributeItem);
|
||
|
|
||
|
/////////////////////////////////////////////////////////////////////////////////
|
||
|
strResults += CLogFormCreate::GSetSampleResolutionChannel(logAtributeData,middleData.sample_id);
|
||
|
|
||
|
logAtributeData.clear();
|
||
|
logAtributeItem.context.clear();
|
||
|
logAtributeItem.atrribute= QLatin1String("Channel");
|
||
|
logAtributeItem.unit = QLatin1String("");
|
||
|
logAtributeItem.context = middleData.calibration_pairs_S_T_xValue;
|
||
|
logAtributeData.append(logAtributeItem);
|
||
|
|
||
|
logAtributeItem.context.clear();
|
||
|
logAtributeItem.atrribute= QLatin1String("Energy");
|
||
|
logAtributeItem.unit = QLatin1String("keV");
|
||
|
logAtributeItem.context = GetThreePoint(middleData.calibration_pairs_S_T_yValue);
|
||
|
logAtributeData.append(logAtributeItem);
|
||
|
|
||
|
logAtributeItem.context.clear();
|
||
|
logAtributeItem.atrribute= QLatin1String("Error");
|
||
|
logAtributeItem.unit = QLatin1String("");
|
||
|
logAtributeItem.context = GetThreePoint(middleData.calibration_pairs_S_T_uncYValue);
|
||
|
logAtributeData.append(logAtributeItem);
|
||
|
|
||
|
////////////////////////////////////////////////////////////////////////////////////
|
||
|
strResults += CLogFormCreate::GSetSampleTotalEfficiencyChannel(logAtributeData,middleData.sample_id);
|
||
|
|
||
|
QStringList lstAtribute;
|
||
|
QStringList lstContext;
|
||
|
lstAtribute<<QLatin1String("Collection Start")
|
||
|
<<QLatin1String("Collection Stop")<<QLatin1String("Sampling Time[h]")
|
||
|
<<QLatin1String("Sample Quantity[m3]")<<QLatin1String("Decay Time[h]")
|
||
|
<<QLatin1String("Acquisition Start")<<QLatin1String("Acquisition Stop")<<QLatin1String("Acquisition Time[s]");
|
||
|
|
||
|
lstContext<<middleData.sample_collection_start<<middleData.sample_collection_stop
|
||
|
<<middleData.sample_time
|
||
|
<<QLatin1String(" ")+middleData.sample_quantity<<middleData.sample_decay_time
|
||
|
<<middleData.sample_acquisiton_start<<middleData.sample_acquistion_stop<<middleData.sample_acquistion_time;
|
||
|
|
||
|
//////////////////////////////////////////////////////////////////////////////////////////
|
||
|
strResults += CLogFormCreate::GGetSampleInfo(lstAtribute,lstContext);
|
||
|
strResults += CLogFormCreate::TitleCalibrationIdEnd();
|
||
|
strResults += CLogFormCreate::GTitleCalibration();
|
||
|
|
||
|
if(middleData.calibration_pairs_E_idCalPoint.size()>0)
|
||
|
{
|
||
|
lstAtribute.clear();
|
||
|
lstContext.clear();
|
||
|
lstAtribute<<QString("Energy Calibration [%1 ]").arg(middleData.calibration_pairs_E_Input)
|
||
|
<<QLatin1String("Function:")<<QLatin1String("E:")
|
||
|
<<QLatin1String("P:")<<QLatin1String("Err:")
|
||
|
<<QLatin1String("Data:");
|
||
|
|
||
|
lstContext<<QString("")<<middleData.calibration_E_functionTypeDef
|
||
|
<<middleData.calibration_E_functionDef<<middleData.calibration_E_coeff_string<<middleData.calibration_E_uncoeff_string<<middleData.calibration_pairs_E_Input;
|
||
|
|
||
|
/////////////////////////////////////////////////////////////////////////////////////////////
|
||
|
strResults += CLogFormCreate::GGetCalibration(lstAtribute,lstContext);
|
||
|
}
|
||
|
|
||
|
if(middleData.calibration_pairs_R_idCalPoint.size()>0)
|
||
|
{
|
||
|
lstAtribute.clear();
|
||
|
lstContext.clear();
|
||
|
lstAtribute<<QString("Resolution Calibration [%1 ]").arg(middleData.calibration_pairs_R_Input)
|
||
|
<<QLatin1String("Function:")<<QLatin1String("E:")
|
||
|
<<QLatin1String("P:")<<QLatin1String("Err:")
|
||
|
<<QLatin1String("Data:");
|
||
|
|
||
|
lstContext<<QString("")<<middleData.calibration_R_functionTypeDef
|
||
|
<<middleData.calibration_R_functionDef<<middleData.calibration_R_coeff_string<<middleData.calibration_R_uncoeff_string<<middleData.calibration_pairs_R_Input;
|
||
|
|
||
|
//////////////////////////////////////////////////////////////////////////////////////////////
|
||
|
strResults += CLogFormCreate::GGetCalibration(lstAtribute,lstContext);
|
||
|
}
|
||
|
|
||
|
if(middleData.calibration_pairs_EF_idCalPoint.size()>0)
|
||
|
{
|
||
|
lstAtribute.clear();
|
||
|
lstContext.clear();
|
||
|
lstAtribute<<QString("Efficiency Calibration [%1 ]").arg(middleData.calibration_pairs_EF_Input)
|
||
|
<<QLatin1String("Function:")<<QLatin1String("E:")
|
||
|
<<QLatin1String("P:")<<QLatin1String("Err:")
|
||
|
<<QLatin1String("Data:");
|
||
|
|
||
|
lstContext<<QString("")<<middleData.calibration_EF_functionTypeDef
|
||
|
<<middleData.calibration_EF_functionDef<<middleData.calibration_EF_coeff_string<<middleData.calibration_EF_uncoeff_string<<middleData.calibration_pairs_EF_Input;
|
||
|
|
||
|
/////////////////////////////////////////////////////////////////////////////////////////////////
|
||
|
strResults += CLogFormCreate::GGetCalibration(lstAtribute,lstContext);
|
||
|
}
|
||
|
|
||
|
if(middleData.calibration_pairs_T_idCalPoint.size()>0)
|
||
|
{
|
||
|
lstAtribute.clear();
|
||
|
lstContext.clear();
|
||
|
lstAtribute<<QString("Tot_efficiency Calibration [%1 ]").arg(middleData.calibration_pairs_T_Input)
|
||
|
<<QLatin1String("Function:")<<QString("E")
|
||
|
<<QLatin1String("P:")<<QLatin1String("Err:")
|
||
|
<<QLatin1String("Data:");
|
||
|
|
||
|
lstContext<<QString("")<<middleData.calibration_T_functionTypeDef
|
||
|
<<middleData.calibration_T_functionDef<<middleData.calibration_T_coeff_string<<middleData.calibration_T_uncoeff_string<<middleData.calibration_pairs_T_Input;
|
||
|
|
||
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||
|
strResults += CLogFormCreate::GGetCalibration(lstAtribute,lstContext);
|
||
|
}
|
||
|
|
||
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||
|
strResults += CLogFormCreate::GTitleCalibrationEnd();
|
||
|
strResults += CLogFormCreate::GTitleSpectrum();
|
||
|
|
||
|
lstAtribute.clear();
|
||
|
lstContext.clear();
|
||
|
lstAtribute<<QLatin1String("ECutAnalysis_Low")
|
||
|
<<QLatin1String("ECutAnalysis_High")<<QLatin1String("EnergyTolerance")
|
||
|
<<QLatin1String("BaseImprovePSS")<<QLatin1String("PSS_low")
|
||
|
<<QLatin1String("k_back")<<QLatin1String("k_alpha")<<QLatin1String("k_beta")<<QLatin1String("RiskLevelK")
|
||
|
<<QLatin1String("refTime_act")<<QLatin1String("refTime_conc");
|
||
|
|
||
|
lstContext<<QString::number(middleData.setting_specSetup.ECutAnalysis_Low)<<QString::number(middleData.setting_specSetup.ECutAnalysis_High)<<QString::number(middleData.setting_specSetup.EnergyTolerance)
|
||
|
<<QString::number(middleData.setting_specSetup.BaseImprovePSS)<<QString::number(middleData.setting_specSetup.PSS_low)<<QString::number(middleData.setting_specSetup.k_back)<<QString::number(middleData.setting_specSetup.k_alpha)
|
||
|
<<QString::number(middleData.setting_specSetup.k_beta)<<QString::number(middleData.setting_specSetup.RiskLevelK)<<DateTimeSpaceStandard(middleData.setting_specSetup.refTime_act)<<DateTimeSpaceStandard(middleData.setting_specSetup.refTime_conc);
|
||
|
|
||
|
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||
|
strResults += CLogFormCreate::GGetPROCESSING(lstAtribute,lstContext);
|
||
|
|
||
|
lstAtribute.clear();
|
||
|
lstContext.clear();
|
||
|
lstAtribute<<QLatin1String("CalibrationPSS_low")
|
||
|
<<QLatin1String("CalibrationPSS_high")<<QLatin1String("bUpdateCal")
|
||
|
<<QLatin1String("KeepCalPeakSearchPeaks");
|
||
|
|
||
|
lstContext<<QString::number(middleData.setting_specSetup.CalibrationPSS_low)<<QString::number(middleData.setting_specSetup.CalibrationPSS_high)<<QString::number(middleData.setting_specSetup.bUpdateCal)
|
||
|
<<QString::number(middleData.setting_specSetup.KeepCalPeakSearchPeaks);
|
||
|
|
||
|
//////////////////////////////////////////////////////////////////////////////////////////
|
||
|
strResults += CLogFormCreate::GGetCALIBRATION(lstAtribute,lstContext);
|
||
|
|
||
|
double peaksUsed = 0;
|
||
|
for(int m=0;m<middleData.peaks_Nuclide_name.size();m++)
|
||
|
{
|
||
|
if(!middleData.peaks_Nuclide_name.at(m).isEmpty())
|
||
|
{
|
||
|
peaksUsed++;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
lstAtribute.clear();
|
||
|
lstContext.clear();
|
||
|
lstAtribute<<QString("%1 peaks reported").arg(middleData.peaks_idPeak.size())
|
||
|
<<QString("%1 peaks with ID (%2%)").arg(peaksUsed).arg(peaksUsed/middleData.peaks_idPeak.size()*100)<<QString("%1 peaks without ID(%2%)").
|
||
|
arg(middleData.peaks_idPeak.size()-peaksUsed).arg(double(middleData.peaks_idPeak.size()-peaksUsed)/middleData.peaks_idPeak.size()*100);
|
||
|
lstContext<<QString("")<<QString("")<<QString("");
|
||
|
|
||
|
//////////////////////////////////////////////////////////////////////////////////////////////
|
||
|
strResults += CLogFormCreate::GGetPeakSearchResult(lstAtribute,lstContext);
|
||
|
|
||
|
logAtributeData.clear();
|
||
|
logAtributeItem.context.clear();
|
||
|
logAtributeItem.atrribute= QLatin1String("PeakID");
|
||
|
logAtributeItem.unit = QLatin1String("");
|
||
|
logAtributeItem.context = middleData.peaks_idPeak;
|
||
|
logAtributeData.append(logAtributeItem);
|
||
|
|
||
|
logAtributeItem.context.clear();
|
||
|
logAtributeItem.atrribute= QLatin1String("Energy");
|
||
|
logAtributeItem.unit = QLatin1String("");
|
||
|
logAtributeItem.context = GetThreePoint(middleData.peaks_Energy);
|
||
|
logAtributeData.append(logAtributeItem);
|
||
|
|
||
|
logAtributeItem.context.clear();
|
||
|
logAtributeItem.atrribute= QLatin1String("Centroid");
|
||
|
logAtributeItem.unit = QLatin1String("");
|
||
|
logAtributeItem.context = GetThreePoint(middleData.peaks_peakCentroid);
|
||
|
logAtributeData.append(logAtributeItem);
|
||
|
|
||
|
logAtributeItem.context.clear();
|
||
|
logAtributeItem.atrribute= QLatin1String("FWHM");
|
||
|
logAtributeItem.unit = QLatin1String("");
|
||
|
logAtributeItem.context = GetThreePoint(middleData.peaks_Fwhm);
|
||
|
logAtributeData.append(logAtributeItem);
|
||
|
|
||
|
logAtributeItem.context.clear();
|
||
|
logAtributeItem.atrribute= QLatin1String("NetArea");
|
||
|
logAtributeItem.unit = QLatin1String("");
|
||
|
logAtributeItem.context = GetThreePoint(middleData.peaks_Area);
|
||
|
logAtributeData.append(logAtributeItem);
|
||
|
|
||
|
logAtributeItem.context.clear();
|
||
|
logAtributeItem.atrribute= QLatin1String("NAErr%");
|
||
|
logAtributeItem.unit = QLatin1String("");
|
||
|
logAtributeItem.context = GetThreePoint(GetPercent(middleData.peaks_areaErr,middleData.peaks_Area));
|
||
|
logAtributeData.append(logAtributeItem);
|
||
|
|
||
|
logAtributeItem.context.clear();
|
||
|
logAtributeItem.atrribute= QLatin1String("Signif");
|
||
|
logAtributeItem.unit = QLatin1String("");
|
||
|
logAtributeItem.context = GetThreePoint(middleData.peaks_Significance);
|
||
|
logAtributeData.append(logAtributeItem);
|
||
|
|
||
|
logAtributeItem.context.clear();
|
||
|
logAtributeItem.atrribute= QLatin1String("Sensit");
|
||
|
logAtributeItem.unit = QLatin1String("");
|
||
|
logAtributeItem.context = GetThreePoint(middleData.peaks_Sensitivity);
|
||
|
logAtributeData.append(logAtributeItem);
|
||
|
|
||
|
logAtributeItem.context.clear();
|
||
|
logAtributeItem.atrribute= QLatin1String("Nuclide");
|
||
|
logAtributeItem.unit = QLatin1String("");
|
||
|
logAtributeItem.context = middleData.peaks_Nuclide_name;
|
||
|
logAtributeData.append(logAtributeItem);
|
||
|
|
||
|
///////////////////////////////////////////////////////////////////////////////////////
|
||
|
strResults += CLogFormCreate::SetAttributeContext(logAtributeData);
|
||
|
|
||
|
lstAtribute.clear();
|
||
|
lstContext.clear();
|
||
|
|
||
|
QString qsNuclidesName;
|
||
|
for(int m=0;m<middleData.nucl_ided_Nuclidename.size()-1;m++)
|
||
|
{
|
||
|
qsNuclidesName = qsNuclidesName+ middleData.nucl_ided_Nuclidename.at(m) + QString(",");
|
||
|
}
|
||
|
if(middleData.nucl_ided_Nuclidename.size()>1)
|
||
|
{
|
||
|
qsNuclidesName = qsNuclidesName+middleData.nucl_ided_Nuclidename.at(middleData.nucl_ided_Nuclidename.size()-1);
|
||
|
}
|
||
|
lstAtribute<<QString("Nuclides Identified")
|
||
|
<<QString("Keyline Activities for Nuclides with defined Reference Line")<<QString("Activity Reference Time")
|
||
|
<<QString("Concentration Reference Time");
|
||
|
lstContext<<qsNuclidesName<<QString("")<<middleData.sample_acquisiton_start<<middleData.sample_collection_start;
|
||
|
|
||
|
//////////////////////////////////////////////////////////////////////////////////////////////
|
||
|
strResults += CLogFormCreate::GGetPeakSearchResult(lstAtribute,lstContext);
|
||
|
|
||
|
logAtributeData.clear();
|
||
|
logAtributeItem.context.clear();
|
||
|
logAtributeItem.atrribute= QLatin1String("Nuclide");
|
||
|
logAtributeItem.unit = QLatin1String("");
|
||
|
logAtributeItem.context = middleData.nucl_ided_Nuclidename;
|
||
|
logAtributeData.append(logAtributeItem);
|
||
|
|
||
|
logAtributeItem.context.clear();
|
||
|
logAtributeItem.atrribute= QLatin1String("Halflife");
|
||
|
logAtributeItem.unit = QLatin1String("");
|
||
|
logAtributeItem.context = middleData.nucl_ided_Halflife;
|
||
|
logAtributeData.append(logAtributeItem);
|
||
|
|
||
|
logAtributeItem.context.clear();
|
||
|
logAtributeItem.atrribute= QLatin1String("Activity");
|
||
|
logAtributeItem.unit = QLatin1String("bq");
|
||
|
logAtributeItem.context = GetThreePoint(middleData.nucl_ided_activ_key);
|
||
|
logAtributeData.append(logAtributeItem);
|
||
|
|
||
|
logAtributeItem.context.clear();
|
||
|
logAtributeItem.atrribute= QLatin1String("RelErr");
|
||
|
logAtributeItem.unit = QLatin1String("%");
|
||
|
logAtributeItem.context = GetPercent(middleData.nucl_ided_activ_key_err,middleData.nucl_ided_activ_key);
|
||
|
logAtributeData.append(logAtributeItem);
|
||
|
|
||
|
logAtributeItem.context.clear();
|
||
|
logAtributeItem.atrribute= QLatin1String("Conc");
|
||
|
logAtributeItem.unit = QLatin1String("uBq/m^3");
|
||
|
logAtributeItem.context = middleData.nucl_ided_Concentration;
|
||
|
logAtributeData.append(logAtributeItem);
|
||
|
|
||
|
logAtributeItem.context.clear();
|
||
|
logAtributeItem.atrribute= QLatin1String("MDC");
|
||
|
logAtributeItem.unit = QLatin1String("");
|
||
|
logAtributeItem.context = middleData.nucl_ided_MDC;
|
||
|
logAtributeData.append(logAtributeItem);
|
||
|
|
||
|
////////////////////////////////////////////////////////////////////////////////////
|
||
|
strResults += CLogFormCreate::SetAttributeContext(logAtributeData);
|
||
|
|
||
|
logAtributeData.clear();
|
||
|
logAtributeItem.context.clear();
|
||
|
logAtributeItem.atrribute= QLatin1String("Name");
|
||
|
logAtributeItem.unit = QLatin1String("");
|
||
|
logAtributeItem.context = middleData.QC_CHECK_QC_NAME;
|
||
|
logAtributeData.append(logAtributeItem);
|
||
|
|
||
|
logAtributeItem.context.clear();
|
||
|
logAtributeItem.atrribute= QLatin1String("Pass/Fail");
|
||
|
logAtributeItem.unit = QLatin1String("");
|
||
|
logAtributeItem.context = GetPass(middleData.QC_CHECK_QC_RESULT);
|
||
|
logAtributeData.append(logAtributeItem);
|
||
|
|
||
|
logAtributeItem.context.clear();
|
||
|
logAtributeItem.atrribute= QLatin1String("Value");
|
||
|
logAtributeItem.unit = QLatin1String("");
|
||
|
logAtributeItem.context = GetThreePoint(middleData.QC_CHECK_QC_VALUE);
|
||
|
logAtributeData.append(logAtributeItem);
|
||
|
|
||
|
logAtributeItem.context.clear();
|
||
|
logAtributeItem.atrribute= QLatin1String("Test");
|
||
|
logAtributeItem.unit = QLatin1String("");
|
||
|
logAtributeItem.context = middleData.QC_CHECK_QC_STANDARD;
|
||
|
logAtributeData.append(logAtributeItem);
|
||
|
|
||
|
///////////////////////////////////////////////////////////////////////////////////////
|
||
|
strResults += CLogFormCreate::GSetDataQuality(logAtributeData,middleData.sample_id);
|
||
|
strResults += CLogFormCreate::GTitleSpectrumEnd();
|
||
|
|
||
|
strResults += CLogFormCreate::SqlStore(middleData.dbWriteFlag);
|
||
|
strResults += CLogFormCreate::SetStatus(middleData.dbWriteStatusFlag);
|
||
|
strResults += CLogFormCreate::GSetError(middleData.ErrorInfo);
|
||
|
|
||
|
strResults += CLogFormCreate::AnlyseResultsEnd(true);
|
||
|
return strResults;
|
||
|
}
|
||
|
|
||
|
QString GammaAnalyDataInterface::GetReportContent(structGStoreMiddleProcessData& middleData)
|
||
|
{
|
||
|
MyReport::REPORTINPUTPARA para = GetReportData(middleData);
|
||
|
|
||
|
MyReport::reportTable _text = para.text;
|
||
|
QMap<int,int>columnWidth = ReportOutput::GetMaxColumnSize(_text);
|
||
|
QMap<int,int>::iterator itor = columnWidth.begin();
|
||
|
int width=0;
|
||
|
int maxWidth=0;
|
||
|
for(;itor!=columnWidth.end();itor++)
|
||
|
{
|
||
|
*itor+=COL_GAP;
|
||
|
width+=itor.value();
|
||
|
if(maxWidth<itor.value())
|
||
|
{
|
||
|
maxWidth = itor.value();
|
||
|
}
|
||
|
}
|
||
|
#ifdef COLUMN_EQUAL
|
||
|
//设置最大宽度
|
||
|
itor = columnWidth.begin();
|
||
|
for(;itor!=columnWidth.end();itor++)
|
||
|
{
|
||
|
*itor=maxWidth;
|
||
|
width=maxWidth*columnWidth.size();
|
||
|
}
|
||
|
#endif
|
||
|
QVector<QString> title = _text.tilte;
|
||
|
QString strResults;
|
||
|
QTextStream stream(&strResults);
|
||
|
stream.setFieldAlignment(QTextStream::AlignCenter);
|
||
|
for(int pos=0;pos<title.size();pos++)
|
||
|
{
|
||
|
stream.setFieldWidth(width);
|
||
|
stream<<title.at(pos);
|
||
|
stream.setFieldWidth(0);
|
||
|
stream<<STRING_END;
|
||
|
}
|
||
|
stream<<STRING_END;
|
||
|
|
||
|
stream.setFieldAlignment(QTextStream::AlignLeft);
|
||
|
|
||
|
for(int pos=0;pos<_text.data.size();pos++)
|
||
|
{
|
||
|
MyReport::reportTableGroup group = _text.data.at(pos);
|
||
|
if(group.form == MyReport::Horizontal)
|
||
|
{
|
||
|
stream.setFieldWidth(columnWidth[0]);
|
||
|
if(!group.header.isEmpty())
|
||
|
{
|
||
|
stream<<ROW_HEADER_FLAG+group.header;
|
||
|
}
|
||
|
stream.setFieldWidth(0);
|
||
|
stream<<STRING_END;
|
||
|
for(int cell=0;cell<group.data.size();cell++)
|
||
|
{
|
||
|
stream.setFieldWidth(columnWidth[0]);
|
||
|
stream <<ROW_HEADER_BEGIN+group.data.at(cell).Flag+ROW_HEADER_ASSIGN;
|
||
|
stream.setFieldWidth(columnWidth[1]);
|
||
|
|
||
|
if(group.data.at(cell).Data.size())
|
||
|
{
|
||
|
stream<<group.data.at(cell).Data.at(0);
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
//
|
||
|
}
|
||
|
stream.setFieldWidth(0);
|
||
|
stream<<STRING_END;
|
||
|
}
|
||
|
stream.setFieldWidth(0);
|
||
|
stream<<STRING_END;
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
stream.setFieldWidth(columnWidth[0]);
|
||
|
if(!group.header.isEmpty())
|
||
|
{
|
||
|
stream<<ROW_HEADER_FLAG+group.header;
|
||
|
}
|
||
|
|
||
|
stream.setFieldWidth(0);
|
||
|
stream<<STRING_END;
|
||
|
|
||
|
if(group.data.size()>0)
|
||
|
{
|
||
|
//flag
|
||
|
for(int fRow=0;fRow<group.data.size();fRow++)
|
||
|
{
|
||
|
stream.setFieldWidth(columnWidth[fRow]);
|
||
|
if(fRow == 0)
|
||
|
{
|
||
|
stream<<ROW_HEADER_BEGIN+group.data.at(fRow).Flag;
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
stream<<group.data.at(fRow).Flag;
|
||
|
}
|
||
|
}
|
||
|
stream.setFieldWidth(0);
|
||
|
stream<<STRING_END;
|
||
|
//text
|
||
|
for(int tRow=0;tRow<group.data.at(0).Data.size();tRow++)
|
||
|
{
|
||
|
for(int cRow=0;cRow<group.data.size();cRow++)
|
||
|
{
|
||
|
stream.setFieldWidth(columnWidth[cRow]);
|
||
|
if(cRow == 0)
|
||
|
{
|
||
|
stream<<ROW_HEADER_BEGIN+group.data.at(cRow).Data.at(tRow);
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
if(group.data.at(cRow).Data.size()>tRow)
|
||
|
{
|
||
|
stream<<group.data.at(cRow).Data.at(tRow);
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
stream<<QString("");
|
||
|
}
|
||
|
}
|
||
|
|
||
|
}
|
||
|
stream.setFieldWidth(0);
|
||
|
stream<<STRING_END;
|
||
|
}
|
||
|
}
|
||
|
stream.setFieldWidth(0);
|
||
|
stream<<STRING_END;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
return strResults;
|
||
|
}
|
||
|
|
||
|
MyReport::REPORTINPUTPARA GammaAnalyDataInterface::GetReportData(structGStoreMiddleProcessData &middleData)
|
||
|
{
|
||
|
MyReport::REPORTINPUTPARA inputPara;
|
||
|
MyReport::reportTable reportTable;
|
||
|
reportTable.tilte<<QLatin1String("CNL06 GENERATED REPORT")<<QString("%1 RADIONUCLIDE REPORT").arg(middleData.analyses_type)
|
||
|
<<QLatin1String("(Noble Gas Version)")<<QString("Creation Date %1").arg(QDateTime::currentDateTime().toString(FILE_DATE_TIME_FORMAT3));
|
||
|
|
||
|
MyReport::reportTableGroup group;
|
||
|
|
||
|
group.header = QLatin1String("SAMPLE INFORMATION");
|
||
|
MyReport::reportTableCell cell;
|
||
|
cell.Flag = QLatin1String("Station ID");
|
||
|
cell.Data.clear();
|
||
|
cell.Data<<middleData.sample_stationID;
|
||
|
group.data.append(cell);
|
||
|
|
||
|
cell.Flag = QLatin1String("Detector ID");
|
||
|
cell.Data.clear();
|
||
|
cell.Data<<middleData.sample_detectID;
|
||
|
group.data.append(cell);
|
||
|
|
||
|
cell.Flag = QLatin1String("Sample ID");
|
||
|
cell.Data.clear();
|
||
|
cell.Data<<middleData.sample_id;
|
||
|
group.data.append(cell);
|
||
|
|
||
|
cell.Flag = QLatin1String("Sample Geometry");
|
||
|
cell.Data.clear();
|
||
|
cell.Data<<middleData.sample_Geometry;
|
||
|
group.data.append(cell);
|
||
|
|
||
|
cell.Flag = QLatin1String("Sample Quantity[m3]");
|
||
|
cell.Data.clear();
|
||
|
cell.Data<<QLatin1String(" ")+middleData.sample_quantity;
|
||
|
group.data.append(cell);
|
||
|
|
||
|
cell.Flag = QLatin1String("Sample Type");
|
||
|
cell.Data.clear();
|
||
|
cell.Data<<middleData.sample_Type;
|
||
|
group.data.append(cell);
|
||
|
|
||
|
cell.Flag = QLatin1String("Collection Start");
|
||
|
cell.Data.clear();
|
||
|
cell.Data<<middleData.sample_collection_start;
|
||
|
group.data.append(cell);
|
||
|
|
||
|
cell.Flag = QLatin1String("Collection Stop");
|
||
|
cell.Data.clear();
|
||
|
cell.Data<<middleData.sample_collection_stop;
|
||
|
group.data.append(cell);
|
||
|
|
||
|
cell.Flag = QLatin1String("Sampling Time[h]");
|
||
|
cell.Data.clear();
|
||
|
cell.Data<<middleData.sample_time;
|
||
|
group.data.append(cell);
|
||
|
|
||
|
cell.Flag = QLatin1String("Decay Time[h]");
|
||
|
cell.Data.clear();
|
||
|
cell.Data<<middleData.sample_decay_time;
|
||
|
group.data.append(cell);
|
||
|
|
||
|
cell.Flag = QLatin1String("Acquisition Start");
|
||
|
cell.Data.clear();
|
||
|
cell.Data<<middleData.sample_acquisiton_start;
|
||
|
group.data.append(cell);
|
||
|
|
||
|
cell.Flag = QLatin1String("Acquisition Stop");
|
||
|
cell.Data.clear();
|
||
|
cell.Data<<middleData.sample_acquistion_stop;
|
||
|
group.data.append(cell);
|
||
|
|
||
|
cell.Flag = QLatin1String("Acquisition Time[s]");
|
||
|
cell.Data.clear();
|
||
|
cell.Data<<middleData.sample_acquistion_time;
|
||
|
group.data.append(cell);
|
||
|
|
||
|
cell.Flag = QLatin1String("Avg Flow Rate[m3/h]");
|
||
|
cell.Data.clear();
|
||
|
cell.Data<<middleData.sample_Avg_Flow_Rate;
|
||
|
group.data.append(cell);
|
||
|
|
||
|
cell.Flag = QLatin1String("Collection Station Comments");
|
||
|
// cell.Data.clear();
|
||
|
GetReportFixedWidth(cell,group,COLUMN_WIDTH,middleData.Collection_Station_Comments);
|
||
|
// cell.Data<<middleData.Collection_Station_Comments;
|
||
|
// group.data.append(cell);
|
||
|
|
||
|
cell.Flag = QLatin1String("Analysis General Comments");
|
||
|
// cell.Data.clear();
|
||
|
//cell.Data<<middleData.NDC_Analysis_General_Comments;
|
||
|
//group.data.append(cell);
|
||
|
GetReportFixedWidth(cell,group,COLUMN_WIDTH,middleData.NDC_Analysis_General_Comments);
|
||
|
|
||
|
reportTable.data.append(group);
|
||
|
|
||
|
QString qsNuclidesName;
|
||
|
for(int m=0;m<middleData.nucl_ided_Nuclidename.size()-1;m++)
|
||
|
{
|
||
|
qsNuclidesName = qsNuclidesName+ middleData.nucl_ided_Nuclidename.at(m) + QString(",");
|
||
|
}
|
||
|
if(middleData.nucl_ided_Nuclidename.size()>1)
|
||
|
{
|
||
|
qsNuclidesName = qsNuclidesName+middleData.nucl_ided_Nuclidename.at(middleData.nucl_ided_Nuclidename.size()-1);
|
||
|
}
|
||
|
|
||
|
group.data.clear();
|
||
|
group.header = QLatin1String("ACTIVITY SUMMARY");
|
||
|
cell.Flag = QLatin1String("Nuclides Identified");
|
||
|
// cell.Data.clear();
|
||
|
// cell.Data<<qsNuclidesName;
|
||
|
// group.data.append(cell);
|
||
|
GetReportFixedWidth(cell,group,COLUMN_WIDTH,qsNuclidesName);
|
||
|
|
||
|
cell.Flag = QLatin1String("Keyline Activities for Nuclides");
|
||
|
cell.Data.clear();
|
||
|
cell.Data<<QLatin1String("");
|
||
|
group.data.append(cell);
|
||
|
|
||
|
cell.Flag = QLatin1String("with defined Reference Line");
|
||
|
cell.Data.clear();
|
||
|
cell.Data<<QLatin1String("");
|
||
|
group.data.append(cell);
|
||
|
|
||
|
cell.Flag = QLatin1String("Activity Reference Time");
|
||
|
cell.Data.clear();
|
||
|
cell.Data<<middleData.sample_acquisiton_start;
|
||
|
group.data.append(cell);
|
||
|
cell.Flag = QLatin1String("Concentration Reference Time");
|
||
|
cell.Data.clear();
|
||
|
cell.Data<<middleData.sample_collection_start;;
|
||
|
group.data.append(cell);
|
||
|
reportTable.data.append(group);
|
||
|
|
||
|
group.header = QLatin1String("");
|
||
|
group.data.clear();
|
||
|
group.form = MyReport::Vertical;
|
||
|
cell.Flag = QLatin1String("Nuclide");
|
||
|
cell.Data.clear();
|
||
|
cell.Data<<middleData.nucl_ided_Nuclidename;
|
||
|
group.data.append(cell);
|
||
|
|
||
|
group.form = MyReport::Vertical;
|
||
|
cell.Flag = QLatin1String("Halflife(s)");
|
||
|
cell.Data.clear();
|
||
|
cell.Data<<middleData.nucl_ided_Halflife;
|
||
|
group.data.append(cell);
|
||
|
|
||
|
group.form = MyReport::Vertical;
|
||
|
cell.Flag = QLatin1String("Activity(Bq)");
|
||
|
cell.Data.clear();
|
||
|
cell.Data<<GetThreePoint(middleData.nucl_ided_activ_key);
|
||
|
group.data.append(cell);
|
||
|
|
||
|
group.form = MyReport::Vertical;
|
||
|
cell.Flag = QLatin1String("RelErr%");
|
||
|
cell.Data.clear();
|
||
|
cell.Data<<GetPercent(middleData.nucl_ided_activ_key_err,middleData.nucl_ided_activ_key);
|
||
|
group.data.append(cell);
|
||
|
|
||
|
group.form = MyReport::Vertical;
|
||
|
cell.Flag = QLatin1String("MDA(Bq)");
|
||
|
cell.Data.clear();
|
||
|
cell.Data<<middleData.nucl_ided_mda;
|
||
|
group.data.append(cell);
|
||
|
|
||
|
group.form = MyReport::Vertical;
|
||
|
cell.Flag = QLatin1String("Conc(uBq/m^3)");
|
||
|
cell.Data.clear();
|
||
|
cell.Data<<middleData.nucl_ided_Concentration;
|
||
|
group.data.append(cell);
|
||
|
|
||
|
group.form = MyReport::Vertical;
|
||
|
cell.Flag = QLatin1String("MDC");
|
||
|
cell.Data.clear();
|
||
|
cell.Data<<middleData.nucl_ided_MDC;
|
||
|
group.data.append(cell);
|
||
|
|
||
|
reportTable.data.append(group);
|
||
|
|
||
|
|
||
|
group.data.clear();
|
||
|
group.header = QLatin1String("PEAK SEARCH RESULTS");
|
||
|
group.form = MyReport::Horizontal;
|
||
|
cell.Flag = QString("%1 peaks reported").arg(middleData.peaks_idPeak.size());
|
||
|
cell.Data.clear();
|
||
|
cell.Data<<QString("");
|
||
|
group.data.append(cell);
|
||
|
|
||
|
double peaksUsed = 0;
|
||
|
for(int m=0;m<middleData.peaks_Nuclide_name.size();m++)
|
||
|
{
|
||
|
if(!middleData.peaks_Nuclide_name.at(m).isEmpty())
|
||
|
{
|
||
|
peaksUsed++;
|
||
|
}
|
||
|
}
|
||
|
cell.Flag = QString("%1 peaks with ID (%2%)").arg(peaksUsed).arg(peaksUsed/middleData.peaks_idPeak.size()*100);
|
||
|
cell.Data.clear();
|
||
|
cell.Data<<QLatin1String("");
|
||
|
group.data.append(cell);
|
||
|
|
||
|
cell.Flag = QString("%1 peaks without ID(%2%)").arg(middleData.peaks_idPeak.size()-peaksUsed).arg(double(middleData.peaks_idPeak.size()-peaksUsed)/middleData.peaks_idPeak.size()*100);
|
||
|
cell.Data.clear();
|
||
|
cell.Data<<QString("");
|
||
|
group.data.append(cell);
|
||
|
|
||
|
reportTable.data.append(group);
|
||
|
|
||
|
group.data.clear();
|
||
|
group.header = QLatin1String("");
|
||
|
group.form = MyReport::Vertical;
|
||
|
cell.Flag = QLatin1String("PeakID");
|
||
|
cell.Data.clear();
|
||
|
cell.Data<<middleData.peaks_idPeak;
|
||
|
group.data.append(cell);
|
||
|
|
||
|
group.form = MyReport::Vertical;
|
||
|
cell.Flag = QLatin1String("Energy[kev]");
|
||
|
cell.Data.clear();
|
||
|
cell.Data<<GetThreePoint(middleData.peaks_Energy);
|
||
|
group.data.append(cell);
|
||
|
|
||
|
group.form = MyReport::Vertical;
|
||
|
cell.Flag = QLatin1String("Centroid");
|
||
|
cell.Data.clear();
|
||
|
cell.Data<<GetThreePoint(middleData.peaks_peakCentroid);
|
||
|
group.data.append(cell);
|
||
|
|
||
|
group.form = MyReport::Vertical;
|
||
|
cell.Flag = QLatin1String("FWHM[kev]");
|
||
|
cell.Data.clear();
|
||
|
cell.Data<<GetThreePoint(middleData.peaks_Fwhm);
|
||
|
group.data.append(cell);
|
||
|
|
||
|
group.form = MyReport::Vertical;
|
||
|
cell.Flag = QLatin1String("NetArea");
|
||
|
cell.Data.clear();
|
||
|
cell.Data<<GetThreePoint(middleData.peaks_Area);
|
||
|
group.data.append(cell);
|
||
|
|
||
|
group.form = MyReport::Vertical;
|
||
|
cell.Flag = QLatin1String("NAErr%");
|
||
|
cell.Data.clear();
|
||
|
cell.Data<<GetThreePoint(GetPercent(middleData.peaks_areaErr,middleData.peaks_Area));
|
||
|
group.data.append(cell);
|
||
|
|
||
|
group.form = MyReport::Vertical;
|
||
|
cell.Flag = QLatin1String("Signif");
|
||
|
cell.Data.clear();
|
||
|
cell.Data<<GetThreePoint(middleData.peaks_Significance);
|
||
|
group.data.append(cell);
|
||
|
|
||
|
group.form = MyReport::Vertical;
|
||
|
cell.Flag = QLatin1String("Sensit");
|
||
|
cell.Data.clear();
|
||
|
cell.Data<<GetThreePoint(middleData.peaks_Sensitivity);
|
||
|
group.data.append(cell);
|
||
|
|
||
|
group.form = MyReport::Vertical;
|
||
|
cell.Flag = QLatin1String("Nuclide");
|
||
|
cell.Data.clear();
|
||
|
cell.Data<<middleData.peaks_Nuclide_name;
|
||
|
group.data.append(cell);
|
||
|
|
||
|
reportTable.data.append(group);
|
||
|
|
||
|
group.data.clear();
|
||
|
group.header = QLatin1String("PROCESSING PARAMETERS");
|
||
|
group.form = MyReport::Horizontal;
|
||
|
cell.Flag = QLatin1String("ECutAnalysis_Low");
|
||
|
cell.Data.clear();
|
||
|
cell.Data<<QString::number(middleData.setting_specSetup.ECutAnalysis_Low);;
|
||
|
group.data.append(cell);
|
||
|
|
||
|
cell.Flag = QLatin1String("ECutAnalysis_High");
|
||
|
cell.Data.clear();
|
||
|
cell.Data<<QString::number(middleData.setting_specSetup.ECutAnalysis_High);
|
||
|
group.data.append(cell);
|
||
|
cell.Flag = QLatin1String("EnergyTolerance");
|
||
|
cell.Data.clear();
|
||
|
cell.Data<<QString::number(middleData.setting_specSetup.EnergyTolerance);
|
||
|
group.data.append(cell);
|
||
|
cell.Flag = QLatin1String("BaseImprovePSS");
|
||
|
cell.Data.clear();
|
||
|
cell.Data<<QString::number(middleData.setting_specSetup.BaseImprovePSS);
|
||
|
group.data.append(cell);
|
||
|
cell.Flag = QLatin1String("PSS_low");
|
||
|
cell.Data.clear();
|
||
|
cell.Data<<QString::number(middleData.setting_specSetup.PSS_low);
|
||
|
group.data.append(cell);
|
||
|
cell.Flag = QLatin1String("k_back");
|
||
|
cell.Data.clear();
|
||
|
cell.Data<<QString::number(middleData.setting_specSetup.k_back);
|
||
|
group.data.append(cell);
|
||
|
cell.Flag = QLatin1String("k_alpha");
|
||
|
cell.Data.clear();
|
||
|
cell.Data<<QString::number(middleData.setting_specSetup.k_alpha);
|
||
|
group.data.append(cell);
|
||
|
cell.Flag = QLatin1String("k_beta");
|
||
|
cell.Data.clear();
|
||
|
cell.Data<<QString::number(middleData.setting_specSetup.k_beta);
|
||
|
group.data.append(cell);
|
||
|
cell.Flag = QLatin1String("RiskLevelK");
|
||
|
cell.Data.clear();
|
||
|
cell.Data<<QString::number(middleData.setting_specSetup.RiskLevelK);
|
||
|
group.data.append(cell);
|
||
|
cell.Flag = QLatin1String("refTime_act");
|
||
|
cell.Data.clear();
|
||
|
cell.Data<<DateTimeSpaceStandard(middleData.setting_specSetup.refTime_act);
|
||
|
group.data.append(cell);
|
||
|
cell.Flag = QLatin1String("refTime_conc");
|
||
|
cell.Data.clear();
|
||
|
cell.Data<<DateTimeSpaceStandard(middleData.setting_specSetup.refTime_conc);
|
||
|
group.data.append(cell);
|
||
|
reportTable.data.append(group);
|
||
|
|
||
|
group.data.clear();
|
||
|
group.header = QLatin1String("CALIBRATION PARAMETERS");
|
||
|
cell.Flag = QLatin1String("CalibrationPSS_low");
|
||
|
cell.Data.clear();
|
||
|
cell.Data<<QString::number(middleData.setting_specSetup.CalibrationPSS_low);;
|
||
|
group.data.append(cell);
|
||
|
|
||
|
cell.Flag = QLatin1String("CalibrationPSS_high");
|
||
|
cell.Data.clear();
|
||
|
cell.Data<<QString::number(middleData.setting_specSetup.CalibrationPSS_high);
|
||
|
group.data.append(cell);
|
||
|
cell.Flag = QLatin1String("bUpdateCal");
|
||
|
cell.Data.clear();
|
||
|
cell.Data<<QString::number(middleData.setting_specSetup.bUpdateCal);
|
||
|
group.data.append(cell);
|
||
|
cell.Flag = QLatin1String("KeepCalPeakSearchPeaks");
|
||
|
cell.Data.clear();
|
||
|
cell.Data<<QString::number(middleData.setting_specSetup.KeepCalPeakSearchPeaks);
|
||
|
group.data.append(cell);
|
||
|
reportTable.data.append(group);
|
||
|
|
||
|
if(middleData.calibration_pairs_E_idCalPoint.size()>0)
|
||
|
{
|
||
|
group.data.clear();
|
||
|
group.header = QLatin1String("Calibration");
|
||
|
cell.Flag = QString("Energy Calibration [%1 ]").arg(middleData.calibration_pairs_E_Input);
|
||
|
cell.Data.clear();
|
||
|
cell.Data<<QString("");
|
||
|
group.data.append(cell);
|
||
|
|
||
|
cell.Flag = QLatin1String("Function");
|
||
|
cell.Data.clear();
|
||
|
cell.Data<<middleData.calibration_E_functionTypeDef;
|
||
|
group.data.append(cell);
|
||
|
cell.Flag = QLatin1String("E");
|
||
|
// cell.Data.clear();
|
||
|
// cell.Data<<middleData.calibration_E_functionDef;
|
||
|
// group.data.append(cell);
|
||
|
GetReportFixedWidth(cell,group,COLUMN_WIDTH,middleData.calibration_E_functionDef);
|
||
|
|
||
|
cell.Flag = QLatin1String("P");
|
||
|
// cell.Data.clear();
|
||
|
// cell.Data<<middleData.calibration_E_coeff_string;
|
||
|
// group.data.append(cell);
|
||
|
GetReportFixedWidth(cell,group,COLUMN_WIDTH,middleData.calibration_E_coeff_string);
|
||
|
|
||
|
cell.Flag = QLatin1String("Err");
|
||
|
cell.Data.clear();
|
||
|
cell.Data<<middleData.calibration_E_uncoeff_string;
|
||
|
group.data.append(cell);
|
||
|
cell.Flag = QLatin1String("Data");
|
||
|
cell.Data.clear();
|
||
|
cell.Data<<middleData.calibration_pairs_E_Input;
|
||
|
group.data.append(cell);
|
||
|
reportTable.data.append(group);
|
||
|
|
||
|
}
|
||
|
if(middleData.calibration_pairs_R_idCalPoint.size()>0)
|
||
|
{
|
||
|
group.data.clear();
|
||
|
group.header = QLatin1String("");
|
||
|
cell.Flag = QString("Resolution Calibration [%1 ]").arg(middleData.calibration_pairs_R_Input);
|
||
|
cell.Data.clear();
|
||
|
cell.Data<<QString("");
|
||
|
group.data.append(cell);
|
||
|
|
||
|
cell.Flag = QLatin1String("Function");
|
||
|
cell.Data.clear();
|
||
|
cell.Data<<middleData.calibration_R_functionTypeDef;
|
||
|
group.data.append(cell);
|
||
|
cell.Flag = QLatin1String("E");
|
||
|
// cell.Data.clear();
|
||
|
// cell.Data<<middleData.calibration_R_functionDef;
|
||
|
// group.data.append(cell);
|
||
|
GetReportFixedWidth(cell,group,COLUMN_WIDTH,middleData.calibration_R_functionDef);
|
||
|
cell.Flag = QLatin1String("P");
|
||
|
// cell.Data.clear();
|
||
|
// cell.Data<<middleData.calibration_R_coeff_string;
|
||
|
// group.data.append(cell);
|
||
|
GetReportFixedWidth(cell,group,COLUMN_WIDTH,middleData.calibration_R_coeff_string);
|
||
|
|
||
|
cell.Flag = QLatin1String("Err");
|
||
|
cell.Data.clear();
|
||
|
cell.Data<<middleData.calibration_R_uncoeff_string;
|
||
|
group.data.append(cell);
|
||
|
cell.Flag = QLatin1String("Data");
|
||
|
cell.Data.clear();
|
||
|
cell.Data<<middleData.calibration_pairs_R_Input;
|
||
|
group.data.append(cell);
|
||
|
reportTable.data.append(group);
|
||
|
}
|
||
|
if(middleData.calibration_pairs_EF_idCalPoint.size()>0)
|
||
|
{
|
||
|
group.data.clear();
|
||
|
group.header = QLatin1String("");
|
||
|
cell.Flag = QString("Efficiency Calibration [%1 ]").arg(middleData.calibration_pairs_EF_Input);
|
||
|
cell.Data.clear();
|
||
|
cell.Data<<QString("");
|
||
|
group.data.append(cell);
|
||
|
|
||
|
cell.Flag = QLatin1String("Function");
|
||
|
cell.Data.clear();
|
||
|
cell.Data<<middleData.calibration_EF_functionTypeDef;
|
||
|
group.data.append(cell);
|
||
|
cell.Flag = QLatin1String("E");
|
||
|
// cell.Data.clear();
|
||
|
// cell.Data<<middleData.calibration_EF_functionDef;
|
||
|
// group.data.append(cell);
|
||
|
GetReportFixedWidth(cell,group,COLUMN_WIDTH,middleData.calibration_EF_functionDef);
|
||
|
cell.Flag = QLatin1String("P");
|
||
|
// cell.Data.clear();
|
||
|
// cell.Data<<middleData.calibration_EF_coeff_string;
|
||
|
// group.data.append(cell);
|
||
|
GetReportFixedWidth(cell,group,COLUMN_WIDTH,middleData.calibration_EF_coeff_string);
|
||
|
cell.Flag = QLatin1String("Err");
|
||
|
cell.Data.clear();
|
||
|
cell.Data<<middleData.calibration_EF_uncoeff_string;
|
||
|
group.data.append(cell);
|
||
|
cell.Flag = QLatin1String("Data");
|
||
|
cell.Data.clear();
|
||
|
cell.Data<<middleData.calibration_pairs_EF_Input;
|
||
|
group.data.append(cell);
|
||
|
reportTable.data.append(group);
|
||
|
}
|
||
|
|
||
|
if(middleData.calibration_pairs_T_idCalPoint.size()>0)
|
||
|
{
|
||
|
group.data.clear();
|
||
|
group.header = QLatin1String("");
|
||
|
cell.Flag = QString("Tot_efficiency Calibration [%1 ]").arg(middleData.calibration_pairs_T_Input);
|
||
|
cell.Data.clear();
|
||
|
cell.Data<<QString("");
|
||
|
group.data.append(cell);
|
||
|
|
||
|
cell.Flag = QLatin1String("Function");
|
||
|
cell.Data.clear();
|
||
|
cell.Data<<middleData.calibration_T_functionTypeDef;
|
||
|
group.data.append(cell);
|
||
|
cell.Flag = QLatin1String("E");
|
||
|
// cell.Data.clear();
|
||
|
// cell.Data<<middleData.calibration_T_functionDef;
|
||
|
// group.data.append(cell);
|
||
|
GetReportFixedWidth(cell,group,COLUMN_WIDTH,middleData.calibration_T_functionDef);
|
||
|
cell.Flag = QLatin1String("P");
|
||
|
//cell.Data.clear();
|
||
|
// cell.Data<<middleData.calibration_T_coeff_string;
|
||
|
// group.data.append(cell);
|
||
|
GetReportFixedWidth(cell,group,COLUMN_WIDTH,middleData.calibration_T_coeff_string);
|
||
|
cell.Flag = QLatin1String("Err");
|
||
|
cell.Data.clear();
|
||
|
cell.Data<<middleData.calibration_T_uncoeff_string;
|
||
|
group.data.append(cell);
|
||
|
cell.Flag = QLatin1String("Data");
|
||
|
cell.Data.clear();
|
||
|
cell.Data<<middleData.calibration_pairs_T_Input;
|
||
|
group.data.append(cell);
|
||
|
reportTable.data.append(group);
|
||
|
}
|
||
|
|
||
|
group.data.clear();
|
||
|
group.header = QLatin1String("DATA QUALITY FLAGS");
|
||
|
group.form = MyReport::Vertical;
|
||
|
cell.Flag = QLatin1String("Name");
|
||
|
cell.Data.clear();
|
||
|
cell.Data<<middleData.QC_CHECK_QC_NAME;
|
||
|
group.data.append(cell);
|
||
|
|
||
|
group.form = MyReport::Vertical;
|
||
|
cell.Flag = QLatin1String("Pass/Fail");
|
||
|
cell.Data.clear();
|
||
|
cell.Data<<GetPass(middleData.QC_CHECK_QC_RESULT);
|
||
|
group.data.append(cell);
|
||
|
|
||
|
group.form = MyReport::Vertical;
|
||
|
cell.Flag = QLatin1String("Value");
|
||
|
cell.Data.clear();
|
||
|
cell.Data<<GetThreePoint(middleData.QC_CHECK_QC_VALUE);
|
||
|
group.data.append(cell);
|
||
|
|
||
|
group.form = MyReport::Vertical;
|
||
|
cell.Flag = QLatin1String("Test");
|
||
|
cell.Data.clear();
|
||
|
cell.Data<<middleData.QC_CHECK_QC_STANDARD;
|
||
|
group.data.append(cell);
|
||
|
reportTable.data.append(group);
|
||
|
|
||
|
inputPara.text = reportTable;
|
||
|
|
||
|
return inputPara;
|
||
|
}
|
||
|
|
||
|
bool GammaAnalyDataInterface::WriteReport(structGStoreMiddleProcessData& middleData, ReportType _report_type, QString rpt_path)
|
||
|
{
|
||
|
bool bRet = true;
|
||
|
ReportOutput* report_creat=0;
|
||
|
switch (_report_type) {
|
||
|
case Report_text:
|
||
|
//report_creat = ReportFactory::creatText();
|
||
|
break;
|
||
|
case Report_exel:
|
||
|
//report_creat = ReportFactory::creatExecl();
|
||
|
break;
|
||
|
case Report_html:
|
||
|
//report_creat = ReportFactory::creatHtml();
|
||
|
break;
|
||
|
default:
|
||
|
return false;
|
||
|
break;
|
||
|
}
|
||
|
|
||
|
MyReport::REPORTINPUTPARA inputPara = GetReportData(middleData);
|
||
|
if(rpt_path.isEmpty()) inputPara.filePath=m_SavefilePath+QDir::separator()+middleData.analyses_ReportPath;
|
||
|
else inputPara.filePath = rpt_path;
|
||
|
MkDir(inputPara.filePath);
|
||
|
|
||
|
if(report_creat)
|
||
|
{
|
||
|
report_creat->SetReportText(inputPara);
|
||
|
report_creat->deleteLater();
|
||
|
report_creat=0;
|
||
|
}
|
||
|
return bRet;
|
||
|
}
|
||
|
|
||
|
void GammaAnalyDataInterface::MkDir(QString fileName)
|
||
|
{
|
||
|
QDir dirPath(fileName);
|
||
|
if(!dirPath.exists())
|
||
|
{
|
||
|
QFileInfo info(fileName);
|
||
|
dirPath.mkpath(info.absolutePath());
|
||
|
}
|
||
|
}
|
||
|
|
||
|
bool GammaAnalyDataInterface::GetMiddleData(PHDFile& fileAnlyse,QMap<QString, NuclideLines> &nucline,structGStoreMiddleProcessData& middleData,enum_middleDataType type)
|
||
|
{
|
||
|
|
||
|
m_info.clear();
|
||
|
bool bRet=true;
|
||
|
|
||
|
//标准名称规范化
|
||
|
SetDataFile(fileAnlyse.filepath);
|
||
|
QString dataType = fileAnlyse.msgInfo.data_type;
|
||
|
QStringList subDirSavePath;
|
||
|
subDirSavePath << GetSysTemSubdir(fileAnlyse.header.system_type);
|
||
|
subDirSavePath << GetDateTypeSubdir(dataType);
|
||
|
SetSaveSubdir(subDirSavePath);
|
||
|
NameStandard(fileAnlyse);
|
||
|
SetFileDir();
|
||
|
middleData.analyses_analyst=GetAnlyseName();
|
||
|
QString qsSaveFile = m_saveFileName;
|
||
|
QString qsLogPath=PathStandard(GetLogFilePath()+QDir::separator()+middleData.analyses_analyst+QLatin1String("_")+GetLogFileName());
|
||
|
QString qsReportPath=PathStandard(ARR_REPORT_PATH+QDir::separator()+GetReportFilePath()+QDir::separator()+middleData.analyses_analyst+QLatin1String("_")+GetReportFileName());
|
||
|
|
||
|
middleData.analyses_save_filePath = qsSaveFile;
|
||
|
middleData.analyses_LogPath = qsLogPath;
|
||
|
middleData.analyses_ReportPath = qsReportPath;
|
||
|
|
||
|
|
||
|
//获取算法数据
|
||
|
if(type == Auto)
|
||
|
{
|
||
|
QString anylseBegin;
|
||
|
QString anylseEnd;
|
||
|
anylseBegin =DateTimeStandard(QDateTime::currentDateTime());
|
||
|
// AlgFunc::LoadSpectrum(&fileAnlyse);
|
||
|
GammaAnalyALG alg;
|
||
|
try
|
||
|
{
|
||
|
bRet = alg.AnalyseSpectrum(&fileAnlyse,nucline);
|
||
|
}
|
||
|
catch(...)
|
||
|
{
|
||
|
m_info = QLatin1String("arithmetic exception");
|
||
|
middleData.ErrorInfo = m_info;
|
||
|
return false;
|
||
|
}
|
||
|
|
||
|
if(!bRet)
|
||
|
{
|
||
|
m_info=QLatin1String("arithmetic error");
|
||
|
middleData.ErrorInfo = m_info;
|
||
|
// return bRet;
|
||
|
}
|
||
|
anylseEnd =DateTimeStandard(QDateTime::currentDateTime());
|
||
|
middleData.analyses_analysisBegin = anylseBegin;
|
||
|
middleData.analyses_analysisEnd = anylseEnd;
|
||
|
}
|
||
|
|
||
|
|
||
|
//gards_analyses
|
||
|
QString qsBaseLinePath = PathStandard(GetBaseFilePath()+QDir::separator()+middleData.analyses_analyst+QLatin1String("_")+GetBaseFileName());
|
||
|
// m_baseLineFileName;
|
||
|
QString qsLcPath=PathStandard(GetLCFilePath()+QDir::separator()+middleData.analyses_analyst+QLatin1String("_")+GetLCFileName());
|
||
|
QString qsScacPath=PathStandard(GetScacFilePath()+QDir::separator()+middleData.analyses_analyst+QLatin1String("_")+GetScacFileName());
|
||
|
|
||
|
//Add By XYL 20170718
|
||
|
QString szFilePath = m_SavefilePath+QDir::separator()+PathStandard(GetBaseFilePath());
|
||
|
QDir BaseFilePath(szFilePath);
|
||
|
if(!BaseFilePath.exists())
|
||
|
{
|
||
|
BaseFilePath.mkpath(szFilePath);
|
||
|
}
|
||
|
|
||
|
szFilePath = m_SavefilePath+QDir::separator()+PathStandard(GetLCFilePath());
|
||
|
QDir LCFilePath(szFilePath);
|
||
|
if(!LCFilePath.exists())
|
||
|
{
|
||
|
LCFilePath.mkpath(szFilePath);
|
||
|
}
|
||
|
|
||
|
szFilePath = m_SavefilePath+QDir::separator()+PathStandard(GetScacFilePath());
|
||
|
QDir ScacFilePath(szFilePath);
|
||
|
if(!ScacFilePath.exists())
|
||
|
{
|
||
|
ScacFilePath.mkpath(szFilePath);
|
||
|
}
|
||
|
//Add By XYL 20170718
|
||
|
|
||
|
QString qsSaveBaseLine = m_SavefilePath+QDir::separator()+qsBaseLinePath;
|
||
|
QString qsSaveLc = m_SavefilePath+QDir::separator()+qsLcPath;
|
||
|
QString qsSaveScac = m_SavefilePath+QDir::separator()+qsScacPath;
|
||
|
|
||
|
AlgFunc::WriteBaseInfo(fileAnlyse.baseCtrls,qsSaveBaseLine);
|
||
|
AlgFunc::WriteLcScac(fileAnlyse.vLc,WRITE_LC,qsSaveLc);
|
||
|
AlgFunc::WriteLcScac(fileAnlyse.vScac,WRITE_SCAC,qsSaveScac);
|
||
|
|
||
|
|
||
|
double totalNumber = 0.0;
|
||
|
for(int m=0;m<fileAnlyse.Spec.counts.size();m++)
|
||
|
{
|
||
|
totalNumber+=fileAnlyse.Spec.counts.at(m);
|
||
|
}
|
||
|
middleData.analyses_type=OPERATOR_AUTO;
|
||
|
middleData.analyses_software = GetAppName();
|
||
|
middleData.analyses_swVersion = GetAppVersion();
|
||
|
middleData.analyses_category = 1;
|
||
|
middleData.analyses_comments = "autoprocess";
|
||
|
middleData.analyses_searchStartChannel = fileAnlyse.baseCtrls.rg_low;
|
||
|
middleData.analyses_searchEndChannel = fileAnlyse.baseCtrls.rg_high;
|
||
|
middleData.analyses_searchThreshold = fileAnlyse.usedSetting.EnergyTolerance;
|
||
|
middleData.analyses_numberOfPeaks = fileAnlyse.vPeak.size();
|
||
|
middleData.analyses_totalCounts = totalNumber;
|
||
|
middleData.analyses_baseline_filePath = qsBaseLinePath;
|
||
|
middleData.analyses_lc_filePath = qsLcPath;
|
||
|
middleData.analyses_scac_filePath = qsScacPath;
|
||
|
|
||
|
middleData.analyses_baseline_absolute_filePath =qsSaveLc;
|
||
|
middleData.analyses_lc_absolute_filePath=qsSaveLc;
|
||
|
middleData.analyses_scac_absolute_filePath=qsSaveScac;
|
||
|
middleData.analyses_save_absolute_filePath=m_SavefilePath+QDir::separator()+qsSaveFile;
|
||
|
middleData.analyses_absolute_LogPath=m_logFilePath+QDir::separator()+qsLogPath;
|
||
|
middleData.analyses_absolute_ReportPath=m_SavefilePath+QDir::separator()+qsReportPath;
|
||
|
|
||
|
|
||
|
QVector<QString> temp;
|
||
|
if(fileAnlyse.usedEnerKD.g_energy.size() != 0)
|
||
|
{
|
||
|
middleData.calibration_pairs_E_Caltype = ENERGY_CAL;
|
||
|
middleData.calibration_pairs_E_Input = fileAnlyse.usedEner;
|
||
|
|
||
|
middleData.calibration_pairs_S_E_Caltype = ENERGY_CAL;
|
||
|
middleData.calibration_pairs_S_E_Input = fileAnlyse.usedEner;
|
||
|
|
||
|
for(int pos=0;pos<fileAnlyse.usedEnerKD.g_energy.size();pos++)
|
||
|
{
|
||
|
temp.append(QString::number(pos));
|
||
|
}
|
||
|
middleData.calibration_pairs_E_idCalPoint =DoubleLimit(temp);
|
||
|
middleData.calibration_pairs_E_xValue =DoubleLimit(fileAnlyse.usedEnerKD.centroid_channel);
|
||
|
middleData.calibration_pairs_E_yValue =DoubleLimit(fileAnlyse.usedEnerKD.g_energy);
|
||
|
middleData.calibration_pairs_E_uncYValue =DoubleLimit(fileAnlyse.usedEnerKD.uncertainty);
|
||
|
|
||
|
if(fileAnlyse.mapEnerKD.contains(CalPHD))
|
||
|
{
|
||
|
middleData.calibration_pairs_S_E_idCalPoint =DoubleLimit(temp);
|
||
|
middleData.calibration_pairs_S_E_xValue =DoubleLimit(fileAnlyse.mapEnerKD[CalPHD].centroid_channel);
|
||
|
middleData.calibration_pairs_S_E_yValue =DoubleLimit(fileAnlyse.mapEnerKD[CalPHD].g_energy);
|
||
|
middleData.calibration_pairs_S_E_uncYValue =DoubleLimit(fileAnlyse.mapEnerKD[CalPHD].uncertainty);
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
|
||
|
//gards_ calibration_pairs Efficiency
|
||
|
middleData.calibration_pairs_sample_type = fileAnlyse.header.system_type;
|
||
|
if(fileAnlyse.usedEffiKD.g_energy.size() != 0)
|
||
|
{
|
||
|
middleData.calibration_pairs_EF_Caltype = EFFICIENCY_CAL;
|
||
|
middleData.calibration_pairs_EF_Input = fileAnlyse.usedEffi;
|
||
|
middleData.calibration_pairs_S_EF_Caltype = EFFICIENCY_CAL;
|
||
|
middleData.calibration_pairs_S_EF_Input = fileAnlyse.usedEffi;
|
||
|
temp.clear();
|
||
|
for(int pos=0;pos<fileAnlyse.usedEffiKD.g_energy.size();pos++)
|
||
|
{
|
||
|
temp.append(QString::number(pos));
|
||
|
}
|
||
|
middleData.calibration_pairs_EF_idCalPoint =DoubleLimit(temp);
|
||
|
middleData.calibration_pairs_EF_xValue =DoubleLimit(fileAnlyse.usedEffiKD.g_energy);
|
||
|
middleData.calibration_pairs_EF_yValue =DoubleLimit(fileAnlyse.usedEffiKD.efficiency);
|
||
|
middleData.calibration_pairs_EF_uncYValue=DoubleLimit(fileAnlyse.usedEffiKD.uncertainty);
|
||
|
|
||
|
if(fileAnlyse.mapEffiKD.contains(CalPHD))
|
||
|
{
|
||
|
middleData.calibration_pairs_S_EF_idCalPoint =DoubleLimit(temp);
|
||
|
middleData.calibration_pairs_S_EF_xValue =DoubleLimit(fileAnlyse.mapEffiKD[CalPHD].g_energy);
|
||
|
middleData.calibration_pairs_S_EF_yValue =DoubleLimit(fileAnlyse.mapEffiKD[CalPHD].efficiency);
|
||
|
middleData.calibration_pairs_S_EF_uncYValue=DoubleLimit(fileAnlyse.mapEffiKD[CalPHD].uncertainty);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
//gards_ calibration_pairs Resolution
|
||
|
|
||
|
if(fileAnlyse.usedResoKD.FWHM.size() != 0)
|
||
|
{
|
||
|
middleData.calibration_pairs_R_Caltype = RESOLUTION_CAL;
|
||
|
middleData.calibration_pairs_R_Input = fileAnlyse.usedReso;
|
||
|
|
||
|
middleData.calibration_pairs_S_R_Caltype = RESOLUTION_CAL;
|
||
|
middleData.calibration_pairs_S_R_Input = fileAnlyse.usedReso;
|
||
|
|
||
|
temp.clear();
|
||
|
for(int pos=0;pos<fileAnlyse.usedResoKD.FWHM.size();pos++)
|
||
|
{
|
||
|
temp.append(QString::number(pos));
|
||
|
}
|
||
|
middleData.calibration_pairs_R_idCalPoint =DoubleLimit(temp);
|
||
|
middleData.calibration_pairs_R_xValue =DoubleLimit(fileAnlyse.usedResoKD.g_energy);
|
||
|
middleData.calibration_pairs_R_yValue =DoubleLimit(fileAnlyse.usedResoKD.FWHM);
|
||
|
middleData.calibration_pairs_R_uncYValue =DoubleLimit(fileAnlyse.usedResoKD.uncertainty);
|
||
|
|
||
|
if(fileAnlyse.mapResoKD.contains(CalPHD))
|
||
|
{
|
||
|
middleData.calibration_pairs_S_R_idCalPoint =DoubleLimit(temp);
|
||
|
middleData.calibration_pairs_S_R_xValue =DoubleLimit(fileAnlyse.mapResoKD[CalPHD].g_energy);
|
||
|
middleData.calibration_pairs_S_R_yValue =DoubleLimit(fileAnlyse.mapResoKD[CalPHD].FWHM);
|
||
|
middleData.calibration_pairs_S_R_uncYValue =DoubleLimit(fileAnlyse.mapResoKD[CalPHD].uncertainty);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
//gards_ calibration_pairs TotalEfficiency
|
||
|
if(fileAnlyse.usedTotEKD.g_energy.size() != 0)
|
||
|
{
|
||
|
middleData.calibration_pairs_T_Caltype = TOTALEFFICIENCY_CAL;
|
||
|
middleData.calibration_pairs_T_Input = fileAnlyse.usedTotE;
|
||
|
|
||
|
middleData.calibration_pairs_S_T_Caltype = TOTALEFFICIENCY_CAL;
|
||
|
middleData.calibration_pairs_S_T_Input = fileAnlyse.usedTotE;
|
||
|
temp.clear();
|
||
|
for(int pos=0;pos<fileAnlyse.usedTotEKD.g_energy.size();pos++)
|
||
|
{
|
||
|
temp.append(QString::number(pos));
|
||
|
}
|
||
|
|
||
|
middleData.calibration_pairs_T_idCalPoint =DoubleLimit(temp);
|
||
|
middleData.calibration_pairs_T_xValue =DoubleLimit(fileAnlyse.usedTotEKD.g_energy);
|
||
|
middleData.calibration_pairs_T_yValue =DoubleLimit(fileAnlyse.usedTotEKD.total_efficiency);
|
||
|
middleData.calibration_pairs_T_uncYValue =DoubleLimit(fileAnlyse.usedTotEKD.uncertainty);
|
||
|
if(fileAnlyse.mapTotEKD.contains(CalPHD))
|
||
|
{
|
||
|
middleData.calibration_pairs_S_T_idCalPoint =DoubleLimit(temp);
|
||
|
middleData.calibration_pairs_S_T_xValue =DoubleLimit(fileAnlyse.mapTotEKD[CalPHD].g_energy);
|
||
|
middleData.calibration_pairs_S_T_yValue =DoubleLimit(fileAnlyse.mapTotEKD[CalPHD].total_efficiency);
|
||
|
middleData.calibration_pairs_S_T_uncYValue =DoubleLimit(fileAnlyse.mapTotEKD[CalPHD].uncertainty);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// gards_ calibration 数据表
|
||
|
//拼写刻度字符串
|
||
|
//获取刻度描述字符串
|
||
|
middleData.calibration_sample_type = fileAnlyse.header.system_type;
|
||
|
QString coeff;
|
||
|
QString uncer;
|
||
|
QString funcDef;
|
||
|
QString funcTypeDef;
|
||
|
int funcType=0;
|
||
|
int coeffNumber=0;
|
||
|
int uncerNumber=0;
|
||
|
coeffNumber = fileAnlyse.usedEnerPara.p.size();
|
||
|
if(coeffNumber>0)
|
||
|
{
|
||
|
funcType = fileAnlyse.usedEnerPara.p.at(0);
|
||
|
}
|
||
|
for(int m=1;m<coeffNumber-1;m++)
|
||
|
{
|
||
|
coeff += QString::number(fileAnlyse.usedEnerPara.p.at(m),'e')+',';
|
||
|
}
|
||
|
if(coeffNumber>0)
|
||
|
{
|
||
|
coeff+=QString::number(fileAnlyse.usedEnerPara.p.at(coeffNumber-1),'e');
|
||
|
}
|
||
|
|
||
|
uncerNumber = fileAnlyse.usedEnerPara.perr.size();
|
||
|
for(int m=0;m<uncerNumber-1;m++)
|
||
|
{
|
||
|
uncer += QString::number(fileAnlyse.usedEnerPara.perr.at(m),'e')+',';
|
||
|
}
|
||
|
if(uncerNumber>0)
|
||
|
{
|
||
|
uncer+=QString::number(fileAnlyse.usedEnerPara.perr.at(uncerNumber-1),'e');
|
||
|
}
|
||
|
funcDef = AlgFunc::EquationDescription(funcType);
|
||
|
funcTypeDef = AlgFunc::EquationName(funcType);
|
||
|
middleData.calibration_E_Caltype = ENERGY_CAL;
|
||
|
middleData.calibration_E_function = funcType;
|
||
|
middleData.calibration_E_functionDef = funcDef;
|
||
|
middleData.calibration_E_functionTypeDef = funcTypeDef;
|
||
|
middleData.calibration_E_startOfRange = 0;
|
||
|
middleData.calibration_E_endOfRange = 1;
|
||
|
middleData.calibration_E_coeff_string = coeff;
|
||
|
|
||
|
|
||
|
coeff.clear();
|
||
|
uncer.clear();
|
||
|
coeffNumber = fileAnlyse.usedEffiPara.p.size();
|
||
|
if(coeffNumber>0)
|
||
|
{
|
||
|
funcType = fileAnlyse.usedEffiPara.p.at(0);
|
||
|
}
|
||
|
for(int m=1;m<coeffNumber-1;m++)
|
||
|
{
|
||
|
coeff += QString::number(fileAnlyse.usedEffiPara.p.at(m),'e')+',';
|
||
|
}
|
||
|
if(coeffNumber>0)
|
||
|
{
|
||
|
coeff+=QString::number(fileAnlyse.usedEffiPara.p.at(coeffNumber-1),'e');
|
||
|
}
|
||
|
|
||
|
uncerNumber = fileAnlyse.usedEffiPara.perr.size();
|
||
|
for(int m=0;m<uncerNumber-1;m++)
|
||
|
{
|
||
|
uncer += QString::number(fileAnlyse.usedEffiPara.perr.at(m),'e')+',';
|
||
|
}
|
||
|
if(uncerNumber>0)
|
||
|
{
|
||
|
uncer+=QString::number(fileAnlyse.usedEffiPara.perr.at(uncerNumber-1),'e');
|
||
|
}
|
||
|
funcDef = AlgFunc::EquationDescription(funcType);
|
||
|
funcTypeDef = AlgFunc::EquationName(funcType);
|
||
|
middleData.calibration_EF_Caltype = EFFICIENCY_CAL;
|
||
|
middleData.calibration_EF_function = funcType;
|
||
|
middleData.calibration_EF_functionDef = funcDef;
|
||
|
middleData.calibration_EF_functionTypeDef = funcTypeDef;
|
||
|
middleData.calibration_EF_startOfRange = 0;
|
||
|
middleData.calibration_EF_endOfRange = 1;
|
||
|
middleData.calibration_EF_coeff_string = coeff;
|
||
|
|
||
|
coeff.clear();
|
||
|
uncer.clear();
|
||
|
coeffNumber = fileAnlyse.usedResoPara.p.size();
|
||
|
if(coeffNumber>0)
|
||
|
{
|
||
|
funcType = fileAnlyse.usedResoPara.p.at(0);
|
||
|
}
|
||
|
for(int m=1;m<coeffNumber-1;m++)
|
||
|
{
|
||
|
coeff += QString::number(fileAnlyse.usedResoPara.p.at(m),'e')+',';
|
||
|
}
|
||
|
if(coeffNumber>0)
|
||
|
{
|
||
|
coeff+=QString::number(fileAnlyse.usedResoPara.p.at(coeffNumber-1),'e');
|
||
|
}
|
||
|
|
||
|
uncerNumber = fileAnlyse.usedResoPara.perr.size();
|
||
|
for(int m=0;m<uncerNumber-1;m++)
|
||
|
{
|
||
|
uncer += QString::number(fileAnlyse.usedResoPara.perr.at(m),'e')+',';
|
||
|
}
|
||
|
if(uncerNumber>0)
|
||
|
{
|
||
|
uncer+=QString::number(fileAnlyse.usedResoPara.perr.at(uncerNumber-1),'e');
|
||
|
}
|
||
|
funcDef = AlgFunc::EquationDescription(funcType);
|
||
|
funcTypeDef = AlgFunc::EquationName(funcType);
|
||
|
middleData.calibration_R_Caltype = RESOLUTION_CAL;
|
||
|
middleData.calibration_R_function = funcType;
|
||
|
middleData.calibration_R_functionDef = funcDef;
|
||
|
middleData.calibration_R_functionTypeDef = funcTypeDef;
|
||
|
middleData.calibration_R_startOfRange = 0;
|
||
|
middleData.calibration_R_endOfRange = 1;
|
||
|
middleData.calibration_R_coeff_string = coeff;
|
||
|
|
||
|
coeff.clear();
|
||
|
uncer.clear();
|
||
|
coeffNumber = fileAnlyse.usedTotEPara.p.size();
|
||
|
if(coeffNumber>0)
|
||
|
{
|
||
|
funcType = fileAnlyse.usedTotEPara.p.at(0);
|
||
|
}
|
||
|
for(int m=1;m<coeffNumber-1;m++)
|
||
|
{
|
||
|
coeff += QString::number(fileAnlyse.usedTotEPara.p.at(m),'e')+',';
|
||
|
}
|
||
|
if(coeffNumber>0)
|
||
|
{
|
||
|
coeff+=QString::number(fileAnlyse.usedTotEPara.p.at(coeffNumber-1),'e');
|
||
|
}
|
||
|
|
||
|
uncerNumber = fileAnlyse.usedTotEPara.perr.size();
|
||
|
for(int m=0;m<uncerNumber-1;m++)
|
||
|
{
|
||
|
uncer += QString::number(fileAnlyse.usedTotEPara.perr.at(m),'e')+',';
|
||
|
}
|
||
|
if(uncerNumber>0)
|
||
|
{
|
||
|
uncer+=QString::number(fileAnlyse.usedTotEPara.perr.at(uncerNumber-1),'e');
|
||
|
}
|
||
|
funcDef = AlgFunc::EquationDescription(funcType);
|
||
|
funcTypeDef = AlgFunc::EquationName(funcType);
|
||
|
middleData.calibration_T_Caltype = TOTALEFFICIENCY_CAL;
|
||
|
middleData.calibration_T_function = funcType;
|
||
|
middleData.calibration_T_functionDef = funcDef;
|
||
|
middleData.calibration_T_functionTypeDef = funcTypeDef;
|
||
|
middleData.calibration_T_startOfRange = 0;
|
||
|
middleData.calibration_T_endOfRange = 1;
|
||
|
middleData.calibration_T_coeff_string = coeff;
|
||
|
|
||
|
//gards_ peaks数据表
|
||
|
|
||
|
if(fileAnlyse.vPeak.size() != 0)
|
||
|
{
|
||
|
QVector<double> dvctIDPEAK;
|
||
|
QVector<double> dvctCENTROIDCHANNEL;
|
||
|
QVector<double> dvctUNCCENTROIDCHANNEL;
|
||
|
QVector<double> dvctENERGY;
|
||
|
QVector<double> dvctUNCENERGY;
|
||
|
QVector<double> dvctAREA;
|
||
|
QVector<double> dvctnetCountRate;
|
||
|
QVector<double> dvctuncNetCountRate;
|
||
|
QVector<double> dvctUNCAREA;
|
||
|
QVector<double> dvctEFFICIENCY;
|
||
|
QVector<double> dvctUNCEFFICIENCY;
|
||
|
QVector<double> dvctFWHM;
|
||
|
QVector<double> dvctFWTM;
|
||
|
QVector<double> dvctSIGNIFICANCE;
|
||
|
QVector<double> dvctSENSITIVITY;
|
||
|
QVector<double> dvctMULTIINDEX;
|
||
|
QVector<double> dvctROISTART;
|
||
|
QVector<double> dvctROIEND;
|
||
|
QVector<double> dvctTAIL;
|
||
|
QVector<double> dvctTAILALPHA;
|
||
|
QVector<double> dvctUPPERTAIL;
|
||
|
QVector<double> dvctUPPERTAILALPHA;
|
||
|
QVector<double> dvctBWWIDTHCHAN;
|
||
|
QVector<double> dvctRECOILBETACHAN;
|
||
|
QVector<double> dvctRECOILDELTACHAN;
|
||
|
QVector<double> dvctSTEPRAIO;
|
||
|
QVector<double> dvctBACKGROUNDAREA;
|
||
|
QVector<double> dvctMEANBACKCOUNT;
|
||
|
QVector<double> dvctLC;
|
||
|
QVector<double> dvctLD;
|
||
|
QVector<QString> dvctNuclide_name;
|
||
|
QVector<QString> dvctComments;
|
||
|
for(int m=0;m<fileAnlyse.vPeak.size();m++)
|
||
|
{
|
||
|
dvctIDPEAK.append(m+1);
|
||
|
dvctCENTROIDCHANNEL.append(fileAnlyse.vPeak.at(m).peakCentroid);
|
||
|
// dvctUNCCENTROIDCHANNEL.append(0.0);
|
||
|
dvctENERGY.append(fileAnlyse.vPeak.at(m).energy);
|
||
|
// dvctUNCENERGY.append(0.0);
|
||
|
dvctAREA.append(fileAnlyse.vPeak.at(m).area);
|
||
|
dvctUNCAREA.append(fileAnlyse.vPeak.at(m).areaErr);
|
||
|
dvctnetCountRate.append(fileAnlyse.vPeak.at(m).area/fileAnlyse.acq.acquisition_live_time);
|
||
|
dvctuncNetCountRate.append(fileAnlyse.vPeak.at(m).areaErr);
|
||
|
dvctEFFICIENCY.append(fileAnlyse.vPeak.at(m).efficiency);
|
||
|
// dvctUNCEFFICIENCY.append(0.0);
|
||
|
dvctFWHM.append(fileAnlyse.vPeak.at(m).fwhm);
|
||
|
dvctFWTM.append(fileAnlyse.vPeak.at(m).fwhmc);
|
||
|
dvctSIGNIFICANCE.append(fileAnlyse.vPeak.at(m).significance);
|
||
|
dvctSENSITIVITY.append(fileAnlyse.vPeak.at(m).sensitivity);
|
||
|
dvctMULTIINDEX.append(fileAnlyse.vPeak.at(m).multiIndex);
|
||
|
dvctROISTART.append(fileAnlyse.vPeak.at(m).left);
|
||
|
dvctROIEND.append(fileAnlyse.vPeak.at(m).right);
|
||
|
dvctTAIL.append(fileAnlyse.vPeak.at(m).tail);
|
||
|
dvctTAILALPHA.append(fileAnlyse.vPeak.at(m).tailAlpha);
|
||
|
dvctUPPERTAIL.append(fileAnlyse.vPeak.at(m).upperTail);
|
||
|
dvctUPPERTAILALPHA.append(fileAnlyse.vPeak.at(m).upperTailAlpha);
|
||
|
dvctBWWIDTHCHAN.append(fileAnlyse.vPeak.at(m).BWWidthChan);
|
||
|
dvctRECOILBETACHAN.append(fileAnlyse.vPeak.at(m).recoilBetaChan);
|
||
|
dvctRECOILDELTACHAN.append(fileAnlyse.vPeak.at(m).recoilDeltaChan);
|
||
|
dvctSTEPRAIO.append(fileAnlyse.vPeak.at(m).stepRatio);
|
||
|
dvctBACKGROUNDAREA.append(fileAnlyse.vPeak.at(m).backgroundArea);
|
||
|
dvctMEANBACKCOUNT.append(fileAnlyse.vPeak.at(m).meanBackCount);
|
||
|
dvctLC.append(fileAnlyse.vPeak.at(m).lc);
|
||
|
dvctLD.append(fileAnlyse.vPeak.at(m).ld);
|
||
|
|
||
|
QString t_comment = SqlSpecialCharHandle( fileAnlyse.vPeak.at(m).comments.trimmed() );
|
||
|
if(t_comment.length() > 1024) t_comment = t_comment.left(1024);
|
||
|
dvctComments.append(t_comment);
|
||
|
|
||
|
QString qsName;
|
||
|
for(int n=0;n<fileAnlyse.vPeak.at(m).nuclides.size();n++)
|
||
|
{
|
||
|
qsName = qsName+fileAnlyse.vPeak.at(m).nuclides.at(n)+QString(";");
|
||
|
}
|
||
|
dvctNuclide_name.append(qsName);
|
||
|
|
||
|
}
|
||
|
middleData.peaks_idPeak =DoubleLimit_G(dvctIDPEAK);
|
||
|
middleData.peaks_peakCentroid =DoubleLimit_G(dvctCENTROIDCHANNEL);
|
||
|
middleData.peaks_uncpeakCentroid =DoubleLimit_G(dvctUNCCENTROIDCHANNEL);
|
||
|
middleData.peaks_Energy =DoubleLimit_G(dvctENERGY);
|
||
|
middleData.peaks_uncEnergy =DoubleLimit_G(dvctUNCENERGY);
|
||
|
middleData.peaks_Area =DoubleLimit_G(dvctAREA);
|
||
|
middleData.peaks_areaErr =DoubleLimit_G(dvctUNCAREA);
|
||
|
middleData.peaks_Efficiency =DoubleLimit_G(dvctEFFICIENCY);
|
||
|
middleData.peaks_Uncefficiency =DoubleLimit_G(dvctUNCEFFICIENCY);
|
||
|
middleData.peaks_Fwhm =DoubleLimit_G(dvctFWHM);
|
||
|
middleData.peaks_Fwhmc = DoubleLimit_G(dvctFWTM);
|
||
|
middleData.peaks_Significance =DoubleLimit_G(dvctSIGNIFICANCE);
|
||
|
middleData.peaks_Sensitivity =DoubleLimit_G(dvctSENSITIVITY);
|
||
|
middleData.peaks_multiIndex =DoubleLimit_G(dvctMULTIINDEX);
|
||
|
middleData.peaks_ROIstart =DoubleLimit_G(dvctROISTART);
|
||
|
middleData.peaks_ROIend =DoubleLimit_G(dvctROIEND);
|
||
|
middleData.peaks_tail =DoubleLimit_G(dvctTAIL);
|
||
|
middleData.peaks_tailAlpha =DoubleLimit_G(dvctTAILALPHA);
|
||
|
middleData.peaks_upperTail =DoubleLimit_G(dvctUPPERTAIL);
|
||
|
middleData.peaks_upperTailAlpha =DoubleLimit_G(dvctUPPERTAILALPHA);
|
||
|
middleData.peaks_BWWidthChan =DoubleLimit_G(dvctBWWIDTHCHAN);
|
||
|
middleData.peaks_recoilBetaChan = DoubleLimit_G(dvctRECOILBETACHAN);
|
||
|
middleData.peaks_recoilDeltaChan =DoubleLimit_G(dvctRECOILDELTACHAN);
|
||
|
middleData.peaks_stepRatio =DoubleLimit_G(dvctSTEPRAIO);
|
||
|
middleData.peaks_backgroundArea =DoubleLimit_G(dvctBACKGROUNDAREA);
|
||
|
middleData.peaks_meanBackCount =DoubleLimit_G(dvctMEANBACKCOUNT);
|
||
|
middleData.peaks_Lc =DoubleLimit_G(dvctLC);
|
||
|
middleData.peaks_Ld =DoubleLimit_G(dvctLD);
|
||
|
middleData.peaks_comments = dvctComments;
|
||
|
middleData.peaks_Nuclide_name = dvctNuclide_name;
|
||
|
|
||
|
}
|
||
|
// gards_ nucl_lines_ided数据表
|
||
|
QMap<QString, NuclideActMda>::iterator itor = fileAnlyse.mapNucActMda.begin();
|
||
|
for(;itor!=fileAnlyse.mapNucActMda.end();itor++)
|
||
|
{
|
||
|
structGStoreMiddleProcessDataNuclLinesIded nucl_lines_ided_data;
|
||
|
QVector<QString> svctNUCLIDEFULLNAME;
|
||
|
QVector<double> dvctIDPEAK;
|
||
|
QVector<double> dvctENERGY;
|
||
|
QVector<double> dvctUNCENERGY;
|
||
|
QVector<double> dvctABUNDANCE;
|
||
|
QVector<double> dvctUNCABUNDANCE;
|
||
|
QVector<QString> dvctACTIVITY;
|
||
|
QVector<double> dvctUNCACTIVITY;
|
||
|
QVector<double> dvctEFFIC;
|
||
|
QVector<double> dvctUNEFFIC;
|
||
|
QVector<QString> dvctMDA;
|
||
|
QVector<double> dvctKEY_FLAG;
|
||
|
QVector<double> dvctCSC_RATIO;
|
||
|
QVector<double> dvctCSC_RATIO_ERR;
|
||
|
QVector<double> dvctCSC_MOD_FLAG;
|
||
|
QVector<QString> dvctMDC;
|
||
|
QVector<QString> dvctCONCENTRATION;
|
||
|
|
||
|
int first=itor.value().fullNames.size();
|
||
|
int second=itor.value().vPeakIdx.size();
|
||
|
first = qMin(first,second);
|
||
|
second = itor.value().vEnergy.size();
|
||
|
first = qMin(first,second);
|
||
|
second = itor.value().vUncertE.size();
|
||
|
first = qMin(first,second);
|
||
|
second = itor.value().vYield.size();
|
||
|
first = qMin(first,second);
|
||
|
second = itor.value().vUncertY.size();
|
||
|
first = qMin(first,second);
|
||
|
|
||
|
for(int m=0;m<first;m++)
|
||
|
{
|
||
|
svctNUCLIDEFULLNAME.append( SqlSpecialCharHandle(itor.value().fullNames.at(m)) );
|
||
|
dvctIDPEAK.append(itor.value().vPeakIdx.at(m));
|
||
|
dvctENERGY.append(itor.value().vEnergy.at(m));
|
||
|
dvctUNCENERGY.append(itor.value().vUncertE.at(m));
|
||
|
dvctABUNDANCE.append(itor.value().vYield.at(m));
|
||
|
dvctUNCABUNDANCE.append(itor.value().vUncertY.at(m));
|
||
|
dvctACTIVITY.append(QString::number(itor.value().activity,'e'));
|
||
|
dvctUNCACTIVITY.append(itor.value().act_err);
|
||
|
dvctEFFIC.append(itor.value().efficiency);
|
||
|
dvctUNEFFIC.append(itor.value().effi_err);
|
||
|
dvctMDA.append(QString::number(itor.value().mda,'e'));
|
||
|
// dvctKEY_FLAG.append(itor.value().vYield.at(m));
|
||
|
dvctCSC_RATIO.append(1);
|
||
|
dvctCSC_RATIO_ERR.append(0);
|
||
|
dvctCSC_MOD_FLAG.append(0);
|
||
|
if(itor.value().key_flag == m)
|
||
|
{
|
||
|
dvctKEY_FLAG.append(1);
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
dvctKEY_FLAG.append(0);
|
||
|
}
|
||
|
dvctMDC.append(QString::number(itor.value().mdc,'e'));
|
||
|
dvctCONCENTRATION.append(QString::number(itor.value().concentration,'e'));
|
||
|
}
|
||
|
nucl_lines_ided_data.nuclideFullname = svctNUCLIDEFULLNAME;
|
||
|
nucl_lines_ided_data.idPeak =DoubleLimit_G(dvctIDPEAK);
|
||
|
nucl_lines_ided_data.Energy =DoubleLimit_G(dvctENERGY);
|
||
|
nucl_lines_ided_data.uncEnergy =DoubleLimit_G(dvctUNCENERGY);
|
||
|
nucl_lines_ided_data.Abundance =DoubleLimit_G(dvctABUNDANCE);
|
||
|
nucl_lines_ided_data.uncAbundance =DoubleLimit_G(dvctUNCABUNDANCE);
|
||
|
nucl_lines_ided_data.Activity = dvctACTIVITY;
|
||
|
nucl_lines_ided_data.uncActivity =DoubleLimit_G(dvctUNCACTIVITY);
|
||
|
nucl_lines_ided_data.Effic =DoubleLimit_G(dvctEFFIC);
|
||
|
nucl_lines_ided_data.uncEffic =DoubleLimit_G(dvctUNEFFIC);
|
||
|
nucl_lines_ided_data.Mda = dvctMDA;
|
||
|
nucl_lines_ided_data.key_flag =DoubleLimit_G(dvctKEY_FLAG);
|
||
|
nucl_lines_ided_data.csc_ratio =DoubleLimit_G(dvctCSC_RATIO);
|
||
|
nucl_lines_ided_data.csc_ratio_err =DoubleLimit_G(dvctCSC_RATIO_ERR);
|
||
|
nucl_lines_ided_data.csc_mod_flag =DoubleLimit_G(dvctCSC_MOD_FLAG);
|
||
|
nucl_lines_ided_data.MDC = dvctMDC;
|
||
|
nucl_lines_ided_data.Concentration = dvctCONCENTRATION;
|
||
|
middleData.nucl_lines_ided_data[itor.key()] = nucl_lines_ided_data;
|
||
|
|
||
|
}
|
||
|
// gards_ nucl_ided数据表
|
||
|
QVector<QString> svctNUCLIDEFULLNAME;
|
||
|
QVector<QString> svctTYPE;
|
||
|
QVector<double> dvctHALFLIFE;
|
||
|
QVector<QString> dvctAVE_ACTIV;
|
||
|
QVector<double> dvctAVE_ACTIV_ERR;
|
||
|
QVector<double> dvctACTIV_KEY;
|
||
|
QVector<double> dvctACTIV_KEY_ERR;
|
||
|
QVector<QString> dvctMDA;
|
||
|
QVector<double> dvctMDA_ERR;
|
||
|
QVector<double> dvctNID_FLAG;
|
||
|
QVector<double> dvctCSC_RATIO;
|
||
|
QVector<double> dvctCSC_RATIO_ERR;
|
||
|
QVector<double> dvctCSC_MOD_FLAG;
|
||
|
QVector<QString> dvctMDC;
|
||
|
QVector<QString> dvctCONCENTRATION;
|
||
|
|
||
|
QVector<double> dvctKey_Energy;
|
||
|
QVector<double> dvctKey_Yield;
|
||
|
|
||
|
if( fileAnlyse.mapNucActMda.size() != 0)
|
||
|
{
|
||
|
QMap<QString, NuclideActMda>::iterator itor_v = fileAnlyse.mapNucActMda.begin();
|
||
|
for(;itor_v!=fileAnlyse.mapNucActMda.end();itor_v++)
|
||
|
{
|
||
|
QString nuclideName = itor_v.key();
|
||
|
svctNUCLIDEFULLNAME.append(nuclideName);
|
||
|
|
||
|
dvctHALFLIFE.append(itor_v.value().halflife);
|
||
|
dvctACTIV_KEY.append(itor_v.value().activity);
|
||
|
dvctACTIV_KEY_ERR.append(itor_v.value().act_err);
|
||
|
dvctMDA.append(QString::number(itor_v.value().mda,'e'));
|
||
|
dvctMDC.append(QString::number(itor_v.value().mdc,'e'));
|
||
|
dvctCONCENTRATION.append(QString::number(itor_v.value().concentration,'e'));
|
||
|
// QString stest = QString::number(itor_v.value().concentration,'e');
|
||
|
// double dtest = stest.toDouble();
|
||
|
// dvctTYPE.append(itor.value().vPeakIdx.at(m));
|
||
|
|
||
|
// dvctACTIV_KEY.append(itor.value().vUncertY.at(m));
|
||
|
// dvctACTIV_KEY_ERR.append(itor.value().activity);
|
||
|
|
||
|
// dvctMDA_ERR.append(itor.value().efficiency);
|
||
|
// dvctNID_FLAG.append(itor.value().effi_err);
|
||
|
// dvctKEY_FLAG.append(itor.value().vYield.at(m));
|
||
|
dvctCSC_RATIO.append(1);
|
||
|
dvctCSC_RATIO_ERR.append(0);
|
||
|
if(itor_v.value().calculateIdx<itor_v.value().vEnergy.size())
|
||
|
{
|
||
|
dvctKey_Energy.append(itor_v.value().vEnergy.at(itor_v.value().calculateIdx));
|
||
|
}
|
||
|
|
||
|
if(itor_v.value().calculateIdx<itor_v.value().vYield.size())
|
||
|
{
|
||
|
dvctKey_Yield.append(itor_v.value().vYield.at(itor_v.value().calculateIdx));
|
||
|
}
|
||
|
}
|
||
|
|
||
|
middleData.nucl_ided_Nuclidename = svctNUCLIDEFULLNAME;
|
||
|
middleData.nucl_ided_Type= svctTYPE;
|
||
|
middleData.nucl_ided_Halflife =DoubleLimit_G(dvctHALFLIFE);
|
||
|
middleData.nucl_ided_ave_activ = dvctAVE_ACTIV;
|
||
|
middleData.nucl_ided_ave_activ_err =DoubleLimit_G(dvctAVE_ACTIV_ERR);
|
||
|
middleData.nucl_ided_activ_key =DoubleLimit_G(dvctACTIV_KEY);
|
||
|
middleData.nucl_ided_activ_key_err =DoubleLimit_G(dvctACTIV_KEY_ERR);
|
||
|
middleData.nucl_ided_mda = dvctMDA;
|
||
|
middleData.nucl_ided_mda_err =DoubleLimit_G(dvctMDA_ERR);
|
||
|
middleData.nucl_ided_nid_flag =DoubleLimit_G(dvctNID_FLAG);
|
||
|
middleData.nucl_ided_csc_ratio =DoubleLimit_G(dvctCSC_RATIO);
|
||
|
middleData.nucl_ided_csc_ratio_err =DoubleLimit_G(dvctCSC_RATIO_ERR);
|
||
|
middleData.nucl_ided_csc_mod_flag =DoubleLimit_G(dvctCSC_MOD_FLAG);
|
||
|
middleData.nucl_ided_MDC = dvctMDC;
|
||
|
middleData.nucl_ided_Concentration = dvctCONCENTRATION;
|
||
|
middleData.nucl_ided_Key_Energy = DoubleLimit_G(dvctKey_Energy);
|
||
|
middleData.nucl_ided_Key_Yield = DoubleLimit_G(dvctKey_Yield);
|
||
|
|
||
|
}
|
||
|
// GARDS_QC_CHECK数据表
|
||
|
QVector<QString> qvctQC_NAME;
|
||
|
QVector<double> dvctQC_VALUE;
|
||
|
QVector<QString> qvctQC_STANDARD;
|
||
|
QVector<double> dvctQC_RESULT;
|
||
|
|
||
|
if( fileAnlyse.QcItems.size() != 0)
|
||
|
{
|
||
|
QMap<QString, QcCheckItem>::iterator itor_q = fileAnlyse.QcItems.begin();
|
||
|
for(;itor_q!=fileAnlyse.QcItems.end();itor_q++)
|
||
|
{
|
||
|
QString nuclideName = itor_q.key();
|
||
|
qvctQC_NAME.append(nuclideName);
|
||
|
|
||
|
dvctQC_VALUE.append(itor_q.value().value);
|
||
|
qvctQC_STANDARD.append(itor_q.value().standard);
|
||
|
dvctQC_RESULT.append(itor_q.value().bPass);
|
||
|
|
||
|
}
|
||
|
middleData.QC_CHECK_QC_NAME=qvctQC_NAME;
|
||
|
middleData.QC_CHECK_QC_RESULT=DoubleLimit_G(dvctQC_RESULT);
|
||
|
middleData.QC_CHECK_QC_STANDARD=qvctQC_STANDARD;
|
||
|
middleData.QC_CHECK_QC_VALUE=DoubleLimit_G(dvctQC_VALUE);
|
||
|
}
|
||
|
middleData.ErrorInfo = m_info;
|
||
|
|
||
|
//sample info
|
||
|
middleData.sample_collection_start = DateTimeSpaceStandard(fileAnlyse.collect.collection_start_date+fileAnlyse.collect.collection_start_time);
|
||
|
middleData.sample_collection_stop = DateTimeSpaceStandard(fileAnlyse.collect.collection_stop_date+fileAnlyse.collect.collection_stop_time);
|
||
|
|
||
|
if(fileAnlyse.QcItems.contains(QC_COL_TIME))
|
||
|
{
|
||
|
middleData.sample_time = QString::number(fileAnlyse.QcItems[QC_COL_TIME].value);
|
||
|
if(fileAnlyse.QcItems[QC_COL_TIME].value!=0)
|
||
|
{
|
||
|
middleData.sample_Avg_Flow_Rate = QString::number(fileAnlyse.collect.air_volume/fileAnlyse.QcItems[QC_COL_TIME].value);
|
||
|
}
|
||
|
}
|
||
|
if(fileAnlyse.QcItems.contains(QC_DECAY_TIME))
|
||
|
{
|
||
|
middleData.sample_decay_time = QString::number(fileAnlyse.QcItems[QC_DECAY_TIME].value);
|
||
|
}
|
||
|
if(fileAnlyse.QcItems.contains(QC_ACQ_TIME))
|
||
|
{
|
||
|
middleData.sample_acquistion_time = QString::number(fileAnlyse.QcItems[QC_ACQ_TIME].value);
|
||
|
}
|
||
|
middleData.sample_quantity = QString::number(fileAnlyse.collect.air_volume);
|
||
|
middleData.sample_acquisiton_start = DateTimeSpaceStandard(fileAnlyse.acq.acquisition_start_date+fileAnlyse.acq.acquisition_start_time);
|
||
|
QString acquisition_start = middleData.sample_acquisiton_start;
|
||
|
QDateTime dataTime = StringToDateTimeStandard(acquisition_start);
|
||
|
acquisition_start = DateTimeSpaceStandard(acquisition_start);
|
||
|
dataTime = dataTime.addSecs(fileAnlyse.acq.acquisition_live_time);
|
||
|
middleData.sample_acquistion_stop = DateTimeSpaceStandard(dataTime);
|
||
|
middleData.sample_acquistion_time =QString::number(fileAnlyse.acq.acquisition_real_time) ;
|
||
|
middleData.sample_stationID = fileAnlyse.header.site_code;
|
||
|
middleData.sample_detectID = fileAnlyse.header.detector_code;
|
||
|
middleData.sample_Geometry = fileAnlyse.header.sample_geometry;
|
||
|
middleData.sample_Type = fileAnlyse.header.system_type;
|
||
|
middleData.setting_specSetup = fileAnlyse.usedSetting;
|
||
|
|
||
|
middleData.Collection_Station_Comments = fileAnlyse.oriTotalCmt;
|
||
|
middleData.NDC_Analysis_General_Comments = fileAnlyse.totalCmt;
|
||
|
return bRet;
|
||
|
}
|
||
|
|
||
|
QString GammaAnalyDataInterface::DateTimeSpaceStandard(const QDateTime&_data)
|
||
|
{
|
||
|
return _data.toString(DATATIME_FORMAT_SPACE_SECONDS);
|
||
|
}
|
||
|
QDateTime GammaAnalyDataInterface::StringToDateTimeStandard(const QString&_data)
|
||
|
{
|
||
|
QDateTime dateTime = QDateTime::fromString(_data,DATATIME_FORMAT_NOSPACE);
|
||
|
if(dateTime.isNull())
|
||
|
{
|
||
|
dateTime = QDateTime::fromString(_data,DATATIME_FORMAT_SECONDS);
|
||
|
if(dateTime.isNull())
|
||
|
{
|
||
|
dateTime = QDateTime::fromString(_data,DATATIME_FORMAT_SPACE_SECONDS);
|
||
|
}
|
||
|
}
|
||
|
return dateTime;
|
||
|
}
|
||
|
QString GammaAnalyDataInterface::DateTimeSpaceStandard(const QString&_data)
|
||
|
{
|
||
|
QDateTime dateTime = QDateTime::fromString(_data,DATATIME_FORMAT_NOSPACE);
|
||
|
if(dateTime.isNull())
|
||
|
{
|
||
|
dateTime = QDateTime::fromString(_data,DATATIME_FORMAT_SECONDS);
|
||
|
if(dateTime.isNull())
|
||
|
{
|
||
|
dateTime = QDateTime::fromString(_data,DATATIME_FORMAT_SPACE_SECONDS);
|
||
|
}
|
||
|
}
|
||
|
return dateTime.toString(DATATIME_FORMAT_SPACE_SECONDS);
|
||
|
}
|