Skip to content
This repository was archived by the owner on May 18, 2019. It is now read-only.

Commit 49624ef

Browse files
adrpoOpenModelica-Hudson
authored andcommitted
better Qt log
Belonging to [master]: - #2621
1 parent 51e9b19 commit 49624ef

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

Compiler/Script/Makefile.common

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
all: OpenModelicaScriptingAPI.mo $(OMBUILDDIR)/include/omc/scripting-API/OpenModelicaScriptingAPIQt.cpp $(OMBUILDDIR)/include/omc/scripting-API/OpenModelicaScriptingAPIQt.h
22

3-
OpenModelicaScriptingAPI.mo: OpenModelicaScriptingAPI.mos ../FrontEnd/ModelicaBuiltin.mo
3+
OpenModelicaScriptingAPI.mo: OpenModelicaScriptingAPI.mos ../FrontEnd/ModelicaBuiltin.mo ../Template/GenerateAPIFunctionsTpl.tpl
44
$(OMC) -g=MetaModelica $<
55
test -f OpenModelicaScriptingAPI.mo
66
test -f OpenModelicaScriptingAPIQt.cpp

Compiler/Template/GenerateAPIFunctionsTpl.tpl

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ template getQtInterfaceHeaders(list<DAE.Type> tys, String className)
150150
<%heads%>
151151
signals:
152152
void logCommand(QString command, QTime *commandTime);
153-
void logResponse(QString response, QTime *responseTime);
153+
void logResponse(QString command, QString response, QTime *responseTime);
154154
void throwException(QString exception);
155155
};
156156
>>
@@ -426,7 +426,13 @@ template getQtInterfaceFunc(String name, list<DAE.FuncArg> args, DAE.Type res, S
426426

427427
QString responseLog;
428428
<%responseLog%>
429-
emit logResponse(responseLog, &commandTime);
429+
<%if intGt(listLength(args), 0) then
430+
<<
431+
emit logResponse("<%replaceDotAndUnderscore(name)%>("+commandLog+")", responseLog, &commandTime);
432+
>> else
433+
<<
434+
emit logResponse("<%replaceDotAndUnderscore(name)%>()", responseLog, &commandTime);
435+
>>%>
430436

431437
<%if outArg then "return result;"%>
432438
}

0 commit comments

Comments
 (0)