*** empty log message ***

This commit is contained in:
margraf 2005-09-12 12:01:40 +00:00
parent 68d1beeb4b
commit 5a90cc85ec
29 changed files with 5679 additions and 6484 deletions

5
NEWS
View File

@ -26,6 +26,11 @@ files.
Version 0.0.8
-------------
* dialog for changing properties of several components
* creating matching circuits
* more filters supported by filter synthese tool
* many more models in component library
Version 0.0.7
-------------

View File

@ -3,7 +3,7 @@
---------------
begin : Wed Mar 02 2005
copyright : (C) 2005 by Toyoyuki Ishikawa
(C) 2005 by Vincent
(C) 2005 by Vincent Habchi, F5RCS
(C) 2005 by Michael Margraf
***************************************************************************/
@ -72,6 +72,24 @@ QString LC_Filter::num2str(double Num)
}
double BesselCoef [9] [10] = {
{0.5755, 2.1478, 0, 0, 0, 0, 0, 0, 0, 0 },
{0.3374, 0.9705, 2.2034, 0, 0, 0, 0, 0, 0, 0},
{0.2334, 0.6725, 1.0815, 2.2404, 0, 0, 0, 0, 0, 0},
{0.1743, 0.5072, 0.8040, 1.1110, 2.2582, 0, 0, 0, 0, 0},
{0.1365, 0.4002, 0.6392, 0.8538, 1.1126, 2.2645, 0, 0, 0, 0},
{0.1106, 0.3259, 0.5249, 0.7020, 0.8690, 1.1052, 2.2659, 0, 0, 0},
{0.0919, 0.2719, 0.4409, 0.5936, 0.7303, 0.8695, 1.0956, 2.2656, 0, 0},
{0.0780, 0.2313, 0.3370, 0.5108, 0.6306, 0.7407, 0.8639, 1.0863, 2.2649, 0},
{0.0672, 0.1998, 0.3270, 0.4454, 0.5528, 0.6493, 0.7420, 0.8561, 1.0781, 2.2641}};
// Calculate normalized component value for Bessel filter
double LC_Filter::BesselValue(int No, int Order)
{
return BesselCoef [Order - 2] [No];
}
// Calculate normalized component value for Butterworth filter
double LC_Filter::ButterworthValue(int No, int Order)
{
@ -79,29 +97,28 @@ double LC_Filter::ButterworthValue(int No, int Order)
}
// Calculate normalized component value for Chebichev filter
double LC_Filter::ChebichevValue(int No, int Order, double Ripple)
// Calculate normalized component value for Tschebyscheff filter
// "Ripple" is in dB !
double LC_Filter::TschebyscheffValue(int No, int Order, double Ripple)
{
// We must define static variables since g(k+1) is tied to g(k)
static double ak, bk, gk ;
double a, bk1, bk2 ;
static double ak, gk ;
double a, b;
Ripple = sqrt (Ripple * Ripple - 1.0);
if (No == 0) { // first value of new series
ak = 2.0 * sin (double(2 * No + 1) * M_PI / double(2 * Order));
gk = ak / (sinh (Ripple / (2 * Order)));
}
Ripple = sqrt(pow(10.0, (Ripple / 10.0)) - 1.0);
Ripple = sinh(asinh(1.0 / Ripple) / double(Order));
a = sin(double(2 * No + 1) / double(2 * Order) * M_PI);
if (No == 0)
gk = a / Ripple;
else {
a = sin ((2 * No + 1) * M_PI / (2 * Order)) ;
gk = (2.0 * ak * a) / (bk * gk) ;
ak = a ;
b = sin(double(No) * M_PI / double(Order));
gk *= Ripple * Ripple + b * b;
gk = ak * a / gk;
}
ak = a;
bk1 = sinh (Ripple / (2 * Order));
bk2 = sin ((No + 1) * M_PI / Order);
bk = bk1 * bk1 + bk2 * bk2;
return gk ;
return 2.0 * gk;
}
@ -117,16 +134,17 @@ double LC_Filter::ChebichevValue(int No, int Order, double Ripple)
// Frequency - corner frequency (lowpass and highpass) or
// band start frequency (bandpass and bandstop)
// Frequency2 - band stop frequency (only for bandpass and bandstop)
QString* LC_Filter::createSchematic(int Class, double Impedance, int Order,
double Frequency, double Frequency2)
QString* LC_Filter::createSchematic(tFilter *Filter)
{
double Value, Value2, Omega, Bandwidth;
if((Class == CLASS_BANDPASS) || (Class == CLASS_BANDSTOP))
Omega = (Frequency2 + Frequency) / 2.0;
else
Omega = Frequency;
if((Filter->Class == CLASS_BANDPASS) || (Filter->Class == CLASS_BANDSTOP))
Omega = (Filter->Frequency2 + Filter->Frequency) / 2.0;
else {
Filter->Frequency2 = 0.0;
Omega = Filter->Frequency;
}
Bandwidth = fabs(Frequency2 - Frequency) / Omega;
Bandwidth = fabs(Filter->Frequency2 - Filter->Frequency) / Omega;
Omega *= 2.0*M_PI; // angular frequency
// create the Qucs schematic
@ -136,24 +154,38 @@ QString* LC_Filter::createSchematic(int Class, double Impedance, int Order,
int i, x, yc=320, yl;
x = 20;
if(Class != CLASS_BANDPASS) x += 40;
if(Filter->Class != CLASS_BANDPASS) x += 40;
*s += "<Components>\n";
*s += QString("<Pac P1 1 %1 320 18 -26 0 1 \"1\" 1 \"%2 Ohm\" 1 \"0 dBm\" 0 \"1 GHz\" 0>\n").arg(x).arg(Impedance);
*s += QString("<Pac P1 1 %1 320 18 -26 0 1 \"1\" 1 \"%2 Ohm\" 1 \"0 dBm\" 0 \"1 GHz\" 0>\n").arg(x).arg(Filter->Impedance);
*s += QString("<GND * 1 %1 350 0 0 0 0>\n").arg(x);
for(i = 0; i < Order; i++) {
for(i = 0; i < Filter->Order; i++) {
x = 100 +((i+1) * 70);
yc = 320;
yl = 240;
Value = ButterworthValue(i, Order);
//Value = ChebichevValue(i, Order, 0.2);
switch(Filter->Type) {
case TYPE_BESSEL:
Value = BesselValue(i, Filter->Order);
break;
case TYPE_BUTTERWORTH:
Value = ButterworthValue(i, Filter->Order);
break;
case TYPE_TSCHEBYSCHEFF:
Value = TschebyscheffValue(i, Filter->Order, Filter->Ripple);
break;
default:
Value = 0.0;
*s = QString("");
return s;
}
// de-normalize
if(i & 1) Value *= Impedance / Omega;
else Value /= Impedance * Omega;
if(i & 1) Value *= Filter->Impedance / Omega;
else Value /= Filter->Impedance * Omega;
switch(Class) {
switch(Filter->Class) {
case CLASS_LOWPASS:
if(i & 1)
@ -174,7 +206,7 @@ QString* LC_Filter::createSchematic(int Class, double Impedance, int Order,
case CLASS_BANDPASS:
Value /= Bandwidth; // transform to bandpass
Value2 = 0.25 / Frequency / Frequency2 / M_PI / M_PI / Value;
Value2 = 0.25 / Filter->Frequency / Filter->Frequency2 / M_PI / M_PI / Value;
if(i & 1) {
*s += QString("<L L%1 1 %2 %3 -26 -44 0 0 \"%4H\" 1>\n").arg(i+1).arg(x+40).arg(yl).arg(num2str(Value));
*s += QString("<C C%1 1 %2 %3 -26 10 0 0 \"%4F\" 1>\n").arg(i+1).arg(x-20).arg(yl).arg(num2str(Value2));
@ -188,7 +220,7 @@ QString* LC_Filter::createSchematic(int Class, double Impedance, int Order,
case CLASS_BANDSTOP:
Value2 = 1.0 / Omega / Omega / Bandwidth / Value; // transform to bandstop
Value *= 0.5 * fabs(Frequency2/Frequency - Frequency/Frequency2);
Value *= 0.5 * fabs(Filter->Frequency2/Filter->Frequency - Filter->Frequency/Filter->Frequency2);
if(i & 1) {
*s += QString("<L L%1 1 %2 %3 -26 -44 0 0 \"%4H\" 1>\n").arg(i+1).arg(x).arg(yl-35).arg(num2str(Value));
*s += QString("<C C%1 1 %2 %3 -26 10 0 0 \"%4F\" 1>\n").arg(i+1).arg(x).arg(yl).arg(num2str(Value2));
@ -208,17 +240,17 @@ QString* LC_Filter::createSchematic(int Class, double Impedance, int Order,
}
if(Order & 1) x += 110;
if(Filter->Order & 1) x += 110;
else x += 70;
*s += QString("<Pac P2 1 %1 320 18 -26 0 1 \"2\" 1 \"%2 Ohm\" 1 \"0 dBm\" 0 \"1 GHz\" 0>\n").arg(x).arg(Impedance);
*s += QString("<Pac P2 1 %1 320 18 -26 0 1 \"2\" 1 \"%2 Ohm\" 1 \"0 dBm\" 0 \"1 GHz\" 0>\n").arg(x).arg(Filter->Impedance);
*s += QString("<GND * 1 %1 350 0 0 0 0>\n").arg(x);
yc += 100;
Value = Frequency / 10.0;
if((Class == CLASS_BANDPASS) || (Class == CLASS_BANDSTOP))
Value2 = 10.0 * Frequency2;
Value = Filter->Frequency / 10.0;
if((Filter->Class == CLASS_BANDPASS) || (Filter->Class == CLASS_BANDSTOP))
Value2 = 10.0 * Filter->Frequency2;
else
Value2 = 10.0 * Frequency;
Value2 = 10.0 * Filter->Frequency;
*s += QString("<.SP SP1 1 70 %1 0 50 0 0 \"log\" 1 \"%2Hz\" 1 \"%3Hz\" 1 \"200\" 1 \"no\" 0 \"1\" 0 \"2\" 0>\n").arg(yc).arg(num2str(Value)).arg(num2str(Value2));
*s += QString("<Eqn Eqn1 1 260 %1 -28 15 0 0 \"dBS21=dB(S[2,1])\" 1 \"dBS11=dB(S[1,1])\" 1 \"yes\" 0>\n").arg(yc+10);
*s += "</Components>\n";
@ -227,42 +259,42 @@ QString* LC_Filter::createSchematic(int Class, double Impedance, int Order,
// connect left source
x = 20;
if(Class != CLASS_BANDPASS) x += 40;
if(Filter->Class != CLASS_BANDPASS) x += 40;
*s += QString("<%1 240 %2 290 \"\" 0 0 0>\n").arg(x).arg(x);
*s += QString("<%1 240 170 240 \"\" 0 0 0>\n").arg(x);
// wires down to shunt components
for(i = 0; i < (Order / 2) + 1; i++) {
for(i = 0; i < (Filter->Order / 2) + 1; i++) {
x = 170 + (i * 140);
*s += QString("<%1 240 %2 290 \"\" 0 0 0>\n").arg(x).arg(x);
}
// horizontal wires for series components
if(Class == CLASS_BANDPASS) {
for(i = 0; i < (Order / 2); i++) {
if(Filter->Class == CLASS_BANDPASS) {
for(i = 0; i < (Filter->Order / 2); i++) {
x = 170 + (i * 140);
*s += QString("<%1 240 %2 240 \"\" 0 0 0>\n").arg(x).arg(x+20);
*s += QString("<%1 290 %2 290 \"\" 0 0 0>\n").arg(x-30).arg(x);
*s += QString("<%1 350 %2 350 \"\" 0 0 0>\n").arg(x-30).arg(x);
}
if(Order & 1) {
if(Filter->Order & 1) {
*s += QString("<%1 290 %2 290 \"\" 0 0 0>\n").arg(x+110).arg(x+140);
*s += QString("<%1 350 %2 350 \"\" 0 0 0>\n").arg(x+110).arg(x+140);
}
}
else
for(i = 0; i < (Order / 2); i++) {
for(i = 0; i < (Filter->Order / 2); i++) {
x = 170 + (i * 140);
*s += QString("<%1 240 %2 240 \"\" 0 0 0>\n").arg(x).arg(x+40);
*s += QString("<%1 240 %2 240 \"\" 0 0 0>\n").arg(x+100).arg(x+140);
if(Class == CLASS_BANDSTOP) {
if(Filter->Class == CLASS_BANDSTOP) {
*s += QString("<%1 240 %2 205 \"\" 0 0 0>\n").arg(x+40).arg(x+40);
*s += QString("<%1 240 %2 205 \"\" 0 0 0>\n").arg(x+100).arg(x+100);
}
}
// connect right source
if(Order & 1) {
if(Filter->Order & 1) {
x += 140 + 110;
*s += QString("<%1 240 %2 290 \"\" 0 0 0>\n").arg(x).arg(x);
*s += QString("<%1 240 %2 240 \"\" 0 0 0>\n").arg(x-110).arg(x);
@ -274,18 +306,24 @@ QString* LC_Filter::createSchematic(int Class, double Impedance, int Order,
*s += "<Paintings>\n";
*s += QString("<Text 400 %1 12 #000000 0 \"Butterworth ").arg(yc+10);
switch(Class) {
case CLASS_LOWPASS:
*s += QString("low-pass filter\\n%1Hz cutoff").arg(num2str(Frequency)); break;
case CLASS_HIGHPASS:
*s += QString("high-pass filter\\n%1Hz cutoff").arg(num2str(Frequency)); break;
case CLASS_BANDPASS:
*s += QString("band-pass filter\\n%1Hz...%2Hz").arg(num2str(Frequency)).arg(num2str(Frequency2)); break;
case CLASS_BANDSTOP:
*s += QString("band-reject filter\\n%1Hz...%2Hz").arg(num2str(Frequency)).arg(num2str(Frequency2)); break;
*s += QString("<Text 400 %1 12 #000000 0 \"").arg(yc+10);
switch(Filter->Type) {
case TYPE_BESSEL: *s += QString("Bessel "); break;
case TYPE_BUTTERWORTH: *s += QString("Butterworth "); break;
case TYPE_TSCHEBYSCHEFF: *s += QString("Tschebyscheff "); break;
}
*s += QString(", PI-type,\\nimpedance matching %3 Ohm\">\n").arg(Impedance);
switch(Filter->Class) {
case CLASS_LOWPASS:
*s += QString("low-pass filter\\n%1Hz cutoff").arg(num2str(Filter->Frequency)); break;
case CLASS_HIGHPASS:
*s += QString("high-pass filter\\n%1Hz cutoff").arg(num2str(Filter->Frequency)); break;
case CLASS_BANDPASS:
*s += QString("band-pass filter\\n%1Hz...%2Hz").arg(num2str(Filter->Frequency)).arg(num2str(Filter->Frequency2)); break;
case CLASS_BANDSTOP:
*s += QString("band-reject filter\\n%1Hz...%2Hz").arg(num2str(Filter->Frequency)).arg(num2str(Filter->Frequency2)); break;
}
*s += QString(", PI-type,\\nimpedance matching %3 Ohm\">\n").arg(Filter->Impedance);
*s += "</Paintings>\n";
return s;

View File

@ -24,6 +24,21 @@
#define CLASS_BANDPASS 2
#define CLASS_BANDSTOP 3
#define TYPE_BESSEL 0
#define TYPE_BUTTERWORTH 1
#define TYPE_TSCHEBYSCHEFF 2
typedef struct tFilter {
int Type;
int Class;
int Order;
double Ripple; // in dB
double Impedance;
double Frequency;
double Frequency2;
};
class QString;
@ -32,12 +47,13 @@ public:
LC_Filter();
~LC_Filter();
static QString* createSchematic(int, double, int, double, double Frequency2=0.0);
static QString* createSchematic(tFilter*);
private:
static QString num2str(double);
static double BesselValue(int, int);
static double ButterworthValue(int, int);
static double ChebichevValue(int, int, double);
static double TschebyscheffValue(int, int, double);
};
#endif

View File

@ -74,8 +74,9 @@ QucsFilter::QucsFilter()
QLabel *Label1 = new QLabel(tr("Filter type:"), this);
gbox->addWidget(Label1, 1,0);
ComboType = new QComboBox(this);
#define TYPE_BUTTERWORTH 0
ComboType->insertItem("Bessel");
ComboType->insertItem("Butterworth");
ComboType->insertItem("Tschebyscheff");
gbox->addWidget(ComboType, 1,1);
connect(ComboType, SIGNAL(activated(int)), SLOT(slotTypeChanged(int)));
@ -183,7 +184,8 @@ void QucsFilter::slotHelpAbout()
QMessageBox::about(this, tr("About..."),
tr("QucsFilter Version ")+PACKAGE_VERSION+
tr("\nFilter synthesis program\n")+
tr("Copyright (C) 2005 by Toyoyuki Ishikawa and Michael Margraf\n")+
tr("Copyright (C) 2005 by")+
"\n Toyoyuki Ishikawa, Vincent Habchi, Michael Margraf\n"
"\nThis is free software; see the source for copying conditions."
"\nThere is NO warranty; not even for MERCHANTABILITY or "
"\nFITNESS FOR A PARTICULAR PURPOSE.\n\n");
@ -202,28 +204,45 @@ void QucsFilter::slotHelpIntro()
d->show();
}
// ************************************************************
void QucsFilter::setError(const QString& Message)
{
LabelResult->setText(tr("Result:") + "<font color=\"#FF0000\"><b> " +
tr("Error") + "</b></font>");
QMessageBox::critical(this, tr("Error"), Message);
}
// ************************************************************
void QucsFilter::slotCalculate()
{
// get numerical values from input widgets
int Order = EditOrder->text().toInt();
double CornerFreq = EditCorner->text().toDouble();
double StopFreq = EditStop->text().toDouble();
// double Ripple_dB = EditRipple->text().toDouble();
double Impedance = EditImpedance->text().toDouble();
CornerFreq *= pow(10, double(3*ComboCorner->currentItem())); // add exponent
StopFreq *= pow(10, double(3*ComboStop->currentItem()));
tFilter Filter;
Filter.Type = ComboType->currentItem();
Filter.Class = ComboClass->currentItem();
Filter.Order = EditOrder->text().toInt();
Filter.Ripple = EditRipple->text().toDouble();
Filter.Impedance = EditImpedance->text().toDouble();
Filter.Frequency = CornerFreq;
Filter.Frequency2 = StopFreq;
QString *s = 0;
// call appropriate filter synthesis function
switch(ComboType->currentItem()) {
case TYPE_BUTTERWORTH :
s = LC_Filter::createSchematic(ComboClass->currentItem(), Impedance,
Order, CornerFreq, StopFreq);
break;
if(EditStop->isEnabled())
if(Filter.Frequency >= Filter.Frequency2) {
setError(tr("Stop frequency must be greater than start frequency."));
return;
}
if(Filter.Order < 2) {
setError(tr("Filter order must not be less than two."));
return;
}
QString *s = LC_Filter::createSchematic(&Filter);
if(!s) return;
@ -264,11 +283,17 @@ void QucsFilter::slotShowResult()
void QucsFilter::slotTypeChanged(int index)
{
switch(index) {
case TYPE_BESSEL :
case TYPE_BUTTERWORTH :
LabelRipple->setEnabled(false);
EditRipple->setEnabled(false);
Label_dB->setEnabled(false);
break;
case TYPE_TSCHEBYSCHEFF :
LabelRipple->setEnabled(true);
EditRipple->setEnabled(true);
Label_dB->setEnabled(true);
break;
}
}

View File

@ -55,6 +55,8 @@ private slots:
void slotShowResult();
private:
void setError(const QString&);
int ResultState;
QGridLayout *gbox;

View File

@ -31,6 +31,9 @@ Short Description of Actions<br><br>
<tr><td>mouse wheel + Ctrl Button</td>
<td>Zooms into or outof the drawing area.</td>
</tr>
<tr><td>drag'n'drop file into document area</td>
<td>Tries to open file as Qucs schematic or data display.</td>
</tr>
</table>

View File

@ -1,3 +1,15 @@
2005-10-09 Michael Margraf <michael.margraf@alumni.tu-berlin.de>
* bugfix: add path to SPICE files in work directory
* dialog for two-port matching
2005-30-08 Michael Margraf <michael.margraf@alumni.tu-berlin.de>
* mark input and output of matching circuits
* qucs-filter: Tschebyscheff filter, band pass, band stop
* drag'n'drop now works correctly
* drag'n'drop of schematic files into the document area
2005-20-08 Michael Margraf <michael.margraf@alumni.tu-berlin.de>
* new components: mutual indoctors (2 and 3), correlated

View File

@ -942,11 +942,11 @@ bool Diagram::loadVarData(const QString& fileName, Graph *g)
Variable = g->Var;
}
else {
file.setName(g->Var.left(pos)+".dat");
QFileInfo Info(fileName);
file.setName(Info.dirPath()+QDir::separator() + g->Var.left(pos)+".dat");
Variable = g->Var.mid(pos+1);
}
file.setName(QucsWorkDir.filePath(file.name()));
if(!file.open(IO_ReadOnly)) return false;
// *****************************************************************

View File

@ -237,7 +237,7 @@ DiagramDialog::DiagramDialog(Diagram *d, const QString& _DataSet,
connect(ChooseData, SIGNAL(activated(int)), SLOT(slotReadVars(int)));
ChooseVars = new QListView(DataGroup);
ChooseVars->addColumn(tr("Name"));
ChooseVars->addColumn(tr("Status"));
ChooseVars->addColumn(tr("Type"));
ChooseVars->addColumn(tr("Size"));
connect(ChooseVars, SIGNAL(doubleClicked(QListViewItem*)),
SLOT(slotTakeVar(QListViewItem*)));
@ -545,20 +545,19 @@ DiagramDialog::DiagramDialog(Diagram *d, const QString& _DataSet,
connect(ApplyButt, SIGNAL(clicked()), SLOT(slotApply()));
QPushButton *CancelButt = new QPushButton(tr("Cancel"), Butts);
connect(CancelButt, SIGNAL(clicked()), SLOT(slotCancel()));
// QPushButton *HelpButt = new QPushButton(tr("Function Help"), Butts);
// connect(HelpButt, SIGNAL(clicked()), SLOT(slotFuncHelp()));
OkButt->setDefault(true);
// ...........................................................
// put all data files into ComboBox
QDir ProjDir(QucsWorkDir);
QFileInfo Info(defaultDataSet);
QDir ProjDir(Info.dirPath());
QStringList Elements = ProjDir.entryList("*.dat", QDir::Files, QDir::Name);
QStringList::iterator it;
for(it = Elements.begin(); it != Elements.end(); ++it) {
ChooseData->insertItem((*it).left((*it).length()-4));
if((*it) == defaultDataSet)
if((*it) == Info.fileName())
// default dataset should be the current
ChooseData->setCurrentItem(ChooseData->count()-1);
}
@ -592,9 +591,10 @@ DiagramDialog::~DiagramDialog()
// --------------------------------------------------------------------------
void DiagramDialog::slotReadVars(int)
{
QFileInfo Info(defaultDataSet);
QString DocName = ChooseData->currentText()+".dat";
QFile file(QucsWorkDir.filePath(DocName));
QFile file(Info.dirPath() + QDir::separator() + DocName);
if(!file.open(IO_ReadOnly)) {
return;
}
@ -637,7 +637,8 @@ void DiagramDialog::slotTakeVar(QListViewItem *Item)
int i = GraphInput->cursorPosition();
QString s = GraphInput->text();
QString s1 = Item->text(0);
if(ChooseData->currentText() != defaultDataSet.section('.',0,0))
QFileInfo Info(defaultDataSet);
if(ChooseData->currentText() != Info.baseName())
s1 = ChooseData->currentText() + ":" + s1;
GraphInput->setText(s.left(i) + s1 + s.right(s.length()-i));

View File

@ -30,90 +30,143 @@
#include <qlabel.h>
#include <qlayout.h>
#include <qhbox.h>
#include <qvbox.h>
#include <qlineedit.h>
#include <qcombobox.h>
#include <qcheckbox.h>
#include <qvalidator.h>
#include <qpushbutton.h>
#include <qmessagebox.h>
#include <qapplication.h>
#include <qclipboard.h>
#include <qhgroupbox.h>
#include <qvgroupbox.h>
MatchDialog::MatchDialog(QWidget *parent, double Rreal_, double Rimag_,
double Freq_, double Z0_)
MatchDialog::MatchDialog(QWidget *parent)
: QDialog(parent, 0, TRUE, Qt::WDestructiveClose)
{
setCaption(tr("Create Matching Circuit"));
DoubleVal = new QDoubleValidator(this);
all = new QVBoxLayout(this, 3,3);
TwoCheck = new QCheckBox(tr("calculate two-port matching"), this);
all->addWidget(TwoCheck);
TwoCheck->setChecked(true);
connect(TwoCheck, SIGNAL(toggled(bool)), SLOT(slotSetTwoPort(bool)));
// ...........................................................
all = new QGridLayout(this, 5,5,3,3);
QHGroupBox *ImpBox = new QHGroupBox(tr("Reference Impedance"), this);
all->addWidget(ImpBox);
Port1Label = new QLabel(tr("Port 1"), ImpBox);
Ref1Edit = new QLineEdit("50", ImpBox);
Ref1Edit->setValidator(DoubleVal);
Ohm1Label = new QLabel(tr("ohms"), ImpBox);
connect(Ref1Edit, SIGNAL(textChanged(const QString&)),
SLOT(slotImpedanceChanged(const QString&)));
ImpBox->addSpace(50); // placeholder
Port2Label = new QLabel(tr("Port 2"), ImpBox);
Ref2Edit = new QLineEdit("50", ImpBox);
Ref2Edit->setValidator(DoubleVal);
Ohm2Label = new QLabel(tr("ohms"), ImpBox);
all->addWidget(new QLabel(tr("Reference Impedance:"), this), 0,0);
ReferenceEdit = new QLineEdit(this);
ReferenceEdit->setValidator(DoubleVal);
ReferenceEdit->setText(QString::number(Z0_));
all->addWidget(ReferenceEdit, 0,1);
all->addMultiCellWidget(new QLabel(tr("Ohm"), this), 0,0,2,3);
connect(ReferenceEdit, SIGNAL(textChanged(const QString&)),
SLOT(slotReflexionChanged(const QString&)));
all->addWidget(new QLabel(tr("Frequency:"), this), 1,0);
FrequencyEdit = new QLineEdit(this);
// ...........................................................
QVGroupBox *SParBox = new QVGroupBox(tr("S Parameter"), this);
all->addWidget(SParBox);
QHBox *h1 = new QHBox(SParBox);
h1->setSpacing(3);
FormatLabel = new QLabel(tr("Input format"), h1);
FormatCombo = new QComboBox(h1);
FormatCombo->insertItem(tr("real/imag"));
FormatCombo->insertItem(tr("mag/deg"));
connect(FormatCombo, SIGNAL(activated(int)), SLOT(slotChangeMode(int)));
QWidget *place1 = new QWidget(h1); // stretchable placeholder
h1->setStretchFactor(place1, 5);
QHBox *h3 = new QHBox(SParBox);
h3->setSpacing(3);
QVBox *VBox1 = new QVBox(h3);
S11Label = new QLabel(tr("S11"), VBox1);
S21Label = new QLabel(tr("S21"), VBox1);
QVBox *VBox2 = new QVBox(h3);
S11magEdit = new QLineEdit("0.5", VBox2);
S11magEdit->setValidator(DoubleVal);
S21magEdit = new QLineEdit("0.5", VBox2);
S21magEdit->setValidator(DoubleVal);
QVBox *VBox3 = new QVBox(h3);
S11sLabel = new QLabel("+j", VBox3);
S21sLabel = new QLabel("+j", VBox3);
QVBox *VBox4 = new QVBox(h3);
S11degEdit = new QLineEdit("0", VBox4);
S11degEdit->setValidator(DoubleVal);
S21degEdit = new QLineEdit("0", VBox4);
S21degEdit->setValidator(DoubleVal);
QVBox *VBox5 = new QVBox(h3);
S11uLabel = new QLabel(" ", VBox5);
S21uLabel = new QLabel(" ", VBox5);
QWidget *place4 = new QWidget(h3); // stretchable placeholder
h3->setStretchFactor(place4, 5);
QVBox *VBox6 = new QVBox(h3);
S12Label = new QLabel(tr("S12"), VBox6);
S22Label = new QLabel(tr("S22"), VBox6);
QVBox *VBox7 = new QVBox(h3);
S12magEdit = new QLineEdit("0", VBox7);
S12magEdit->setValidator(DoubleVal);
S22magEdit = new QLineEdit("0.5", VBox7);
S22magEdit->setValidator(DoubleVal);
QVBox *VBox8 = new QVBox(h3);
S12sLabel = new QLabel("+j", VBox8);
S22sLabel = new QLabel("+j", VBox8);
QVBox *VBox9 = new QVBox(h3);
S12degEdit = new QLineEdit("0", VBox9);
S12degEdit->setValidator(DoubleVal);
S22degEdit = new QLineEdit("0", VBox9);
S22degEdit->setValidator(DoubleVal);
QVBox *VBox0 = new QVBox(h3);
S12uLabel = new QLabel(" ", VBox0);
S22uLabel = new QLabel(" ", VBox0);
connect(S21magEdit, SIGNAL(textChanged(const QString&)),
SLOT(slotImpedanceChanged(const QString&)));
connect(S21degEdit, SIGNAL(textChanged(const QString&)),
SLOT(slotImpedanceChanged(const QString&)));
connect(S11magEdit, SIGNAL(textChanged(const QString&)),
SLOT(slotReflexionChanged(const QString&)));
connect(S11degEdit, SIGNAL(textChanged(const QString&)),
SLOT(slotReflexionChanged(const QString&)));
QHBox *h2 = new QHBox(SParBox);
h2->setSpacing(3);
FrequencyLabel = new QLabel(tr("Frequency:"), h2);
FrequencyEdit = new QLineEdit(h2);
FrequencyEdit->setValidator(DoubleVal);
all->addWidget(FrequencyEdit, 1,1);
UnitCombo = new QComboBox(this);
UnitCombo = new QComboBox(h2);
UnitCombo->insertItem("Hz");
UnitCombo->insertItem("kHz");
UnitCombo->insertItem("MHz");
UnitCombo->insertItem("GHz");
all->addMultiCellWidget(UnitCombo, 1,1,2,3);
int Expo = int(log10(Freq_) / 3.0);
if(Expo < 0) Expo = 0;
else if(Expo > 3) Expo = 3;
UnitCombo->setCurrentItem(Expo);
Freq_ /= pow(10.0, double(3*Expo));
FrequencyEdit->setText(QString::number(Freq_));
all->addWidget(new QLabel(tr("Impedance:"), this), 2,0);
ImpedanceRealEdit = new QLineEdit(this);
ImpedanceRealEdit->setValidator(DoubleVal);
all->addWidget(ImpedanceRealEdit, 2,1);
all->addWidget(new QLabel("+j", this), 2,2);
ImpedanceImagEdit = new QLineEdit(this);
ImpedanceImagEdit->setValidator(DoubleVal);
all->addWidget(ImpedanceImagEdit, 2,3);
all->addWidget(new QLabel(tr("Ohm"), this), 2,4);
connect(ImpedanceRealEdit, SIGNAL(textChanged(const QString&)),
SLOT(slotImpedanceChanged(const QString&)));
connect(ImpedanceImagEdit, SIGNAL(textChanged(const QString&)),
SLOT(slotImpedanceChanged(const QString&)));
all->addWidget(new QLabel(tr("Reflexion Coefficient:"), this), 3,0);
ReflexionRealEdit = new QLineEdit(this);
ReflexionRealEdit->setValidator(DoubleVal);
ReflexionRealEdit->setText(QString::number(Rreal_));
all->addWidget(ReflexionRealEdit, 3,1);
all->addWidget(new QLabel("+j", this), 3,2);
ReflexionImagEdit = new QLineEdit(this);
ReflexionImagEdit->setValidator(DoubleVal);
ReflexionImagEdit->setText(QString::number(Rimag_));
all->addWidget(ReflexionImagEdit, 3,3);
connect(ReflexionRealEdit, SIGNAL(textChanged(const QString&)),
SLOT(slotReflexionChanged(const QString&)));
connect(ReflexionImagEdit, SIGNAL(textChanged(const QString&)),
SLOT(slotReflexionChanged(const QString&)));
slotReflexionChanged(""); // calculate impedance
QWidget *place2 = new QWidget(h2); // stretchable placeholder
h2->setStretchFactor(place2, 5);
// ...........................................................
QHBox *h0 = new QHBox(this);
h0->setSpacing(5);
all->addMultiCellWidget(h0, 4,4, 0,4);
all->addWidget(h0);
QWidget *place3 = new QWidget(h0); // stretchable placeholder
h0->setStretchFactor(place3, 5);
connect(new QPushButton(tr("Create"),h0), SIGNAL(clicked()),
SLOT(slotButtCreate()));
connect(new QPushButton(tr("Cancel"),h0), SIGNAL(clicked()),
SLOT(reject()));
// slotReflexionChanged(""); // calculate impedance
setFrequency(1e9); // set 1GHz
resize(520, 100);
}
MatchDialog::~MatchDialog()
@ -122,21 +175,152 @@ MatchDialog::~MatchDialog()
delete DoubleVal;
}
// -----------------------------------------------------------------------
void MatchDialog::setFrequency(double Freq_)
{
int Expo = int(log10(Freq_) / 3.0);
if(Expo < 0) Expo = 0;
else if(Expo > 3) Expo = 3;
UnitCombo->setCurrentItem(Expo);
Freq_ /= pow(10.0, double(3*Expo));
FrequencyEdit->setText(QString::number(Freq_));
}
// -----------------------------------------------------------------------
// Is called when the checkbox for two-port matching changes.
void MatchDialog::slotSetTwoPort(bool on)
{
if(on) { // two-port matching ?
S11Label->setText(tr("S11"));
S21Label->setText(tr("S21"));
S12magEdit->setEnabled(true);
S22magEdit->setEnabled(true);
S12degEdit->setEnabled(true);
S22degEdit->setEnabled(true);
S12Label->setEnabled(true);
S22Label->setEnabled(true);
S12sLabel->setEnabled(true);
S22sLabel->setEnabled(true);
S12degEdit->setEnabled(true);
S22degEdit->setEnabled(true);
S12uLabel->setEnabled(true);
S22uLabel->setEnabled(true);
Port2Label->setEnabled(true);
Ref2Edit->setEnabled(true);
Ohm2Label->setEnabled(true);
}
else {
S11Label->setText(tr("Reflexion Coefficient"));
S21Label->setText(tr("Impedance (ohms)"));
S12magEdit->setEnabled(false);
S22magEdit->setEnabled(false);
S12degEdit->setEnabled(false);
S22degEdit->setEnabled(false);
S12Label->setEnabled(false);
S22Label->setEnabled(false);
S12sLabel->setEnabled(false);
S22sLabel->setEnabled(false);
S12degEdit->setEnabled(false);
S22degEdit->setEnabled(false);
S12uLabel->setEnabled(false);
S22uLabel->setEnabled(false);
Port2Label->setEnabled(false);
Ref2Edit->setEnabled(false);
Ohm2Label->setEnabled(false);
}
}
// -----------------------------------------------------------------------
// Is called when the combobox changes between mag/deg and real/imag.
void MatchDialog::slotChangeMode(int Index)
{
if(Index) { // polar ?
S11sLabel->setText("/");
S12sLabel->setText("/");
S21sLabel->setText("/");
S22sLabel->setText("/");
S11uLabel->setText("°");
S12uLabel->setText("°");
S21uLabel->setText("°");
S22uLabel->setText("°");
double Real = S11magEdit->text().toDouble();
double Imag = S11degEdit->text().toDouble();
c2p(Real, Imag);
S11magEdit->setText(QString::number(Real));
S11degEdit->setText(QString::number(Imag));
Real = S12magEdit->text().toDouble();
Imag = S12degEdit->text().toDouble();
c2p(Real, Imag);
S12magEdit->setText(QString::number(Real));
S12degEdit->setText(QString::number(Imag));
Real = S21magEdit->text().toDouble();
Imag = S21degEdit->text().toDouble();
c2p(Real, Imag);
S21magEdit->setText(QString::number(Real));
S21degEdit->setText(QString::number(Imag));
Real = S22magEdit->text().toDouble();
Imag = S22degEdit->text().toDouble();
c2p(Real, Imag);
S22magEdit->setText(QString::number(Real));
S22degEdit->setText(QString::number(Imag));
}
else { // cartesian
S11sLabel->setText("+j");
S12sLabel->setText("+j");
S21sLabel->setText("+j");
S22sLabel->setText("+j");
S11uLabel->setText(" ");
S12uLabel->setText(" ");
S21uLabel->setText(" ");
S22uLabel->setText(" ");
double Mag = S11magEdit->text().toDouble();
double Phase = S11degEdit->text().toDouble();
p2c(Mag, Phase);
S11magEdit->setText(QString::number(Mag));
S11degEdit->setText(QString::number(Phase));
Mag = S12magEdit->text().toDouble();
Phase = S12degEdit->text().toDouble();
p2c(Mag, Phase);
S12magEdit->setText(QString::number(Mag));
S12degEdit->setText(QString::number(Phase));
Mag = S21magEdit->text().toDouble();
Phase = S21degEdit->text().toDouble();
p2c(Mag, Phase);
S21magEdit->setText(QString::number(Mag));
S21degEdit->setText(QString::number(Phase));
Mag = S22magEdit->text().toDouble();
Phase = S22degEdit->text().toDouble();
p2c(Mag, Phase);
S22magEdit->setText(QString::number(Mag));
S22degEdit->setText(QString::number(Phase));
}
}
// -----------------------------------------------------------------------
// Is called if the user changed the impedance. -> The reflexion
// coefficient is calculated.
void MatchDialog::slotImpedanceChanged(const QString&)
{
double Z0 = ReferenceEdit->text().toDouble();
double Real = ImpedanceRealEdit->text().toDouble();
double Imag = ImpedanceImagEdit->text().toDouble();
if(TwoCheck->isChecked()) return;
double Z0 = Ref1Edit->text().toDouble();
double Real = S21magEdit->text().toDouble();
double Imag = S21degEdit->text().toDouble();
z2r(Real, Imag, Z0);
ReflexionRealEdit->blockSignals(true); // do not call "changed-slot"
ReflexionRealEdit->setText(QString::number(Real));
ReflexionRealEdit->blockSignals(false);
ReflexionImagEdit->blockSignals(true); // do not call "changed-slot"
ReflexionImagEdit->setText(QString::number(Imag));
ReflexionImagEdit->blockSignals(false);
S11magEdit->blockSignals(true); // do not call "changed-slot"
S11magEdit->setText(QString::number(Real));
S11magEdit->blockSignals(false);
S11degEdit->blockSignals(true); // do not call "changed-slot"
S11degEdit->setText(QString::number(Imag));
S11degEdit->blockSignals(false);
}
// -----------------------------------------------------------------------
@ -144,36 +328,82 @@ void MatchDialog::slotImpedanceChanged(const QString&)
// is calculated.
void MatchDialog::slotReflexionChanged(const QString&)
{
double Z0 = ReferenceEdit->text().toDouble();
double Real = ReflexionRealEdit->text().toDouble();
double Imag = ReflexionImagEdit->text().toDouble();
if(TwoCheck->isChecked()) return;
double Z0 = Ref1Edit->text().toDouble();
double Real = S11magEdit->text().toDouble();
double Imag = S11degEdit->text().toDouble();
r2z(Real, Imag, Z0);
ImpedanceRealEdit->blockSignals(true); // do not call "changed-slot"
ImpedanceRealEdit->setText(QString::number(Real));
ImpedanceRealEdit->blockSignals(false);
ImpedanceImagEdit->blockSignals(true); // do not call "changed-slot"
ImpedanceImagEdit->setText(QString::number(Imag));
ImpedanceImagEdit->blockSignals(false);
S21magEdit->blockSignals(true); // do not call "changed-slot"
S21magEdit->setText(QString::number(Real));
S21magEdit->blockSignals(false);
S21degEdit->blockSignals(true); // do not call "changed-slot"
S21degEdit->setText(QString::number(Imag));
S21degEdit->blockSignals(false);
}
// -----------------------------------------------------------------------
// Is called if the "Create"-button is pressed.
void MatchDialog::slotButtCreate()
{
double Z0 = ReferenceEdit->text().toDouble();
double Z1 = Ref1Edit->text().toDouble();
double Z2 = Ref2Edit->text().toDouble();
double Freq = FrequencyEdit->text().toDouble() *
pow(10.0, 3.0*double(UnitCombo->currentItem()));
double Real = ReflexionRealEdit->text().toDouble();
double Imag = ReflexionImagEdit->text().toDouble();
if(!calcMatchingCircuit(Real, Imag, Z0, Freq))
return;
double S11real = S11magEdit->text().toDouble();
double S11imag = S11degEdit->text().toDouble();
double S12real = S12magEdit->text().toDouble();
double S12imag = S12degEdit->text().toDouble();
double S21real = S21magEdit->text().toDouble();
double S21imag = S21degEdit->text().toDouble();
double S22real = S22magEdit->text().toDouble();
double S22imag = S22degEdit->text().toDouble();
if(FormatCombo->currentItem()) { // are they polar ?
p2c(S11real, S11imag);
p2c(S12real, S12imag);
p2c(S21real, S21imag);
p2c(S22real, S22imag);
}
if(TwoCheck->isChecked()) { // two-port matching ?
// determinante of S-parameter matrix
double DetReal = S11real*S22real - S11imag*S22imag
- S12real*S21real + S12imag*S21imag;
double DetImag = S11real*S22imag + S11imag*S22real
- S12real*S21imag - S12imag*S21real;
if(!MatchDialog::calc2PortMatch(S11real, S11imag, S22real, S22imag,
DetReal, DetImag, Z1, Z2, Freq))
return;
}
else
if(!calcMatchingCircuit(S11real, S11imag, Z1, Freq))
return;
QucsMain->Acts.slotEditPaste(true);
accept();
}
// -----------------------------------------------------------------------
// transform real/imag into mag/deg (cartesian to polar)
void MatchDialog::c2p(double& Real, double& Imag)
{
double Real_ = Real;
Real = sqrt(Real*Real + Imag*Imag); // magnitude
Imag = 180.0/M_PI * atan2(Imag, Real_); // phase in degree
}
// -----------------------------------------------------------------------
// transform mag/deg into real/imag (polar to cartesian)
void MatchDialog::p2c(double& Real, double& Imag)
{
double Real_ = Real;
Real = Real_ * cos(Imag * M_PI/180.0); // real part
Imag = Real_ * sin(Imag * M_PI/180.0); // imaginary part
}
// -----------------------------------------------------------------------
// transform reflexion coefficient into impedance
void MatchDialog::r2z(double& Real, double& Imag, double Z0)
@ -207,7 +437,7 @@ QString MatchDialog::calcMatching(double r_real, double r_imag,
return QString(""); // matching not possible
}
// In high-Q circuits, Zreal often becomes somewhat about 1e-16
// In high-Q circuits, Zreal often becomes somewhat about -1e-16
// because of numerical inaccuracy.
Zreal = 0.0;
}
@ -299,29 +529,31 @@ bool MatchDialog::calcMatchingCircuit(double r_real, double r_imag,
Schematic += "<C C1";
else
Schematic += "<L L1";
Schematic += " 1 10 10 -26 10 0 0 \"" + Str.section(':', 1,1) + "\" 1>\n";
Schematic += " 1 50 10 -26 10 0 0 \"" + Str.section(':', 1,1) + "\" 1>\n";
if(Str.section(':', 2,2).right(1) == "F")
Schematic += "<C C2";
else
Schematic += "<L L2";
Schematic += " 1 90 70 17 -26 0 1 \"" + Str.section(':', 2,2) + "\" 1>\n";
Schematic += " 1 130 70 17 -26 0 1 \"" + Str.section(':', 2,2) + "\" 1>\n";
Schematic +=
"<GND * 1 90 100 0 0 0 0>\n"
"<GND * 1 130 100 0 0 0 0>\n"
"</Components>\n"
"<Wires>\n"
"<90 10 90 40 \"\" 0 0 0 \"\">\n"
"<90 10 110 10 \"\" 0 0 0 \"\">\n"
"<40 10 90 10 \"\" 0 0 0 \"\">\n";
"<130 10 130 40 \"\" 0 0 0 \"\">\n"
"<130 10 150 10 \"\" 0 0 0 \"\">\n"
"<80 10 130 10 \"\" 0 0 0 \"\">\n";
}
Schematic +=
Schematic += QString(
"</Wires>\n"
"<Diagrams>\n"
"</Diagrams>\n"
"<Paintings>\n"
"</Paintings>\n";
" <Text -20 -10 12 #000000 0 \"%1 Ohm\">\n"
" <Text 120 -10 12 #000000 0 \"device\">\n"
"</Paintings>\n").arg(Z0);
QApplication::clipboard()->setText(Schematic, QClipboard::Clipboard);
return true;
@ -360,14 +592,14 @@ QString MatchDialog::calcBiMatch(double S11real, double S11imag,
// -----------------------------------------------------------------------
bool MatchDialog::calc2PortMatch(double S11real, double S11imag,
double S22real, double S22imag, double DetReal, double DetImag,
double Z0, double Freq)
double Z1, double Z2, double Freq)
{
QString Input = calcBiMatch(S11real, S11imag, S22real, S22imag,
DetReal, DetImag, Z0, Freq);
DetReal, DetImag, Z1, Freq);
if(Input.isEmpty()) return false;
QString Output = calcBiMatch(S22real, S22imag, S11real, S11imag,
DetReal, DetImag, Z0, Freq);
DetReal, DetImag, Z2, Freq);
if(Output.isEmpty()) return false;
QString Schematic =
@ -486,6 +718,9 @@ bool MatchDialog::calc2PortMatch(double S11real, double S11imag,
"<Diagrams>\n"
"</Diagrams>\n"
"<Paintings>\n"
" <Text -200 -10 12 #000000 0 \"Port 1\">\n"
" <Text -20 -10 12 #000000 0 \"device\">\n"
" <Text 160 -10 12 #000000 0 \"Port 2\">\n"
"</Paintings>\n";
QApplication::clipboard()->setText(Schematic, QClipboard::Clipboard);

View File

@ -22,19 +22,22 @@
#include <qptrlist.h>
class Element;
class QLabel;
class QLineEdit;
class QComboBox;
class QGridLayout;
class QCheckBox;
class QVBoxLayout;
class QDoubleValidator;
class MatchDialog : public QDialog {
Q_OBJECT
public:
MatchDialog(QWidget *parent=0, double Rreal_=0.5, double Rimag_=0.0,
double Freq_=1e9, double Z0_=50.0);
MatchDialog(QWidget *parent=0);
~MatchDialog();
static void c2p(double&, double&);
static void p2c(double&, double&);
static void r2z(double&, double&, double);
static void z2r(double&, double&, double);
static QString calcMatching(double, double, double, double);
@ -42,19 +45,31 @@ public:
static QString calcBiMatch(double, double, double, double, double, double,
double, double);
static bool calc2PortMatch(double, double, double, double, double, double,
double, double);
double, double, double);
void setFrequency(double);
private slots:
QLineEdit *Ref1Edit, *Ref2Edit, *FrequencyEdit,
*S11magEdit,*S11degEdit, *S21magEdit,*S21degEdit,
*S12magEdit,*S12degEdit, *S22magEdit,*S22degEdit;
QCheckBox *TwoCheck;
public slots:
void slotButtCreate();
void slotImpedanceChanged(const QString&);
void slotReflexionChanged(const QString&);
void slotSetTwoPort(bool);
void slotChangeMode(int);
private:
QGridLayout *all; // the mother of all widgets
QVBoxLayout *all; // the mother of all widgets
QDoubleValidator *DoubleVal;
QLineEdit *ReferenceEdit, *FrequencyEdit, *ImpedanceRealEdit,
*ImpedanceImagEdit, *ReflexionRealEdit, *ReflexionImagEdit;
QComboBox *UnitCombo;
QLabel *Port1Label, *Port2Label, *Ohm1Label, *Ohm2Label,
*FormatLabel, *FrequencyLabel,
*S11Label, *S11sLabel, *S11uLabel,
*S21Label, *S21sLabel, *S21uLabel,
*S12Label, *S12sLabel, *S12uLabel,
*S22Label, *S22sLabel, *S22uLabel;
QComboBox *FormatCombo, *UnitCombo;
};
#endif

View File

@ -161,7 +161,11 @@ void SimMessage::nextSPICE()
com << (QucsSettings.BinDir + "qucsconv");
if(makeSubcircuit)
com << "-g" << "_ref";
com << "-if" << "spice" << "-of" << "qucs" << "-i" << FileName;
com << "-if" << "spice" << "-of" << "qucs" << "-i";
if(FileName.find(QDir::separator()) < 0) // add path ?
com << QucsWorkDir.path() + QDir::separator() + FileName;
else
com << FileName;
SimProcess.setArguments(com);
@ -231,9 +235,10 @@ void SimMessage::startSimulator()
ProgText->insert(tr("done.\n"));
QStringList com;
QFileInfo Info(Doc->DocName);
com << QucsSettings.BinDir + "qucsator" << "-b" << "-i"
<< QucsHomeDir.filePath("netlist.txt")
<< "-o" << QucsWorkDir.filePath(Doc->DataSet);
<< QucsHomeDir.filePath("netlist.txt") << "-o"
<< Info.dirPath() + QDir::separator() + Doc->DataSet;
SimProcess.setArguments(com);
@ -357,6 +362,8 @@ void SimMessage::slotClose()
// ------------------------------------------------------------------------
void SimMessage::slotDisplayButton()
{
emit displayDataPage(Doc->DataDisplay);
QFileInfo Info(Doc->DocName);
emit displayDataPage(Info.dirPath() + QDir::separator() +
Doc->DataDisplay);
accept();
}

View File

@ -1,6 +1,6 @@
/***************************************************************************
qucs.cpp - description
-------------------
qucs.cpp
----------
begin : Thu Aug 28 18:17:41 CEST 2003
copyright : (C) 2003, 2004 by Michael Margraf
email : michael.margraf@alumni.tu-berlin.de
@ -62,8 +62,37 @@
#define COMBO_Diagrams 6
#define COMBO_Paints 7 // must be the last one
QDir QucsWorkDir;
QDir QucsHomeDir;
QDir QucsWorkDir; // current project path
QDir QucsHomeDir; // Qucs user directory where all projects are located
// IconView without dragging icon bitmap
class myIconView : public QIconView
{
public:
myIconView(QWidget* parent_) : QIconView(parent_, 0, 0) {};
~myIconView() {};
protected:
QDragObject *dragObject() {
QIconViewItem *Item = currentItem();
if(!Item) return 0;
// no picture during dragging, but bounding rectangles in QListView
QIconDrag *DragPic = new QIconDrag( viewport() );
DragPic->setPixmap( QPixmap(empty_xpm), QPoint(0, 0) );
DragPic->append( QIconDragItem(),
QRect( Item->pixmapRect().width() / -2,
Item->pixmapRect().height() / -2,
Item->pixmapRect().width(), Item->pixmapRect().height() ),
QRect( Item->textRect().width() / -2,
Item->pixmapRect().height() / 2 + 5,
Item->textRect().width(), Item->textRect().height() ) );
return DragPic;
};
};
QucsApp::QucsApp()
{
@ -166,8 +195,6 @@ void QucsApp::initView()
TabView->addTab(Content,tr("Content"));
TabView->setTabToolTip(TabView->page(1), tr("content of the open project"));
// QT 3.2
// connect(Content, SIGNAL(doubleClicked(QListViewItem*, const QPoint &,int)), SLOT(slotOpenContent(QListViewItem*, const QPoint &,int)));
connect(Content, SIGNAL(doubleClicked(QListViewItem*)),
SLOT(slotOpenContent(QListViewItem*)));
connect(Content, SIGNAL(clicked(QListViewItem*)),
@ -177,7 +204,7 @@ void QucsApp::initView()
// "Component Tab" of the left QTabWidget
QVBox *CompGroup = new QVBox(this);
CompChoose = new QComboBox(CompGroup);
CompComps = new QIconView(CompGroup);
CompComps = new myIconView(CompGroup);
TabView->addTab(CompGroup,tr("Components"));
TabView->setTabToolTip(TabView->page(2), tr("components and diagrams"));
fillComboBox(true);
@ -1141,7 +1168,9 @@ void QucsApp::slotAfterSimulation(int Status, SimMessage *sim)
Dia->show();
}
else if(sim->Doc->SimOpenDpl) {
slotChangePage(sim->Doc->DataDisplay); // switch to data display
QFileInfo Info(sim->Doc->DocName);
// switch to data display
slotChangePage(Info.dirPath() + QDir::separator() + sim->Doc->DataDisplay);
sim->slotClose(); // close and delete simulation window
}
else sim->Doc->reloadGraphs(); // load recent simulation data
@ -1172,10 +1201,8 @@ void QucsApp::slotChangePage(QString Name)
QucsDoc *Doc = view->Docs.current();
// search, if page is already loaded
for(d = view->Docs.first(); d!=0; d = view->Docs.next()) {
Info.setFile(d->DocName);
if(Info.fileName() == Name) break;
}
for(d = view->Docs.first(); d!=0; d = view->Docs.next())
if(d->DocName == Name) break;
if(d == 0) { // no open page found ?
Info.setFile(Name);
@ -1187,7 +1214,7 @@ void QucsApp::slotChangePage(QString Name)
view->Docs.findRef(Doc);
QMessageBox::critical(this, tr("Error"),
tr("Cannot create ")+Info.dirPath(true)+
QDir::convertSeparators ("/")+Name);
QDir::separator()+Name);
return;
}
else new QListViewItem(ConDisplays, Info.fileName()); // add new name
@ -1231,7 +1258,8 @@ void QucsApp::slotToPage()
return;
}
slotChangePage(Name);
QFileInfo Info(view->Docs.current()->DocName);
slotChangePage(Info.dirPath() + QDir::separator() + Name);
}
// #######################################################################
@ -1249,7 +1277,7 @@ void QucsApp::slotOpenContent(QListViewItem *item)
if(!QucsWorkDir.cd(p)) {
QMessageBox::critical(this, tr("Error"),
tr("Cannot access project directory: ")+
QucsWorkDir.path()+QDir::convertSeparators ("/")+p);
QucsWorkDir.path()+QDir::separator()+p);
return;
}
@ -1665,7 +1693,7 @@ void QucsApp::slotSelectComponent(QIconViewItem *item)
if(view->selElem != 0) delete view->selElem;
view->selElem = 0; // no component/diagram/painting selected
if(view->drawn) view->viewport()->update();
if(view->drawn) view->viewport()->repaint(); // don't use update() here !!!
view->drawn = false;
if(item == 0) { // mouse button pressed not over an item ?

View File

@ -72,6 +72,7 @@ public:
bool closeAllFiles();
static int testFile(const QString&);
bool gotoPage(const QString&); // to load a document
protected:
@ -177,7 +178,6 @@ private:
void OpenProject(const QString&, const QString&);
bool DeleteProject(const QString&, const QString&);
void updatePortNumber(int);
bool gotoPage(const QString&);
void nextDocument(bool);
void fillComboBox(bool);
void switchEditMode(bool);

File diff suppressed because it is too large Load Diff

View File

@ -364,7 +364,7 @@
</message>
<message>
<source>Status</source>
<translation>Estado</translation>
<translation type="obsolete">Estado</translation>
</message>
<message>
<source>Size</source>
@ -570,6 +570,10 @@
<source>2D-projection:</source>
<translation>Proyección-2D:</translation>
</message>
<message>
<source>Type</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>DisplayDialog</name>
@ -858,25 +862,13 @@
<source>Create Matching Circuit</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Reference Impedance:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Ohm</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Frequency:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Impedance:</source>
<translation type="unfinished">Impedancia:</translation>
</message>
<message>
<source>Reflexion Coefficient:</source>
<translation type="unfinished"></translation>
<translation type="obsolete">Impedancia:</translation>
</message>
<message>
<source>Create</source>
@ -890,11 +882,71 @@
<source>Error</source>
<translation type="unfinished">Error</translation>
</message>
<message>
<source>Reference Impedance</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Port 1</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>ohms</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Port 2</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>S Parameter</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Input format</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>mag/deg</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>real/imag</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>S11</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>S21</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>S12</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>S22</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>calculate two-port matching</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Real part of impedance must be greater zero,
but is %1 !</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Reflexion Coefficient</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Impedance (ohms)</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MessageBox</name>
@ -3725,7 +3777,7 @@ Programa de síntexis de filtros</translation>
<message>
<source>Copyright (C) 2005 by Toyoyuki Ishikawa and Michael Margraf
</source>
<translation>Copyright (C) 2005 by Toyoyuki Ishikawa and Michael Margraf
<translation type="obsolete">Copyright (C) 2005 by Toyoyuki Ishikawa and Michael Margraf
</translation>
</message>
<message>
@ -3744,6 +3796,34 @@ Programa de síntexis de filtros</translation>
<source>Successful</source>
<translation>Con éxito</translation>
</message>
<message>
<source>Band pass</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Band stop</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Copyright (C) 2005 by</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Error</source>
<translation type="unfinished">Error</translation>
</message>
<message>
<source>Stop frequency must be greater than start frequency.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Start frequency:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Filter order must not be less than two.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QucsHelp</name>
@ -5636,10 +5716,6 @@ Calculates DC bias and shows it</source>
<source>2-port matching</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Wrong depency!</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Could not load S[1,1].</source>
<translation type="unfinished"></translation>
@ -5656,6 +5732,10 @@ Calculates DC bias and shows it</source>
<source>Could not load S[2,2].</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Wrong dependency!</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SearchDialog</name>

View File

@ -320,7 +320,7 @@
</message>
<message>
<source>Status</source>
<translation>État</translation>
<translation type="obsolete">État</translation>
</message>
<message>
<source>Size</source>
@ -571,6 +571,10 @@
<source>2D-projection:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Type</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>DisplayDialog</name>
@ -859,26 +863,10 @@
<source>Create Matching Circuit</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Reference Impedance:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Ohm</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Frequency:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Impedance:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Reflexion Coefficient:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Create</source>
<translation type="unfinished">Créer</translation>
@ -891,11 +879,71 @@
<source>Error</source>
<translation type="unfinished">Erreur</translation>
</message>
<message>
<source>Reference Impedance</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Port 1</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>ohms</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Port 2</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>S Parameter</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Input format</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>mag/deg</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>real/imag</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>S11</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>S21</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>S12</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>S22</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>calculate two-port matching</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Real part of impedance must be greater zero,
but is %1 !</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Reflexion Coefficient</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Impedance (ohms)</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MessageBox</name>
@ -3694,11 +3742,6 @@ Un petit éditeur sans prétention pour Qucs
<message>
<source>
Filter synthesis program
</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Copyright (C) 2005 by Toyoyuki Ishikawa and Michael Margraf
</source>
<translation type="unfinished"></translation>
</message>
@ -3718,6 +3761,34 @@ Filter synthesis program
<source>Successful</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Band pass</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Band stop</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Copyright (C) 2005 by</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Error</source>
<translation type="unfinished">Erreur</translation>
</message>
<message>
<source>Stop frequency must be greater than start frequency.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Start frequency:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Filter order must not be less than two.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QucsHelp</name>
@ -5603,10 +5674,6 @@ Calculates DC bias and shows it</source>
<source>2-port matching</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Wrong depency!</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Could not load S[1,1].</source>
<translation type="unfinished"></translation>
@ -5623,6 +5690,10 @@ Calculates DC bias and shows it</source>
<source>Could not load S[2,2].</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Wrong dependency!</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SearchDialog</name>

View File

@ -381,7 +381,7 @@
</message>
<message>
<source>Status</source>
<translation>סטאטוס</translation>
<translation type="obsolete">סטאטוס</translation>
</message>
<message>
<source>Size</source>
@ -547,6 +547,10 @@
<source>2D-projection:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Type</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>DisplayDialog</name>
@ -835,26 +839,10 @@
<source>Create Matching Circuit</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Reference Impedance:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Ohm</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Frequency:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Impedance:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Reflexion Coefficient:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Create</source>
<translation type="unfinished">צור</translation>
@ -867,11 +855,71 @@
<source>Error</source>
<translation type="unfinished">שגיאה</translation>
</message>
<message>
<source>Reference Impedance</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Port 1</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>ohms</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Port 2</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>S Parameter</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Input format</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>mag/deg</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>real/imag</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>S11</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>S21</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>S12</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>S22</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>calculate two-port matching</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Real part of impedance must be greater zero,
but is %1 !</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Reflexion Coefficient</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Impedance (ohms)</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MessageBox</name>
@ -3598,11 +3646,6 @@ Very simple text editor for Qucs
<message>
<source>
Filter synthesis program
</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Copyright (C) 2005 by Toyoyuki Ishikawa and Michael Margraf
</source>
<translation type="unfinished"></translation>
</message>
@ -3622,6 +3665,34 @@ Filter synthesis program
<source>Successful</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Band pass</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Band stop</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Copyright (C) 2005 by</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Error</source>
<translation type="unfinished">שגיאה</translation>
</message>
<message>
<source>Stop frequency must be greater than start frequency.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Start frequency:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Filter order must not be less than two.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QucsHelp</name>
@ -5459,10 +5530,6 @@ Calculates DC bias and shows it</source>
<source>2-port matching</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Wrong depency!</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Could not load S[1,1].</source>
<translation type="unfinished"></translation>
@ -5479,6 +5546,10 @@ Calculates DC bias and shows it</source>
<source>Could not load S[2,2].</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Wrong dependency!</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SearchDialog</name>

View File

@ -364,7 +364,7 @@
</message>
<message>
<source>Status</source>
<translation>Státusz</translation>
<translation type="obsolete">Státusz</translation>
</message>
<message>
<source>Size</source>
@ -570,6 +570,10 @@
<source>2D-projection:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Type</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>DisplayDialog</name>
@ -858,13 +862,9 @@
<source>Create Matching Circuit</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Reference Impedance:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Ohm</source>
<translation type="unfinished">Ohm</translation>
<translation type="obsolete">Ohm</translation>
</message>
<message>
<source>Frequency:</source>
@ -872,11 +872,7 @@
</message>
<message>
<source>Impedance:</source>
<translation type="unfinished">Impedancia:</translation>
</message>
<message>
<source>Reflexion Coefficient:</source>
<translation type="unfinished"></translation>
<translation type="obsolete">Impedancia:</translation>
</message>
<message>
<source>Create</source>
@ -890,11 +886,71 @@
<source>Error</source>
<translation type="unfinished">Hiba</translation>
</message>
<message>
<source>Reference Impedance</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Port 1</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>ohms</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Port 2</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>S Parameter</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Input format</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>mag/deg</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>real/imag</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>S11</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>S21</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>S12</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>S22</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>calculate two-port matching</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Real part of impedance must be greater zero,
but is %1 !</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Reflexion Coefficient</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Impedance (ohms)</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MessageBox</name>
@ -3738,7 +3794,7 @@ Szűrő méretező program
<message>
<source>Copyright (C) 2005 by Toyoyuki Ishikawa and Michael Margraf
</source>
<translation>Copyright (C) 2005 by Toyoyuki Ishikawa and Michael Margraf
<translation type="obsolete">Copyright (C) 2005 by Toyoyuki Ishikawa and Michael Margraf
</translation>
</message>
<message>
@ -3761,6 +3817,34 @@ Szűrő méretező program
<source>Successful</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Band pass</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Band stop</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Copyright (C) 2005 by</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Error</source>
<translation type="unfinished">Hiba</translation>
</message>
<message>
<source>Stop frequency must be greater than start frequency.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Start frequency:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Filter order must not be less than two.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QucsHelp</name>
@ -5656,10 +5740,6 @@ Calculates DC bias and shows it</source>
<source>2-port matching</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Wrong depency!</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Could not load S[1,1].</source>
<translation type="unfinished"></translation>
@ -5676,6 +5756,10 @@ Calculates DC bias and shows it</source>
<source>Could not load S[2,2].</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Wrong dependency!</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SearchDialog</name>

View File

@ -329,7 +329,7 @@
</message>
<message>
<source>Status</source>
<translation>Stato</translation>
<translation type="obsolete">Stato</translation>
</message>
<message>
<source>Size</source>
@ -583,6 +583,10 @@
<source>2D-projection:</source>
<translation>proiezione 2D:</translation>
</message>
<message>
<source>Type</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>DisplayDialog</name>
@ -967,11 +971,11 @@
</message>
<message>
<source>Reference Impedance:</source>
<translation>Impedenza di Riferimento:</translation>
<translation type="obsolete">Impedenza di Riferimento:</translation>
</message>
<message>
<source>Ohm</source>
<translation>Ohm</translation>
<translation type="obsolete">Ohm</translation>
</message>
<message>
<source>Frequency:</source>
@ -979,11 +983,11 @@
</message>
<message>
<source>Impedance:</source>
<translation>Impedenza:</translation>
<translation type="obsolete">Impedenza:</translation>
</message>
<message>
<source>Reflexion Coefficient:</source>
<translation>Coefficiente di Riflessione:</translation>
<translation type="obsolete">Coefficiente di Riflessione:</translation>
</message>
<message>
<source>Create</source>
@ -995,17 +999,77 @@
</message>
<message>
<source>Error</source>
<translation>Errore</translation>
<translation type="unfinished">Errore</translation>
</message>
<message>
<source>Real part of impedance must be greater zero.</source>
<translation type="obsolete">La parte reale dell&apos;impedenza deve essere maggiore di zero.</translation>
</message>
<message>
<source>Reference Impedance</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Port 1</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>ohms</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Port 2</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>S Parameter</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Input format</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>mag/deg</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>real/imag</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>S11</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>S21</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>S12</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>S22</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>calculate two-port matching</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Real part of impedance must be greater zero,
but is %1 !</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Reflexion Coefficient</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Impedance (ohms)</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MessageBox</name>
@ -4719,7 +4783,7 @@ Programma di sintesi dei filtri
<message>
<source>Copyright (C) 2005 by Toyoyuki Ishikawa and Michael Margraf
</source>
<translation>Copyright (C) 2005 by Toyoyuki Ishikawa and Michael Margraf
<translation type="obsolete">Copyright (C) 2005 by Toyoyuki Ishikawa and Michael Margraf
</translation>
</message>
<message>
@ -4738,6 +4802,34 @@ Programma di sintesi dei filtri
<source>Successful</source>
<translation>Successo</translation>
</message>
<message>
<source>Band pass</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Band stop</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Copyright (C) 2005 by</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Error</source>
<translation type="unfinished">Errore</translation>
</message>
<message>
<source>Stop frequency must be greater than start frequency.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Start frequency:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Filter order must not be less than two.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QucsHelp</name>
@ -6664,7 +6756,7 @@ Calculates DC bias and shows it</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Wrong depency!</source>
<source>Wrong dependency!</source>
<translation type="unfinished"></translation>
</message>
</context>

View File

@ -364,7 +364,7 @@
</message>
<message>
<source>Status</source>
<translation></translation>
<translation type="obsolete"></translation>
</message>
<message>
<source>Size</source>
@ -570,6 +570,10 @@
<source>2D-projection:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Type</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>DisplayDialog</name>
@ -858,26 +862,10 @@
<source>Create Matching Circuit</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Reference Impedance:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Ohm</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Frequency:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Impedance:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Reflexion Coefficient:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Create</source>
<translation type="unfinished"></translation>
@ -890,11 +878,71 @@
<source>Error</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Reference Impedance</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Port 1</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>ohms</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Port 2</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>S Parameter</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Input format</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>mag/deg</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>real/imag</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>S11</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>S21</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>S12</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>S22</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>calculate two-port matching</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Real part of impedance must be greater zero,
but is %1 !</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Reflexion Coefficient</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Impedance (ohms)</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MessageBox</name>
@ -3623,11 +3671,6 @@ Very simple text editor for Qucs
<message>
<source>
Filter synthesis program
</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Copyright (C) 2005 by Toyoyuki Ishikawa and Michael Margraf
</source>
<translation type="unfinished"></translation>
</message>
@ -3647,6 +3690,34 @@ Filter synthesis program
<source>Successful</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Band pass</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Band stop</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Copyright (C) 2005 by</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Error</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Stop frequency must be greater than start frequency.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Start frequency:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Filter order must not be less than two.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QucsHelp</name>
@ -5487,10 +5558,6 @@ Calculates DC bias and shows it</source>
<source>2-port matching</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Wrong depency!</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Could not load S[1,1].</source>
<translation type="unfinished"></translation>
@ -5507,6 +5574,10 @@ Calculates DC bias and shows it</source>
<source>Could not load S[2,2].</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Wrong dependency!</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SearchDialog</name>

View File

@ -316,7 +316,7 @@
</message>
<message>
<source>Status</source>
<translation>Status</translation>
<translation type="obsolete">Status</translation>
</message>
<message>
<source>Size</source>
@ -538,6 +538,10 @@
<source>2D-projection:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Type</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>DisplayDialog</name>
@ -847,25 +851,13 @@
<source>Create Matching Circuit</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Reference Impedance:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Ohm</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Frequency:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Impedance:</source>
<translation type="unfinished">Impedancja:</translation>
</message>
<message>
<source>Reflexion Coefficient:</source>
<translation type="unfinished"></translation>
<translation type="obsolete">Impedancja:</translation>
</message>
<message>
<source>Create</source>
@ -879,11 +871,71 @@
<source>Error</source>
<translation type="unfinished">Błąd</translation>
</message>
<message>
<source>Reference Impedance</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Port 1</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>ohms</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Port 2</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>S Parameter</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Input format</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>mag/deg</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>real/imag</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>S11</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>S21</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>S12</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>S22</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>calculate two-port matching</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Real part of impedance must be greater zero,
but is %1 !</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Reflexion Coefficient</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Impedance (ohms)</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MessageBox</name>
@ -3761,7 +3813,7 @@ Program syntezy filtrów
<message>
<source>Copyright (C) 2005 by Toyoyuki Ishikawa and Michael Margraf
</source>
<translation>Copyright (C) 2005 Toyoyuki Ishikawa i Michael Margraf
<translation type="obsolete">Copyright (C) 2005 Toyoyuki Ishikawa i Michael Margraf
</translation>
</message>
<message>
@ -3780,6 +3832,34 @@ Program syntezy filtrów
<source>Successful</source>
<translation>Zakończono</translation>
</message>
<message>
<source>Band pass</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Band stop</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Copyright (C) 2005 by</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Error</source>
<translation type="unfinished">Błąd</translation>
</message>
<message>
<source>Stop frequency must be greater than start frequency.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Start frequency:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Filter order must not be less than two.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QucsHelp</name>
@ -5648,10 +5728,6 @@ Calculates DC bias and shows it</source>
<source>2-port matching</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Wrong depency!</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Could not load S[1,1].</source>
<translation type="unfinished"></translation>
@ -5668,6 +5744,10 @@ Calculates DC bias and shows it</source>
<source>Could not load S[2,2].</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Wrong dependency!</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SearchDialog</name>

View File

@ -356,7 +356,7 @@
</message>
<message>
<source>Status</source>
<translation>Estado</translation>
<translation type="obsolete">Estado</translation>
</message>
<message>
<source>Size</source>
@ -530,6 +530,10 @@
<source>2D-projection:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Type</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>DisplayDialog</name>
@ -818,26 +822,10 @@
<source>Create Matching Circuit</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Reference Impedance:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Ohm</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Frequency:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Impedance:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Reflexion Coefficient:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Create</source>
<translation type="unfinished">Criar</translation>
@ -850,11 +838,71 @@
<source>Error</source>
<translation type="unfinished">Erro</translation>
</message>
<message>
<source>Reference Impedance</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Port 1</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>ohms</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Port 2</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>S Parameter</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Input format</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>mag/deg</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>real/imag</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>S11</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>S21</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>S12</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>S22</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>calculate two-port matching</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Real part of impedance must be greater zero,
but is %1 !</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Reflexion Coefficient</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Impedance (ohms)</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MessageBox</name>
@ -3608,11 +3656,6 @@ Very simple text editor for Qucs
<message>
<source>
Filter synthesis program
</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Copyright (C) 2005 by Toyoyuki Ishikawa and Michael Margraf
</source>
<translation type="unfinished"></translation>
</message>
@ -3632,6 +3675,34 @@ Filter synthesis program
<source>Result: --</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Band pass</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Band stop</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Copyright (C) 2005 by</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Error</source>
<translation type="unfinished">Erro</translation>
</message>
<message>
<source>Stop frequency must be greater than start frequency.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Start frequency:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Filter order must not be less than two.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QucsHelp</name>
@ -5486,10 +5557,6 @@ Calculates DC bias and shows it</source>
<source>2-port matching</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Wrong depency!</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Could not load S[1,1].</source>
<translation type="unfinished"></translation>
@ -5506,6 +5573,10 @@ Calculates DC bias and shows it</source>
<source>Could not load S[2,2].</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Wrong dependency!</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SearchDialog</name>

View File

@ -316,7 +316,7 @@
</message>
<message>
<source>Status</source>
<translation>Status</translation>
<translation type="obsolete">Status</translation>
</message>
<message>
<source>Size</source>
@ -534,6 +534,10 @@
<source>2D-projection:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Type</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>DisplayDialog</name>
@ -822,26 +826,10 @@
<source>Create Matching Circuit</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Reference Impedance:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Ohm</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Frequency:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Impedance:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Reflexion Coefficient:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Create</source>
<translation type="unfinished">Crează</translation>
@ -854,11 +842,71 @@
<source>Error</source>
<translation type="unfinished">Eroare</translation>
</message>
<message>
<source>Reference Impedance</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Port 1</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>ohms</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Port 2</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>S Parameter</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Input format</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>mag/deg</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>real/imag</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>S11</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>S21</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>S12</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>S22</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>calculate two-port matching</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Real part of impedance must be greater zero,
but is %1 !</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Reflexion Coefficient</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Impedance (ohms)</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MessageBox</name>
@ -3703,11 +3751,6 @@ Editor de text foarte simplu pentur Qucs
<message>
<source>
Filter synthesis program
</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Copyright (C) 2005 by Toyoyuki Ishikawa and Michael Margraf
</source>
<translation type="unfinished"></translation>
</message>
@ -3727,6 +3770,34 @@ Filter synthesis program
<source>Successful</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Band pass</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Band stop</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Copyright (C) 2005 by</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Error</source>
<translation type="unfinished">Eroare</translation>
</message>
<message>
<source>Stop frequency must be greater than start frequency.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Start frequency:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Filter order must not be less than two.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QucsHelp</name>
@ -5590,10 +5661,6 @@ Calculates DC bias and shows it</source>
<source>2-port matching</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Wrong depency!</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Could not load S[1,1].</source>
<translation type="unfinished"></translation>
@ -5610,6 +5677,10 @@ Calculates DC bias and shows it</source>
<source>Could not load S[2,2].</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Wrong dependency!</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SearchDialog</name>

View File

@ -378,10 +378,6 @@
<source>Name</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Status</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Size</source>
<translation type="unfinished"></translation>
@ -514,6 +510,10 @@
<source>2D-projection:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Type</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>DisplayDialog</name>
@ -802,26 +802,10 @@
<source>Create Matching Circuit</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Reference Impedance:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Ohm</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Frequency:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Impedance:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Reflexion Coefficient:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Create</source>
<translation type="unfinished"></translation>
@ -830,6 +814,58 @@
<source>Cancel</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Reference Impedance</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Port 1</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>ohms</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Port 2</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>S Parameter</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Input format</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>mag/deg</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>real/imag</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>S11</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>S21</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>S12</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>S22</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>calculate two-port matching</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Error</source>
<translation type="unfinished"></translation>
@ -839,6 +875,14 @@
but is %1 !</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Reflexion Coefficient</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Impedance (ohms)</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>NewProjDialog</name>
@ -3328,11 +3372,6 @@ Very simple text editor for Qucs
<message>
<source>
Filter synthesis program
</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Copyright (C) 2005 by Toyoyuki Ishikawa and Michael Margraf
</source>
<translation type="unfinished"></translation>
</message>
@ -3352,6 +3391,34 @@ Filter synthesis program
<source>Successful</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Band pass</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Band stop</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Copyright (C) 2005 by</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Error</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Stop frequency must be greater than start frequency.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Start frequency:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Filter order must not be less than two.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QucsHelp</name>
@ -5055,10 +5122,6 @@ Calculates DC bias and shows it</source>
<source>Error</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Wrong depency!</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Could not load S[1,1].</source>
<translation type="unfinished"></translation>
@ -5075,6 +5138,10 @@ Calculates DC bias and shows it</source>
<source>Could not load S[2,2].</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Wrong dependency!</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SearchDialog</name>

View File

@ -2659,7 +2659,7 @@ void QucsDoc::reloadGraphs()
{
QFileInfo Info(DocName);
for(Diagram *pd = Diags->first(); pd != 0; pd = Diags->next())
pd->loadGraphData(Info.dirPath()+QDir::convertSeparators ("/")+DataSet);
pd->loadGraphData(Info.dirPath()+QDir::separator()+DataSet);
}
// ---------------------------------------------------

View File

@ -33,6 +33,8 @@
class QucsApp;
extern const char *empty_xpm[];
class QucsDoc {
public:
@ -161,5 +163,4 @@ public:
QPtrList<QString> UndoSymbol; // undo stack for circuit symbol
};
#endif

View File

@ -1438,10 +1438,11 @@ void QucsView::MPressElement(QMouseEvent *Event, QucsDoc *d, int, int)
Comp->entireBounds(x1,y1,x2,y2, d->textCorr());
enlargeView(x1, y1, x2, y2);
viewport()->repaint();
drawn = false;
viewport()->update();
d->setChanged(true, true);
Comp = Comp->newOne(); // component is used, so create a new one
Comp->paintScheme(&painter);
// Comp->paintScheme(&painter);
break;
case Qt::RightButton : // right mouse button rotates the component
@ -1462,8 +1463,11 @@ void QucsView::MPressElement(QMouseEvent *Event, QucsDoc *d, int, int)
if(Event->button() != Qt::LeftButton) return;
Diagram *Diag = (Diagram*)selElem;
QFileInfo Info(d->DocName);
// dialog is Qt::WDestructiveClose !!!
DiagramDialog *dia = new DiagramDialog(Diag, d->DataSet, this);
DiagramDialog *dia =
new DiagramDialog(Diag,
Info.dirPath() + QDir::separator() + d->DataSet, this);
if(dia->exec() == QDialog::Rejected) { // don't insert if dialog canceled
viewport()->update();
drawn = false;
@ -1835,6 +1839,7 @@ void QucsView::MReleaseResizePainting(QMouseEvent *Event, QucsDoc *d)
void QucsView::MReleasePaste(QMouseEvent *Event, QucsDoc *d)
{
int x1, y1, x2, y2;
QFileInfo Info(d->DocName);
QPainter painter(viewport());
Element *pe;
@ -1853,7 +1858,8 @@ void QucsView::MReleasePaste(QMouseEvent *Event, QucsDoc *d)
break;
case isDiagram:
d->Diags->append((Diagram*)pe);
((Diagram*)pe)->loadGraphData(d->DataSet);
((Diagram*)pe)->loadGraphData(Info.dirPath() + QDir::separator() +
d->DataSet);
enlargeView(pe->cx, pe->cy-pe->y2, pe->cx+pe->x2, pe->cy);
break;
case isPainting:
@ -2009,6 +2015,7 @@ void QucsView::editElement(QMouseEvent *Event)
int x1, y1, x2, y2;
QucsDoc *d = Docs.current();
QFileInfo Info(d->DocName);
int x = int(Event->pos().x()/d->Scale) + d->ViewX1;
int y = int(Event->pos().y()/d->Scale) + d->ViewY1;
@ -2045,7 +2052,8 @@ void QucsView::editElement(QMouseEvent *Event)
break;
}
}
ddia = new DiagramDialog(dia, d->DataSet, this);
ddia = new DiagramDialog(dia,
Info.dirPath() + QDir::separator() + d->DataSet, this);
if(ddia->exec() != QDialog::Rejected) // is WDestructiveClose
d->setChanged(true, true);
@ -2062,7 +2070,8 @@ void QucsView::editElement(QMouseEvent *Event)
if(!dia) break;
ddia = new DiagramDialog(dia, d->DataSet, this, pg);
ddia = new DiagramDialog(dia,
Info.dirPath() + QDir::separator() + d->DataSet, this, pg);
if(ddia->exec() != QDialog::Rejected) // is WDestructiveClose
d->setChanged(true, true);
break;
@ -2317,6 +2326,18 @@ void QucsView::slotScrollRight()
// Is called if an object is dropped (after drag'n drop).
void QucsView::contentsDropEvent(QDropEvent *Event)
{
if(dragIsOkay) {
QStrList List;
QUriDrag::decode(Event, List);
// URI: file:/home/linuxuser/Desktop/example.sch
for(unsigned int i=0; i < List.count(); i++)
QucsMain->gotoPage(QString(List.at(i)).section(':',1));
return;
}
QMouseEvent e(QEvent::MouseButtonPress, Event->pos(),
Qt::LeftButton, Qt::NoButton);
QucsDoc *d = Docs.current();
@ -2327,20 +2348,31 @@ void QucsView::contentsDropEvent(QDropEvent *Event)
if(selElem) delete selElem;
selElem = 0; // no component selected
if(labeledWire)
((QAction*)labeledWire)->setOn(true); // restore old action
}
void QucsView::contentsDragEnterEvent(QDragEnterEvent *Event)
{
//if(Event->provides("text/uri-list")) { // file dragged in ?
dragIsOkay = false;
if(Event->provides("text/uri-list")) // file dragged in ?
if(QUriDrag::canDecode(Event)) {
dragIsOkay = true;
Event->accept();
return;
}
if(Event->format(1) == 0) // only one MIME type ?
if(Event->provides("application/x-qiconlist")) {
// if(Event->source() == QucsMain->CompComps) {
QIconViewItem *Item = QucsMain->CompComps->currentItem();
if(Item) {
QucsMain->slotSelectComponent(Item);
(QAction*)labeledWire = QucsMain->activeAction; // misuse variable
QucsMain->slotSelectComponent(Item); // also sets drawn=false
MouseMoveAction = 0;
MousePressAction = 0;
Event->accept();
return;
}
@ -2349,15 +2381,35 @@ void QucsView::contentsDragEnterEvent(QDragEnterEvent *Event)
Event->ignore();
}
void QucsView::contentsDragLeaveEvent(QDragLeaveEvent*)
{
if(selElem)
if(selElem->Type == isComponent)
if(drawn) {
QucsDoc *d = Docs.current();
QPainter painter(viewport());
setPainter(&painter, d);
((Component*)selElem)->paintScheme(&painter);
drawn = false;
}
if(labeledWire)
((QAction*)labeledWire)->setOn(true); // restore old action
}
void QucsView::contentsDragMoveEvent(QDragMoveEvent *Event)
{
if(selElem == 0) {
Event->ignore();
return;
if(!dragIsOkay) {
if(selElem == 0) {
Event->ignore();
return;
}
QMouseEvent e(QEvent::MouseMove, Event->pos(), Qt::NoButton, Qt::NoButton);
MMoveElement(&e);
}
QMouseEvent e(QEvent::MouseMove, Event->pos(), Qt::NoButton, Qt::NoButton);
MMoveElement(&e);
Event->accept();
}
@ -2474,14 +2526,19 @@ void QucsView::slotPowerMatching()
if(focusElement->Type != isMarker) return;
Marker *pm = (Marker*)focusElement;
double Z0 = 50.0;
// double Z0 = 50.0;
QString Var = pm->pGraph->Var;
double Imag = pm->VarPos[pm->nVarPos+1];
if(Var == "Sopt") // noise matching ?
Imag *= -1.0;
MatchDialog *Dia =
new MatchDialog(this, pm->VarPos[pm->nVarPos], Imag, pm->VarPos[0], Z0);
MatchDialog *Dia = new MatchDialog(this);
Dia->TwoCheck->setChecked(false);
Dia->TwoCheck->setEnabled(false);
// Dia->Ref1Edit->setText(QString::number(Z0));
Dia->S11magEdit->setText(QString::number(pm->VarPos[pm->nVarPos]));
Dia->S11degEdit->setText(QString::number(Imag));
Dia->setFrequency(pm->VarPos[0]);
if(Dia->exec() != QDialog::Accepted)
return;
@ -2496,7 +2553,6 @@ void QucsView::slot2PortMatching()
if(focusElement->Type != isMarker) return;
Marker *pm = (Marker*)focusElement;
double Z0 = 50.0;
QString DataSet;
int z = pm->pGraph->Var.find(':');
if(z <= 0) DataSet = Docs.current()->DataSet;
@ -2535,7 +2591,7 @@ void QucsView::slot2PortMatching()
DataX *Data = Diag->Graphs.getFirst()->cPointsX.first();
if(Data->Var != "frequency") {
QMessageBox::critical(0, tr("Error"), tr("Wrong depency!"));
QMessageBox::critical(0, tr("Error"), tr("Wrong dependency!"));
return;
}
@ -2556,15 +2612,20 @@ void QucsView::slot2PortMatching()
delete Diag;
// determinante of S-parameter matrix
double DetReal = S11real*S22real - S11imag*S22imag
- S12real*S21real + S12imag*S21imag;
double DetImag = S11real*S22imag + S11imag*S22real
- S12real*S21imag - S12imag*S21real;
MatchDialog *Dia = new MatchDialog(this);
Dia->TwoCheck->setEnabled(false);
Dia->setFrequency(Freq);
Dia->S11magEdit->setText(QString::number(S11real));
Dia->S11degEdit->setText(QString::number(S11imag));
Dia->S12magEdit->setText(QString::number(S12real));
Dia->S12degEdit->setText(QString::number(S12imag));
Dia->S21magEdit->setText(QString::number(S21real));
Dia->S21degEdit->setText(QString::number(S21imag));
Dia->S22magEdit->setText(QString::number(S22real));
Dia->S22degEdit->setText(QString::number(S22imag));
if(!MatchDialog::calc2PortMatch(S11real, S11imag, S22real, S22imag,
DetReal, DetImag, Z0, Freq)) return;
if(Dia->exec() != QDialog::Accepted)
return;
QucsMain->Acts.slotEditPaste(true);
QucsMain->slotToPage();
}

View File

@ -80,6 +80,7 @@ protected:
void contentsWheelEvent(QWheelEvent*);
void contentsDropEvent(QDropEvent*);
void contentsDragEnterEvent(QDragEnterEvent*);
void contentsDragLeaveEvent(QDragLeaveEvent*);
void contentsDragMoveEvent(QDragMoveEvent*);
bool ScrollUp(int);
@ -167,7 +168,7 @@ private:
void rightPressMenu(QMouseEvent*, QucsDoc*, int, int);
int MAx1, MAy1,MAx2, MAy2, MAx3, MAy3; // cache for mouse movements
bool isMoveEqual;
bool isMoveEqual, dragIsOkay;
Element *focusElement;
QMouseEvent *focusMEvent;
Wire *labeledWire; // remember the wire whose label is moving