void ConnectionForm::createControls() { receiveBox = new QTextEdit; utilityBar = new QToolBar; QAction *clearAction = new QAction(tr("Clear Text"), this); clearAction->setIcon(QIcon(":/resources/icons/edit_clear.png")); connect(clearAction, SIGNAL(triggered()), this, SLOT(clearText())); QAction *exportAction = new QAction(tr("Export..."), this); connect(exportAction, SIGNAL(triggered()), this, SLOT(exportResult())); exportAction->setIcon(QIcon(":/resources/icons/export.png")); utilityBar->addAction(exportAction); utilityBar->addAction(clearAction); QComboBox *combo = new QComboBox; combo->addItems(QStringList() << tr("Packet Mode") << tr("Original Data")); connect(combo, SIGNAL(currentIndexChanged(int)), this, SLOT(changeDisplayMode(int))); combo->setCurrentIndex(0); utilityBar->addWidget(combo); utilityBar->setIconSize(QSize(24, 24)); utilityBar->setStyleSheet("QToolBar{border:0}"); }
void Worker::primary() { Script* s=parse(inputFile,reporter,true); if(print) { TreePrinter p(output); s->accept(p); output << endl; } TreeEvaluator e(reporter); s->accept(e); delete s; output.flush(); Node* n = e.getRootNode(); if(print) { NodePrinter p(output); n->accept(p); output << endl; } NodeEvaluator ne(reporter); n->accept(ne); delete n; primitive=ne.getResult(); if(!primitive) reporter->reportWarning(tr("no top level object.")); else if(!outputFile.isEmpty()) { exportResult(outputFile); } }
/** * \fn int starSort( int func, int *t, int size ) * \author Michael Gileta * \brief Cherche l'indice ou se trouve la taille du tableau * \param[in] func Fonction de tri à éxécuter * \param[in, out] t Tableau à trier * \param[in] size Taille du tableau * \return Return PID processus **/ int starSort( int func, int *t, int size ) { double timeFct; int child = fork(); if(child == 0) { alarm(TIMEEND); timeFct = Timepass(t, size, TAB_FONCTION[func]); exportResult(size, func, timeFct); exit(0); } return child; }
/** * \author Sylvain De baros & Michael Gileta * \fn void endlerChild() * \brief Arrète le tri en cour **/ void endlerChild() { printf("Délais dépassé"); exportResult(sort_size_tab, sort_nb_tab, 300); exit(EXIT_SUCCESS); }