display the last calculation time in the statusbar
| 839 | |
| 840 | //display the last calculation time in the statusbar |
| 841 | void 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 | |
| 859 | void MainWindow::enableAutoupdate(bool on) { |
| 860 | ui->checkBox_autoUpdate->setEnabled(on); |
nothing calls this directly
no outgoing calls
no test coverage detected