mirror of
https://github.com/ra3xdh/qucs_s
synced 2025-03-28 21:13:26 +00:00
*** empty log message ***
This commit is contained in:
parent
65e9d444ef
commit
c69c4ef8cd
@ -48,7 +48,7 @@ Ampere_noise::Ampere_noise()
|
||||
Name = "I";
|
||||
|
||||
Props.append(new Property("i", "1e-6", true,
|
||||
QObject::tr("equivalent current density in A/sqrt(Hz)")));
|
||||
QObject::tr("current power spectral density in A^2/Hz")));
|
||||
Props.append(new Property("e", "0", false,
|
||||
QObject::tr("frequency exponent")));
|
||||
Props.append(new Property("c", "1", false,
|
||||
|
@ -33,15 +33,15 @@ BJT::BJT()
|
||||
Lines.append(new Line( 0, 9, 0, 15,QPen(QPen::darkBlue,2)));
|
||||
|
||||
Ports.append(new Port(-30, 0));
|
||||
Ports.append(new Port( 0, 30));
|
||||
Ports.append(new Port( 0,-30));
|
||||
Ports.append(new Port( 0, 30));
|
||||
|
||||
x1 = -30; y1 = -30;
|
||||
x2 = 4; y2 = 30;
|
||||
|
||||
tx = x2+4;
|
||||
ty = y1+4;
|
||||
Model = "BJT";
|
||||
Model = "_BJT";
|
||||
Name = "T";
|
||||
|
||||
// this must be the first property in the list !!!
|
||||
|
@ -36,16 +36,16 @@ BJTsub::BJTsub()
|
||||
Lines.append(new Line( 0, 9, 0, 15,QPen(QPen::darkBlue,2)));
|
||||
|
||||
Ports.append(new Port(-30, 0));
|
||||
Ports.append(new Port( 0,-30));
|
||||
Ports.append(new Port( 0, 30));
|
||||
Ports.append(new Port( 30, 0));
|
||||
Ports.append(new Port( 0,-30));
|
||||
|
||||
x1 = -30; y1 = -30;
|
||||
x2 = 30; y2 = 30;
|
||||
|
||||
tx = x2+4;
|
||||
ty = y1+4;
|
||||
Model = "BJTsub";
|
||||
Model = "BJT";
|
||||
Name = "T";
|
||||
|
||||
// this must be the first property in the list !!!
|
||||
|
@ -23,8 +23,11 @@
|
||||
#include <qstring.h>
|
||||
#include <qpen.h>
|
||||
#include <qmessagebox.h>
|
||||
#include <qdir.h>
|
||||
#include <qfileinfo.h>
|
||||
|
||||
|
||||
extern QDir QucsWorkDir;
|
||||
|
||||
// ***********************************************************************
|
||||
// ********** **********
|
||||
@ -353,13 +356,24 @@ QString Component::NetList()
|
||||
if(Model == "Port") return QString(""); // do not mention subcircuit ports
|
||||
|
||||
QString s = Model+":"+Name;
|
||||
if(s.at(0) == '#') s.remove(0,1);
|
||||
|
||||
for(Port *p1 = Ports.first(); p1 != 0; p1 = Ports.next())
|
||||
s += " "+p1->Connection->Name; // node names
|
||||
s += " "+p1->Connection->Name; // node names
|
||||
if(Model.at(0) == '_') {
|
||||
s += " gnd"; // add port (e.g. BJT without substrate)
|
||||
s.remove(0,1); // remove leading '_'
|
||||
}
|
||||
|
||||
for(Property *p2 = Props.first(); p2 != 0; p2 = Props.next())
|
||||
if(p2->Name != "Symbol")
|
||||
s += " "+p2->Name+"=\""+p2->Value+"\""; // properties
|
||||
if(p2->Name == "File") {
|
||||
QFileInfo info(p2->Value);
|
||||
if(info.isRelative()) info.setFile(QucsWorkDir, p2->Value);
|
||||
s += " "+p2->Name+"=\"{"+info.absFilePath()+"}\""; // properties
|
||||
}
|
||||
else
|
||||
s += " "+p2->Name+"=\""+p2->Value+"\""; // properties
|
||||
|
||||
return s;
|
||||
}
|
||||
@ -367,7 +381,11 @@ QString Component::NetList()
|
||||
// -------------------------------------------------------
|
||||
QString Component::save()
|
||||
{
|
||||
QString s = "<"+Model;
|
||||
QString s = "<";
|
||||
if(Model.at(0) == '#')
|
||||
s += Model.mid(1) + QString::number(Ports.count()-1);
|
||||
else s += Model;
|
||||
|
||||
if(Name.isEmpty()) s += " *";
|
||||
else s += " "+Name;
|
||||
|
||||
@ -403,7 +421,7 @@ bool Component::load(const QString& _s)
|
||||
s = s.mid(1, s.length()-2); // cut off start and end character
|
||||
|
||||
QString n;
|
||||
Model = s.section(' ',0,0); // Model
|
||||
// Model = s.section(' ',0,0); // Model
|
||||
|
||||
Name = s.section(' ',1,1); // Name
|
||||
if(Name == "*") Name = "";
|
||||
@ -551,8 +569,7 @@ Component* getComponentFromName(QString& Line)
|
||||
else if(cstr == "iode") c = new Diode();
|
||||
break;
|
||||
case 'B' : if(cstr == "iasT") c = new BiasT();
|
||||
else if(cstr == "JT") c = new BJT();
|
||||
else if(cstr == "JTsub") c = new BJTsub();
|
||||
else if(cstr == "JT") c = new BJTsub();
|
||||
break;
|
||||
case 'A' : if(cstr == "ttenuator") c = new Attenuator();
|
||||
break;
|
||||
@ -576,6 +593,8 @@ Component* getComponentFromName(QString& Line)
|
||||
else if(cstr == "HB") c = new HB_Sim();
|
||||
else if(cstr == "SW") c = new Param_Sweep();
|
||||
break;
|
||||
case '_' : if(cstr == "BJT") c = new BJT();
|
||||
break;
|
||||
}
|
||||
if(!c) {
|
||||
QMessageBox::critical(0, QObject::tr("Error"),
|
||||
|
@ -278,11 +278,12 @@ void ComponentDialog::slotApplyPropName()
|
||||
{
|
||||
QListViewItem *item = prop->currentItem();
|
||||
if(item->text(0) != NameEdit->text()) {
|
||||
if(NameEdit->text() == "Export") {
|
||||
item->setText(0, "Export_"); // name must not be "Export" !!!
|
||||
NameEdit->setText("Export_");
|
||||
}
|
||||
else item->setText(0, NameEdit->text()); // apply property name
|
||||
// if(NameEdit->text() == "Export") {
|
||||
// item->setText(0, "Export_"); // name must not be "Export" !!!
|
||||
// NameEdit->setText("Export_");
|
||||
// }
|
||||
// else
|
||||
item->setText(0, NameEdit->text()); // apply property name
|
||||
changed = true;
|
||||
}
|
||||
edit->setFocus(); // cursor into "edit" widget
|
||||
@ -327,6 +328,8 @@ void ComponentDialog::slotButtCancel()
|
||||
void ComponentDialog::slotApplyInput()
|
||||
{
|
||||
Component *pc;
|
||||
if(CompNameEdit->text().isEmpty()) CompNameEdit->setText(Comp->Name);
|
||||
else
|
||||
if(CompNameEdit->text() != Comp->Name) {
|
||||
for(pc = cList->first(); pc!=0; pc = cList->next())
|
||||
if(pc->Name == CompNameEdit->text())
|
||||
|
@ -54,11 +54,13 @@ SParamFile::SParamFile(int No)
|
||||
|
||||
tx = x1+4;
|
||||
ty = y2+4;
|
||||
Model = QString("SPfile")+QString::number(No);
|
||||
Model = "#SPfile";
|
||||
Name = "X";
|
||||
|
||||
Props.append(new Property("File", "test.s2p", true,
|
||||
QObject::tr("name of the s parameter file")));
|
||||
Props.append(new Property("Data", "rectangular", true,
|
||||
QObject::tr("interpolation type (rectangular,polar)")));
|
||||
}
|
||||
|
||||
SParamFile::~SParamFile()
|
||||
@ -67,8 +69,7 @@ SParamFile::~SParamFile()
|
||||
|
||||
Component* SParamFile::newOne()
|
||||
{
|
||||
int z = Model.mid(6).toInt();
|
||||
return new SParamFile(z);
|
||||
return new SParamFile(Ports.count()-1);
|
||||
}
|
||||
|
||||
Component* SParamFile::info(QString& Name, char* &BitmapFile, bool getNewOne)
|
||||
|
@ -43,7 +43,7 @@ Volt_noise::Volt_noise()
|
||||
Name = "V";
|
||||
|
||||
Props.append(new Property("u", "1e-6", true,
|
||||
QObject::tr("equivalent voltage density in V/sqrt(Hz)")));
|
||||
QObject::tr("voltage power spectral density in V^2/Hz")));
|
||||
Props.append(new Property("e", "0", false,
|
||||
QObject::tr("frequency exponent")));
|
||||
Props.append(new Property("c", "1", false,
|
||||
|
@ -456,7 +456,7 @@ bool Diagram::loadVarData(const QString& fileName)
|
||||
QMessageBox::critical(0, QObject::tr("Error"),
|
||||
QObject::tr("Too few dependent data \"")+
|
||||
Variable+"\"");
|
||||
g->Var += " (invalid)";
|
||||
// g->Var += " (invalid)";
|
||||
g->cPointsX.clear();
|
||||
delete[] g->cPointsY; g->cPointsY = 0;
|
||||
g->countY = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user