MCPcopy Create free account
hub / github.com/Theverat/NormalmapGenerator / displayCalcTime

Method displayCalcTime

src_gui/mainwindow.cpp:841–857  ·  view source on GitHub ↗

display the last calculation time in the statusbar

Source from the content-addressed store, hash-verified

839
840//display the last calculation time in the statusbar
841void MainWindow::displayCalcTime(int calcTime_ms, QString mapType, int duration_ms) {
842 std::cout << mapType.toStdString() << " for image " << loadedImagePath.fileName().toStdString()
843 << " calculated (" << calcTime_ms << "ms)" << std::endl;
844 ui->statusBar->clearMessage();
845 QString msg = generateElapsedTimeMsg(calcTime_ms, mapType);
846 ui->statusBar->showMessage(msg, duration_ms);
847 ui->label_autoUpdate_lastCalcTime->setText("(Last Calc. Time: " + QString::number((double)calcTime_ms / 1000.0) + "s)");
848
849 if(calcTime_ms < ui->doubleSpinBox_autoUpdateThreshold->value() * 1000) {
850 //calcTime was below the threshold, set textcolor to green
851 ui->label_autoUpdate_lastCalcTime->setStyleSheet("QLabel {color: #00AA00;}");
852 }
853 else {
854 //calcTime was above threshold, set textcolor to red to signal user the time was too long for autoupdate
855 ui->label_autoUpdate_lastCalcTime->setStyleSheet("QLabel {color: red;}");
856 }
857}
858
859void MainWindow::enableAutoupdate(bool on) {
860 ui->checkBox_autoUpdate->setEnabled(on);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected