Supress 2nd Wertetabelle if no hazard was found
This commit is contained in:
parent
1325c11caa
commit
e1614a62e6
3 changed files with 7 additions and 3 deletions
|
@ -47,6 +47,7 @@ void CellCollection::findHazards()
|
||||||
printf("Hazard found! Cell %d <--> Cell %d\n", I, (*nc)->index);
|
printf("Hazard found! Cell %d <--> Cell %d\n", I, (*nc)->index);
|
||||||
this->globalPIC->add(I, (*nc)->index); // add PI that solves hazard. Not quite smart...
|
this->globalPIC->add(I, (*nc)->index); // add PI that solves hazard. Not quite smart...
|
||||||
(*nc)->refresh(this->globalPIC); // refresh the foreign PIC (a PI was added)
|
(*nc)->refresh(this->globalPIC); // refresh the foreign PIC (a PI was added)
|
||||||
|
this->hazardsFound = true;
|
||||||
}
|
}
|
||||||
currentCell->refresh(this->globalPIC); // refresh the current PIC (a PI was added)
|
currentCell->refresh(this->globalPIC); // refresh the current PIC (a PI was added)
|
||||||
delete hazardousNeighbors;
|
delete hazardousNeighbors;
|
||||||
|
|
|
@ -27,11 +27,13 @@ public:
|
||||||
CellCollection(PrimImplikantCollection* &globalPIC)
|
CellCollection(PrimImplikantCollection* &globalPIC)
|
||||||
{
|
{
|
||||||
this->init(globalPIC);
|
this->init(globalPIC);
|
||||||
|
this->hazardsFound = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
vector<Cell*> cells;
|
vector<Cell*> cells;
|
||||||
PrimImplikantCollection* globalPIC;
|
PrimImplikantCollection* globalPIC;
|
||||||
|
bool hazardsFound;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -162,8 +162,9 @@ void user_main(void)
|
||||||
allCells->findHazards();
|
allCells->findHazards();
|
||||||
|
|
||||||
|
|
||||||
// print Wertetabelle and KV of corrected data
|
if (allCells->hazardsFound)
|
||||||
wt->Print();
|
// print Wertetabelle and KV of corrected data
|
||||||
|
wt->Print();
|
||||||
|
|
||||||
kv->Print(30 + kv->width() + 30, 30); // Diagramm neben dem vorherigen
|
kv->Print(30 + kv->width() + 30, 30); // Diagramm neben dem vorherigen
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue