示例#1
0
 public Triode()
 {
     p = new Terminal(this, "P");
     g = new Terminal(this, "G");
     k = new Terminal(this, "K");
     Name = "V1";
 }
示例#2
0
 public Potentiometer()
 {
     anode = new Terminal(this, "Anode");
     cathode = new Terminal(this, "Cathode");
     wiper = new Terminal(this, "Wiper");
     Name = "R1";
 }
 public BipolarJunctionTransistor()
 {
     c = new Terminal(this, "C");
     e = new Terminal(this, "E");
     b = new Terminal(this, "B");
     Name = "Q1";
 }
 public JunctionFieldEffectTransistor()
 {
     s = new Terminal(this, "S");
     g = new Terminal(this, "G");
     d = new Terminal(this, "D");
     Name = "J1";
 }
示例#5
0
 public Transformer()
 {
     pa = new Terminal(this, "PA");
     pc = new Terminal(this, "PC");
     sa = new Terminal(this, "SA");
     sc = new Terminal(this, "SC");
     Name = "TX1";
 }
 public CenterTapTransformer()
 {
     pa = new Terminal(this, "PA");
     pc = new Terminal(this, "PC");
     sa = new Terminal(this, "SA");
     st = new Terminal(this, "ST");
     sc = new Terminal(this, "SC");
     Name = "TX1";
 }
示例#7
0
        public SinglePoleSwitch(int ThrowCount)
        {
            if (ThrowCount < 2 || ThrowCount > 100)
                throw new ArgumentOutOfRangeException("ThrowCount", "ThrowCount must be in [2, 100]");

            throws = new Terminal[ThrowCount];
            for (int i = 0; i < ThrowCount; ++i)
                throws[i] = new Terminal(this, "Throw" + i.ToString());

            common = new Terminal(this, "Common");

            Name = "S1";
        }
示例#8
0
        public static void LayoutSymbol(SymbolLayout Sym, Terminal p, Terminal n, Terminal o, Terminal vp, Terminal vn, Func<string> Name, Func<string> Part)
        {
            IdealOpAmp.LayoutSymbol(Sym, p, n, o, Name);

            Sym.AddTerminal(vn, new Coord(0, -20), new Coord(0, -10));
            Sym.DrawNegative(EdgeType.Black, new Coord(5, -13));

            Sym.AddTerminal(vp, new Coord(0, 20), new Coord(0, 10));
            Sym.DrawPositive(EdgeType.Black, new Coord(5, 13));

            if (Part != null)
                Sym.DrawText(Part, new Coord(12, 4), Alignment.Near, Alignment.Near);
        }
示例#9
0
        public static void LayoutSymbol(SymbolLayout Sym, Terminal P, Terminal G, Terminal K, Func<string> Name, Func<string> Part)
        {
            Sym.AddTerminal(P, new Coord(0, 20), new Coord(0, 4));
            Sym.AddWire(new Coord(-10, 4), new Coord(10, 4));

            Sym.AddTerminal(G, new Coord(-20, 0), new Coord(-12, 0));
            for (int i = -8; i < 16; i += 8)
                Sym.AddWire(new Coord(i, 0), new Coord(i + 4, 0));

            Sym.AddTerminal(K, new Coord(-10, -20), new Coord(-10, -6), new Coord(-8, -4), new Coord(8, -4), new Coord(10, -6));

            Sym.AddCircle(EdgeType.Black, new Coord(0, 0), 20);

            if (Part != null)
                Sym.DrawText(Part, new Coord(-2, 20), Alignment.Far, Alignment.Near);
            Sym.DrawText(Name, new Point(-8, -20), Alignment.Near, Alignment.Far);
        }
示例#10
0
        public static void LayoutSymbol(SymbolLayout Sym, Terminal p, Terminal n, Terminal o, Func<string> Name)
        {
            Sym.AddTerminal(p, new Coord(-20, -10));
            Sym.DrawPositive(EdgeType.Black, new Coord(-15, -10));

            Sym.AddTerminal(n, new Coord(-20, 10));
            Sym.DrawNegative(EdgeType.Black, new Coord(-15, 10));

            Sym.AddTerminal(o, new Coord(20, 0));
            Sym.AddWire(o, new Coord(20, 0));

            Sym.AddLoop(EdgeType.Black,
                new Coord(-20, 20),
                new Coord(-20, -20),
                new Coord(20, 0));

            Sym.DrawText(Name, new Coord(12, -4), Alignment.Near, Alignment.Far);
        }
示例#11
0
 public void AddWire(Terminal T, IEnumerable<Coord> x)
 {
     AddWire(new Coord[] { terminals[T] }.Concat(x));
 }
示例#12
0
 /// <summary>
 /// Disconnect a terminal from this node.
 /// </summary>
 /// <param name="T"></param>
 public void Disconnect(Terminal T)
 {
     connected.Remove(T);
 }
示例#13
0
 /// <summary>
 /// Connect a terminal to this node.
 /// </summary>
 /// <param name="T"></param>
 public void Connect(Terminal T)
 {
     connected.Add(T);
 }
示例#14
0
 public TwoTerminal()
 {
     anode = new Terminal(this, "Anode");
     cathode = new Terminal(this, "Cathode");
 }
示例#15
0
 public OneTerminal()
 {
     terminal = new Terminal(this);
 }
示例#16
0
 private void Connect(Terminal T, Node V)
 {
     if (V != T.ConnectedTo)
     {
         T.ConnectTo(V);
         if (V != null)
             Log.WriteLine(MessageType.Verbose, "Terminal '" + T.ToString() + "' connected to node '" + V.ToString() + "'");
         else
             Log.WriteLine(MessageType.Verbose, "Terminal '" + T.ToString() + "' disconnected");
     }
 }
示例#17
0
 public OpAmp()
 {
     vcc = new Terminal(this, "Vcc+");
     vee = new Terminal(this, "Vcc-");
 }
示例#18
0
 /// <summary>
 /// Connect the terminal of this port.
 /// </summary>
 /// <param name="N"></param>
 public void ConnectTo(Node N)
 {
     Terminal.ConnectTo(N);
 }
示例#19
0
 public void AddWire(Terminal T, params Coord[] x)
 {
     AddWire(T, x.AsEnumerable());
 }
        public static void LayoutSymbol(SymbolLayout Sym, JfetType Type, Terminal S, Terminal G, Terminal D, Func<string> Name, Func<string> Part)
        {
            int bx = 0;
            Sym.AddTerminal(S, new Coord(10, -20), new Coord(10, -10), new Coord(0, -10));
            Sym.AddTerminal(G, new Coord(-20, 0), new Coord(-10, 0));
            Sym.AddTerminal(D, new Coord(10, 20), new Coord(10, 10), new Coord(0, 10));

            Sym.DrawLine(EdgeType.Black, new Coord(bx, 12), new Coord(bx, -12));
            switch (Type)
            {
                case JfetType.N: Sym.DrawArrow(EdgeType.Black, new Coord(-10, 0), new Coord(0, 0), 0.2, 0.3); break;
                case JfetType.P: Sym.DrawArrow(EdgeType.Black, new Coord(0, 0), new Coord(-10, 0), 0.2, 0.3); break;
                default:
                    throw new NotSupportedException("Unknown JFET type.");
            }

            if (Part != null)
                Sym.DrawText(Part, new Coord(8, 20), Alignment.Far, Alignment.Near);
            Sym.DrawText(Name, new Point(8, -20), Alignment.Far, Alignment.Far);

            Sym.AddCircle(EdgeType.Black, new Coord(0, 0), 20);
        }
示例#21
0
 public override Coord MapTerminal(Terminal T)
 {
     return MapToGlobal(layout.MapTerminal(T));
 }
示例#22
0
 public IdealOpAmp()
 {
     p = new Terminal(this, "+");
     n = new Terminal(this, "-");
     o = new Terminal(this, "Out");
 }
示例#23
0
 /// <summary>
 /// Add a terminal followed by a wire to the schematic.
 /// </summary>
 /// <param name="T"></param>
 /// <param name="x"></param>
 public void AddTerminal(Terminal T, params Coord[] x)
 {
     terminals[T] = x[0]; AddWire(x);
 }
示例#24
0
 public TwoTerminal()
 {
     anode   = new Terminal(this, "Anode");
     cathode = new Terminal(this, "Cathode");
 }
示例#25
0
 public Port()
 {
     external = new Terminal(this, "X1");
 }
示例#26
0
        public static void LayoutSymbol(SymbolLayout Sym, Terminal A, Terminal C, DiodeType Type, Func<string> Name, Func<string> Part)
        {
            Sym.AddTerminal(A, new Coord(0, 20));
            Sym.AddWire(A, new Coord(0, 10));

            Sym.AddTerminal(C, new Coord(0, -20));
            Sym.AddWire(C, new Coord(0, -10));

            Sym.AddLoop(EdgeType.Black,
                new Coord(-10, 10),
                new Coord(10, 10),
                new Coord(0, -10));
            Sym.AddLine(EdgeType.Black, new Coord(-10, -10), new Coord(10, -10));

            switch (Type)
            {
                case DiodeType.LED:
                    Sym.DrawArrow(EdgeType.Black, new Coord(-12, 5), new Coord(-20, -3), 0.2);
                    Sym.DrawArrow(EdgeType.Black, new Coord(-8, -2), new Coord(-16, -10), 0.2);
                    break;
                case DiodeType.Zener:
                    Sym.AddLine(EdgeType.Black, new Coord(-10, -10), new Coord(-10, -5));
                    Sym.AddLine(EdgeType.Black, new Coord(10, -10), new Coord(10, -15));
                    break;
                default:
                    break;
            }

            if (Part != null)
                Sym.DrawText(Part, new Coord(12, 4), Alignment.Near, Alignment.Near);
            Sym.DrawText(Name, new Coord(12, -4), Alignment.Near, Alignment.Far);
        }
示例#27
0
 public override Coord MapTerminal(Terminal T)
 {
     if (T == conductor.Anode) return a;
     else if (T == conductor.Cathode) return b;
     else throw new ArgumentOutOfRangeException("T");
 }
示例#28
0
 /// <summary>
 /// Get the position of the terminal in this symbol.
 /// </summary>
 /// <param name="T"></param>
 /// <returns></returns>
 public Coord MapTerminal(Terminal T)
 {
     return terminals[T];
 }
示例#29
0
 public OneTerminal()
 {
     terminal = new Terminal(this);
 }
        public static void LayoutSymbol(SymbolLayout Sym, BjtType Type, Terminal C, Terminal B, Terminal E, Func<string> Name, Func<string> Part)
        {
            int bx = -5;
            Sym.AddTerminal(B, new Coord(-20, 0), new Coord(bx, 0));
            switch (Type)
            {
                case BjtType.NPN:
                    Sym.AddTerminal(C, new Coord(10, 20), new Coord(10, 17));
                    Sym.AddTerminal(E, new Coord(10, -20), new Coord(10, -17));
                    Sym.DrawLine(EdgeType.Black, new Coord(10, 17), new Coord(bx, 8));
                    Sym.DrawArrow(EdgeType.Black, new Coord(bx, -8), new Coord(10, -17), 0.2, 0.3);
                    break;
                case BjtType.PNP:
                    Sym.AddTerminal(E, new Coord(10, 20), new Coord(10, 17));
                    Sym.AddTerminal(C, new Coord(10, -20), new Coord(10, -17));
                    Sym.DrawArrow(EdgeType.Black, new Coord(10, 17), new Coord(bx, 8), 0.2, 0.3);
                    Sym.DrawLine(EdgeType.Black, new Coord(bx, -8), new Coord(10, -17));
                    break;
                default:
                    throw new NotSupportedException("Unknown BJT type.");
            }
            Sym.DrawLine(EdgeType.Black, new Coord(bx, 12), new Coord(bx, -12));

            if (Part != null)
                Sym.DrawText(Part, new Coord(8, 20), Alignment.Far, Alignment.Near);
            Sym.DrawText(Name, new Point(8, -20), Alignment.Far, Alignment.Far);

            Sym.AddCircle(EdgeType.Black, new Coord(0, 0), 20);
        }