My Project  0.0.16
QUCS Mapping
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
source_ac.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  source_ac.cpp
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 "source_ac.h"
19 
20 
22 {
23  Description = QObject::tr("ac power source");
24 
25  Lines.append(new Line(-22,-11, 22,-11,QPen(QPen::darkGray,0)));
26  Lines.append(new Line(-22, 11, 22, 11,QPen(QPen::darkGray,0)));
27  Lines.append(new Line(-22,-11,-22, 11,QPen(QPen::darkGray,0)));
28  Lines.append(new Line( 22,-11, 22, 11,QPen(QPen::darkGray,0)));
29 
30  Arcs.append(new Arc(-19, -9, 18, 18, 0, 16*360,QPen(QPen::darkBlue,2)));
31  Arcs.append(new Arc(-13, -6, 6, 6,16*270, 16*180,QPen(QPen::darkBlue,2)));
32  Arcs.append(new Arc(-13, 0, 6, 6, 16*90, 16*180,QPen(QPen::darkBlue,2)));
33  Lines.append(new Line(-30, 0,-19, 0,QPen(QPen::darkBlue,2)));
34  Lines.append(new Line( 30, 0, 19, 0,QPen(QPen::darkBlue,2)));
35  Lines.append(new Line( -1, 0, 3, 0,QPen(QPen::darkBlue,2)));
36 
37  Lines.append(new Line( 3, -5, 19, -5,QPen(QPen::darkBlue,2)));
38  Lines.append(new Line( 3, 5, 19, 5,QPen(QPen::darkBlue,2)));
39  Lines.append(new Line( 3, -5, 3, 5,QPen(QPen::darkBlue,2)));
40  Lines.append(new Line( 19, -5, 19, 5,QPen(QPen::darkBlue,2)));
41 
42  Lines.append(new Line( 25, 5, 25, 11,QPen(QPen::red,1)));
43  Lines.append(new Line( 28, 8, 22, 8,QPen(QPen::red,1)));
44  Lines.append(new Line(-25, 5,-25, 11,QPen(QPen::black,1)));
45 
46  Ports.append(new Port( 30, 0));
47  Ports.append(new Port(-30, 0));
48 
49  x1 = -30; y1 = -14;
50  x2 = 30; y2 = 14;
51 
52  tx = x1+4;
53  ty = y2+4;
54  Model = "Pac";
55  Name = "P";
56 
57  // This property must be the first one !
58  Props.append(new Property("Num", "1", true,
59  QObject::tr("number of the port")));
60  Props.append(new Property("Z", "50 Ohm", true,
61  QObject::tr("port impedance")));
62  Props.append(new Property("P", "0 dBm", false,
63  QObject::tr("(available) ac power in Watts")));
64  Props.append(new Property("f", "1 GHz", false,
65  QObject::tr("frequency in Hertz")));
66  Props.append(new Property("Temp", "26.85", false,
67  QObject::tr("simulation temperature in degree Celsius")));
68 
69  rotate(); // fix historical flaw
70 }
71 
73 {
74 }
75 
77 {
78  return new Source_ac();
79 }
80 
81 Element* Source_ac::info(QString& Name, char* &BitmapFile, bool getNewOne)
82 {
83  Name = QObject::tr("Power Source");
84  BitmapFile = (char *) "source";
85 
86  if(getNewOne) return new Source_ac();
87  return 0;
88 }