Qucs-GUI
0.0.19
|
00001 /*************************************************************************** 00002 mscross.cpp - description 00003 ------------------- 00004 begin : Sat Aug 23 2003 00005 copyright : (C) 2003 by Michael Margraf 00006 email : michael.margraf@alumni.tu-berlin.de 00007 ***************************************************************************/ 00008 00009 /*************************************************************************** 00010 * * 00011 * This program is free software; you can redistribute it and/or modify * 00012 * it under the terms of the GNU General Public License as published by * 00013 * the Free Software Foundation; either version 2 of the License, or * 00014 * (at your option) any later version. * 00015 * * 00016 ***************************************************************************/ 00017 00018 #include "mscross.h" 00019 00020 00021 MScross::MScross() 00022 { 00023 Description = QObject::tr("microstrip cross"); 00024 00025 Model = "MCROSS"; 00026 Name = "MS"; 00027 00028 Props.append(new Property("Subst", "Subst1", true, 00029 QObject::tr("substrate"))); 00030 Props.append(new Property("W1", "1 mm", true, 00031 QObject::tr("width of line 1"))); 00032 Props.append(new Property("W2", "2 mm", true, 00033 QObject::tr("width of line 2"))); 00034 Props.append(new Property("W3", "1 mm", true, 00035 QObject::tr("width of line 3"))); 00036 Props.append(new Property("W4", "2 mm", true, 00037 QObject::tr("width of line 4"))); 00038 Props.append(new Property("MSModel", "Hammerstad", false, 00039 QObject::tr("quasi-static microstrip model")+ 00040 " [Hammerstad, Wheeler, Schneider]")); 00041 Props.append(new Property("MSDispModel", "Kirschning", false, 00042 QObject::tr("microstrip dispersion model")+" [Kirschning, Kobayashi, " 00043 "Yamashita, Hammerstad, Getsinger, Schneider, Pramanick]")); 00044 Props.append(new Property("Symbol", "showNumbers", false, 00045 QObject::tr("show port numbers in symbol or not")+ 00046 " [showNumbers, noNumbers]")); 00047 00048 createSymbol(); 00049 } 00050 00051 MScross::~MScross() 00052 { 00053 } 00054 00055 Component* MScross::newOne() 00056 { 00057 return new MScross(); 00058 } 00059 00060 Element* MScross::info(QString& Name, char* &BitmapFile, bool getNewOne) 00061 { 00062 Name = QObject::tr("Microstrip Cross"); 00063 BitmapFile = (char *) "mscross"; 00064 00065 if(getNewOne) return new MScross(); 00066 return 0; 00067 } 00068 00069 void MScross::createSymbol() 00070 { 00071 Lines.append(new Line(-30, 0,-18, 0,QPen(Qt::darkBlue,2))); 00072 Lines.append(new Line( 18, 0, 30, 0,QPen(Qt::darkBlue,2))); 00073 Lines.append(new Line( 0, 18, 0, 30,QPen(Qt::darkBlue,2))); 00074 Lines.append(new Line( 0,-30, 0,-18,QPen(Qt::darkBlue,2))); 00075 00076 Lines.append(new Line(-18, -8, -8, -8,QPen(Qt::darkBlue,2))); 00077 Lines.append(new Line(-18, 8, -8, 8,QPen(Qt::darkBlue,2))); 00078 Lines.append(new Line(-18, -8,-18, 8,QPen(Qt::darkBlue,2))); 00079 00080 Lines.append(new Line( 8, -8, 18, -8,QPen(Qt::darkBlue,2))); 00081 Lines.append(new Line( 8, 8, 18, 8,QPen(Qt::darkBlue,2))); 00082 Lines.append(new Line( 18, -8, 18, 8,QPen(Qt::darkBlue,2))); 00083 00084 Lines.append(new Line( -8, 8, -8, 18,QPen(Qt::darkBlue,2))); 00085 Lines.append(new Line( 8, 8, 8, 18,QPen(Qt::darkBlue,2))); 00086 Lines.append(new Line( -8, 18, 8, 18,QPen(Qt::darkBlue,2))); 00087 00088 Lines.append(new Line( -8,-18, -8, -8,QPen(Qt::darkBlue,2))); 00089 Lines.append(new Line( 8,-18, 8, -8,QPen(Qt::darkBlue,2))); 00090 Lines.append(new Line( -8,-18, 8,-18,QPen(Qt::darkBlue,2))); 00091 00092 if(Props.getLast()->Value.at(0) != 'n') { 00093 Texts.append(new Text(-26, 3, "1")); 00094 Texts.append(new Text(-10,-30, "2")); 00095 Texts.append(new Text( 21,-13, "3")); 00096 Texts.append(new Text( 4, 18, "4")); 00097 } 00098 00099 Ports.append(new Port(-30, 0)); 00100 Ports.append(new Port( 0,-30)); 00101 Ports.append(new Port( 30, 0)); 00102 Ports.append(new Port( 0, 30)); 00103 00104 x1 = -30; y1 =-30; 00105 x2 = 30; y2 = 30; 00106 00107 tx = x1+4; 00108 ty = y2+4; 00109 }