My Project  0.0.16
QUCS Mapping
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
irect.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  irect.cpp
3  -----------
4  begin : Sat Sep 18 2004
5  copyright : (C) 2004 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 "irect.h"
19 
20 
22 {
23  Description = QObject::tr("ideal rectangle 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  // little rectangle symbol
33  Lines.append(new Line( 19, 5, 19, 7,QPen(QPen::darkBlue,2)));
34  Lines.append(new Line( 13, 7, 19, 7,QPen(QPen::darkBlue,2)));
35  Lines.append(new Line( 13, 7, 13, 11,QPen(QPen::darkBlue,2)));
36  Lines.append(new Line( 13, 11, 19, 11,QPen(QPen::darkBlue,2)));
37  Lines.append(new Line( 19, 11, 19, 15,QPen(QPen::darkBlue,2)));
38  Lines.append(new Line( 13, 15, 19, 15,QPen(QPen::darkBlue,2)));
39  Lines.append(new Line( 13, 15, 13, 17,QPen(QPen::darkBlue,2)));
40 
41  Ports.append(new Port( 30, 0));
42  Ports.append(new Port(-30, 0));
43 
44  x1 = -30; y1 = -14;
45  x2 = 30; y2 = 20;
46 
47  tx = x1+4;
48  ty = y2+4;
49  Model = "Irect";
50  Name = "I";
51 
52  Props.append(new Property("I", "1 mA", true,
53  QObject::tr("current at high pulse")));
54  Props.append(new Property("TH", "1 ms", true,
55  QObject::tr("duration of high pulses")));
56  Props.append(new Property("TL", "1 ms", true,
57  QObject::tr("duration of low pulses")));
58  Props.append(new Property("Tr", "1 ns", false,
59  QObject::tr("rise time of the leading edge")));
60  Props.append(new Property("Tf", "1 ns", false,
61  QObject::tr("fall time of the trailing edge")));
62  Props.append(new Property("Td", "0 ns", false,
63  QObject::tr("initial delay time")));
64 
65  rotate(); // fix historical flaw
66 }
67 
69 {
70 }
71 
73 {
74  return new iRect();
75 }
76 
77 Element* iRect::info(QString& Name, char* &BitmapFile, bool getNewOne)
78 {
79  Name = QObject::tr("Rectangle Current");
80  BitmapFile = (char *) "irect";
81 
82  if(getNewOne) return new iRect();
83  return 0;
84 }