Qucs-GUI
0.0.19
|
00001 /*************************************************************************** 00002 vrect.cpp 00003 ----------- 00004 begin : Sat Sep 18 2004 00005 copyright : (C) 2004 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 "vrect.h" 00019 00020 00021 vRect::vRect() 00022 { 00023 Description = QObject::tr("ideal rectangle voltage 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( 18, 5, 18, 11,QPen(Qt::red,1))); 00029 Lines.append(new Line( 21, 8, 15, 8,QPen(Qt::red,1))); 00030 Lines.append(new Line(-18, 5,-18, 11,QPen(Qt::black,1))); 00031 00032 Lines.append(new Line( -5, -7, -5, -5,QPen(Qt::darkBlue,2))); 00033 Lines.append(new Line( -5, -5, 5, -5,QPen(Qt::darkBlue,2))); 00034 Lines.append(new Line( 5, -5, 6, 0,QPen(Qt::darkBlue,2))); 00035 Lines.append(new Line( -5, 0, 6, 0,QPen(Qt::darkBlue,2))); 00036 Lines.append(new Line( -5, 0, -5, 5,QPen(Qt::darkBlue,2))); 00037 Lines.append(new Line( -5, 5, 5, 5,QPen(Qt::darkBlue,2))); 00038 Lines.append(new Line( 5, 5, 5, 7,QPen(Qt::darkBlue,2))); 00039 00040 Ports.append(new Port( 30, 0)); 00041 Ports.append(new Port(-30, 0)); 00042 00043 x1 = -30; y1 = -14; 00044 x2 = 30; y2 = 14; 00045 00046 tx = x1+4; 00047 ty = y2+4; 00048 Model = "Vrect"; 00049 Name = "V"; 00050 00051 Props.append(new Property("U", "1 V", true, 00052 QObject::tr("voltage of high signal"))); 00053 Props.append(new Property("TH", "1 ms", true, 00054 QObject::tr("duration of high pulses"))); 00055 Props.append(new Property("TL", "1 ms", true, 00056 QObject::tr("duration of low pulses"))); 00057 Props.append(new Property("Tr", "1 ns", false, 00058 QObject::tr("rise time of the leading edge"))); 00059 Props.append(new Property("Tf", "1 ns", false, 00060 QObject::tr("fall time of the trailing edge"))); 00061 Props.append(new Property("Td", "0 ns", false, 00062 QObject::tr("initial delay time"))); 00063 00064 rotate(); // fix historical flaw 00065 } 00066 00067 vRect::~vRect() 00068 { 00069 } 00070 00071 Component* vRect::newOne() 00072 { 00073 return new vRect(); 00074 } 00075 00076 Element* vRect::info(QString& Name, char* &BitmapFile, bool getNewOne) 00077 { 00078 Name = QObject::tr("Rectangle Voltage"); 00079 BitmapFile = (char *) "vrect"; 00080 00081 if(getNewOne) return new vRect(); 00082 return 0; 00083 }