My Project  0.0.16
QUCS Mapping
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ampere_dc.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  ampere_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 "ampere_dc.h"
19 
20 
22 {
23  Description = QObject::tr("ideal dc current source");
24 
25  Arcs.append(new Arc(-12,-12, 24, 24, 0, 16*360,QPen(QPen::darkBlue,2)));
26  Lines.append(new Line(-30, 0,-12, 0,QPen(QPen::darkBlue,2)));
27  Lines.append(new Line( 30, 0, 12, 0,QPen(QPen::darkBlue,2)));
28  Lines.append(new Line( -7, 0, 7, 0,QPen(QPen::darkBlue,3)));
29  Lines.append(new Line( 6, 0, 0, -4,QPen(QPen::darkBlue,3)));
30  Lines.append(new Line( 6, 0, 0, 4,QPen(QPen::darkBlue,3)));
31 
32  Ports.append(new Port( 30, 0));
33  Ports.append(new Port(-30, 0));
34 
35  x1 = -30; y1 = -14;
36  x2 = 30; y2 = 14;
37 
38  tx = x1+4;
39  ty = y2+4;
40  Model = "Idc";
41  Name = "I";
42 
43  Props.append(new Property("I", "1 mA", true,
44  QObject::tr("current in Ampere")));
45 
46  rotate(); // fix historical flaw
47 }
48 
50 {
51 }
52 
54 {
55  return new Ampere_dc();
56 }
57 
58 Element* Ampere_dc::info(QString& Name, char* &BitmapFile, bool getNewOne)
59 {
60  Name = QObject::tr("dc Current Source");
61  BitmapFile = (char *) "dc_current";
62 
63  if(getNewOne) return new Ampere_dc();
64  return 0;
65 }