Qucs-GUI
0.0.19
|
00001 /*************************************************************************** 00002 diode.cpp 00003 ----------- 00004 begin : Sat Aug 23 2003 00005 copyright : (C) 2003 by Michael Margraf 00006 email : michael.margraf@alumni.tu-berlin.de 00007 ***************************************************************************/ 00008 00009 /*************************************************************************** 00010 * * 00011 * This program is free software; you can redistribute it and/or modify * 00012 * it under the terms of the GNU General Public License as published by * 00013 * the Free Software Foundation; either version 2 of the License, or * 00014 * (at your option) any later version. * 00015 * * 00016 ***************************************************************************/ 00017 00018 #include "diode.h" 00019 00020 00021 Diode::Diode() 00022 { 00023 Description = QObject::tr("diode"); 00024 00025 Props.append(new Property("Is", "1e-15 A", true, 00026 QObject::tr("saturation current"))); 00027 Props.append(new Property("N", "1", true, 00028 QObject::tr("emission coefficient"))); 00029 Props.append(new Property("Cj0", "10 fF", true, 00030 QObject::tr("zero-bias junction capacitance"))); 00031 Props.append(new Property("M", "0.5", false, 00032 QObject::tr("grading coefficient"))); 00033 Props.append(new Property("Vj", "0.7 V", false, 00034 QObject::tr("junction potential"))); 00035 Props.append(new Property("Fc", "0.5", false, 00036 QObject::tr("forward-bias depletion capacitance coefficient"))); 00037 Props.append(new Property("Cp", "0.0 fF", false, 00038 QObject::tr("linear capacitance"))); 00039 Props.append(new Property("Isr", "0.0", false, 00040 QObject::tr("recombination current parameter"))); 00041 Props.append(new Property("Nr", "2.0", false, 00042 QObject::tr("emission coefficient for Isr"))); 00043 Props.append(new Property("Rs", "0.0 Ohm", false, 00044 QObject::tr("ohmic series resistance"))); 00045 Props.append(new Property("Tt", "0.0 ps", false, 00046 QObject::tr("transit time"))); 00047 Props.append(new Property("Ikf", "0", false, 00048 QObject::tr("high-injection knee current (0=infinity)"))); 00049 Props.append(new Property("Kf", "0.0", false, 00050 QObject::tr("flicker noise coefficient"))); 00051 Props.append(new Property("Af", "1.0", false, 00052 QObject::tr("flicker noise exponent"))); 00053 Props.append(new Property("Ffe", "1.0", false, 00054 QObject::tr("flicker noise frequency exponent"))); 00055 Props.append(new Property("Bv", "0", false, 00056 QObject::tr("reverse breakdown voltage"))); 00057 Props.append(new Property("Ibv", "1 mA", false, 00058 QObject::tr("current at reverse breakdown voltage"))); 00059 Props.append(new Property("Temp", "26.85", false, 00060 QObject::tr("simulation temperature in degree Celsius"))); 00061 Props.append(new Property("Xti", "3.0", false, 00062 QObject::tr("saturation current temperature exponent"))); 00063 Props.append(new Property("Eg", "1.11", false, 00064 QObject::tr("energy bandgap in eV"))); 00065 Props.append(new Property("Tbv", "0.0", false, 00066 QObject::tr("Bv linear temperature coefficient"))); 00067 Props.append(new Property("Trs", "0.0", false, 00068 QObject::tr("Rs linear temperature coefficient"))); 00069 Props.append(new Property("Ttt1", "0.0", false, 00070 QObject::tr("Tt linear temperature coefficient"))); 00071 Props.append(new Property("Ttt2", "0.0", false, 00072 QObject::tr("Tt quadratic temperature coefficient"))); 00073 Props.append(new Property("Tm1", "0.0", false, 00074 QObject::tr("M linear temperature coefficient"))); 00075 Props.append(new Property("Tm2", "0.0", false, 00076 QObject::tr("M quadratic temperature coefficient"))); 00077 Props.append(new Property("Tnom", "26.85", false, 00078 QObject::tr("temperature at which parameters were extracted"))); 00079 Props.append(new Property("Area", "1.0", false, 00080 QObject::tr("default area for diode"))); 00081 Props.append(new Property("Symbol", "normal", false, 00082 QObject::tr("schematic symbol")+" [normal, US, Schottky, Zener, Varactor]")); 00083 00084 createSymbol(); 00085 tx = x1+4; 00086 ty = y2+4; 00087 Model = "Diode"; 00088 Name = "D"; 00089 } 00090 00091 Component* Diode::newOne() 00092 { 00093 return new Diode(); 00094 } 00095 00096 Element* Diode::info(QString& Name, char* &BitmapFile, bool getNewOne) 00097 { 00098 Name = QObject::tr("Diode"); 00099 BitmapFile = (char *) "diode"; 00100 00101 if(getNewOne) return new Diode(); 00102 return 0; 00103 } 00104 00105 // ------------------------------------------------------- 00106 void Diode::createSymbol() 00107 { 00108 if(Props.getLast()->Value.at(0) == 'V') { 00109 Lines.append(new Line(-30, 0, -9, 0,QPen(Qt::darkBlue,2))); 00110 Lines.append(new Line( -6, 0, 30, 0,QPen(Qt::darkBlue,2))); 00111 Lines.append(new Line( -9, -9, -9, 9,QPen(Qt::darkBlue,2))); 00112 } 00113 else if(Props.getLast()->Value.at(0) == 'U') { 00114 Lines.append(new Line(-30, 0, -6, 0,QPen(Qt::darkBlue,2))); 00115 Lines.append(new Line( 6, 0, 30, 0,QPen(Qt::darkBlue,2))); 00116 } 00117 else { 00118 Lines.append(new Line(-30, 0, 30, 0,QPen(Qt::darkBlue,2))); 00119 } 00120 Lines.append(new Line( -6, -9, -6, 9,QPen(Qt::darkBlue,2))); 00121 Lines.append(new Line( 6, -9, 6, 9,QPen(Qt::darkBlue,2))); 00122 Lines.append(new Line( -6, 0, 6, -9,QPen(Qt::darkBlue,2))); 00123 Lines.append(new Line( -6, 0, 6, 9,QPen(Qt::darkBlue,2))); 00124 00125 if(Props.getLast()->Value.at(0) == 'S') { 00126 Lines.append(new Line( -6, -9,-12,-12,QPen(Qt::darkBlue,2))); 00127 Lines.append(new Line( -6, 9, 0, 12,QPen(Qt::darkBlue,2))); 00128 } 00129 else if(Props.getLast()->Value.at(0) == 'Z') { 00130 Lines.append(new Line( -6, 9, -1, 9,QPen(Qt::darkBlue,2))); 00131 } 00132 00133 Ports.append(new Port(-30, 0)); 00134 Ports.append(new Port( 30, 0)); 00135 00136 x1 = -30; y1 = -11; 00137 x2 = 30; y2 = 11; 00138 }