My Project  0.0.16
QUCS Mapping
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
vpulse.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  vpulse.cpp
3  ------------
4  begin : Sat Sep 18 2004
5  copyright : (C) 2004 by Michael Margraf
6  email : michael.margraf@alumni.tu-berlin.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 "vpulse.h"
19 
20 
22 {
23  Description = QObject::tr("ideal voltage pulse source");
24 
25  Arcs.append(new Arc(-12,-12, 24, 24, 0, 16*360,QPen(QPen::darkBlue,2)));
26  Lines.append(new Line(-30, 0,-12, 0,QPen(QPen::darkBlue,2)));
27  Lines.append(new Line( 30, 0, 12, 0,QPen(QPen::darkBlue,2)));
28  Lines.append(new Line( 18, 5, 18, 11,QPen(QPen::red,1)));
29  Lines.append(new Line( 21, 8, 15, 8,QPen(QPen::red,1)));
30  Lines.append(new Line(-18, 5,-18, 11,QPen(QPen::black,1)));
31 
32  Lines.append(new Line( 6, -3, 6, 3,QPen(QPen::darkBlue,2)));
33  Lines.append(new Line( -6, -7, -6, -3,QPen(QPen::darkBlue,2)));
34  Lines.append(new Line( -6, 3, -6, 7,QPen(QPen::darkBlue,2)));
35  Lines.append(new Line( -6, -3, 6, -3,QPen(QPen::darkBlue,2)));
36  Lines.append(new Line( -6, 3, 6, 3,QPen(QPen::darkBlue,2)));
37 
38  Ports.append(new Port( 30, 0));
39  Ports.append(new Port(-30, 0));
40 
41  x1 = -30; y1 = -14;
42  x2 = 30; y2 = 14;
43 
44  tx = x1+4;
45  ty = y2+4;
46  Model = "Vpulse";
47  Name = "V";
48 
49  Props.append(new Property("U1", "0 V", true,
50  QObject::tr("voltage before and after the pulse")));
51  Props.append(new Property("U2", "1 V", true,
52  QObject::tr("voltage of the pulse")));
53  Props.append(new Property("T1", "0", true,
54  QObject::tr("start time of the pulse")));
55  Props.append(new Property("T2", "1 ms", true,
56  QObject::tr("ending time of the pulse")));
57  Props.append(new Property("Tr", "1 ns", false,
58  QObject::tr("rise time of the leading edge")));
59  Props.append(new Property("Tf", "1 ns", false,
60  QObject::tr("fall time of the trailing edge")));
61 
62  rotate(); // fix historical flaw
63 }
64 
66 {
67 }
68 
70 {
71  return new vPulse();
72 }
73 
74 Element* vPulse::info(QString& Name, char* &BitmapFile, bool getNewOne)
75 {
76  Name = QObject::tr("Voltage Pulse");
77  BitmapFile = (char *) "vpulse";
78 
79  if(getNewOne) return new vPulse();
80  return 0;
81 }