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