Correct a bug in the UpdateSession::close() mechanism.

* Bug: In Hurricane, UpdateSession::close(), when re-materializing, the
    cells must be notified <CellChanged> *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.
This commit is contained in:
Jean-Paul Chaput 2014-05-27 15:41:32 +02:00
parent 70b896fc96
commit 1e1495e294
3 changed files with 19 additions and 3 deletions

View File

@ -89,17 +89,25 @@ void UpdateSession::_destroy()
UPDATOR_STACK->pop(); UPDATOR_STACK->pop();
vector<Cell*> changedCells;
forEach( DBo*, iowner, getOwners() ) { forEach( DBo*, iowner, getOwners() ) {
Cell* cell = dynamic_cast<Cell*>(*iowner); Cell* cell = dynamic_cast<Cell*>(*iowner);
if (cell) { if (cell) {
//cerr << "Notify Cell::CellChanged to: " << cell << endl; //cerr << "Notify Cell::CellChanged to: " << cell << endl;
cell->notify( Cell::CellChanged ); changedCells.push_back( cell );
} else { } else {
Go* go = dynamic_cast<Go*>(*iowner); Go* go = dynamic_cast<Go*>(*iowner);
if (go) go->materialize(); 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(); Inherit::_preDestroy();
} }

View File

@ -186,6 +186,7 @@ namespace Mauka {
_viewer->clearToolInterrupt(); _viewer->clearToolInterrupt();
_viewer->getCellWidget()->fitToContents(); _viewer->getCellWidget()->fitToContents();
_viewer->redrawCellWidget();
} }
@ -198,10 +199,11 @@ namespace Mauka {
_viewer->getCellWidget()->fitToContents (); _viewer->getCellWidget()->fitToContents ();
mauka->Run (); mauka->Run ();
_viewer->redrawCellWidget();
} }
void GraphicMaukaEngine::place () void GraphicMaukaEngine::_place ()
{ {
if (MetisEngine::isHMetisCapable()) { if (MetisEngine::isHMetisCapable()) {
doQuadriPart(); doQuadriPart();
@ -211,7 +213,7 @@ namespace Mauka {
} }
doSimulatedAnnealing(); doSimulatedAnnealing();
save(); _save();
} }
@ -220,6 +222,7 @@ namespace Mauka {
MaukaEngine* mauka = getForFramework( NoFlags ); MaukaEngine* mauka = getForFramework( NoFlags );
_viewer->clearToolInterrupt (); _viewer->clearToolInterrupt ();
_viewer->redrawCellWidget();
mauka->Save (); mauka->Save ();
} }
@ -232,6 +235,10 @@ namespace Mauka {
{ ExceptionWidget::catchAllWrapper( std::bind(&GraphicMaukaEngine::_doSimulatedAnnealing,this) ); } { ExceptionWidget::catchAllWrapper( std::bind(&GraphicMaukaEngine::_doSimulatedAnnealing,this) ); }
void GraphicMaukaEngine::place ()
{ ExceptionWidget::catchAllWrapper( std::bind(&GraphicMaukaEngine::_place,this) ); }
void GraphicMaukaEngine::save () void GraphicMaukaEngine::save ()
{ ExceptionWidget::catchAllWrapper( std::bind(&GraphicMaukaEngine::_save,this) ); } { ExceptionWidget::catchAllWrapper( std::bind(&GraphicMaukaEngine::_save,this) ); }

View File

@ -83,6 +83,7 @@ namespace Mauka {
virtual ~GraphicMaukaEngine (); virtual ~GraphicMaukaEngine ();
void _doQuadriPart (); void _doQuadriPart ();
void _doSimulatedAnnealing (); void _doSimulatedAnnealing ();
void _place ();
void _save (); void _save ();
}; };