Mercurial > hg > svapp
comparison framework/Document.cpp @ 248:ecbf3b75c562
Debug output only
author | Chris Cannam |
---|---|
date | Fri, 07 Oct 2011 17:06:08 +0100 |
parents | dd14baa45847 |
children | 40a0fa9af6b4 068235cf5bf7 |
comparison
equal
deleted
inserted
replaced
247:1e9df8eac5ce | 248:ecbf3b75c562 |
---|---|
280 // model, or delete the layer for each layer that is currently | 280 // model, or delete the layer for each layer that is currently |
281 // using one of these. Carry out this replacement before we | 281 // using one of these. Carry out this replacement before we |
282 // delete any of the models. | 282 // delete any of the models. |
283 | 283 |
284 #ifdef DEBUG_DOCUMENT | 284 #ifdef DEBUG_DOCUMENT |
285 SVDEBUG << "Document::setMainModel: Have " | 285 std::cerr << "Document::setMainModel: Have " |
286 << m_layers.size() << " layers" << endl; | 286 << m_layers.size() << " layers" << std::endl; |
287 std::cerr << "Models now: "; | 287 std::cerr << "Models now: "; |
288 for (ModelMap::const_iterator i = m_models.begin(); i != m_models.end(); ++i) { | 288 for (ModelMap::const_iterator i = m_models.begin(); i != m_models.end(); ++i) { |
289 std::cerr << i->first << " "; | 289 std::cerr << i->first << " "; |
290 } | 290 } |
291 std::cerr << std::endl; | 291 std::cerr << std::endl; |
292 std::cerr << "Old main model: " << oldMainModel << std::endl; | |
292 #endif | 293 #endif |
293 | 294 |
294 for (LayerSet::iterator i = m_layers.begin(); i != m_layers.end(); ++i) { | 295 for (LayerSet::iterator i = m_layers.begin(); i != m_layers.end(); ++i) { |
295 | 296 |
296 Layer *layer = *i; | 297 Layer *layer = *i; |
297 Model *model = layer->getModel(); | 298 Model *model = layer->getModel(); |
298 | 299 |
299 #ifdef DEBUG_DOCUMENT | 300 #ifdef DEBUG_DOCUMENT |
300 SVDEBUG << "Document::setMainModel: inspecting model " | 301 std::cerr << "Document::setMainModel: inspecting model " |
301 << (model ? model->objectName(): "(null)") << " in layer " | 302 << (model ? model->objectName(): "(null)") << " in layer " |
302 << layer->objectName() << endl; | 303 << layer->objectName() << std::endl; |
303 #endif | 304 #endif |
304 | 305 |
305 if (model == oldMainModel) { | 306 if (model == oldMainModel) { |
306 #ifdef DEBUG_DOCUMENT | 307 #ifdef DEBUG_DOCUMENT |
307 std::cerr << "... it uses the old main model, replacing" << std::endl; | 308 std::cerr << "... it uses the old main model, replacing" << std::endl; |
365 emit modelRegenerationWarning(layer->objectName(), | 366 emit modelRegenerationWarning(layer->objectName(), |
366 transformId, | 367 transformId, |
367 message); | 368 message); |
368 } | 369 } |
369 #ifdef DEBUG_DOCUMENT | 370 #ifdef DEBUG_DOCUMENT |
370 SVDEBUG << "Replacing model " << model << " (type " | 371 std::cerr << "Replacing model " << model << " (type " |
371 << typeid(*model).name() << ") with model " | 372 << typeid(*model).name() << ") with model " |
372 << replacementModel << " (type " | 373 << replacementModel << " (type " |
373 << typeid(*replacementModel).name() << ") in layer " | 374 << typeid(*replacementModel).name() << ") in layer " |
374 << layer << " (name " << layer->objectName() << ")" | 375 << layer << " (name " << layer->objectName() << ")" |
375 << endl; | 376 << std::endl; |
376 #endif | 377 #endif |
377 RangeSummarisableTimeValueModel *rm = | 378 RangeSummarisableTimeValueModel *rm = |
378 dynamic_cast<RangeSummarisableTimeValueModel *>(replacementModel); | 379 dynamic_cast<RangeSummarisableTimeValueModel *>(replacementModel); |
379 #ifdef DEBUG_DOCUMENT | 380 #ifdef DEBUG_DOCUMENT |
380 if (rm) { | 381 if (rm) { |
436 << std::endl; | 437 << std::endl; |
437 return; | 438 return; |
438 } | 439 } |
439 | 440 |
440 #ifdef DEBUG_DOCUMENT | 441 #ifdef DEBUG_DOCUMENT |
441 SVDEBUG << "Document::addDerivedModel: source is " << input.getModel() << " \"" << input.getModel()->objectName() << "\"" << endl; | 442 if (input.getModel()) { |
443 std::cerr << "Document::addDerivedModel: source is " << input.getModel() << " \"" << input.getModel()->objectName() << "\"" << std::endl; | |
444 } else { | |
445 std::cerr << "Document::addDerivedModel: source is " << input.getModel() << std::endl; | |
446 } | |
442 #endif | 447 #endif |
443 | 448 |
444 ModelRecord rec; | 449 ModelRecord rec; |
445 rec.source = input.getModel(); | 450 rec.source = input.getModel(); |
446 rec.channel = input.getChannel(); | 451 rec.channel = input.getChannel(); |