Qucs-GUI  0.0.18
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
vrect.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  vrect.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 "vrect.h"
19 
20 
22 {
23  Description = QObject::tr("ideal rectangle voltage 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( 18, 5, 18, 11,QPen(Qt::red,1)));
29  Lines.append(new Line( 21, 8, 15, 8,QPen(Qt::red,1)));
30  Lines.append(new Line(-18, 5,-18, 11,QPen(Qt::black,1)));
31 
32  Lines.append(new Line( -5, -7, -5, -5,QPen(Qt::darkBlue,2)));
33  Lines.append(new Line( -5, -5, 5, -5,QPen(Qt::darkBlue,2)));
34  Lines.append(new Line( 5, -5, 6, 0,QPen(Qt::darkBlue,2)));
35  Lines.append(new Line( -5, 0, 6, 0,QPen(Qt::darkBlue,2)));
36  Lines.append(new Line( -5, 0, -5, 5,QPen(Qt::darkBlue,2)));
37  Lines.append(new Line( -5, 5, 5, 5,QPen(Qt::darkBlue,2)));
38  Lines.append(new Line( 5, 5, 5, 7,QPen(Qt::darkBlue,2)));
39 
40  Ports.append(new Port( 30, 0));
41  Ports.append(new Port(-30, 0));
42 
43  x1 = -30; y1 = -14;
44  x2 = 30; y2 = 14;
45 
46  tx = x1+4;
47  ty = y2+4;
48  Model = "Vrect";
49  Name = "V";
50 
51  Props.append(new Property("U", "1 V", true,
52  QObject::tr("voltage of high signal")));
53  Props.append(new Property("TH", "1 ms", true,
54  QObject::tr("duration of high pulses")));
55  Props.append(new Property("TL", "1 ms", true,
56  QObject::tr("duration of low pulses")));
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  Props.append(new Property("Td", "0 ns", false,
62  QObject::tr("initial delay time")));
63 
64  rotate(); // fix historical flaw
65 }
66 
68 {
69 }
70 
72 {
73  return new vRect();
74 }
75 
76 Element* vRect::info(QString& Name, char* &BitmapFile, bool getNewOne)
77 {
78  Name = QObject::tr("Rectangle Voltage");
79  BitmapFile = (char *) "vrect";
80 
81  if(getNewOne) return new vRect();
82  return 0;
83 }
Q3PtrList< Line > Lines
Definition: component.h:67
Definition: element.h:55
int y1
Definition: element.h:153
Q3PtrList< struct Arc > Arcs
Definition: component.h:68
~vRect()
Definition: vrect.cpp:67
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
static Element * info(QString &, char *&, bool getNewOne=false)
Definition: vrect.cpp:76
Component * newOne()
Definition: vrect.cpp:71
Q3PtrList< Property > Props
Definition: component.h:72
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
vRect()
Definition: vrect.cpp:21