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