Fait tourner !

This commit is contained in:
Ludovic Jacomme 2002-04-16 15:06:52 +00:00
parent 30806dd628
commit 2dc1ef9993
3 changed files with 69 additions and 40 deletions

View File

@ -132,20 +132,34 @@ void XfsmSimplifyFigure( FsmFigure )
fsmfig_list *FsmFigure;
{
chain_list *ScanChain;
fsmfig_list *ScanFigure;
bddsystem *BddSystem;
bddcircuit *BddCircuit;
BddSystem = createbddsystem( XFSM_BDD_VAR_NODE,
XFSM_BDD_OPER_NODE, 1000, XFSM_BDD_MAX_NODE );
if ( ! IsFsmFigMulti( FsmFigure ) )
{
FsmFigure->MULTI = addchain( (chain_list *)0, FsmFigure );
}
reorderbddsystemdynamic( BddSystem, XFSM_BDD_REORDER_FUNC,
XFSM_BDD_REORDER_LOW, XFSM_BDD_REORDER_RATIO );
for ( ScanChain = FsmFigure->MULTI;
ScanChain != (chain_list *)0;
ScanChain = ScanChain->NEXT )
{
ScanFigure = (fsmfig_list *)ScanChain->DATA;
BddCircuit = XfsmMakeBddCircuit( BddSystem, FsmFigure );
convertfsmbddnodeabl( FsmFigure );
destroybddcircuit( BddCircuit );
destroybddsystem( BddSystem );
FsmFigure->CIRCUIT = (bddcircuit *)0;
BddSystem = createbddsystem( XFSM_BDD_VAR_NODE,
XFSM_BDD_OPER_NODE, 1000, XFSM_BDD_MAX_NODE );
reorderbddsystemdynamic( BddSystem, XFSM_BDD_REORDER_FUNC,
XFSM_BDD_REORDER_LOW, XFSM_BDD_REORDER_RATIO );
BddCircuit = XfsmMakeBddCircuit( BddSystem, ScanFigure );
convertfsmbddnodeabl( ScanFigure );
destroybddcircuit( BddCircuit );
destroybddsystem( BddSystem );
ScanFigure->CIRCUIT = (bddcircuit *)0;
}
}

View File

@ -166,7 +166,10 @@ fsmfig_list *Xfsmgetfsmfig( FileName )
if ( FigureFsm != (fsmfig_list *)NULL )
{
delfsmfig( FigureFsm->NAME );
while ( HEAD_FSMFIG != (fsmfig_list *)0 )
{
delfsmfig( HEAD_FSMFIG->NAME );
}
}
autend();

View File

@ -597,6 +597,8 @@ long XfsmPlaceState( FsmState, X, Y )
xfsmfig_list *XfsmAddFigure()
{
fsmfig_list *FigureFsm;
chain_list *ScanChain;
fsmstate_list *ScanState;
void *Pointer;
long X;
@ -609,39 +611,46 @@ xfsmfig_list *XfsmAddFigure()
X = 0;
XfsmScanStepX1 = 0;
XfsmScanStepX2 = 0;
if ( XfsmFigureFsm->FIRST_STATE != (fsmstate_list *)0 )
for ( ScanChain = XfsmFigureFsm->MULTI;
ScanChain != (chain_list *)0;
ScanChain = ScanChain->NEXT )
{
X = 15 + XfsmPlaceState( XfsmFigureFsm->FIRST_STATE, X, 0 );
}
FigureFsm = (fsmfig_list *)ScanChain->DATA;
if ( XfsmFigureFsm->STAR_STATE != (fsmstate_list *)0 )
{
ScanState = XfsmFigureFsm->STAR_STATE;
if ( ScanState->USER == (void *)0 )
if ( FigureFsm->FIRST_STATE != (fsmstate_list *)0 )
{
X = 15 + XfsmPlaceState( ScanState, X, 0 );
X = 15 + XfsmPlaceState( FigureFsm->FIRST_STATE, X, 0 );
}
}
for ( ScanState = XfsmFigureFsm->STATE;
ScanState != (fsmstate_list *)0;
ScanState = ScanState->NEXT )
{
if ( ScanState->USER == (void *)0 )
if ( FigureFsm->STAR_STATE != (fsmstate_list *)0 )
{
X = 15 + XfsmPlaceState( ScanState, X, 0 );
ScanState = FigureFsm->STAR_STATE;
if ( ScanState->USER == (void *)0 )
{
X = 15 + XfsmPlaceState( ScanState, X, 0 );
}
}
for ( ScanState = FigureFsm->STATE;
ScanState != (fsmstate_list *)0;
ScanState = ScanState->NEXT )
{
if ( ScanState->USER == (void *)0 )
{
X = 15 + XfsmPlaceState( ScanState, X, 0 );
}
}
for ( ScanState = FigureFsm->STATE;
ScanState != (fsmstate_list *)0;
ScanState = ScanState->NEXT )
{
Pointer = ScanState->USER;
ScanState->USER = (void *)(((xfsmcoord *)Pointer)->OBJECT);
autfreeheap( Pointer, sizeof( xfsmcoord ) );
}
}
for ( ScanState = XfsmFigureFsm->STATE;
ScanState != (fsmstate_list *)0;
ScanState = ScanState->NEXT )
{
Pointer = ScanState->USER;
ScanState->USER = (void *)(((xfsmcoord *)Pointer)->OBJECT);
autfreeheap( Pointer, sizeof( xfsmcoord ) );
}
autend();
@ -723,7 +732,10 @@ void XfsmDelFigure()
XfsmFreeFigure( XfsmFigure );
delfsmfig( XfsmFigureFsm->NAME );
while ( HEAD_FSMFIG != (fsmfig_list *)0 )
{
delfsmfig( HEAD_FSMFIG->NAME );
}
XfsmFigure = (xfsmfig_list *)0;
XfsmFigureFsm = (fsmfig_list *)0;