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
sp_sim.cpp
Go to the documentation of this file.
1
/***************************************************************************
2
sp_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 "
sp_sim.h
"
19
#include "
main.h
"
20
21
22
SP_Sim::SP_Sim
()
23
{
24
Description
= QObject::tr(
"S parameter 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
(b != -1) s[b] =
'\n'
;
33
34
Texts
.append(
new
Text
(0, 0, s.left(b), Qt::darkBlue,
QucsSettings
.
largeFontSize
));
35
if
(b != -1)
36
Texts
.append(
new
Text
(0, 0, s.mid(b+1), Qt::darkBlue,
QucsSettings
.
largeFontSize
));
37
38
x1
= -10;
y1
= -9;
39
x2
=
x1
+121;
y2
=
y1
+59;
40
41
tx
= 0;
42
ty
=
y2
+1;
43
Model
=
".SP"
;
44
Name
=
"SP"
;
45
46
// The index of the first 4 properties must not changed. Used in recreate().
47
Props
.append(
new
Property
(
"Type"
,
"lin"
,
true
,
48
QObject::tr(
"sweep type"
)+
" [lin, log, list, const]"
));
49
Props
.append(
new
Property
(
"Start"
,
"1 GHz"
,
true
,
50
QObject::tr(
"start frequency in Hertz"
)));
51
Props
.append(
new
Property
(
"Stop"
,
"10 GHz"
,
true
,
52
QObject::tr(
"stop frequency in Hertz"
)));
53
Props
.append(
new
Property
(
"Points"
,
"19"
,
true
,
54
QObject::tr(
"number of simulation steps"
)));
55
Props
.append(
new
Property
(
"Noise"
,
"no"
,
false
,
56
QObject::tr(
"calculate noise parameters"
)+
57
" [yes, no]"
));
58
Props
.append(
new
Property
(
"NoiseIP"
,
"1"
,
false
,
59
QObject::tr(
"input port for noise figure"
)));
60
Props
.append(
new
Property
(
"NoiseOP"
,
"2"
,
false
,
61
QObject::tr(
"output port for noise figure"
)));
62
Props
.append(
new
Property
(
"saveCVs"
,
"no"
,
false
,
63
QObject::tr(
"put characteristic values into dataset"
)+
64
" [yes, no]"
));
65
Props
.append(
new
Property
(
"saveAll"
,
"no"
,
false
,
66
QObject::tr(
"save subcircuit characteristic values into dataset"
)+
67
" [yes, no]"
));
68
}
69
70
SP_Sim::~SP_Sim
()
71
{
72
}
73
74
Component
*
SP_Sim::newOne
()
75
{
76
return
new
SP_Sim
();
77
}
78
79
Element
*
SP_Sim::info
(QString& Name,
char
* &BitmapFile,
bool
getNewOne)
80
{
81
Name = QObject::tr(
"S-parameter simulation"
);
82
BitmapFile = (
char
*)
"sparameter"
;
83
84
if
(getNewOne)
return
new
SP_Sim
();
85
return
0;
86
}
87
88
void
SP_Sim::recreate
(
Schematic
*)
89
{
90
Property
*pp =
Props
.first();
91
if
((pp->
Value
==
"list"
) || (pp->
Value
==
"const"
)) {
92
// Call them "Symbol" to omit them in the netlist.
93
pp =
Props
.next();
94
pp->
Name
=
"Symbol"
;
95
pp->
display
=
false
;
96
pp =
Props
.next();
97
pp->
Name
=
"Symbol"
;
98
pp->
display
=
false
;
99
Props
.next()->Name =
"Values"
;
100
}
101
else
{
102
Props
.next()->Name =
"Start"
;
103
Props
.next()->Name =
"Stop"
;
104
Props
.next()->Name =
"Points"
;
105
}
106
}
SP_Sim::info
static Element * info(QString &, char *&, bool getNewOne=false)
Definition:
sp_sim.cpp:79
Element::y1
int y1
Definition:
element.h:153
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
SP_Sim::SP_Sim
SP_Sim()
Definition:
sp_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
Component::Props
Q3PtrList< Property > Props
Definition:
component.h:72
Property
Definition:
element.h:94
Text
Definition:
element.h:82
Component
Definition:
component.h:33
sp_sim.h
Element
Superclass of all schematic drawing elements.
Definition:
element.h:142
SP_Sim::newOne
Component * newOne()
Definition:
sp_sim.cpp:74
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
SP_Sim::recreate
void recreate(Schematic *)
Definition:
sp_sim.cpp:88
Element::x2
int x2
Definition:
element.h:153
SP_Sim::~SP_Sim
~SP_Sim()
Definition:
sp_sim.cpp:70
Generated on Mon Sep 1 2014 20:05:20 for Qucs-GUI by
1.8.6