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