Qucs-GUI  0.0.18
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
rlcg.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  rlcg.cpp
3  ----------
4  begin : Wed Apr 1 2009
5  copyright : (C) 2009 by Stefan Jahn
6  email : stefan@lkcc.org
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 #include <QtGui>
18 #include "main.h"
19 #include "rlcg.h"
20 
22 {
23  Description = QObject::tr("RLCG transmission line");
24 
25  Lines.append(new Line(-30, 0, 30, 0,QPen(Qt::darkBlue,2)));
26  Lines.append(new Line(-28, 7, 28, 7,QPen(Qt::darkBlue,2)));
27 
28  Lines.append(new Line(-28, 14,-21, 7,QPen(Qt::darkBlue,2)));
29  Lines.append(new Line(-21, 14,-14, 7,QPen(Qt::darkBlue,2)));
30  Lines.append(new Line(-14, 14, -7, 7,QPen(Qt::darkBlue,2)));
31  Lines.append(new Line( -7, 14, 0, 7,QPen(Qt::darkBlue,2)));
32  Lines.append(new Line( 0, 14, 7, 7,QPen(Qt::darkBlue,2)));
33  Lines.append(new Line( 7, 14, 14, 7,QPen(Qt::darkBlue,2)));
34  Lines.append(new Line( 14, 14, 21, 7,QPen(Qt::darkBlue,2)));
35  Lines.append(new Line( 21, 14, 28, 7,QPen(Qt::darkBlue,2)));
36 
37  QFontMetrics metrics(QucsSettings.font);
38  int fHeight = metrics.lineSpacing();
39  QString tmp = QObject::tr("RLCG");
40  int w = metrics.width(tmp);
41  Texts.append(new Text(w/-2, -fHeight, tmp));
42 
43  Ports.append(new Port(-30, 0));
44  Ports.append(new Port( 30, 0));
45 
46  x1 = -30; y1 = -fHeight;
47  x2 = 30; y2 = 16;
48 
49  tx = x1+4;
50  ty = y2+4;
51  Model = "RLCG";
52  Name = "Line";
53 
54  Props.append(new Property("R", "0.0", false,
55  QObject::tr("resistive load")+" ("+QObject::tr ("Ohm/m")+")"));
56  Props.append(new Property("L", "0.6e-6", true,
57  QObject::tr("inductive load")+" ("+QObject::tr ("H/m")+")"));
58  Props.append(new Property("C", "240e-12", true,
59  QObject::tr("capacitive load")+" ("+QObject::tr ("F/m")+")"));
60  Props.append(new Property("G", "0.0", false,
61  QObject::tr("conductive load")+" ("+QObject::tr ("S/m")+")"));
62  Props.append(new Property("Length", "1 mm", true,
63  QObject::tr("electrical length of the line")));
64  Props.append(new Property("Temp", "26.85", false,
65  QObject::tr("simulation temperature in degree Celsius")));
66 }
67 
69 {
70 }
71 
73 {
74  return new RLCG();
75 }
76 
77 Element* RLCG::info(QString& Name, char* &BitmapFile, bool getNewOne)
78 {
79  Name = QObject::tr("RLCG Transmission Line");
80  BitmapFile = (char *) "rlcg";
81 
82  if(getNewOne) return new RLCG();
83  return 0;
84 }
Q3PtrList< Line > Lines
Definition: component.h:67
RLCG()
Definition: rlcg.cpp:21
int y1
Definition: element.h:153
QFont font
Definition: main.h:46
tQucsSettings QucsSettings
Definition: main.cpp:52
int tx
Definition: component.h:78
int y2
Definition: element.h:153
Definition: element.h:72
int x1
Definition: element.h:153
Component * newOne()
Definition: rlcg.cpp:72
~RLCG()
Definition: rlcg.cpp:68
Definitions and declarations for the main application.
int ty
Definition: component.h:78
static Element * info(QString &, char *&, bool getNewOne=false)
Definition: rlcg.cpp:77
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