Qucs-GUI  0.0.19
/home/travis/build/Qucs/qucs/qucs/qucs/components/ccvs.cpp
Go to the documentation of this file.
00001 /***************************************************************************
00002                           ccvs.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 "ccvs.h"
00019 
00020 
00021 CCVS::CCVS()
00022 {
00023   Description = QObject::tr("current controlled voltage source");
00024 
00025   Arcs.append(new Arc(0,-11, 22, 22,  0, 16*360,QPen(Qt::darkBlue,2)));
00026 
00027   Lines.append(new Line(-30,-30,-12,-30,QPen(Qt::darkBlue,2)));
00028   Lines.append(new Line(-30, 30,-12, 30,QPen(Qt::darkBlue,2)));
00029   Lines.append(new Line( 11,-30, 30,-30,QPen(Qt::darkBlue,2)));
00030   Lines.append(new Line( 11, 30, 30, 30,QPen(Qt::darkBlue,2)));
00031 
00032   Lines.append(new Line(-12,-30,-12, 30,QPen(Qt::darkBlue,2)));
00033   Lines.append(new Line( 11,-30, 11,-11,QPen(Qt::darkBlue,2)));
00034   Lines.append(new Line( 11, 30, 11, 11,QPen(Qt::darkBlue,2)));
00035 
00036   Lines.append(new Line(-12, 20,-17, 11,QPen(Qt::darkBlue,2)));
00037   Lines.append(new Line(-12, 20, -8, 11,QPen(Qt::darkBlue,2)));
00038 
00039   Lines.append(new Line( 19,-21, 19,-15,QPen(Qt::red,1)));
00040   Lines.append(new Line( 16,-18, 22,-18,QPen(Qt::red,1)));
00041   Lines.append(new Line( 16, 18, 22, 18,QPen(Qt::black,1)));
00042 
00043   Lines.append(new Line(-25,-27, 25,-27,QPen(Qt::darkGray,1)));
00044   Lines.append(new Line( 25,-27, 25, 27,QPen(Qt::darkGray,1)));
00045   Lines.append(new Line( 25, 27,-25, 27,QPen(Qt::darkGray,1)));
00046   Lines.append(new Line(-25, 27,-25,-27,QPen(Qt::darkGray,1)));
00047 
00048   Ports.append(new Port(-30,-30));
00049   Ports.append(new Port( 30,-30));
00050   Ports.append(new Port( 30, 30));
00051   Ports.append(new Port(-30, 30));
00052 
00053   x1 = -30; y1 = -30;
00054   x2 =  30; y2 =  30;
00055 
00056   tx = x1+4;
00057   ty = y2+4;
00058   Model = "CCVS";
00059   Name  = "SRC";
00060 
00061   Props.append(new Property("G", "1 Ohm", true,
00062     QObject::tr("forward transfer factor")));
00063   Props.append(new Property("T", "0", false, QObject::tr("delay time")));
00064 }
00065 
00066 CCVS::~CCVS()
00067 {
00068 }
00069 
00070 Component* CCVS::newOne()
00071 {
00072   return new CCVS();
00073 }
00074 
00075 Element* CCVS::info(QString& Name, char* &BitmapFile, bool getNewOne)
00076 {
00077   Name = QObject::tr("Current Controlled Voltage Source");
00078   BitmapFile = (char *) "ccvs";
00079 
00080   if(getNewOne)  return new CCVS();
00081   return 0;
00082 }
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines