Qucs-GUI  0.0.18
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
iexp.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  iexp.cpp
3  ----------
4  begin : Tue Mar 06 2007
5  copyright : (C) 2007 by Gunther Kraut
6  email : gn.kraut@t-online.de
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #include "iexp.h"
19 
20 
22 {
23  Description = QObject::tr("exponential current source");
24 
25  // normal current source symbol
26  Arcs.append(new Arc(-12,-12, 24, 24, 0, 16*360,QPen(Qt::darkBlue,2)));
27  Lines.append(new Line(-30, 0,-12, 0,QPen(Qt::darkBlue,2)));
28  Lines.append(new Line( 30, 0, 12, 0,QPen(Qt::darkBlue,2)));
29  Lines.append(new Line( -7, 0, 7, 0,QPen(Qt::darkBlue,3)));
30  Lines.append(new Line( 6, 0, 0, -4,QPen(Qt::darkBlue,3)));
31  Lines.append(new Line( 6, 0, 0, 4,QPen(Qt::darkBlue,3)));
32 
33  // write 'Exp' beside current source symbol
34  Lines.append(new Line( 13, 7, 13, 10,QPen(Qt::darkBlue,2)));
35  Lines.append(new Line( 13, 7, 21, 7,QPen(Qt::darkBlue,2)));
36  Lines.append(new Line( 17, 7, 17, 10,QPen(Qt::darkBlue,2)));
37  Lines.append(new Line( 21, 7, 21, 10,QPen(Qt::darkBlue,2)));
38  Lines.append(new Line( 13, 13, 17, 17,QPen(Qt::darkBlue,2)));
39  Lines.append(new Line( 17, 13, 13, 17,QPen(Qt::darkBlue,2)));
40  Lines.append(new Line( 17, 20, 11, 20,QPen(Qt::darkBlue,2)));
41  Lines.append(new Line( 17, 20, 17, 23,QPen(Qt::darkBlue,2)));
42  Lines.append(new Line( 13, 20, 13, 23,QPen(Qt::darkBlue,2)));
43  Lines.append(new Line( 17, 23, 13, 23,QPen(Qt::darkBlue,2)));
44 
45  Ports.append(new Port( 30, 0));
46  Ports.append(new Port(-30, 0));
47 
48  x1 = -30; y1 = -14;
49  x2 = 30; y2 = 20;
50 
51  tx = x1+4;
52  ty = y2+8;
53  Model = "Iexp";
54  Name = "I";
55 
56  Props.append(new Property("I1", "0", true,
57  QObject::tr("current before rising edge")));
58  Props.append(new Property("I2", "1 A", true,
59  QObject::tr("maximum current of the pulse")));
60  Props.append(new Property("T1", "0", true,
61  QObject::tr("start time of the exponentially rising edge")));
62  Props.append(new Property("T2", "1 ms", true,
63  QObject::tr("start of exponential decay")));
64  Props.append(new Property("Tr", "1 ns", false,
65  QObject::tr("time constant of the rising edge")));
66  Props.append(new Property("Tf", "1 ns", false,
67  QObject::tr("time constant of the falling edge")));
68 
69  rotate(); // fix historical flaw
70 }
71 
73 {
74 }
75 
77 {
78  return new iExp();
79 }
80 
81 Element* iExp::info(QString& Name, char* &BitmapFile, bool getNewOne)
82 {
83  Name = QObject::tr("Exponential Current Pulse");
84  BitmapFile = (char *) "iexp";
85 
86  if(getNewOne) return new iExp();
87  return 0;
88 }
Q3PtrList< Line > Lines
Definition: component.h:67
Definition: element.h:55
int y1
Definition: element.h:153
Q3PtrList< struct Arc > Arcs
Definition: component.h:68
int tx
Definition: component.h:78
int y2
Definition: element.h:153
Definition: element.h:72
int x1
Definition: element.h:153
static Element * info(QString &, char *&, bool getNewOne=false)
Definition: iexp.cpp:81
int ty
Definition: component.h:78
Q3PtrList< Property > Props
Definition: component.h:72
Component * newOne()
Definition: iexp.cpp:76
Definition: element.h:48
Superclass of all schematic drawing elements.
Definition: element.h:142
Q3PtrList< Port > Ports
Definition: component.h:70
void rotate()
Definition: component.cpp:390
iExp()
Definition: iexp.cpp:21
QString Name
Definition: component.h:80
QString Model
Definition: component.h:80
QString Description
Definition: component.h:81
int x2
Definition: element.h:153
~iExp()
Definition: iexp.cpp:72