Skip to content

Commit

Permalink
- Log omc output.
Browse files Browse the repository at this point in the history
- Creates a file openmodelica.omc.output.OMEdit in user temp directory.

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@10307 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
adeas31 committed Nov 6, 2011
1 parent f39e004 commit 47b60a1
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions OMEdit/OMEditGUI/OMCProxy.cpp
Expand Up @@ -227,10 +227,18 @@ bool OMCProxy::startServer()
// Start the omc.exe
QStringList parameters;
parameters << QString("+c=").append(this->mName).append(fileIdentifier) << QString("+d=interactiveCorba");

QProcess *omcProcess = new QProcess();
omcProcess->start( omcPath, parameters );

QFile omcOutputFile;
#ifdef WIN32 // Win32
omcOutputFile.setFileName(QString(QDir::tempPath()).append(QDir::separator()).append("openmodelica.omc.output.").append(this->mName));
#else // UNIX environment
char *user = getenv("USER");
if (!user) { user = "nobody"; }
omcOutputFile.setFileName(QString(QDir::tempPath()).append(QDir::separator()).append("openmodelica.").append(*(new QString(user))).append(".omc.output.").append(this->mName));
#endif
omcProcess->setProcessChannelMode(QProcess::MergedChannels);
omcProcess->setStandardOutputFile(omcOutputFile.fileName());
omcProcess->start(omcPath, parameters);
// wait for the server to start.
int ticks = 0;
while (!objectRefFile.exists())
Expand Down

0 comments on commit 47b60a1

Please sign in to comment.