Qucs-GUI  0.0.18
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
log_amp.cpp
Go to the documentation of this file.
1 /*
2  * log_amp.cpp - device implementations for log_amp 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 "log_amp.h"
12 
14 {
15  Description = QObject::tr ("Logarithmic Amplifier verilog device");
16 
17  Props.append (new Property ("Kv", "1.0", false,
18  QObject::tr ("scale factor")));
19  Props.append (new Property ("Dk", "0.3", false,
20  QObject::tr ("scale factor error")
21  +" ("+QObject::tr ("%")+")"));
22  Props.append (new Property ("Ib1", "5e-12", false,
23  QObject::tr ("input I1 bias current")
24  +" ("+QObject::tr ("A")+")"));
25  Props.append (new Property ("Ibr", "5e-12", false,
26  QObject::tr ("input reference bias current")
27  +" ("+QObject::tr ("A")+")"));
28  Props.append (new Property ("M", "5", false,
29  QObject::tr ("number of decades")));
30  Props.append (new Property ("N", "0.1", false,
31  QObject::tr ("conformity error")
32  +" ("+QObject::tr ("%")+")"));
33  Props.append (new Property ("Vosout", "3e-3", false,
34  QObject::tr ("output offset error")
35  +" ("+QObject::tr ("V")+")"));
36  Props.append (new Property ("Rinp", "1e6", false,
37  QObject::tr ("amplifier input resistance")
38  +" ("+QObject::tr ("Ohm")+")"));
39  Props.append (new Property ("Fc", "1e3", false,
40  QObject::tr ("amplifier 3dB frequency")
41  +" ("+QObject::tr ("Hz")+")"));
42  Props.append (new Property ("Ro", "1e-3", false,
43  QObject::tr ("amplifier output resistance")
44  +" ("+QObject::tr ("Ohm")+")"));
45  Props.append (new Property ("Ntc", "0.002", false,
46  QObject::tr ("conformity error temperature coefficient")
47  +" ("+QObject::tr ("%/Celsius")+")"));
48  Props.append (new Property ("Vosouttc", "80e-6", false,
49  QObject::tr ("offset temperature coefficient")
50  +" ("+QObject::tr ("V/Celsius")+")"));
51  Props.append (new Property ("Dktc", "0.03", false,
52  QObject::tr ("scale factor error temperature coefficient")
53  +" ("+QObject::tr ("%/Celsius")+")"));
54  Props.append (new Property ("Ib1tc", "0.5e-12", false,
55  QObject::tr ("input I1 bias current temperature coefficient")
56  +" ("+QObject::tr ("A/Celsius")+")"));
57  Props.append (new Property ("Ibrtc", "0.5e-12", false,
58  QObject::tr ("input reference bias current temperature coefficient")
59  +" ("+QObject::tr ("A/Celsius")+")"));
60  Props.append (new Property ("Tnom", "26.85", false,
61  QObject::tr ("parameter measurement temperature")
62  +" ("+QObject::tr ("Celsius")+")"));
63  Props.append (new Property ("Temp", "26.85", false,
64  QObject::tr ("simulation temperature")));
65 
66  createSymbol ();
67  tx = x2 + 4;
68  ty = y1 + 4;
69  Model = "log_amp";
70  Name = "LA";
71 }
72 
74 {
75  log_amp * p = new log_amp();
76  p->Props.getFirst()->Value = Props.getFirst()->Value;
77  p->recreate(0);
78  return p;
79 }
80 
81 Element * log_amp::info(QString& Name, char * &BitmapFile, bool getNewOne)
82 {
83  Name = QObject::tr("Logarithmic Amplifier");
84  BitmapFile = (char *) "log_amp";
85 
86  if(getNewOne) return new log_amp();
87  return 0;
88 }
89 
91 {
92  Lines.append(new Line(-30,-20,-20,-20,QPen(Qt::darkBlue,2)));
93  Lines.append(new Line(-30, 20,-20, 20,QPen(Qt::darkBlue,2)));
94  Lines.append(new Line( 30, 0, 40, 0,QPen(Qt::darkBlue,2)));
95 
96  Lines.append(new Line(-20,-35,-20, 35,QPen(Qt::darkBlue,2)));
97  Lines.append(new Line(-20,-35, 30, 0,QPen(Qt::darkBlue,2)));
98  Lines.append(new Line(-20, 35, 30, 0,QPen(Qt::darkBlue,2)));
99 
100  Lines.append(new Line(-5, -10, -5, 10,QPen(Qt::red,2)));
101  Lines.append(new Line(-5, 10, 5, 10,QPen(Qt::red,2)));
102 
103  Texts.append(new Text(-17, -26, QObject::tr("I"), Qt::black, 10.0, 1.0, 0.0));
104  Texts.append(new Text(-17, 14, QObject::tr("R"), Qt::black, 10.0, 1.0, 0.0));
105 
106  Ports.append(new Port(-30,-20));
107  Ports.append(new Port(-30, 20));
108  Ports.append(new Port( 40, 0));
109 
110  x1 = -30; y1 = -38;
111  x2 = 40; y2 = 38;
112 }
Q3PtrList< Line > Lines
Definition: component.h:67
void createSymbol()
Definition: log_amp.cpp:90
int y1
Definition: element.h:153
int tx
Definition: component.h:78
int y2
Definition: element.h:153
Definition: element.h:72
int x1
Definition: element.h:153
int ty
Definition: component.h:78
Q3PtrList< Property > Props
Definition: component.h:72
log_amp()
Definition: log_amp.cpp:13
static Element * info(QString &, char *&, bool getNewOne=false)
Definition: log_amp.cpp:81
Definition: element.h:82
Definition: element.h:48
Superclass of all schematic drawing elements.
Definition: element.h:142
Q3PtrList< Port > Ports
Definition: component.h:70
QString Name
Definition: component.h:80
Q3PtrList< Text > Texts
Definition: component.h:71
QString Model
Definition: component.h:80
QString Description
Definition: component.h:81
int x2
Definition: element.h:153
Component * newOne()
Definition: log_amp.cpp:73
virtual void recreate(Schematic *)
Definition: component.h:39