Qucs-GUI  0.0.18
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
hb_sim.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  hb_sim.cpp - description
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 "hb_sim.h"
19 #include "main.h"
20 
21 
23 {
24  Description = QObject::tr("Harmonic balance simulation");
25 
26  QString s = Description;
27  int a = s.findRev(" ");
28  if (a != -1) s[a] = '\n'; // break line before the word "simulation"
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+163; y2 = y1+59;
36 
37  tx = 0;
38  ty = y2+1;
39  Model = ".HB";
40  Name = "HB";
41 
42  Props.append(new Property("f", "1 GHz", false,
43  QObject::tr("frequency in Hertz")));
44  Props.append(new Property("n", "4", true,
45  QObject::tr("number of harmonics")));
46  Props.append(new Property("iabstol", "1 pA", false,
47  QObject::tr("absolute tolerance for currents")));
48  Props.append(new Property("vabstol", "1 uV", false,
49  QObject::tr("absolute tolerance for voltages")));
50  Props.append(new Property("reltol", "0.001", false,
51  QObject::tr("relative tolerance for convergence")));
52  Props.append(new Property("MaxIter", "150", false,
53  QObject::tr("maximum number of iterations until error")));
54 }
55 
57 {
58 }
59 
61 {
62  return new HB_Sim();
63 }
64 
65 Element* HB_Sim::info(QString& Name, char* &BitmapFile, bool getNewOne)
66 {
67  Name = QObject::tr("Harmonic balance");
68  BitmapFile = (char *) "hb";
69 
70  if(getNewOne) return new HB_Sim();
71  return 0;
72 }
int y1
Definition: element.h:153
~HB_Sim()
Definition: hb_sim.cpp:56
tQucsSettings QucsSettings
Definition: main.cpp:52
int tx
Definition: component.h:78
int y2
Definition: element.h:153
int x1
Definition: element.h:153
Definitions and declarations for the main application.
int ty
Definition: component.h:78
Q3PtrList< Property > Props
Definition: component.h:72
Component * newOne()
Definition: hb_sim.cpp:60
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
QString Model
Definition: component.h:80
QString Description
Definition: component.h:81
float largeFontSize
Definition: main.h:47
static Element * info(QString &, char *&, bool getNewOne=false)
Definition: hb_sim.cpp:65
HB_Sim()
Definition: hb_sim.cpp:22
int x2
Definition: element.h:153