Qucs-GUI
0.0.18
Main Page
Related Pages
Data Structures
Files
File List
Globals
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
qucs
components
ac_sim.cpp
Go to the documentation of this file.
1
/***************************************************************************
2
ac_sim.cpp
3
------------
4
begin : Sat Aug 23 2003
5
copyright : (C) 2003 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 "
ac_sim.h
"
19
#include "
main.h
"
20
21
22
AC_Sim::AC_Sim
()
23
{
24
Description
= QObject::tr(
"ac simulation"
);
25
26
QString s =
Description
;
27
int
a = s.find(
" "
);
28
int
b = s.findRev(
" "
);
29
if
(a != -1 && b != -1) {
30
if
(a > (
int
) s.length() - b) b = a;
31
}
32
if
(a < 8 || s.length() - b < 8) b = -1;
33
if
(b != -1) s[b] =
'\n'
;
34
35
Texts
.append(
new
Text
(0, 0, s.left(b), Qt::darkBlue,
QucsSettings
.
largeFontSize
));
36
if
(b != -1)
37
Texts
.append(
new
Text
(0, 0, s.mid(b+1), Qt::darkBlue,
QucsSettings
.
largeFontSize
));
38
39
x1
= -10;
y1
= -9;
40
x2
=
x1
+128;
y2
=
y1
+41;
41
42
tx
= 0;
43
ty
=
y2
+1;
44
Model
=
".AC"
;
45
Name
=
"AC"
;
46
47
// The index of the first 4 properties must not changed. Used in recreate().
48
Props
.append(
new
Property
(
"Type"
,
"lin"
,
true
,
49
QObject::tr(
"sweep type"
)+
" [lin, log, list, const]"
));
50
Props
.append(
new
Property
(
"Start"
,
"1 GHz"
,
true
,
51
QObject::tr(
"start frequency in Hertz"
)));
52
Props
.append(
new
Property
(
"Stop"
,
"10 GHz"
,
true
,
53
QObject::tr(
"stop frequency in Hertz"
)));
54
Props
.append(
new
Property
(
"Points"
,
"19"
,
true
,
55
QObject::tr(
"number of simulation steps"
)));
56
Props
.append(
new
Property
(
"Noise"
,
"no"
,
false
,
57
QObject::tr(
"calculate noise voltages"
)+
58
" [yes, no]"
));
59
}
60
61
AC_Sim::~AC_Sim
()
62
{
63
}
64
65
Component
*
AC_Sim::newOne
()
66
{
67
return
new
AC_Sim
();
68
}
69
70
Element
*
AC_Sim::info
(QString& Name,
char
* &BitmapFile,
bool
getNewOne)
71
{
72
Name = QObject::tr(
"ac simulation"
);
73
BitmapFile = (
char
*)
"ac"
;
74
75
if
(getNewOne)
return
new
AC_Sim
();
76
return
0;
77
}
78
79
void
AC_Sim::recreate
(
Schematic
*)
80
{
81
Property
*pp =
Props
.first();
82
if
((pp->
Value
==
"list"
) || (pp->
Value
==
"const"
)) {
83
// Call them "Symbol" to omit them in the netlist.
84
pp =
Props
.next();
85
pp->
Name
=
"Symbol"
;
86
pp->
display
=
false
;
87
pp =
Props
.next();
88
pp->
Name
=
"Symbol"
;
89
pp->
display
=
false
;
90
Props
.next()->Name =
"Values"
;
91
}
92
else
{
93
Props
.next()->Name =
"Start"
;
94
Props
.next()->Name =
"Stop"
;
95
Props
.next()->Name =
"Points"
;
96
}
97
}
Element::y1
int y1
Definition:
element.h:153
AC_Sim::info
static Element * info(QString &, char *&, bool getNewOne=false)
Definition:
ac_sim.cpp:70
QucsSettings
tQucsSettings QucsSettings
Definition:
main.cpp:52
Component::tx
int tx
Definition:
component.h:78
Element::y2
int y2
Definition:
element.h:153
Element::x1
int x1
Definition:
element.h:153
AC_Sim::newOne
Component * newOne()
Definition:
ac_sim.cpp:65
AC_Sim::AC_Sim
AC_Sim()
Definition:
ac_sim.cpp:22
Property::display
bool display
Definition:
element.h:99
main.h
Definitions and declarations for the main application.
Component::ty
int ty
Definition:
component.h:78
Property::Value
QString Value
Definition:
element.h:97
ac_sim.h
Component::Props
Q3PtrList< Property > Props
Definition:
component.h:72
Property
Definition:
element.h:94
Text
Definition:
element.h:82
Component
Definition:
component.h:33
AC_Sim::recreate
void recreate(Schematic *)
Definition:
ac_sim.cpp:79
Element
Superclass of all schematic drawing elements.
Definition:
element.h:142
Property::Name
QString Name
Definition:
element.h:97
Component::Name
QString Name
Definition:
component.h:80
Component::Texts
Q3PtrList< Text > Texts
Definition:
component.h:71
Component::Model
QString Model
Definition:
component.h:80
Component::Description
QString Description
Definition:
component.h:81
tQucsSettings::largeFontSize
float largeFontSize
Definition:
main.h:47
Schematic
Definition:
schematic.h:69
Element::x2
int x2
Definition:
element.h:153
AC_Sim::~AC_Sim
~AC_Sim()
Definition:
ac_sim.cpp:61
Generated on Mon Sep 1 2014 20:05:19 for Qucs-GUI by
1.8.6