Skip to content

Commit

Permalink
Merge branch 'current' into new_comp_dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
iwbnwif committed Nov 15, 2024
2 parents 3fbc44b + 1bbd4bd commit a97f8df
Show file tree
Hide file tree
Showing 54 changed files with 2,621 additions and 2,420 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ add_subdirectory( translations )

install(DIRECTORY "examples" DESTINATION "share/${QUCS_NAME}")

install(FILES contrib/io.github.ra3xdh.qucs_s.metainfo.xml DESTINATION ${CMAKE_INSTALL_PREFIX}/share/metainfo)

#
# Custom uninstall target
#
Expand Down
17 changes: 17 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
# Qucs-S 24.4.1

## Bugfixes

* Improved diagrams rendering speed #1042
* Fixed hardcoded version in LC Cauer filter #1039
* Fixed pulsed current source issues #1059
* Fixed show exit status if Ngspice crashes #1001

## Localization

* Russian translation update #1038

## Packaging

* Prepare for Flatpak package #51

# Qucs-S 24.4.0

## New features
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
24.4.0
24.4.1
45 changes: 45 additions & 0 deletions contrib/io.github.ra3xdh.qucs_s.metainfo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop-application">
<id>io.github.ra3xdh.qucs_s</id>

<metadata_license>CC0-1.0</metadata_license>
<project_license>GPL-2.0-or-later</project_license>

<name>Qucs-S</name>
<summary>Quite universal circuit simulator with SPICE</summary>

<developer id="io.github.ra3xdh">
<name>Vadim Kuznetsov</name>
</developer>

<description>
<p>
Qucs-S provides a fancy graphical user interface for a number of popular circuit simulation engines. Qucs-S contains instruments for schematic capture, visualization and provides differents passive and active components including device library.
</p>
</description>

<launchable type="desktop-id">qucs-s.desktop</launchable>

<content_rating type="oars-1.1" />

<url type="bugtracker">https://github.com/ra3xdh/qucs_s/issues</url>
<url type="homepage">https://ra3xdh.github.io</url>
<url type="donation">https://boosty.to/qucs_s</url>
<url type="vcs-browser">https://github.com/ra3xdh/qucs_s</url>

<screenshots>
<screenshot type="default">
<image>https://ra3xdh.github.io/ne5532.png</image>
<caption>NE5532 amplifier using SPICE model</caption>
</screenshot>
</screenshots>

<releases>
<release version="24.4.1" date="2024-11-14">
<url type="details">https://github.com/ra3xdh/qucs_s/releases/tag/24.4.1</url>
</release>
<release version="24.4.0" date="2024-10-31">
<url type="details">https://github.com/ra3xdh/qucs_s/releases/tag/24.4.0</url>
</release>
</releases>
</component>
4 changes: 2 additions & 2 deletions qucs/components/component.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1465,7 +1465,7 @@ void Component::copyComponent(Component *pc) {
// ***********************************************************************
void MultiViewComponent::recreate(Schematic *Doc) {
if (Doc) {
Doc->Components->setAutoDelete(false);
Doc->a_Components->setAutoDelete(false);
Doc->deleteComp(this);
}

Expand Down Expand Up @@ -1493,7 +1493,7 @@ void MultiViewComponent::recreate(Schematic *Doc) {

if (Doc) {
Doc->insertRawComponent(this);
Doc->Components->setAutoDelete(true);
Doc->a_Components->setAutoDelete(true);
}
}

Expand Down
10 changes: 5 additions & 5 deletions qucs/components/componentdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -815,18 +815,18 @@ void ComponentDialog::slotBrowseFile(QLineEdit* lineEdit)
if (!schematicFileName.isEmpty()) // if schematic has a filename
currDir = schematicFileInfo.absolutePath();
else // use the WorkDir path
currDir = lastDir.isEmpty() ? QucsSettings.QucsWorkDir.absolutePath() : lastDir;
currDir = lastDir.isEmpty() ? QucsSettings.QucsWorkDir.absolutePath() : lastDir;
} else { // current file name is absolute
currDir = currFileInfo.exists() ? currFileInfo.absolutePath() : QucsSettings.QucsWorkDir.absolutePath();
}
} else { // a file name is not defined
if (!schematicFileName.isEmpty()) { // if schematic has a filename
currDir = schematicFileInfo.absolutePath();
} else { // use the WorkDir path
currDir = lastDir.isEmpty() ? QucsSettings.QucsWorkDir.absolutePath() : lastDir;
currDir = lastDir.isEmpty() ? QucsSettings.QucsWorkDir.absolutePath() : lastDir;
}
}

