Qucs-GUI  0.0.19
/home/travis/build/Qucs/qucs/qucs/qucs/components/am_modulator.cpp
Go to the documentation of this file.
00001 /***************************************************************************
00002                                am_modulator.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 "am_modulator.h"
00019 
00020 
00021 AM_Modulator::AM_Modulator()
00022 {
00023   Description = QObject::tr("ac voltage source with amplitude modulator");
00024 
00025   Arcs.append(new Arc(-12,-12, 24, 24,     0, 16*360,QPen(Qt::darkBlue,2)));
00026   Arcs.append(new Arc( -7, -4,  7,  7,     0, 16*180,QPen(Qt::darkBlue,2)));
00027   Arcs.append(new Arc(  0, -4,  7,  7,16*180, 16*180,QPen(Qt::darkBlue,2)));
00028   Lines.append(new Line(  0, 30,  0, 12,QPen(Qt::darkBlue,2)));
00029   Lines.append(new Line(  0,-30,  0,-12,QPen(Qt::darkBlue,2)));
00030   Lines.append(new Line(  5,-18, 11,-18,QPen(Qt::red,1)));
00031   Lines.append(new Line(  8,-21,  8,-15,QPen(Qt::red,1)));
00032   Lines.append(new Line(  5, 18, 11, 18,QPen(Qt::black,1)));
00033 
00034   Lines.append(new Line(-12,  0,-30,  0,QPen(Qt::darkBlue,2)));
00035   Lines.append(new Line(-12,  0,-17,  5,QPen(Qt::darkBlue,2)));
00036   Lines.append(new Line(-12,  0,-17, -5,QPen(Qt::darkBlue,2)));
00037   Texts.append(new Text(-30,-22, QObject::tr("AM"), Qt::black, 10.0,1.0,0.0));
00038 
00039   Ports.append(new Port(  0,-30));
00040   Ports.append(new Port(  0, 30));
00041   Ports.append(new Port(-30,  0));
00042 
00043   x1 = -30; y1 = -30;
00044   x2 =  14; y2 =  30;
00045 
00046   tx = x2+4;
00047   ty = y1+4;
00048   Model = "AM_Mod";
00049   Name  = "V";
00050 
00051   Props.append(new Property("U", "1 V", true,
00052     QObject::tr("peak voltage in Volts")));
00053   Props.append(new Property("f", "1 GHz", false,
00054     QObject::tr("frequency in Hertz")));
00055   Props.append(new Property("Phase", "0", false,
00056     QObject::tr("initial phase in degrees")));
00057   Props.append(new Property("m", "1.0", false,
00058     QObject::tr("modulation level")));
00059 }
00060 
00061 AM_Modulator::~AM_Modulator()
00062 {
00063 }
00064 
00065 Component* AM_Modulator::newOne()
00066 {
00067   return new AM_Modulator();
00068 }
00069 
00070 Element* AM_Modulator::info(QString& Name, char* &BitmapFile, bool getNewOne)
00071 {
00072   Name = QObject::tr("AM modulated Source");
00073   BitmapFile = (char *) "am_mod";
00074 
00075   if(getNewOne)  return new AM_Modulator();
00076   return 0;
00077 }
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines