22 #include "../diagrams/graph.h"
26 #include <qlineedit.h>
27 #include <qvalidator.h>
28 #include <qpushbutton.h>
32 : QSpinBox(Min, Max, Step, Parent)
35 editor()->setReadOnly(
true);
40 return QString::number(*(Values+Val));
47 : QDialog(Doc_, 0, TRUE, Qt::WDestructiveClose)
51 pGraph = setBiasPoints();
58 if(pGraph->
cPointsX.getFirst()->count <= 1) {
64 setCaption(tr(
"Bias Points"));
68 QGridLayout *all =
new QGridLayout(
this, pGraph->
cPointsX.count()+2,2,3,3);
71 all->setColStretch(1,5);
76 all->addWidget(
new QLabel(pD->
Var,
this), i,0);
80 all->addWidget(Box, i++,1);
81 connect(Box, SIGNAL(valueChanged(
int)), SLOT(slotNewValue(
int)));
86 all->setRowStretch(i,5);
87 QPushButton *ButtClose =
new QPushButton(tr(
"Close"),
this);
88 all->addMultiCellWidget(ButtClose, i+1,i+1, 0,1);
89 connect(ButtClose, SIGNAL(clicked()), SLOT(accept()));
96 for(
double *p = ValueList.first(); p!=0; p = ValueList.next())
101 void SweepDialog::slotNewValue(
int)
105 int Factor = 1, Index = 0;
106 for(
mySpinBox *pb = BoxList.first(); pb!=0; pb = BoxList.next()) {
107 Index += pb->value() * Factor;
112 double *p = ValueList.first();
113 for(
Node *pn = NodeList.first(); pn!=0; pn = NodeList.next()) {
114 pn->Name =
num2str(*(p+Index));
119 p = ValueList.next();
122 Doc->viewport()->update();
126 Graph* SweepDialog::setBiasPoints()
135 QString DataSet = Info.dirPath() + QDir::separator() + Doc->
DataSet;
140 for(pn = Doc->
Nodes->first(); pn != 0; pn = Doc->
Nodes->next()) {
141 if(pn->
Name.isEmpty())
continue;
152 if( ((
Wire*)pe)->isHorizontal() ) pn->
x1 |= 2;
160 if(pn->
cx < pe->
cx) pn->
x1 |= 1;
182 if( ((
Wire*)pe)->Port1 != pn )
183 ((
Wire*)pe)->Port1->Name =
"";
184 else ((
Wire*)pe)->Port2->Name =
"";
192 if(pc->
Model ==
"IProbe") {
193 pn = pc->
Ports.first()->Connection;
194 if(!pn->
Name.isEmpty())
195 pn = pc->
Ports.next()->Connection;
210 if( ((
Wire*)pe)->isHorizontal() ) pn->
x1 |= 2;
213 if(pn->
cx < pe->
cx) pn->
x1 |= 1;