My Project  0.0.16
QUCS Mapping
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
volt_dc.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  volt_dc.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_dc.h"
19 
20 
22 {
23  Description = QObject::tr("ideal dc voltage source");
24 
25  Lines.append(new Line( 4,-13, 4, 13,QPen(QPen::darkBlue,2)));
26  Lines.append(new Line( -4, -6, -4, 6,QPen(QPen::darkBlue,4)));
27  Lines.append(new Line( 30, 0, 4, 0,QPen(QPen::darkBlue,2)));
28  Lines.append(new Line( -4, 0,-30, 0,QPen(QPen::darkBlue,2)));
29  Lines.append(new Line( 11, 5, 11, 11,QPen(QPen::red,1)));
30  Lines.append(new Line( 14, 8, 8, 8,QPen(QPen::red,1)));
31  Lines.append(new Line(-11, 5,-11, 11,QPen(QPen::black,1)));
32 
33  Ports.append(new Port( 30, 0));
34  Ports.append(new Port(-30, 0));
35 
36  x1 = -30; y1 = -14;
37  x2 = 30; y2 = 14;
38 
39  tx = x1+4;
40  ty = y2+4;
41  Model = "Vdc";
42  Name = "V";
43 
44  Props.append(new Property("U", "1 V", true,
45  QObject::tr("voltage in Volts")));
46 
47  rotate(); // fix historical flaw
48 }
49 
51 {
52 }
53 
55 {
56  return new Volt_dc();
57 }
58 
59 Element* Volt_dc::info(QString& Name, char* &BitmapFile, bool getNewOne)
60 {
61  Name = QObject::tr("dc Voltage Source");
62  BitmapFile = (char *) "dc_voltage";
63 
64  if(getNewOne) return new Volt_dc();
65  return 0;
66 }