sequential clock is configured to run at real time

This commit is contained in:
hneemann 2016-05-20 11:00:33 +02:00
parent 987a10f254
commit d85e242d0d
2 changed files with 10 additions and 7 deletions

View File

@ -277,7 +277,9 @@ public class Builder {
VisualElement clock = new VisualElement(Clock.DESCRIPTION.getName()) VisualElement clock = new VisualElement(Clock.DESCRIPTION.getName())
.setShapeFactory(shapeFactory) .setShapeFactory(shapeFactory)
.setPos(new Vector(x, yMin - SIZE * 3)); .setPos(new Vector(x, yMin - SIZE * 3));
clock.getElementAttributes().set(Keys.ROTATE, new Rotation(3)); clock.getElementAttributes()
.set(Keys.ROTATE, new Rotation(3))
.set(Keys.RUN_AT_REAL_TIME, true);
circuit.add(clock); circuit.add(clock);
} }

View File

@ -251,8 +251,9 @@ public class TableDialog extends JDialog {
int cols = model.getTable().getVars().size(); int cols = model.getTable().getVars().size();
reorderMenu.add(new JMenuItem(new ReorderAction(cols))); reorderMenu.add(new JMenuItem(new ReorderAction(cols)));
for (int i = 0; i < cols - 1; i++) { for (int i = 0; i < cols - 1; i++) {
reorderMenu.add(new JMenuItem(new ReorderAction(cols, i))); reorderMenu.add(new JMenuItem(new ReorderAction(cols, i, i + 1)));
} }
reorderMenu.add(new JMenuItem(new ReorderAction(cols, cols - 1, 0)));
calculateExpressions(); calculateExpressions();
} }
@ -367,15 +368,15 @@ public class TableDialog extends JDialog {
swap[cols - i - 1] = i; swap[cols - i - 1] = i;
} }
private ReorderAction(int cols, int swapIndex) { private ReorderAction(int cols, int swapIndex1, int swapIndex2) {
super(Lang.get("menu_table_swap_N1_N2", swapIndex, swapIndex + 1)); super(Lang.get("menu_table_swap_N1_N2", swapIndex1, swapIndex2));
swap = new int[cols]; swap = new int[cols];
for (int i = 0; i < cols; i++) for (int i = 0; i < cols; i++)
swap[i] = i; swap[i] = i;
int z = swap[swapIndex]; int z = swap[swapIndex1];
swap[swapIndex] = swap[swapIndex + 1]; swap[swapIndex1] = swap[swapIndex2];
swap[swapIndex + 1] = z; swap[swapIndex2] = z;
} }
@Override @Override