My Project  0.0.16
QUCS Mapping
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
DLS_nto1.cpp
Go to the documentation of this file.
1 /*
2  * DLS_nto1.cpp - device implementations for DLS_nto1 module
3  *
4  * This is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2, or (at your option)
7  * any later version.
8  *
9  */
10 
11 #include "DLS_nto1.h"
12 
14 {
15  Description = QObject::tr ("data voltage level shifter (analogue to digital) verilog device");
16 
17  Props.append (new Property ("LEVEL", "5 V", false,
18  QObject::tr ("voltage level")
19  +" ("+QObject::tr ("V")+")"));
20  Props.append (new Property ("Delay", "1 ns", false,
21  QObject::tr ("time delay")
22  +" ("+QObject::tr ("s")+")"));
23 
24  createSymbol ();
25  tx = x1 + 14;
26  ty = y2 + 4;
27  Model = "DLS_nto1";
28  Name = "Y";
29 }
30 
32 {
33  DLS_nto1 * p = new DLS_nto1();
34  p->Props.getFirst()->Value = Props.getFirst()->Value;
35  p->recreate(0);
36  return p;
37 }
38 
39 Element * DLS_nto1::info(QString& Name, char * &BitmapFile, bool getNewOne)
40 {
41  Name = QObject::tr("A2D Level Shifter");
42  BitmapFile = (char *) "DLS_nto1";
43 
44  if(getNewOne) return new DLS_nto1();
45  return 0;
46 }
47 
49 {
50  Lines.append(new Line(-30, -30, 30,-30,QPen(QPen::darkRed,2)));
51  Lines.append(new Line( 30, -30, 30, 30,QPen(QPen::darkRed,2)));
52  Lines.append(new Line( 30, 30,-30, 30,QPen(QPen::darkRed,2)));
53  Lines.append(new Line(-30, 30, -30, -30,QPen(QPen::darkRed,2)));
54 
55  Lines.append(new Line(-30, 30, 30, -30,QPen(QPen::darkRed,2)));
56 
57  Lines.append(new Line(-40, 0,-30, 0,QPen(QPen::darkRed,2))); // Lin
58  Lines.append(new Line( 30, 0, 40, 0,QPen(QPen::darkRed,2))); // Lout
59 
60  Lines.append(new Line(-25, -20,-15, -20,QPen(QPen::darkRed,2)));
61  Lines.append(new Line( 25, 20, 15, 20,QPen(QPen::darkRed,2)));
62 
63  Texts.append(new Text(-10,-32, "n", QPen::darkRed, 12.0));
64  Texts.append(new Text( 0, 8, "1", QPen::darkRed, 12.0));
65 
66  Ports.append(new Port(-40, 0)); // Lin
67  Ports.append(new Port( 40, 0)); // Lout
68 
69 
70  x1 = -40; y1 = -34;
71  x2 = 40; y2 = 34;
72 }