mirror of
https://github.com/hneemann/Digital.git
synced 2025-09-28 23:45:17 -04:00
minor refactoring
This commit is contained in:
parent
bb03f7cdbd
commit
f90ca0b911
@ -95,19 +95,15 @@ public class ExpressionCreator {
|
|||||||
|
|
||||||
QuineMcCluskey qmc = new QuineMcCluskey(localVars)
|
QuineMcCluskey qmc = new QuineMcCluskey(localVars)
|
||||||
.fillTableWith(boolTable);
|
.fillTableWith(boolTable);
|
||||||
calcColumn(listener, qmc, resultName, localVars);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void calcColumn(ExpressionListener listener, QuineMcCluskey qmc, String name, List<Variable> vars) throws ExpressionException, FormatterException {
|
|
||||||
PrimeSelector ps = new PrimeSelectorDefault();
|
PrimeSelector ps = new PrimeSelectorDefault();
|
||||||
Expression e = qmc.simplify(ps).getExpression();
|
Expression e = qmc.simplify(ps).getExpression();
|
||||||
|
|
||||||
if (ps.getAllSolutions() != null) {
|
if (ps.getAllSolutions() != null) {
|
||||||
for (ArrayList<TableRow> i : ps.getAllSolutions()) {
|
for (ArrayList<TableRow> i : ps.getAllSolutions()) {
|
||||||
listener.resultFound(name, QuineMcCluskey.addAnd(null, i, vars));
|
listener.resultFound(resultName, QuineMcCluskey.addAnd(null, i, localVars));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
listener.resultFound(name, e);
|
listener.resultFound(resultName, e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user