void TestRunner::run_onTestFinished_(int exitCode, QProcess::ExitStatus /*exitStatus*/) { disconnect(process_, static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished), this, &TestRunner::run_onTestFinished_); runOutput_ += process_->readAll(); if (exitCode == 0) { QString time = getCurrentTime(); runOutput_ += time + ": The process \"" + process_->program() + "\" exited normally.\n"; emit outputChanged(); setStatus_(Status::Pass); emit runFinished(true); } else { QString time = getCurrentTime(); runOutput_ += time + ": The process \"" + process_->program() + QString("\" exited with code %1.\n").arg(exitCode); emit outputChanged(); setStatus_(Status::RunError); emit runFinished(false); } }
void FileTestItem::onRunFinished_(bool success) { setProgress(1.0); setStatus(success ? Status::Pass : Status::Fail); QString testRelPath = testRunner_->testRelPath(); switch (testRunner_->status()) { case TestRunner::Status::CompileError: appendToCommandLineOutput(compileOutput()); appendToCommandLineOutput("FAIL: " + testRelPath + "\n"); break; case TestRunner::Status::RunError: appendToCommandLineOutput(runOutput()); appendToCommandLineOutput("FAIL: " + testRelPath + "\n"); break; case TestRunner::Status::Pass: appendToCommandLineOutput("PASS: "******"\n"); break; default: appendToCommandLineOutput("????: " + testRelPath + "\n"); break; } emit runFinished(this); }
void TestRunner::run_onCompileFinished_(bool success) { disconnect(this, &TestRunner::compileFinished, this, &TestRunner::run_onCompileFinished_); if (success) { setStatus_(Status::Running); // -------- Run test -------- QString program = testBinPath_; QStringList arguments; runOutput_ += getCurrentTime() + ": Starting: \"" + program + "\" " + arguments.join(' ') + "\n"; connect(process_, static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished), this, &TestRunner::run_onTestFinished_); emit outputChanged(); process_->start(program, arguments); } else { emit runFinished(false); } }
void RunData::setGoalTimeID(int timeID) { //qDebug() << "setGoalTimeID"; if(this->goalTimeID!=timeID){ if(startTimeID!=0 && goalTimeID==0) // if there is a starttime and the previous goaltime is invalid { emit runFinished(this); } this->goalTimeID=timeID; changeHandler(); emit timeStampAssigned(this); } }
void Runner::stopRunner() { setCanBack(true); setCanContinue(false); emit runFinished(); }
void MgClKernel::run() { if(!environment()) return; if(!localRange()) return; if(!d_ptr->arguments.size()) return; if(!valid()) return; Q_EMIT runStarted(); cl::KernelFunctor functor = d_ptr->kernel.bind( d_ptr->environment->d_ptr->commandQueue, createRange(offsetRange()), createRange(localRange()), createRange(globalRange()) ); switch (d_ptr->arguments.size()) { case 1: functor(); break; case 2: functor(); break; case 3: functor(); break; case 4: functor(); break; case 5: functor(); break; case 6: functor(); break; case 7: functor(); break; case 8: functor(); break; case 9: functor(); break; case 10: functor(); break; case 11: functor(); break; case 12: functor(); break; case 13: functor(); break; case 14: functor(); break; case 15: functor(); break; default: break; } Q_EMIT runFinished(); }
int main(int argc, char *argv[]) { QApplication a(argc, argv); auto keys = QStyleFactory::keys(); for (auto s : keys) { qDebug(s.toStdString().c_str()); } QString ss = load_stylesheet(":/Stylesheets/common.qss"); #ifdef _6IT_UI_MOBILE ss.append(load_stylesheet(":/Stylesheets/common_mobile.qss")); #else ss.append(load_stylesheet(":/Stylesheets/common_desktop.qss")); #endif #ifdef _6IT_QT_WINRT_DESKTOP ss.append(load_stylesheet(":/Stylesheets/winrt_desktop.qss")); #elif defined(_6IT_QT_WINRT_PHONE) a.setStyle(QStyleFactory::create("Fusion")); ss.append(load_stylesheet(":/Stylesheets/winrt_phone.qss")); #elif defined(_6IT_QT_WINRT_DESKTOP) ss.append(load_stylesheet(":/Stylesheets/windows_desktop.qss")); #elif defined(_6IT_QT_IOS) ss.append(load_stylesheet(":/Stylesheets/ios.qss")); #elif defined(_6IT_QT_ANDROID) a.setStyle(QStyleFactory::create("Fusion")); ss.append(load_stylesheet(":/Stylesheets/android.qss")); #elif defined(_6IT_QT_LINUX_DESKTOP) ss.append(load_stylesheet(":/Stylesheets/linux_desktop.qss")); #endif a.setStyleSheet(ss); QThread thread; auto pworker = new RZQtSubCWorker(); auto &worker = *pworker; worker.moveToThread(&thread); thread.start(); FileListWindow fileListWindow; ViewSourceWindow editorWindow; RunWindow runWindow; CompileWindow compileWindow(worker); fileListWindow.show(); QObject::connect(&fileListWindow, SIGNAL(sourceSelected(QString)), &editorWindow, SLOT(show())); QObject::connect(&fileListWindow, SIGNAL(sourceSelected(QString)), &editorWindow, SLOT(loadFile(QString))); QObject::connect(&fileListWindow, SIGNAL(sourceSelected(QString)), &fileListWindow, SLOT(hide())); QObject::connect(&editorWindow, SIGNAL(navigatedBack()), &fileListWindow, SLOT(show())); QObject::connect(&editorWindow, SIGNAL(navigatedBack()), &editorWindow, SLOT(hide())); QObject::connect(&editorWindow, SIGNAL(runCode(QString const &)), &editorWindow, SLOT(hide())); QObject::connect(&editorWindow, SIGNAL(runCode(QString const &)), &compileWindow, SLOT(show())); QObject::connect(&editorWindow, SIGNAL(runCode(QString const &)), &compileWindow, SLOT(clear())); QObject::connect(&editorWindow, SIGNAL(runCode(QString const &)), &worker, SLOT(setSource(QString const &))); QObject::connect(&compileWindow, SIGNAL(navigatedBack()), &editorWindow, SLOT(show())); QObject::connect(&compileWindow, SIGNAL(navigatedBack()), &compileWindow, SLOT(hide())); QObject::connect(&worker, SIGNAL(compilationWillStart()), &compileWindow, SLOT(compileStarted())); QObject::connect(&worker, SIGNAL(compilationDidFinish()), &compileWindow, SLOT(compileFinished())); QObject::connect(&compileWindow, SIGNAL(runClicked()), &compileWindow, SLOT(hide())); QObject::connect(&compileWindow, SIGNAL(runClicked()), &runWindow, SLOT(show())); QObject::connect(&compileWindow, SIGNAL(runClicked()), &worker, SLOT(run())); QObject::connect(&runWindow, SIGNAL(navigatedBack()), &compileWindow, SLOT(show())); QObject::connect(&runWindow, SIGNAL(navigatedBack()), &runWindow, SLOT(hide())); QObject::connect(&worker, SIGNAL(runWillStart()), &runWindow, SLOT(runStarted())); QObject::connect(&worker, SIGNAL(runDidFinish()), &runWindow, SLOT(runFinished())); QObject::connect(&worker, SIGNAL(sourceChanged()), &worker, SLOT(compile())); QObject::connect(&worker, SIGNAL(compilerConsoleOutput(QString const &, int)), &compileWindow, SLOT(printString(QString const &, int))); QObject::connect(&worker, SIGNAL(runConsoleOutput(QString const &, int)), &runWindow, SLOT(printString(QString const &, int))); return a.exec(); }
void RunView::treeChanged(const openstudio::UUID &t_uuid) { std::string statusstr = "Ready"; try { openstudio::runmanager::Job j = runManager().getJob(t_uuid); while (j.parent()) { j = j.parent().get(); } openstudio::runmanager::TreeStatusEnum status = j.treeStatus(); LOG(Debug, "Tree finished, status is: " << status.valueName()); statusstr = status.valueDescription(); openstudio::path sqlpath; openstudio::path radianceOutPath; if (status == openstudio::runmanager::TreeStatusEnum::Finished || status == openstudio::runmanager::TreeStatusEnum::Failed || status == openstudio::runmanager::TreeStatusEnum::Canceled) { if (status == openstudio::runmanager::TreeStatusEnum::Failed && m_canceling) { statusstr = "Canceled"; } try { sqlpath = j.treeAllFiles().getLastByFilename("eplusout.sql").fullPath; } catch (const std::exception &e) { LOG(Debug, "Tree finished, error getting sql file: " << e.what()); } catch (...) { LOG(Debug, "Tree finished, error getting sql file"); // no sql file exists } try { radianceOutPath = j.treeOutputFiles().getLastByFilename("radout.sql").fullPath; } catch (const std::exception &e) { LOG(Debug, "Tree finished, error getting radout.sql file: " << e.what()); } catch (...) { LOG(Debug, "Tree finished, error getting radout.sql file"); // no sql file exists } runFinished(sqlpath, radianceOutPath); } else { m_canceling = false; } } catch (const std::exception &e) { LOG(Debug, "Tree finished, error getting status: " << e.what()); runFinished(openstudio::path(), openstudio::path()); } catch (...) { LOG(Debug, "Tree finished, error getting status"); runFinished(openstudio::path(), openstudio::path()); // no sql file exists } m_statusLabel->setText(openstudio::toQString(statusstr)); }