mirror of
https://github.com/hneemann/Digital.git
synced 2025-09-15 15:58:41 -04:00
fixed some syncing issues
This commit is contained in:
parent
806d594845
commit
b8abd2440c
@ -454,6 +454,7 @@ public class CircuitBuilder implements BuilderInterface<CircuitBuilder> {
|
||||
|
||||
private int createStateVar(int splitterXPos, int y, Circuit circuit, String name) {
|
||||
ArrayList<Variable> outputs = sequentialVars;
|
||||
outputs.sort(Comparator.comparing(Variable::getIdentifier));
|
||||
|
||||
circuit.add(new VisualElement(Splitter.DESCRIPTION.getName())
|
||||
.setAttribute(Keys.OUTPUT_SPLIT, "" + outputs.size())
|
||||
@ -472,7 +473,7 @@ public class CircuitBuilder implements BuilderInterface<CircuitBuilder> {
|
||||
|
||||
for (int i = 0; i < outputs.size(); i++) {
|
||||
circuit.add(new VisualElement(Tunnel.DESCRIPTION.getName())
|
||||
.setAttribute(Keys.NETNAME, outputs.get(outputs.size()-i-1).getIdentifier())
|
||||
.setAttribute(Keys.NETNAME, outputs.get(i).getIdentifier())
|
||||
.setRotation(2)
|
||||
.setPos(new Vector(splitterXPos - SIZE, y + i * SIZE))
|
||||
.setShapeFactory(shapeFactory));
|
||||
|
@ -77,7 +77,8 @@ public class Transition extends Movable<Transition> {
|
||||
|
||||
if (!isInitialTransition()) {
|
||||
for (State s : states)
|
||||
addRepulsive(s.getPos(), 2000);
|
||||
if (s != fromState && s != toState)
|
||||
addRepulsive(s.getPos(), 2000);
|
||||
|
||||
for (Transition t : transitions)
|
||||
if (t != this)
|
||||
|
@ -60,8 +60,7 @@ public class ReorderInputs {
|
||||
*/
|
||||
public TruthTable reorder() throws ExpressionException {
|
||||
ArrayList<Variable> newVars = new ArrayList<>();
|
||||
ArrayList<Variable> deletedVars = new ArrayList<>();
|
||||
deletedVars.addAll(table.getVars());
|
||||
ArrayList<Variable> deletedVars = new ArrayList<>(table.getVars());
|
||||
|
||||
for (String name : names) {
|
||||
Variable found = null;
|
||||
@ -81,6 +80,7 @@ public class ReorderInputs {
|
||||
throw new ExpressionException(Lang.get("err_tableBecomesToSmall"));
|
||||
|
||||
TruthTable newTable = new TruthTable(newVars);
|
||||
newTable.setModelAnalyzerInfo(table.getModelAnalyzerInfo());
|
||||
for (int j = 0; j < table.getResultCount(); j++)
|
||||
newTable.addResult(table.getResultName(j));
|
||||
|
||||
|
@ -58,6 +58,7 @@ public class ReorderOutputs {
|
||||
*/
|
||||
public TruthTable reorder() throws ExpressionException {
|
||||
TruthTable newTable = new TruthTable(table.getVars());
|
||||
newTable.setModelAnalyzerInfo(table.getModelAnalyzerInfo());
|
||||
for (String name : names) {
|
||||
for (int i = 0; i < table.getResultCount(); i++)
|
||||
if (table.getResultName(i).equals(name)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user