My Project  0.0.16
QUCS Mapping
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
vexp.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  vexp.cpp
3  ----------
4  begin : Fri Mar 9 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 "vexp.h"
19 
20 
22 {
23  Description = QObject::tr("exponential voltage source");
24 
25  // normal voltage 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( 18, 5, 18, 11,QPen(QPen::red,1)));
30  Lines.append(new Line( 21, 8, 15, 8,QPen(QPen::red,1)));
31  Lines.append(new Line(-18, 5,-18, 11,QPen(QPen::black,1)));
32 
33  // write 'Exp' inside voltage source symbol
34  Lines.append(new Line( -3, -7, -3, -4,QPen(QPen::darkBlue,2)));
35  Lines.append(new Line( -3, -7, 5, -7,QPen(QPen::darkBlue,2)));
36  Lines.append(new Line( 1, -7, 1, -4,QPen(QPen::darkBlue,2)));
37  Lines.append(new Line( 5, -7, 5, -4,QPen(QPen::darkBlue,2)));
38  Lines.append(new Line( -3, -1, 1, 3,QPen(QPen::darkBlue,2)));
39  Lines.append(new Line( 1, -1, -3, 3,QPen(QPen::darkBlue,2)));
40  Lines.append(new Line( 1, 6, -5, 6,QPen(QPen::darkBlue,2)));
41  Lines.append(new Line( 1, 6, 1, 9,QPen(QPen::darkBlue,2)));
42  Lines.append(new Line( -3, 6, -3, 9,QPen(QPen::darkBlue,2)));
43  Lines.append(new Line( 1, 9, -3, 9,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 = 14;
50 
51  tx = x1+4;
52  ty = y2+4;
53  Model = "Vexp";
54  Name = "V";
55 
56  Props.append(new Property("U1", "0 V", true,
57  QObject::tr("voltage before rising edge")));
58  Props.append(new Property("U2", "1 V", true,
59  QObject::tr("maximum voltage 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("rise time of the rising edge")));
66  Props.append(new Property("Tf", "1 ns", false,
67  QObject::tr("fall time of the falling edge")));
68 
69  rotate(); // fix historical flaw
70 }
71 
73 {
74 }
75 
77 {
78  return new vExp();
79 }
80 
81 Element* vExp::info(QString& Name, char* &BitmapFile, bool getNewOne)
82 {
83  Name = QObject::tr("Exponential Voltage Pulse");
84  BitmapFile = (char *) "vexp";
85 
86  if(getNewOne) return new vExp();
87  return 0;
88 }