Qucs-GUI  0.0.18
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
vcvs.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  vcvs.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 "vcvs.h"
19 
20 
22 {
23  Description = QObject::tr("voltage controlled voltage source");
24 
25  Arcs.append(new Arc(0,-11, 22, 22, 0, 16*360,QPen(Qt::darkBlue,2)));
26 
27  Lines.append(new Line(-30,-30,-12,-30,QPen(Qt::darkBlue,2)));
28  Lines.append(new Line(-30, 30,-12, 30,QPen(Qt::darkBlue,2)));
29  Lines.append(new Line( 11,-30, 30,-30,QPen(Qt::darkBlue,2)));
30  Lines.append(new Line( 11, 30, 30, 30,QPen(Qt::darkBlue,2)));
31 
32  Lines.append(new Line(-12,-30,-12,-23,QPen(Qt::darkBlue,2)));
33  Lines.append(new Line(-12, 30,-12, 23,QPen(Qt::darkBlue,2)));
34  Lines.append(new Line( 11,-30, 11,-11,QPen(Qt::darkBlue,2)));
35  Lines.append(new Line( 11, 30, 11, 11,QPen(Qt::darkBlue,2)));
36 
37  Lines.append(new Line(-12,-18,-12, 18,QPen(Qt::darkBlue,1)));
38  Lines.append(new Line(-12, 18,-17, 9,QPen(Qt::darkBlue,1)));
39  Lines.append(new Line(-12, 18, -7, 9,QPen(Qt::darkBlue,1)));
40 
41  Lines.append(new Line( 19,-21, 19,-15,QPen(Qt::red,1)));
42  Lines.append(new Line( 16,-18, 22,-18,QPen(Qt::red,1)));
43  Lines.append(new Line( 16, 18, 22, 18,QPen(Qt::black,1)));
44 
45  Lines.append(new Line(-25,-27, 25,-27,QPen(Qt::darkGray,1)));
46  Lines.append(new Line( 25,-27, 25, 27,QPen(Qt::darkGray,1)));
47  Lines.append(new Line( 25, 27,-25, 27,QPen(Qt::darkGray,1)));
48  Lines.append(new Line(-25, 27,-25,-27,QPen(Qt::darkGray,1)));
49 
50  Ports.append(new Port(-30,-30));
51  Ports.append(new Port( 30,-30));
52  Ports.append(new Port( 30, 30));
53  Ports.append(new Port(-30, 30));
54 
55  x1 = -30; y1 = -30;
56  x2 = 30; y2 = 30;
57 
58  tx = x1+4;
59  ty = y2+4;
60  Model = "VCVS";
61  Name = "SRC";
62 
63  Props.append(new Property("G", "1", true,
64  QObject::tr("forward transfer factor")));
65  Props.append(new Property("T", "0", false, QObject::tr("delay time")));
66 }
67 
69 {
70 }
71 
73 {
74  return new VCVS();
75 }
76 
77 Element* VCVS::info(QString& Name, char* &BitmapFile, bool getNewOne)
78 {
79  Name = QObject::tr("Voltage Controlled Voltage Source");
80  BitmapFile = (char *) "vcvs";
81 
82  if(getNewOne) return new VCVS();
83  return 0;
84 }
Q3PtrList< Line > Lines
Definition: component.h:67
VCVS()
Definition: vcvs.cpp:21
static Element * info(QString &, char *&, bool getNewOne=false)
Definition: vcvs.cpp:77
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
~VCVS()
Definition: vcvs.cpp:68
int ty
Definition: component.h:78
Q3PtrList< Property > Props
Definition: component.h:72
Component * newOne()
Definition: vcvs.cpp:72
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
int x2
Definition: element.h:153