/*! */ void pAcquisitionWindow::setupConnections() { connect(m_transportBar, SIGNAL(start()), this, SLOT(startRun())); connect(m_transportBar, SIGNAL(stop()), this, SLOT(stopRun())); connect(m_runController, SIGNAL(runStarted()), this, SLOT(disableTabs())); connect(m_runController, SIGNAL(runStopped()), this, SLOT(enableTabs())); connect(m_runController, SIGNAL(runStopped()), this, SLOT(stop())); connect(m_runController, SIGNAL(stationIdSet(int)), m_daqDisplay, SLOT(updateStationId(int))); connect(m_runController, SIGNAL(runIdChanged(int)), m_daqDisplay, SLOT(updateRunId(int))); connect(m_runController, SIGNAL(statusChanged(QString)), m_daqDisplay, SLOT(updateStatus(QString))); connect(m_runController, SIGNAL(numDataBlocksChanged(int)), m_daqDisplay, SLOT(updateNumDataBlocks(int))); connect(m_runController, SIGNAL(numEventsChanged(int)), m_daqDisplay, SLOT(updateNumEvents(int))); connect(m_runController, SIGNAL(elapsedSecondsChanged(int)), m_daqDisplay, SLOT(updateElapsedSeconds(int))); connect(m_runController, SIGNAL(averageEventRateChanged(double)), m_daqDisplay, SLOT(updateAverageDaqRate(double))); //connect(m_runController, SIGNAL(instantEventRateChanged(double)), //m_daqDisplay, SLOT(updateInstantDaqRate(double))); connect(m_runController->xpolFpga(), SIGNAL(vrefRead(unsigned short, double)), this, SLOT(displayReference(unsigned short, double))); connect(m_thresholdSettingTab->getRefreshRefButton(), SIGNAL(clicked()), m_runController->xpolFpga(), SLOT(readVrefDac())); connect(m_userPreferencesTab, SIGNAL(visualizetionModeChanged(int)), this, SLOT(changeVisualizationMode(int))); }
void FileTestItem::run() { clearCompileOutput(); clearRunOutput(); clearCommandLineOutput(); setProgress(0.0); setStatus(Status::Running); emit runStarted(this); testRunner_->run(); }
void RunData::setStartTimeID(int timeID) { //qDebug() << "setStartTimeID"; if(this->startTimeID!=timeID){ if(startTimeID==0 && goalTimeID==0) // if the previous starttime was invalid and there is no goaltime yet { emit runStarted(this); } this->startTimeID=timeID; changeHandler(); emit timeStampAssigned(this); } }
Runner::Runner(QWidget *parent, QStatusBar* mainWindowStatusBar) : QWidget(parent), statusBar(mainWindowStatusBar) { layout = new QHBoxLayout(this); runButton = new QPushButton(RUN); QFontMetrics fontMetrics = runButton->fontMetrics(); runButton->setMinimumWidth(fontMetrics.width(RUNNING)*1.5); runButton->setFocusPolicy(Qt::StrongFocus); connect(runButton, SIGNAL(clicked()), SLOT(runButtonClicked())); layout->addStretch(1); layout->addWidget(runButton); layout->addStretch(1); processManager = new ProcessManager(this); converter = new ConvertAllEps(this, mainWindowStatusBar); pdf_concat = new ConcatPdfs(this); connect(processManager, SIGNAL(runFinished(bool,QString)), SLOT(onRunFinished(bool,QString))); connect(processManager, SIGNAL(runStarted()), SLOT(onRunStarted())); connect(converter, SIGNAL(finished(bool)), SLOT(onConversionFinished(bool))); connect(pdf_concat, SIGNAL(finished(bool)), SLOT(onConcatFinished(bool))); }
GoplayBrowser::GoplayBrowser(LiteApi::IApplication *app, QObject *parent) : LiteApi::IBrowserEditor(parent), m_liteApp(app) { QDir dir(m_liteApp->storagePath()); dir.mkpath("goplay"); m_dataPath = dir.path()+"/goplay"; m_playFile = QFileInfo(dir,"goplay.go").filePath(); QFile file(m_playFile); if (file.open(QFile::WriteOnly|QIODevice::Text)) { file.write(data.toUtf8()); file.close(); } m_widget = new QWidget; m_editor = m_liteApp->fileManager()->createEditor(data,"text/x-gosrc"); m_editor->open(m_playFile,"text/x-gosrc"); QToolBar *toolBar = LiteApi::findExtensionObject<QToolBar*>(m_editor,"LiteApi.QToolBar"); m_output = new TextOutput(m_liteApp); QVBoxLayout *layout = new QVBoxLayout; QHBoxLayout *head = new QHBoxLayout; QSplitter *spliter = new QSplitter(Qt::Vertical); QLabel *label = new QLabel(QString("<h2>%1</h2>").arg(tr("Go Playground"))); QAction *run = new QAction(tr("Run"),this); QAction *stop = new QAction(tr("Stop"),this); QAction *_new = new QAction(tr("New"),this); QAction *load = new QAction(tr("Load..."),this); QAction *save = new QAction(tr("Save..."),this); QAction *shell = new QAction(tr("Explore Folder"),this); m_editLabel = new QLabel; if (toolBar) { toolBar->addSeparator(); toolBar->addAction(run); toolBar->addAction(stop); toolBar->addAction(_new); toolBar->addAction(load); toolBar->addAction(save); toolBar->addSeparator(); toolBar->addAction(shell); toolBar->addSeparator(); toolBar->addWidget(m_editLabel); } head->addWidget(label); layout->addLayout(head); spliter->addWidget(m_editor->widget()); spliter->addWidget(m_output); spliter->setStretchFactor(0,2); spliter->setStretchFactor(1,1); layout->addWidget(spliter); m_widget->setLayout(layout); m_process = new ProcessEx(this); m_process->setWorkingDirectory(dir.path()); m_codec = QTextCodec::codecForName("utf-8"); connect(run,SIGNAL(triggered()),this,SLOT(run())); connect(stop,SIGNAL(triggered()),this,SLOT(stop())); connect(_new,SIGNAL(triggered()),this,SLOT(newPlay())); connect(load,SIGNAL(triggered()),this,SLOT(loadPlay())); connect(save,SIGNAL(triggered()),this,SLOT(savePlay())); connect(shell,SIGNAL(triggered()),this,SLOT(shell())); connect(m_process,SIGNAL(started()),this,SLOT(runStarted())); connect(m_process,SIGNAL(extOutput(QByteArray,bool)),this,SLOT(runOutput(QByteArray,bool))); connect(m_process,SIGNAL(extFinish(bool,int,QString)),this,SLOT(runFinish(bool,int,QString))); m_liteApp->extension()->addObject("LiteApi.Goplay",this); m_liteApp->extension()->addObject("LiteApi.Goplay.IEditor",m_editor); }
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(); }
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow), _has_unsaved_data(true), _current_file(""), _can_run(false), _is_running(false), _is_debug_input(false) { ui->setupUi(this); initStyles(); updateWindowTitle(); redoAvailable(false); undoAvailable(false); copyAvailable(false); _window = this; ui->debugRun->setVisible(false); ui->runWidget->setVisible(false); registerFileType(tr("Yad.Markov.File"), tr("Markov Algorithm File"), ".yad", 1); updateDebugMenu(); //Connect MainWindow menu connect(ui->actionExit, SIGNAL(triggered()), this, SLOT(close())); connect(ui->actionUndo, SIGNAL(triggered()), this, SIGNAL(undo())); connect(ui->actionRedo, SIGNAL(triggered()), this, SIGNAL(redo())); connect(ui->actionSelect_All, SIGNAL(triggered()), this, SIGNAL(selectAll())); connect(ui->actionCopy, SIGNAL(triggered()), this, SIGNAL(copy())); connect(ui->actionPaste, SIGNAL(triggered()), this, SIGNAL(paste())); connect(ui->actionCut, SIGNAL(triggered()), this, SIGNAL(cut())); connect(ui->actionDelete, SIGNAL(triggered()), this, SIGNAL(deleteSelection())); connect(ui->actionNew, SIGNAL(triggered()), this, SIGNAL(newFile())); connect(ui->actionOpen, SIGNAL(triggered()), this, SIGNAL(open())); connect(ui->actionSave, SIGNAL(triggered()), this, SIGNAL(save())); connect(ui->actionSave_As, SIGNAL(triggered()), this, SIGNAL(saveAs())); connect(ui->actionTutorial, SIGNAL(triggered()), this, SLOT(tutorial())); connect(ui->actionAbout, SIGNAL(triggered()), this, SLOT(about())); //Connect InputWidget and HistoryManager HistoryManager* history_manager = HistoryManager::getInstance(); connect(ui->input, SIGNAL(addToHistory(QString)), history_manager, SLOT(addToHistory(QString))); connect(history_manager, SIGNAL(wordSelected(QString)), ui->input, SLOT(setInput(QString))); //Connect HistoryWidget and HistoryManager connect(ui->history, SIGNAL(inputWordSelected(QString)), history_manager, SIGNAL(wordSelected(QString))); connect(ui->history, SIGNAL(removeFromHistory(QString)), history_manager, SLOT(removeFromHistory(QString))); connect(history_manager, SIGNAL(historyChanged(QVector<QString>)), ui->history, SLOT(historyChanged(QVector<QString>))); //Connect MainWindows and FileManager FileManager* file_manager = FileManager::getInstance(); connect(this, SIGNAL(newFile()), file_manager, SLOT(newFile())); connect(this, SIGNAL(open()), file_manager, SLOT(open())); connect(this, SIGNAL(save()), file_manager, SLOT(save())); connect(this, SIGNAL(saveAs()), file_manager, SLOT(saveAs())); connect(file_manager, SIGNAL(hasUnsavedData(bool)), this, SLOT(hasUnsavedData(bool))); connect(file_manager, SIGNAL(fileNameChanged(QString)), this, SLOT(fileNameChanged(QString))); //Connect MainWindows and EditorWindowWidget connect(this, SIGNAL(undo()), ui->editorWindow, SLOT(undo())); connect(this, SIGNAL(redo()), ui->editorWindow, SLOT(redo())); connect(this, SIGNAL(selectAll()), ui->editorWindow, SLOT(selectAll())); connect(this, SIGNAL(copy()), ui->editorWindow, SLOT(copy())); connect(this, SIGNAL(paste()), ui->editorWindow, SLOT(paste())); connect(this, SIGNAL(cut()), ui->editorWindow, SLOT(cut())); connect(this, SIGNAL(deleteSelection()), ui->editorWindow, SLOT(deleteSelection())); connect(ui->editorWindow, SIGNAL(redoAvailable(bool)), this, SLOT(redoAvailable(bool))); connect(ui->editorWindow, SIGNAL(undoAvailable(bool)), this, SLOT(undoAvailable(bool))); connect(ui->editorWindow, SIGNAL(copyAvailable(bool)), this, SLOT(copyAvailable(bool))); //Connect InputWidget and MarkovRunManager MarkovRunManager* run_manager = MarkovRunManager::getInstance(); connect(ui->input, SIGNAL(run(QString)), run_manager, SLOT(runWithoutDebug(QString))); connect(ui->input, SIGNAL(runWithDebug(QString)), run_manager, SLOT(runWithDebug(QString))); connect(run_manager, SIGNAL(runWithoutDebugStarted(QString)), ui->input, SLOT(runStarted())); connect(ui->input, SIGNAL(runWithDebugStepByStep(QString)), run_manager, SLOT(runWithDebugStepByStep(QString))); connect(run_manager, SIGNAL(debugStarted(QString)), ui->input, SLOT(runStarted())); connect(run_manager, SIGNAL(runWithoutDebugFinishFail(QString,RunError,int)), ui->input, SLOT(runFinished())); connect(run_manager, SIGNAL(runWithoutDebugFinishSuccess(QString,QString,int)), ui->input, SLOT(runFinished())); connect(run_manager, SIGNAL(debugFinishFail(QString,RunError,int)), ui->input, SLOT(runFinished())); connect(run_manager, SIGNAL(debugFinishSuccess(QString,QString,int)), ui->input, SLOT(runFinished())); connect(run_manager, SIGNAL(canRunSourceCode(bool)), ui->input, SLOT(canRunAlgorithm(bool))); //Connect SourceCodeManager and EditorWindowWidget SourceCodeManager* source_manager = SourceCodeManager::getInstance(); connect(source_manager, SIGNAL(newSourceCodeWasLoaded(QString)), ui->editorWindow, SLOT(newSourceCode(QString))); connect(ui->editorWindow, SIGNAL(sourceCodeChanged(QString)), source_manager, SLOT(setSourceCode(QString))); //Connect InputWidget and FileManager connect(ui->input, SIGNAL(save()), file_manager, SLOT(save())); //Connect MarkovRunManager and EditorWindowWidget connect(ui->editorWindow, SIGNAL(canRun(bool)), run_manager, SLOT(setCanRunSourceCode(bool))); connect(ui->editorWindow, SIGNAL(markovAlgorithmChanged(MarkovAlgorithm)), run_manager, SLOT(setAlgorithm(MarkovAlgorithm))); //Connect SourceCodeManager and FileManager connect(file_manager, SIGNAL(newSourceCodeLoaded(QString)), source_manager, SLOT(setNewSourceCodeFromFile(QString))); connect(source_manager, SIGNAL(sourceCodeChanged(QString)), file_manager, SLOT(sourceCodeChanged())); //Connect FileManager and HistoryManager connect(file_manager, SIGNAL(newHistoryLoaded(QVector<QString>)), this, SLOT(newHistoryLoaded(QVector<QString>))); connect(history_manager, SIGNAL(historyChanged(QVector<QString>)), file_manager, SLOT(historyChanged())); //Connect RunWidget and MarkovRunManager connect(run_manager, SIGNAL(runWithoutDebugStarted(QString)), ui->runWidget, SLOT(runStarted(QString))); connect(run_manager, SIGNAL(runStepsMade(int)), ui->runWidget, SLOT(runStepsMade(int))); connect(run_manager, SIGNAL(runWithoutDebugFinishFail(QString,RunError,int)), ui->runWidget, SLOT(runFailed(QString,RunError,int))); connect(run_manager, SIGNAL(runWithoutDebugFinishSuccess(QString,QString,int)), ui->runWidget, SLOT(runSuccess(QString,QString,int))); connect(run_manager, SIGNAL(debugStarted(QString)), ui->runWidget, SLOT(hide())); //Connect DebugRunWidget and MarkovRunManager connect(ui->debugRun, SIGNAL(nextStepClicked()), run_manager, SLOT(debugNextStep())); connect(ui->debugRun, SIGNAL(continueClicked()), run_manager, SLOT(debugContinue())); connect(ui->debugRun, SIGNAL(stopClicked()), run_manager, SLOT(debugStop())); connect(run_manager, SIGNAL(debugStarted(QString)), ui->debugRun, SLOT(debugStarted(QString))); connect(run_manager, SIGNAL(debugFinishSuccess(QString,QString,int)), ui->debugRun, SLOT(debugSuccess(QString,QString,int))); connect(run_manager, SIGNAL(debugFinishFail(QString,RunError,int)), ui->debugRun, SLOT(debugFailed(QString,RunError,int))); connect(run_manager, SIGNAL(debugStepFinished(int,QString,QString,MarkovRule)), ui->debugRun, SLOT(debugStepFinished(int,QString,QString,MarkovRule))); connect(run_manager, SIGNAL(debugBreakPointReached(int)), ui->debugRun, SLOT(breakPointReached(int))); connect(run_manager, SIGNAL(runWithoutDebugStarted(QString)), ui->debugRun, SLOT(hide())); connect(run_manager, SIGNAL(debugFinishFail(QString,RunError,int)), ui->runWidget, SLOT(hide())); connect(run_manager, SIGNAL(runWithoutDebugFinishFail(QString,RunError,int)), ui->debugRun, SLOT(hide())); //Connect DebugRunWidget and EditorWindowWidget connect(ui->debugRun, SIGNAL(removeBreakPoint()), ui->editorWindow, SLOT(removeLineHighlight())); connect(ui->debugRun, SIGNAL(showBreakPoint(int)), ui->editorWindow, SLOT(showLineHighlight(int))); //Connect MarkovRunManager and EditorWindowWidget connect(ui->editorWindow, SIGNAL(breakPointAdded(int)), run_manager, SLOT(addBreakPoint(int))); connect(ui->editorWindow, SIGNAL(breakPointRemoved(int)), run_manager, SLOT(removeBreakPoint(int))); //Connect top menu connect(run_manager, SIGNAL(runWithoutDebugStarted(QString)), this, SLOT(runStarted())); connect(run_manager, SIGNAL(debugStarted(QString)), this, SLOT(runStarted())); connect(run_manager, SIGNAL(runWithoutDebugFinishFail(QString,RunError,int)), this, SLOT(runFinished())); connect(run_manager, SIGNAL(runWithoutDebugFinishSuccess(QString,QString,int)), this, SLOT(runFinished())); connect(run_manager, SIGNAL(debugFinishFail(QString,RunError,int)), this, SLOT(runFinished())); connect(run_manager, SIGNAL(debugFinishSuccess(QString,QString,int)), this, SLOT(runFinished())); connect(run_manager, SIGNAL(canRunSourceCode(bool)), this, SLOT(canRunAlgorithm(bool))); connect(run_manager, SIGNAL(debugBreakPointReached(int)), this, SLOT(debugInputStarted())); connect(run_manager, SIGNAL(debugStepFinished(int,QString,QString,MarkovRule)), this, SLOT(debugInputFinished())); connect(ui->actionRun, SIGNAL(triggered()), ui->input, SLOT(runCliked())); connect(ui->actionDebug, SIGNAL(triggered()), ui->input, SLOT(runWithDebugClicked())); connect(ui->actionNext_Step, SIGNAL(triggered()), run_manager, SLOT(debugNextStep())); connect(ui->actionContinue, SIGNAL(triggered()), run_manager, SLOT(debugContinue())); connect(ui->actionStop_Debug, SIGNAL(triggered()), run_manager, SLOT(debugStop())); connect(ui->actionDebug_Step_By_Step, SIGNAL(triggered()), ui->input, SLOT(runWithDebugStepByStepClicked())); //Read file to open from command line QStringList arguments = QCoreApplication::arguments(); if(arguments.size() >= 2) { QString file_name = arguments.at(1); FileManager::getInstance()->openFile(file_name); } else { source_manager->setNewSourceCodeFromFile(tr("//Alphabet\nT = {a, b}\n\n//Rules\nab -> a\na ->. b")); } }