My Project  0.0.16
QUCS Mapping
 All Classes Namespaces 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(QPen::darkBlue,2)));
26  Lines.append(new Line(-30, 20,-20, 20,QPen(QPen::darkBlue,2)));
27  Lines.append(new Line( 30, 0, 40, 0,QPen(QPen::darkBlue,2)));
28 
29  Lines.append(new Line(-20,-35,-20, 35,QPen(QPen::darkBlue,2)));
30  Lines.append(new Line(-20,-35, 30, 0,QPen(QPen::darkBlue,2)));
31  Lines.append(new Line(-20, 35, 30, 0,QPen(QPen::darkBlue,2)));
32 
33  Lines.append(new Line(-16, 19, -9, 19,QPen(QPen::black,1)));
34  Lines.append(new Line(-16,-19, -9,-19,QPen(QPen::red,1)));
35  Lines.append(new Line(-13,-22,-13,-15,QPen(QPen::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 }