Qucs-GUI  0.0.18
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
opamp.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  opamp.cpp - description
3  -------------------
4  begin : Sun Oct 31 2004
5  copyright : (C) 2004 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 "opamp.h"
19 
20 
22 {
23  Description = QObject::tr("operational amplifier");
24 
25  Lines.append(new Line(-30,-20,-20,-20,QPen(Qt::darkBlue,2)));
26  Lines.append(new Line(-30, 20,-20, 20,QPen(Qt::darkBlue,2)));
27  Lines.append(new Line( 30, 0, 40, 0,QPen(Qt::darkBlue,2)));
28 
29  Lines.append(new Line(-20,-35,-20, 35,QPen(Qt::darkBlue,2)));
30  Lines.append(new Line(-20,-35, 30, 0,QPen(Qt::darkBlue,2)));
31  Lines.append(new Line(-20, 35, 30, 0,QPen(Qt::darkBlue,2)));
32 
33  Lines.append(new Line(-16, 19, -9, 19,QPen(Qt::black,1)));
34  Lines.append(new Line(-16,-19, -9,-19,QPen(Qt::red,1)));
35  Lines.append(new Line(-13,-22,-13,-15,QPen(Qt::red,1)));
36 
37  Ports.append(new Port(-30, 20));
38  Ports.append(new Port(-30,-20));
39  Ports.append(new Port( 40, 0));
40 
41  x1 = -30; y1 = -38;
42  x2 = 30; y2 = 38;
43 
44  tx = x1+4;
45  ty = y2+4;
46  Model = "OpAmp";
47  Name = "OP";
48 
49  Props.append(new Property("G", "1e6", true,
50  QObject::tr("voltage gain")));
51  Props.append(new Property("Umax", "15 V", false,
52  QObject::tr("absolute value of maximum and minimum output voltage")));
53 }
54 
56 {
57 }
58 
60 {
61  return new OpAmp();
62 }
63 
64 Element* OpAmp::info(QString& Name, char* &BitmapFile, bool getNewOne)
65 {
66  Name = QObject::tr("OpAmp");
67  BitmapFile = (char *) "opamp";
68 
69  if(getNewOne) return new OpAmp();
70  return 0;
71 }
Q3PtrList< Line > Lines
Definition: component.h:67
int y1
Definition: element.h:153
Component * newOne()
Definition: opamp.cpp:59
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
~OpAmp()
Definition: opamp.cpp:55
OpAmp()
Definition: opamp.cpp:21
Definition: element.h:48
Superclass of all schematic drawing elements.
Definition: element.h:142
static Element * info(QString &, char *&, bool getNewOne=false)
Definition: opamp.cpp:64
Q3PtrList< Port > Ports
Definition: component.h:70
QString Name
Definition: component.h:80
QString Model
Definition: component.h:80
QString Description
Definition: component.h:81
int x2
Definition: element.h:153