Qucs-GUI  0.0.18
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
DLS_1ton.cpp
Go to the documentation of this file.
1 /*
2  * DLS_1ton.cpp - device implementations for DLS_1ton 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_1ton.h"
12 
14 {
15  Description = QObject::tr ("data voltage level shifter (digital to analogue) verilog device");
16 
17  Props.append (new Property ("LEVEL", "5 V", false,
18  QObject::tr ("voltage level")));
19  Props.append (new Property ("Delay", "1 ns", false,
20  QObject::tr ("time delay")
21  +" ("+QObject::tr ("s")+")"));
22 
23  createSymbol ();
24  tx = x1 + 14;
25  ty = y2 + 4;
26  Model = "DLS_1ton";
27  Name = "Y";
28 }
29 
31 {
32  DLS_1ton * p = new DLS_1ton();
33  p->Props.getFirst()->Value = Props.getFirst()->Value;
34  p->recreate(0);
35  return p;
36 }
37 
38 Element * DLS_1ton::info(QString& Name, char * &BitmapFile, bool getNewOne)
39 {
40  Name = QObject::tr("D2A Level Shifter");
41  BitmapFile = (char *) "DLS_1ton";
42 
43  if(getNewOne) return new DLS_1ton();
44  return 0;
45 }
46 
48 {
49  Lines.append(new Line(-30, -30, 30,-30,QPen(Qt::darkRed,2)));
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 
54  Lines.append(new Line(-30, 30, 30, -30,QPen(Qt::darkRed,2)));
55 
56  Lines.append(new Line(-40, 0,-30, 0,QPen(Qt::darkRed,2))); // Lin
57  Lines.append(new Line( 30, 0, 40, 0,QPen(Qt::darkRed,2))); // Lout
58 
59  Lines.append(new Line(-25, -20,-15, -20,QPen(Qt::darkRed,2)));
60  Lines.append(new Line( 25, 20, 15, 20,QPen(Qt::darkRed,2)));
61 
62  Texts.append(new Text(-10,-32, "1", Qt::darkRed, 12.0));
63  Texts.append(new Text( 0, 8, "n", Qt::darkRed, 12.0));
64 
65  Ports.append(new Port(-40, 0)); // Lin
66  Ports.append(new Port( 40, 0)); // Lout
67 
68  x1 = -40; y1 = -34;
69  x2 = 40; y2 = 34;
70 }
Q3PtrList< Line > Lines
Definition: component.h:67
int y1
Definition: element.h:153
DLS_1ton()
Definition: DLS_1ton.cpp:13
Component * newOne()
Definition: DLS_1ton.cpp:30
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
void createSymbol()
Definition: DLS_1ton.cpp:47
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
static Element * info(QString &, char *&, bool getNewOne=false)
Definition: DLS_1ton.cpp:38
QString Description
Definition: component.h:81
int x2
Definition: element.h:153
virtual void recreate(Schematic *)
Definition: component.h:39