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