Qucs-GUI  0.0.19
/home/travis/build/Qucs/qucs/qucs/qucs/components/transformer.cpp
Go to the documentation of this file.
00001 /***************************************************************************
00002                           transformer.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 "transformer.h"
00019 
00020 
00021 Transformer::Transformer()
00022 {
00023   Description = QObject::tr("ideal transformer");
00024 
00025   Arcs.append(new Arc(-16,-18,12,12, 16*270,16*180, QPen(Qt::darkBlue,2)));
00026   Arcs.append(new Arc(-16, -6,12,12, 16*270,16*180, QPen(Qt::darkBlue,2)));
00027   Arcs.append(new Arc(-16,  6,12,12, 16*270,16*180, QPen(Qt::darkBlue,2)));
00028   Arcs.append(new Arc(  4,-18,12,12,  16*90,16*180, QPen(Qt::darkBlue,2)));
00029   Arcs.append(new Arc(  4, -6,12,12,  16*90,16*180, QPen(Qt::darkBlue,2)));
00030   Arcs.append(new Arc(  4,  6,12,12,  16*90,16*180, QPen(Qt::darkBlue,2)));
00031   Lines.append(new Line(-10,-18,-10,-30,QPen(Qt::darkBlue,2)));
00032   Lines.append(new Line(-10,-30,-30,-30,QPen(Qt::darkBlue,2)));
00033   Lines.append(new Line( 10,-18, 10,-30,QPen(Qt::darkBlue,2)));
00034   Lines.append(new Line( 10,-30, 30,-30,QPen(Qt::darkBlue,2)));
00035   Lines.append(new Line(-10, 18,-10, 30,QPen(Qt::darkBlue,2)));
00036   Lines.append(new Line(-10, 30,-30, 30,QPen(Qt::darkBlue,2)));
00037   Lines.append(new Line( 10, 18, 10, 30,QPen(Qt::darkBlue,2)));
00038   Lines.append(new Line( 10, 30, 30, 30,QPen(Qt::darkBlue,2)));
00039   Lines.append(new Line( -1,-20, -1, 20,QPen(Qt::darkBlue,1)));
00040   Lines.append(new Line(  1,-20,  1, 20,QPen(Qt::darkBlue,1)));
00041 
00042   Texts.append(new Text(-21, -18,"T"));
00043   Arcs.append(new Arc(-21,-24,  5,  5,  0, 16*360,QPen(Qt::darkBlue,2)));
00044   Arcs.append(new Arc( 15,-24,  5,  5,  0, 16*360,QPen(Qt::darkBlue,2)));
00045 
00046 
00047   Ports.append(new Port(-30,-30));
00048   Ports.append(new Port( 30,-30));
00049   Ports.append(new Port( 30, 30));
00050   Ports.append(new Port(-30, 30));
00051 
00052   x1 = -33; y1 = -34;
00053   x2 =  33; y2 =  34;
00054 
00055   tx = x1+4;
00056   ty = y2+4;
00057   Model = "Tr";
00058   Name  = "Tr";
00059 
00060   Props.append(new Property("T", "1", true,
00061     QObject::tr("voltage transformation ratio")));
00062 }
00063 
00064 Transformer::~Transformer()
00065 {
00066 }
00067 
00068 Component* Transformer::newOne()
00069 {
00070   return new Transformer();
00071 }
00072 
00073 Element* Transformer::info(QString& Name, char* &BitmapFile, bool getNewOne)
00074 {
00075   Name = QObject::tr("Transformer");
00076   BitmapFile = (char *) "transformer";
00077 
00078   if(getNewOne)  return new Transformer();
00079   return 0;
00080 }
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines