Qucs-GUI  0.0.18
 All Data Structures 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(Qt::darkRed,2)));
51  Lines.append(new Line( 30, -30, 30, 30,QPen(Qt::darkRed,2)));
52  Lines.append(new Line( 30, 30,-30, 30,QPen(Qt::darkRed,2)));
53  Lines.append(new Line(-30, 30, -30, -30,QPen(Qt::darkRed,2)));
54 
55  Lines.append(new Line(-30, 30, 30, -30,QPen(Qt::darkRed,2)));
56 
57  Lines.append(new Line(-40, 0,-30, 0,QPen(Qt::darkRed,2))); // Lin
58  Lines.append(new Line( 30, 0, 40, 0,QPen(Qt::darkRed,2))); // Lout
59 
60  Lines.append(new Line(-25, -20,-15, -20,QPen(Qt::darkRed,2)));
61  Lines.append(new Line( 25, 20, 15, 20,QPen(Qt::darkRed,2)));
62 
63  Texts.append(new Text(-10,-32, "n", Qt::darkRed, 12.0));
64  Texts.append(new Text( 0, 8, "1", Qt::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 }
Q3PtrList< Line > Lines
Definition: component.h:67
Component * newOne()
Definition: DLS_nto1.cpp:31
static Element * info(QString &, char *&, bool getNewOne=false)
Definition: DLS_nto1.cpp:39
DLS_nto1()
Definition: DLS_nto1.cpp:13
int y1
Definition: element.h:153
int tx
Definition: component.h:78
int y2
Definition: element.h:153
Definition: element.h:72
int x1
Definition: element.h:153
int ty
Definition: component.h:78
Q3PtrList< Property > Props
Definition: component.h:72
Definition: element.h:82
Definition: element.h:48
Superclass of all schematic drawing elements.
Definition: element.h:142
Q3PtrList< Port > Ports
Definition: component.h:70
QString Name
Definition: component.h:80
Q3PtrList< Text > Texts
Definition: component.h:71
QString Model
Definition: component.h:80
QString Description
Definition: component.h:81
void createSymbol()
Definition: DLS_nto1.cpp:48
int x2
Definition: element.h:153
virtual void recreate(Schematic *)
Definition: component.h:39