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