Пример #1
0
void Q3Process::socketRead( int fd )
{
    // fd == 1: stdout, fd == 2: stderr
    HANDLE dev;
    if ( fd == 1 ) {
	dev = d->pipeStdout[0];
    } else if ( fd == 2 ) {
	dev = d->pipeStderr[0];
    } else {
	return;
    }
#ifndef Q_OS_WINCE
    // get the number of bytes that are waiting to be read
    unsigned long i, r;
    char dummy;
    if ( !PeekNamedPipe( dev, &dummy, 1, &r, &i, 0 ) ) {
	return; // ### is it worth to dig for the reason of the error?
    }
#else
    unsigned long i = 1000;
#endif
    if ( i > 0 ) {
	Q3Membuf *buffer;
	if ( fd == 1 )
	    buffer = &d->bufStdout;
	else
	    buffer = &d->bufStderr;

	QByteArray *ba = new QByteArray( i );
	uint sz = readStddev( dev, ba->data(), i );
	if ( sz != i )
	    ba->resize( i );

	if ( sz == 0 ) {
	    delete ba;
	    return;
	}
	buffer->append( ba );
	if ( fd == 1 )
	    emit readyReadStdout();
	else
	    emit readyReadStderr();
    }
}
Пример #2
0
void qt4encodeWnd::demarrer(QString fn, int tf )
{
	cbKeep->setChecked( false);
	cbKeep->hide();
	pbClose->hide();
	setWindowTitle( "Encoding to vob" );
	setModal( true );
	//FIXME teAuthor->setMaxLogLines(1000);
	teAuthor->clear();
	teAuthor->append( fn );
	pbEncode->setMaximum( tf );
	connect( procEncode, SIGNAL(readyReadStdout()),
						this, SLOT(readEncode()));
	connect( procEncode, SIGNAL(readyReadStderr()),
						this, SLOT(readEncMpeg()));
	connect( procEncode, SIGNAL(processExited()),
						this, SLOT(accept()));
	exec();
}
Пример #3
0
/*!  \reimp
*/
void QProcess::disconnectNotify( const char * )
{
    if ( ioRedirection &&
	    receivers( SIGNAL(readyReadStdout()) ) ==0 &&
	    receivers( SIGNAL(readyReadStderr()) ) ==0
	    ) {
#if defined(QT_QPROCESS_DEBUG)
	qDebug( "QProcess::disconnectNotify(): set ioRedirection to FALSE" );
#endif
	setIoRedirection( FALSE );
    }
    if ( notifyOnExit && receivers( SIGNAL(processExited()) ) == 0 ) {
#if defined(QT_QPROCESS_DEBUG)
	qDebug( "QProcess::disconnectNotify(): set notifyOnExit to FALSE" );
#endif
	setNotifyOnExit( FALSE );
    }
    if ( wroteToStdinConnected && receivers( SIGNAL(wroteToStdin()) ) == 0 ) {
#if defined(QT_QPROCESS_DEBUG)
	qDebug( "QProcess::disconnectNotify(): set wroteToStdinConnected to FALSE" );
#endif
	setWroteStdinConnected( FALSE );
    }
}
Пример #4
0
// -------------------------------------------------------------------------
bool SpiceDialog::loadSpiceNetList(const QString& s)
{
  Comp->withSim = false;
  if(s.isEmpty()) return false;
  QFileInfo FileInfo(QucsWorkDir, s);

  NodesList->clear();
  PortsList->clear();
  textStatus = 0;
  Line = Error = "";

  QString preprocessor = PrepCombo->currentText();
  if (preprocessor != "none") {
    bool piping = true;
    QString script;
#ifdef __MINGW32__
    QString interpreter = "tinyperl.exe";
#else
    QString interpreter = "perl";
#endif
    if (preprocessor == "ps2sp") {
      script = "ps2sp";
    } else if (preprocessor == "spicepp") {
      script = "spicepp.pl";
    } else if (preprocessor == "spiceprm") {
      script = "spiceprm";
      piping = false;
    }
    script = QucsSettings.BinDir + script;
    SpicePrep = new QProcess(this);
    SpicePrep->addArgument(interpreter);
    SpicePrep->addArgument(script);
    SpicePrep->addArgument(FileInfo.filePath());

    QFile PrepFile;
    QFileInfo PrepInfo(QucsWorkDir, s + ".pre");
    QString PrepName = PrepInfo.filePath();

    if (!piping) {
      SpicePrep->addArgument(PrepName);
      connect(SpicePrep, SIGNAL(readyReadStdout()), SLOT(slotSkipOut()));
      connect(SpicePrep, SIGNAL(readyReadStderr()), SLOT(slotGetPrepErr()));
    } else {
      connect(SpicePrep, SIGNAL(readyReadStdout()), SLOT(slotGetPrepOut()));
      connect(SpicePrep, SIGNAL(readyReadStderr()), SLOT(slotGetPrepErr()));
    }

    QMessageBox *MBox = new QMessageBox(tr("Info"),
	       tr("Preprocessing SPICE file \"%1\".").arg(FileInfo.filePath()),
               QMessageBox::NoIcon, QMessageBox::Abort,
               QMessageBox::NoButton, QMessageBox::NoButton, this, 0, true,
	       Qt::WStyle_DialogBorder |  Qt::WDestructiveClose);
    connect(SpicePrep, SIGNAL(processExited()), MBox, SLOT(close()));

    if (piping) {
      PrepFile.setName(PrepName);
      if(!PrepFile.open(IO_WriteOnly)) {
	QMessageBox::critical(this, tr("Error"),
          tr("Cannot save preprocessed SPICE file \"%1\".").
	  arg(PrepName));
	return false;
      }
      prestream = new QTextStream(&PrepFile);
    }

    if(!SpicePrep->start()) {
      QMessageBox::critical(this, tr("Error"),
        tr("Cannot execute \"%1\".").arg(interpreter + " " + script));
      if (piping) {
	PrepFile.close();
	delete prestream;
      }
      return false;
    }
    SpicePrep->closeStdin();

    MBox->exec();
    delete SpicePrep;
    if (piping) {
      PrepFile.close();
      delete prestream;
    }

    if(!Error.isEmpty()) {
      QMessageBox::critical(this, tr("SPICE Preprocessor Error"), Error);
      return false;
    }
    FileInfo = QFileInfo(QucsWorkDir, s + ".pre");
  }

  // first call Qucsconv ............
  QucsConv = new QProcess(this);
  QucsConv->addArgument(QucsSettings.BinDir + "qucsconv");
  QucsConv->addArgument("-if");
  QucsConv->addArgument("spice");
  QucsConv->addArgument("-of");
  QucsConv->addArgument("qucs");
  QucsConv->addArgument("-i");
  QucsConv->addArgument(FileInfo.filePath());
  connect(QucsConv, SIGNAL(readyReadStdout()), SLOT(slotGetNetlist()));
  connect(QucsConv, SIGNAL(readyReadStderr()), SLOT(slotGetError()));

  QMessageBox *MBox = new QMessageBox(tr("Info"),
	       tr("Converting SPICE file \"%1\".").arg(FileInfo.filePath()),
               QMessageBox::NoIcon, QMessageBox::Abort,
               QMessageBox::NoButton, QMessageBox::NoButton, this, 0, true,
	       Qt::WStyle_DialogBorder |  Qt::WDestructiveClose);
  connect(QucsConv, SIGNAL(processExited()), MBox, SLOT(close()));

  if(!QucsConv->start()) {
    QMessageBox::critical(this, tr("Error"),
      tr("Cannot execute \"%1\".").arg(QucsSettings.BinDir + "qucsconv"));
    return false;
  }
  QucsConv->closeStdin();

  MBox->exec();
  delete QucsConv;

  if(!Error.isEmpty())
    QMessageBox::critical(this, tr("QucsConv Error"), Error);

  Property *pp = Comp->Props.at(1);
  if(!pp->Value.isEmpty()) {
    PortsList->clear();
    PortsList->insertStringList(QStringList::split(',', pp->Value));
  }

  QString tmp;
  QListBoxItem *pi;
  for(unsigned int i=0; i<PortsList->count(); i++) {
    tmp = PortsList->text(i).remove(0, 4);
    PortsList->changeItem(tmp, i);

    pi = NodesList->findItem(tmp, Qt::CaseSensitive | Qt::ExactMatch);
    if(pi) delete pi;
    else PortsList->removeItem(i--);
  }
  return true;
}
Пример #5
0
// -------------------------------------------------------------------------
bool SpiceFile::recreateSubNetlist(QString *SpiceFile, QString *FileName)
{
  // initialize collectors
  ErrText = "";
  NetText = "";
  SimText = "";
  NetLine = "";

  // evaluate properties
  if(Props.at(1)->Value != "")
    makeSubcircuit = true;
  else
    makeSubcircuit = false;
  if(Props.at(2)->Value == "yes")
    insertSim = true;
  else
    insertSim = false;

  // preprocessor run if necessary
  QString preprocessor = Props.at(3)->Value;
  if (preprocessor != "none") {
    bool piping = true;
    QString script;
#ifdef __MINGW32__
    QString interpreter = "tinyperl.exe";
#else
    QString interpreter = "perl";
#endif
    if (preprocessor == "ps2sp") {
      script = "ps2sp";
    } else if (preprocessor == "spicepp") {
      script = "spicepp.pl";
    } else if (preprocessor == "spiceprm") {
      script = "spiceprm";
      piping = false;
    }
    script = QucsSettings.BinDir + script;
    SpicePrep = new Q3Process(this);
    SpicePrep->addArgument(interpreter);
    SpicePrep->addArgument(script);
    SpicePrep->addArgument(*SpiceFile);

    QFile PrepFile;
    QString PrepName = *SpiceFile + ".pre";

    if (!piping) {
      SpicePrep->addArgument(PrepName);
      connect(SpicePrep, SIGNAL(readyReadStdout()), SLOT(slotSkipOut()));
      connect(SpicePrep, SIGNAL(readyReadStderr()), SLOT(slotGetPrepErr()));
    } else {
      connect(SpicePrep, SIGNAL(readyReadStdout()), SLOT(slotGetPrepOut()));
      connect(SpicePrep, SIGNAL(readyReadStderr()), SLOT(slotGetPrepErr()));
    }

    QMessageBox *MBox = new QMessageBox(QObject::tr("Info"),
	       QObject::tr("Preprocessing SPICE file \"%1\".").arg(*SpiceFile),
               QMessageBox::NoIcon, QMessageBox::Abort,
               QMessageBox::NoButton, QMessageBox::NoButton, 0, 0, true,
	       Qt::WStyle_DialogBorder |  Qt::WDestructiveClose);
    connect(SpicePrep, SIGNAL(processExited()), MBox, SLOT(close()));

    if (piping) {
      PrepFile.setName(PrepName);
      if(!PrepFile.open(QIODevice::WriteOnly)) {
	ErrText +=
	  QObject::tr("ERROR: Cannot save preprocessed SPICE file \"%1\".").
	  arg(PrepName);
	return false;
      }
      prestream = new QTextStream(&PrepFile);
    }

    if(!SpicePrep->start()) {
      ErrText += QObject::tr("ERROR: Cannot execute \"%1\".").
	arg(interpreter + " " + script + "\".");
      if (piping) {
	PrepFile.close();
	delete prestream;
      }
      return false;
    }
    SpicePrep->closeStdin();

    MBox->exec();
    delete SpicePrep;
    if (piping) {
      PrepFile.close();
      delete prestream;
    }
    *SpiceFile = PrepName;
  }

  // begin command line construction
  QStringList com;
  com << (QucsSettings.BinDir + "qucsconv");
  if(makeSubcircuit) com << "-g" << "_ref";
  com << "-if" << "spice" << "-of" << "qucs";
  com << "-i" << *SpiceFile;

  // begin netlist text creation
  if(makeSubcircuit) {
    QString f = properFileName(*FileName);
    NetText += "\n.Def:" + properName(f) + " ";
    QString PortNames = Props.at(1)->Value;
    PortNames.replace(',', ' ');
    NetText += PortNames;
    if(makeSubcircuit) NetText += " _ref";
  }
  NetText += "\n";

  // startup SPICE conversion process
  QucsConv = new Q3Process(this);
  QucsConv->setArguments(com);
  connect(QucsConv, SIGNAL(readyReadStdout()), SLOT(slotGetNetlist()));
  connect(QucsConv, SIGNAL(readyReadStderr()), SLOT(slotGetError()));
  connect(QucsConv, SIGNAL(processExited()), SLOT(slotExited()));
  if(!QucsConv->start()) {
    ErrText += QObject::tr("ERROR: Cannot start QucsConv!");
    return false;
  }
  (*outstream) << NetText;
  (*filstream) << NetText;
  QucsConv->closeStdin();

  // waiting info dialog box
  QMessageBox *MBox = new QMessageBox(QObject::tr("Info"),
	       QObject::tr("Converting SPICE file \"%1\".").arg(*SpiceFile),
               QMessageBox::NoIcon, QMessageBox::Abort,
               QMessageBox::NoButton, QMessageBox::NoButton, 0, 0, true,
	       Qt::WStyle_DialogBorder | Qt::WDestructiveClose);
  connect(QucsConv, SIGNAL(processExited()), MBox, SLOT(close()));
  MBox->exec();

  // finish
  delete QucsConv;
  lastLoaded = QDateTime::currentDateTime();
  return true;
}
Пример #6
0
WVConfigDlg::WVConfigDlg( QWidget *parent, const char *name ) :
  ConfigDlg( parent, name, true ),
  curGroup( "" )
{
  confPath = "/etc/wvdial.conf";
  
  providerName = new WVProviderNameDlg( this, "NAME" );
  providerName->hide();

  wvdialconf = new Q3Process( this );
  QStringList args;
  args.append( "wvdialconf" );
  args.append( confPath );
  wvdialconf->setArguments( args );

  // Do some connections
  //  
  connect( helpBut, SIGNAL( clicked() ),
           this, SLOT( helpSLOT() ));
  connect( runConfBut, SIGNAL( clicked() ),
           this, SLOT( runWvdialconfSLOT() ));
  connect( okBut, SIGNAL( clicked() ),
           this, SLOT( acceptSLOT() ));
  connect( cancelBut, SIGNAL( clicked() ),
           this, SLOT( rejectSLOT() ));
  connect( addBut, SIGNAL( clicked() ),
           this, SLOT( addProviderSLOT() ));
  connect( removeBut, SIGNAL( clicked() ),
           this, SLOT( removeProviderSLOT() ));
  connect( moreBut, SIGNAL( clicked() ),
           this, SLOT( moreOptionsSLOT() ));
  connect( browseBut, SIGNAL( clicked() ),
           this, SLOT( browseSLOT() ));
  connect( clearLogBut, SIGNAL( clicked() ),
           this, SLOT( clearLogSLOT() ));
  connect( startBut, SIGNAL( toggled( bool ) ),
           this, SLOT( startSLOT( bool ) ));
  connect( timeoutBut, SIGNAL( toggled( bool ) ),
           this, SLOT( timeoutSLOT( bool ) ));
  connect( providerCombo, SIGNAL( activated( const QString & ) ),
           this, SLOT( providerSLOT( const QString & )));
  connect( wvdialconf, SIGNAL( readyReadStdout() ),
           this, SLOT( readStdoutSLOT()));
  connect( wvdialconf, SIGNAL( readyReadStderr() ),
           this, SLOT( readStderrSLOT()));
  connect( wvdialconf, SIGNAL( processExited() ),
           this, SLOT( exitedSLOT() ));
  connect( monthCombo, SIGNAL( activated( int ) ),
           this, SLOT( readLogfileSLOT() ));
  connect( yearSpin, SIGNAL( valueChanged( int ) ),
           this, SLOT( readLogfileSLOT() ));
  connect( prevBut, SIGNAL( clicked() ), 
           this, SLOT( previousMonthSLOT() ));
  connect( nextBut, SIGNAL( clicked() ), 
           this, SLOT( nextMonthSLOT() ));
  
  startSLOT( false );
  timeoutSLOT( false );
  
  cfg = new SimpleCfg( confPath );
  
  expertDlg = new WVExpertDlg( this );
  expertDlg->hide();
  
  adjustSize();
  
  // There seems to be a tiny bug in qtdesigner 
  // it does not set the max value -> do it by hand
  yearSpin->setMaxValue( 3000 );
  yearSpin->setMinValue( 2000 );
  
  for (int i=1; i<6; ++i)
  {
    logfile->setColumnAlignment( i, Qt::AlignRight );
  }
  
  logfile->setSorting( -1 );
  logfile->setItemMargin( 2 );
}
Пример #7
0
PlotLine * ExScript::doScript ()
{
  if (proc)
  {
    delete proc;
    proc = 0;
  }

  PlotLine *line = new PlotLine();

  if (! scriptPath.length())
  {
    qDebug("ExScript::calculate: no script path");
    return line;
  }

  proc = new QProcess(this);
  connect(proc, SIGNAL(readyReadStdout()), this, SLOT(readFromStdout()));
  proc->setCommunication(QProcess::Stdin|QProcess::Stdout|QProcess::Stderr);
  proc->addArgument(scriptPath);

  QStringList l = QStringList::split(" ", comlineParms, FALSE);
  int loop;
  for (loop = 0; loop < (int) l.count(); loop++)
    proc->addArgument(l[loop]);

  buffer.truncate(0);

  QString s;
  if (dateFlag || openFlag || highFlag || lowFlag || closeFlag || volumeFlag || oiFlag)
    getInput(s);

  QByteArray ba(s.length());
  if (s.length())
  {
    for (loop = 0; loop < (int) s.length(); loop++)
      ba[loop] = s.at(loop).latin1();
  }

  if (! proc->launch(ba, NULL))
  {
    qDebug("ExScript::calculate: error starting script");
    delete proc;
    proc = 0;
    return line;
  }

  timer->start(seconds * 1000, FALSE);

  wakeup();

  while (proc->isRunning())
  {
    usleep(100);
    wakeup();
  }

  timer->stop();

  if (proc)
  {
    delete proc;
    proc = 0;
  }

  if (! buffer.length())
  {
    qDebug("ExScript::createOutput: output buffer empty");
    return line;
  }

  l = QStringList::split(",", buffer, FALSE);
  for (loop = 0; loop < (int) l.count(); loop++)
    line->append(l[loop].toDouble());

  line->setColor(color);
  line->setType(lineType);
  line->setLabel(label);
  return line;
}
Пример #8
0
void SofaConfiguration::saveConfiguration()
{
    std::ofstream out((path + std::string("/sofa-local.cfg")).c_str());
    std::string currentCategory;
    std::vector< CONDITION > currentConditions;
    for (unsigned int i=0; i<options.size(); ++i)
    {
        DEFINES &option=options[i]->option;


        bool differentConditions=false;
        if (currentConditions.size() != option.conditions.size()) differentConditions=true;
        else
        {
            for (unsigned int c=0; c<currentConditions.size() && !differentConditions; ++c)
            {
                if (currentConditions[c] != option.conditions[c]) differentConditions=true;
            }
        }

        if (differentConditions)
        {
            for (unsigned int c=0; c<currentConditions.size(); ++c) out << "}\n";

            currentConditions = option.conditions;
        }

        if (currentCategory != option.category)
        {
            if (!currentCategory.empty())  out << "\n\n";
            currentCategory = option.category;
            out << "########################################################################\n";
            out << "# " << currentCategory << "\n";
            out << "########################################################################\n";
        }

        if (differentConditions)
        {
            for (unsigned int c=0; c<currentConditions.size(); ++c)
            {
                if (!currentConditions[c].presence) out << "!";
                switch( currentConditions[c].type)
                {
                case OPTION:
                    out << "contains(DEFINES," << currentConditions[c].option << "){\n";
                    break;
                case ARCHI:
                    out << currentConditions[c].option << "{\n";
                    break;
                }
            }
        }


        if (option.typeOption)
        {
            std::string description=option.description;
            for (unsigned int position=0; position<description.size(); ++position)
            {
                if (description[position] == '\n') description.insert(position+1, "# ");
            }
            out << "\n# Uncomment " << description << "\n";
            if (!option.value) out << "# ";
            out << "DEFINES += " << option.name << "\n";
        }
        else
        {
            if (!option.value) out << "# ";
            out << option.name << " " << option.description << "\n";
        }
    }

    for (unsigned int c=0; c<currentConditions.size(); ++c) out << "}\n";

    out.close();


    std::set< QWidget *>::iterator it;
    if (!optionsModified.empty())
    {
        std::vector<QString> listDir;
        listDir.push_back(QString("/applications"));
        listDir.push_back(QString("/modules"));
        listDir.push_back(QString("/framework"));
        //listDir.push_back(QString("/extlibs"));

        std::set< QWidget *>::iterator it;
        std::cout << "Touch file containing option :";
        for (it=optionsModified.begin(); it!=optionsModified.end(); it++)
            std::cout << "\"" << (*it)->name() << "\" ";
        std::cout << "in [ ";
        for (unsigned int i=0; i<listDir.size(); ++i)
            std::cout << listDir[i].ascii() << " ";
        std::cout << "]" << std::endl;


        for (unsigned int i=0; i<listDir.size(); ++i)
        {
            std::cout << "   Searching in " << listDir[i].ascii() << "\n";
            processDirectory(listDir[i]);
        }

    }
    QStringList argv;
#ifdef WIN32
    argv << QString("cmd.exe");
    argv << QString("/c");
    argv << QString(QString(projectVC->text()) );
#elif defined (__APPLE__)
    argv << QString("sh");
    argv << QString("Project MacOS.sh");
#else
#if SOFA_QT4
    argv << QString("qmake-qt4");
#else
    argv << QString("qmake");
#endif
#endif
    p = new Q3Process(argv,this);
    p->setWorkingDirectory(QDir(QString(path.c_str())));
    connect( p, SIGNAL( readyReadStdout() ), this, SLOT( redirectStdOut() ) );
    connect( p, SIGNAL( readyReadStderr() ), this, SLOT( redirectStdErr() ) );
    connect( p, SIGNAL( processExited() ), this, SLOT( saveConfigurationDone() ) );
    p->start();

    this->saveButton->setEnabled(false);
}
Пример #9
0
// ------------------------------------------------------------------------
void SimMessage::startSimulator()
{
  // Using the Doc pointer here is risky as the user may have closed
  // the schematic, but converting the SPICE netlists is (hopefully)
  // faster than the user (I have no other idea).

  QString SimTime;
  QStringList CommandLine;
  QString SimPath = QDir::convertSeparators (QucsHomeDir.absPath());
#ifdef __MINGW32__
  QString QucsDigi = "qucsdigi.bat";
#else
  QString QucsDigi = "qucsdigi";
#endif
  SimOpt = NULL;

  if(DocWidget->inherits("QTextEdit")) {
    // Take VHDL file in memory as it could contain unsaved changes.
    Stream << ((TextDoc*)DocWidget)->text();
    NetlistFile.close();
    ProgText->insert(tr("done.\n"));  // of "creating netlist... 

    SimTime = ((TextDoc*)DocWidget)->SimTime;
#ifdef __MINGW32__
    CommandLine << getShortPathName(QucsSettings.BinDir + QucsDigi)
		<< "netlist.txt" << DataSet
		<< SimTime << getShortPathName(SimPath)
		<< getShortPathName(QucsSettings.BinDir);
#else
    CommandLine << QucsSettings.BinDir + QucsDigi << "netlist.txt" << DataSet
       << SimTime << SimPath << QucsSettings.BinDir;
#endif
  }
  else {
    // output NodeSets, SPICE simulations etc.
    Stream << Collect.join("\n") << '\n';
    SimTime = ((Schematic*)DocWidget)->createNetlist(Stream, SimPorts);
    NetlistFile.close();
    if(SimTime.at(0) == '§') {
      ErrText->insert(SimTime.mid(1));
      FinishSimulation(-1);
      return;
    }
    ProgText->insert(tr("done.\n"));  // of "creating netlist... 

    if(SimPorts < 0) {
      if((SimOpt = findOptimization((Schematic*)DocWidget))) {
	((Optimize_Sim*)SimOpt)->createASCOnetlist();
	CommandLine << QucsSettings.AscoDir + "asco" << "-qucs" <<
	  QucsHomeDir.filePath("asco_netlist.txt") << "-o" << "asco_out";
      }
      else {
	CommandLine << QucsSettings.BinDir + "qucsator" << "-b" << "-g"
           << "-i" << QucsHomeDir.filePath("netlist.txt") << "-o" << DataSet;
      }
    } else {
#ifdef __MINGW32__
      CommandLine << getShortPathName(QucsSettings.BinDir + QucsDigi)
		  << "netlist.txt" << DataSet
		  << SimTime << getShortPathName(SimPath)
		  << getShortPathName(QucsSettings.BinDir) << "-c";
#else
      CommandLine << QucsSettings.BinDir + QucsDigi << "netlist.txt"
         << DataSet << SimTime << SimPath << QucsSettings.BinDir << "-c";
#endif
    }
  }

  SimProcess.setArguments(CommandLine);

  disconnect(&SimProcess, 0, 0, 0);
  connect(&SimProcess, SIGNAL(readyReadStderr()), SLOT(slotDisplayErr()));
  connect(&SimProcess, SIGNAL(readyReadStdout()), SLOT(slotDisplayMsg()));
  connect(&SimProcess, SIGNAL(processExited()), SLOT(slotSimEnded()));

#ifdef SPEEDUP_PROGRESSBAR
  waitForUpdate = false;
#endif
  wasLF = false;
  ProgressText = "";
  if(!SimProcess.start()) {
    ErrText->insert(tr("ERROR: Cannot start simulator!"));
    FinishSimulation(-1);
    return;
  }
}