RENAME: removed Part- prefix from parts
This commit is contained in:
parent
698c6b2509
commit
42de5cd032
@ -15,6 +15,7 @@ import java.io.File;
|
|||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.time.ZonedDateTime;
|
import java.time.ZonedDateTime;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
@ -103,7 +104,7 @@ public class Circuit {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
final File file = new File("./data/circuit.json");
|
final File file = new File("./data/%s.json".formatted(created.format(DateTimeFormatter.ISO_OFFSET_DATE_TIME)));
|
||||||
if (file.getParentFile().mkdirs()) {
|
if (file.getParentFile().mkdirs()) {
|
||||||
log.info("Directory created: {}", file.getParent());
|
log.info("Directory created: {}", file.getParent());
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
package de.ph87.electro.circuit;
|
package de.ph87.electro.circuit;
|
||||||
|
|
||||||
import de.ph87.electro.circuit.part.parts.PartBattery;
|
import de.ph87.electro.circuit.part.parts.Battery;
|
||||||
import de.ph87.electro.circuit.part.parts.PartLight;
|
import de.ph87.electro.circuit.part.parts.Light;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
@ -19,8 +19,8 @@ public class CircuitPanel extends JPanel {
|
|||||||
|
|
||||||
public CircuitPanel() {
|
public CircuitPanel() {
|
||||||
new CircuitPanelDropTarget(this, circuit);
|
new CircuitPanelDropTarget(this, circuit);
|
||||||
final PartBattery battery = circuit.addPart(new PartBattery(RST(0, 0)));
|
final Battery battery = circuit.addPart(new Battery(RST(0, 0)));
|
||||||
final PartLight light = circuit.addPart(new PartLight(RST(0, 1)));
|
final Light light = circuit.addPart(new Light(RST(0, 1)));
|
||||||
circuit.connect(battery.getMinus(), light.getA());
|
circuit.connect(battery.getMinus(), light.getA());
|
||||||
circuit.connect(light.getB(), battery.getPlus());
|
circuit.connect(light.getB(), battery.getPlus());
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,22 +22,22 @@ public class CircuitPanelDropTarget extends AbstractDropTarget {
|
|||||||
@Override
|
@Override
|
||||||
protected boolean drop(final Point point, final String data) {
|
protected boolean drop(final Point point, final String data) {
|
||||||
final Position position = new Position(point);
|
final Position position = new Position(point);
|
||||||
if (data.equals(PartBattery.class.getSimpleName())) {
|
if (data.equals(Battery.class.getSimpleName())) {
|
||||||
circuit.addPart(new PartBattery(position));
|
circuit.addPart(new Battery(position));
|
||||||
} else if (data.equals(PartJunctionCorner.class.getSimpleName())) {
|
} else if (data.equals(ConnectorCorner.class.getSimpleName())) {
|
||||||
circuit.addPart(new PartJunctionCorner(position));
|
circuit.addPart(new ConnectorCorner(position));
|
||||||
} else if (data.equals(PartJunctionEdge.class.getSimpleName())) {
|
} else if (data.equals(ConnectorEdge.class.getSimpleName())) {
|
||||||
circuit.addPart(new PartJunctionEdge(position));
|
circuit.addPart(new ConnectorEdge(position));
|
||||||
} else if (data.equals(PartJunctionMiddle.class.getSimpleName())) {
|
} else if (data.equals(ConnectorMiddle.class.getSimpleName())) {
|
||||||
circuit.addPart(new PartJunctionMiddle(position));
|
circuit.addPart(new ConnectorMiddle(position));
|
||||||
} else if (data.equals(PartLight.class.getSimpleName())) {
|
} else if (data.equals(Light.class.getSimpleName())) {
|
||||||
circuit.addPart(new PartLight(position));
|
circuit.addPart(new Light(position));
|
||||||
} else if (data.equals(PartSwitch1x1.class.getSimpleName())) {
|
} else if (data.equals(Switch1x1.class.getSimpleName())) {
|
||||||
circuit.addPart(new PartSwitch1x1(position));
|
circuit.addPart(new Switch1x1(position));
|
||||||
} else if (data.equals(PartSwitch1x2.class.getSimpleName())) {
|
} else if (data.equals(Switch1x2.class.getSimpleName())) {
|
||||||
circuit.addPart(new PartSwitch1x2(position));
|
circuit.addPart(new Switch1x2(position));
|
||||||
} else if (data.equals(PartSwitchCross.class.getSimpleName())) {
|
} else if (data.equals(SwitchCross.class.getSimpleName())) {
|
||||||
circuit.addPart(new PartSwitchCross(position));
|
circuit.addPart(new SwitchCross(position));
|
||||||
} else {
|
} else {
|
||||||
throw new RuntimeException();
|
throw new RuntimeException();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,8 +4,8 @@ import de.ph87.electro.circuit.Circuit;
|
|||||||
import de.ph87.electro.circuit.part.InnerConnection;
|
import de.ph87.electro.circuit.part.InnerConnection;
|
||||||
import de.ph87.electro.circuit.part.Part;
|
import de.ph87.electro.circuit.part.Part;
|
||||||
import de.ph87.electro.circuit.part.junction.Junction;
|
import de.ph87.electro.circuit.part.junction.Junction;
|
||||||
import de.ph87.electro.circuit.part.parts.PartBattery;
|
import de.ph87.electro.circuit.part.parts.Battery;
|
||||||
import de.ph87.electro.circuit.part.parts.PartLight;
|
import de.ph87.electro.circuit.part.parts.Light;
|
||||||
import de.ph87.electro.circuit.wire.Wire;
|
import de.ph87.electro.circuit.wire.Wire;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.NonNull;
|
import lombok.NonNull;
|
||||||
@ -41,13 +41,13 @@ public class Calculation {
|
|||||||
|
|
||||||
public static List<Calculation> calculate(final Circuit circuit) {
|
public static List<Calculation> calculate(final Circuit circuit) {
|
||||||
final List<Calculation> calculations = new ArrayList<>();
|
final List<Calculation> calculations = new ArrayList<>();
|
||||||
final List<PartBattery> batteries = new ArrayList<>(circuit.streamParts().flatMap(PartBattery::filterCast).toList());
|
final List<Battery> batteries = new ArrayList<>(circuit.streamParts().flatMap(Battery::filterCast).toList());
|
||||||
while (!batteries.isEmpty()) {
|
while (!batteries.isEmpty()) {
|
||||||
final PartBattery pivot = batteries.removeFirst();
|
final Battery pivot = batteries.removeFirst();
|
||||||
final Set<Junction> connectedJunctions = new HashSet<>();
|
final Set<Junction> connectedJunctions = new HashSet<>();
|
||||||
pivot.getPlus().collectConnectedJunctions(connectedJunctions);
|
pivot.getPlus().collectConnectedJunctions(connectedJunctions);
|
||||||
pivot.getMinus().collectConnectedJunctions(connectedJunctions);
|
pivot.getMinus().collectConnectedJunctions(connectedJunctions);
|
||||||
connectedJunctions.stream().map(Junction::getOwner).flatMap(PartBattery::filterCast).forEach(batteries::remove);
|
connectedJunctions.stream().map(Junction::getOwner).flatMap(Battery::filterCast).forEach(batteries::remove);
|
||||||
calculations.add(new Calculation(connectedJunctions, pivot));
|
calculations.add(new Calculation(connectedJunctions, pivot));
|
||||||
}
|
}
|
||||||
return calculations;
|
return calculations;
|
||||||
@ -58,7 +58,7 @@ public class Calculation {
|
|||||||
currents = new ArrayRealVector(numNodes);
|
currents = new ArrayRealVector(numNodes);
|
||||||
}
|
}
|
||||||
|
|
||||||
private Calculation(final Set<Junction> connectedJunctions, final PartBattery pivot) {
|
private Calculation(final Set<Junction> connectedJunctions, final Battery pivot) {
|
||||||
for (final Junction junction : connectedJunctions) {
|
for (final Junction junction : connectedJunctions) {
|
||||||
parts.add(junction.getOwner());
|
parts.add(junction.getOwner());
|
||||||
if (!junctions.contains(junction) && junction != pivot.getMinus()) {
|
if (!junctions.contains(junction) && junction != pivot.getMinus()) {
|
||||||
@ -83,9 +83,9 @@ public class Calculation {
|
|||||||
for (final InnerConnection innerConnection : part.getInnerConnections()) {
|
for (final InnerConnection innerConnection : part.getInnerConnections()) {
|
||||||
addResistor(innerConnection.a, innerConnection.b, innerConnection.resistance);
|
addResistor(innerConnection.a, innerConnection.b, innerConnection.resistance);
|
||||||
}
|
}
|
||||||
if (part instanceof final PartBattery battery) {
|
if (part instanceof final Battery battery) {
|
||||||
addBattery(battery);
|
addBattery(battery);
|
||||||
} else if (part instanceof final PartLight light) {
|
} else if (part instanceof final Light light) {
|
||||||
addResistor(light.getA(), light.getB(), light.getResistance());
|
addResistor(light.getA(), light.getB(), light.getResistance());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -148,7 +148,7 @@ public class Calculation {
|
|||||||
potentials = null;
|
potentials = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addBattery(final PartBattery battery) {
|
public void addBattery(final Battery battery) {
|
||||||
final double current = battery.getVoltage() / battery.getResistance();
|
final double current = battery.getVoltage() / battery.getResistance();
|
||||||
final int indexMinus = getJunctionIndex(battery.getMinus());
|
final int indexMinus = getJunctionIndex(battery.getMinus());
|
||||||
final int indexPlus = getJunctionIndex(battery.getPlus());
|
final int indexPlus = getJunctionIndex(battery.getPlus());
|
||||||
|
|||||||
@ -118,14 +118,14 @@ public abstract class Part {
|
|||||||
|
|
||||||
public static Part of(final PartDto abstractDto) {
|
public static Part of(final PartDto abstractDto) {
|
||||||
return switch (abstractDto) {
|
return switch (abstractDto) {
|
||||||
case final PartBatteryDto dto -> new PartBattery(dto);
|
case final BatteryDto dto -> new Battery(dto);
|
||||||
case final PartJunctionCornerDto dto -> new PartJunctionCorner(dto);
|
case final ConnectorCornerDto dto -> new ConnectorCorner(dto);
|
||||||
case final PartJunctionEdgeDto dto -> new PartJunctionEdge(dto);
|
case final ConnectorEdgeDto dto -> new ConnectorEdge(dto);
|
||||||
case final PartJunctionMiddleDto dto -> new PartJunctionMiddle(dto);
|
case final ConnectorMiddleDto dto -> new ConnectorMiddle(dto);
|
||||||
case final PartLightDto dto -> new PartLight(dto);
|
case final LightDto dto -> new Light(dto);
|
||||||
case final PartSwitch1x1Dto dto -> new PartSwitch1x1(dto);
|
case final Switch1x1Dto dto -> new Switch1x1(dto);
|
||||||
case final PartSwitch1x2Dto dto -> new PartSwitch1x2(dto);
|
case final Switch1x2Dto dto -> new Switch1x2(dto);
|
||||||
case final PartSwitchCrossDto dto -> new PartSwitchCross(dto);
|
case final SwitchCrossDto dto -> new SwitchCross(dto);
|
||||||
case null, default -> throw new RuntimeException();
|
case null, default -> throw new RuntimeException();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@ -31,14 +31,14 @@ public abstract class PartDto {
|
|||||||
|
|
||||||
public static PartDto of(final Part abstractPart) {
|
public static PartDto of(final Part abstractPart) {
|
||||||
return switch (abstractPart) {
|
return switch (abstractPart) {
|
||||||
case final PartBattery part -> new PartBatteryDto(part);
|
case final Battery part -> new BatteryDto(part);
|
||||||
case final PartJunctionCorner part -> new PartJunctionCornerDto(part);
|
case final ConnectorCorner part -> new ConnectorCornerDto(part);
|
||||||
case final PartJunctionEdge part -> new PartJunctionEdgeDto(part);
|
case final ConnectorEdge part -> new ConnectorEdgeDto(part);
|
||||||
case final PartJunctionMiddle part -> new PartJunctionMiddleDto(part);
|
case final ConnectorMiddle part -> new ConnectorMiddleDto(part);
|
||||||
case final PartLight part -> new PartLightDto(part);
|
case final Light part -> new LightDto(part);
|
||||||
case final PartSwitch1x1 part -> new PartSwitch1x1Dto(part);
|
case final Switch1x1 part -> new Switch1x1Dto(part);
|
||||||
case final PartSwitch1x2 part -> new PartSwitch1x2Dto(part);
|
case final Switch1x2 part -> new Switch1x2Dto(part);
|
||||||
case final PartSwitchCross part -> new PartSwitchCrossDto(part);
|
case final SwitchCross part -> new SwitchCrossDto(part);
|
||||||
case null, default -> throw new RuntimeException();
|
case null, default -> throw new RuntimeException();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@ -16,7 +16,7 @@ import static de.ph87.electro.circuit.part.Position.ABS;
|
|||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@ToString(callSuper = true, onlyExplicitlyIncluded = true)
|
@ToString(callSuper = true, onlyExplicitlyIncluded = true)
|
||||||
public class PartBattery extends Part {
|
public class Battery extends Part {
|
||||||
|
|
||||||
private static final double MINUS_W = 0.1 * RASTER;
|
private static final double MINUS_W = 0.1 * RASTER;
|
||||||
|
|
||||||
@ -40,13 +40,13 @@ public class PartBattery extends Part {
|
|||||||
@ToString.Include
|
@ToString.Include
|
||||||
private double resistance = 0.05;
|
private double resistance = 0.05;
|
||||||
|
|
||||||
public PartBattery(final Position position) {
|
public Battery(final Position position) {
|
||||||
super("Batterie", position);
|
super("Batterie", position);
|
||||||
minus = newJunction(this, "MINUS", P10, P50);
|
minus = newJunction(this, "MINUS", P10, P50);
|
||||||
plus = newJunction(this, "PLUS", P90, P50);
|
plus = newJunction(this, "PLUS", P90, P50);
|
||||||
}
|
}
|
||||||
|
|
||||||
public PartBattery(final PartBatteryDto dto) {
|
public Battery(final BatteryDto dto) {
|
||||||
super(dto);
|
super(dto);
|
||||||
minus = newJunction(this, dto.getMinus(), P10, P50);
|
minus = newJunction(this, dto.getMinus(), P10, P50);
|
||||||
plus = newJunction(this, dto.getPlus(), P90, P50);
|
plus = newJunction(this, dto.getPlus(), P90, P50);
|
||||||
@ -75,8 +75,8 @@ public class PartBattery extends Part {
|
|||||||
render.textCenter(LABEL_FONT, "%.1fV".formatted(voltage), x, y0, Color.BLACK);
|
render.textCenter(LABEL_FONT, "%.1fV".formatted(voltage), x, y0, Color.BLACK);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Stream<PartBattery> filterCast(final Part part) {
|
public static Stream<Battery> filterCast(final Part part) {
|
||||||
if (part instanceof final PartBattery battery) {
|
if (part instanceof final Battery battery) {
|
||||||
return Stream.of(battery);
|
return Stream.of(battery);
|
||||||
}
|
}
|
||||||
return Stream.empty();
|
return Stream.empty();
|
||||||
@ -9,7 +9,7 @@ import lombok.ToString;
|
|||||||
@Getter
|
@Getter
|
||||||
@ToString
|
@ToString
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
public class PartBatteryDto extends PartDto {
|
public class BatteryDto extends PartDto {
|
||||||
|
|
||||||
private JunctionDto minus;
|
private JunctionDto minus;
|
||||||
|
|
||||||
@ -17,11 +17,11 @@ public class PartBatteryDto extends PartDto {
|
|||||||
|
|
||||||
private double voltage;
|
private double voltage;
|
||||||
|
|
||||||
public PartBatteryDto(final PartBattery partBattery) {
|
public BatteryDto(final Battery battery) {
|
||||||
super(partBattery);
|
super(battery);
|
||||||
this.minus = new JunctionDto(partBattery.getMinus());
|
this.minus = new JunctionDto(battery.getMinus());
|
||||||
this.plus = new JunctionDto(partBattery.getPlus());
|
this.plus = new JunctionDto(battery.getPlus());
|
||||||
this.voltage = partBattery.getVoltage();
|
this.voltage = battery.getVoltage();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -11,19 +11,19 @@ import static de.ph87.electro.CONFIG.P90;
|
|||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@ToString(callSuper = true)
|
@ToString(callSuper = true)
|
||||||
public class PartJunctionCorner extends PartOther {
|
public class ConnectorCorner extends PartOther {
|
||||||
|
|
||||||
private final Junction j0;
|
private final Junction j0;
|
||||||
|
|
||||||
private final Junction j1;
|
private final Junction j1;
|
||||||
|
|
||||||
public PartJunctionCorner(final Position position) {
|
public ConnectorCorner(final Position position) {
|
||||||
super("", position);
|
super("", position);
|
||||||
j0 = newJunction(this, "J0", P10, P10);
|
j0 = newJunction(this, "J0", P10, P10);
|
||||||
j1 = newJunction(this, "J1", P90, P90);
|
j1 = newJunction(this, "J1", P90, P90);
|
||||||
}
|
}
|
||||||
|
|
||||||
public PartJunctionCorner(final PartJunctionCornerDto dto) {
|
public ConnectorCorner(final ConnectorCornerDto dto) {
|
||||||
super(dto);
|
super(dto);
|
||||||
j0 = newJunction(this, dto.getJ0(), P10, P10);
|
j0 = newJunction(this, dto.getJ0(), P10, P10);
|
||||||
j1 = newJunction(this, dto.getJ1(), P90, P90);
|
j1 = newJunction(this, dto.getJ1(), P90, P90);
|
||||||
@ -9,13 +9,13 @@ import lombok.ToString;
|
|||||||
@Getter
|
@Getter
|
||||||
@ToString
|
@ToString
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
public class PartJunctionEdgeDto extends PartDto {
|
public class ConnectorCornerDto extends PartDto {
|
||||||
|
|
||||||
private JunctionDto j0;
|
private JunctionDto j0;
|
||||||
|
|
||||||
private JunctionDto j1;
|
private JunctionDto j1;
|
||||||
|
|
||||||
public PartJunctionEdgeDto(final PartJunctionEdge part) {
|
public ConnectorCornerDto(final ConnectorCorner part) {
|
||||||
j0 = new JunctionDto(part.getJ0());
|
j0 = new JunctionDto(part.getJ0());
|
||||||
j1 = new JunctionDto(part.getJ1());
|
j1 = new JunctionDto(part.getJ1());
|
||||||
}
|
}
|
||||||
@ -11,19 +11,19 @@ import static de.ph87.electro.CONFIG.P50;
|
|||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@ToString(callSuper = true)
|
@ToString(callSuper = true)
|
||||||
public class PartJunctionEdge extends PartOther {
|
public class ConnectorEdge extends PartOther {
|
||||||
|
|
||||||
private final Junction j0;
|
private final Junction j0;
|
||||||
|
|
||||||
private final Junction j1;
|
private final Junction j1;
|
||||||
|
|
||||||
public PartJunctionEdge(final Position position) {
|
public ConnectorEdge(final Position position) {
|
||||||
super("", position);
|
super("", position);
|
||||||
j0 = newJunction(this, "J0", P10, P50);
|
j0 = newJunction(this, "J0", P10, P50);
|
||||||
j1 = newJunction(this, "J1", P50, P10);
|
j1 = newJunction(this, "J1", P50, P10);
|
||||||
}
|
}
|
||||||
|
|
||||||
public PartJunctionEdge(final PartJunctionEdgeDto dto) {
|
public ConnectorEdge(final ConnectorEdgeDto dto) {
|
||||||
super(dto);
|
super(dto);
|
||||||
j0 = newJunction(this, dto.getJ0(), P10, P50);
|
j0 = newJunction(this, dto.getJ0(), P10, P50);
|
||||||
j1 = newJunction(this, dto.getJ1(), P50, P10);
|
j1 = newJunction(this, dto.getJ1(), P50, P10);
|
||||||
@ -9,13 +9,13 @@ import lombok.ToString;
|
|||||||
@Getter
|
@Getter
|
||||||
@ToString
|
@ToString
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
public class PartJunctionCornerDto extends PartDto {
|
public class ConnectorEdgeDto extends PartDto {
|
||||||
|
|
||||||
private JunctionDto j0;
|
private JunctionDto j0;
|
||||||
|
|
||||||
private JunctionDto j1;
|
private JunctionDto j1;
|
||||||
|
|
||||||
public PartJunctionCornerDto(final PartJunctionCorner part) {
|
public ConnectorEdgeDto(final ConnectorEdge part) {
|
||||||
j0 = new JunctionDto(part.getJ0());
|
j0 = new JunctionDto(part.getJ0());
|
||||||
j1 = new JunctionDto(part.getJ1());
|
j1 = new JunctionDto(part.getJ1());
|
||||||
}
|
}
|
||||||
@ -10,16 +10,16 @@ import static de.ph87.electro.CONFIG.P50;
|
|||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@ToString(callSuper = true)
|
@ToString(callSuper = true)
|
||||||
public class PartJunctionMiddle extends PartOther {
|
public class ConnectorMiddle extends PartOther {
|
||||||
|
|
||||||
private final Junction junction;
|
private final Junction junction;
|
||||||
|
|
||||||
public PartJunctionMiddle(final Position position) {
|
public ConnectorMiddle(final Position position) {
|
||||||
super("", position);
|
super("", position);
|
||||||
junction = newJunction(this, "J", P50, P50);
|
junction = newJunction(this, "J", P50, P50);
|
||||||
}
|
}
|
||||||
|
|
||||||
public PartJunctionMiddle(final PartJunctionMiddleDto dto) {
|
public ConnectorMiddle(final ConnectorMiddleDto dto) {
|
||||||
super(dto);
|
super(dto);
|
||||||
junction = newJunction(this, dto.getJunction(), P50, P50);
|
junction = newJunction(this, dto.getJunction(), P50, P50);
|
||||||
}
|
}
|
||||||
@ -9,11 +9,11 @@ import lombok.ToString;
|
|||||||
@Getter
|
@Getter
|
||||||
@ToString
|
@ToString
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
public class PartJunctionMiddleDto extends PartDto {
|
public class ConnectorMiddleDto extends PartDto {
|
||||||
|
|
||||||
private JunctionDto junction;
|
private JunctionDto junction;
|
||||||
|
|
||||||
public PartJunctionMiddleDto(final PartJunctionMiddle part) {
|
public ConnectorMiddleDto(final ConnectorMiddle part) {
|
||||||
junction = new JunctionDto(part.getJunction());
|
junction = new JunctionDto(part.getJunction());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -19,7 +19,7 @@ import static java.lang.Math.round;
|
|||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@ToString(callSuper = true)
|
@ToString(callSuper = true)
|
||||||
public class PartLight extends PartOther {
|
public class Light extends PartOther {
|
||||||
|
|
||||||
private static final Color COLOR_DEFECT = new Color(255, 0, 234);
|
private static final Color COLOR_DEFECT = new Color(255, 0, 234);
|
||||||
|
|
||||||
@ -53,13 +53,13 @@ public class PartLight extends PartOther {
|
|||||||
|
|
||||||
private Color color = BULB_OFF_COLOR;
|
private Color color = BULB_OFF_COLOR;
|
||||||
|
|
||||||
public PartLight(final Position position) {
|
public Light(final Position position) {
|
||||||
super("Licht", position);
|
super("Licht", position);
|
||||||
a = newJunction(this, "A", P10, P50);
|
a = newJunction(this, "A", P10, P50);
|
||||||
b = newJunction(this, "B", P90, P50);
|
b = newJunction(this, "B", P90, P50);
|
||||||
}
|
}
|
||||||
|
|
||||||
public PartLight(final PartLightDto dto) {
|
public Light(final LightDto dto) {
|
||||||
super(dto);
|
super(dto);
|
||||||
a = newJunction(this, dto.getB(), P10, P50);
|
a = newJunction(this, dto.getB(), P10, P50);
|
||||||
b = newJunction(this, dto.getA(), P90, P50);
|
b = newJunction(this, dto.getA(), P90, P50);
|
||||||
@ -9,7 +9,7 @@ import lombok.ToString;
|
|||||||
@Getter
|
@Getter
|
||||||
@ToString
|
@ToString
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
public class PartLightDto extends PartDto {
|
public class LightDto extends PartDto {
|
||||||
|
|
||||||
private JunctionDto a;
|
private JunctionDto a;
|
||||||
|
|
||||||
@ -23,14 +23,14 @@ public class PartLightDto extends PartDto {
|
|||||||
|
|
||||||
private boolean defect;
|
private boolean defect;
|
||||||
|
|
||||||
public PartLightDto(final PartLight partLight) {
|
public LightDto(final Light light) {
|
||||||
super(partLight);
|
super(light);
|
||||||
this.a = new JunctionDto(partLight.getB());
|
this.a = new JunctionDto(light.getB());
|
||||||
this.b = new JunctionDto(partLight.getA());
|
this.b = new JunctionDto(light.getA());
|
||||||
this.defect = partLight.isDefect();
|
this.defect = light.isDefect();
|
||||||
this.resistance = partLight.getResistance();
|
this.resistance = light.getResistance();
|
||||||
this.minVoltage = partLight.getMinVoltage();
|
this.minVoltage = light.getMinVoltage();
|
||||||
this.maxVoltage = partLight.getMaxVoltage();
|
this.maxVoltage = light.getMaxVoltage();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1,33 +0,0 @@
|
|||||||
package de.ph87.electro.circuit.part.parts;
|
|
||||||
|
|
||||||
import de.ph87.electro.circuit.part.PartDto;
|
|
||||||
import de.ph87.electro.circuit.part.junction.JunctionDto;
|
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.ToString;
|
|
||||||
|
|
||||||
@Getter
|
|
||||||
@ToString
|
|
||||||
@NoArgsConstructor
|
|
||||||
public class PartSwitchCrossDto extends PartDto {
|
|
||||||
|
|
||||||
private JunctionDto common0;
|
|
||||||
|
|
||||||
private JunctionDto common1;
|
|
||||||
|
|
||||||
private JunctionDto output0;
|
|
||||||
|
|
||||||
private JunctionDto output1;
|
|
||||||
|
|
||||||
private boolean state;
|
|
||||||
|
|
||||||
public PartSwitchCrossDto(final PartSwitchCross partSwitchCross) {
|
|
||||||
super(partSwitchCross);
|
|
||||||
this.common0 = new JunctionDto(partSwitchCross.getCommon0());
|
|
||||||
this.common1 = new JunctionDto(partSwitchCross.getCommon1());
|
|
||||||
this.output0 = new JunctionDto(partSwitchCross.getOutput0());
|
|
||||||
this.output1 = new JunctionDto(partSwitchCross.getOutput1());
|
|
||||||
this.state = partSwitchCross.isState();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -16,7 +16,7 @@ import static de.ph87.electro.circuit.calculation.Calculation.NO_RESISTANCE;
|
|||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@ToString(callSuper = true)
|
@ToString(callSuper = true)
|
||||||
public class PartSwitch1x1 extends PartOther {
|
public class Switch1x1 extends PartOther {
|
||||||
|
|
||||||
private final Junction common;
|
private final Junction common;
|
||||||
|
|
||||||
@ -25,13 +25,13 @@ public class PartSwitch1x1 extends PartOther {
|
|||||||
@Setter
|
@Setter
|
||||||
private boolean state = false;
|
private boolean state = false;
|
||||||
|
|
||||||
public PartSwitch1x1(final Position position) {
|
public Switch1x1(final Position position) {
|
||||||
super("Ausschalter", position);
|
super("Ausschalter", position);
|
||||||
common = newJunction(this, "C", P10, P50);
|
common = newJunction(this, "C", P10, P50);
|
||||||
output = newJunction(this, "O", P90, P50);
|
output = newJunction(this, "O", P90, P50);
|
||||||
}
|
}
|
||||||
|
|
||||||
public PartSwitch1x1(final PartSwitch1x1Dto dto) {
|
public Switch1x1(final Switch1x1Dto dto) {
|
||||||
super(dto);
|
super(dto);
|
||||||
common = newJunction(this, dto.getCommon(), P10, P50);
|
common = newJunction(this, dto.getCommon(), P10, P50);
|
||||||
output = newJunction(this, dto.getOutput(), P90, P50);
|
output = newJunction(this, dto.getOutput(), P90, P50);
|
||||||
@ -9,7 +9,7 @@ import lombok.ToString;
|
|||||||
@Getter
|
@Getter
|
||||||
@ToString
|
@ToString
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
public class PartSwitch1x1Dto extends PartDto {
|
public class Switch1x1Dto extends PartDto {
|
||||||
|
|
||||||
private JunctionDto common;
|
private JunctionDto common;
|
||||||
|
|
||||||
@ -17,11 +17,11 @@ public class PartSwitch1x1Dto extends PartDto {
|
|||||||
|
|
||||||
private boolean state;
|
private boolean state;
|
||||||
|
|
||||||
public PartSwitch1x1Dto(final PartSwitch1x1 partSwitch1x1) {
|
public Switch1x1Dto(final Switch1x1 switch1X1) {
|
||||||
super(partSwitch1x1);
|
super(switch1X1);
|
||||||
this.common = new JunctionDto(partSwitch1x1.getCommon());
|
this.common = new JunctionDto(switch1X1.getCommon());
|
||||||
this.output = new JunctionDto(partSwitch1x1.getOutput());
|
this.output = new JunctionDto(switch1X1.getOutput());
|
||||||
this.state = partSwitch1x1.isState();
|
this.state = switch1X1.isState();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -15,7 +15,7 @@ import static de.ph87.electro.circuit.calculation.Calculation.NO_RESISTANCE;
|
|||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@ToString(callSuper = true)
|
@ToString(callSuper = true)
|
||||||
public class PartSwitch1x2 extends PartOther {
|
public class Switch1x2 extends PartOther {
|
||||||
|
|
||||||
private final Junction common;
|
private final Junction common;
|
||||||
|
|
||||||
@ -26,14 +26,14 @@ public class PartSwitch1x2 extends PartOther {
|
|||||||
@Setter
|
@Setter
|
||||||
private boolean state = false;
|
private boolean state = false;
|
||||||
|
|
||||||
public PartSwitch1x2(final Position position) {
|
public Switch1x2(final Position position) {
|
||||||
super("Wechselschalter", position);
|
super("Wechselschalter", position);
|
||||||
common = newJunction(this, "C", P10, P50);
|
common = newJunction(this, "C", P10, P50);
|
||||||
output0 = newJunction(this, "O0", P90, P25);
|
output0 = newJunction(this, "O0", P90, P25);
|
||||||
output1 = newJunction(this, "O1", P90, P75);
|
output1 = newJunction(this, "O1", P90, P75);
|
||||||
}
|
}
|
||||||
|
|
||||||
public PartSwitch1x2(final PartSwitch1x2Dto dto) {
|
public Switch1x2(final Switch1x2Dto dto) {
|
||||||
super(dto);
|
super(dto);
|
||||||
common = newJunction(this, dto.getCommon(), P10, P50);
|
common = newJunction(this, dto.getCommon(), P10, P50);
|
||||||
output0 = newJunction(this, dto.getOutput0(), P90, P25);
|
output0 = newJunction(this, dto.getOutput0(), P90, P25);
|
||||||
@ -9,7 +9,7 @@ import lombok.ToString;
|
|||||||
@Getter
|
@Getter
|
||||||
@ToString
|
@ToString
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
public class PartSwitch1x2Dto extends PartDto {
|
public class Switch1x2Dto extends PartDto {
|
||||||
|
|
||||||
private JunctionDto common;
|
private JunctionDto common;
|
||||||
|
|
||||||
@ -19,12 +19,12 @@ public class PartSwitch1x2Dto extends PartDto {
|
|||||||
|
|
||||||
private boolean state;
|
private boolean state;
|
||||||
|
|
||||||
public PartSwitch1x2Dto(final PartSwitch1x2 partSwitch1x2) {
|
public Switch1x2Dto(final Switch1x2 switch1X2) {
|
||||||
super(partSwitch1x2);
|
super(switch1X2);
|
||||||
this.common = new JunctionDto(partSwitch1x2.getCommon());
|
this.common = new JunctionDto(switch1X2.getCommon());
|
||||||
this.output0 = new JunctionDto(partSwitch1x2.getOutput0());
|
this.output0 = new JunctionDto(switch1X2.getOutput0());
|
||||||
this.output1 = new JunctionDto(partSwitch1x2.getOutput1());
|
this.output1 = new JunctionDto(switch1X2.getOutput1());
|
||||||
this.state = partSwitch1x2.isState();
|
this.state = switch1X2.isState();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -15,7 +15,7 @@ import static de.ph87.electro.circuit.calculation.Calculation.NO_RESISTANCE;
|
|||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@ToString(callSuper = true)
|
@ToString(callSuper = true)
|
||||||
public class PartSwitchCross extends PartOther {
|
public class SwitchCross extends PartOther {
|
||||||
|
|
||||||
private final Junction common0;
|
private final Junction common0;
|
||||||
|
|
||||||
@ -28,7 +28,7 @@ public class PartSwitchCross extends PartOther {
|
|||||||
@Setter
|
@Setter
|
||||||
private boolean state = false;
|
private boolean state = false;
|
||||||
|
|
||||||
public PartSwitchCross(final Position position) {
|
public SwitchCross(final Position position) {
|
||||||
super("Kreuzschalter", position);
|
super("Kreuzschalter", position);
|
||||||
common0 = newJunction(this, "C0", P10, P25);
|
common0 = newJunction(this, "C0", P10, P25);
|
||||||
common1 = newJunction(this, "C1", P10, P75);
|
common1 = newJunction(this, "C1", P10, P75);
|
||||||
@ -36,7 +36,7 @@ public class PartSwitchCross extends PartOther {
|
|||||||
output1 = newJunction(this, "O1", P90, P75);
|
output1 = newJunction(this, "O1", P90, P75);
|
||||||
}
|
}
|
||||||
|
|
||||||
public PartSwitchCross(final PartSwitchCrossDto dto) {
|
public SwitchCross(final SwitchCrossDto dto) {
|
||||||
super(dto);
|
super(dto);
|
||||||
common0 = newJunction(this, dto.getCommon0(), P10, P25);
|
common0 = newJunction(this, dto.getCommon0(), P10, P25);
|
||||||
common1 = newJunction(this, dto.getCommon1(), P10, P75);
|
common1 = newJunction(this, dto.getCommon1(), P10, P75);
|
||||||
@ -0,0 +1,33 @@
|
|||||||
|
package de.ph87.electro.circuit.part.parts;
|
||||||
|
|
||||||
|
import de.ph87.electro.circuit.part.PartDto;
|
||||||
|
import de.ph87.electro.circuit.part.junction.JunctionDto;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.ToString;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@ToString
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class SwitchCrossDto extends PartDto {
|
||||||
|
|
||||||
|
private JunctionDto common0;
|
||||||
|
|
||||||
|
private JunctionDto common1;
|
||||||
|
|
||||||
|
private JunctionDto output0;
|
||||||
|
|
||||||
|
private JunctionDto output1;
|
||||||
|
|
||||||
|
private boolean state;
|
||||||
|
|
||||||
|
public SwitchCrossDto(final SwitchCross switchCross) {
|
||||||
|
super(switchCross);
|
||||||
|
this.common0 = new JunctionDto(switchCross.getCommon0());
|
||||||
|
this.common1 = new JunctionDto(switchCross.getCommon1());
|
||||||
|
this.output0 = new JunctionDto(switchCross.getOutput0());
|
||||||
|
this.output1 = new JunctionDto(switchCross.getOutput1());
|
||||||
|
this.state = switchCross.isState();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -28,14 +28,14 @@ public class Sidebar extends JPanel {
|
|||||||
});
|
});
|
||||||
add(toggleDetails);
|
add(toggleDetails);
|
||||||
|
|
||||||
add(new PartBattery(Position.ZERO));
|
add(new Battery(Position.ZERO));
|
||||||
add(new PartJunctionCorner(Position.ZERO));
|
add(new ConnectorCorner(Position.ZERO));
|
||||||
add(new PartJunctionEdge(Position.ZERO));
|
add(new ConnectorEdge(Position.ZERO));
|
||||||
add(new PartJunctionMiddle(Position.ZERO));
|
add(new ConnectorMiddle(Position.ZERO));
|
||||||
add(new PartLight(Position.ZERO));
|
add(new Light(Position.ZERO));
|
||||||
add(new PartSwitch1x1(Position.ZERO));
|
add(new Switch1x1(Position.ZERO));
|
||||||
add(new PartSwitch1x2(Position.ZERO));
|
add(new Switch1x2(Position.ZERO));
|
||||||
add(new PartSwitchCross(Position.ZERO));
|
add(new SwitchCross(Position.ZERO));
|
||||||
setPreferredSize(new Dimension(0, 200));
|
setPreferredSize(new Dimension(0, 200));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,8 +2,8 @@ package de.ph87.electro.circuit;
|
|||||||
|
|
||||||
import de.ph87.electro.circuit.calculation.Calculation;
|
import de.ph87.electro.circuit.calculation.Calculation;
|
||||||
import de.ph87.electro.circuit.part.junction.Junction;
|
import de.ph87.electro.circuit.part.junction.Junction;
|
||||||
import de.ph87.electro.circuit.part.parts.PartBattery;
|
import de.ph87.electro.circuit.part.parts.Battery;
|
||||||
import de.ph87.electro.circuit.part.parts.PartLight;
|
import de.ph87.electro.circuit.part.parts.Light;
|
||||||
import de.ph87.electro.circuit.wire.Wire;
|
import de.ph87.electro.circuit.wire.Wire;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
@ -16,8 +16,8 @@ class CalculationServiceTest {
|
|||||||
@Test
|
@Test
|
||||||
void test() {
|
void test() {
|
||||||
final Circuit circuit = new Circuit();
|
final Circuit circuit = new Circuit();
|
||||||
final PartBattery battery = circuit.addPart(new PartBattery(RST(0, 0)));
|
final Battery battery = circuit.addPart(new Battery(RST(0, 0)));
|
||||||
final PartLight light = circuit.addPart(new PartLight(RST(0, 1)));
|
final Light light = circuit.addPart(new Light(RST(0, 1)));
|
||||||
circuit.connect(battery.getMinus(), light.getA());
|
circuit.connect(battery.getMinus(), light.getA());
|
||||||
circuit.connect(battery.getPlus(), light.getB());
|
circuit.connect(battery.getPlus(), light.getB());
|
||||||
|
|
||||||
|
|||||||
@ -3,8 +3,8 @@ package de.ph87.electro.circuit.io;
|
|||||||
import de.ph87.electro.circuit.Circuit;
|
import de.ph87.electro.circuit.Circuit;
|
||||||
import de.ph87.electro.circuit.part.Part;
|
import de.ph87.electro.circuit.part.Part;
|
||||||
import de.ph87.electro.circuit.part.junction.Junction;
|
import de.ph87.electro.circuit.part.junction.Junction;
|
||||||
import de.ph87.electro.circuit.part.parts.PartBattery;
|
import de.ph87.electro.circuit.part.parts.Battery;
|
||||||
import de.ph87.electro.circuit.part.parts.PartLight;
|
import de.ph87.electro.circuit.part.parts.Light;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import java.io.ByteArrayInputStream;
|
import java.io.ByteArrayInputStream;
|
||||||
@ -22,8 +22,8 @@ class CircuitIOServiceTest {
|
|||||||
@Test
|
@Test
|
||||||
void serialization() throws IOException {
|
void serialization() throws IOException {
|
||||||
final Circuit circuit = new Circuit();
|
final Circuit circuit = new Circuit();
|
||||||
final PartBattery battery = circuit.addPart(new PartBattery(RST(0, 0)));
|
final Battery battery = circuit.addPart(new Battery(RST(0, 0)));
|
||||||
final PartLight light = circuit.addPart(new PartLight(RST(0, 1)));
|
final Light light = circuit.addPart(new Light(RST(0, 1)));
|
||||||
circuit.connect(battery.getPlus(), light.getB());
|
circuit.connect(battery.getPlus(), light.getB());
|
||||||
circuit.connect(light.getA(), battery.getMinus());
|
circuit.connect(light.getA(), battery.getMinus());
|
||||||
check(circuit);
|
check(circuit);
|
||||||
|
|||||||
@ -14,9 +14,9 @@ public class BatteryLightTest {
|
|||||||
|
|
||||||
private static final Circuit CIRCUIT = new Circuit();
|
private static final Circuit CIRCUIT = new Circuit();
|
||||||
|
|
||||||
private static final PartBattery battery = CIRCUIT.addPart(new PartBattery(RST(0, 0)));
|
private static final Battery battery = CIRCUIT.addPart(new Battery(RST(0, 0)));
|
||||||
|
|
||||||
private static final PartLight light = CIRCUIT.addPart(new PartLight(RST(0, 1)));
|
private static final Light light = CIRCUIT.addPart(new Light(RST(0, 1)));
|
||||||
|
|
||||||
@BeforeAll
|
@BeforeAll
|
||||||
public static void setUp() {
|
public static void setUp() {
|
||||||
|
|||||||
@ -15,11 +15,11 @@ public class BatterySwitcher1x1Test {
|
|||||||
|
|
||||||
private static final Circuit CIRCUIT = new Circuit();
|
private static final Circuit CIRCUIT = new Circuit();
|
||||||
|
|
||||||
private static final PartBattery battery = CIRCUIT.addPart(new PartBattery(RST(0, 0)));
|
private static final Battery battery = CIRCUIT.addPart(new Battery(RST(0, 0)));
|
||||||
|
|
||||||
private static final PartSwitch1x1 switcher = CIRCUIT.addPart(new PartSwitch1x1(RST(0, 1)));
|
private static final Switch1x1 switcher = CIRCUIT.addPart(new Switch1x1(RST(0, 1)));
|
||||||
|
|
||||||
private static final PartLight light = CIRCUIT.addPart(new PartLight(RST(1, 0)));
|
private static final Light light = CIRCUIT.addPart(new Light(RST(1, 0)));
|
||||||
|
|
||||||
@BeforeAll
|
@BeforeAll
|
||||||
public static void setUp() {
|
public static void setUp() {
|
||||||
|
|||||||
@ -15,13 +15,13 @@ public class BatterySwitcher1x2Test {
|
|||||||
|
|
||||||
private static final Circuit CIRCUIT = new Circuit();
|
private static final Circuit CIRCUIT = new Circuit();
|
||||||
|
|
||||||
private static final PartBattery battery = CIRCUIT.addPart(new PartBattery(RST(0, 0)));
|
private static final Battery battery = CIRCUIT.addPart(new Battery(RST(0, 0)));
|
||||||
|
|
||||||
private static final PartSwitch1x2 switcher = CIRCUIT.addPart(new PartSwitch1x2(RST(0, 2)));
|
private static final Switch1x2 switcher = CIRCUIT.addPart(new Switch1x2(RST(0, 2)));
|
||||||
|
|
||||||
private static final PartLight light0 = CIRCUIT.addPart(new PartLight(RST(1, 1)));
|
private static final Light light0 = CIRCUIT.addPart(new Light(RST(1, 1)));
|
||||||
|
|
||||||
private static final PartLight light1 = CIRCUIT.addPart(new PartLight(RST(1, 3)));
|
private static final Light light1 = CIRCUIT.addPart(new Light(RST(1, 3)));
|
||||||
|
|
||||||
@BeforeAll
|
@BeforeAll
|
||||||
public static void setUp() {
|
public static void setUp() {
|
||||||
|
|||||||
@ -15,13 +15,13 @@ public class BatterySwitcher2x2Test {
|
|||||||
|
|
||||||
private static final Circuit CIRCUIT = new Circuit();
|
private static final Circuit CIRCUIT = new Circuit();
|
||||||
|
|
||||||
private static final PartBattery battery = CIRCUIT.addPart(new PartBattery(RST(0, 0)));
|
private static final Battery battery = CIRCUIT.addPart(new Battery(RST(0, 0)));
|
||||||
|
|
||||||
private static final PartSwitch1x2 switcher0 = CIRCUIT.addPart(new PartSwitch1x2(RST(0, 1)));
|
private static final Switch1x2 switcher0 = CIRCUIT.addPart(new Switch1x2(RST(0, 1)));
|
||||||
|
|
||||||
private static final PartSwitch1x2 switcher1 = CIRCUIT.addPart(new PartSwitch1x2(RST(1, 1)));
|
private static final Switch1x2 switcher1 = CIRCUIT.addPart(new Switch1x2(RST(1, 1)));
|
||||||
|
|
||||||
private static final PartLight light = CIRCUIT.addPart(new PartLight(RST(1, 0)));
|
private static final Light light = CIRCUIT.addPart(new Light(RST(1, 0)));
|
||||||
|
|
||||||
@BeforeAll
|
@BeforeAll
|
||||||
public static void setUp() {
|
public static void setUp() {
|
||||||
|
|||||||
@ -15,15 +15,15 @@ public class BatterySwitcherCrossTest {
|
|||||||
|
|
||||||
private static final Circuit CIRCUIT = new Circuit();
|
private static final Circuit CIRCUIT = new Circuit();
|
||||||
|
|
||||||
private static final PartBattery battery = CIRCUIT.addPart(new PartBattery(RST(0, 0)));
|
private static final Battery battery = CIRCUIT.addPart(new Battery(RST(0, 0)));
|
||||||
|
|
||||||
private static final PartSwitch1x2 switcher0 = CIRCUIT.addPart(new PartSwitch1x2(RST(0, 1)));
|
private static final Switch1x2 switcher0 = CIRCUIT.addPart(new Switch1x2(RST(0, 1)));
|
||||||
|
|
||||||
private static final PartSwitchCross switcherX = CIRCUIT.addPart(new PartSwitchCross(RST(1, 1)));
|
private static final SwitchCross switcherX = CIRCUIT.addPart(new SwitchCross(RST(1, 1)));
|
||||||
|
|
||||||
private static final PartSwitch1x2 switcher1 = CIRCUIT.addPart(new PartSwitch1x2(RST(2, 1)));
|
private static final Switch1x2 switcher1 = CIRCUIT.addPart(new Switch1x2(RST(2, 1)));
|
||||||
|
|
||||||
private static final PartLight light = CIRCUIT.addPart(new PartLight(RST(2, 0)));
|
private static final Light light = CIRCUIT.addPart(new Light(RST(2, 0)));
|
||||||
|
|
||||||
@BeforeAll
|
@BeforeAll
|
||||||
public static void setUp() {
|
public static void setUp() {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user