Qucs-GUI  0.0.19
/home/travis/build/Qucs/qucs/qucs/qucs/components/hybrid.cpp
Go to the documentation of this file.
00001 /***************************************************************************
00002     copyright            : (C) 2010 by Michael Margraf
00003     email                : michael.margraf@alumni.tu-berlin.de
00004  ***************************************************************************/
00005 
00006 /***************************************************************************
00007  *                                                                         *
00008  *   This program is free software; you can redistribute it and/or modify  *
00009  *   it under the terms of the GNU General Public License as published by  *
00010  *   the Free Software Foundation; either version 2 of the License, or     *
00011  *   (at your option) any later version.                                   *
00012  *                                                                         *
00013  ***************************************************************************/
00014 
00015 #include "hybrid.h"
00016 
00017 Hybrid::Hybrid()
00018 {
00019   Description = QObject::tr("hybrid (unsymmetrical 3dB coupler)");
00020 
00021   Lines.append(new Line(-14,-14, 14,-14,QPen(Qt::darkBlue,2)));
00022   Lines.append(new Line(-14, 14, 14, 14,QPen(Qt::darkBlue,2)));
00023   Lines.append(new Line(-14,-14,-14, 14,QPen(Qt::darkBlue,2)));
00024   Lines.append(new Line( 14,-14, 14, 14,QPen(Qt::darkBlue,2)));
00025 
00026   Arcs.append(new Arc(-28,-28, 28, 28, 16*270, 16*90,QPen(Qt::darkBlue,1)));
00027   Arcs.append(new Arc(  0,-28, 28, 28, 16*180, 16*90,QPen(Qt::darkBlue,1)));
00028   Arcs.append(new Arc(-28,  0, 28, 28,      0, 16*90,QPen(Qt::darkBlue,1)));
00029   Arcs.append(new Arc(  0,  0, 28, 28,  16*90, 16*90,QPen(Qt::darkBlue,1)));
00030 
00031   Arcs.append(new Arc(-11,-11, 4, 6, 0, 16*360,QPen(Qt::darkBlue,1)));
00032   Arcs.append(new Arc(-11,  5, 4, 6, 0, 16*360,QPen(Qt::darkBlue,1)));
00033   Arcs.append(new Arc(  6,-11, 4, 6, 0, 16*360,QPen(Qt::darkBlue,1)));
00034   Arcs.append(new Arc(  6,  5, 4, 6, 0, 16*360,QPen(Qt::darkBlue,1)));
00035   Lines.append(new Line( 8, -12, 8, -4,QPen(Qt::darkBlue,1)));
00036 
00037   Lines.append(new Line(-30,  0,-14,  0,QPen(Qt::darkBlue,2)));
00038   Lines.append(new Line( 14,  0, 30,  0,QPen(Qt::darkBlue,2)));
00039   Lines.append(new Line(  0,-30,  0,-14,QPen(Qt::darkBlue,2)));
00040   Lines.append(new Line(  0, 14,  0, 30,QPen(Qt::darkBlue,2)));
00041 
00042   Ports.append(new Port(-30,  0));
00043   Ports.append(new Port( 30,  0));
00044   Ports.append(new Port(  0, 30));
00045   Ports.append(new Port(  0,-30));
00046 
00047   x1 = -30; y1 = -30;
00048   x2 =  30; y2 =  30;
00049 
00050   tx = x1+4;
00051   ty = y2+4;
00052   Model = "Hybrid";
00053   Name  = "X";
00054 
00055   Props.append(new Property("phi", "90", true,
00056     QObject::tr("phase shift in degree")));
00057   Props.append(new Property("Zref", "50 Ohm", false,
00058     QObject::tr("reference impedance")));
00059 }
00060 
00061 // -------------------------------------------------------------------
00062 Component* Hybrid::newOne()
00063 {
00064   return new Hybrid();
00065 }
00066 
00067 Element* Hybrid::info(QString& Name, char* &BitmapFile, bool getNewOne)
00068 {
00069   Name = QObject::tr("Hybrid");
00070   BitmapFile = (char *) "hybrid";
00071 
00072   if(getNewOne)  return new Hybrid();
00073   return 0;
00074 }
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines