Qucs-GUI
0.0.19
|
00001 /*************************************************************************** 00002 ampere_ac.cpp 00003 --------------- 00004 begin : Sun May 23 2004 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_ac.h" 00019 00020 00021 Ampere_ac::Ampere_ac() 00022 { 00023 Description = QObject::tr("ideal ac 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 Arcs.append(new Arc( 12, 5, 6, 6,16*270, 16*180,QPen(Qt::darkBlue,2))); 00032 Arcs.append(new Arc( 12, 11, 6, 6, 16*90, 16*180,QPen(Qt::darkBlue,2))); 00033 00034 Ports.append(new Port( 30, 0)); 00035 Ports.append(new Port(-30, 0)); 00036 00037 x1 = -30; y1 = -14; 00038 x2 = 30; y2 = 16; 00039 00040 tx = x1+4; 00041 ty = y2+4; 00042 Model = "Iac"; 00043 Name = "I"; 00044 00045 Props.append(new Property("I", "1 mA", true, 00046 QObject::tr("peak current in Ampere"))); 00047 Props.append(new Property("f", "1 GHz", false, 00048 QObject::tr("frequency in Hertz"))); 00049 Props.append(new Property("Phase", "0", false, 00050 QObject::tr("initial phase in degrees"))); 00051 Props.append(new Property("Theta", "0", false, 00052 QObject::tr("damping factor (transient simulation only)"))); 00053 00054 rotate(); // fix historical flaw 00055 } 00056 00057 Ampere_ac::~Ampere_ac() 00058 { 00059 } 00060 00061 Component* Ampere_ac::newOne() 00062 { 00063 return new Ampere_ac(); 00064 } 00065 00066 Element* Ampere_ac::info(QString& Name, char* &BitmapFile, bool getNewOne) 00067 { 00068 Name = QObject::tr("ac Current Source"); 00069 BitmapFile = (char *) "ac_current"; 00070 00071 if(getNewOne) return new Ampere_ac(); 00072 return 0; 00073 }