Fix empty log on second simulation start

This commit is contained in:
Vadim Kuznetsov 2023-10-03 19:45:22 +03:00
parent eaf8570514
commit a7a535ade9
2 changed files with 3 additions and 2 deletions

View File

@ -48,6 +48,7 @@ AbstractSpiceKernel::AbstractSpiceKernel(Schematic *sch_, QObject *parent) :
QObject(parent)
{
Sch = sch_;
console = nullptr;
if (Sch->showBias == 0) DC_OP_only = true;
else DC_OP_only = false;
@ -351,7 +352,6 @@ void AbstractSpiceKernel::parseNgSpiceSimOutput(QString ngspice_file,QList< QLis
int NumPoints = 0;
int bin_offset = 0;
QByteArray content;
console = nullptr;
QFile ofile(ngspice_file);
if (ofile.open(QFile::ReadOnly)) {

View File

@ -495,7 +495,8 @@ void Ngspice::slotSimulate()
}
if (checker_error) {
console->insertPlainText(output);
if (console != nullptr)
console->insertPlainText(output);
emit finished();
emit errors(QProcess::FailedToStart);
return;