My Project  0.0.16
QUCS Mapping
 All Classes Namespaces 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(QPen::darkBlue,2)));
26  Lines.append(new Line(-16,-20, 16, 0,QPen(QPen::darkBlue,2)));
27  Lines.append(new Line(-16, 20, 16, 0,QPen(QPen::darkBlue,2)));
28 
29  Lines.append(new Line(-30, 0,-16, 0,QPen(QPen::darkBlue,2)));
30  Lines.append(new Line( 16, 0, 30, 0,QPen(QPen::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 }