Qucs-GUI  0.0.18
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
digi_sim.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  digi_sim.cpp
3  --------------
4  begin : Oct 3 2005
5  copyright : (C) 2005 by Michael Margraf
6  email : michael.margraf@alumni.tu-berlin.de
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 #include <QtGui>
18 #include "digi_sim.h"
19 #include "main.h"
20 
21 
23 {
25  Description = QObject::tr("digital simulation");
26 
27  QString s = Description;
28  int a = s.find(" ");
29  if (a != -1) s[a] = '\n'; // break line before the word "simulation"
30 
31  Texts.append(new Text(0, 0, s.left(a), Qt::darkBlue, QucsSettings.largeFontSize));
32  if (a != -1)
33  Texts.append(new Text(0, 0, s.mid(a+1), Qt::darkBlue, QucsSettings.largeFontSize));
34 
35  x1 = -10; y1 = -9;
36  x2 = x1+120; y2 = y1+59;
37 
38  tx = 0;
39  ty = y2+1;
40  Model = ".Digi";
41  Name = "Digi";
42 
43  // Property list must keeps its order !
44  Props.append(new Property("Type", "TruthTable", true,
45  QObject::tr("type of simulation")+" [TruthTable, TimeList]"));
46  Props.append(new Property("time", "10 ns", false,
47  QObject::tr("duration of TimeList simulation")));
48  Props.append(new Property("Model", "VHDL", false,
49  QObject::tr("netlist format")+" [VHDL, Verilog]"));
50 }
51 
52 // -------------------------------------------------------
54 {
55 }
56 
57 // -------------------------------------------------------
59 {
60  return new Digi_Sim();
61 }
62 
63 // -------------------------------------------------------
64 Element* Digi_Sim::info(QString& Name, char* &BitmapFile, bool getNewOne)
65 {
66  Name = QObject::tr("digital simulation");
67  BitmapFile = (char *) "digi";
68 
69  if(getNewOne) return new Digi_Sim();
70  return 0;
71 }
int Type
Definition: element.h:152
int y1
Definition: element.h:153
tQucsSettings QucsSettings
Definition: main.cpp:52
static Element * info(QString &, char *&, bool getNewOne=false)
Definition: digi_sim.cpp:64
int tx
Definition: component.h:78
int y2
Definition: element.h:153
int x1
Definition: element.h:153
#define isDigitalComponent
Definition: element.h:113
Definitions and declarations for the main application.
int ty
Definition: component.h:78
Q3PtrList< Property > Props
Definition: component.h:72
Definition: element.h:82
Superclass of all schematic drawing elements.
Definition: element.h:142
QString Name
Definition: component.h:80
Q3PtrList< Text > Texts
Definition: component.h:71
~Digi_Sim()
Definition: digi_sim.cpp:53
QString Model
Definition: component.h:80
Digi_Sim()
Definition: digi_sim.cpp:22
QString Description
Definition: component.h:81
float largeFontSize
Definition: main.h:47
int x2
Definition: element.h:153
Component * newOne()
Definition: digi_sim.cpp:58