Qucs-GUI  0.0.18
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ipulse.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  ipulse.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 "ipulse.h"
19 
20 
22 {
23  Description = QObject::tr("ideal current pulse source");
24 
25  Arcs.append(new Arc(-12,-12, 24, 24, 0, 16*360,QPen(Qt::darkBlue,2)));
26  Lines.append(new Line(-30, 0,-12, 0,QPen(Qt::darkBlue,2)));
27  Lines.append(new Line( 30, 0, 12, 0,QPen(Qt::darkBlue,2)));
28  Lines.append(new Line( -7, 0, 7, 0,QPen(Qt::darkBlue,3)));
29  Lines.append(new Line( 6, 0, 0, -4,QPen(Qt::darkBlue,3)));
30  Lines.append(new Line( 6, 0, 0, 4,QPen(Qt::darkBlue,3)));
31 
32  // little pulse symbol
33  Lines.append(new Line( 13, 7, 13, 10,QPen(Qt::darkBlue,2)));
34  Lines.append(new Line( 19, 10, 19, 14,QPen(Qt::darkBlue,2)));
35  Lines.append(new Line( 13, 14, 13, 17,QPen(Qt::darkBlue,2)));
36  Lines.append(new Line( 13, 10, 19, 10,QPen(Qt::darkBlue,2)));
37  Lines.append(new Line( 13, 14, 19, 14,QPen(Qt::darkBlue,2)));
38 
39  Ports.append(new Port( 30, 0));
40  Ports.append(new Port(-30, 0));
41 
42  x1 = -30; y1 = -14;
43  x2 = 30; y2 = 20;
44 
45  tx = x1+4;
46  ty = y2+4;
47  Model = "Ipulse";
48  Name = "I";
49 
50  Props.append(new Property("I1", "0", true,
51  QObject::tr("current before and after the pulse")));
52  Props.append(new Property("I2", "1 A", true,
53  QObject::tr("current of the pulse")));
54  Props.append(new Property("T1", "0", true,
55  QObject::tr("start time of the pulse")));
56  Props.append(new Property("T2", "1 ms", true,
57  QObject::tr("ending time of the pulse")));
58  Props.append(new Property("Tr", "1 ns", false,
59  QObject::tr("rise time of the leading edge")));
60  Props.append(new Property("Tf", "1 ns", false,
61  QObject::tr("fall time of the trailing edge")));
62 
63  rotate(); // fix historical flaw
64 }
65 
67 {
68 }
69 
71 {
72  return new iPulse();
73 }
74 
75 Element* iPulse::info(QString& Name, char* &BitmapFile, bool getNewOne)
76 {
77  Name = QObject::tr("Current Pulse");
78  BitmapFile = (char *) "ipulse";
79 
80  if(getNewOne) return new iPulse();
81  return 0;
82 }
Q3PtrList< Line > Lines
Definition: component.h:67
Definition: element.h:55
int y1
Definition: element.h:153
iPulse()
Definition: ipulse.cpp:21
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
~iPulse()
Definition: ipulse.cpp:66
static Element * info(QString &, char *&, bool getNewOne=false)
Definition: ipulse.cpp:75
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
Component * newOne()
Definition: ipulse.cpp:70
int x2
Definition: element.h:153