修复路径问题
1. 配置文件创建在程序所在目录; 2. csv文件(ximea温度)输出路径改为:/home/programRunLog/hyperspectralLog;
This commit is contained in:
@ -12,6 +12,8 @@
|
||||
|
||||
#include <QFileInfo>
|
||||
#include <QString>
|
||||
#include <QCoreApplication>
|
||||
#include <QDir>
|
||||
|
||||
using namespace std;
|
||||
using namespace libconfig;
|
||||
|
@ -29,6 +29,7 @@
|
||||
#include <QObject>
|
||||
#include <QDateTime>
|
||||
#include <qthread.h>
|
||||
#include <QDir>
|
||||
|
||||
#include "configfile.h"
|
||||
|
||||
|
@ -159,7 +159,6 @@ bool Configfile::createConfigFile()
|
||||
using namespace std;
|
||||
using namespace libconfig;
|
||||
|
||||
static const char *output_file = "ximea.cfg";
|
||||
Config cfg;
|
||||
|
||||
Setting &root = cfg.getRoot();
|
||||
@ -208,15 +207,16 @@ bool Configfile::createConfigFile()
|
||||
|
||||
|
||||
// Write out the new configuration.
|
||||
QString output_file = QDir::cleanPath(QCoreApplication::applicationDirPath() + QDir::separator() + "ximea.cfg");
|
||||
try
|
||||
{
|
||||
cfg.writeFile(output_file);
|
||||
cerr << "New configuration successfully written to: " << output_file << endl;
|
||||
cfg.writeFile(output_file.toStdString().c_str());
|
||||
cerr << "New configuration successfully written to: " << output_file.toStdString().c_str() << endl;
|
||||
|
||||
}
|
||||
catch(const FileIOException &fioex)
|
||||
{
|
||||
cerr << "I/O error while writing configuration file: " << output_file << endl;
|
||||
cerr << "I/O error while writing configuration file: " << output_file.toStdString().c_str() << endl;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -9,7 +9,8 @@ XimeaImager::XimeaImager()
|
||||
|
||||
//connect(this, SIGNAL(recordFinished()),this, SLOT());
|
||||
|
||||
m_configfile.setConfigfilePath("ximea.cfg");
|
||||
QString ximeaCfgFile = QDir::cleanPath(QCoreApplication::applicationDirPath() + QDir::separator() + "ximea.cfg");
|
||||
m_configfile.setConfigfilePath(ximeaCfgFile.toStdString());
|
||||
if(!m_configfile.isConfigfileExist())
|
||||
m_configfile.createConfigFile();
|
||||
m_configfile.parseConfigfile();
|
||||
@ -80,7 +81,10 @@ void XimeaImager::openImger()
|
||||
m_iImagerState = 101;
|
||||
emit ximeaImageStatus(m_iImagerState);
|
||||
|
||||
m_ximeaTemperatureCSVPath = "/home/rock/programRunLog/ximeaTemperature.csv";
|
||||
QDateTime curDateTime = QDateTime::currentDateTime();
|
||||
QString currentTime = curDateTime.toString("yyyy_MM_dd_hh_mm_ss");
|
||||
m_ximeaTemperatureCSVPath = QDir::cleanPath(QString::fromStdString("/home/programRunLog/hyperspectralLog") + QDir::separator() + "ximeaTemperature_" + currentTime + ".csv");
|
||||
// m_ximeaTemperatureCSVPath = "/home/ximeaTemperature.csv";
|
||||
emit recordXimeaTemperatureSignal(m_ximeaTemperatureCSVPath);
|
||||
}
|
||||
catch(int xiApiErrorCodes)
|
||||
@ -480,6 +484,10 @@ void XimeaImager::startRecord(double TimeDifferenceBetweensOSAndSbg,QString base
|
||||
// {
|
||||
// break;
|
||||
// }
|
||||
// if(m_iFrameCounter/getFramerate() > 5*60) //这个判断会导致丢帧率的大幅升高:5% → 20%,推测原因:除法耗时;
|
||||
// {
|
||||
// break;
|
||||
// }
|
||||
|
||||
// unsigned char pixel = *(unsigned char*)image.bp;//Default value: XI_MONO8
|
||||
// unsigned short pixel =*(unsigned short*)image.bp;//XI_RAW16
|
||||
@ -669,6 +677,7 @@ void XimeaImager::processXiApiErrorCodes(int xiApiErrorCodes)
|
||||
ofstream ximeaErrorFile(ximeaError.toStdString().c_str(),ios::app);
|
||||
|
||||
ximeaErrorFile<< xiApiErrorCodes << "\n";
|
||||
std::cout<<"XimeaImager::processXiApiErrorCodes-----------:未处理ximea异常代码:"<< xiApiErrorCodes <<std::endl;
|
||||
|
||||
ximeaErrorFile.close();
|
||||
|
||||
|
Reference in New Issue
Block a user