Qucs-GUI  0.0.19
/home/travis/build/Qucs/qucs/qucs/qucs/components/msvia.cpp
Go to the documentation of this file.
00001 /***************************************************************************
00002                                msvia.cpp
00003                               -----------
00004     begin                : Sat Oct 30 2004
00005     copyright            : (C) 2004 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 "msvia.h"
00019 #include "node.h"
00020 
00021 
00022 MSvia::MSvia()
00023 {
00024   Description = QObject::tr("microstrip via");
00025 
00026   Arcs.append(new Arc(-5,-4, 10,  7,  0, 16*360,QPen(Qt::darkBlue,2)));
00027   Lines.append(new Line(-20,  0, -5,  0,QPen(Qt::darkBlue,2)));
00028   Lines.append(new Line( -5,  0, -5, 14,QPen(Qt::darkBlue,2)));
00029   Lines.append(new Line(  5,  0,  5, 14,QPen(Qt::darkBlue,2)));
00030   Lines.append(new Line(-11, 14, 11, 14,QPen(Qt::darkBlue,3)));
00031   Lines.append(new Line( -7, 20,  7, 20,QPen(Qt::darkBlue,3)));
00032   Lines.append(new Line( -3, 26,  3, 26,QPen(Qt::darkBlue,3)));
00033 
00034   Ports.append(new Port(-20,  0));
00035 
00036   x1 = -20; y1 = -7;
00037   x2 =  14; y2 = 30;
00038 
00039   tx = 20;
00040   ty = 0;
00041   Model = "MVIA";
00042   Name  = "MS";
00043 
00044   Props.append(new Property("Subst", "Subst1", true,
00045     QObject::tr("substrate")));
00046   Props.append(new Property("D", "1 mm", true,
00047     QObject::tr("diameter of round via conductor")));
00048   Props.append(new Property("Temp", "26.85", false,
00049   QObject::tr("simulation temperature in degree Celsius")));
00050 }
00051 
00052 MSvia::~MSvia()
00053 {
00054 }
00055 
00056 // -------------------------------------------------------
00057 Component* MSvia::newOne()
00058 {
00059   return new MSvia();
00060 }
00061 
00062 // -------------------------------------------------------
00063 Element* MSvia::info(QString& Name, char* &BitmapFile, bool getNewOne)
00064 {
00065   Name = QObject::tr("Microstrip Via");
00066   BitmapFile = (char *) "msvia";
00067 
00068   if(getNewOne)  return new MSvia();
00069   return 0;
00070 }
00071 
00072 // -------------------------------------------------------
00073 QString MSvia::netlist()
00074 {
00075   QString s = Model+":"+Name;
00076 
00077   // output node name and add ground node
00078   s += " " + Ports.first()->Connection->Name + " gnd";
00079 
00080   // output all properties
00081   for(Property *p2 = Props.first(); p2 != 0; p2 = Props.next())
00082     s += " "+p2->Name+"=\""+p2->Value+"\"";
00083 
00084   return s + '\n';
00085 }
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines