My Project  0.0.16
QUCS Mapping
 All Classes Namespaces 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(QPen::darkRed,2)));
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 
54  Lines.append(new Line(-30, 30, 30, -30,QPen(QPen::darkRed,2)));
55 
56  Lines.append(new Line(-40, 0,-30, 0,QPen(QPen::darkRed,2))); // Lin
57  Lines.append(new Line( 30, 0, 40, 0,QPen(QPen::darkRed,2))); // Lout
58 
59  Lines.append(new Line(-25, -20,-15, -20,QPen(QPen::darkRed,2)));
60  Lines.append(new Line( 25, 20, 15, 20,QPen(QPen::darkRed,2)));
61 
62  Texts.append(new Text(-10,-32, "1", QPen::darkRed, 12.0));
63  Texts.append(new Text( 0, 8, "n", QPen::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 }