void PorkSendPage::startNewGame() { timer = new QTimer(this); connect(timer, SIGNAL(timeout()), this, SLOT(updateProgressBar())); timer->start(2000); updateProgressBar(); this->update(); }
void StatusWindow::updateJobBar(ProgressBar *bar, bool percent) { updateProgressBar(bar, player_node->mJobXp, player_node->mJobXpForNextLevel, percent); }
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); this->setFixedSize(467, 304); bytesSent = 0; ui->lineEdit_localPort->setEnabled(false); ui->lineEdit_filePath->setEnabled(false); ui->lineEdit_localAddress->setEnabled(false); ui->lineEdit_remoteAddress->setEnabled(false); ui->progressBar->setValue(0); ui->progressBar->setRange(0, 10000); connect(&server, SIGNAL(currentStatus(int)), this, SLOT(setCurrentStatus(int))); connect(&server, SIGNAL(error(int)), this, SLOT(errorHandler(int))); connect(&server, SIGNAL(ipAddress(QString, quint16)),this, SLOT(displayIPAddress(QString, quint16))); connect(&server, SIGNAL(bytesSent(qint64)), this, SLOT(updateProgressBar(qint64))); connect(&server, SIGNAL(progressRange(qint64)), this, SLOT(setProgressRange(qint64))); QFile thePath("C:/imageFilePath_inkPresettingSystem"); if (thePath.open(QIODevice::ReadOnly)){ QString dir = thePath.readAll(); ui->lineEdit_filePath->setText(dir); server.setFilePath(dir); thePath.close(); } }
void FalseColorDock::processCalculationProgressChanged(FalseColoring::Type coloringType, int percent) { coloringProgress[coloringType] = percent; if (coloringType == selectedColoring()) updateProgressBar(); }
/*------------------------------------------------------------------------------------------------------------------ -- FUNCTION: SendPacket -- -- DATE: November 25, 2015 -- -- REVISIONS: (Date and Description) -- -- DESIGNER: Alvin Man -- -- PROGRAMMER: Alvin Man -- -- INTERFACE: SendPacket(char* str) -- -char* str : the packet to be sent -- -- RETURNS: VOID -- -- NOTES: -- Sends a packet to the serial port. If we get an ACK back acknowledging the packet we just sent, the packet is -- considered sent successfully, and we return. If we don't get an ACK back, we assume something went wrong with the -- transmission and we resend the same packet, up to the maximum specified tries. ----------------------------------------------------------------------------------------------------------------------*/ VOID SendPacket(char* str) { DWORD numTries_sendPacket = 0; //Try to send the packet until we reach the maximum number of tries while (numTries_sendPacket < SEND_PACKET_MAX_TRIES) { //Send the packet Send(str, strlen(str), hWrite_Lock); //Wait for a response for the Packet we sent char *response = ""; if (!Wait_For_Data(&response, 1, 3000)) { updateStats(stats.packetSent++, IDC_SDATA0); //Time'd out, increment counter and restart the loop to send the packet again OutputDebugString("Packet sending timeout\n"); numTries_sendPacket++; continue; } else if (Evaluate_Response (response[0])) { updateProgressBar (progressSize / Write_Packets.size()); return; } } }
void TwitPicDialog::accept() { m_progressBar->reset(); m_errorMsgLabel->hide(); m_progressBar->show(); QUrl url("http://twitpic.com/api/upload"); QNetworkRequest post(url); QByteArray boundary = "------------------------------7251e57fe7ed"; // "--------dlf-maximum"; post.setHeader(QNetworkRequest::ContentTypeHeader, "multipart/form-data; boundary=" + boundary); post.setRawHeader("Host", "twitpic.com"); QByteArray ba; ba.append("--" + boundary + "\r\n"); ba.append("Content-Disposition: form-data; name=\"media\"; filename=\"1.jpg\"\r\n"); ba.append("Content-Type: image/" + QImageReader::imageFormat(m_fileName) + "\r\n\r\n"); QFile file(m_fileName); file.open(QIODevice::ReadOnly); ba.append(file.readAll()); ba.append("\r\n"); ba.append("--" + boundary + "\r\n"); ba.append("Content-Disposition: form-data; name=\"username\"\r\n\r\n"); ba.append(m_username + "\r\n"); ba.append("--" + boundary + "\r\n"); ba.append("Content-Disposition: form-data; name=\"password\"\r\n\r\n"); ba.append(m_password + "\r\n"); ba.append("--" + boundary + "--" + "\r\n"); post.setHeader(QNetworkRequest::ContentLengthHeader, ba.count()); QNetworkAccessManager *manager = new QNetworkAccessManager(this); m_reply = manager->post(post, ba); connect(m_reply, SIGNAL(uploadProgress(qint64, qint64)), this, SLOT(updateProgressBar(qint64,qint64))); connect(m_reply, SIGNAL(finished()), this, SLOT(uploadFinished())); m_postButton->setEnabled(false); }
DownloadFromDCWidget::DownloadFromDCWidget(QWidget* parent, Qt::WindowFlags f) : QDialog(parent, f), thread(0), timer(new QTimer(this)), currentState(INITIAL) { ui.setupUi(this); ui.progressBar->hide(); ui.progressBar->setMinimum(0); ui.progressBar->setMaximum(100); fill_device_list(); fill_computer_list(); vendorModel = new QStringListModel(vendorList); ui.vendor->setModel(vendorModel); if (default_dive_computer_vendor) { ui.vendor->setCurrentIndex(ui.vendor->findText(default_dive_computer_vendor)); productModel = new QStringListModel(productList[default_dive_computer_vendor]); ui.product->setModel(productModel); if (default_dive_computer_product) ui.product->setCurrentIndex(ui.product->findText(default_dive_computer_product)); } if (default_dive_computer_device) ui.device->setEditText(default_dive_computer_device); timer->setInterval(200); connect(timer, SIGNAL(timeout()), this, SLOT(updateProgressBar())); updateState(INITIAL); }
void ECWThread::run() { try{ GDALDataset *poSrcDS = (GDALDataset *)GDALOpen(TO8F(inputPath),GA_ReadOnly); if (poSrcDS==NULL) throw tr("Open input file failed!"); if (poSrcDS->GetRasterBand(1)->GetRasterDataType()!=GDT_Byte) throw tr("Data type of input file is not byte!"); GDALDriver *poDriver = GetGDALDriverManager()->GetDriverByName("JP2ECW"); if (poDriver == NULL) throw tr("Data driver of ECW not found!"); char **papszOptions = NULL; papszOptions = CSLSetNameValue( papszOptions, "LARGE_OK", "YES" ); // papszOptions = CSLSetNameValue( papszOptions, "TARGET", "0" ); GDALDataset *poDstDS = poDriver->CreateCopy(TO8F(outputPath),poSrcDS,NULL,papszOptions,progress,this); if (poDstDS==NULL) throw tr("Generate ecw file failed!"); GDALClose(poSrcDS); GDALClose(poDstDS); updateProgressBar(100); } catch (const QString &msg) { qDebug()<<msg; } }
void UpdateProjects::UpdateProjectsSAke(QObject *__currentMaximumFitness, QObject *__absoluteMaximumFitness, QObject *__currentAverageFitness, QObject *__absoluteAverageFitness, QObject *__gen, QObject *__tb, QObject *__deltaCritico, QObject *__momentoDelPrimoOrdine, QObject *_progressBar) { _currentMaximumFitness = __currentMaximumFitness; _absoluteMaximumFitness = __absoluteMaximumFitness; _currentAverageFitness = __currentAverageFitness; _absoluteAverageFitness = __absoluteAverageFitness; _gen =__gen; _tb=__tb; _deltaCritico=__deltaCritico; _momentoDelPrimoOrdine=__momentoDelPrimoOrdine; progressBar = _progressBar; QObject::connect(update, SIGNAL(valueCurrentMaximumFitness(QString)),this, SLOT( updateCurrentMaximumFitness(QString))); QObject::connect(update, SIGNAL(valueAbsoluteMaximumFitness(QString)),this, SLOT( updateAbosulteMaximumFitness(QString))); QObject::connect(update, SIGNAL(valueCurrentAvarageFitness(QString)),this, SLOT( updateCurrentAvarageFitness(QString))); QObject::connect(update, SIGNAL(valueAbsoluteAvarageFitness(QString)),this, SLOT( updateAbsoluteAvarageFitness(QString))); QObject::connect(update, SIGNAL(valueGen(QString)),this, SLOT( updateGen(QString))); QObject::connect(update, SIGNAL(valueTb(QString)),this, SLOT( updateTb(QString))); QObject::connect(update, SIGNAL(valueDeltaCritico(QString)),this, SLOT( updateDeltaCritico(QString))); QObject::connect(update, SIGNAL(valueMomentoDelPrimoOrdine(QString)),this, SLOT( updateMomentoDelPrimoOrdine(QString))); QObject::connect(update, SIGNAL(valueProgressBar(QString)),this, SLOT( updateProgressBar(QString))); }
/*! * \brief Updates module based on the new status. * \param[in] newStatus - new status received from module */ void GUI::statusChanged(int newStatus) { status = newStatus; updateGUI(); updateProgressBar(progress); updateProgressBarClients(); }
void eZapSetup::init_eZapSetup() { if(!eSystemInfo::getInstance()->isOpenEmbedded()) { setNrOfBars(1); // var bar } valign(); int entry = 1; addCallableMenuEntry("eZapBouquetSetup", _("Create or edit bouquets"), &entry); addCallableMenuEntry("eZapScan", _("Setup and find satellites or scan for transponders"), &entry); new eListBoxEntryMenuSeparator(&list, eSkin::getActive()->queryImage("listbox.separator"), 0, true ); addCallableMenuEntry("eSystemSettings", _("Change internal settings like time, EPG and debugging settings"), &entry); addCallableMenuEntry("eHardwareSettings", _("Change hardware settings like harddisk, USB-stick or keyboard"), &entry); addCallableMenuEntry("eInterfaceSettings", _("Change user interface settings like OSD, LCD and languages"), &entry); new eListBoxEntryMenuSeparator(&list, eSkin::getActive()->queryImage("listbox.separator"), 0, true ); addCallableMenuEntry("eEmuConfig", _("Configure the softcam"), &entry); addCallableMenuEntry("eSoftwareManagement", _("Install and remove software"), &entry); // Set /var text and progress bar updateProgressBar(); CONNECT(list.selected, eZapSetup::entrySelected); /* emit */ setupHook(this, &entry); }
void ModelLoadingProgressDialog::setLoadedVertices(int n){ if(loadedVertices!=n){ loadedVertices = n; setVerticesLabels(); updateProgressBar(); } }
void LoadingBar::setScale9Enabled(bool enabled) { if (_scale9Enabled == enabled) { return; } _scale9Enabled = enabled; _barRenderer->setScale9Enabled(_scale9Enabled); if (_scale9Enabled) { bool ignoreBefore = _ignoreSize; ignoreContentAdaptWithSize(false); _prevIgnoreSize = ignoreBefore; } else { ignoreContentAdaptWithSize(_prevIgnoreSize); } setCapInsets(_capInsets); updateProgressBar(); _barRendererAdaptDirty = true; }
void sigalrm_handler (void) { printf ("Signal Alarm came\n"); updateProgressBar (bwritten, req->clength); alarm (1); }
void ModelLoadingProgressDialog::setLoadedPolyhedrons(int n){ if(loadedPolyhedrons!=n){ loadedPolyhedrons = n; setPolyhedronsLabels(); updateProgressBar(); } }
void ModelLoadingProgressDialog::stageComplete(int d){ QString message(""); switch(d){ case RMODEL_READY:{ message = QString("Rendering model complete...");break; } case CAMARON_ELEMENTS_CONFIGURATED:{ message = QString("Camaron elements configurated...");break; } case COMPLETED_VERTEX_POLYGON_R:{ message = QString("Completed vertex-polygon neighboor pointers...");break; } case COMPLETED_POLYGON_POLYGON_R:{ message = QString("Completed polygon-polygon neighboor pointers...");break; } case NORMALS_CALCULATED:{ message = QString("Normals calculated...");break; } case COMPLETED_POLYGON_POLYHEDRON_R:{ message = QString("Completed polygons-polyhedron neighboor pointers...");break; } case POLYHEDRON_GEOCENTER_CALCULATED:{ message = QString("Polyhedron's geocenters calculated...");break; } case FIXED_SURFACE_POLYGONS_VERTICES_ORDER:{ message = QString("Fixed surface polygons vertices order...");break; } case BASE_MODE_READY:{ message = QString("Base model loaded...");break; } } ui->plainTextEdit->appendPlainText(message); progressStages+=0.1f*(totalVertices+totalPolygons+totalPolyhedrons); updateProgressBar(); }
void FalseColorDock::processApplyClicked() { if(coloringState[selectedColoring()] == FalseColoringState::CALCULATING) { GGDBGM("enterState():"<<endl); enterState(selectedColoring(), FalseColoringState::ABORTING); if (lastShown == selectedColoring()) { // Cancel after re-calc enterState(selectedColoring(), FalseColoringState::UNKNOWN); emit unsubscribeFalseColoring(this, selectedColoring()); updateProgressBar(); updateTheButton(); } else { emit unsubscribeFalseColoring(this, selectedColoring()); // go back to last shown coloring if(coloringUpToDate[lastShown]) { uisel->sourceBox->setCurrentIndex(int(lastShown)); requestColoring(lastShown); } else { // or fall back to CMF, e.g. after ROI change uisel->sourceBox->setCurrentIndex(FalseColoring::CMF); requestColoring(FalseColoring::CMF); } } } else if( coloringState[selectedColoring()] == FalseColoringState::FINISHED || coloringState[selectedColoring()] == FalseColoringState::UNKNOWN ) { requestColoring(selectedColoring(), /* recalc */ true); } }
void StatusWindow::updateXPBar(ProgressBar *bar, bool percent) { updateProgressBar(bar, player_node->getXp(), player_node->mXpForNextLevel, percent); }
int TvrUiWidget::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QMainWindow::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { switch (_id) { case 0: on_actionVolume_triggered(); break; case 1: on_actionNew_triggered(); break; case 2: on_actionSave_triggered(); break; case 3: on_actionSaveAs_triggered(); break; case 4: on_actionAbout_triggered(); break; case 5: on_actionOpen_triggered(); break; case 6: on_actionExit_triggered(); break; case 7: on_actionRecord_triggered(); break; case 8: on_actionStop_triggered(); break; case 9: on_actionPlay_triggered(); break; case 10: on_actionPaused_triggered(); break; case 11: updateProgressBar(); break; default: ; } _id -= 12; } return _id; }
/** * @brief ResultsPageWidget::setResults * @param result */ void ResultsPageWidget::setResults(SearchResult result) { updateProgressBar(1.0); mResult = std::make_shared<SearchResult>(std::move(result)); mResult->sortByScore(); mModel.setSearchResult(mResult.get()); ConfigData* data = ConfigData::getInstance(); if (data->getSoundOn()) { Q_INIT_RESOURCE(application); QSound::play(":/sound.wav"); } QVariant varQuery; emit readFromStack(3, varQuery); if (varQuery.canConvert<std::shared_ptr<SearchQuery>>()) { SearchQuery* query = varQuery.value<std::shared_ptr<SearchQuery>>().get(); SearchFeedback feedback = mModel.getFeedback(); QList<DataPacket*> algoInputs; algoInputs.push_back(query); algoInputs.push_back(&feedback); if(mAlgorithm->setInputs(algoInputs)){ ui->btnNewSearch->setEnabled(true); } } else { LOG_ERR("could not find search query on stack"); } setCursor(QCursor(Qt::CursorShape::ArrowCursor)); }
void FalseColorDock::setCalculationInProgress(FalseColoring::Type coloringType) { if (selectedColoring() == coloringType) { enterState(selectedColoring(), FalseColoringState::CALCULATING); updateTheButton(); updateProgressBar(); } }
void StatusWindow::updateXPBar(ProgressBar *bar, bool percent) { if (!bar) return; updateProgressBar(bar, PlayerInfo::getAttribute(EXP), PlayerInfo::getAttribute(EXP_NEEDED), percent); }
/** * revertVideo - revert playing * */ void VideoProcessor::revertVideo() { // pause the video jumpTo(0); curPos = 0; pauseIt(); emit updateProgressBar(); }
void FalseColorDock::processSelectedColoring() { emit unsubscribeFalseColoring(this, lastShown); GGDBGM( "requesting false color image " << selectedColoring() << endl); requestColoring(selectedColoring()); updateTheButton(); updateProgressBar(); }
void stopSimulationRequested() { if (runner.isRunning()) runner.interrupt(); if (!progressTimer.empty()) progressTimer.disconnect(); updateProgressBar(); }
void ModelLoadingProgressDialog::setupForNewModel(int type, int nvertices, int npolygons, int npolyhedrons){ modelType = type; ui->progressBar->setEnabled(true); ui->pushButton->setVisible(false); resetVertices(nvertices); resetPolygons(npolygons); resetPolyhedrons(npolyhedrons); ui->progressBar->setValue(0); progressStages = 0; ui->plainTextEdit->clear(); totalelements = totalVertices+totalPolygons+totalPolyhedrons; switch(type){ case vis::CONSTANTS::VERTEX_CLOUD:{ ui->widget_polygon->setVisible(false); ui->widget_polyhedron->setVisible(false); progressVarMax = (int)((nvertices+npolygons+npolyhedrons)*1.3f); break; } case vis::CONSTANTS::POLYGON_MESH:{ ui->widget_polygon->setVisible(true); ui->widget_polyhedron->setVisible(false); progressVarMax = (int)((nvertices+npolygons+npolyhedrons)*1.6f); break; } case vis::CONSTANTS::POLYHEDRON_MESH:{ ui->widget_polygon->setVisible(true); ui->widget_polyhedron->setVisible(true); progressVarMax = (int)((nvertices+npolygons+npolyhedrons)*1.9f); break; } case vis::CONSTANTS::LIGHT_WEIGHT_VERTEX_CLOUD:{ ui->widget_polygon->setVisible(false); ui->widget_polyhedron->setVisible(false); progressVarMax = (int)((nvertices+npolygons+npolyhedrons)*1.3f); break; } case vis::CONSTANTS::LIGHT_WEIGHT_POLYGON_MESH:{ ui->widget_polygon->setVisible(true); ui->widget_polyhedron->setVisible(false); progressVarMax = (int)((nvertices+npolygons+npolyhedrons)*1.4f); break; } case vis::CONSTANTS::LIGHT_WEIGHT_POLYHEDRON_MESH:{ ui->widget_polygon->setVisible(true); ui->widget_polyhedron->setVisible(true); progressVarMax = (int)((nvertices+npolygons+npolyhedrons)*1.5f); break; } default: std::cerr << "Error [ModelLoadingProgressDialog]:"<< "Invalid model type: "<<type<<std::endl; } ui->progressBar->setMaximum(progressVarMax); updateProgressBar(); }
int PlayBack::Fastforwardandrewind(bool flag,int keystate) { if(true == flag){ seek(5000); //right true 2000 = step 2S updateProgressBar(); }else if(false == flag){ seek(-5000); //left false updateProgressBar(); } if(MSG_KEYUP == keystate){ if(getCurrentState() == STATE_STARTED){ PlayBackPlayStatus(PlayStart); }else if(getCurrentState() == STATE_PAUSED) { PlayBackPlayStatus(PlayStop); } } return 0; }
void LaunchSimulationBox::updateWidget() { switch (mState) { case LaunchSimulationBox::Wait: mPlay->set_sensitive(true); mStop->set_sensitive(false); mProgressBar->set_fraction(0.0); mProgressBar->set_text(_("Wait")); mCurrentTimeLabel->set_text(""); break; case LaunchSimulationBox::Init: changeToWatchCursor(); mPlay->set_sensitive(false); mStop->set_sensitive(false); mProgressBar->set_fraction(0.0); mProgressBar->set_text(_("The simulator initializes the models")); mCurrentTimeLabel->set_text(""); break; case LaunchSimulationBox::Play: mPlay->set_sensitive(false); mStop->set_sensitive(true); updateCurrentTime(); updateProgressBar(); break; case LaunchSimulationBox::Error: resetCursor(); mPlay->set_sensitive(true); mStop->set_sensitive(false); mProgressBar->set_text(_("Simulation error")); updateCurrentTime(); updateProgressBar(); break; case LaunchSimulationBox::Finish: resetCursor(); mPlay->set_sensitive(true); mStop->set_sensitive(false); mProgressBar->set_text(_("Finished")); updateCurrentTime(); updateProgressBar(); break; case LaunchSimulationBox::Close: break; } }
/** * prevFrame - display the prev frame of the sequence * */ void VideoProcessor::prevFrame() { if(isStop()) pauseIt(); if (curPos >= 0){ curPos -= 1; jumpTo(curPos); } emit updateProgressBar(); }
void MapDownloader::downloadTileList() { if (m_downloadIndex<downloadListy->size()) { ImageManager::instance()->prefetchImage(mapAdapter->host(), mapAdapter->query(downloadListx->at(m_downloadIndex), downloadListy->at(m_downloadIndex), downloadListz->at(m_downloadIndex))); m_downloadIndex++; qDebug()<<"download tiles"<<m_downloadIndex; updateProgressBar(); } }