From 1e1495e2942a0702ce83ca040fd74e1fe6b22359 Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Tue, 27 May 2014 15:41:32 +0200 Subject: [PATCH] Correct a bug in the UpdateSession::close() mechanism. * Bug: In Hurricane, UpdateSession::close(), when re-materializing, the cells must be notified *after* all the Gos are re-materializeds. In fact they must also revalided according to the deepness of their instanciation (the deepest first). Has still to be done. --- hurricane/src/hurricane/UpdateSession.cpp | 10 +++++++++- mauka/src/GraphicMaukaEngine.cpp | 11 +++++++++-- mauka/src/mauka/GraphicMaukaEngine.h | 1 + 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/hurricane/src/hurricane/UpdateSession.cpp b/hurricane/src/hurricane/UpdateSession.cpp index 2e9ad563..58356709 100644 --- a/hurricane/src/hurricane/UpdateSession.cpp +++ b/hurricane/src/hurricane/UpdateSession.cpp @@ -89,17 +89,25 @@ void UpdateSession::_destroy() UPDATOR_STACK->pop(); + vector changedCells; forEach( DBo*, iowner, getOwners() ) { Cell* cell = dynamic_cast(*iowner); if (cell) { //cerr << "Notify Cell::CellChanged to: " << cell << endl; - cell->notify( Cell::CellChanged ); + changedCells.push_back( cell ); } else { Go* go = dynamic_cast(*iowner); if (go) go->materialize(); } } + // Changed cells must be notified *after* all the Gos are materialized. + // They also should be sorted according to their hierarchical depth and + // revalidated bottom-up (TODO). + for ( auto icell : changedCells ) { + icell->notify( Cell::CellChanged ); + } + Inherit::_preDestroy(); } diff --git a/mauka/src/GraphicMaukaEngine.cpp b/mauka/src/GraphicMaukaEngine.cpp index 2e173d34..432f60e0 100644 --- a/mauka/src/GraphicMaukaEngine.cpp +++ b/mauka/src/GraphicMaukaEngine.cpp @@ -186,6 +186,7 @@ namespace Mauka { _viewer->clearToolInterrupt(); _viewer->getCellWidget()->fitToContents(); + _viewer->redrawCellWidget(); } @@ -198,10 +199,11 @@ namespace Mauka { _viewer->getCellWidget()->fitToContents (); mauka->Run (); + _viewer->redrawCellWidget(); } - void GraphicMaukaEngine::place () + void GraphicMaukaEngine::_place () { if (MetisEngine::isHMetisCapable()) { doQuadriPart(); @@ -211,7 +213,7 @@ namespace Mauka { } doSimulatedAnnealing(); - save(); + _save(); } @@ -220,6 +222,7 @@ namespace Mauka { MaukaEngine* mauka = getForFramework( NoFlags ); _viewer->clearToolInterrupt (); + _viewer->redrawCellWidget(); mauka->Save (); } @@ -232,6 +235,10 @@ namespace Mauka { { ExceptionWidget::catchAllWrapper( std::bind(&GraphicMaukaEngine::_doSimulatedAnnealing,this) ); } + void GraphicMaukaEngine::place () + { ExceptionWidget::catchAllWrapper( std::bind(&GraphicMaukaEngine::_place,this) ); } + + void GraphicMaukaEngine::save () { ExceptionWidget::catchAllWrapper( std::bind(&GraphicMaukaEngine::_save,this) ); } diff --git a/mauka/src/mauka/GraphicMaukaEngine.h b/mauka/src/mauka/GraphicMaukaEngine.h index a69567e8..1f3181cc 100644 --- a/mauka/src/mauka/GraphicMaukaEngine.h +++ b/mauka/src/mauka/GraphicMaukaEngine.h @@ -83,6 +83,7 @@ namespace Mauka { virtual ~GraphicMaukaEngine (); void _doQuadriPart (); void _doSimulatedAnnealing (); + void _place (); void _save (); };