Skip to content

Commit

Permalink
subcircuits containing various elements were not working. sharpie7#339
Browse files Browse the repository at this point in the history
  • Loading branch information
pfalstad committed Jun 8, 2019
1 parent 05363b4 commit 4c75c6f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/com/lushprojects/circuitjs1/client/CirSim.java
Original file line number Diff line number Diff line change
Expand Up @@ -4871,7 +4871,7 @@ public static CircuitElm constructElement(String n, int x1, int y1){
return (CircuitElm) new PolarCapacitorElm(x1, y1);
if (n=="InductorElm")
return (CircuitElm) new InductorElm(x1, y1);
if (n=="DCVoltageElm")
if (n=="DCVoltageElm" || n=="VoltageElm")
return (CircuitElm) new DCVoltageElm(x1, y1);
if (n=="VarRailElm")
return (CircuitElm) new VarRailElm(x1, y1);
Expand Down Expand Up @@ -4929,11 +4929,11 @@ public static CircuitElm constructElement(String n, int x1, int y1){
return (CircuitElm) new OpAmpElm(x1, y1);
if (n=="OpAmpSwapElm")
return (CircuitElm) new OpAmpSwapElm(x1, y1);
if (n=="NMosfetElm")
if (n=="NMosfetElm" || n == "MosfetElm")
return (CircuitElm) new NMosfetElm(x1, y1);
if (n=="PMosfetElm")
return (CircuitElm) new PMosfetElm(x1, y1);
if (n=="NJfetElm")
if (n=="NJfetElm" || n == "JfetElm")
return (CircuitElm) new NJfetElm(x1, y1);
if (n=="PJfetElm")
return (CircuitElm) new PJfetElm(x1, y1);
Expand Down Expand Up @@ -5036,7 +5036,7 @@ public static CircuitElm constructElement(String n, int x1, int y1){
return (CircuitElm) new DataRecorderElm(x1, y1);
if (n=="AudioOutputElm")
return (CircuitElm) new AudioOutputElm(x1, y1);
if (n=="NDarlingtonElm")
if (n=="NDarlingtonElm" || n == "DarlingtonElm")
return (CircuitElm) new NDarlingtonElm(x1, y1);
if (n=="PDarlingtonElm")
return (CircuitElm) new PDarlingtonElm(x1, y1);
Expand Down Expand Up @@ -5309,7 +5309,8 @@ public CustomCompositeModel getCircuitAsComposite() {
CircuitElm ce = getElm(i);
if (sel && !ce.isSelected())
continue;
if (ce instanceof WireElm || ce instanceof LabeledNodeElm)
// don't need these elements dumped
if (ce instanceof WireElm || ce instanceof LabeledNodeElm || ce instanceof ScopeElm)
continue;
if (ce instanceof GraphicElm)
continue;
Expand Down

0 comments on commit 4c75c6f

Please sign in to comment.