Qucs-GUI  0.0.18
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
dcblock.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  dcblock.cpp - description
3  -------------------
4  begin : Sat Aug 23 2003
5  copyright : (C) 2003 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 "dcblock.h"
19 
21 {
22  Description = QObject::tr("dc block");
23 
24  Lines.append(new Line(- 4,-11, -4, 11,QPen(Qt::darkBlue,4)));
25  Lines.append(new Line( 4,-11, 4, 11,QPen(Qt::darkBlue,4)));
26  Lines.append(new Line(-30, 0, -4, 0,QPen(Qt::darkBlue,2)));
27  Lines.append(new Line( 4, 0, 30, 0,QPen(Qt::darkBlue,2)));
28 
29  Lines.append(new Line(-23,-14, 23,-14,QPen(Qt::darkBlue,1)));
30  Lines.append(new Line(-23, 14, 23, 14,QPen(Qt::darkBlue,1)));
31  Lines.append(new Line(-23,-14,-23, 14,QPen(Qt::darkBlue,1)));
32  Lines.append(new Line( 23,-14, 23, 14,QPen(Qt::darkBlue,1)));
33 
34  Ports.append(new Port(-30, 0));
35  Ports.append(new Port( 30, 0));
36 
37  x1 = -30; y1 = -16;
38  x2 = 30; y2 = 17;
39 
40  tx = x1+4;
41  ty = y2+4;
42  Model = "DCBlock";
43  Name = "C";
44 
45  Props.append(new Property("C", "1 uF", false,
46  QObject::tr("for transient simulation: capacitance in Farad")));
47 }
48 
50 {
51 }
52 
54 {
55  return new dcBlock();
56 }
57 
58 Element* dcBlock::info(QString& Name, char* &BitmapFile, bool getNewOne)
59 {
60  Name = QObject::tr("dc Block");
61  BitmapFile = (char *) "dcblock";
62 
63  if(getNewOne) return new dcBlock();
64  return 0;
65 }
Q3PtrList< Line > Lines
Definition: component.h:67
int y1
Definition: element.h:153
int tx
Definition: component.h:78
int y2
Definition: element.h:153
Definition: element.h:72
int x1
Definition: element.h:153
Component * newOne()
Definition: dcblock.cpp:53
int ty
Definition: component.h:78
Q3PtrList< Property > Props
Definition: component.h:72
dcBlock()
Definition: dcblock.cpp:20
Definition: element.h:48
Superclass of all schematic drawing elements.
Definition: element.h:142
Q3PtrList< Port > Ports
Definition: component.h:70
QString Name
Definition: component.h:80
QString Model
Definition: component.h:80
QString Description
Definition: component.h:81
~dcBlock()
Definition: dcblock.cpp:49
static Element * info(QString &, char *&, bool getNewOne=false)
Definition: dcblock.cpp:58
int x2
Definition: element.h:153