Skip to content

Commit

Permalink
- emit signals from scripting API for logging.
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@24443 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
adeas31 committed Feb 5, 2015
1 parent 43bacd0 commit 063b01f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Compiler/Template/GenerateAPIFunctionsTpl.tpl
Expand Up @@ -147,7 +147,8 @@ template getQtInterfaceHeaders(list<DAE.Type> tys, String className)
<%className%>(threadData_t *td, void *symbolTable);
<%heads%>
signals:
void finished();
void logCommand(QString command, QTime *commandTime);
void logResponse(QString response, QTime *responseTime);
};
>>
end getQtInterfaceHeaders;
Expand Down Expand Up @@ -286,8 +287,11 @@ template getQtInterfaceFunc(String name, list<DAE.FuncArg> args, DAE.Type res, S
MMC_TRY_TOP_INTERNAL()
QTime commandTime;
commandTime.start();
emit logCommand("<%replaceDotAndUnderscore(name)%>(### create string of parameters ###)", &commandTime);
st = omc_OpenModelicaScriptingAPI_<%replaceDotAndUnderscore(name)%>(threadData, st<%inArgs%><%outArgs%>);
emit finished();
emit logResponse("### create string of result ###", &commandTime);
<%postCall%>
MMC_CATCH_TOP(throw std::runtime_error("<%replaceDotAndUnderscore(name)%> failed");)
Expand Down

0 comments on commit 063b01f

Please sign in to comment.