Qucs-GUI  0.0.18
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
circulator.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  circulator.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 #include <QtGui>
18 #include "circulator.h"
19 #include "main.h"
20 
21 
23 {
24  Description = QObject::tr("circulator");
25 
26  Arcs.append(new Arc(-14,-14, 28, 28, 0,16*360,QPen(Qt::darkBlue,2)));
27  Lines.append(new Line(-30, 0,-14, 0,QPen(Qt::darkBlue,2)));
28  Lines.append(new Line( 30, 0, 14, 0,QPen(Qt::darkBlue,2)));
29  Lines.append(new Line( 0, 14, 0, 30,QPen(Qt::darkBlue,2)));
30 
31  Arcs.append(new Arc( -8, -6, 16, 16,16*20,16*150,QPen(Qt::darkBlue,2)));
32  Lines.append(new Line( 8, 0, 9, -7,QPen(Qt::darkBlue,2)));
33  Lines.append(new Line( 8, 0, 2, -1,QPen(Qt::darkBlue,2)));
34 
35  Lines.append(new Line(-22, -4,-26, 4,QPen(Qt::darkBlue,2))); // marks port 1
36 
37  Ports.append(new Port(-30, 0));
38  Ports.append(new Port( 30, 0));
39  Ports.append(new Port( 0, 30));
40 
41  x1 = -30; y1 = -16;
42  x2 = 30; y2 = 30;
43 
44  tx = x1 + 4;
45  ty = y1 - QucsSettings.font.pointSize()-4;
46  Model = "Circulator";
47  Name = "X";
48 
49  Props.append(new Property("Z1", "50 Ohm", false,
50  QObject::tr("reference impedance of port 1")));
51  Props.append(new Property("Z2", "50 Ohm", false,
52  QObject::tr("reference impedance of port 2")));
53  Props.append(new Property("Z3", "50 Ohm", false,
54  QObject::tr("reference impedance of port 3")));
55 }
56 
58 {
59 }
60 
62 {
63  return new Circulator();
64 }
65 
66 Element* Circulator::info(QString& Name, char* &BitmapFile, bool getNewOne)
67 {
68  Name = QObject::tr("Circulator");
69  BitmapFile = (char *) "circulator";
70 
71  if(getNewOne) return new Circulator();
72  return 0;
73 }
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
QFont font
Definition: main.h:46
tQucsSettings QucsSettings
Definition: main.cpp:52
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: circulator.cpp:61
Definitions and declarations for the main application.
int ty
Definition: component.h:78
Q3PtrList< Property > Props
Definition: component.h:72
static Element * info(QString &, char *&, bool getNewOne=false)
Definition: circulator.cpp:66
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