Qucs-GUI  0.0.19
/home/travis/build/Qucs/qucs/qucs/qucs/components/phototransistor.cpp
Go to the documentation of this file.
00001 /*
00002  * phototransistor.cpp - device implementations for phototransistor module
00003  *
00004  * This is free software; you can redistribute it and/or modify
00005  * it under the terms of the GNU General Public License as published by
00006  * the Free Software Foundation; either version 2, or (at your option)
00007  * any later version.
00008  * 
00009  */
00010 
00011 #include "phototransistor.h"
00012 
00013 phototransistor::phototransistor()
00014 {
00015   Description = QObject::tr ("Phototransistor verilog device");
00016 
00017   Props.append (new Property ("Bf", "100", false,
00018     QObject::tr ("forward beta")));
00019   Props.append (new Property ("Br", "0.1", false,
00020     QObject::tr ("reverse beta")));
00021   Props.append (new Property ("Is", "1e-10", false,
00022     QObject::tr ("dark current")
00023     +" ("+QObject::tr ("A")+")"));
00024   Props.append (new Property ("Nf", "1", false,
00025     QObject::tr ("forward emission coefficient")));
00026   Props.append (new Property ("Nr", "1", false,
00027     QObject::tr ("reverse emission coefficient")));
00028   Props.append (new Property ("Vaf", "100", false,
00029     QObject::tr ("forward early voltage")
00030     +" ("+QObject::tr ("V")+")"));
00031   Props.append (new Property ("Var", "100", false,
00032     QObject::tr ("reverse early voltage")
00033     +" ("+QObject::tr ("V")+")"));
00034   Props.append (new Property ("Mje", "0.33", false,
00035     QObject::tr ("base-emitter junction exponential factor")));
00036   Props.append (new Property ("Vje", "0.75", false,
00037     QObject::tr ("base-emitter junction built-in potential")
00038     +" ("+QObject::tr ("V")+")"));
00039   Props.append (new Property ("Cje", "1e-12", false,
00040     QObject::tr ("base-emitter zero-bias depletion capacitance")
00041     +" ("+QObject::tr ("F")+")"));
00042   Props.append (new Property ("Mjc", "0.33", false,
00043     QObject::tr ("base-collector junction exponential factor")));
00044   Props.append (new Property ("Vjc", "0.75", false,
00045     QObject::tr ("base-collector junction built-in potential")
00046     +" ("+QObject::tr ("V")+")"));
00047   Props.append (new Property ("Cjc", "2e-12", false,
00048     QObject::tr ("base-collector zero-bias depletion capacitance")
00049     +" ("+QObject::tr ("F")+")"));
00050   Props.append (new Property ("Tr", "100n", false,
00051     QObject::tr ("ideal reverse transit time")
00052     +" ("+QObject::tr ("s")+")"));
00053   Props.append (new Property ("Tf", "0.1n", false,
00054     QObject::tr ("ideal forward transit time")
00055     +" ("+QObject::tr ("s")+")"));
00056   Props.append (new Property ("Ikf", "10", false,
00057     QObject::tr ("high current corner for forward beta")
00058     +" ("+QObject::tr ("A")+")"));
00059   Props.append (new Property ("Ikr", "10", false,
00060     QObject::tr ("high current corner for reverse beta")
00061     +" ("+QObject::tr ("A")+")"));
00062   Props.append (new Property ("Rc", "10", false,
00063     QObject::tr ("collector series resistance")
00064     +" ("+QObject::tr ("Ohm")+")"));
00065   Props.append (new Property ("Re", "1", false,
00066     QObject::tr ("emitter series resistance")
00067     +" ("+QObject::tr ("Ohm")+")"));
00068   Props.append (new Property ("Rb", "100", false,
00069     QObject::tr ("base series resistance")
00070     +" ("+QObject::tr ("Ohm")+")"));
00071   Props.append (new Property ("Kf", "1e-12", false,
00072     QObject::tr ("flicker noise coefficient")));
00073   Props.append (new Property ("Ffe", "1", false,
00074     QObject::tr ("flicker noise coefficient")));
00075   Props.append (new Property ("Af", "1", false,
00076     QObject::tr ("flicker noise exponent")));
00077   Props.append (new Property ("Responsivity", "1.5", false,
00078     QObject::tr ("responsivity at relative selectivity=100%")
00079     +" ("+QObject::tr ("A/W")+")"));
00080   Props.append (new Property ("P0", "2.6122e3", false,
00081     QObject::tr ("relative selectivity polynomial coefficient")));
00082   Props.append (new Property ("P1", "-1.489e1", false,
00083     QObject::tr ("relative selectivity polynomial coefficient")));
00084   Props.append (new Property ("P2", "3.0332e-2", false,
00085     QObject::tr ("relative selectivity polynomial coefficient")));
00086   Props.append (new Property ("P3", "-2.5708e-5", false,
00087     QObject::tr ("relative selectivity polynomial coefficient")));
00088   Props.append (new Property ("P4", "7.6923e-9", false,
00089     QObject::tr ("relative selectivity polynomial coefficient")));
00090   Props.append (new Property ("Temp", "26.85", false,
00091     QObject::tr ("simulation temperature")));
00092 
00093   createSymbol ();
00094   tx = x2 + 4;
00095   ty = y1 +24;
00096   Model = "phototransistor";
00097   Name  = "PT";
00098 }
00099 
00100 Component * phototransistor::newOne()
00101 {
00102   phototransistor * p = new phototransistor();
00103   p->Props.getFirst()->Value = Props.getFirst()->Value; 
00104   p->recreate(0); 
00105   return p;
00106 }
00107 
00108 Element * phototransistor::info(QString& Name, char * &BitmapFile, bool getNewOne)
00109 {
00110   Name = QObject::tr("Phototransistor");
00111   BitmapFile = (char *) "phototransistor";
00112 
00113   if(getNewOne) return new phototransistor();
00114   return 0;
00115 }
00116 
00117 void phototransistor::createSymbol()
00118 {
00119   Arcs.append(new Arc(-25,-20, 40, 40,  0,16*360,QPen(Qt::red,2)));
00120   Lines.append(new Line(-10,-15,-10, 15,QPen(Qt::darkBlue,3)));
00121   Lines.append(new Line(-30,  0,-10,  0,QPen(Qt::darkBlue,2)));
00122   Lines.append(new Line(-10, -5,  0,-15,QPen(Qt::darkBlue,2)));
00123   Lines.append(new Line(  0,-15,  0,-30,QPen(Qt::darkBlue,2)));
00124   Lines.append(new Line(-10,  5,  0, 15,QPen(Qt::darkBlue,2)));
00125   Lines.append(new Line(  0, 15,  0, 30,QPen(Qt::darkBlue,2)));
00126   Lines.append(new Line( -6, 15,  0, 15,QPen(Qt::darkBlue,2)));
00127   Lines.append(new Line(  0,  9,  0, 15,QPen(Qt::darkBlue,2)));
00128 
00129   Lines.append(new Line(-50, -50, -40, -50,QPen(Qt::green,2)));
00130   Lines.append(new Line(-40, -50, -40, -30,QPen(Qt::green,2)));
00131   Lines.append(new Line(-40, -30, -50, -30,QPen(Qt::green,2)));
00132 
00133   // green arrow
00134   Lines.append(new Line(-40, -40, -16, -16,QPen(Qt::green,2)));
00135   Lines.append(new Line(-16, -16, -16, -23,QPen(Qt::green,2)));
00136   Lines.append(new Line(-16, -16, -23, -16,QPen(Qt::green,2)));
00137 
00138   // P
00139   Lines.append(new Line(-60, -55, -60, -65,QPen(Qt::black,2)));
00140   Lines.append(new Line(-60, -65, -55, -65,QPen(Qt::black,2)));
00141   Lines.append(new Line(-55, -65, -55, -60,QPen(Qt::black,2)));
00142   Lines.append(new Line(-60, -60, -55, -60,QPen(Qt::black,2)));
00143 
00144   // W
00145   Lines.append(new Line(-63, -40, -60, -35,QPen(Qt::black,2)));
00146   Lines.append(new Line(-60, -35, -57, -40,QPen(Qt::black,2)));
00147   Lines.append(new Line(-57, -40, -54, -35,QPen(Qt::black,2)));
00148   Lines.append(new Line(-54, -35, -51, -40,QPen(Qt::black,2)));
00149 
00150   Ports.append(new Port(  0,-30)); // Collector
00151   Ports.append(new Port(-30,  0)); // Base
00152   Ports.append(new Port(  0, 30)); // Emitter
00153   Ports.append(new Port(-50,-50)); // Power
00154   Ports.append(new Port(-50,-30)); // Wavelength
00155 
00156   x1 = -50; y1 = -60;
00157   x2 =  20; y2 =  30;
00158 }
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines