My Project  0.0.16
QUCS Mapping
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
attenuator.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  attenuator.cpp - description
3  -------------------
4  begin : Sat Aug 23 2003
5  copyright : (C) 2003 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 "attenuator.h"
19 
20 
22 {
23  Description = QObject::tr("attenuator");
24 
25  Lines.append(new Line( -4, -6, -4, 6,QPen(QPen::darkBlue,2)));
26  Lines.append(new Line( -4, -6, 4, -6,QPen(QPen::darkBlue,2)));
27  Lines.append(new Line( 4, -6, 4, 6,QPen(QPen::darkBlue,2)));
28  Lines.append(new Line( -4, 6, 4, 6,QPen(QPen::darkBlue,2)));
29  Lines.append(new Line( 0,-11, 0, -6,QPen(QPen::darkBlue,2)));
30  Lines.append(new Line( 0, 6, 0, 11,QPen(QPen::darkBlue,2)));
31 
32  Lines.append(new Line(-14,-14, 14,-14,QPen(QPen::darkBlue,2)));
33  Lines.append(new Line(-14, 14, 14, 14,QPen(QPen::darkBlue,2)));
34  Lines.append(new Line(-14,-14,-14, 14,QPen(QPen::darkBlue,2)));
35  Lines.append(new Line( 14,-14, 14, 14,QPen(QPen::darkBlue,2)));
36 
37  Lines.append(new Line(-30, 0,-14, 0,QPen(QPen::darkBlue,2)));
38  Lines.append(new Line( 14, 0, 30, 0,QPen(QPen::darkBlue,2)));
39 
40  Ports.append(new Port(-30, 0));
41  Ports.append(new Port( 30, 0));
42 
43  x1 = -30; y1 = -17;
44  x2 = 30; y2 = 17;
45 
46  tx = x1+4;
47  ty = y2+4;
48  Model = "Attenuator";
49  Name = "X";
50 
51  Props.append(new Property("L", "10 dB", true,
52  QObject::tr("power attenuation")));
53  Props.append(new Property("Zref", "50 Ohm", false,
54  QObject::tr("reference impedance")));
55  Props.append(new Property("Temp", "26.85", false,
56  QObject::tr("simulation temperature in degree Celsius")));
57 }
58 
60 {
61 }
62 
64 {
65  return new Attenuator();
66 }
67 
68 Element* Attenuator::info(QString& Name, char* &BitmapFile, bool getNewOne)
69 {
70  Name = QObject::tr("Attenuator");
71  BitmapFile = (char *) "attenuator";
72 
73  if(getNewOne) return new Attenuator();
74  return 0;
75 }