From 33bf560a534658cb8104522929923d4fc263acfb Mon Sep 17 00:00:00 2001 From: hneemann Date: Sun, 16 Apr 2017 20:51:21 +0200 Subject: [PATCH] correct fet pin names --- .../neemann/digital/core/switching/FGNFET.java | 2 +- .../neemann/digital/core/switching/FGPFET.java | 2 +- .../de/neemann/digital/core/switching/NFET.java | 9 ++++++++- .../de/neemann/digital/core/switching/PFET.java | 2 +- .../neemann/digital/core/switching/Relay.java | 2 +- .../neemann/digital/core/switching/Switch.java | 12 ++++++++---- src/main/resources/lang/lang_de.xml | 17 +++++++++-------- src/main/resources/lang/lang_en.xml | 17 +++++++++-------- 8 files changed, 38 insertions(+), 25 deletions(-) diff --git a/src/main/java/de/neemann/digital/core/switching/FGNFET.java b/src/main/java/de/neemann/digital/core/switching/FGNFET.java index 4693d0c22..b88c6e3d3 100644 --- a/src/main/java/de/neemann/digital/core/switching/FGNFET.java +++ b/src/main/java/de/neemann/digital/core/switching/FGNFET.java @@ -29,7 +29,7 @@ public class FGNFET extends NFET { * @param attr the attributes */ public FGNFET(ElementAttributes attr) { - super(attr); + super(attr, false); getOutput1().setPinDescription(DESCRIPTION); getOutput2().setPinDescription(DESCRIPTION); programmed = attr.get(Keys.BLOWN); diff --git a/src/main/java/de/neemann/digital/core/switching/FGPFET.java b/src/main/java/de/neemann/digital/core/switching/FGPFET.java index 8043c93d4..b7220da9f 100644 --- a/src/main/java/de/neemann/digital/core/switching/FGPFET.java +++ b/src/main/java/de/neemann/digital/core/switching/FGPFET.java @@ -29,7 +29,7 @@ public class FGPFET extends NFET { * @param attr the attributes */ public FGPFET(ElementAttributes attr) { - super(attr); + super(attr, true); getOutput1().setPinDescription(DESCRIPTION); getOutput2().setPinDescription(DESCRIPTION); programmed = attr.get(Keys.BLOWN); diff --git a/src/main/java/de/neemann/digital/core/switching/NFET.java b/src/main/java/de/neemann/digital/core/switching/NFET.java index a405a93e3..7080fe568 100644 --- a/src/main/java/de/neemann/digital/core/switching/NFET.java +++ b/src/main/java/de/neemann/digital/core/switching/NFET.java @@ -32,11 +32,18 @@ public class NFET extends Node implements Element { * @param attr the attributes */ public NFET(ElementAttributes attr) { - s = new Switch(attr, false); + this(attr, false); s.getOutput1().setPinDescription(DESCRIPTION); s.getOutput2().setPinDescription(DESCRIPTION); } + NFET(ElementAttributes attr, boolean pChan) { + if (pChan) + s = new Switch(attr, false, "S", "D"); + else + s = new Switch(attr, false, "D", "S"); + } + @Override public void setInputs(ObservableValues inputs) throws NodeException { input = inputs.get(0).checkBits(1, this).addObserverToValue(this); diff --git a/src/main/java/de/neemann/digital/core/switching/PFET.java b/src/main/java/de/neemann/digital/core/switching/PFET.java index ff1ccded7..0c62c2089 100644 --- a/src/main/java/de/neemann/digital/core/switching/PFET.java +++ b/src/main/java/de/neemann/digital/core/switching/PFET.java @@ -26,7 +26,7 @@ public class PFET extends NFET { * @param attr the attributes */ public PFET(ElementAttributes attr) { - super(attr); + super(attr, true); getOutput1().setPinDescription(DESCRIPTION); getOutput2().setPinDescription(DESCRIPTION); } diff --git a/src/main/java/de/neemann/digital/core/switching/Relay.java b/src/main/java/de/neemann/digital/core/switching/Relay.java index af4d6de3d..ae1a8e86e 100644 --- a/src/main/java/de/neemann/digital/core/switching/Relay.java +++ b/src/main/java/de/neemann/digital/core/switching/Relay.java @@ -49,7 +49,7 @@ public class Relay extends Node implements Element { */ public Relay(ElementAttributes attr, boolean invers) { this.invers = invers; - s = new Switch(attr, invers); + s = new Switch(attr, invers, "out1", "out2"); } @Override diff --git a/src/main/java/de/neemann/digital/core/switching/Switch.java b/src/main/java/de/neemann/digital/core/switching/Switch.java index 2ed592b72..1d14a9db1 100644 --- a/src/main/java/de/neemann/digital/core/switching/Switch.java +++ b/src/main/java/de/neemann/digital/core/switching/Switch.java @@ -35,7 +35,9 @@ public class Switch implements Element, Observer { * @param attr the elements attributes */ public Switch(ElementAttributes attr) { - this(attr, attr.get(Keys.CLOSED)); + this(attr, attr.get(Keys.CLOSED), "out1", "out2"); + output1.setPinDescription(DESCRIPTION); + output2.setPinDescription(DESCRIPTION); } /** @@ -43,12 +45,14 @@ public class Switch implements Element, Observer { * * @param attr the elements attributes * @param closed true if switch is closed + * @param out1 name of output 1 + * @param out2 name of output 2 */ - public Switch(ElementAttributes attr, boolean closed) { + public Switch(ElementAttributes attr, boolean closed, String out1, String out2) { bits = attr.getBits(); this.closed = closed; - output1 = new ObservableValue("out1", bits, true).setPinDescription(DESCRIPTION).setBidirectional().set(0, true); - output2 = new ObservableValue("out2", bits, true).setPinDescription(DESCRIPTION).setBidirectional().set(0, true); + output1 = new ObservableValue(out1, bits, true).setBidirectional().set(0, true); + output2 = new ObservableValue(out2, bits, true).setBidirectional().set(0, true); } @Override diff --git a/src/main/resources/lang/lang_de.xml b/src/main/resources/lang/lang_de.xml index 3b7f94cda..9903f6447 100644 --- a/src/main/resources/lang/lang_de.xml +++ b/src/main/resources/lang/lang_de.xml @@ -365,27 +365,28 @@ Die gesammte Speichergröße beträgt damit damit dx*dy*2 Speicherworte.N-Kanal FET N-Kanal Feldeffekttransistor. Der Bulk ist mit Masse verbunden jedoch wird der Transistor ohne eine Body-Diode simuliert. Gate - Source - Drain + Source + Drain + P-Kanal FET P-Kanal Feldeffekttransistor. Der Bulk ist mit der pos. Versorgung verbunden, jedoch wird der Transistor ohne eine Body-Diode simuliert. Gate - Source - Drain + Source + Drain N-Kanal Floating Gate FET N-Kanal Feldeffekttransistor mit Floating Gate. Der Bulk ist mit Masse verbunden jedoch wird der Transistor ohne eine Body-Diode simuliert. Ist das Floating Gate geladen, ist der Transistor immer sperrend. Gate - Source - Drain + Source + Drain P-Kanal Floating Gate FET P-Kanal Feldeffekttransistor mit Floating Gate. Der Bulk ist mit Masse verbunden jedoch wird der Transistor ohne eine Body-Diode simuliert. Ist das Floating Gate geladen, ist der Transistor immer sperrend. Gate - Source - Drain + Source + Drain Drehencoder Drehknopf mit Drehencoder zur zustandsfreien Erfassung der Drehbewegung. diff --git a/src/main/resources/lang/lang_en.xml b/src/main/resources/lang/lang_en.xml index f2f31f4ae..2c4c0309c 100644 --- a/src/main/resources/lang/lang_en.xml +++ b/src/main/resources/lang/lang_en.xml @@ -352,28 +352,29 @@ N-Channel FET N-Channel Field Effect Transistor. The bulk is connected to ground and the transistor is simulated without a body diode. Gate - Source - Drain + Source + Drain N-Channel floating gate FET N-Channel Floating Gate Field Effect Transistor. The bulk is connected to ground and the transistor is simulated without a body diode. If there is a charge stored in the floating gate, the fet isn't conducting even if the gate is high. Gate - Source - Drain + Source + Drain P-Channel floating gate FET P-Channel Floating Gate Field Effect Transistor. The bulk is connected to ground and the transistor is simulated without a body diode. If there is a charge stored in the floating gate, the fet isn't conducting even if the gate is low. Gate - Source - Drain + Source + Drain P-Channel FET P-Channel Field Effect Transistor. The bulk is connected to the pos. voltage rail and the transistor is simulated without a body diode. Gate - Source - Drain + Source + Drain + Rotary Encoder Rotary knob with rotary encoder for stateless detecting rotational movements. encoder signal A