My Project  0.0.16
QUCS Mapping
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
vccs.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  vccs.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 "vccs.h"
19 
20 
22 {
23  Description = QObject::tr("voltage controlled current source");
24 
25  Arcs.append(new Arc(0,-11, 22, 22, 0, 16*360,QPen(QPen::darkBlue,2)));
26  Lines.append(new Line( 11, -7, 11, 7,QPen(QPen::darkBlue,3)));
27  Lines.append(new Line( 11, 6, 15, 1,QPen(QPen::darkBlue,3)));
28  Lines.append(new Line( 11, 6, 7, 1,QPen(QPen::darkBlue,3)));
29 
30  Lines.append(new Line(-30,-30,-12,-30,QPen(QPen::darkBlue,2)));
31  Lines.append(new Line(-30, 30,-12, 30,QPen(QPen::darkBlue,2)));
32  Lines.append(new Line( 11,-30, 30,-30,QPen(QPen::darkBlue,2)));
33  Lines.append(new Line( 11, 30, 30, 30,QPen(QPen::darkBlue,2)));
34 
35  Lines.append(new Line(-12,-30,-12,-23,QPen(QPen::darkBlue,2)));
36  Lines.append(new Line(-12, 30,-12, 23,QPen(QPen::darkBlue,2)));
37  Lines.append(new Line( 11,-30, 11,-11,QPen(QPen::darkBlue,2)));
38  Lines.append(new Line( 11, 30, 11, 11,QPen(QPen::darkBlue,2)));
39 
40  Lines.append(new Line(-12,-18,-12, 18,QPen(QPen::darkBlue,1)));
41  Lines.append(new Line(-12, 18,-17, 9,QPen(QPen::darkBlue,1)));
42  Lines.append(new Line(-12, 18, -7, 9,QPen(QPen::darkBlue,1)));
43 
44  Lines.append(new Line(-25,-27, 25,-27,QPen(QPen::darkGray,1)));
45  Lines.append(new Line( 25,-27, 25, 27,QPen(QPen::darkGray,1)));
46  Lines.append(new Line( 25, 27,-25, 27,QPen(QPen::darkGray,1)));
47  Lines.append(new Line(-25, 27,-25,-27,QPen(QPen::darkGray,1)));
48 
49  Ports.append(new Port(-30,-30));
50  Ports.append(new Port( 30,-30));
51  Ports.append(new Port( 30, 30));
52  Ports.append(new Port(-30, 30));
53 
54  x1 = -30; y1 = -30;
55  x2 = 30; y2 = 30;
56 
57  tx = x1+4;
58  ty = y2+4;
59  Model = "VCCS";
60  Name = "SRC";
61 
62  Props.append(new Property("G", "1 S", true,
63  QObject::tr("forward transconductance")));
64  Props.append(new Property("T", "0", false, QObject::tr("delay time")));
65 }
66 
68 {
69 }
70 
72 {
73  return new VCCS();
74 }
75 
76 Element* VCCS::info(QString& Name, char* &BitmapFile, bool getNewOne)
77 {
78  Name = QObject::tr("Voltage Controlled Current Source");
79  BitmapFile = (char *) "vccs";
80 
81  if(getNewOne) return new VCCS();
82  return 0;
83 }