My Project  0.0.16
QUCS Mapping
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
transformer.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  transformer.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 "transformer.h"
19 
20 
22 {
23  Description = QObject::tr("ideal transformer");
24 
25  Arcs.append(new Arc(-16,-18,12,12, 16*270,16*180, QPen(QPen::darkBlue,2)));
26  Arcs.append(new Arc(-16, -6,12,12, 16*270,16*180, QPen(QPen::darkBlue,2)));
27  Arcs.append(new Arc(-16, 6,12,12, 16*270,16*180, QPen(QPen::darkBlue,2)));
28  Arcs.append(new Arc( 4,-18,12,12, 16*90,16*180, QPen(QPen::darkBlue,2)));
29  Arcs.append(new Arc( 4, -6,12,12, 16*90,16*180, QPen(QPen::darkBlue,2)));
30  Arcs.append(new Arc( 4, 6,12,12, 16*90,16*180, QPen(QPen::darkBlue,2)));
31  Lines.append(new Line(-10,-18,-10,-30,QPen(QPen::darkBlue,2)));
32  Lines.append(new Line(-10,-30,-30,-30,QPen(QPen::darkBlue,2)));
33  Lines.append(new Line( 10,-18, 10,-30,QPen(QPen::darkBlue,2)));
34  Lines.append(new Line( 10,-30, 30,-30,QPen(QPen::darkBlue,2)));
35  Lines.append(new Line(-10, 18,-10, 30,QPen(QPen::darkBlue,2)));
36  Lines.append(new Line(-10, 30,-30, 30,QPen(QPen::darkBlue,2)));
37  Lines.append(new Line( 10, 18, 10, 30,QPen(QPen::darkBlue,2)));
38  Lines.append(new Line( 10, 30, 30, 30,QPen(QPen::darkBlue,2)));
39  Lines.append(new Line( -1,-20, -1, 20,QPen(QPen::darkBlue,1)));
40  Lines.append(new Line( 1,-20, 1, 20,QPen(QPen::darkBlue,1)));
41 
42  Texts.append(new Text(-21, -18,"T"));
43  Arcs.append(new Arc(-21,-24, 5, 5, 0, 16*360,QPen(QPen::darkBlue,2)));
44  Arcs.append(new Arc( 15,-24, 5, 5, 0, 16*360,QPen(QPen::darkBlue,2)));
45 
46 
47  Ports.append(new Port(-30,-30));
48  Ports.append(new Port( 30,-30));
49  Ports.append(new Port( 30, 30));
50  Ports.append(new Port(-30, 30));
51 
52  x1 = -33; y1 = -34;
53  x2 = 33; y2 = 34;
54 
55  tx = x1+4;
56  ty = y2+4;
57  Model = "Tr";
58  Name = "Tr";
59 
60  Props.append(new Property("T", "1", true,
61  QObject::tr("voltage transformation ratio")));
62 }
63 
65 {
66 }
67 
69 {
70  return new Transformer();
71 }
72 
73 Element* Transformer::info(QString& Name, char* &BitmapFile, bool getNewOne)
74 {
75  Name = QObject::tr("Transformer");
76  BitmapFile = (char *) "transformer";
77 
78  if(getNewOne) return new Transformer();
79  return 0;
80 }