Qucs-GUI  0.0.19
/home/travis/build/Qucs/qucs/qucs/qucs/components/gyrator.cpp
Go to the documentation of this file.
00001 /***************************************************************************
00002                           gyrator.cpp  -  description
00003                              -------------------
00004     begin                : Sat Aug 23 2003
00005     copyright            : (C) 2003 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 "gyrator.h"
00019 
00020 
00021 Gyrator::Gyrator()
00022 {
00023   Description = QObject::tr("gyrator (impedance inverter)");
00024 
00025   Arcs.append(new Arc(  3, -9, 18, 18, 16*90, 16*180,QPen(Qt::darkBlue,2)));
00026   Arcs.append(new Arc(-21, -9, 18, 18,16*270, 16*180,QPen(Qt::darkBlue,2)));
00027 
00028   Lines.append(new Line(-30,-30,-12,-30,QPen(Qt::darkBlue,2)));
00029   Lines.append(new Line(-30, 30,-12, 30,QPen(Qt::darkBlue,2)));
00030   Lines.append(new Line( 12,-30, 30,-30,QPen(Qt::darkBlue,2)));
00031   Lines.append(new Line( 12, 30, 30, 30,QPen(Qt::darkBlue,2)));
00032 
00033   Lines.append(new Line( 12,-30, 12, 30,QPen(Qt::darkBlue,2)));
00034   Lines.append(new Line(-12,-30,-12, 30,QPen(Qt::darkBlue,2)));
00035 
00036   Lines.append(new Line(-22,-22, 22,-22,QPen(Qt::darkGray,1)));
00037   Lines.append(new Line( 22,-22, 22, 22,QPen(Qt::darkGray,1)));
00038   Lines.append(new Line( 22, 22,-22, 22,QPen(Qt::darkGray,1)));
00039   Lines.append(new Line(-22, 22,-22,-22,QPen(Qt::darkGray,1)));
00040 
00041   Ports.append(new Port(-30,-30));
00042   Ports.append(new Port( 30,-30));
00043   Ports.append(new Port( 30, 30));
00044   Ports.append(new Port(-30, 30));
00045 
00046   x1 = -30; y1 = -30;
00047   x2 =  30; y2 =  30;
00048 
00049   tx = x1+4;
00050   ty = y2+4;
00051   Model = "Gyrator";
00052   Name  = "X";
00053 
00054   Props.append(new Property("R", "50 Ohm", true,
00055     QObject::tr("gyrator ratio")));
00056   Props.append(new Property("Zref", "50 Ohm", false,
00057     QObject::tr("reference impedance")));
00058 }
00059 
00060 Gyrator::~Gyrator()
00061 {
00062 }
00063 
00064 Component* Gyrator::newOne()
00065 {
00066   return new Gyrator();
00067 }
00068 
00069 Element* Gyrator::info(QString& Name, char* &BitmapFile, bool getNewOne)
00070 {
00071   Name = QObject::tr("Gyrator");
00072   BitmapFile = (char *) "gyrator";
00073 
00074   if(getNewOne)  return new Gyrator();
00075   return 0;
00076 }
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines