Qucs-GUI  0.0.18
 All Data Structures 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(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( 18, 5, 18, 11,QPen(Qt::red,1)));
30  Lines.append(new Line( 21, 8, 15, 8,QPen(Qt::red,1)));
31  Lines.append(new Line(-18, 5,-18, 11,QPen(Qt::black,1)));
32 
33  // write 'Exp' inside voltage source symbol
34  Lines.append(new Line( -3, -7, -3, -4,QPen(Qt::darkBlue,2)));
35  Lines.append(new Line( -3, -7, 5, -7,QPen(Qt::darkBlue,2)));
36  Lines.append(new Line( 1, -7, 1, -4,QPen(Qt::darkBlue,2)));
37  Lines.append(new Line( 5, -7, 5, -4,QPen(Qt::darkBlue,2)));
38  Lines.append(new Line( -3, -1, 1, 3,QPen(Qt::darkBlue,2)));
39  Lines.append(new Line( 1, -1, -3, 3,QPen(Qt::darkBlue,2)));
40  Lines.append(new Line( 1, 6, -5, 6,QPen(Qt::darkBlue,2)));
41  Lines.append(new Line( 1, 6, 1, 9,QPen(Qt::darkBlue,2)));
42  Lines.append(new Line( -3, 6, -3, 9,QPen(Qt::darkBlue,2)));
43  Lines.append(new Line( 1, 9, -3, 9,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 = 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 }
Q3PtrList< Line > Lines
Definition: component.h:67
~vExp()
Definition: vexp.cpp:72
vExp()
Definition: vexp.cpp:21
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
int ty
Definition: component.h:78
Q3PtrList< Property > Props
Definition: component.h:72
Component * newOne()
Definition: vexp.cpp:76
static Element * info(QString &, char *&, bool getNewOne=false)
Definition: vexp.cpp:81
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
QString Name
Definition: component.h:80
QString Model
Definition: component.h:80
QString Description
Definition: component.h:81
int x2
Definition: element.h:153