Qucs-GUI  0.0.18
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
gyrator.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  gyrator.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 "gyrator.h"
19 
20 
22 {
23  Description = QObject::tr("gyrator (impedance inverter)");
24 
25  Arcs.append(new Arc( 3, -9, 18, 18, 16*90, 16*180,QPen(Qt::darkBlue,2)));
26  Arcs.append(new Arc(-21, -9, 18, 18,16*270, 16*180,QPen(Qt::darkBlue,2)));
27 
28  Lines.append(new Line(-30,-30,-12,-30,QPen(Qt::darkBlue,2)));
29  Lines.append(new Line(-30, 30,-12, 30,QPen(Qt::darkBlue,2)));
30  Lines.append(new Line( 12,-30, 30,-30,QPen(Qt::darkBlue,2)));
31  Lines.append(new Line( 12, 30, 30, 30,QPen(Qt::darkBlue,2)));
32 
33  Lines.append(new Line( 12,-30, 12, 30,QPen(Qt::darkBlue,2)));
34  Lines.append(new Line(-12,-30,-12, 30,QPen(Qt::darkBlue,2)));
35 
36  Lines.append(new Line(-22,-22, 22,-22,QPen(Qt::darkGray,1)));
37  Lines.append(new Line( 22,-22, 22, 22,QPen(Qt::darkGray,1)));
38  Lines.append(new Line( 22, 22,-22, 22,QPen(Qt::darkGray,1)));
39  Lines.append(new Line(-22, 22,-22,-22,QPen(Qt::darkGray,1)));
40 
41  Ports.append(new Port(-30,-30));
42  Ports.append(new Port( 30,-30));
43  Ports.append(new Port( 30, 30));
44  Ports.append(new Port(-30, 30));
45 
46  x1 = -30; y1 = -30;
47  x2 = 30; y2 = 30;
48 
49  tx = x1+4;
50  ty = y2+4;
51  Model = "Gyrator";
52  Name = "X";
53 
54  Props.append(new Property("R", "50 Ohm", true,
55  QObject::tr("gyrator ratio")));
56  Props.append(new Property("Zref", "50 Ohm", false,
57  QObject::tr("reference impedance")));
58 }
59 
61 {
62 }
63 
65 {
66  return new Gyrator();
67 }
68 
69 Element* Gyrator::info(QString& Name, char* &BitmapFile, bool getNewOne)
70 {
71  Name = QObject::tr("Gyrator");
72  BitmapFile = (char *) "gyrator";
73 
74  if(getNewOne) return new Gyrator();
75  return 0;
76 }
Q3PtrList< Line > Lines
Definition: component.h:67
~Gyrator()
Definition: gyrator.cpp:60
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
Component * newOne()
Definition: gyrator.cpp:64
int ty
Definition: component.h:78
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
QString Name
Definition: component.h:80
static Element * info(QString &, char *&, bool getNewOne=false)
Definition: gyrator.cpp:69
Gyrator()
Definition: gyrator.cpp:21
QString Model
Definition: component.h:80
QString Description
Definition: component.h:81
int x2
Definition: element.h:153