Qucs-GUI  0.0.19
/home/travis/build/Qucs/qucs/qucs/qucs/components/iexp.cpp
Go to the documentation of this file.
00001 /***************************************************************************
00002                                 iexp.cpp
00003                                ----------
00004     begin                : Tue Mar 06 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 "iexp.h"
00019 
00020 
00021 iExp::iExp()
00022 {
00023   Description = QObject::tr("exponential current source");
00024 
00025   // normal current 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( -7,  0,  7,  0,QPen(Qt::darkBlue,3)));
00030   Lines.append(new Line(  6,  0,  0, -4,QPen(Qt::darkBlue,3)));
00031   Lines.append(new Line(  6,  0,  0,  4,QPen(Qt::darkBlue,3)));
00032 
00033   // write 'Exp' beside current source symbol
00034   Lines.append(new Line( 13,  7, 13, 10,QPen(Qt::darkBlue,2)));
00035   Lines.append(new Line( 13,  7, 21, 7,QPen(Qt::darkBlue,2)));
00036   Lines.append(new Line( 17,  7, 17, 10,QPen(Qt::darkBlue,2)));
00037   Lines.append(new Line( 21,  7, 21, 10,QPen(Qt::darkBlue,2)));
00038   Lines.append(new Line( 13,  13, 17, 17,QPen(Qt::darkBlue,2)));
00039   Lines.append(new Line( 17,  13, 13, 17,QPen(Qt::darkBlue,2)));
00040   Lines.append(new Line( 17,  20, 11, 20,QPen(Qt::darkBlue,2)));
00041   Lines.append(new Line( 17,  20, 17, 23,QPen(Qt::darkBlue,2)));
00042   Lines.append(new Line( 13,  20, 13, 23,QPen(Qt::darkBlue,2)));
00043   Lines.append(new Line( 17,  23, 13, 23,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 =  20;
00050 
00051   tx = x1+4;
00052   ty = y2+8;
00053   Model = "Iexp";
00054   Name  = "I";
00055 
00056   Props.append(new Property("I1", "0", true,
00057     QObject::tr("current before rising edge")));
00058   Props.append(new Property("I2", "1 A", true,
00059     QObject::tr("maximum current 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("time constant of the rising edge")));
00066   Props.append(new Property("Tf", "1 ns", false,
00067     QObject::tr("time constant of the falling edge")));
00068 
00069   rotate();  // fix historical flaw
00070 }
00071 
00072 iExp::~iExp()
00073 {
00074 }
00075 
00076 Component* iExp::newOne()
00077 {
00078   return new iExp();
00079 }
00080 
00081 Element* iExp::info(QString& Name, char* &BitmapFile, bool getNewOne)
00082 {
00083   Name = QObject::tr("Exponential Current Pulse");
00084   BitmapFile = (char *) "iexp";
00085 
00086   if(getNewOne)  return new iExp();
00087   return 0;
00088 }
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines