Qucs-GUI  0.0.19
/home/travis/build/Qucs/qucs/qucs/qucs/components/vpulse.cpp
Go to the documentation of this file.
00001 /***************************************************************************
00002                                 vpulse.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 "vpulse.h"
00019 
00020 
00021 vPulse::vPulse()
00022 {
00023   Description = QObject::tr("ideal voltage pulse 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(  6, -3,  6,  3,QPen(Qt::darkBlue,2)));
00033   Lines.append(new Line( -6, -7, -6, -3,QPen(Qt::darkBlue,2)));
00034   Lines.append(new Line( -6,  3, -6,  7,QPen(Qt::darkBlue,2)));
00035   Lines.append(new Line( -6, -3,  6, -3,QPen(Qt::darkBlue,2)));
00036   Lines.append(new Line( -6,  3,  6,  3,QPen(Qt::darkBlue,2)));
00037 
00038   Ports.append(new Port( 30,  0));
00039   Ports.append(new Port(-30,  0));
00040 
00041   x1 = -30; y1 = -14;
00042   x2 =  30; y2 =  14;
00043 
00044   tx = x1+4;
00045   ty = y2+4;
00046   Model = "Vpulse";
00047   Name  = "V";
00048 
00049   Props.append(new Property("U1", "0 V", true,
00050     QObject::tr("voltage before and after the pulse")));
00051   Props.append(new Property("U2", "1 V", true,
00052     QObject::tr("voltage of the pulse")));
00053   Props.append(new Property("T1", "0", true,
00054     QObject::tr("start time of the pulse")));
00055   Props.append(new Property("T2", "1 ms", true,
00056     QObject::tr("ending time of the pulse")));
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 
00062   rotate();  // fix historical flaw
00063 }
00064 
00065 vPulse::~vPulse()
00066 {
00067 }
00068 
00069 Component* vPulse::newOne()
00070 {
00071   return new vPulse();
00072 }
00073 
00074 Element* vPulse::info(QString& Name, char* &BitmapFile, bool getNewOne)
00075 {
00076   Name = QObject::tr("Voltage Pulse");
00077   BitmapFile = (char *) "vpulse";
00078 
00079   if(getNewOne)  return new vPulse();
00080   return 0;
00081 }
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines