if (p != NULL) params.removeAll(p);
}
-void GroupBlock::initInputPattern() {
+void GroupBlock::createInputPattern() {
foreach(AbstractInterface* iface, getControlInputs()) {
ConnectedInterface* connIface = AI_TO_CON(iface);
QList<char>* pattern = new QList<char>(*(connIface->getConnectedFrom()->getOutputPattern()));
}
}
+bool GroupBlock::checkInputPatternCompatibility() {
+ return true;
+}
+
bool GroupBlock::computeOutputPattern(int nbExec) {
static QString fctName = "GroupBlock::computeOutputPattern()";
cout << "computing output pattern of group " << qPrintable(name) << endl;
bool canCompute = true;
+ bool compatible = true;
// get the input pattern on each inputs
- initInputPattern();
+ createInputPattern();
cout << "Input pattern OK" << endl;
// find blocks that are connected to that inputs and generators
while (!fifo.isEmpty()) {
AbstractBlock* block = fifo.takeFirst();
- if (block->getPatternComputed()) continue; // block has laready been processed
-
+ if (block->getPatternComputed()) continue; // block has already been processed
+
+ compatible = block->checkInputPatternCompatibility();
+ if (!compatible) {
+ cout << qPrintable(block->getName()) << " is not compatible with his input pattern" << endl;
+ break;
+ }
canCompute = block->computeOutputPattern();
if (!canCompute) {
cout << "cannot finalize output pattern computation of " << qPrintable(block->getName()) << endl;