@@ -239,6 +239,18 @@ template getQtInArgBoxed(Text name, DAE.Type ty)
239
239
else error(sourceInfo(), 'getQtInArgBoxed failed for <%unparseType(ty)%>')
240
240
end getQtInArgBoxed;
241
241
242
+ template getQtCommandLogText(Text name, DAE.Type ty)
243
+ ::=
244
+ match ty
245
+ case T_CODE(ty=C_TYPENAME(__))
246
+ case T_STRING(__) then '<%name%>'
247
+ case T_INTEGER(__)
248
+ case T_REAL(__) then 'QString::number(<%name%>)'
249
+ case T_BOOL(__) then 'QString(<%name%> ? "true" : "false")'
250
+ case aty as T_ARRAY(__) then 'QString("### Handle array arguments ###")'
251
+ else error(sourceInfo(), 'getQtCommandLogText failed for <%unparseType(ty)%>')
252
+ end getQtCommandLogText;
253
+
242
254
template getQtOutArg(Text name, Text shortName, DAE.Type ty, Text &varDecl, Text &postCall)
243
255
::=
244
256
match ty
@@ -297,6 +309,7 @@ template getQtInterfaceFunc(String name, list<DAE.FuncArg> args, DAE.Type res, S
297
309
let &responseLog = buffer ""
298
310
let &postCall = buffer ""
299
311
let inArgs = args |> arg as FUNCARG(__) => ', <%getQtInArg(arg.name, arg.ty, varDecl)%>'
312
+ let commandArgs = args |> arg as FUNCARG(__) => getQtCommandLogText(arg.name, arg.ty) ; separator='+"," +'
300
313
let outArgs = (match res
301
314
case T_NORETCALL(__) then
302
315
let &responseLog += '""'
@@ -319,7 +332,7 @@ template getQtInterfaceFunc(String name, list<DAE.FuncArg> args, DAE.Type res, S
319
332
320
333
QTime commandTime;
321
334
commandTime.start();
322
- emit logCommand(" <%replaceDotAndUnderscore(name)%>(### create string of parameters ### )" , &commandTime);
335
+ emit logCommand(" <%replaceDotAndUnderscore(name)%>(" + <% if intGt(listLength(args), 0) then commandArgs else ' QString("") ' %> + " )" , &commandTime);
323
336
st = omc_OpenModelicaScriptingAPI_<% replaceDotAndUnderscore(name)%> (threadData, st<% inArgs%><% outArgs%> );
324
337
<% postCall%>
325
338
emit logResponse(<% responseLog%> , &commandTime);
0 commit comments