Qucs-GUI  0.0.19
/home/travis/build/Qucs/qucs/qucs/qucs/components/volt_noise.cpp
Go to the documentation of this file.
00001 /***************************************************************************
00002                                volt_noise.cpp
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 "volt_noise.h"
00019 
00020 
00021 Volt_noise::Volt_noise()
00022 {
00023   Description = QObject::tr("noise voltage source");
00024 
00025   Arcs.append(new Arc(-12,-12, 24, 24,     0, 16*360,QPen(Qt::darkBlue,2)));
00026   Lines.append(new Line(-30,  0,-12,  0,QPen(Qt::darkBlue,2)));
00027   Lines.append(new Line( 30,  0, 12,  0,QPen(Qt::darkBlue,2)));
00028 
00029   Lines.append(new Line(-12,  1,  1,-12,QPen(Qt::darkBlue,2)));
00030   Lines.append(new Line(-10,  6,  6,-10,QPen(Qt::darkBlue,2)));
00031   Lines.append(new Line( -7, 10, 10, -7,QPen(Qt::darkBlue,2)));
00032   Lines.append(new Line( -2, 12, 12, -2,QPen(Qt::darkBlue,2)));
00033 
00034   Ports.append(new Port( 30,  0));
00035   Ports.append(new Port(-30,  0));
00036 
00037   x1 = -30; y1 = -15;
00038   x2 =  30; y2 =  15;
00039 
00040   tx = x1+4;
00041   ty = y2+4;
00042   Model = "Vnoise";
00043   Name  = "V";
00044 
00045   Props.append(new Property("u", "1e-6", true,
00046     QObject::tr("voltage power spectral density in V^2/Hz")));
00047   Props.append(new Property("e", "0", false,
00048     QObject::tr("frequency exponent")));
00049   Props.append(new Property("c", "1", false,
00050     QObject::tr("frequency coefficient")));
00051   Props.append(new Property("a", "0", false,
00052     QObject::tr("additive frequency term")));
00053 
00054   rotate();  // fix historical flaw
00055 }
00056 
00057 Volt_noise::~Volt_noise()
00058 {
00059 }
00060 
00061 Component* Volt_noise::newOne()
00062 {
00063   return new Volt_noise();
00064 }
00065 
00066 Element* Volt_noise::info(QString& Name, char* &BitmapFile, bool getNewOne)
00067 {
00068   Name = QObject::tr("Noise Voltage Source");
00069   BitmapFile = (char *) "noise_volt";
00070 
00071   if(getNewOne)  return new Volt_noise();
00072   return 0;
00073 }
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines