Qucs-GUI  0.0.18
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
amplifier.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  amplifier.cpp - description
3  -------------------
4  begin : Sat Oct 30 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 "amplifier.h"
19 
20 
22 {
23  Description = QObject::tr("ideal amplifier");
24 
25  Lines.append(new Line(-16,-20,-16, 20,QPen(Qt::darkBlue,2)));
26  Lines.append(new Line(-16,-20, 16, 0,QPen(Qt::darkBlue,2)));
27  Lines.append(new Line(-16, 20, 16, 0,QPen(Qt::darkBlue,2)));
28 
29  Lines.append(new Line(-30, 0,-16, 0,QPen(Qt::darkBlue,2)));
30  Lines.append(new Line( 16, 0, 30, 0,QPen(Qt::darkBlue,2)));
31 
32  Ports.append(new Port(-30, 0));
33  Ports.append(new Port( 30, 0));
34 
35  x1 = -30; y1 = -23;
36  x2 = 30; y2 = 23;
37 
38  tx = x1+4;
39  ty = y2+4;
40  Model = "Amp";
41  Name = "X";
42 
43  Props.append(new Property("G", "10", true,
44  QObject::tr("voltage gain")));
45  Props.append(new Property("Z1", "50 Ohm", false,
46  QObject::tr("reference impedance of input port")));
47  Props.append(new Property("Z2", "50 Ohm", false,
48  QObject::tr("reference impedance of output port")));
49  Props.append(new Property("NF", "0 dB", false,
50  QObject::tr("noise figure")));
51 }
52 
54 {
55 }
56 
58 {
59  return new Amplifier();
60 }
61 
62 Element* Amplifier::info(QString& Name, char* &BitmapFile, bool getNewOne)
63 {
64  Name = QObject::tr("Amplifier");
65  BitmapFile = (char *) "amplifier";
66 
67  if(getNewOne) return new Amplifier();
68  return 0;
69 }
Q3PtrList< Line > Lines
Definition: component.h:67
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
Component * newOne()
Definition: amplifier.cpp:57
int ty
Definition: component.h:78
Q3PtrList< Property > Props
Definition: component.h:72
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
QString Model
Definition: component.h:80
QString Description
Definition: component.h:81
int x2
Definition: element.h:153
static Element * info(QString &, char *&, bool getNewOne=false)
Definition: amplifier.cpp:62