Search in sources :

Example 6 with FormatterException

use of de.neemann.digital.analyse.expression.format.FormatterException in project Digital by hneemann.

the class TableDialog method createCircuit.

private void createCircuit(boolean useJKff, ExpressionModifier... modifier) {
    try {
        CircuitBuilder circuitBuilder = new CircuitBuilder(shapeFactory, useJKff, model.getTable().getVars()).setModelAnalyzerInfo(model.getTable().getModelAnalyzerInfo());
        new BuilderExpressionCreator(circuitBuilder, modifier).setUseJKOptimizer(useJKff).create(lastGeneratedExpressions);
        Circuit circuit = circuitBuilder.createCircuit();
        new Main.MainBuilder().setParent(TableDialog.this).setLibrary(library).setCircuit(circuit).setBaseFileName(filename).openLater();
    } catch (ExpressionException | FormatterException | RuntimeException e) {
        new ErrorMessage(Lang.get("msg_errorDuringCalculation")).addCause(e).show(this);
    }
}
Also used : FormatterException(de.neemann.digital.analyse.expression.format.FormatterException) Circuit(de.neemann.digital.draw.elements.Circuit) ErrorMessage(de.neemann.gui.ErrorMessage) Main(de.neemann.digital.gui.Main) ExpressionException(de.neemann.digital.analyse.expression.ExpressionException) CircuitBuilder(de.neemann.digital.builder.circuit.CircuitBuilder)

Example 7 with FormatterException

use of de.neemann.digital.analyse.expression.format.FormatterException in project Digital by hneemann.

the class TableDialog method calculateExpressions.

private void calculateExpressions() {
    try {
        ExpressionListener expressionListener = new HTMLExpressionListener();
        if (createJK.isSelected())
            expressionListener = new ExpressionListenerJK(expressionListener);
        lastGeneratedExpressions = new ExpressionListenerStore(expressionListener);
        new ExpressionCreator(model.getTable()).create(lastGeneratedExpressions);
        kvMap.setResult(model.getTable(), lastGeneratedExpressions.getResults());
    } catch (ExpressionException | FormatterException | AnalyseException e1) {
        lastGeneratedExpressions = null;
        new ErrorMessage(Lang.get("msg_errorDuringCalculation")).addCause(e1).show(this);
    }
}
Also used : FormatterException(de.neemann.digital.analyse.expression.format.FormatterException) AnalyseException(de.neemann.digital.analyse.AnalyseException) ErrorMessage(de.neemann.gui.ErrorMessage) ExpressionException(de.neemann.digital.analyse.expression.ExpressionException)

Aggregations

FormatterException (de.neemann.digital.analyse.expression.format.FormatterException)7 ExpressionException (de.neemann.digital.analyse.expression.ExpressionException)4 Variable (de.neemann.digital.analyse.expression.Variable)3 AnalyseException (de.neemann.digital.analyse.AnalyseException)2 Expression (de.neemann.digital.analyse.expression.Expression)2 FormatToExpression (de.neemann.digital.analyse.expression.format.FormatToExpression)2 CircuitBuilder (de.neemann.digital.builder.circuit.CircuitBuilder)2 Circuit (de.neemann.digital.draw.elements.Circuit)2 Main (de.neemann.digital.gui.Main)2 ErrorMessage (de.neemann.gui.ErrorMessage)2 IOException (java.io.IOException)2 DetermineJKStateMachine (de.neemann.digital.analyse.DetermineJKStateMachine)1 TruthTable (de.neemann.digital.analyse.TruthTable)1 TruthTableTableModel (de.neemann.digital.analyse.TruthTableTableModel)1 FormatToTableLatex (de.neemann.digital.analyse.expression.format.FormatToTableLatex)1 ExpressionModifier (de.neemann.digital.analyse.expression.modify.ExpressionModifier)1 NAnd (de.neemann.digital.analyse.expression.modify.NAnd)1 NOr (de.neemann.digital.analyse.expression.modify.NOr)1 TwoInputs (de.neemann.digital.analyse.expression.modify.TwoInputs)1 TruthTableFormatterLaTeX (de.neemann.digital.analyse.format.TruthTableFormatterLaTeX)1