Qucs-GUI  0.0.18
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
volt_ac.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  volt_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 "volt_ac.h"
19 
20 
22 {
23  Description = QObject::tr("ideal ac voltage source");
24 
25  Arcs.append(new Arc(-12,-12, 24, 24, 0, 16*360,QPen(Qt::darkBlue,2)));
26  Arcs.append(new Arc( -3, -7, 7, 7,16*270, 16*180,QPen(Qt::darkBlue,2)));
27  Arcs.append(new Arc( -3, 0, 7, 7, 16*90, 16*180,QPen(Qt::darkBlue,2)));
28  Lines.append(new Line(-30, 0,-12, 0,QPen(Qt::darkBlue,2)));
29  Lines.append(new Line( 30, 0, 12, 0,QPen(Qt::darkBlue,2)));
30  Lines.append(new Line( 18, 5, 18, 11,QPen(Qt::red,1)));
31  Lines.append(new Line( 21, 8, 15, 8,QPen(Qt::red,1)));
32  Lines.append(new Line(-18, 5,-18, 11,QPen(Qt::black,1)));
33 
34  Ports.append(new Port( 30, 0));
35  Ports.append(new Port(-30, 0));
36 
37  x1 = -30; y1 = -14;
38  x2 = 30; y2 = 14;
39 
40  tx = x1+4;
41  ty = y2+4;
42  Model = "Vac";
43  Name = "V";
44 
45  Props.append(new Property("U", "1 V", true,
46  QObject::tr("peak voltage in Volts")));
47  Props.append(new Property("f", "1 GHz", false,
48  QObject::tr("frequency in Hertz")));
49  Props.append(new Property("Phase", "0", false,
50  QObject::tr("initial phase in degrees")));
51  Props.append(new Property("Theta", "0", false,
52  QObject::tr("damping factor (transient simulation only)")));
53 
54  rotate(); // fix historical flaw
55 }
56 
58 {
59 }
60 
62 {
63  return new Volt_ac();
64 }
65 
66 Element* Volt_ac::info(QString& Name, char* &BitmapFile, bool getNewOne)
67 {
68  Name = QObject::tr("ac Voltage Source");
69  BitmapFile = (char *) "ac_voltage";
70 
71  if(getNewOne) return new Volt_ac();
72  return 0;
73 }
Q3PtrList< Line > Lines
Definition: component.h:67
Definition: element.h:55
int y1
Definition: element.h:153
Q3PtrList< struct Arc > Arcs
Definition: component.h:68
Component * newOne()
Definition: volt_ac.cpp:61
int tx
Definition: component.h:78
int y2
Definition: element.h:153
Definition: element.h:72
int x1
Definition: element.h:153
static Element * info(QString &, char *&, bool getNewOne=false)
Definition: volt_ac.cpp:66
int ty
Definition: component.h:78
Q3PtrList< Property > Props
Definition: component.h:72
Definition: element.h:48
Superclass of all schematic drawing elements.
Definition: element.h:142
Q3PtrList< Port > Ports
Definition: component.h:70
void rotate()
Definition: component.cpp:390
QString Name
Definition: component.h:80
QString Model
Definition: component.h:80
QString Description
Definition: component.h:81
~Volt_ac()
Definition: volt_ac.cpp:57
int x2
Definition: element.h:153
Volt_ac()
Definition: volt_ac.cpp:21