Qucs-GUI  0.0.19
/home/travis/build/Qucs/qucs/qucs/qucs/components/vexp.cpp
Go to the documentation of this file.
00001 /***************************************************************************
00002                                 vexp.cpp
00003                                ----------
00004     begin                : Fri Mar 9 2007
00005     copyright            : (C) 2007 by Gunther Kraut
00006     email                : gn.kraut@t-online.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 "vexp.h"
00019 
00020 
00021 vExp::vExp()
00022 {
00023   Description = QObject::tr("exponential voltage source");
00024 
00025   // normal voltage source symbol
00026   Arcs.append(new Arc(-12,-12, 24, 24,     0, 16*360,QPen(Qt::darkBlue,2)));
00027   Lines.append(new Line(-30,  0,-12,  0,QPen(Qt::darkBlue,2)));
00028   Lines.append(new Line( 30,  0, 12,  0,QPen(Qt::darkBlue,2)));
00029   Lines.append(new Line( 18,  5, 18, 11,QPen(Qt::red,1)));
00030   Lines.append(new Line( 21,  8, 15,  8,QPen(Qt::red,1)));
00031   Lines.append(new Line(-18,  5,-18, 11,QPen(Qt::black,1)));
00032 
00033   // write 'Exp' inside voltage source symbol
00034   Lines.append(new Line( -3,  -7, -3, -4,QPen(Qt::darkBlue,2)));
00035   Lines.append(new Line( -3,  -7, 5, -7,QPen(Qt::darkBlue,2)));
00036   Lines.append(new Line( 1,  -7, 1, -4,QPen(Qt::darkBlue,2)));
00037   Lines.append(new Line( 5,  -7, 5, -4,QPen(Qt::darkBlue,2)));
00038   Lines.append(new Line( -3,  -1, 1, 3,QPen(Qt::darkBlue,2)));
00039   Lines.append(new Line( 1,  -1, -3, 3,QPen(Qt::darkBlue,2)));
00040   Lines.append(new Line( 1,  6, -5, 6,QPen(Qt::darkBlue,2)));
00041   Lines.append(new Line( 1,  6, 1, 9,QPen(Qt::darkBlue,2)));
00042   Lines.append(new Line( -3,  6, -3, 9,QPen(Qt::darkBlue,2)));
00043   Lines.append(new Line( 1,  9, -3, 9,QPen(Qt::darkBlue,2)));
00044 
00045   Ports.append(new Port( 30,  0));
00046   Ports.append(new Port(-30,  0));
00047 
00048   x1 = -30; y1 = -14;
00049   x2 =  30; y2 =  14;
00050 
00051   tx = x1+4;
00052   ty = y2+4;
00053   Model = "Vexp";
00054   Name  = "V";
00055 
00056   Props.append(new Property("U1", "0 V", true,
00057     QObject::tr("voltage before rising edge")));
00058   Props.append(new Property("U2", "1 V", true,
00059     QObject::tr("maximum voltage of the pulse")));
00060   Props.append(new Property("T1", "0", true,
00061     QObject::tr("start time of the exponentially rising edge")));
00062   Props.append(new Property("T2", "1 ms", true,
00063     QObject::tr("start of exponential decay")));
00064   Props.append(new Property("Tr", "1 ns", false,
00065     QObject::tr("rise time of the rising edge")));
00066   Props.append(new Property("Tf", "1 ns", false,
00067     QObject::tr("fall time of the falling edge")));
00068 
00069   rotate();  // fix historical flaw
00070 }
00071 
00072 vExp::~vExp()
00073 {
00074 }
00075 
00076 Component* vExp::newOne()
00077 {
00078   return new vExp();
00079 }
00080 
00081 Element* vExp::info(QString& Name, char* &BitmapFile, bool getNewOne)
00082 {
00083   Name = QObject::tr("Exponential Voltage Pulse");
00084   BitmapFile = (char *) "vexp";
00085 
00086   if(getNewOne)  return new vExp();
00087   return 0;
00088 }
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines