Skip to content

Commit

Permalink
get rid of flip edit items
Browse files Browse the repository at this point in the history
  • Loading branch information
pfalstad committed Dec 8, 2024
1 parent ded6ed7 commit 58f00e1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 27 deletions.
24 changes: 7 additions & 17 deletions src/com/lushprojects/circuitjs1/client/ChipElm.java
Original file line number Diff line number Diff line change
Expand Up @@ -361,35 +361,25 @@ boolean hasGroundConnection(int n1) {
boolean isFlippedXY() { return hasFlag(FLAG_FLIP_XY); }

public EditInfo getEditInfo(int n) {
if (n == 0) {
EditInfo ei = new EditInfo("", 0, -1, -1);
ei.checkbox = new Checkbox("Flip X/Y", (flags & FLAG_FLIP_XY) != 0);
return ei;
}
if (!isDigitalChip())
return getChipEditInfo(n-1);
return getChipEditInfo(n);

if (n == 1)
if (n == 0)
return new EditInfo("High Logic Voltage", highVoltage);

return getChipEditInfo(n-2);
return getChipEditInfo(n-1);
}
public void setEditValue(int n, EditInfo ei) {
if (n == 0) {
flags = ei.changeFlag(flags, FLAG_FLIP_XY);
setPoints();
}
if (!isDigitalChip()) {
if (n >= 1)
setChipEditValue(n-1, ei);
setChipEditValue(n, ei);
return;
}

if (n == 1)
if (n == 0)
highVoltage = ei.value;

if (n >= 2)
setChipEditValue(n-2, ei);
if (n >= 1)
setChipEditValue(n-1, ei);
}

public EditInfo getChipEditInfo(int n) { return null; }
Expand Down
11 changes: 1 addition & 10 deletions src/com/lushprojects/circuitjs1/client/CustomCompositeElm.java
Original file line number Diff line number Diff line change
Expand Up @@ -198,12 +198,7 @@ public EditInfo getEditInfo(int n) {
ei.button = new Button(Locale.LS("Edit Pin Layout"));
return ei;
}
if (n == 2) {
EditInfo ei = new EditInfo("", 0, -1, -1);
ei.checkbox = new Checkbox("Flip X/Y", (flags & ChipElm.FLAG_FLIP_XY) != 0);
return ei;
}
if (n == 3 && model.canLoadModelCircuit()) {
if (n == 2 && model.canLoadModelCircuit()) {
EditInfo ei = new EditInfo("", 0, -1, -1);
ei.button = new Button(Locale.LS("Load Model Circuit"));
return ei;
Expand Down Expand Up @@ -234,10 +229,6 @@ public void setEditValue(int n, EditInfo ei) {
return;
}
if (n == 2) {
flags = ei.changeFlag(flags, ChipElm.FLAG_FLIP_XY);
setPoints();
}
if (n == 3) {
sim.readCircuit(model.modelCircuit);
CirSim.editDialog.closeDialog();
}
Expand Down

0 comments on commit 58f00e1

Please sign in to comment.