Qucs-GUI  0.0.18
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
pm_modulator.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  pm_modulator.cpp
3  ------------------
4  begin : Sat Feb 25 2006
5  copyright : (C) 2006 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 "pm_modulator.h"
19 
20 
22 {
23  Description = QObject::tr("ac voltage source with phase modulator");
24 
25  Arcs.append(new Arc(-12,-12, 24, 24, 0, 16*360,QPen(Qt::darkBlue,2)));
26  Arcs.append(new Arc( -7, -4, 7, 7, 0, 16*180,QPen(Qt::darkBlue,2)));
27  Arcs.append(new Arc( 0, -4, 7, 7,16*180, 16*180,QPen(Qt::darkBlue,2)));
28  Lines.append(new Line( 0, 30, 0, 12,QPen(Qt::darkBlue,2)));
29  Lines.append(new Line( 0,-30, 0,-12,QPen(Qt::darkBlue,2)));
30  Lines.append(new Line( 5,-18, 11,-18,QPen(Qt::red,1)));
31  Lines.append(new Line( 8,-21, 8,-15,QPen(Qt::red,1)));
32  Lines.append(new Line( 5, 18, 11, 18,QPen(Qt::black,1)));
33 
34  Lines.append(new Line(-12, 0,-30, 0,QPen(Qt::darkBlue,2)));
35  Lines.append(new Line(-12, 0,-17, 5,QPen(Qt::darkBlue,2)));
36  Lines.append(new Line(-12, 0,-17, -5,QPen(Qt::darkBlue,2)));
37  Texts.append(new Text(-30,-22, QObject::tr("PM"), Qt::black, 10.0,1.0,0.0));
38 
39  Ports.append(new Port( 0,-30));
40  Ports.append(new Port( 0, 30));
41  Ports.append(new Port(-30, 0));
42 
43  x1 = -30; y1 = -30;
44  x2 = 14; y2 = 30;
45 
46  tx = x2+4;
47  ty = y1+4;
48  Model = "PM_Mod";
49  Name = "V";
50 
51  Props.append(new Property("U", "1 V", true,
52  QObject::tr("peak voltage in Volts")));
53  Props.append(new Property("f", "1 GHz", false,
54  QObject::tr("frequency in Hertz")));
55  Props.append(new Property("Phase", "0", false,
56  QObject::tr("initial phase in degrees")));
57  Props.append(new Property("M", "1.0", false,
58  QObject::tr("modulation index")));
59 }
60 
62 {
63 }
64 
66 {
67  return new PM_Modulator();
68 }
69 
70 Element* PM_Modulator::info(QString& Name, char* &BitmapFile, bool getNewOne)
71 {
72  Name = QObject::tr("PM modulated Source");
73  BitmapFile = (char *) "pm_mod";
74 
75  if(getNewOne) return new PM_Modulator();
76  return 0;
77 }
Q3PtrList< Line > Lines
Definition: component.h:67
Component * newOne()
Definition: element.h:55
int y1
Definition: element.h:153
Q3PtrList< struct Arc > Arcs
Definition: component.h:68
int tx
Definition: component.h:78
int y2
Definition: element.h:153
Definition: element.h:72
int x1
Definition: element.h:153
int ty
Definition: component.h:78
Q3PtrList< Property > Props
Definition: component.h:72
Definition: element.h:82
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
Q3PtrList< Text > Texts
Definition: component.h:71
QString Model
Definition: component.h:80
QString Description
Definition: component.h:81
int x2
Definition: element.h:153
static Element * info(QString &, char *&, bool getNewOne=false)