QString s = QFileDialog::getOpenFileName (
this,
tr("Select a file"),
Expand Down Expand Up @@ -934,8 +934,8 @@ QStringList ComponentDialog::getSimulationList()
return sim_lst;
}
sim_lst.append("ALL");
for (size_t i = 0; i < sch->DocComps.count(); i++) {
Component *c = sch->DocComps.at(i);
for (size_t i = 0; i < sch->a_DocComps.count(); i++) {
Component *c = sch->a_DocComps.at(i);
if (!c->isSimulation) continue;
if (c->Model == ".FOUR") continue;
if (c->Model == ".PZ") continue;
Expand Down
8 changes: 3 additions & 5 deletions qucs/components/iexp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,9 @@ Element* iExp::info(QString& Name, char* &BitmapFile, bool getNewOne)
QString iExp::spice_netlist(bool)
{
QString s = spicecompat::check_refdes(Name,SpiceModel);
for (Port *p1 : Ports) {
QString nam = p1->Connection->Name;
if (nam=="gnd") nam = "0";
s += " "+ nam; // node names
}

s += " " + spicecompat::normalize_node_name(Ports.at(1)->Connection->Name);
s += " " + spicecompat::normalize_node_name(Ports.at(0)->Connection->Name);

QString U1= spicecompat::normalize_value(Props.at(0)->Value);
QString U2 = spicecompat::normalize_value(Props.at(1)->Value);
Expand Down
7 changes: 2 additions & 5 deletions qucs/components/ipulse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,8 @@ QString iPulse::spice_netlist(bool)
{
QString s = spicecompat::check_refdes(Name,SpiceModel);

for (Port *p1 : Ports) {
QString nam = p1->Connection->Name;
if (nam=="gnd") nam = "0";
s += " "+ nam; // node names
}
s += " " + spicecompat::normalize_node_name(Ports.at(1)->Connection->Name);
s += " " + spicecompat::normalize_node_name(Ports.at(0)->Connection->Name);

double T1,T2, TrVal, TfVal, Pw,fac,Per;
QString unit;
Expand Down
2 changes: 1 addition & 1 deletion qucs/components/irect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ iRect::iRect()
Name = "I";
SpiceModel = "I";

Props.append(new Property("U", "1 mA", true,
Props.append(new Property("I", "1 mA", true,
QObject::tr("current at high pulse")));
Props.append(new Property("TH", "1 ms", true,
QObject::tr("duration of high pulses")));
Expand Down
48 changes: 24 additions & 24 deletions qucs/components/optimizedialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@


OptimizeDialog::OptimizeDialog(Optimize_Sim *c_, Schematic *d_)
: QDialog(d_)
: QDialog(d_)
{
Comp = c_;
Doc = d_;
Expand Down Expand Up @@ -92,15 +92,15 @@ OptimizeDialog::OptimizeDialog(Optimize_Sim *c_, Schematic *d_)

MethodCombo = new QComboBox();
MethodCombo->insertItems(-1, QStringLiteral("DE/best/1/exp;"
"DE/rand/1/exp;"
"DE/rand-to-best/1/exp;"
"DE/best/2/exp;"
"DE/rand/1/exp;"
"DE/best/1/bin;"
"DE/rand/1/bin;"
"DE/rand-to-best/1/bin;"
"DE/best/2/bin;"
"DE/rand/2/bin").split(";"));
"DE/rand/1/exp;"
"DE/rand-to-best/1/exp;"
"DE/best/2/exp;"
"DE/rand/1/exp;"
"DE/best/1/bin;"
"DE/rand/1/bin;"
"DE/rand-to-best/1/bin;"
"DE/best/2/bin;"
"DE/rand/2/bin").split(";"));

gp2->addWidget(new QLabel(tr("Method:")), 0,0);
gp2->addWidget(MethodCombo,0,1);
Expand Down Expand Up @@ -257,7 +257,7 @@ OptimizeDialog::OptimizeDialog(Optimize_Sim *c_, Schematic *d_)
// add horizontal line
QFrame *line = new QFrame(this);
line->setFrameShape(QFrame::HLine);
line->setFrameShadow(QFrame::Sunken);
line->setFrameShadow(QFrame::Sunken);
gp3->addWidget(line, 5, 0, 1, -1); // fill the entire width
QPushButton *CreateEqn_Butt = new QPushButton(tr("Copy current values to equation"));
connect(CreateEqn_Butt, SIGNAL(clicked()), SLOT(slotCreateEqn()));
Expand Down Expand Up @@ -347,7 +347,7 @@ OptimizeDialog::OptimizeDialog(Optimize_Sim *c_, Schematic *d_)
// ...........................................................

Component *pc;
for(pc=Doc->Components->first(); pc!=0; pc=Doc->Components->next())
for(pc=Doc->a_Components->first(); pc!=0; pc=Doc->a_Components->next())
if(pc != Comp)
if(pc->Model[0] == '.' && pc->Model != ".Opt")
SimEdit->insertItem(SimEdit->count(), pc->Name);
Expand Down Expand Up @@ -519,7 +519,7 @@ void OptimizeDialog::slotAddVariable()
int row;
for (row = 0; row < VarTable->rowCount(); ++row) {
if (VarNameEdit->text() == VarTable->item(row, 0)->text()) {
QMessageBox::critical(this, tr("Error"),
QMessageBox::critical(this, tr("Error"),
tr("Variable \"%1\" aleardy in list!").arg(VarNameEdit->text()));
return;
}
Expand Down Expand Up @@ -728,7 +728,7 @@ void OptimizeDialog::slotApply()
NameEdit->setText(Comp->Name);
else
if(NameEdit->text() != Comp->Name) {
for(pc = Doc->Components->first(); pc!=0; pc = Doc->Components->next())
for(pc = Doc->a_Components->first(); pc!=0; pc = Doc->a_Components->next())
if(pc->Name == NameEdit->text())
break; // found component with the same name ?
if(pc)
Expand Down Expand Up @@ -790,7 +790,7 @@ void OptimizeDialog::slotApply()
propList << "E48";
} else if (typeStr == tr("E96 series")) {
propList << "E96";
} else if (typeStr == tr("E192 series")) {
} else if (typeStr == tr("E192 series")) {
propList << "E192";
} else {
propList << "LOG_INT";
Expand Down Expand Up @@ -889,12 +889,12 @@ void OptimizeDialog::slotCreateEqn()

s += QStringLiteral("\"yes\" 0>\n" // Export yes, no display
"</Components>\n"
"<Wires>\n"
"</Wires>\n"
"<Diagrams>\n"
"</Diagrams>\n"
"<Paintings>\n"
"</Paintings>\n");
"<Wires>\n"
"</Wires>\n"
"<Diagrams>\n"
"</Diagrams>\n"
"<Paintings>\n"
"</Paintings>\n");

QApplication::clipboard()->setText(s, QClipboard::Clipboard);
// uncomment to have the dialog close and the Equation pasted...
Expand Down Expand Up @@ -926,9 +926,9 @@ void OptimizeDialog::slotSetPrecision(const QPoint& pos)
for(int i = 2; i< Comp->Props.size(); i++) {
if(Comp->Props.at(i)->Name == "Var") {
QStringList ValueSplit = Comp->Props.at(i)->Value.split("|");
// 'initial' column
item = VarTable->item(row++, 2);
item->setText(QString::number(ValueSplit.at(2).toDouble(), 'g', numPrec));
// 'initial' column
item = VarTable->item(row++, 2);
item->setText(QString::number(ValueSplit.at(2).toDouble(), 'g', numPrec));
}
}
}
Expand Down
26 changes: 13 additions & 13 deletions qucs/components/sp_sim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,26 +31,26 @@ SP_Sim::SP_Sim()

// The index of the first 4 properties must not changed. Used in recreate().
Props.append(new Property("Type", "lin", true,
QObject::tr("sweep type")+" [lin, log, list, const]"));
QObject::tr("sweep type")+" [lin, log, list, const]"));
Props.append(new Property("Start", "1 MHz", true,
QObject::tr("start frequency in Hertz")));
QObject::tr("start frequency in Hertz")));
Props.append(new Property("Stop", "100 MHz", true,
QObject::tr("stop frequency in Hertz")));
QObject::tr("stop frequency in Hertz")));
Props.append(new Property("Points", "200", true,
QObject::tr("number of simulation steps")));
QObject::tr("number of simulation steps")));
Props.append(new Property("Noise", "no", false,
QObject::tr("calculate noise parameters")+
" [yes, no]"));
QObject::tr("calculate noise parameters")+
" [yes, no]"));
Props.append(new Property("NoiseIP", "1", false,
QObject::tr("input port for noise figure")));
QObject::tr("input port for noise figure")));
Props.append(new Property("NoiseOP", "2", false,
QObject::tr("output port for noise figure")));
QObject::tr("output port for noise figure")));
Props.append(new Property("saveCVs", "no", false,
QObject::tr("put characteristic values into dataset")+
" [yes, no]"));
QObject::tr("put characteristic values into dataset")+
" [yes, no]"));
Props.append(new Property("saveAll", "no", false,
QObject::tr("save subcircuit characteristic values into dataset")+
" [yes, no]"));
QObject::tr("save subcircuit characteristic values into dataset")+
" [yes, no]"));
}

