修复路径问题
1. 配置文件创建在程序所在目录; 2. csv文件(ximea温度)输出路径改为:/home/programRunLog/hyperspectralLog;
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user