Commit 324204b5a41141b7faeebaf0acfebd4bb75e97a8
1 parent
5c750607
Properties working
Showing
4 changed files
with
10 additions
and
17 deletions
openbr/openbr_plugin.cpp
| @@ -763,11 +763,18 @@ void Object::setProperty(const QString &name, QVariant value) | @@ -763,11 +763,18 @@ void Object::setProperty(const QString &name, QVariant value) | ||
| 763 | if (value.isNull()) value = true; | 763 | if (value.isNull()) value = true; |
| 764 | else if (value == "false") value = false; | 764 | else if (value == "false") value = false; |
| 765 | else if (value == "true") value = true; | 765 | else if (value == "true") value = true; |
| 766 | + } else if (type.startsWith("br::") /* Pray to science it's safe to assume these are enums */) { | ||
| 767 | + bool ok; | ||
| 768 | + int enumIndex = value.toInt(&ok); | ||
| 769 | + if (ok) { | ||
| 770 | + QMetaEnum metaEnum = metaObject()->enumerator(metaObject()->indexOfEnumerator(type.toStdString().c_str())); | ||
| 771 | + value = metaEnum.value(enumIndex); | ||
| 772 | + } | ||
| 766 | } | 773 | } |
| 767 | 774 | ||
| 768 | if (!QObject::setProperty(qPrintable(name), value) && !type.isEmpty()) | 775 | if (!QObject::setProperty(qPrintable(name), value) && !type.isEmpty()) |
| 769 | - qFatal("Failed to set %s::%s to: %s", | ||
| 770 | - metaObject()->className(), qPrintable(name), qPrintable(value.toString())); | 776 | + qFatal("Failed to set %s %s::%s to: %s", |
| 777 | + qPrintable(type), metaObject()->className(), qPrintable(name), qPrintable(value.toString())); | ||
| 771 | } | 778 | } |
| 772 | 779 | ||
| 773 | QStringList Object::parse(const QString &string, char split) | 780 | QStringList Object::parse(const QString &string, char split) |
openbr/plugins/openbr_internal.h
| @@ -264,8 +264,7 @@ public: | @@ -264,8 +264,7 @@ public: | ||
| 264 | QString name = metaObject()->className(); | 264 | QString name = metaObject()->className(); |
| 265 | 265 | ||
| 266 | name.replace("Transform",""); | 266 | name.replace("Transform",""); |
| 267 | - name += "(["; | ||
| 268 | - name += "],"; | 267 | + name += "([],"; |
| 269 | 268 | ||
| 270 | QStringList parameters; | 269 | QStringList parameters; |
| 271 | 270 | ||
| @@ -278,11 +277,8 @@ public: | @@ -278,11 +277,8 @@ public: | ||
| 278 | name += parameters.join(","); | 277 | name += parameters.join(","); |
| 279 | 278 | ||
| 280 | name += ")"; | 279 | name += ")"; |
| 281 | - | ||
| 282 | name.replace("br::",""); | 280 | name.replace("br::",""); |
| 283 | 281 | ||
| 284 | - qDebug() << name; | ||
| 285 | - | ||
| 286 | CompositeTransform * output = dynamic_cast<CompositeTransform *>(Transform::make(name, NULL)); | 282 | CompositeTransform * output = dynamic_cast<CompositeTransform *>(Transform::make(name, NULL)); |
| 287 | 283 | ||
| 288 | if (output == NULL) | 284 | if (output == NULL) |
openbr/plugins/quality.cpp
| @@ -179,9 +179,6 @@ class MatchProbabilityDistance : public Distance | @@ -179,9 +179,6 @@ class MatchProbabilityDistance : public Distance | ||
| 179 | } | 179 | } |
| 180 | } | 180 | } |
| 181 | 181 | ||
| 182 | - qDebug() << "Genuines:" << genuineScores; | ||
| 183 | - qDebug() << "Impostors:" << impostorScores; | ||
| 184 | - | ||
| 185 | mp = MP(genuineScores, impostorScores); | 182 | mp = MP(genuineScores, impostorScores); |
| 186 | } | 183 | } |
| 187 | 184 |
openbr/plugins/stream.cpp
| @@ -253,8 +253,6 @@ public: | @@ -253,8 +253,6 @@ public: | ||
| 253 | 253 | ||
| 254 | bool getNextTemplate(Template & output) | 254 | bool getNextTemplate(Template & output) |
| 255 | { | 255 | { |
| 256 | - qDebug() << "Next as video"; | ||
| 257 | - | ||
| 258 | if (!isOpen()) { | 256 | if (!isOpen()) { |
| 259 | qDebug("video source is not open"); | 257 | qDebug("video source is not open"); |
| 260 | return false; | 258 | return false; |
| @@ -1060,8 +1058,6 @@ public: | @@ -1060,8 +1058,6 @@ public: | ||
| 1060 | if (src.empty()) | 1058 | if (src.empty()) |
| 1061 | return; | 1059 | return; |
| 1062 | 1060 | ||
| 1063 | - qDebug() << "Reading with mode:" << readMode; | ||
| 1064 | - | ||
| 1065 | bool res = readStage->dataSource.open(src,br::Idiocy::DistributeFrames); | 1061 | bool res = readStage->dataSource.open(src,br::Idiocy::DistributeFrames); |
| 1066 | if (!res) { | 1062 | if (!res) { |
| 1067 | qDebug("stream failed to open %s", qPrintable(dst[0].file.name)); | 1063 | qDebug("stream failed to open %s", qPrintable(dst[0].file.name)); |
| @@ -1210,8 +1206,6 @@ public: | @@ -1210,8 +1206,6 @@ public: | ||
| 1210 | // And the collection stage points to the read stage, because this is | 1206 | // And the collection stage points to the read stage, because this is |
| 1211 | // a ring buffer. | 1207 | // a ring buffer. |
| 1212 | collectionStage->nextStage = readStage; | 1208 | collectionStage->nextStage = readStage; |
| 1213 | - | ||
| 1214 | - qDebug() << "Init Readmode:" << readMode; | ||
| 1215 | } | 1209 | } |
| 1216 | 1210 | ||
| 1217 | DirectStreamTransform() | 1211 | DirectStreamTransform() |
| @@ -1329,7 +1323,6 @@ public: | @@ -1329,7 +1323,6 @@ public: | ||
| 1329 | basis.activeFrames = this->activeFrames; | 1323 | basis.activeFrames = this->activeFrames; |
| 1330 | basis.readMode = this->readMode; | 1324 | basis.readMode = this->readMode; |
| 1331 | 1325 | ||
| 1332 | - qDebug() << basis.readMode; | ||
| 1333 | // We need at least a CompositeTransform * to acess transform's children. | 1326 | // We need at least a CompositeTransform * to acess transform's children. |
| 1334 | CompositeTransform * downcast = dynamic_cast<CompositeTransform *> (transform); | 1327 | CompositeTransform * downcast = dynamic_cast<CompositeTransform *> (transform); |
| 1335 | 1328 |