Mercurial > hg > svapp
diff framework/Document.cpp @ 78:58bfaaed07ed
* Part of #1877436 transform fails to re-run when file loaded at different rate
author | Chris Cannam |
---|---|
date | Wed, 23 Jan 2008 18:09:50 +0000 |
parents | 0535c49069ba |
children | b1a68403714b |
line wrap: on
line diff
--- a/framework/Document.cpp Wed Jan 23 15:43:27 2008 +0000 +++ b/framework/Document.cpp Wed Jan 23 18:09:50 2008 +0000 @@ -205,11 +205,13 @@ Document::createDerivedLayer(const Transform &transform, const ModelTransformer::Input &input) { - Model *newModel = addDerivedModel(transform, input); + QString message; + Model *newModel = addDerivedModel(transform, input, message); if (!newModel) { - // error already printed to stderr by addDerivedModel - emit modelGenerationFailed(transform.getIdentifier()); + emit modelGenerationFailed(transform.getIdentifier(), message); return 0; + } else if (message != "") { + emit modelGenerationWarning(transform.getIdentifier(), message); } LayerFactory::LayerTypeSet types = @@ -317,11 +319,12 @@ //!!! We have a problem here if the number of channels in //the main model has changed. + QString message; Model *replacementModel = addDerivedModel(transform, ModelTransformer::Input - (m_mainModel, - m_models[model].channel)); + (m_mainModel, m_models[model].channel), + message); if (!replacementModel) { std::cerr << "WARNING: Document::setMainModel: Failed to regenerate model for transform \"" @@ -329,11 +332,17 @@ if (failedTransformers.find(transformId) == failedTransformers.end()) { emit modelRegenerationFailed(layer->objectName(), - transformId); + transformId, + message); failedTransformers.insert(transformId); } obsoleteLayers.push_back(layer); } else { + if (message != "") { + emit modelRegenerationWarning(layer->objectName(), + transformId, + message); + } #ifdef DEBUG_DOCUMENT std::cerr << "Replacing model " << model << " (type " << typeid(*model).name() << ") with model " @@ -428,7 +437,8 @@ Model * Document::addDerivedModel(const Transform &transform, - const ModelTransformer::Input &input) + const ModelTransformer::Input &input, + QString &message) { Model *model = 0; @@ -440,7 +450,8 @@ } } - model = ModelTransformerFactory::getInstance()->transform(transform, input); + model = ModelTransformerFactory::getInstance()->transform + (transform, input, message); if (!model) { std::cerr << "WARNING: Document::addDerivedModel: no output model for transform " << transform.getIdentifier().toStdString() << std::endl; @@ -787,11 +798,12 @@ ModelTransformerFactory *mtf = ModelTransformerFactory::getInstance(); - Model *transformOutput = mtf->transform(transform, aggregate); + QString message; + Model *transformOutput = mtf->transform(transform, aggregate, message); if (!transformOutput) { transform.setStepSize(0); - transformOutput = mtf->transform(transform, aggregate); + transformOutput = mtf->transform(transform, aggregate, message); } SparseTimeValueModel *path = dynamic_cast<SparseTimeValueModel *> @@ -799,6 +811,7 @@ if (!path) { std::cerr << "Document::alignModel: ERROR: Failed to create alignment path (no MATCH plugin?)" << std::endl; + emit alignmentFailed(id, message); delete transformOutput; delete aggregate; return;