My Project  0.0.16
QUCS Mapping
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
phototransistor.cpp
Go to the documentation of this file.
1 /*
2  * phototransistor.cpp - device implementations for phototransistor module
3  *
4  * This is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2, or (at your option)
7  * any later version.
8  *
9  */
10 
11 #include "phototransistor.h"
12 
14 {
15  Description = QObject::tr ("Phototransistor verilog device");
16 
17  Props.append (new Property ("Bf", "100", false,
18  QObject::tr ("forward beta")));
19  Props.append (new Property ("Br", "0.1", false,
20  QObject::tr ("reverse beta")));
21  Props.append (new Property ("Is", "1e-10", false,
22  QObject::tr ("dark current")
23  +" ("+QObject::tr ("A")+")"));
24  Props.append (new Property ("Nf", "1", false,
25  QObject::tr ("forward emission coefficient")));
26  Props.append (new Property ("Nr", "1", false,
27  QObject::tr ("reverse emission coefficient")));
28  Props.append (new Property ("Vaf", "100", false,
29  QObject::tr ("forward early voltage")
30  +" ("+QObject::tr ("V")+")"));
31  Props.append (new Property ("Var", "100", false,
32  QObject::tr ("reverse early voltage")
33  +" ("+QObject::tr ("V")+")"));
34  Props.append (new Property ("Mje", "0.33", false,
35  QObject::tr ("base-emitter junction exponential factor")));
36  Props.append (new Property ("Vje", "0.75", false,
37  QObject::tr ("base-emitter junction built-in potential")
38  +" ("+QObject::tr ("V")+")"));
39  Props.append (new Property ("Cje", "1e-12", false,
40  QObject::tr ("base-emitter zero-bias depletion capacitance")
41  +" ("+QObject::tr ("F")+")"));
42  Props.append (new Property ("Mjc", "0.33", false,
43  QObject::tr ("base-collector junction exponential factor")));
44  Props.append (new Property ("Vjc", "0.75", false,
45  QObject::tr ("base-collector junction built-in potential")
46  +" ("+QObject::tr ("V")+")"));
47  Props.append (new Property ("Cjc", "2e-12", false,
48  QObject::tr ("base-collector zero-bias depletion capacitance")
49  +" ("+QObject::tr ("F")+")"));
50  Props.append (new Property ("Tr", "100n", false,
51  QObject::tr ("ideal reverse transit time")
52  +" ("+QObject::tr ("s")+")"));
53  Props.append (new Property ("Tf", "0.1n", false,
54  QObject::tr ("ideal forward transit time")
55  +" ("+QObject::tr ("s")+")"));
56  Props.append (new Property ("Ikf", "10", false,
57  QObject::tr ("high current corner for forward beta")
58  +" ("+QObject::tr ("A")+")"));
59  Props.append (new Property ("Ikr", "10", false,
60  QObject::tr ("high current corner for reverse beta")
61  +" ("+QObject::tr ("A")+")"));
62  Props.append (new Property ("Rc", "10", false,
63  QObject::tr ("collector series resistance")
64  +" ("+QObject::tr ("Ohm")+")"));
65  Props.append (new Property ("Re", "1", false,
66  QObject::tr ("emitter series resistance")
67  +" ("+QObject::tr ("Ohm")+")"));
68  Props.append (new Property ("Rb", "100", false,
69  QObject::tr ("base series resistance")
70  +" ("+QObject::tr ("Ohm")+")"));
71  Props.append (new Property ("Kf", "1e-12", false,
72  QObject::tr ("flicker noise coefficient")));
73  Props.append (new Property ("Ffe", "1", false,
74  QObject::tr ("flicker noise coefficient")));
75  Props.append (new Property ("Af", "1", false,
76  QObject::tr ("flicker noise exponent")));
77  Props.append (new Property ("Responsivity", "1.5", false,
78  QObject::tr ("responsivity at relative selectivity=100%")
79  +" ("+QObject::tr ("A/W")+")"));
80  Props.append (new Property ("P0", "2.6122e3", false,
81  QObject::tr ("relative selectivity polynomial coefficient")));
82  Props.append (new Property ("P1", "-1.489e1", false,
83  QObject::tr ("relative selectivity polynomial coefficient")));
84  Props.append (new Property ("P2", "3.0332e-2", false,
85  QObject::tr ("relative selectivity polynomial coefficient")));
86  Props.append (new Property ("P3", "-2.5708e-5", false,
87  QObject::tr ("relative selectivity polynomial coefficient")));
88  Props.append (new Property ("P4", "7.6923e-9", false,
89  QObject::tr ("relative selectivity polynomial coefficient")));
90  Props.append (new Property ("Temp", "26.85", false,
91  QObject::tr ("simulation temperature")));
92 
93  createSymbol ();
94  tx = x2 + 4;
95  ty = y1 +24;
96  Model = "phototransistor";
97  Name = "PT";
98 }
99 
101 {
102  phototransistor * p = new phototransistor();
103  p->Props.getFirst()->Value = Props.getFirst()->Value;
104  p->recreate(0);
105  return p;
106 }
107 
108 Element * phototransistor::info(QString& Name, char * &BitmapFile, bool getNewOne)
109 {
110  Name = QObject::tr("Phototransistor");
111  BitmapFile = (char *) "phototransistor";
112 
113  if(getNewOne) return new phototransistor();
114  return 0;
115 }
116 
118 {
119  Arcs.append(new Arc(-25,-20, 40, 40, 0,16*360,QPen(QPen::red,2)));
120  Lines.append(new Line(-10,-15,-10, 15,QPen(QPen::darkBlue,3)));
121  Lines.append(new Line(-30, 0,-10, 0,QPen(QPen::darkBlue,2)));
122  Lines.append(new Line(-10, -5, 0,-15,QPen(QPen::darkBlue,2)));
123  Lines.append(new Line( 0,-15, 0,-30,QPen(QPen::darkBlue,2)));
124  Lines.append(new Line(-10, 5, 0, 15,QPen(QPen::darkBlue,2)));
125  Lines.append(new Line( 0, 15, 0, 30,QPen(QPen::darkBlue,2)));
126  Lines.append(new Line( -6, 15, 0, 15,QPen(QPen::darkBlue,2)));
127  Lines.append(new Line( 0, 9, 0, 15,QPen(QPen::darkBlue,2)));
128 
129  Lines.append(new Line(-50, -50, -40, -50,QPen(QPen::green,2)));
130  Lines.append(new Line(-40, -50, -40, -30,QPen(QPen::green,2)));
131  Lines.append(new Line(-40, -30, -50, -30,QPen(QPen::green,2)));
132 
133  // green arrow
134  Lines.append(new Line(-40, -40, -16, -16,QPen(QPen::green,2)));
135  Lines.append(new Line(-16, -16, -16, -23,QPen(QPen::green,2)));
136  Lines.append(new Line(-16, -16, -23, -16,QPen(QPen::green,2)));
137 
138  // P
139  Lines.append(new Line(-60, -55, -60, -65,QPen(QPen::black,2)));
140  Lines.append(new Line(-60, -65, -55, -65,QPen(QPen::black,2)));
141  Lines.append(new Line(-55, -65, -55, -60,QPen(QPen::black,2)));
142  Lines.append(new Line(-60, -60, -55, -60,QPen(QPen::black,2)));
143 
144  // W
145  Lines.append(new Line(-63, -40, -60, -35,QPen(QPen::black,2)));
146  Lines.append(new Line(-60, -35, -57, -40,QPen(QPen::black,2)));
147  Lines.append(new Line(-57, -40, -54, -35,QPen(QPen::black,2)));
148  Lines.append(new Line(-54, -35, -51, -40,QPen(QPen::black,2)));
149 
150  Ports.append(new Port( 0,-30)); // Collector
151  Ports.append(new Port(-30, 0)); // Base
152  Ports.append(new Port( 0, 30)); // Emitter
153  Ports.append(new Port(-50,-50)); // Power
154  Ports.append(new Port(-50,-30)); // Wavelength
155 
156  x1 = -50; y1 = -60;
157  x2 = 20; y2 = 30;
158 }