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
param_sweep.cpp
Go to the documentation of this file.
1
/***************************************************************************
2
param_sweep.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 "
param_sweep.h
"
19
#include "
main.h
"
20
21
22
Param_Sweep::Param_Sweep
()
23
{
24
Description
= QObject::tr(
"Parameter sweep"
);
25
26
QString s =
Description
;
27
int
a = s.findRev(
" "
);
28
if
(a != -1) s[a] =
'\n'
;
// break line
29
30
Texts
.append(
new
Text
(0, 0, s.left(a), Qt::darkBlue,
QucsSettings
.
largeFontSize
));
31
if
(a != -1)
32
Texts
.append(
new
Text
(0, 0, s.mid(a+1), Qt::darkBlue,
QucsSettings
.
largeFontSize
));
33
34
x1
= -10;
y1
= -9;
35
x2
=
x1
+104;
y2
=
y1
+59;
36
37
tx
= 0;
38
ty
=
y2
+1;
39
Model
=
".SW"
;
40
Name
=
"SW"
;
41
42
// The index of the first 6 properties must not changed. Used in recreate().
43
Props
.append(
new
Property
(
"Sim"
,
""
,
true
,
44
QObject::tr(
"simulation to perform parameter sweep on"
)));
45
Props
.append(
new
Property
(
"Type"
,
"lin"
,
true
,
46
QObject::tr(
"sweep type"
)+
" [lin, log, list, const]"
));
47
Props
.append(
new
Property
(
"Param"
,
"R1"
,
true
,
48
QObject::tr(
"parameter to sweep"
)));
49
Props
.append(
new
Property
(
"Start"
,
"5 Ohm"
,
true
,
50
QObject::tr(
"start value for sweep"
)));
51
Props
.append(
new
Property
(
"Stop"
,
"50 Ohm"
,
true
,
52
QObject::tr(
"stop value for sweep"
)));
53
Props
.append(
new
Property
(
"Points"
,
"20"
,
true
,
54
QObject::tr(
"number of simulation steps"
)));
55
}
56
57
Param_Sweep::~Param_Sweep
()
58
{
59
}
60
61
Component
*
Param_Sweep::newOne
()
62
{
63
return
new
Param_Sweep
();
64
}
65
66
Element
*
Param_Sweep::info
(QString& Name,
char
* &BitmapFile,
bool
getNewOne)
67
{
68
Name = QObject::tr(
"Parameter sweep"
);
69
BitmapFile = (
char
*)
"sweep"
;
70
71
if
(getNewOne)
return
new
Param_Sweep
();
72
return
0;
73
}
74
75
void
Param_Sweep::recreate
(
Schematic
*)
76
{
77
Property
*pp =
Props
.at(1);
78
Props
.next();
79
if
((pp->
Value
==
"list"
) || (pp->
Value
==
"const"
)) {
80
// Call them "Symbol" to omit them in the netlist.
81
pp =
Props
.next();
82
pp->
Name
=
"Symbol"
;
83
pp->
display
=
false
;
84
pp =
Props
.next();
85
pp->
Name
=
"Symbol"
;
86
pp->
display
=
false
;
87
Props
.next()->Name =
"Values"
;
88
}
89
else
{
90
Props
.next()->Name =
"Start"
;
91
Props
.next()->Name =
"Stop"
;
92
Props
.next()->Name =
"Points"
;
93
}
94
}
95
Element::y1
int y1
Definition:
element.h:153
param_sweep.h
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
Param_Sweep::~Param_Sweep
~Param_Sweep()
Definition:
param_sweep.cpp:57
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
Param_Sweep::newOne
Component * newOne()
Definition:
param_sweep.cpp:61
Property
Definition:
element.h:94
Text
Definition:
element.h:82
Component
Definition:
component.h:33
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
Param_Sweep::info
static Element * info(QString &, char *&, bool getNewOne=false)
Definition:
param_sweep.cpp:66
Param_Sweep::Param_Sweep
Param_Sweep()
Definition:
param_sweep.cpp:22
Param_Sweep::recreate
void recreate(Schematic *)
Definition:
param_sweep.cpp:75
Element::x2
int x2
Definition:
element.h:153
Generated on Mon Sep 1 2014 20:05:20 for Qucs-GUI by
1.8.6