Qucs-GUI
0.0.19
|
00001 /*************************************************************************** 00002 irect.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 "irect.h" 00019 00020 00021 iRect::iRect() 00022 { 00023 Description = QObject::tr("ideal rectangle 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 00032 // little rectangle symbol 00033 Lines.append(new Line( 19, 5, 19, 7,QPen(Qt::darkBlue,2))); 00034 Lines.append(new Line( 13, 7, 19, 7,QPen(Qt::darkBlue,2))); 00035 Lines.append(new Line( 13, 7, 13, 11,QPen(Qt::darkBlue,2))); 00036 Lines.append(new Line( 13, 11, 19, 11,QPen(Qt::darkBlue,2))); 00037 Lines.append(new Line( 19, 11, 19, 15,QPen(Qt::darkBlue,2))); 00038 Lines.append(new Line( 13, 15, 19, 15,QPen(Qt::darkBlue,2))); 00039 Lines.append(new Line( 13, 15, 13, 17,QPen(Qt::darkBlue,2))); 00040 00041 Ports.append(new Port( 30, 0)); 00042 Ports.append(new Port(-30, 0)); 00043 00044 x1 = -30; y1 = -14; 00045 x2 = 30; y2 = 20; 00046 00047 tx = x1+4; 00048 ty = y2+4; 00049 Model = "Irect"; 00050 Name = "I"; 00051 00052 Props.append(new Property("I", "1 mA", true, 00053 QObject::tr("current at high pulse"))); 00054 Props.append(new Property("TH", "1 ms", true, 00055 QObject::tr("duration of high pulses"))); 00056 Props.append(new Property("TL", "1 ms", true, 00057 QObject::tr("duration of low pulses"))); 00058 Props.append(new Property("Tr", "1 ns", false, 00059 QObject::tr("rise time of the leading edge"))); 00060 Props.append(new Property("Tf", "1 ns", false, 00061 QObject::tr("fall time of the trailing edge"))); 00062 Props.append(new Property("Td", "0 ns", false, 00063 QObject::tr("initial delay time"))); 00064 00065 rotate(); // fix historical flaw 00066 } 00067 00068 iRect::~iRect() 00069 { 00070 } 00071 00072 Component* iRect::newOne() 00073 { 00074 return new iRect(); 00075 } 00076 00077 Element* iRect::info(QString& Name, char* &BitmapFile, bool getNewOne) 00078 { 00079 Name = QObject::tr("Rectangle Current"); 00080 BitmapFile = (char *) "irect"; 00081 00082 if(getNewOne) return new iRect(); 00083 return 0; 00084 }