Qucs-GUI
0.0.19
|
00001 /*************************************************************************** 00002 vcvs.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 "vcvs.h" 00019 00020 00021 VCVS::VCVS() 00022 { 00023 Description = QObject::tr("voltage 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,-23,QPen(Qt::darkBlue,2))); 00033 Lines.append(new Line(-12, 30,-12, 23,QPen(Qt::darkBlue,2))); 00034 Lines.append(new Line( 11,-30, 11,-11,QPen(Qt::darkBlue,2))); 00035 Lines.append(new Line( 11, 30, 11, 11,QPen(Qt::darkBlue,2))); 00036 00037 Lines.append(new Line(-12,-18,-12, 18,QPen(Qt::darkBlue,1))); 00038 Lines.append(new Line(-12, 18,-17, 9,QPen(Qt::darkBlue,1))); 00039 Lines.append(new Line(-12, 18, -7, 9,QPen(Qt::darkBlue,1))); 00040 00041 Lines.append(new Line( 19,-21, 19,-15,QPen(Qt::red,1))); 00042 Lines.append(new Line( 16,-18, 22,-18,QPen(Qt::red,1))); 00043 Lines.append(new Line( 16, 18, 22, 18,QPen(Qt::black,1))); 00044 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 Lines.append(new Line( 25, 27,-25, 27,QPen(Qt::darkGray,1))); 00048 Lines.append(new Line(-25, 27,-25,-27,QPen(Qt::darkGray,1))); 00049 00050 Ports.append(new Port(-30,-30)); 00051 Ports.append(new Port( 30,-30)); 00052 Ports.append(new Port( 30, 30)); 00053 Ports.append(new Port(-30, 30)); 00054 00055 x1 = -30; y1 = -30; 00056 x2 = 30; y2 = 30; 00057 00058 tx = x1+4; 00059 ty = y2+4; 00060 Model = "VCVS"; 00061 Name = "SRC"; 00062 00063 Props.append(new Property("G", "1", true, 00064 QObject::tr("forward transfer factor"))); 00065 Props.append(new Property("T", "0", false, QObject::tr("delay time"))); 00066 } 00067 00068 VCVS::~VCVS() 00069 { 00070 } 00071 00072 Component* VCVS::newOne() 00073 { 00074 return new VCVS(); 00075 } 00076 00077 Element* VCVS::info(QString& Name, char* &BitmapFile, bool getNewOne) 00078 { 00079 Name = QObject::tr("Voltage Controlled Voltage Source"); 00080 BitmapFile = (char *) "vcvs"; 00081 00082 if(getNewOne) return new VCVS(); 00083 return 0; 00084 }