My Project  0.0.16
QUCS Mapping
 All Classes Namespaces 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(QPen::darkBlue,2)));
27  Lines.append(new Line(-30, 0,-12, 0,QPen(QPen::darkBlue,2)));
28  Lines.append(new Line( 30, 0, 12, 0,QPen(QPen::darkBlue,2)));
29  Lines.append(new Line( -7, 0, 7, 0,QPen(QPen::darkBlue,3)));
30  Lines.append(new Line( 6, 0, 0, -4,QPen(QPen::darkBlue,3)));
31  Lines.append(new Line( 6, 0, 0, 4,QPen(QPen::darkBlue,3)));
32 
33  // write 'Exp' beside current source symbol
34  Lines.append(new Line( 13, 7, 13, 10,QPen(QPen::darkBlue,2)));
35  Lines.append(new Line( 13, 7, 21, 7,QPen(QPen::darkBlue,2)));
36  Lines.append(new Line( 17, 7, 17, 10,QPen(QPen::darkBlue,2)));
37  Lines.append(new Line( 21, 7, 21, 10,QPen(QPen::darkBlue,2)));
38  Lines.append(new Line( 13, 13, 17, 17,QPen(QPen::darkBlue,2)));
39  Lines.append(new Line( 17, 13, 13, 17,QPen(QPen::darkBlue,2)));
40  Lines.append(new Line( 17, 20, 11, 20,QPen(QPen::darkBlue,2)));
41  Lines.append(new Line( 17, 20, 17, 23,QPen(QPen::darkBlue,2)));
42  Lines.append(new Line( 13, 20, 13, 23,QPen(QPen::darkBlue,2)));
43  Lines.append(new Line( 17, 23, 13, 23,QPen(QPen::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 }