My Project  0.0.16
QUCS Mapping
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
hybrid.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  copyright : (C) 2010 by Michael Margraf
3  email : michael.margraf@alumni.tu-berlin.de
4  ***************************************************************************/
5 
6 /***************************************************************************
7  * *
8  * This program is free software; you can redistribute it and/or modify *
9  * it under the terms of the GNU General Public License as published by *
10  * the Free Software Foundation; either version 2 of the License, or *
11  * (at your option) any later version. *
12  * *
13  ***************************************************************************/
14 
15 #include "hybrid.h"
16 
18 {
19  Description = QObject::tr("hybrid (unsymmetrical 3dB coupler)");
20 
21  Lines.append(new Line(-14,-14, 14,-14,QPen(Qt::darkBlue,2)));
22  Lines.append(new Line(-14, 14, 14, 14,QPen(Qt::darkBlue,2)));
23  Lines.append(new Line(-14,-14,-14, 14,QPen(Qt::darkBlue,2)));
24  Lines.append(new Line( 14,-14, 14, 14,QPen(Qt::darkBlue,2)));
25 
26  Arcs.append(new Arc(-28,-28, 28, 28, 16*270, 16*90,QPen(Qt::darkBlue,1)));
27  Arcs.append(new Arc( 0,-28, 28, 28, 16*180, 16*90,QPen(Qt::darkBlue,1)));
28  Arcs.append(new Arc(-28, 0, 28, 28, 0, 16*90,QPen(Qt::darkBlue,1)));
29  Arcs.append(new Arc( 0, 0, 28, 28, 16*90, 16*90,QPen(Qt::darkBlue,1)));
30 
31  Arcs.append(new Arc(-11,-11, 4, 6, 0, 16*360,QPen(Qt::darkBlue,1)));
32  Arcs.append(new Arc(-11, 5, 4, 6, 0, 16*360,QPen(Qt::darkBlue,1)));
33  Arcs.append(new Arc( 6,-11, 4, 6, 0, 16*360,QPen(Qt::darkBlue,1)));
34  Arcs.append(new Arc( 6, 5, 4, 6, 0, 16*360,QPen(Qt::darkBlue,1)));
35  Lines.append(new Line( 8, -12, 8, -4,QPen(Qt::darkBlue,1)));
36 
37  Lines.append(new Line(-30, 0,-14, 0,QPen(Qt::darkBlue,2)));
38  Lines.append(new Line( 14, 0, 30, 0,QPen(Qt::darkBlue,2)));
39  Lines.append(new Line( 0,-30, 0,-14,QPen(Qt::darkBlue,2)));
40  Lines.append(new Line( 0, 14, 0, 30,QPen(Qt::darkBlue,2)));
41 
42  Ports.append(new Port(-30, 0));
43  Ports.append(new Port( 30, 0));
44  Ports.append(new Port( 0, 30));
45  Ports.append(new Port( 0,-30));
46 
47  x1 = -30; y1 = -30;
48  x2 = 30; y2 = 30;
49 
50  tx = x1+4;
51  ty = y2+4;
52  Model = "Hybrid";
53  Name = "X";
54 
55  Props.append(new Property("phi", "90", true,
56  QObject::tr("phase shift in degree")));
57  Props.append(new Property("Zref", "50 Ohm", false,
58  QObject::tr("reference impedance")));
59 }
60 
61 // -------------------------------------------------------------------
63 {
64  return new Hybrid();
65 }
66 
67 Element* Hybrid::info(QString& Name, char* &BitmapFile, bool getNewOne)
68 {
69  Name = QObject::tr("Hybrid");
70  BitmapFile = (char *) "hybrid";
71 
72  if(getNewOne) return new Hybrid();
73  return 0;
74 }