Qucs-GUI  0.0.19
/home/travis/build/Qucs/qucs/qucs/qucs/components/DLS_nto1.cpp
Go to the documentation of this file.
00001 /*
00002  * DLS_nto1.cpp - device implementations for DLS_nto1 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_nto1.h"
00012 
00013 DLS_nto1::DLS_nto1()
00014 {
00015   Description = QObject::tr ("data voltage level shifter (analogue to digital) verilog device");
00016 
00017   Props.append (new Property ("LEVEL", "5 V", false,
00018     QObject::tr ("voltage level")
00019     +" ("+QObject::tr ("V")+")"));
00020   Props.append (new Property ("Delay", "1 ns", false,
00021     QObject::tr ("time delay")
00022     +" ("+QObject::tr ("s")+")"));
00023 
00024   createSymbol ();
00025   tx = x1 + 14;
00026   ty = y2 + 4;
00027   Model = "DLS_nto1";
00028   Name  = "Y";
00029 }
00030 
00031 Component * DLS_nto1::newOne()
00032 {
00033   DLS_nto1 * p = new DLS_nto1();
00034   p->Props.getFirst()->Value = Props.getFirst()->Value; 
00035   p->recreate(0); 
00036   return p;
00037 }
00038 
00039 Element * DLS_nto1::info(QString& Name, char * &BitmapFile, bool getNewOne)
00040 {
00041   Name = QObject::tr("A2D Level Shifter");
00042   BitmapFile = (char *) "DLS_nto1";
00043 
00044   if(getNewOne) return new DLS_nto1();
00045   return 0;
00046 }
00047 
00048 void DLS_nto1::createSymbol()
00049 {
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   Lines.append(new Line(-30, 30, -30, -30,QPen(Qt::darkRed,2)));
00054  
00055   Lines.append(new Line(-30, 30, 30, -30,QPen(Qt::darkRed,2)));
00056 
00057   Lines.append(new Line(-40,  0,-30,  0,QPen(Qt::darkRed,2)));  // Lin
00058   Lines.append(new Line( 30,  0, 40,  0,QPen(Qt::darkRed,2)));  // Lout
00059   
00060   Lines.append(new Line(-25, -20,-15, -20,QPen(Qt::darkRed,2)));
00061   Lines.append(new Line( 25,  20, 15,  20,QPen(Qt::darkRed,2)));
00062   
00063   Texts.append(new Text(-10,-32, "n", Qt::darkRed, 12.0));
00064   Texts.append(new Text(  0,  8, "1", Qt::darkRed, 12.0));
00065  
00066   Ports.append(new Port(-40, 0));  // Lin
00067   Ports.append(new Port( 40, 0));  // Lout
00068 
00069 
00070   x1 = -40; y1 = -34;
00071   x2 =  40; y2 =  34;
00072 }
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines