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