My Project  0.0.16
QUCS Mapping
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
mutual.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  mutual.cpp
3  ------------
4  begin : Sat Aug 20 2005
5  copyright : (C) 2005 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 "mutual.h"
19 
20 
22 {
23  Description = QObject::tr("two mutual inductors");
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 
40  Texts.append(new Text(-21, -22, "1"));
41  Texts.append(new Text( 15, -22, "2"));
42  Lines.append(new Line( 0,-20, 0, 20,QPen(QPen::darkBlue,1,Qt::DashLine)));
43 
44  Ports.append(new Port(-30,-30));
45  Ports.append(new Port( 30,-30));
46  Ports.append(new Port( 30, 30));
47  Ports.append(new Port(-30, 30));
48 
49  x1 = -33; y1 = -34;
50  x2 = 33; y2 = 34;
51 
52  tx = x1+4;
53  ty = y2+4;
54  Model = "MUT";
55  Name = "Tr";
56 
57  Props.append(new Property("L1", "1 mH", false,
58  QObject::tr("inductance of coil 1")));
59  Props.append(new Property("L2", "1 mH", false,
60  QObject::tr("inductance of coil 2")));
61  Props.append(new Property("k", "0.9", false,
62  QObject::tr("coupling factor between coil 1 and 2")));
63 }
64 
66 {
67 }
68 
70 {
71  return new Mutual();
72 }
73 
74 Element* Mutual::info(QString& Name, char* &BitmapFile, bool getNewOne)
75 {
76  Name = QObject::tr("Mutual Inductors");
77  BitmapFile = (char *) "mutual";
78 
79  if(getNewOne) return new Mutual();
80  return 0;
81 }