Qucs-GUI
0.0.19
|
00001 /*************************************************************************** 00002 mutual.cpp 00003 ------------ 00004 begin : Sat Aug 20 2005 00005 copyright : (C) 2005 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 "mutual.h" 00019 00020 00021 Mutual::Mutual() 00022 { 00023 Description = QObject::tr("two mutual inductors"); 00024 00025 Arcs.append(new Arc(-16,-18,12,12, 16*270,16*180, QPen(Qt::darkBlue,2))); 00026 Arcs.append(new Arc(-16, -6,12,12, 16*270,16*180, QPen(Qt::darkBlue,2))); 00027 Arcs.append(new Arc(-16, 6,12,12, 16*270,16*180, QPen(Qt::darkBlue,2))); 00028 Arcs.append(new Arc( 4,-18,12,12, 16*90,16*180, QPen(Qt::darkBlue,2))); 00029 Arcs.append(new Arc( 4, -6,12,12, 16*90,16*180, QPen(Qt::darkBlue,2))); 00030 Arcs.append(new Arc( 4, 6,12,12, 16*90,16*180, QPen(Qt::darkBlue,2))); 00031 Lines.append(new Line(-10,-18,-10,-30,QPen(Qt::darkBlue,2))); 00032 Lines.append(new Line(-10,-30,-30,-30,QPen(Qt::darkBlue,2))); 00033 Lines.append(new Line( 10,-18, 10,-30,QPen(Qt::darkBlue,2))); 00034 Lines.append(new Line( 10,-30, 30,-30,QPen(Qt::darkBlue,2))); 00035 Lines.append(new Line(-10, 18,-10, 30,QPen(Qt::darkBlue,2))); 00036 Lines.append(new Line(-10, 30,-30, 30,QPen(Qt::darkBlue,2))); 00037 Lines.append(new Line( 10, 18, 10, 30,QPen(Qt::darkBlue,2))); 00038 Lines.append(new Line( 10, 30, 30, 30,QPen(Qt::darkBlue,2))); 00039 00040 Texts.append(new Text(-21, -22, "1")); 00041 Texts.append(new Text( 15, -22, "2")); 00042 Lines.append(new Line( 0,-20, 0, 20,QPen(Qt::darkBlue,1,Qt::DashLine))); 00043 00044 Ports.append(new Port(-30,-30)); 00045 Ports.append(new Port( 30,-30)); 00046 Ports.append(new Port( 30, 30)); 00047 Ports.append(new Port(-30, 30)); 00048 00049 x1 = -33; y1 = -34; 00050 x2 = 33; y2 = 34; 00051 00052 tx = x1+4; 00053 ty = y2+4; 00054 Model = "MUT"; 00055 Name = "Tr"; 00056 00057 Props.append(new Property("L1", "1 mH", false, 00058 QObject::tr("inductance of coil 1"))); 00059 Props.append(new Property("L2", "1 mH", false, 00060 QObject::tr("inductance of coil 2"))); 00061 Props.append(new Property("k", "0.9", false, 00062 QObject::tr("coupling factor between coil 1 and 2"))); 00063 } 00064 00065 Mutual::~Mutual() 00066 { 00067 } 00068 00069 Component* Mutual::newOne() 00070 { 00071 return new Mutual(); 00072 } 00073 00074 Element* Mutual::info(QString& Name, char* &BitmapFile, bool getNewOne) 00075 { 00076 Name = QObject::tr("Mutual Inductors"); 00077 BitmapFile = (char *) "mutual"; 00078 00079 if(getNewOne) return new Mutual(); 00080 return 0; 00081 }