Search in sources :

Example 1 with CircuitBuilder

use of de.neemann.digital.builder.circuit.CircuitBuilder in project Digital by hneemann.

the class BuilderExpressionCreatorTest method create.

private Model create(ExpressionListenerStore els, ExpressionModifier modifier) throws ExpressionException, FormatterException, ElementNotFoundException, PinException, NodeException {
    CircuitBuilder circuitBuilder = new CircuitBuilder(shapeFactory, false);
    new BuilderExpressionCreator(circuitBuilder, modifier).create(els);
    return new ModelCreator(circuitBuilder.createCircuit(), libary).createModel(false);
}
Also used : ModelCreator(de.neemann.digital.draw.model.ModelCreator) CircuitBuilder(de.neemann.digital.builder.circuit.CircuitBuilder)

Example 2 with CircuitBuilder

use of de.neemann.digital.builder.circuit.CircuitBuilder in project Digital by hneemann.

the class TestResultTest method getModel.

private Model getModel(String func) throws IOException, ParseException, BuilderException, PinException, NodeException, ElementNotFoundException {
    ArrayList<Expression> exp = new Parser(func).parse();
    ElementLibrary library = new ElementLibrary();
    CircuitBuilder cb = new CircuitBuilder(new ShapeFactory(library));
    cb.addCombinatorial("Y", exp.get(0));
    Circuit circ = cb.createCircuit();
    Model model = new ModelCreator(circ, library).createModel(false);
    model.init();
    return model;
}
Also used : ElementLibrary(de.neemann.digital.draw.library.ElementLibrary) Expression(de.neemann.digital.analyse.expression.Expression) Model(de.neemann.digital.core.Model) ShapeFactory(de.neemann.digital.draw.shapes.ShapeFactory) Circuit(de.neemann.digital.draw.elements.Circuit) ModelCreator(de.neemann.digital.draw.model.ModelCreator) Parser(de.neemann.digital.analyse.parser.Parser) CircuitBuilder(de.neemann.digital.builder.circuit.CircuitBuilder)

Example 3 with CircuitBuilder

use of de.neemann.digital.builder.circuit.CircuitBuilder 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)

Aggregations

CircuitBuilder (de.neemann.digital.builder.circuit.CircuitBuilder)3 Circuit (de.neemann.digital.draw.elements.Circuit)2 ModelCreator (de.neemann.digital.draw.model.ModelCreator)2 Expression (de.neemann.digital.analyse.expression.Expression)1 ExpressionException (de.neemann.digital.analyse.expression.ExpressionException)1 FormatterException (de.neemann.digital.analyse.expression.format.FormatterException)1 Parser (de.neemann.digital.analyse.parser.Parser)1 Model (de.neemann.digital.core.Model)1 ElementLibrary (de.neemann.digital.draw.library.ElementLibrary)1 ShapeFactory (de.neemann.digital.draw.shapes.ShapeFactory)1 Main (de.neemann.digital.gui.Main)1 ErrorMessage (de.neemann.gui.ErrorMessage)1