Qucs-GUI  0.0.19
/home/travis/build/Qucs/qucs/qucs/qucs/components/opamp.cpp
Go to the documentation of this file.
00001 /***************************************************************************
00002                           opamp.cpp  -  description
00003                              -------------------
00004     begin                : Sun Oct 31 2004
00005     copyright            : (C) 2004 by Michael Margraf
00006     email                : michael.margraf@alumni.tu-berlin.de
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00018 #include "opamp.h"
00019 
00020 
00021 OpAmp::OpAmp()
00022 {
00023   Description = QObject::tr("operational amplifier");
00024 
00025   Lines.append(new Line(-30,-20,-20,-20,QPen(Qt::darkBlue,2)));
00026   Lines.append(new Line(-30, 20,-20, 20,QPen(Qt::darkBlue,2)));
00027   Lines.append(new Line( 30,  0, 40,  0,QPen(Qt::darkBlue,2)));
00028 
00029   Lines.append(new Line(-20,-35,-20, 35,QPen(Qt::darkBlue,2)));
00030   Lines.append(new Line(-20,-35, 30,  0,QPen(Qt::darkBlue,2)));
00031   Lines.append(new Line(-20, 35, 30,  0,QPen(Qt::darkBlue,2)));
00032 
00033   Lines.append(new Line(-16, 19, -9, 19,QPen(Qt::black,1)));
00034   Lines.append(new Line(-16,-19, -9,-19,QPen(Qt::red,1)));
00035   Lines.append(new Line(-13,-22,-13,-15,QPen(Qt::red,1)));
00036 
00037   Ports.append(new Port(-30, 20));
00038   Ports.append(new Port(-30,-20));
00039   Ports.append(new Port( 40,  0));
00040 
00041   x1 = -30; y1 = -38;
00042   x2 =  30; y2 =  38;
00043 
00044   tx = x1+4;
00045   ty = y2+4;
00046   Model = "OpAmp";
00047   Name  = "OP";
00048 
00049   Props.append(new Property("G", "1e6", true,
00050     QObject::tr("voltage gain")));
00051   Props.append(new Property("Umax", "15 V", false,
00052   QObject::tr("absolute value of maximum and minimum output voltage")));
00053 }
00054 
00055 OpAmp::~OpAmp()
00056 {
00057 }
00058 
00059 Component* OpAmp::newOne()
00060 {
00061   return new OpAmp();
00062 }
00063 
00064 Element* OpAmp::info(QString& Name, char* &BitmapFile, bool getNewOne)
00065 {
00066   Name = QObject::tr("OpAmp");
00067   BitmapFile = (char *) "opamp";
00068 
00069   if(getNewOne)  return new OpAmp();
00070   return 0;
00071 }
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines