Qucs-GUI
0.0.19
|
00001 /*************************************************************************** 00002 source_ac.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 "source_ac.h" 00019 00020 00021 Source_ac::Source_ac() 00022 { 00023 Description = QObject::tr("ac power source"); 00024 00025 Lines.append(new Line(-22,-11, 22,-11,QPen(Qt::darkGray,0))); 00026 Lines.append(new Line(-22, 11, 22, 11,QPen(Qt::darkGray,0))); 00027 Lines.append(new Line(-22,-11,-22, 11,QPen(Qt::darkGray,0))); 00028 Lines.append(new Line( 22,-11, 22, 11,QPen(Qt::darkGray,0))); 00029 00030 Arcs.append(new Arc(-19, -9, 18, 18, 0, 16*360,QPen(Qt::darkBlue,2))); 00031 Arcs.append(new Arc(-13, -6, 6, 6,16*270, 16*180,QPen(Qt::darkBlue,2))); 00032 Arcs.append(new Arc(-13, 0, 6, 6, 16*90, 16*180,QPen(Qt::darkBlue,2))); 00033 Lines.append(new Line(-30, 0,-19, 0,QPen(Qt::darkBlue,2))); 00034 Lines.append(new Line( 30, 0, 19, 0,QPen(Qt::darkBlue,2))); 00035 Lines.append(new Line( -1, 0, 3, 0,QPen(Qt::darkBlue,2))); 00036 00037 Lines.append(new Line( 3, -5, 19, -5,QPen(Qt::darkBlue,2))); 00038 Lines.append(new Line( 3, 5, 19, 5,QPen(Qt::darkBlue,2))); 00039 Lines.append(new Line( 3, -5, 3, 5,QPen(Qt::darkBlue,2))); 00040 Lines.append(new Line( 19, -5, 19, 5,QPen(Qt::darkBlue,2))); 00041 00042 Lines.append(new Line( 25, 5, 25, 11,QPen(Qt::red,1))); 00043 Lines.append(new Line( 28, 8, 22, 8,QPen(Qt::red,1))); 00044 Lines.append(new Line(-25, 5,-25, 11,QPen(Qt::black,1))); 00045 00046 Ports.append(new Port( 30, 0)); 00047 Ports.append(new Port(-30, 0)); 00048 00049 x1 = -30; y1 = -14; 00050 x2 = 30; y2 = 14; 00051 00052 tx = x1+4; 00053 ty = y2+4; 00054 Model = "Pac"; 00055 Name = "P"; 00056 00057 // This property must be the first one ! 00058 Props.append(new Property("Num", "1", true, 00059 QObject::tr("number of the port"))); 00060 Props.append(new Property("Z", "50 Ohm", true, 00061 QObject::tr("port impedance"))); 00062 Props.append(new Property("P", "0 dBm", false, 00063 QObject::tr("(available) ac power in Watts"))); 00064 Props.append(new Property("f", "1 GHz", false, 00065 QObject::tr("frequency in Hertz"))); 00066 Props.append(new Property("Temp", "26.85", false, 00067 QObject::tr("simulation temperature in degree Celsius"))); 00068 00069 rotate(); // fix historical flaw 00070 } 00071 00072 Source_ac::~Source_ac() 00073 { 00074 } 00075 00076 Component* Source_ac::newOne() 00077 { 00078 return new Source_ac(); 00079 } 00080 00081 Element* Source_ac::info(QString& Name, char* &BitmapFile, bool getNewOne) 00082 { 00083 Name = QObject::tr("Power Source"); 00084 BitmapFile = (char *) "source"; 00085 00086 if(getNewOne) return new Source_ac(); 00087 return 0; 00088 }