Qucs-GUI  0.0.18
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
coupler.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  coupler.cpp
3  -------------
4  begin : Tue Jan 03 2006
5  copyright : (C) 2006 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 "coupler.h"
19 
20 
22 {
23  Description = QObject::tr("ideal coupler");
24 
25  Lines.append(new Line(-23,-24, 23,-24,QPen(Qt::darkGray,1)));
26  Lines.append(new Line( 23,-24, 23, 24,QPen(Qt::darkGray,1)));
27  Lines.append(new Line( 23, 24,-23, 24,QPen(Qt::darkGray,1)));
28  Lines.append(new Line(-23, 24,-23,-24,QPen(Qt::darkGray,1)));
29 
30  Lines.append(new Line(-30,-20,-20,-20,QPen(Qt::darkBlue,2)));
31  Lines.append(new Line( 30,-20, 20,-20,QPen(Qt::darkBlue,2)));
32  Lines.append(new Line(-20,-20, 20,-20,QPen(Qt::darkBlue,4)));
33  Lines.append(new Line(-30, 20,-20, 20,QPen(Qt::darkBlue,2)));
34  Lines.append(new Line( 30, 20, 20, 20,QPen(Qt::darkBlue,2)));
35  Lines.append(new Line(-20, 20, 20, 20,QPen(Qt::darkBlue,4)));
36 
37  Lines.append(new Line( 14, 14,-14,-14,QPen(Qt::darkBlue,1)));
38  Lines.append(new Line(-14,-14, -9,-14,QPen(Qt::darkBlue,1)));
39  Lines.append(new Line(-14,-14,-14, -9,QPen(Qt::darkBlue,1)));
40  Lines.append(new Line( 9, 14, 14, 14,QPen(Qt::darkBlue,1)));
41  Lines.append(new Line( 14, 9, 14, 14,QPen(Qt::darkBlue,1)));
42 
43  Lines.append(new Line( 14,-14,-14, 14,QPen(Qt::darkBlue,1)));
44  Lines.append(new Line( 14,-14, 9,-14,QPen(Qt::darkBlue,1)));
45  Lines.append(new Line( 14,-14, 14, -9,QPen(Qt::darkBlue,1)));
46  Lines.append(new Line(-14, 14, -9, 14,QPen(Qt::darkBlue,1)));
47  Lines.append(new Line(-14, 14,-14, 9,QPen(Qt::darkBlue,1)));
48 
49  Ports.append(new Port(-30,-20));
50  Ports.append(new Port( 30,-20));
51  Ports.append(new Port( 30, 20));
52  Ports.append(new Port(-30, 20));
53 
54 
55  x1 = -30; y1 = -25;
56  x2 = 30; y2 = 25;
57 
58  tx = x1+4;
59  ty = y2+4;
60  Model = "Coupler";
61  Name = "X";
62 
63  Props.append(new Property("k", "0.7071", true,
64  QObject::tr("coupling factor")));
65  Props.append(new Property("phi", "180", true,
66  QObject::tr("phase shift of coupling path in degree")));
67  Props.append(new Property("Z", "50 Ohm", false,
68  QObject::tr("reference impedance")));
69 }
70 
72 {
73 }
74 
76 {
77  return new Coupler();
78 }
79 
80 Element* Coupler::info(QString& Name, char* &BitmapFile, bool getNewOne)
81 {
82  Name = QObject::tr("Coupler");
83  BitmapFile = (char *) "coupler";
84 
85  if(getNewOne) return new Coupler();
86  return 0;
87 }
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
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
Component * newOne()
Definition: coupler.cpp:75
~Coupler()
Definition: coupler.cpp:71
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
static Element * info(QString &, char *&, bool getNewOne=false)
Definition: coupler.cpp:80
int x2
Definition: element.h:153
Coupler()
Definition: coupler.cpp:21