Qucs-GUI  0.0.19
/home/travis/build/Qucs/qucs/qucs/qucs/components/DLS_1ton.cpp
Go to the documentation of this file.
00001 /*
00002  * DLS_1ton.cpp - device implementations for DLS_1ton module
00003  *
00004  * This is free software; you can redistribute it and/or modify
00005  * it under the terms of the GNU General Public License as published by
00006  * the Free Software Foundation; either version 2, or (at your option)
00007  * any later version.
00008  * 
00009  */
00010 
00011 #include "DLS_1ton.h"
00012 
00013 DLS_1ton::DLS_1ton()
00014 {
00015   Description = QObject::tr ("data voltage level shifter (digital to analogue) verilog device");
00016 
00017   Props.append (new Property ("LEVEL", "5 V", false,
00018     QObject::tr ("voltage level")));
00019   Props.append (new Property ("Delay", "1 ns", false,
00020     QObject::tr ("time delay")
00021     +" ("+QObject::tr ("s")+")"));
00022 
00023   createSymbol ();
00024   tx = x1 + 14;
00025   ty = y2 + 4;
00026   Model = "DLS_1ton";
00027   Name  = "Y";
00028 }
00029 
00030 Component * DLS_1ton::newOne()
00031 {
00032   DLS_1ton * p = new DLS_1ton();
00033   p->Props.getFirst()->Value = Props.getFirst()->Value; 
00034   p->recreate(0); 
00035   return p;
00036 }
00037 
00038 Element * DLS_1ton::info(QString& Name, char * &BitmapFile, bool getNewOne)
00039 {
00040   Name = QObject::tr("D2A Level Shifter");
00041   BitmapFile = (char *) "DLS_1ton";
00042 
00043   if(getNewOne) return new DLS_1ton();
00044   return 0;
00045 }
00046 
00047 void DLS_1ton::createSymbol()
00048 {
00049   Lines.append(new Line(-30, -30, 30,-30,QPen(Qt::darkRed,2)));
00050   Lines.append(new Line( 30, -30, 30, 30,QPen(Qt::darkRed,2)));
00051   Lines.append(new Line( 30, 30,-30, 30,QPen(Qt::darkRed,2)));
00052   Lines.append(new Line(-30, 30, -30, -30,QPen(Qt::darkRed,2)));
00053  
00054   Lines.append(new Line(-30, 30, 30, -30,QPen(Qt::darkRed,2)));
00055 
00056   Lines.append(new Line(-40,  0,-30,  0,QPen(Qt::darkRed,2))); // Lin
00057   Lines.append(new Line( 30,  0, 40,  0,QPen(Qt::darkRed,2))); // Lout
00058   
00059   Lines.append(new Line(-25, -20,-15, -20,QPen(Qt::darkRed,2)));
00060   Lines.append(new Line( 25,  20, 15,  20,QPen(Qt::darkRed,2)));
00061   
00062   Texts.append(new Text(-10,-32, "1", Qt::darkRed, 12.0));
00063   Texts.append(new Text(  0,  8, "n", Qt::darkRed, 12.0));
00064  
00065   Ports.append(new Port(-40, 0));  // Lin
00066   Ports.append(new Port( 40, 0));  // Lout
00067 
00068   x1 = -40; y1 = -34;
00069   x2 =  40; y2 =  34;
00070 }
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines