Qucs-GUI  0.0.19
/home/travis/build/Qucs/qucs/qucs/qucs/components/relais.cpp
Go to the documentation of this file.
00001 /***************************************************************************
00002                                 relais.cpp
00003                                ------------
00004     begin                : Sat Feb 25 2006
00005     copyright            : (C) 2006 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 "relais.h"
00019 
00020 
00021 Relais::Relais()
00022 {
00023   Description = QObject::tr("relay");
00024 
00025   Lines.append(new Line(-30,-30,-30, -8,QPen(Qt::darkBlue,2)));
00026   Lines.append(new Line(-30,  8,-30, 30,QPen(Qt::darkBlue,2)));
00027   Lines.append(new Line(-45, -8,-15, -8,QPen(Qt::darkBlue,2)));
00028   Lines.append(new Line(-45,  8,-15,  8,QPen(Qt::darkBlue,2)));
00029   Lines.append(new Line(-45, -8,-45,  8,QPen(Qt::darkBlue,2)));
00030   Lines.append(new Line(-15, -8,-15,  8,QPen(Qt::darkBlue,2)));
00031   Lines.append(new Line(-45,  8,-15, -8,QPen(Qt::darkBlue,2)));
00032 
00033   Lines.append(new Line(-43, -3,-37, -3,QPen(Qt::red,1)));
00034   Lines.append(new Line(-40, -6,-40,  0,QPen(Qt::red,1)));
00035   Lines.append(new Line(-23,  3,-17,  3,QPen(Qt::black,1)));  
00036 
00037   Lines.append(new Line(-15,  0, 35,  0,QPen(Qt::darkBlue,1,Qt::DotLine)));
00038 
00039   Lines.append(new Line( 30,-30, 30,-18,QPen(Qt::darkBlue,2)));
00040   Lines.append(new Line( 30, 15, 30, 30,QPen(Qt::darkBlue,2)));
00041   Lines.append(new Line( 30, 15, 45,-15,QPen(Qt::darkBlue,2)));
00042   Arcs.append(new Arc( 27,-18, 5, 5, 0, 16*360,QPen(Qt::darkBlue,2)));
00043   Ellips.append(new Area( 27, 12, 6, 6, QPen(Qt::darkBlue,2),
00044                          QBrush(Qt::darkBlue, Qt::SolidPattern)));
00045 
00046   Ports.append(new Port(-30,-30));
00047   Ports.append(new Port( 30,-30));
00048   Ports.append(new Port( 30, 30));
00049   Ports.append(new Port(-30, 30));
00050 
00051   x1 = -48; y1 = -30;
00052   x2 =  45; y2 =  30;
00053 
00054   tx = x2+4;
00055   ty = y1+4;
00056   Model = "Relais";
00057   Name  = "S";
00058 
00059   Props.append(new Property("Vt", "0.5 V", false,
00060     QObject::tr("threshold voltage in Volts")));
00061   Props.append(new Property("Vh", "0.1 V", false,
00062     QObject::tr("hysteresis voltage in Volts")));
00063   Props.append(new Property("Ron", "0", false,
00064     QObject::tr("resistance of \"on\" state in Ohms")));
00065   Props.append(new Property("Roff", "1e12", false,
00066     QObject::tr("resistance of \"off\" state in Ohms")));
00067   Props.append(new Property("Temp", "26.85", false,
00068     QObject::tr("simulation temperature in degree Celsius")));
00069 }
00070 
00071 Relais::~Relais()
00072 {
00073 }
00074 
00075 Component* Relais::newOne()
00076 {
00077   return new Relais();
00078 }
00079 
00080 Element* Relais::info(QString& Name, char* &BitmapFile, bool getNewOne)
00081 {
00082   Name = QObject::tr("Relay");
00083   BitmapFile = (char *) "relais";
00084 
00085   if(getNewOne)  return new Relais();
00086   return 0;
00087 }
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines