Qucs-GUI  0.0.18
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
msvia.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  msvia.cpp
3  -----------
4  begin : Sat Oct 30 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 "msvia.h"
19 #include "node.h"
20 
21 
23 {
24  Description = QObject::tr("microstrip via");
25 
26  Arcs.append(new Arc(-5,-4, 10, 7, 0, 16*360,QPen(Qt::darkBlue,2)));
27  Lines.append(new Line(-20, 0, -5, 0,QPen(Qt::darkBlue,2)));
28  Lines.append(new Line( -5, 0, -5, 14,QPen(Qt::darkBlue,2)));
29  Lines.append(new Line( 5, 0, 5, 14,QPen(Qt::darkBlue,2)));
30  Lines.append(new Line(-11, 14, 11, 14,QPen(Qt::darkBlue,3)));
31  Lines.append(new Line( -7, 20, 7, 20,QPen(Qt::darkBlue,3)));
32  Lines.append(new Line( -3, 26, 3, 26,QPen(Qt::darkBlue,3)));
33 
34  Ports.append(new Port(-20, 0));
35 
36  x1 = -20; y1 = -7;
37  x2 = 14; y2 = 30;
38 
39  tx = 20;
40  ty = 0;
41  Model = "MVIA";
42  Name = "MS";
43 
44  Props.append(new Property("Subst", "Subst1", true,
45  QObject::tr("substrate")));
46  Props.append(new Property("D", "1 mm", true,
47  QObject::tr("diameter of round via conductor")));
48  Props.append(new Property("Temp", "26.85", false,
49  QObject::tr("simulation temperature in degree Celsius")));
50 }
51 
53 {
54 }
55 
56 // -------------------------------------------------------
58 {
59  return new MSvia();
60 }
61 
62 // -------------------------------------------------------
63 Element* MSvia::info(QString& Name, char* &BitmapFile, bool getNewOne)
64 {
65  Name = QObject::tr("Microstrip Via");
66  BitmapFile = (char *) "msvia";
67 
68  if(getNewOne) return new MSvia();
69  return 0;
70 }
71 
72 // -------------------------------------------------------
73 QString MSvia::netlist()
74 {
75  QString s = Model+":"+Name;
76 
77  // output node name and add ground node
78  s += " " + Ports.getFirst()->Connection->Name + " gnd";
79 
80  // output all properties
81  for(Property *p2 = Props.first(); p2 != 0; p2 = Props.next())
82  s += " "+p2->Name+"=\""+p2->Value+"\"";
83 
84  return s + '\n';
85 }
Q3PtrList< Line > Lines
Definition: component.h:67
Definition: element.h:55
int y1
Definition: element.h:153
Component * newOne()
Definition: msvia.cpp:57
Q3PtrList< struct Arc > Arcs
Definition: component.h:68
int tx
Definition: component.h:78
int y2
Definition: element.h:153
Definition: element.h:72
int x1
Definition: element.h:153
~MSvia()
Definition: msvia.cpp:52
QString netlist()
Definition: msvia.cpp:73
int ty
Definition: component.h:78
Q3PtrList< Property > Props
Definition: component.h:72
static Element * info(QString &, char *&, bool getNewOne=false)
Definition: msvia.cpp:63
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
QString Model
Definition: component.h:80
QString Description
Definition: component.h:81
MSvia()
Definition: msvia.cpp:22
int x2
Definition: element.h:153