My Project  0.0.16
QUCS Mapping
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
mscross.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  mscross.cpp - description
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 "mscross.h"
19 
20 
22 {
23  Description = QObject::tr("microstrip cross");
24 
25  Model = "MCROSS";
26  Name = "MS";
27 
28  Props.append(new Property("Subst", "Subst1", true,
29  QObject::tr("substrate")));
30  Props.append(new Property("W1", "1 mm", true,
31  QObject::tr("width of line 1")));
32  Props.append(new Property("W2", "2 mm", true,
33  QObject::tr("width of line 2")));
34  Props.append(new Property("W3", "1 mm", true,
35  QObject::tr("width of line 3")));
36  Props.append(new Property("W4", "2 mm", true,
37  QObject::tr("width of line 4")));
38  Props.append(new Property("MSModel", "Hammerstad", false,
39  QObject::tr("quasi-static microstrip model")+
40  " [Hammerstad, Wheeler, Schneider]"));
41  Props.append(new Property("MSDispModel", "Kirschning", false,
42  QObject::tr("microstrip dispersion model")+" [Kirschning, Kobayashi, "
43  "Yamashita, Hammerstad, Getsinger, Schneider, Pramanick]"));
44  Props.append(new Property("Symbol", "showNumbers", false,
45  QObject::tr("show port numbers in symbol or not")+
46  " [showNumbers, noNumbers]"));
47 
48  createSymbol();
49 }
50 
52 {
53 }
54 
56 {
57  return new MScross();
58 }
59 
60 Element* MScross::info(QString& Name, char* &BitmapFile, bool getNewOne)
61 {
62  Name = QObject::tr("Microstrip Cross");
63  BitmapFile = (char *) "mscross";
64 
65  if(getNewOne) return new MScross();
66  return 0;
67 }
68 
70 {
71  Lines.append(new Line(-30, 0,-18, 0,QPen(QPen::darkBlue,2)));
72  Lines.append(new Line( 18, 0, 30, 0,QPen(QPen::darkBlue,2)));
73  Lines.append(new Line( 0, 18, 0, 30,QPen(QPen::darkBlue,2)));
74  Lines.append(new Line( 0,-30, 0,-18,QPen(QPen::darkBlue,2)));
75 
76  Lines.append(new Line(-18, -8, -8, -8,QPen(QPen::darkBlue,2)));
77  Lines.append(new Line(-18, 8, -8, 8,QPen(QPen::darkBlue,2)));
78  Lines.append(new Line(-18, -8,-18, 8,QPen(QPen::darkBlue,2)));
79 
80  Lines.append(new Line( 8, -8, 18, -8,QPen(QPen::darkBlue,2)));
81  Lines.append(new Line( 8, 8, 18, 8,QPen(QPen::darkBlue,2)));
82  Lines.append(new Line( 18, -8, 18, 8,QPen(QPen::darkBlue,2)));
83 
84  Lines.append(new Line( -8, 8, -8, 18,QPen(QPen::darkBlue,2)));
85  Lines.append(new Line( 8, 8, 8, 18,QPen(QPen::darkBlue,2)));
86  Lines.append(new Line( -8, 18, 8, 18,QPen(QPen::darkBlue,2)));
87 
88  Lines.append(new Line( -8,-18, -8, -8,QPen(QPen::darkBlue,2)));
89  Lines.append(new Line( 8,-18, 8, -8,QPen(QPen::darkBlue,2)));
90  Lines.append(new Line( -8,-18, 8,-18,QPen(QPen::darkBlue,2)));
91 
92  if(Props.getLast()->Value.at(0) != 'n') {
93  Texts.append(new Text(-26, 3, "1"));
94  Texts.append(new Text(-10,-30, "2"));
95  Texts.append(new Text( 21,-13, "3"));
96  Texts.append(new Text( 4, 18, "4"));
97  }
98 
99  Ports.append(new Port(-30, 0));
100  Ports.append(new Port( 0,-30));
101  Ports.append(new Port( 30, 0));
102  Ports.append(new Port( 0, 30));
103 
104  x1 = -30; y1 =-30;
105  x2 = 30; y2 = 30;
106 
107  tx = x1+4;
108  ty = y2+4;
109 }