Skip to content

Commit

Permalink
Write total time OMC API calls have taken.
Browse files Browse the repository at this point in the history
  • Loading branch information
adeas31 committed Apr 28, 2016
1 parent bef411c commit 02615af
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
10 changes: 5 additions & 5 deletions OMEdit/OMEditGUI/OMC/OMCProxy.cpp
Expand Up @@ -68,7 +68,7 @@ void omc_Main_setWindowsPaths(threadData_t *threadData, void* _inOMHome);
\param pMainWindow - pointer to MainWindow
*/
OMCProxy::OMCProxy(MainWindow *pMainWindow)
: QObject(pMainWindow), mHasInitialized(false), mResult("")
: QObject(pMainWindow), mHasInitialized(false), mResult(""), mTotalOMCCallsTime(0.0)
{
mpMainWindow = pMainWindow;
mCurrentCommandIndex = -1;
Expand Down Expand Up @@ -394,10 +394,10 @@ void OMCProxy::logResponse(QString response, QTime *responseTime)
mpOMCLoggerTextBox->setTextCursor(textCursor);
// write the log to communication log file
if (mCommunicationLogFileTextStream.device()) {
mCommunicationLogFileTextStream << response << " " << responseTime->currentTime().toString("hh:mm:ss:zzz");
mCommunicationLogFileTextStream << "\n";
mCommunicationLogFileTextStream << "Elapsed Time :: " << QString::number((double)responseTime->elapsed() / 1000).append(" secs");
mCommunicationLogFileTextStream << "\n\n";
mCommunicationLogFileTextStream << response << " " << responseTime->currentTime().toString("hh:mm:ss:zzz") << "\n";
mCommunicationLogFileTextStream << "Elapsed Time :: " << QString::number((double)responseTime->elapsed() / 1000).append(" secs") << "\n";
mTotalOMCCallsTime += (double)responseTime->elapsed() / 1000;
mCommunicationLogFileTextStream << "Total Calls Time :: " << QString::number(mTotalOMCCallsTime).append(" secs") << "\n\n";
mCommunicationLogFileTextStream.flush();
}
}
Expand Down
1 change: 1 addition & 0 deletions OMEdit/OMEditGUI/OMC/OMCProxy.h
Expand Up @@ -83,6 +83,7 @@ class OMCProxy : public QObject
QTextStream mCommunicationLogFileTextStream;
QFile mCommandsMosFile;
QTextStream mCommandsLogFileTextStream;
double mTotalOMCCallsTime;
QList<UnitConverion> mUnitConversionList;
QMap<QString, QList<QString> > mDerivedUnitsMap;
OMCInterface *mpOMCInterface;
Expand Down

0 comments on commit 02615af

Please sign in to comment.