My Project  0.0.16
QUCS Mapping
 All Classes Namespaces 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(QPen::darkBlue,2)));
27  Lines.append(new Line(-20, 0, -5, 0,QPen(QPen::darkBlue,2)));
28  Lines.append(new Line( -5, 0, -5, 14,QPen(QPen::darkBlue,2)));
29  Lines.append(new Line( 5, 0, 5, 14,QPen(QPen::darkBlue,2)));
30  Lines.append(new Line(-11, 14, 11, 14,QPen(QPen::darkBlue,3)));
31  Lines.append(new Line( -7, 20, 7, 20,QPen(QPen::darkBlue,3)));
32  Lines.append(new Line( -3, 26, 3, 26,QPen(QPen::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 }