Commit 4314e5a5 authored by Thiago Santini's avatar Thiago Santini

Improves log information

parent 5d4f0ca9
......@@ -62,13 +62,13 @@ void CameraCalibration::onCalibrated()
void CameraCalibration::updateCalibrationStatus(bool success)
{
if (success) {
qInfo() << "Camera calibration done. RMS Error =" << rms;
qInfo() << id << "calibrated. RMS Error =" << rms;
undistortPB->setEnabled(true);
setRms(rms);
setCoverage(coverage);
sampleCountQL->setText(QString::number(sampleCount));
} else {
qInfo() << "Camera calibration failed.";
qInfo() << id << "calibration failed.";
undistortPB->setEnabled(false);
setRms();
setCoverage();
......@@ -173,7 +173,7 @@ void CameraCalibration::processSample(const Mat &frame)
if (found) {
imagePoints.push_back(pointBuf);
sampleCount = imagePoints.size();
sampleCount = (int) imagePoints.size();
if (sampleCount == 1)
covered = boundingRect(pointBuf);
else
......
......@@ -30,11 +30,12 @@ class CameraCalibration : public QDialog
{
Q_OBJECT
public:
CameraCalibration(QWidget *parent=0)
CameraCalibration(QString id, QWidget *parent=0)
: QDialog(parent),
calibrationSuccessful(false),
sampleCount(0),
coverage(0)
coverage(0),
id(id)
{
this->setWindowModality(Qt::ApplicationModal);
this->setWindowTitle("Camera Calibration");
......@@ -170,6 +171,7 @@ private:
QLabel *sampleCountQL;
QLabel *coveredQL;
QLabel *rmsQL;
QString id;
QFutureWatcher<void> watcher;
......
......@@ -91,7 +91,7 @@ CameraWidget::CameraWidget(QString id, ImageProcessor::Type type, QWidget *paren
recorder->moveToThread(recorderThread);
QMetaObject::invokeMethod(recorder, "create");
cameraCalibration = new CameraCalibration();
cameraCalibration = new CameraCalibration(id);
connect(cameraCalibration, SIGNAL(requestSample()),
this, SLOT(requestCameraCalibrationSample()) );
connect(cameraCalibration, SIGNAL(calibrationFinished(bool)),
......
......@@ -193,12 +193,15 @@ void loadSoundEffect(QSoundEffect &effect, QString fileName)
QStringList searchPaths;
searchPaths << gExeDir + "/../EyeRecToo/effects" << gExeDir + "/effects";
bool loaded = false;
for (int i=0; i<searchPaths.size(); i++) {
QString target = searchPaths[i] + "/" + fileName;
if (QFile(target).exists()) {
qDebug() << "Loaded" << target;
if (QFile(target).exists()) {
loaded = true;
effect.setSource(QUrl::fromLocalFile(target));
break;
}
}
}
}
if (!loaded)
qWarning() << "Failed to load" << fileName;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment