My Project  0.0.16
QUCS Mapping
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
diode.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  diode.cpp
3  -----------
4  begin : Sat Aug 23 2003
5  copyright : (C) 2003 by Michael Margraf
6  email : michael.margraf@alumni.tu-berlin.de
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #include "diode.h"
19 
20 
22 {
23  Description = QObject::tr("diode");
24 
25  Props.append(new Property("Is", "1e-15 A", true,
26  QObject::tr("saturation current")));
27  Props.append(new Property("N", "1", true,
28  QObject::tr("emission coefficient")));
29  Props.append(new Property("Cj0", "10 fF", true,
30  QObject::tr("zero-bias junction capacitance")));
31  Props.append(new Property("M", "0.5", false,
32  QObject::tr("grading coefficient")));
33  Props.append(new Property("Vj", "0.7 V", false,
34  QObject::tr("junction potential")));
35  Props.append(new Property("Fc", "0.5", false,
36  QObject::tr("forward-bias depletion capacitance coefficient")));
37  Props.append(new Property("Cp", "0.0 fF", false,
38  QObject::tr("linear capacitance")));
39  Props.append(new Property("Isr", "0.0", false,
40  QObject::tr("recombination current parameter")));
41  Props.append(new Property("Nr", "2.0", false,
42  QObject::tr("emission coefficient for Isr")));
43  Props.append(new Property("Rs", "0.0 Ohm", false,
44  QObject::tr("ohmic series resistance")));
45  Props.append(new Property("Tt", "0.0 ps", false,
46  QObject::tr("transit time")));
47  Props.append(new Property("Ikf", "0", false,
48  QObject::tr("high-injection knee current (0=infinity)")));
49  Props.append(new Property("Kf", "0.0", false,
50  QObject::tr("flicker noise coefficient")));
51  Props.append(new Property("Af", "1.0", false,
52  QObject::tr("flicker noise exponent")));
53  Props.append(new Property("Ffe", "1.0", false,
54  QObject::tr("flicker noise frequency exponent")));
55  Props.append(new Property("Bv", "0", false,
56  QObject::tr("reverse breakdown voltage")));
57  Props.append(new Property("Ibv", "1 mA", false,
58  QObject::tr("current at reverse breakdown voltage")));
59  Props.append(new Property("Temp", "26.85", false,
60  QObject::tr("simulation temperature in degree Celsius")));
61  Props.append(new Property("Xti", "3.0", false,
62  QObject::tr("saturation current temperature exponent")));
63  Props.append(new Property("Eg", "1.11", false,
64  QObject::tr("energy bandgap in eV")));
65  Props.append(new Property("Tbv", "0.0", false,
66  QObject::tr("Bv linear temperature coefficient")));
67  Props.append(new Property("Trs", "0.0", false,
68  QObject::tr("Rs linear temperature coefficient")));
69  Props.append(new Property("Ttt1", "0.0", false,
70  QObject::tr("Tt linear temperature coefficient")));
71  Props.append(new Property("Ttt2", "0.0", false,
72  QObject::tr("Tt quadratic temperature coefficient")));
73  Props.append(new Property("Tm1", "0.0", false,
74  QObject::tr("M linear temperature coefficient")));
75  Props.append(new Property("Tm2", "0.0", false,
76  QObject::tr("M quadratic temperature coefficient")));
77  Props.append(new Property("Tnom", "26.85", false,
78  QObject::tr("temperature at which parameters were extracted")));
79  Props.append(new Property("Area", "1.0", false,
80  QObject::tr("default area for diode")));
81  Props.append(new Property("Symbol", "normal", false,
82  QObject::tr("schematic symbol")+" [normal, US, Schottky, Zener, Varactor]"));
83 
84  createSymbol();
85  tx = x1+4;
86  ty = y2+4;
87  Model = "Diode";
88  Name = "D";
89 }
90 
92 {
93  return new Diode();
94 }
95 
96 Element* Diode::info(QString& Name, char* &BitmapFile, bool getNewOne)
97 {
98  Name = QObject::tr("Diode");
99  BitmapFile = (char *) "diode";
100 
101  if(getNewOne) return new Diode();
102  return 0;
103 }
104 
105 // -------------------------------------------------------
107 {
108  if(Props.getLast()->Value.at(0) == 'V') {
109  Lines.append(new Line(-30, 0, -9, 0,QPen(QPen::darkBlue,2)));
110  Lines.append(new Line( -6, 0, 30, 0,QPen(QPen::darkBlue,2)));
111  Lines.append(new Line( -9, -9, -9, 9,QPen(QPen::darkBlue,2)));
112  }
113  else if(Props.getLast()->Value.at(0) == 'U') {
114  Lines.append(new Line(-30, 0, -6, 0,QPen(QPen::darkBlue,2)));
115  Lines.append(new Line( 6, 0, 30, 0,QPen(QPen::darkBlue,2)));
116  }
117  else {
118  Lines.append(new Line(-30, 0, 30, 0,QPen(QPen::darkBlue,2)));
119  }
120  Lines.append(new Line( -6, -9, -6, 9,QPen(QPen::darkBlue,2)));
121  Lines.append(new Line( 6, -9, 6, 9,QPen(QPen::darkBlue,2)));
122  Lines.append(new Line( -6, 0, 6, -9,QPen(QPen::darkBlue,2)));
123  Lines.append(new Line( -6, 0, 6, 9,QPen(QPen::darkBlue,2)));
124 
125  if(Props.getLast()->Value.at(0) == 'S') {
126  Lines.append(new Line( -6, -9,-12,-12,QPen(QPen::darkBlue,2)));
127  Lines.append(new Line( -6, 9, 0, 12,QPen(QPen::darkBlue,2)));
128  }
129  else if(Props.getLast()->Value.at(0) == 'Z') {
130  Lines.append(new Line( -6, 9, -1, 9,QPen(QPen::darkBlue,2)));
131  }
132 
133  Ports.append(new Port(-30, 0));
134  Ports.append(new Port( 30, 0));
135 
136  x1 = -30; y1 = -11;
137  x2 = 30; y2 = 11;
138 }