SP_Sim::~SP_Sim()
Expand Down Expand Up @@ -92,7 +92,7 @@ int SP_Sim::getSPortsNumber()
{
int p_num = 0;
if (containingSchematic != NULL) {
auto comps = containingSchematic->DocComps;
auto comps = containingSchematic->a_DocComps;
for(Component *pc = comps.first(); pc != 0; pc = comps.next()) {
if (pc->Model == "Pac") p_num++;
}
Expand Down
10 changes: 5 additions & 5 deletions qucs/components/spicedialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ SpiceDialog::SpiceDialog(QucsApp* App_, SpiceFile *c, Schematic *d)
topGrid->addWidget(new QLabel(tr("Name:")), 0, 0);
topGrid->addWidget(CompNameEdit, 0, 1);


FileEdit = new QLineEdit;
FileEdit->setValidator(ValRestrict);
connect(FileEdit, SIGNAL(returnPressed()), SLOT(slotButtOK()));
Expand Down Expand Up @@ -212,7 +212,7 @@ void SpiceDialog::slotButtApply()
if(CompNameEdit->text().isEmpty()) CompNameEdit->setText(Comp->Name);
else if(CompNameEdit->text() != Comp->Name)
{
for(pc = Doc->Components->first(); pc!=0; pc = Doc->Components->next())
for(pc = Doc->a_Components->first(); pc!=0; pc = Doc->a_Components->next())
if(pc->Name == CompNameEdit->text()) {
break; // found component with the same name ?
}
Expand Down Expand Up @@ -293,15 +293,15 @@ void SpiceDialog::slotButtBrowse()
if (!schematicFileName.isEmpty()) // if schematic has a filename
currDir = schematicFileInfo.absolutePath();
else // use the WorkDir path
currDir = lastDir.isEmpty() ? QucsSettings.QucsWorkDir.absolutePath() : lastDir;
currDir = lastDir.isEmpty() ? QucsSettings.QucsWorkDir.absolutePath() : lastDir;
} else { // current file name is absolute
currDir = currFileInfo.exists() ? currFileInfo.absolutePath() : QucsSettings.QucsWorkDir.absolutePath();
}
} else { // a file name is not defined
if (!schematicFileName.isEmpty()) { // if schematic has a filename
currDir = schematicFileInfo.absolutePath();
} else { // use the WorkDir path
currDir = lastDir.isEmpty() ? QucsSettings.QucsWorkDir.absolutePath() : lastDir;
currDir = lastDir.isEmpty() ? QucsSettings.QucsWorkDir.absolutePath() : lastDir;
}
}

Expand Down Expand Up @@ -644,7 +644,7 @@ void SpiceDialog::slotGetNetlist()
// -------------------------------------------------------------------------
void SpiceDialog::slotButtEdit()
{
Doc->App->editFile(misc::properAbsFileName(FileEdit->text(), Doc));
Doc->getApp()->editFile(misc::properAbsFileName(FileEdit->text(), Doc));
}

// -------------------------------------------------------------------------
Expand Down
Loading

0 comments on commit a97f8df

Please sign in to comment.