Added Simulator start error processing

This commit is contained in:
Vadim Kuznetzov 2015-06-13 13:01:11 +03:00
parent 2e7512538b
commit ad60d9fce5
4 changed files with 24 additions and 14 deletions

View File

@ -55,6 +55,7 @@ AbstractSpiceKernel::AbstractSpiceKernel(Schematic *sch_, QObject *parent) :
SimProcess->setProcessChannelMode(QProcess::MergedChannels);
connect(SimProcess,SIGNAL(finished(int)),this,SLOT(slotFinished()));
connect(SimProcess,SIGNAL(readyRead()),this,SLOT(slotProcessOutput()));
connect(SimProcess,SIGNAL(error(QProcess::ProcessError)),this,SLOT(slotErrors(QProcess::ProcessError)));
connect(this,SIGNAL(destroyed()),this,SLOT(killThemAll()));
}

View File

@ -103,10 +103,10 @@ void ExternSimDialog::slotSetSimulator()
xyce->setParallel(false);
disconnect(xyce,SIGNAL(started()),this,SLOT(slotNgspiceStarted()));
disconnect(xyce,SIGNAL(finished()),this,SLOT(slotProcessXyceOutput()));
disconnect(xyce,SIGNAL(errors(QProcess::ProcessError)),this,SLOT(slotNgspiceStartError()));
disconnect(xyce,SIGNAL(errors(QProcess::ProcessError)),this,SLOT(slotNgspiceStartError(QProcess::ProcessError)));
connect(ngspice,SIGNAL(started()),this,SLOT(slotNgspiceStarted()));
connect(ngspice,SIGNAL(finished()),this,SLOT(slotProcessNgspiceOutput()));
connect(ngspice,SIGNAL(errors(QProcess::ProcessError)),this,SLOT(slotNgspiceStartError()));
connect(ngspice,SIGNAL(errors(QProcess::ProcessError)),this,SLOT(slotNgspiceStartError(QProcess::ProcessError)));
disconnect(buttonSimulate,SIGNAL(clicked()),xyce,SLOT(slotSimulate()));
connect(buttonSimulate,SIGNAL(clicked()),ngspice,SLOT(slotSimulate()));
}
@ -115,10 +115,10 @@ void ExternSimDialog::slotSetSimulator()
xyce->setParallel(false);
disconnect(ngspice,SIGNAL(started()),this,SLOT(slotNgspiceStarted()));
disconnect(ngspice,SIGNAL(finished()),this,SLOT(slotProcessNgspiceOutput()));
disconnect(ngspice,SIGNAL(errors(QProcess::ProcessError)),this,SLOT(slotNgspiceStartError()));
disconnect(ngspice,SIGNAL(errors(QProcess::ProcessError)),this,SLOT(slotNgspiceStartError(QProcess::ProcessError)));
connect(xyce,SIGNAL(started()),this,SLOT(slotNgspiceStarted()));
connect(xyce,SIGNAL(finished()),this,SLOT(slotProcessXyceOutput()));
connect(xyce,SIGNAL(errors(QProcess::ProcessError)),this,SLOT(slotNgspiceStartError()));
connect(xyce,SIGNAL(errors(QProcess::ProcessError)),this,SLOT(slotNgspiceStartError(QProcess::ProcessError)));
connect(buttonSimulate,SIGNAL(clicked()),xyce,SLOT(slotSimulate()));
disconnect(buttonSimulate,SIGNAL(clicked()),ngspice,SLOT(slotSimulate()));
}
@ -131,10 +131,10 @@ void ExternSimDialog::slotSetSimulator()
#endif
disconnect(ngspice,SIGNAL(started()),this,SLOT(slotNgspiceStarted()));
disconnect(ngspice,SIGNAL(finished()),this,SLOT(slotProcessNgspiceOutput()));
disconnect(ngspice,SIGNAL(errors(QProcess::ProcessError)),this,SLOT(slotNgspiceStartError()));
disconnect(ngspice,SIGNAL(errors(QProcess::ProcessError)),this,SLOT(slotNgspiceStartError(QProcess::ProcessError)));
connect(xyce,SIGNAL(started()),this,SLOT(slotNgspiceStarted()));
connect(xyce,SIGNAL(finished()),this,SLOT(slotProcessXyceOutput()));
connect(xyce,SIGNAL(errors(QProcess::ProcessError)),this,SLOT(slotNgspiceStartError()));
connect(xyce,SIGNAL(errors(QProcess::ProcessError)),this,SLOT(slotNgspiceStartError(QProcess::ProcessError)));
connect(buttonSimulate,SIGNAL(clicked()),xyce,SLOT(slotSimulate()));
disconnect(buttonSimulate,SIGNAL(clicked()),ngspice,SLOT(slotSimulate()));
}
@ -177,8 +177,18 @@ void ExternSimDialog::slotNgspiceStarted()
editSimConsole->append(tr("ngspice started...\n"));
}
void ExternSimDialog::slotNgspiceStartError()
void ExternSimDialog::slotNgspiceStartError(QProcess::ProcessError err)
{
QString msg;
switch (err) {
case QProcess::FailedToStart : msg = tr("Failed to start simulator!");
break;
case QProcess::Crashed : msg = tr("Simulator crashed!");
break;
default : msg = tr("Simualtor error!");
}
QMessageBox::critical(this,tr("Simulate with SPICE"),msg,QMessageBox::Ok);
editSimConsole->append(tr("ngspice error..."));
}

View File

@ -61,7 +61,7 @@ private slots:
void slotProcessNgspiceOutput();
void slotProcessXyceOutput();
void slotNgspiceStarted();
void slotNgspiceStartError();
void slotNgspiceStartError(QProcess::ProcessError err);
void slotStart();
void slotStop();
void slotSetSimulator();

View File

@ -256,7 +256,7 @@
<file>bitmaps/R_SPICE.png</file>
<file>bitmaps/K_SPICE.png</file>
<file>bitmaps/MESFET_SPICE.png</file>
<file>bitmaps/PMF_MESFET_SPICE.png</file>
<file>bitmaps/PMF_MESFET_SPICE.png</file>
<file>bitmaps/Cmeter_SPICE.png</file>
<file>bitmaps/LTL_SPICE.png</file>
<file>bitmaps/UDRCTL_SPICE.png</file>
@ -264,15 +264,14 @@
<file>bitmaps/DIODE_SPICE.png</file>
<file>bitmaps/NPN_SPICE.png</file>
<file>bitmaps/PNP_SPICE.png</file>
<file>bitmaps/NJF_SPICE.png</file>
<file>bitmaps/PJF_SPICE.png</file>
<file>bitmaps/NMOS_SPICE.png</file>
<file>bitmaps/PMOS_SPICE.png</file>
<file>bitmaps/NJF_SPICE.png</file>
<file>bitmaps/PJF_SPICE.png</file>
<file>bitmaps/NMOS_SPICE.png</file>
<file>bitmaps/PMOS_SPICE.png</file>
<file>bitmaps/sp_fourier.png</file>
<file>bitmaps/sp_customsim.png</file>
<file>bitmaps/sp_disto.png</file>
<file>bitmaps/Vac_SPICE.png</file>
<file>bitmaps/LTRA_SPICE.png</file>
<file>bitmaps/sp_nutmeg.png</file>
<file>bitmaps/sp_ic.png</file>
<file>bitmaps/sp_nodeset.png</file>