You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

78 lines
1.7 KiB

#include "docthread.h"
#include <QProcess>
#include <QDebug>
#include <QDir>
#include <QApplication>
docthread::docthread(QObject *parent)
: QObject{parent}
{
t = new QThread();
this->moveToThread(t);
t->start();
b_testmode = false;
testcount = 1;
}
void docthread::gendoc(QStringList msg)
{
if(b_testmode && testcount<=3){
}
qDebug()<<QDir::currentPath()<<lowfile<<highfile;
// if(this->lowfile.isEmpty() || this->highfile.isEmpty()){
// qDebug()<<__LINE__;
// return;
// }
qDebug()<<__LINE__;
bool b;
for(int i = 0;i<msg.length();i++){
if(i == 14)
continue;
msg[i].toFloat(&b);
if(!b){
return;
}
qDebug()<<i;
}
QDir d;
if(b_testmode && testcount<=3){
if(d.exists("reportGen/."+QString::number(testcount))){
qDebug()<<__FILE__<<__LINE__;
msg.insert(19,"../."+QString::number(testcount)+"/low.bin");
msg.insert(20,"../."+QString::number(testcount)+"./high.bin");
}
else{
msg.insert(19,lowfile);
msg.insert(20,highfile);
}
testcount+=1;
}
else{
msg.insert(19,lowfile);
msg.insert(20,highfile);
}
// msg.insert(0,"reportGen/test.py");
qDebug()<<__FILE__<<__LINE__<<msg;
QProcess process;
process.start("./reportGen/test.exe",msg);
process.waitForFinished();
qDebug()<<__FILE__<<__LINE__<< "done";
}
void docthread::slotsetlow(QString lowfile)
{
qDebug()<<lowfile;
this->lowfile = lowfile;
qDebug()<<this->lowfile;
}
void docthread::slotsethigh(QString highfile)
{
qDebug()<<highfile;
this->highfile = highfile;
qDebug()<<this->highfile;
}