Qucs-GUI  0.0.19
/home/travis/build/Qucs/qucs/qucs/qucs/components/volt_dc.cpp
Go to the documentation of this file.
00001 /***************************************************************************
00002                                volt_dc.cpp
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 "volt_dc.h"
00019 
00020 
00021 Volt_dc::Volt_dc()
00022 {
00023   Description = QObject::tr("ideal dc voltage source");
00024 
00025   Lines.append(new Line(  4,-13,  4, 13,QPen(Qt::darkBlue,2)));
00026   Lines.append(new Line( -4, -6, -4,  6,QPen(Qt::darkBlue,4)));
00027   Lines.append(new Line( 30,  0,  4,  0,QPen(Qt::darkBlue,2)));
00028   Lines.append(new Line( -4,  0,-30,  0,QPen(Qt::darkBlue,2)));
00029   Lines.append(new Line( 11,  5, 11, 11,QPen(Qt::red,1)));
00030   Lines.append(new Line( 14,  8,  8,  8,QPen(Qt::red,1)));
00031   Lines.append(new Line(-11,  5,-11, 11,QPen(Qt::black,1)));
00032 
00033   Ports.append(new Port( 30,  0));
00034   Ports.append(new Port(-30,  0));
00035 
00036   x1 = -30; y1 = -14;
00037   x2 =  30; y2 =  14;
00038 
00039   tx = x1+4;
00040   ty = y2+4;
00041   Model = "Vdc";
00042   Name  = "V";
00043 
00044   Props.append(new Property("U", "1 V", true,
00045     QObject::tr("voltage in Volts")));
00046 
00047   rotate();  // fix historical flaw
00048 }
00049 
00050 Volt_dc::~Volt_dc()
00051 {
00052 }
00053 
00054 Component* Volt_dc::newOne()
00055 {
00056   return new Volt_dc();
00057 }
00058 
00059 Element* Volt_dc::info(QString& Name, char* &BitmapFile, bool getNewOne)
00060 {
00061   Name = QObject::tr("dc Voltage Source");
00062   BitmapFile = (char *) "dc_voltage";
00063 
00064   if(getNewOne)  return new Volt_dc();
00065   return 0;
00066 }
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines