Skip to content

Commit

Permalink
- Another stupid typo.
Browse files Browse the repository at this point in the history
  • Loading branch information
adeas31 committed May 29, 2015
1 parent 149bf80 commit a6ded24
Showing 1 changed file with 11 additions and 17 deletions.
28 changes: 11 additions & 17 deletions OMEdit/OMEditGUI/Simulation/TLMCoSimulationThread.cpp
Expand Up @@ -86,33 +86,27 @@ void TLMCoSimulationThread::runManager()
void TLMCoSimulationThread::runMonitor()
{
mpMonitorProcess = new QProcess;
QFileInfo fileInfo(mpTLMCoSimulationOutputWidget->getTLMCoSimulationOptions().getFileName());
TLMCoSimulationOptions tlmCoSimulationOptions = mpTLMCoSimulationOutputWidget->getTLMCoSimulationOptions();
QFileInfo fileInfo(tlmCoSimulationOptions.getFileName());
mpMonitorProcess->setWorkingDirectory(fileInfo.absoluteDir().absolutePath());
connect(mpMonitorProcess, SIGNAL(started()), SLOT(monitorProcessStarted()));
connect(mpMonitorProcess, SIGNAL(readyReadStandardOutput()), SLOT(readMonitorStandardOutput()));
connect(mpMonitorProcess, SIGNAL(readyReadStandardError()), SLOT(readMonitorStandardError()));
connect(mpMonitorProcess, SIGNAL(finished(int,QProcess::ExitStatus)), SLOT(monitorProcessFinished(int,QProcess::ExitStatus)));
QStringList args;
args << mpTLMCoSimulationOutputWidget->getTLMCoSimulationOptions().getMonitorArgs() << fileInfo.absoluteFilePath();
args << tlmCoSimulationOptions.getMonitorArgs() << fileInfo.absoluteFilePath();
// start the executable
QString fileName = mpTLMCoSimulationOutputWidget->getTLMCoSimulationOptions().getMonitorProcess();
QString fileName = tlmCoSimulationOptions.getMonitorProcess();
// run the simulation executable to create the result file
QProcessEnvironment environment;
#ifdef WIN32
QProcessEnvironment environment = QProcessEnvironment::systemEnvironment();
const char *OMDEV = getenv("OMDEV");
if (QString(OMDEV).isEmpty()) {
QString OMHOME = QString(Helper::OpenModelicaHome).replace("/", "\\");
QString MinGWBin = OMHOME + "\\MinGW\\bin";
environment.insert("PATH", MinGWBin + ";" + environment.value("PATH"));
} else {
QString qOMDEV = QString(OMDEV).replace("/", "\\");
QString MinGWBin = qOMDEV + "\\tools\\mingw\\bin";
environment.insert("PATH", MinGWBin + ";" + environment.value("PATH"));
}
environment.insert("PATH", "C:/SKF/TLMPlugin/bin;" + environment.value("PATH"));
environment.insert("TLMPluginPath", "C:/SKF/TLMPlugin/");
mpMonitorProcess->setProcessEnvironment(environment);
environment = StringHandler::simulationProcessEnvironment();
#else
environment = QProcessEnvironment::systemEnvironment();
#endif
environment.insert("PATH", tlmCoSimulationOptions.getTLMPluginPath() + ";" + environment.value("PATH"));
environment.insert("TLMPluginPath", tlmCoSimulationOptions.getTLMPluginPath());
mpMonitorProcess->setProcessEnvironment(environment);
mpMonitorProcess->start(fileName, args);
emit sendMonitorOutput(QString("%1 %2").arg(fileName).arg(args.join(" ")), StringHandler::OMEditInfo);
}
Expand Down

0 comments on commit a6ded24

Please sign in to comment.