Qucs-GUI  0.0.19
/home/travis/build/Qucs/qucs/qucs/qucs/components/attenuator.cpp
Go to the documentation of this file.
00001 /***************************************************************************
00002                           attenuator.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 "attenuator.h"
00019 
00020 
00021 Attenuator::Attenuator()
00022 {
00023   Description = QObject::tr("attenuator");
00024 
00025   Lines.append(new Line( -4, -6, -4,  6,QPen(Qt::darkBlue,2)));
00026   Lines.append(new Line( -4, -6,  4, -6,QPen(Qt::darkBlue,2)));
00027   Lines.append(new Line(  4, -6,  4,  6,QPen(Qt::darkBlue,2)));
00028   Lines.append(new Line( -4,  6,  4,  6,QPen(Qt::darkBlue,2)));
00029   Lines.append(new Line(  0,-11,  0, -6,QPen(Qt::darkBlue,2)));
00030   Lines.append(new Line(  0,  6,  0, 11,QPen(Qt::darkBlue,2)));
00031 
00032   Lines.append(new Line(-14,-14, 14,-14,QPen(Qt::darkBlue,2)));
00033   Lines.append(new Line(-14, 14, 14, 14,QPen(Qt::darkBlue,2)));
00034   Lines.append(new Line(-14,-14,-14, 14,QPen(Qt::darkBlue,2)));
00035   Lines.append(new Line( 14,-14, 14, 14,QPen(Qt::darkBlue,2)));
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 
00040   Ports.append(new Port(-30,  0));
00041   Ports.append(new Port( 30,  0));
00042 
00043   x1 = -30; y1 = -17;
00044   x2 =  30; y2 =  17;
00045 
00046   tx = x1+4;
00047   ty = y2+4;
00048   Model = "Attenuator";
00049   Name  = "X";
00050 
00051   Props.append(new Property("L", "10 dB", true,
00052     QObject::tr("power attenuation")));
00053   Props.append(new Property("Zref", "50 Ohm", false,
00054     QObject::tr("reference impedance")));
00055   Props.append(new Property("Temp", "26.85", false,
00056     QObject::tr("simulation temperature in degree Celsius")));
00057 }
00058 
00059 Attenuator::~Attenuator()
00060 {
00061 }
00062 
00063 Component* Attenuator::newOne()
00064 {
00065   return new Attenuator();
00066 }
00067 
00068 Element* Attenuator::info(QString& Name, char* &BitmapFile, bool getNewOne)
00069 {
00070   Name = QObject::tr("Attenuator");
00071   BitmapFile = (char *) "attenuator";
00072 
00073   if(getNewOne)  return new Attenuator();
00074   return 0;
00075 }
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines