Bug Summary

File:OMEdit/OMEditLIB/../../build/include/omc/scripting-API/OpenModelicaScriptingAPIQt.cpp
Warning:line 747, column 22
1st function call argument is an uninitialized value

Annotated Source Code

[?] Use j/k keys for keyboard navigation

1/* generated by OpenModelica */
2#ifndef OpenModelicaScriptingAPIQt__H
3#define OpenModelicaScriptingAPIQt__H
4
5#include <stdexcept>
6#include "OpenModelicaScriptingAPIQt.h"
7
8OMCInterface::OMCInterface(threadData_t *td)
9 : threadData(td)
10{
11}
12QString OMCInterface::oms_getVersion()
13{
14 QTime commandTime;
15 commandTime.start();
16 emit logCommand("oms__getVersion()", &commandTime);
17
18 QString result;
19 void *result_mm = NULL__null;
20
21 try {
22 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
23
24 result_mm = omc_OpenModelicaScriptingAPI_oms__getVersion(threadData);
25 result = QString::fromUtf8(MMC_STRINGDATA(result_mm)(((struct mmc_string*)((void*)((char*)(result_mm) - 3)))->
data)
);
26
27 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
28 } catch(std::exception &exception) {
29 emit throwException(QString("oms__getVersion failed. %1").arg(exception.what()));
30 }
31
32 QString responseLog;
33 responseLog.append("\"" + result + "\"");
34 emit logResponse("oms__getVersion()", responseLog, &commandTime);
35
36 return result;
37}
38modelica_integer OMCInterface::oms_terminate(QString cref)
39{
40 QTime commandTime;
41 commandTime.start();
42 QString commandLog;
43 commandLog.append("\"" + cref + "\"");
44 emit logCommand("oms__terminate("+commandLog+")", &commandTime);
45
46 QByteArray cref_utf8 = cref.toUtf8();
47 modelica_integer result;
48
49 try {
50 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
51
52 result = omc_OpenModelicaScriptingAPI_oms__terminate(threadData, mmc_mk_scon(cref_utf8.constData()));
53
54 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
55 } catch(std::exception &exception) {
56 emit throwException(QString("oms__terminate failed. %1").arg(exception.what()));
57 }
58
59 QString responseLog;
60 responseLog.append(QString::number(result));
61 emit logResponse("oms__terminate("+commandLog+")", responseLog, &commandTime);
62
63 return result;
64}
65modelica_integer OMCInterface::oms_stepUntil(QString cref, modelica_real stopTime)
66{
67 QTime commandTime;
68 commandTime.start();
69 QString commandLog;
70 commandLog.append("\"" + cref + "\"");
71 commandLog.append(",");
72 commandLog.append(QString::number(stopTime));
73 emit logCommand("oms__stepUntil("+commandLog+")", &commandTime);
74
75 QByteArray cref_utf8 = cref.toUtf8();
76 modelica_integer result;
77
78 try {
79 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
80
81 result = omc_OpenModelicaScriptingAPI_oms__stepUntil(threadData, mmc_mk_scon(cref_utf8.constData()), stopTime);
82
83 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
84 } catch(std::exception &exception) {
85 emit throwException(QString("oms__stepUntil failed. %1").arg(exception.what()));
86 }
87
88 QString responseLog;
89 responseLog.append(QString::number(result));
90 emit logResponse("oms__stepUntil("+commandLog+")", responseLog, &commandTime);
91
92 return result;
93}
94modelica_integer OMCInterface::oms_simulate(QString cref)
95{
96 QTime commandTime;
97 commandTime.start();
98 QString commandLog;
99 commandLog.append("\"" + cref + "\"");
100 emit logCommand("oms__simulate("+commandLog+")", &commandTime);
101
102 QByteArray cref_utf8 = cref.toUtf8();
103 modelica_integer result;
104
105 try {
106 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
107
108 result = omc_OpenModelicaScriptingAPI_oms__simulate(threadData, mmc_mk_scon(cref_utf8.constData()));
109
110 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
111 } catch(std::exception &exception) {
112 emit throwException(QString("oms__simulate failed. %1").arg(exception.what()));
113 }
114
115 QString responseLog;
116 responseLog.append(QString::number(result));
117 emit logResponse("oms__simulate("+commandLog+")", responseLog, &commandTime);
118
119 return result;
120}
121modelica_integer OMCInterface::oms_setWorkingDirectory(QString newWorkingDir)
122{
123 QTime commandTime;
124 commandTime.start();
125 QString commandLog;
126 commandLog.append("\"" + newWorkingDir + "\"");
127 emit logCommand("oms__setWorkingDirectory("+commandLog+")", &commandTime);
128
129 QByteArray newWorkingDir_utf8 = newWorkingDir.toUtf8();
130 modelica_integer result;
131
132 try {
133 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
134
135 result = omc_OpenModelicaScriptingAPI_oms__setWorkingDirectory(threadData, mmc_mk_scon(newWorkingDir_utf8.constData()));
136
137 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
138 } catch(std::exception &exception) {
139 emit throwException(QString("oms__setWorkingDirectory failed. %1").arg(exception.what()));
140 }
141
142 QString responseLog;
143 responseLog.append(QString::number(result));
144 emit logResponse("oms__setWorkingDirectory("+commandLog+")", responseLog, &commandTime);
145
146 return result;
147}
148modelica_integer OMCInterface::oms_setVariableStepSize(QString cref, modelica_real initialStepSize, modelica_real minimumStepSize, modelica_real maximumStepSize)
149{
150 QTime commandTime;
151 commandTime.start();
152 QString commandLog;
153 commandLog.append("\"" + cref + "\"");
154 commandLog.append(",");
155 commandLog.append(QString::number(initialStepSize));
156 commandLog.append(",");
157 commandLog.append(QString::number(minimumStepSize));
158 commandLog.append(",");
159 commandLog.append(QString::number(maximumStepSize));
160 emit logCommand("oms__setVariableStepSize("+commandLog+")", &commandTime);
161
162 QByteArray cref_utf8 = cref.toUtf8();
163 modelica_integer result;
164
165 try {
166 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
167
168 result = omc_OpenModelicaScriptingAPI_oms__setVariableStepSize(threadData, mmc_mk_scon(cref_utf8.constData()), initialStepSize, minimumStepSize, maximumStepSize);
169
170 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
171 } catch(std::exception &exception) {
172 emit throwException(QString("oms__setVariableStepSize failed. %1").arg(exception.what()));
173 }
174
175 QString responseLog;
176 responseLog.append(QString::number(result));
177 emit logResponse("oms__setVariableStepSize("+commandLog+")", responseLog, &commandTime);
178
179 return result;
180}
181modelica_integer OMCInterface::oms_setTolerance(QString cref, modelica_real absoluteTolerance, modelica_real relativeTolerance)
182{
183 QTime commandTime;
184 commandTime.start();
185 QString commandLog;
186 commandLog.append("\"" + cref + "\"");
187 commandLog.append(",");
188 commandLog.append(QString::number(absoluteTolerance));
189 commandLog.append(",");
190 commandLog.append(QString::number(relativeTolerance));
191 emit logCommand("oms__setTolerance("+commandLog+")", &commandTime);
192
193 QByteArray cref_utf8 = cref.toUtf8();
194 modelica_integer result;
195
196 try {
197 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
198
199 result = omc_OpenModelicaScriptingAPI_oms__setTolerance(threadData, mmc_mk_scon(cref_utf8.constData()), absoluteTolerance, relativeTolerance);
200
201 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
202 } catch(std::exception &exception) {
203 emit throwException(QString("oms__setTolerance failed. %1").arg(exception.what()));
204 }
205
206 QString responseLog;
207 responseLog.append(QString::number(result));
208 emit logResponse("oms__setTolerance("+commandLog+")", responseLog, &commandTime);
209
210 return result;
211}
212modelica_integer OMCInterface::oms_setTLMSocketData(QString cref, QString address, modelica_integer managerPort, modelica_integer monitorPort)
213{
214 QTime commandTime;
215 commandTime.start();
216 QString commandLog;
217 commandLog.append("\"" + cref + "\"");
218 commandLog.append(",");
219 commandLog.append("\"" + address + "\"");
220 commandLog.append(",");
221 commandLog.append(QString::number(managerPort));
222 commandLog.append(",");
223 commandLog.append(QString::number(monitorPort));
224 emit logCommand("oms__setTLMSocketData("+commandLog+")", &commandTime);
225
226 QByteArray cref_utf8 = cref.toUtf8();
227 QByteArray address_utf8 = address.toUtf8();
228 modelica_integer result;
229
230 try {
231 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
232
233 result = omc_OpenModelicaScriptingAPI_oms__setTLMSocketData(threadData, mmc_mk_scon(cref_utf8.constData()), mmc_mk_scon(address_utf8.constData()), managerPort, monitorPort);
234
235 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
236 } catch(std::exception &exception) {
237 emit throwException(QString("oms__setTLMSocketData failed. %1").arg(exception.what()));
238 }
239
240 QString responseLog;
241 responseLog.append(QString::number(result));
242 emit logResponse("oms__setTLMSocketData("+commandLog+")", responseLog, &commandTime);
243
244 return result;
245}
246modelica_integer OMCInterface::oms_setTLMPositionAndOrientation(QString cref, modelica_real x1, modelica_real x2, modelica_real x3, modelica_real A11, modelica_real A12, modelica_real A13, modelica_real A21, modelica_real A22, modelica_real A23, modelica_real A31, modelica_real A32, modelica_real A33)
247{
248 QTime commandTime;
249 commandTime.start();
250 QString commandLog;
251 commandLog.append("\"" + cref + "\"");
252 commandLog.append(",");
253 commandLog.append(QString::number(x1));
254 commandLog.append(",");
255 commandLog.append(QString::number(x2));
256 commandLog.append(",");
257 commandLog.append(QString::number(x3));
258 commandLog.append(",");
259 commandLog.append(QString::number(A11));
260 commandLog.append(",");
261 commandLog.append(QString::number(A12));
262 commandLog.append(",");
263 commandLog.append(QString::number(A13));
264 commandLog.append(",");
265 commandLog.append(QString::number(A21));
266 commandLog.append(",");
267 commandLog.append(QString::number(A22));
268 commandLog.append(",");
269 commandLog.append(QString::number(A23));
270 commandLog.append(",");
271 commandLog.append(QString::number(A31));
272 commandLog.append(",");
273 commandLog.append(QString::number(A32));
274 commandLog.append(",");
275 commandLog.append(QString::number(A33));
276 emit logCommand("oms__setTLMPositionAndOrientation("+commandLog+")", &commandTime);
277
278 QByteArray cref_utf8 = cref.toUtf8();
279 modelica_integer result;
280
281 try {
282 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
283
284 result = omc_OpenModelicaScriptingAPI_oms__setTLMPositionAndOrientation(threadData, mmc_mk_scon(cref_utf8.constData()), x1, x2, x3, A11, A12, A13, A21, A22, A23, A31, A32, A33);
285
286 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
287 } catch(std::exception &exception) {
288 emit throwException(QString("oms__setTLMPositionAndOrientation failed. %1").arg(exception.what()));
289 }
290
291 QString responseLog;
292 responseLog.append(QString::number(result));
293 emit logResponse("oms__setTLMPositionAndOrientation("+commandLog+")", responseLog, &commandTime);
294
295 return result;
296}
297modelica_integer OMCInterface::oms_setTempDirectory(QString newTempDir)
298{
299 QTime commandTime;
300 commandTime.start();
301 QString commandLog;
302 commandLog.append("\"" + newTempDir + "\"");
303 emit logCommand("oms__setTempDirectory("+commandLog+")", &commandTime);
304
305 QByteArray newTempDir_utf8 = newTempDir.toUtf8();
306 modelica_integer result;
307
308 try {
309 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
310
311 result = omc_OpenModelicaScriptingAPI_oms__setTempDirectory(threadData, mmc_mk_scon(newTempDir_utf8.constData()));
312
313 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
314 } catch(std::exception &exception) {
315 emit throwException(QString("oms__setTempDirectory failed. %1").arg(exception.what()));
316 }
317
318 QString responseLog;
319 responseLog.append(QString::number(result));
320 emit logResponse("oms__setTempDirectory("+commandLog+")", responseLog, &commandTime);
321
322 return result;
323}
324modelica_integer OMCInterface::oms_setStopTime(QString cref, modelica_real stopTime)
325{
326 QTime commandTime;
327 commandTime.start();
328 QString commandLog;
329 commandLog.append("\"" + cref + "\"");
330 commandLog.append(",");
331 commandLog.append(QString::number(stopTime));
332 emit logCommand("oms__setStopTime("+commandLog+")", &commandTime);
333
334 QByteArray cref_utf8 = cref.toUtf8();
335 modelica_integer result;
336
337 try {
338 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
339
340 result = omc_OpenModelicaScriptingAPI_oms__setStopTime(threadData, mmc_mk_scon(cref_utf8.constData()), stopTime);
341
342 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
343 } catch(std::exception &exception) {
344 emit throwException(QString("oms__setStopTime failed. %1").arg(exception.what()));
345 }
346
347 QString responseLog;
348 responseLog.append(QString::number(result));
349 emit logResponse("oms__setStopTime("+commandLog+")", responseLog, &commandTime);
350
351 return result;
352}
353modelica_integer OMCInterface::oms_setStartTime(QString cref, modelica_real startTime)
354{
355 QTime commandTime;
356 commandTime.start();
357 QString commandLog;
358 commandLog.append("\"" + cref + "\"");
359 commandLog.append(",");
360 commandLog.append(QString::number(startTime));
361 emit logCommand("oms__setStartTime("+commandLog+")", &commandTime);
362
363 QByteArray cref_utf8 = cref.toUtf8();
364 modelica_integer result;
365
366 try {
367 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
368
369 result = omc_OpenModelicaScriptingAPI_oms__setStartTime(threadData, mmc_mk_scon(cref_utf8.constData()), startTime);
370
371 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
372 } catch(std::exception &exception) {
373 emit throwException(QString("oms__setStartTime failed. %1").arg(exception.what()));
374 }
375
376 QString responseLog;
377 responseLog.append(QString::number(result));
378 emit logResponse("oms__setStartTime("+commandLog+")", responseLog, &commandTime);
379
380 return result;
381}
382modelica_integer OMCInterface::oms_setSignalFilter(QString cref, QString regex)
383{
384 QTime commandTime;
385 commandTime.start();
386 QString commandLog;
387 commandLog.append("\"" + cref + "\"");
388 commandLog.append(",");
389 commandLog.append("\"" + regex + "\"");
390 emit logCommand("oms__setSignalFilter("+commandLog+")", &commandTime);
391
392 QByteArray cref_utf8 = cref.toUtf8();
393 QByteArray regex_utf8 = regex.toUtf8();
394 modelica_integer result;
395
396 try {
397 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
398
399 result = omc_OpenModelicaScriptingAPI_oms__setSignalFilter(threadData, mmc_mk_scon(cref_utf8.constData()), mmc_mk_scon(regex_utf8.constData()));
400
401 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
402 } catch(std::exception &exception) {
403 emit throwException(QString("oms__setSignalFilter failed. %1").arg(exception.what()));
404 }
405
406 QString responseLog;
407 responseLog.append(QString::number(result));
408 emit logResponse("oms__setSignalFilter("+commandLog+")", responseLog, &commandTime);
409
410 return result;
411}
412modelica_integer OMCInterface::oms_setResultFile(QString cref, QString filename, modelica_integer bufferSize)
413{
414 QTime commandTime;
415 commandTime.start();
416 QString commandLog;
417 commandLog.append("\"" + cref + "\"");
418 commandLog.append(",");
419 commandLog.append("\"" + filename + "\"");
420 commandLog.append(",");
421 commandLog.append(QString::number(bufferSize));
422 emit logCommand("oms__setResultFile("+commandLog+")", &commandTime);
423
424 QByteArray cref_utf8 = cref.toUtf8();
425 QByteArray filename_utf8 = filename.toUtf8();
426 modelica_integer result;
427
428 try {
429 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
430
431 result = omc_OpenModelicaScriptingAPI_oms__setResultFile(threadData, mmc_mk_scon(cref_utf8.constData()), mmc_mk_scon(filename_utf8.constData()), bufferSize);
432
433 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
434 } catch(std::exception &exception) {
435 emit throwException(QString("oms__setResultFile failed. %1").arg(exception.what()));
436 }
437
438 QString responseLog;
439 responseLog.append(QString::number(result));
440 emit logResponse("oms__setResultFile("+commandLog+")", responseLog, &commandTime);
441
442 return result;
443}
444modelica_integer OMCInterface::oms_setRealInputDerivative(QString cref, modelica_real value)
445{
446 QTime commandTime;
447 commandTime.start();
448 QString commandLog;
449 commandLog.append("\"" + cref + "\"");
450 commandLog.append(",");
451 commandLog.append(QString::number(value));
452 emit logCommand("oms__setRealInputDerivative("+commandLog+")", &commandTime);
453
454 QByteArray cref_utf8 = cref.toUtf8();
455 modelica_integer result;
456
457 try {
458 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
459
460 result = omc_OpenModelicaScriptingAPI_oms__setRealInputDerivative(threadData, mmc_mk_scon(cref_utf8.constData()), value);
461
462 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
463 } catch(std::exception &exception) {
464 emit throwException(QString("oms__setRealInputDerivative failed. %1").arg(exception.what()));
465 }
466
467 QString responseLog;
468 responseLog.append(QString::number(result));
469 emit logResponse("oms__setRealInputDerivative("+commandLog+")", responseLog, &commandTime);
470
471 return result;
472}
473modelica_integer OMCInterface::oms_setReal(QString cref, modelica_real value)
474{
475 QTime commandTime;
476 commandTime.start();
477 QString commandLog;
478 commandLog.append("\"" + cref + "\"");
479 commandLog.append(",");
480 commandLog.append(QString::number(value));
481 emit logCommand("oms__setReal("+commandLog+")", &commandTime);
482
483 QByteArray cref_utf8 = cref.toUtf8();
484 modelica_integer result;
485
486 try {
487 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
488
489 result = omc_OpenModelicaScriptingAPI_oms__setReal(threadData, mmc_mk_scon(cref_utf8.constData()), value);
490
491 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
492 } catch(std::exception &exception) {
493 emit throwException(QString("oms__setReal failed. %1").arg(exception.what()));
494 }
495
496 QString responseLog;
497 responseLog.append(QString::number(result));
498 emit logResponse("oms__setReal("+commandLog+")", responseLog, &commandTime);
499
500 return result;
501}
502modelica_integer OMCInterface::oms_setLoggingLevel(modelica_integer logLevel)
503{
504 QTime commandTime;
505 commandTime.start();
506 QString commandLog;
507 commandLog.append(QString::number(logLevel));
508 emit logCommand("oms__setLoggingLevel("+commandLog+")", &commandTime);
509
510 modelica_integer result;
511
512 try {
513 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
514
515 result = omc_OpenModelicaScriptingAPI_oms__setLoggingLevel(threadData, logLevel);
516
517 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
518 } catch(std::exception &exception) {
519 emit throwException(QString("oms__setLoggingLevel failed. %1").arg(exception.what()));
520 }
521
522 QString responseLog;
523 responseLog.append(QString::number(result));
524 emit logResponse("oms__setLoggingLevel("+commandLog+")", responseLog, &commandTime);
525
526 return result;
527}
528modelica_integer OMCInterface::oms_setLoggingInterval(QString cref, modelica_real loggingInterval)
529{
530 QTime commandTime;
531 commandTime.start();
532 QString commandLog;
533 commandLog.append("\"" + cref + "\"");
534 commandLog.append(",");
535 commandLog.append(QString::number(loggingInterval));
536 emit logCommand("oms__setLoggingInterval("+commandLog+")", &commandTime);
537
538 QByteArray cref_utf8 = cref.toUtf8();
539 modelica_integer result;
540
541 try {
542 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
543
544 result = omc_OpenModelicaScriptingAPI_oms__setLoggingInterval(threadData, mmc_mk_scon(cref_utf8.constData()), loggingInterval);
545
546 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
547 } catch(std::exception &exception) {
548 emit throwException(QString("oms__setLoggingInterval failed. %1").arg(exception.what()));
549 }
550
551 QString responseLog;
552 responseLog.append(QString::number(result));
553 emit logResponse("oms__setLoggingInterval("+commandLog+")", responseLog, &commandTime);
554
555 return result;
556}
557modelica_integer OMCInterface::oms_setLogFile(QString filename)
558{
559 QTime commandTime;
560 commandTime.start();
561 QString commandLog;
562 commandLog.append("\"" + filename + "\"");
563 emit logCommand("oms__setLogFile("+commandLog+")", &commandTime);
564
565 QByteArray filename_utf8 = filename.toUtf8();
566 modelica_integer result;
567
568 try {
569 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
570
571 result = omc_OpenModelicaScriptingAPI_oms__setLogFile(threadData, mmc_mk_scon(filename_utf8.constData()));
572
573 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
574 } catch(std::exception &exception) {
575 emit throwException(QString("oms__setLogFile failed. %1").arg(exception.what()));
576 }
577
578 QString responseLog;
579 responseLog.append(QString::number(result));
580 emit logResponse("oms__setLogFile("+commandLog+")", responseLog, &commandTime);
581
582 return result;
583}
584modelica_integer OMCInterface::oms_setInteger(QString cref, modelica_integer value)
585{
586 QTime commandTime;
587 commandTime.start();
588 QString commandLog;
589 commandLog.append("\"" + cref + "\"");
590 commandLog.append(",");
591 commandLog.append(QString::number(value));
592 emit logCommand("oms__setInteger("+commandLog+")", &commandTime);
593
594 QByteArray cref_utf8 = cref.toUtf8();
595 modelica_integer result;
596
597 try {
598 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
599
600 result = omc_OpenModelicaScriptingAPI_oms__setInteger(threadData, mmc_mk_scon(cref_utf8.constData()), value);
601
602 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
603 } catch(std::exception &exception) {
604 emit throwException(QString("oms__setInteger failed. %1").arg(exception.what()));
605 }
606
607 QString responseLog;
608 responseLog.append(QString::number(result));
609 emit logResponse("oms__setInteger("+commandLog+")", responseLog, &commandTime);
610
611 return result;
612}
613modelica_integer OMCInterface::oms_setFixedStepSize(QString cref, modelica_real stepSize)
614{
615 QTime commandTime;
616 commandTime.start();
617 QString commandLog;
618 commandLog.append("\"" + cref + "\"");
619 commandLog.append(",");
620 commandLog.append(QString::number(stepSize));
621 emit logCommand("oms__setFixedStepSize("+commandLog+")", &commandTime);
622
623 QByteArray cref_utf8 = cref.toUtf8();
624 modelica_integer result;
625
626 try {
627 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
628
629 result = omc_OpenModelicaScriptingAPI_oms__setFixedStepSize(threadData, mmc_mk_scon(cref_utf8.constData()), stepSize);
630
631 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
632 } catch(std::exception &exception) {
633 emit throwException(QString("oms__setFixedStepSize failed. %1").arg(exception.what()));
634 }
635
636 QString responseLog;
637 responseLog.append(QString::number(result));
638 emit logResponse("oms__setFixedStepSize("+commandLog+")", responseLog, &commandTime);
639
640 return result;
641}
642modelica_integer OMCInterface::oms_setCommandLineOption(QString cmd)
643{
644 QTime commandTime;
645 commandTime.start();
646 QString commandLog;
647 commandLog.append("\"" + cmd + "\"");
648 emit logCommand("oms__setCommandLineOption("+commandLog+")", &commandTime);
649
650 QByteArray cmd_utf8 = cmd.toUtf8();
651 modelica_integer result;
652
653 try {
654 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
655
656 result = omc_OpenModelicaScriptingAPI_oms__setCommandLineOption(threadData, mmc_mk_scon(cmd_utf8.constData()));
657
658 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
659 } catch(std::exception &exception) {
660 emit throwException(QString("oms__setCommandLineOption failed. %1").arg(exception.what()));
661 }
662
663 QString responseLog;
664 responseLog.append(QString::number(result));
665 emit logResponse("oms__setCommandLineOption("+commandLog+")", responseLog, &commandTime);
666
667 return result;
668}
669modelica_integer OMCInterface::oms_setBoolean(QString cref, modelica_boolean value)
670{
671 QTime commandTime;
672 commandTime.start();
673 QString commandLog;
674 commandLog.append("\"" + cref + "\"");
675 commandLog.append(",");
676 commandLog.append(value ? "true" : "false");
677 emit logCommand("oms__setBoolean("+commandLog+")", &commandTime);
678
679 QByteArray cref_utf8 = cref.toUtf8();
680 modelica_integer result;
681
682 try {
683 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
684
685 result = omc_OpenModelicaScriptingAPI_oms__setBoolean(threadData, mmc_mk_scon(cref_utf8.constData()), value);
686
687 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
688 } catch(std::exception &exception) {
689 emit throwException(QString("oms__setBoolean failed. %1").arg(exception.what()));
690 }
691
692 QString responseLog;
693 responseLog.append(QString::number(result));
694 emit logResponse("oms__setBoolean("+commandLog+")", responseLog, &commandTime);
695
696 return result;
697}
698modelica_integer OMCInterface::oms_RunFile(QString filename)
699{
700 QTime commandTime;
701 commandTime.start();
702 QString commandLog;
703 commandLog.append("\"" + filename + "\"");
704 emit logCommand("oms__RunFile("+commandLog+")", &commandTime);
705
706 QByteArray filename_utf8 = filename.toUtf8();
707 modelica_integer result;
708
709 try {
710 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
711
712 result = omc_OpenModelicaScriptingAPI_oms__RunFile(threadData, mmc_mk_scon(filename_utf8.constData()));
713
714 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
715 } catch(std::exception &exception) {
716 emit throwException(QString("oms__RunFile failed. %1").arg(exception.what()));
717 }
718
719 QString responseLog;
720 responseLog.append(QString::number(result));
721 emit logResponse("oms__RunFile("+commandLog+")", responseLog, &commandTime);
722
723 return result;
724}
725modelica_integer OMCInterface::oms_reset(QString cref)
726{
727 QTime commandTime;
728 commandTime.start();
729 QString commandLog;
730 commandLog.append("\"" + cref + "\"");
731 emit logCommand("oms__reset("+commandLog+")", &commandTime);
732
733 QByteArray cref_utf8 = cref.toUtf8();
734 modelica_integer result;
1
'result' declared without an initial value
735
736 try {
737 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
738
739 result = omc_OpenModelicaScriptingAPI_oms__reset(threadData, mmc_mk_scon(cref_utf8.constData()));
740
741 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
742 } catch(std::exception &exception) {
743 emit throwException(QString("oms__reset failed. %1").arg(exception.what()));
744 }
745
746 QString responseLog;
747 responseLog.append(QString::number(result));
2
1st function call argument is an uninitialized value
748 emit logResponse("oms__reset("+commandLog+")", responseLog, &commandTime);
749
750 return result;
751}
752modelica_integer OMCInterface::oms_rename(QString cref, QString newCref)
753{
754 QTime commandTime;
755 commandTime.start();
756 QString commandLog;
757 commandLog.append("\"" + cref + "\"");
758 commandLog.append(",");
759 commandLog.append("\"" + newCref + "\"");
760 emit logCommand("oms__rename("+commandLog+")", &commandTime);
761
762 QByteArray cref_utf8 = cref.toUtf8();
763 QByteArray newCref_utf8 = newCref.toUtf8();
764 modelica_integer result;
765
766 try {
767 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
768
769 result = omc_OpenModelicaScriptingAPI_oms__rename(threadData, mmc_mk_scon(cref_utf8.constData()), mmc_mk_scon(newCref_utf8.constData()));
770
771 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
772 } catch(std::exception &exception) {
773 emit throwException(QString("oms__rename failed. %1").arg(exception.what()));
774 }
775
776 QString responseLog;
777 responseLog.append(QString::number(result));
778 emit logResponse("oms__rename("+commandLog+")", responseLog, &commandTime);
779
780 return result;
781}
782modelica_integer OMCInterface::oms_removeSignalsFromResults(QString cref, QString regex)
783{
784 QTime commandTime;
785 commandTime.start();
786 QString commandLog;
787 commandLog.append("\"" + cref + "\"");
788 commandLog.append(",");
789 commandLog.append("\"" + regex + "\"");
790 emit logCommand("oms__removeSignalsFromResults("+commandLog+")", &commandTime);
791
792 QByteArray cref_utf8 = cref.toUtf8();
793 QByteArray regex_utf8 = regex.toUtf8();
794 modelica_integer result;
795
796 try {
797 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
798
799 result = omc_OpenModelicaScriptingAPI_oms__removeSignalsFromResults(threadData, mmc_mk_scon(cref_utf8.constData()), mmc_mk_scon(regex_utf8.constData()));
800
801 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
802 } catch(std::exception &exception) {
803 emit throwException(QString("oms__removeSignalsFromResults failed. %1").arg(exception.what()));
804 }
805
806 QString responseLog;
807 responseLog.append(QString::number(result));
808 emit logResponse("oms__removeSignalsFromResults("+commandLog+")", responseLog, &commandTime);
809
810 return result;
811}
812OMCInterface::oms_parseModelName_res OMCInterface::oms_parseModelName(QString contents)
813{
814 QTime commandTime;
815 commandTime.start();
816 QString commandLog;
817 commandLog.append("\"" + contents + "\"");
818 emit logCommand("oms__parseModelName("+commandLog+")", &commandTime);
819
820 QByteArray contents_utf8 = contents.toUtf8();
821 oms_parseModelName_res result;
822 void *out1_mm = NULL__null;
823
824 try {
825 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
826
827 out1_mm = omc_OpenModelicaScriptingAPI_oms__parseModelName(threadData, mmc_mk_scon(contents_utf8.constData()), &result.status);
828 result.cref = QString::fromUtf8(MMC_STRINGDATA(out1_mm)(((struct mmc_string*)((void*)((char*)(out1_mm) - 3)))->data
)
);
829
830 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
831 } catch(std::exception &exception) {
832 emit throwException(QString("oms__parseModelName failed. %1").arg(exception.what()));
833 }
834
835 QString responseLog;
836 responseLog.append(result.toString());
837 emit logResponse("oms__parseModelName("+commandLog+")", responseLog, &commandTime);
838
839 return result;
840}
841modelica_integer OMCInterface::oms_newModel(QString cref)
842{
843 QTime commandTime;
844 commandTime.start();
845 QString commandLog;
846 commandLog.append("\"" + cref + "\"");
847 emit logCommand("oms__newModel("+commandLog+")", &commandTime);
848
849 QByteArray cref_utf8 = cref.toUtf8();
850 modelica_integer result;
851
852 try {
853 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
854
855 result = omc_OpenModelicaScriptingAPI_oms__newModel(threadData, mmc_mk_scon(cref_utf8.constData()));
856
857 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
858 } catch(std::exception &exception) {
859 emit throwException(QString("oms__newModel failed. %1").arg(exception.what()));
860 }
861
862 QString responseLog;
863 responseLog.append(QString::number(result));
864 emit logResponse("oms__newModel("+commandLog+")", responseLog, &commandTime);
865
866 return result;
867}
868modelica_integer OMCInterface::oms_loadSnapshot(QString cref, QString snapshot)
869{
870 QTime commandTime;
871 commandTime.start();
872 QString commandLog;
873 commandLog.append("\"" + cref + "\"");
874 commandLog.append(",");
875 commandLog.append("\"" + snapshot + "\"");
876 emit logCommand("oms__loadSnapshot("+commandLog+")", &commandTime);
877
878 QByteArray cref_utf8 = cref.toUtf8();
879 QByteArray snapshot_utf8 = snapshot.toUtf8();
880 modelica_integer result;
881
882 try {
883 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
884
885 result = omc_OpenModelicaScriptingAPI_oms__loadSnapshot(threadData, mmc_mk_scon(cref_utf8.constData()), mmc_mk_scon(snapshot_utf8.constData()));
886
887 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
888 } catch(std::exception &exception) {
889 emit throwException(QString("oms__loadSnapshot failed. %1").arg(exception.what()));
890 }
891
892 QString responseLog;
893 responseLog.append(QString::number(result));
894 emit logResponse("oms__loadSnapshot("+commandLog+")", responseLog, &commandTime);
895
896 return result;
897}
898OMCInterface::oms_listUnconnectedConnectors_res OMCInterface::oms_listUnconnectedConnectors(QString cref)
899{
900 QTime commandTime;
901 commandTime.start();
902 QString commandLog;
903 commandLog.append("\"" + cref + "\"");
904 emit logCommand("oms__listUnconnectedConnectors("+commandLog+")", &commandTime);
905
906 QByteArray cref_utf8 = cref.toUtf8();
907 oms_listUnconnectedConnectors_res result;
908 void *out1_mm = NULL__null;
909
910 try {
911 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
912
913 out1_mm = omc_OpenModelicaScriptingAPI_oms__listUnconnectedConnectors(threadData, mmc_mk_scon(cref_utf8.constData()), &result.status);
914 result.contents = QString::fromUtf8(MMC_STRINGDATA(out1_mm)(((struct mmc_string*)((void*)((char*)(out1_mm) - 3)))->data
)
);
915
916 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
917 } catch(std::exception &exception) {
918 emit throwException(QString("oms__listUnconnectedConnectors failed. %1").arg(exception.what()));
919 }
920
921 QString responseLog;
922 responseLog.append(result.toString());
923 emit logResponse("oms__listUnconnectedConnectors("+commandLog+")", responseLog, &commandTime);
924
925 return result;
926}
927OMCInterface::oms_list_res OMCInterface::oms_list(QString cref)
928{
929 QTime commandTime;
930 commandTime.start();
931 QString commandLog;
932 commandLog.append("\"" + cref + "\"");
933 emit logCommand("oms__list("+commandLog+")", &commandTime);
934
935 QByteArray cref_utf8 = cref.toUtf8();
936 oms_list_res result;
937 void *out1_mm = NULL__null;
938
939 try {
940 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
941
942 out1_mm = omc_OpenModelicaScriptingAPI_oms__list(threadData, mmc_mk_scon(cref_utf8.constData()), &result.status);
943 result.contents = QString::fromUtf8(MMC_STRINGDATA(out1_mm)(((struct mmc_string*)((void*)((char*)(out1_mm) - 3)))->data
)
);
944
945 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
946 } catch(std::exception &exception) {
947 emit throwException(QString("oms__list failed. %1").arg(exception.what()));
948 }
949
950 QString responseLog;
951 responseLog.append(result.toString());
952 emit logResponse("oms__list("+commandLog+")", responseLog, &commandTime);
953
954 return result;
955}
956modelica_integer OMCInterface::oms_instantiate(QString cref)
957{
958 QTime commandTime;
959 commandTime.start();
960 QString commandLog;
961 commandLog.append("\"" + cref + "\"");
962 emit logCommand("oms__instantiate("+commandLog+")", &commandTime);
963
964 QByteArray cref_utf8 = cref.toUtf8();
965 modelica_integer result;
966
967 try {
968 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
969
970 result = omc_OpenModelicaScriptingAPI_oms__instantiate(threadData, mmc_mk_scon(cref_utf8.constData()));
971
972 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
973 } catch(std::exception &exception) {
974 emit throwException(QString("oms__instantiate failed. %1").arg(exception.what()));
975 }
976
977 QString responseLog;
978 responseLog.append(QString::number(result));
979 emit logResponse("oms__instantiate("+commandLog+")", responseLog, &commandTime);
980
981 return result;
982}
983modelica_integer OMCInterface::oms_initialize(QString cref)
984{
985 QTime commandTime;
986 commandTime.start();
987 QString commandLog;
988 commandLog.append("\"" + cref + "\"");
989 emit logCommand("oms__initialize("+commandLog+")", &commandTime);
990
991 QByteArray cref_utf8 = cref.toUtf8();
992 modelica_integer result;
993
994 try {
995 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
996
997 result = omc_OpenModelicaScriptingAPI_oms__initialize(threadData, mmc_mk_scon(cref_utf8.constData()));
998
999 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
1000 } catch(std::exception &exception) {
1001 emit throwException(QString("oms__initialize failed. %1").arg(exception.what()));
1002 }
1003
1004 QString responseLog;
1005 responseLog.append(QString::number(result));
1006 emit logResponse("oms__initialize("+commandLog+")", responseLog, &commandTime);
1007
1008 return result;
1009}
1010OMCInterface::oms_importFile_res OMCInterface::oms_importFile(QString filename)
1011{
1012 QTime commandTime;
1013 commandTime.start();
1014 QString commandLog;
1015 commandLog.append("\"" + filename + "\"");
1016 emit logCommand("oms__importFile("+commandLog+")", &commandTime);
1017
1018 QByteArray filename_utf8 = filename.toUtf8();
1019 oms_importFile_res result;
1020 void *out1_mm = NULL__null;
1021
1022 try {
1023 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
1024
1025 out1_mm = omc_OpenModelicaScriptingAPI_oms__importFile(threadData, mmc_mk_scon(filename_utf8.constData()), &result.status);
1026 result.cref = QString::fromUtf8(MMC_STRINGDATA(out1_mm)(((struct mmc_string*)((void*)((char*)(out1_mm) - 3)))->data
)
);
1027
1028 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
1029 } catch(std::exception &exception) {
1030 emit throwException(QString("oms__importFile failed. %1").arg(exception.what()));
1031 }
1032
1033 QString responseLog;
1034 responseLog.append(result.toString());
1035 emit logResponse("oms__importFile("+commandLog+")", responseLog, &commandTime);
1036
1037 return result;
1038}
1039OMCInterface::oms_getVariableStepSize_res OMCInterface::oms_getVariableStepSize(QString cref)
1040{
1041 QTime commandTime;
1042 commandTime.start();
1043 QString commandLog;
1044 commandLog.append("\"" + cref + "\"");
1045 emit logCommand("oms__getVariableStepSize("+commandLog+")", &commandTime);
1046
1047 QByteArray cref_utf8 = cref.toUtf8();
1048 oms_getVariableStepSize_res result;
1049
1050 try {
1051 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
1052
1053 result.initialStepSize = omc_OpenModelicaScriptingAPI_oms__getVariableStepSize(threadData, mmc_mk_scon(cref_utf8.constData()), &result.minimumStepSize, &result.maximumStepSize, &result.status);
1054
1055 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
1056 } catch(std::exception &exception) {
1057 emit throwException(QString("oms__getVariableStepSize failed. %1").arg(exception.what()));
1058 }
1059
1060 QString responseLog;
1061 responseLog.append(result.toString());
1062 emit logResponse("oms__getVariableStepSize("+commandLog+")", responseLog, &commandTime);
1063
1064 return result;
1065}
1066OMCInterface::oms_getTolerance_res OMCInterface::oms_getTolerance(QString cref)
1067{
1068 QTime commandTime;
1069 commandTime.start();
1070 QString commandLog;
1071 commandLog.append("\"" + cref + "\"");
1072 emit logCommand("oms__getTolerance("+commandLog+")", &commandTime);
1073
1074 QByteArray cref_utf8 = cref.toUtf8();
1075 oms_getTolerance_res result;
1076
1077 try {
1078 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
1079
1080 result.absoluteTolerance = omc_OpenModelicaScriptingAPI_oms__getTolerance(threadData, mmc_mk_scon(cref_utf8.constData()), &result.relativeTolerance, &result.status);
1081
1082 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
1083 } catch(std::exception &exception) {
1084 emit throwException(QString("oms__getTolerance failed. %1").arg(exception.what()));
1085 }
1086
1087 QString responseLog;
1088 responseLog.append(result.toString());
1089 emit logResponse("oms__getTolerance("+commandLog+")", responseLog, &commandTime);
1090
1091 return result;
1092}
1093OMCInterface::oms_getSystemType_res OMCInterface::oms_getSystemType(QString cref)
1094{
1095 QTime commandTime;
1096 commandTime.start();
1097 QString commandLog;
1098 commandLog.append("\"" + cref + "\"");
1099 emit logCommand("oms__getSystemType("+commandLog+")", &commandTime);
1100
1101 QByteArray cref_utf8 = cref.toUtf8();
1102 oms_getSystemType_res result;
1103
1104 try {
1105 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
1106
1107 result.type_ = omc_OpenModelicaScriptingAPI_oms__getSystemType(threadData, mmc_mk_scon(cref_utf8.constData()), &result.status);
1108
1109 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
1110 } catch(std::exception &exception) {
1111 emit throwException(QString("oms__getSystemType failed. %1").arg(exception.what()));
1112 }
1113
1114 QString responseLog;
1115 responseLog.append(result.toString());
1116 emit logResponse("oms__getSystemType("+commandLog+")", responseLog, &commandTime);
1117
1118 return result;
1119}
1120OMCInterface::oms_getSubModelPath_res OMCInterface::oms_getSubModelPath(QString cref)
1121{
1122 QTime commandTime;
1123 commandTime.start();
1124 QString commandLog;
1125 commandLog.append("\"" + cref + "\"");
1126 emit logCommand("oms__getSubModelPath("+commandLog+")", &commandTime);
1127
1128 QByteArray cref_utf8 = cref.toUtf8();
1129 oms_getSubModelPath_res result;
1130 void *out1_mm = NULL__null;
1131
1132 try {
1133 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
1134
1135 out1_mm = omc_OpenModelicaScriptingAPI_oms__getSubModelPath(threadData, mmc_mk_scon(cref_utf8.constData()), &result.status);
1136 result.path = QString::fromUtf8(MMC_STRINGDATA(out1_mm)(((struct mmc_string*)((void*)((char*)(out1_mm) - 3)))->data
)
);
1137
1138 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
1139 } catch(std::exception &exception) {
1140 emit throwException(QString("oms__getSubModelPath failed. %1").arg(exception.what()));
1141 }
1142
1143 QString responseLog;
1144 responseLog.append(result.toString());
1145 emit logResponse("oms__getSubModelPath("+commandLog+")", responseLog, &commandTime);
1146
1147 return result;
1148}
1149OMCInterface::oms_getStopTime_res OMCInterface::oms_getStopTime(QString cref)
1150{
1151 QTime commandTime;
1152 commandTime.start();
1153 QString commandLog;
1154 commandLog.append("\"" + cref + "\"");
1155 emit logCommand("oms__getStopTime("+commandLog+")", &commandTime);
1156
1157 QByteArray cref_utf8 = cref.toUtf8();
1158 oms_getStopTime_res result;
1159
1160 try {
1161 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
1162
1163 result.stopTime = omc_OpenModelicaScriptingAPI_oms__getStopTime(threadData, mmc_mk_scon(cref_utf8.constData()), &result.status);
1164
1165 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
1166 } catch(std::exception &exception) {
1167 emit throwException(QString("oms__getStopTime failed. %1").arg(exception.what()));
1168 }
1169
1170 QString responseLog;
1171 responseLog.append(result.toString());
1172 emit logResponse("oms__getStopTime("+commandLog+")", responseLog, &commandTime);
1173
1174 return result;
1175}
1176OMCInterface::oms_getStartTime_res OMCInterface::oms_getStartTime(QString cref)
1177{
1178 QTime commandTime;
1179 commandTime.start();
1180 QString commandLog;
1181 commandLog.append("\"" + cref + "\"");
1182 emit logCommand("oms__getStartTime("+commandLog+")", &commandTime);
1183
1184 QByteArray cref_utf8 = cref.toUtf8();
1185 oms_getStartTime_res result;
1186
1187 try {
1188 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
1189
1190 result.startTime = omc_OpenModelicaScriptingAPI_oms__getStartTime(threadData, mmc_mk_scon(cref_utf8.constData()), &result.status);
1191
1192 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
1193 } catch(std::exception &exception) {
1194 emit throwException(QString("oms__getStartTime failed. %1").arg(exception.what()));
1195 }
1196
1197 QString responseLog;
1198 responseLog.append(result.toString());
1199 emit logResponse("oms__getStartTime("+commandLog+")", responseLog, &commandTime);
1200
1201 return result;
1202}
1203OMCInterface::oms_getSolver_res OMCInterface::oms_getSolver(QString cref)
1204{
1205 QTime commandTime;
1206 commandTime.start();
1207 QString commandLog;
1208 commandLog.append("\"" + cref + "\"");
1209 emit logCommand("oms__getSolver("+commandLog+")", &commandTime);
1210
1211 QByteArray cref_utf8 = cref.toUtf8();
1212 oms_getSolver_res result;
1213
1214 try {
1215 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
1216
1217 result.solver = omc_OpenModelicaScriptingAPI_oms__getSolver(threadData, mmc_mk_scon(cref_utf8.constData()), &result.status);
1218
1219 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
1220 } catch(std::exception &exception) {
1221 emit throwException(QString("oms__getSolver failed. %1").arg(exception.what()));
1222 }
1223
1224 QString responseLog;
1225 responseLog.append(result.toString());
1226 emit logResponse("oms__getSolver("+commandLog+")", responseLog, &commandTime);
1227
1228 return result;
1229}
1230OMCInterface::oms_getReal_res OMCInterface::oms_getReal(QString cref)
1231{
1232 QTime commandTime;
1233 commandTime.start();
1234 QString commandLog;
1235 commandLog.append("\"" + cref + "\"");
1236 emit logCommand("oms__getReal("+commandLog+")", &commandTime);
1237
1238 QByteArray cref_utf8 = cref.toUtf8();
1239 oms_getReal_res result;
1240
1241 try {
1242 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
1243
1244 result.value = omc_OpenModelicaScriptingAPI_oms__getReal(threadData, mmc_mk_scon(cref_utf8.constData()), &result.status);
1245
1246 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
1247 } catch(std::exception &exception) {
1248 emit throwException(QString("oms__getReal failed. %1").arg(exception.what()));
1249 }
1250
1251 QString responseLog;
1252 responseLog.append(result.toString());
1253 emit logResponse("oms__getReal("+commandLog+")", responseLog, &commandTime);
1254
1255 return result;
1256}
1257OMCInterface::oms_getModelState_res OMCInterface::oms_getModelState(QString cref)
1258{
1259 QTime commandTime;
1260 commandTime.start();
1261 QString commandLog;
1262 commandLog.append("\"" + cref + "\"");
1263 emit logCommand("oms__getModelState("+commandLog+")", &commandTime);
1264
1265 QByteArray cref_utf8 = cref.toUtf8();
1266 oms_getModelState_res result;
1267
1268 try {
1269 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
1270
1271 result.modelState = omc_OpenModelicaScriptingAPI_oms__getModelState(threadData, mmc_mk_scon(cref_utf8.constData()), &result.status);
1272
1273 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
1274 } catch(std::exception &exception) {
1275 emit throwException(QString("oms__getModelState failed. %1").arg(exception.what()));
1276 }
1277
1278 QString responseLog;
1279 responseLog.append(result.toString());
1280 emit logResponse("oms__getModelState("+commandLog+")", responseLog, &commandTime);
1281
1282 return result;
1283}
1284modelica_integer OMCInterface::oms_getInteger(QString cref, modelica_integer value)
1285{
1286 QTime commandTime;
1287 commandTime.start();
1288 QString commandLog;
1289 commandLog.append("\"" + cref + "\"");
1290 commandLog.append(",");
1291 commandLog.append(QString::number(value));
1292 emit logCommand("oms__getInteger("+commandLog+")", &commandTime);
1293
1294 QByteArray cref_utf8 = cref.toUtf8();
1295 modelica_integer result;
1296
1297 try {
1298 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
1299
1300 result = omc_OpenModelicaScriptingAPI_oms__getInteger(threadData, mmc_mk_scon(cref_utf8.constData()), value);
1301
1302 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
1303 } catch(std::exception &exception) {
1304 emit throwException(QString("oms__getInteger failed. %1").arg(exception.what()));
1305 }
1306
1307 QString responseLog;
1308 responseLog.append(QString::number(result));
1309 emit logResponse("oms__getInteger("+commandLog+")", responseLog, &commandTime);
1310
1311 return result;
1312}
1313OMCInterface::oms_getFixedStepSize_res OMCInterface::oms_getFixedStepSize(QString cref)
1314{
1315 QTime commandTime;
1316 commandTime.start();
1317 QString commandLog;
1318 commandLog.append("\"" + cref + "\"");
1319 emit logCommand("oms__getFixedStepSize("+commandLog+")", &commandTime);
1320
1321 QByteArray cref_utf8 = cref.toUtf8();
1322 oms_getFixedStepSize_res result;
1323
1324 try {
1325 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
1326
1327 result.stepSize = omc_OpenModelicaScriptingAPI_oms__getFixedStepSize(threadData, mmc_mk_scon(cref_utf8.constData()), &result.status);
1328
1329 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
1330 } catch(std::exception &exception) {
1331 emit throwException(QString("oms__getFixedStepSize failed. %1").arg(exception.what()));
1332 }
1333
1334 QString responseLog;
1335 responseLog.append(result.toString());
1336 emit logResponse("oms__getFixedStepSize("+commandLog+")", responseLog, &commandTime);
1337
1338 return result;
1339}
1340OMCInterface::oms_getBoolean_res OMCInterface::oms_getBoolean(QString cref)
1341{
1342 QTime commandTime;
1343 commandTime.start();
1344 QString commandLog;
1345 commandLog.append("\"" + cref + "\"");
1346 emit logCommand("oms__getBoolean("+commandLog+")", &commandTime);
1347
1348 QByteArray cref_utf8 = cref.toUtf8();
1349 oms_getBoolean_res result;
1350
1351 try {
1352 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
1353
1354 result.value = omc_OpenModelicaScriptingAPI_oms__getBoolean(threadData, mmc_mk_scon(cref_utf8.constData()), &result.status);
1355
1356 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
1357 } catch(std::exception &exception) {
1358 emit throwException(QString("oms__getBoolean failed. %1").arg(exception.what()));
1359 }
1360
1361 QString responseLog;
1362 responseLog.append(result.toString());
1363 emit logResponse("oms__getBoolean("+commandLog+")", responseLog, &commandTime);
1364
1365 return result;
1366}
1367OMCInterface::oms_extractFMIKind_res OMCInterface::oms_extractFMIKind(QString filename)
1368{
1369 QTime commandTime;
1370 commandTime.start();
1371 QString commandLog;
1372 commandLog.append("\"" + filename + "\"");
1373 emit logCommand("oms__extractFMIKind("+commandLog+")", &commandTime);
1374
1375 QByteArray filename_utf8 = filename.toUtf8();
1376 oms_extractFMIKind_res result;
1377
1378 try {
1379 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
1380
1381 result.kind = omc_OpenModelicaScriptingAPI_oms__extractFMIKind(threadData, mmc_mk_scon(filename_utf8.constData()), &result.status);
1382
1383 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
1384 } catch(std::exception &exception) {
1385 emit throwException(QString("oms__extractFMIKind failed. %1").arg(exception.what()));
1386 }
1387
1388 QString responseLog;
1389 responseLog.append(result.toString());
1390 emit logResponse("oms__extractFMIKind("+commandLog+")", responseLog, &commandTime);
1391
1392 return result;
1393}
1394modelica_integer OMCInterface::oms_exportDependencyGraphs(QString cref, QString initialization, QString simulation)
1395{
1396 QTime commandTime;
1397 commandTime.start();
1398 QString commandLog;
1399 commandLog.append("\"" + cref + "\"");
1400 commandLog.append(",");
1401 commandLog.append("\"" + initialization + "\"");
1402 commandLog.append(",");
1403 commandLog.append("\"" + simulation + "\"");
1404 emit logCommand("oms__exportDependencyGraphs("+commandLog+")", &commandTime);
1405
1406 QByteArray cref_utf8 = cref.toUtf8();
1407 QByteArray initialization_utf8 = initialization.toUtf8();
1408 QByteArray simulation_utf8 = simulation.toUtf8();
1409 modelica_integer result;
1410
1411 try {
1412 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
1413
1414 result = omc_OpenModelicaScriptingAPI_oms__exportDependencyGraphs(threadData, mmc_mk_scon(cref_utf8.constData()), mmc_mk_scon(initialization_utf8.constData()), mmc_mk_scon(simulation_utf8.constData()));
1415
1416 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
1417 } catch(std::exception &exception) {
1418 emit throwException(QString("oms__exportDependencyGraphs failed. %1").arg(exception.what()));
1419 }
1420
1421 QString responseLog;
1422 responseLog.append(QString::number(result));
1423 emit logResponse("oms__exportDependencyGraphs("+commandLog+")", responseLog, &commandTime);
1424
1425 return result;
1426}
1427modelica_integer OMCInterface::oms_export(QString cref, QString filename)
1428{
1429 QTime commandTime;
1430 commandTime.start();
1431 QString commandLog;
1432 commandLog.append("\"" + cref + "\"");
1433 commandLog.append(",");
1434 commandLog.append("\"" + filename + "\"");
1435 emit logCommand("oms__export("+commandLog+")", &commandTime);
1436
1437 QByteArray cref_utf8 = cref.toUtf8();
1438 QByteArray filename_utf8 = filename.toUtf8();
1439 modelica_integer result;
1440
1441 try {
1442 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
1443
1444 result = omc_OpenModelicaScriptingAPI_oms__export(threadData, mmc_mk_scon(cref_utf8.constData()), mmc_mk_scon(filename_utf8.constData()));
1445
1446 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
1447 } catch(std::exception &exception) {
1448 emit throwException(QString("oms__export failed. %1").arg(exception.what()));
1449 }
1450
1451 QString responseLog;
1452 responseLog.append(QString::number(result));
1453 emit logResponse("oms__export("+commandLog+")", responseLog, &commandTime);
1454
1455 return result;
1456}
1457modelica_integer OMCInterface::oms_deleteConnectorFromTLMBus(QString busCref, QString connectorCref)
1458{
1459 QTime commandTime;
1460 commandTime.start();
1461 QString commandLog;
1462 commandLog.append("\"" + busCref + "\"");
1463 commandLog.append(",");
1464 commandLog.append("\"" + connectorCref + "\"");
1465 emit logCommand("oms__deleteConnectorFromTLMBus("+commandLog+")", &commandTime);
1466
1467 QByteArray busCref_utf8 = busCref.toUtf8();
1468 QByteArray connectorCref_utf8 = connectorCref.toUtf8();
1469 modelica_integer result;
1470
1471 try {
1472 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
1473
1474 result = omc_OpenModelicaScriptingAPI_oms__deleteConnectorFromTLMBus(threadData, mmc_mk_scon(busCref_utf8.constData()), mmc_mk_scon(connectorCref_utf8.constData()));
1475
1476 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
1477 } catch(std::exception &exception) {
1478 emit throwException(QString("oms__deleteConnectorFromTLMBus failed. %1").arg(exception.what()));
1479 }
1480
1481 QString responseLog;
1482 responseLog.append(QString::number(result));
1483 emit logResponse("oms__deleteConnectorFromTLMBus("+commandLog+")", responseLog, &commandTime);
1484
1485 return result;
1486}
1487modelica_integer OMCInterface::oms_deleteConnectorFromBus(QString busCref, QString connectorCref)
1488{
1489 QTime commandTime;
1490 commandTime.start();
1491 QString commandLog;
1492 commandLog.append("\"" + busCref + "\"");
1493 commandLog.append(",");
1494 commandLog.append("\"" + connectorCref + "\"");
1495 emit logCommand("oms__deleteConnectorFromBus("+commandLog+")", &commandTime);
1496
1497 QByteArray busCref_utf8 = busCref.toUtf8();
1498 QByteArray connectorCref_utf8 = connectorCref.toUtf8();
1499 modelica_integer result;
1500
1501 try {
1502 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
1503
1504 result = omc_OpenModelicaScriptingAPI_oms__deleteConnectorFromBus(threadData, mmc_mk_scon(busCref_utf8.constData()), mmc_mk_scon(connectorCref_utf8.constData()));
1505
1506 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
1507 } catch(std::exception &exception) {
1508 emit throwException(QString("oms__deleteConnectorFromBus failed. %1").arg(exception.what()));
1509 }
1510
1511 QString responseLog;
1512 responseLog.append(QString::number(result));
1513 emit logResponse("oms__deleteConnectorFromBus("+commandLog+")", responseLog, &commandTime);
1514
1515 return result;
1516}
1517modelica_integer OMCInterface::oms_deleteConnection(QString crefA, QString crefB)
1518{
1519 QTime commandTime;
1520 commandTime.start();
1521 QString commandLog;
1522 commandLog.append("\"" + crefA + "\"");
1523 commandLog.append(",");
1524 commandLog.append("\"" + crefB + "\"");
1525 emit logCommand("oms__deleteConnection("+commandLog+")", &commandTime);
1526
1527 QByteArray crefA_utf8 = crefA.toUtf8();
1528 QByteArray crefB_utf8 = crefB.toUtf8();
1529 modelica_integer result;
1530
1531 try {
1532 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
1533
1534 result = omc_OpenModelicaScriptingAPI_oms__deleteConnection(threadData, mmc_mk_scon(crefA_utf8.constData()), mmc_mk_scon(crefB_utf8.constData()));
1535
1536 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
1537 } catch(std::exception &exception) {
1538 emit throwException(QString("oms__deleteConnection failed. %1").arg(exception.what()));
1539 }
1540
1541 QString responseLog;
1542 responseLog.append(QString::number(result));
1543 emit logResponse("oms__deleteConnection("+commandLog+")", responseLog, &commandTime);
1544
1545 return result;
1546}
1547modelica_integer OMCInterface::oms_delete(QString cref)
1548{
1549 QTime commandTime;
1550 commandTime.start();
1551 QString commandLog;
1552 commandLog.append("\"" + cref + "\"");
1553 emit logCommand("oms__delete("+commandLog+")", &commandTime);
1554
1555 QByteArray cref_utf8 = cref.toUtf8();
1556 modelica_integer result;
1557
1558 try {
1559 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
1560
1561 result = omc_OpenModelicaScriptingAPI_oms__delete(threadData, mmc_mk_scon(cref_utf8.constData()));
1562
1563 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
1564 } catch(std::exception &exception) {
1565 emit throwException(QString("oms__delete failed. %1").arg(exception.what()));
1566 }
1567
1568 QString responseLog;
1569 responseLog.append(QString::number(result));
1570 emit logResponse("oms__delete("+commandLog+")", responseLog, &commandTime);
1571
1572 return result;
1573}
1574modelica_integer OMCInterface::oms_copySystem(QString source, QString target)
1575{
1576 QTime commandTime;
1577 commandTime.start();
1578 QString commandLog;
1579 commandLog.append("\"" + source + "\"");
1580 commandLog.append(",");
1581 commandLog.append("\"" + target + "\"");
1582 emit logCommand("oms__copySystem("+commandLog+")", &commandTime);
1583
1584 QByteArray source_utf8 = source.toUtf8();
1585 QByteArray target_utf8 = target.toUtf8();
1586 modelica_integer result;
1587
1588 try {
1589 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
1590
1591 result = omc_OpenModelicaScriptingAPI_oms__copySystem(threadData, mmc_mk_scon(source_utf8.constData()), mmc_mk_scon(target_utf8.constData()));
1592
1593 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
1594 } catch(std::exception &exception) {
1595 emit throwException(QString("oms__copySystem failed. %1").arg(exception.what()));
1596 }
1597
1598 QString responseLog;
1599 responseLog.append(QString::number(result));
1600 emit logResponse("oms__copySystem("+commandLog+")", responseLog, &commandTime);
1601
1602 return result;
1603}
1604modelica_integer OMCInterface::oms_compareSimulationResults(QString filenameA, QString filenameB, QString var, modelica_real relTol, modelica_real absTol)
1605{
1606 QTime commandTime;
1607 commandTime.start();
1608 QString commandLog;
1609 commandLog.append("\"" + filenameA + "\"");
1610 commandLog.append(",");
1611 commandLog.append("\"" + filenameB + "\"");
1612 commandLog.append(",");
1613 commandLog.append("\"" + var + "\"");
1614 commandLog.append(",");
1615 commandLog.append(QString::number(relTol));
1616 commandLog.append(",");
1617 commandLog.append(QString::number(absTol));
1618 emit logCommand("oms__compareSimulationResults("+commandLog+")", &commandTime);
1619
1620 QByteArray filenameA_utf8 = filenameA.toUtf8();
1621 QByteArray filenameB_utf8 = filenameB.toUtf8();
1622 QByteArray var_utf8 = var.toUtf8();
1623 modelica_integer result;
1624
1625 try {
1626 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
1627
1628 result = omc_OpenModelicaScriptingAPI_oms__compareSimulationResults(threadData, mmc_mk_scon(filenameA_utf8.constData()), mmc_mk_scon(filenameB_utf8.constData()), mmc_mk_scon(var_utf8.constData()), relTol, absTol);
1629
1630 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
1631 } catch(std::exception &exception) {
1632 emit throwException(QString("oms__compareSimulationResults failed. %1").arg(exception.what()));
1633 }
1634
1635 QString responseLog;
1636 responseLog.append(QString::number(result));
1637 emit logResponse("oms__compareSimulationResults("+commandLog+")", responseLog, &commandTime);
1638
1639 return result;
1640}
1641modelica_integer OMCInterface::oms_cancelSimulation_asynchronous(QString cref)
1642{
1643 QTime commandTime;
1644 commandTime.start();
1645 QString commandLog;
1646 commandLog.append("\"" + cref + "\"");
1647 emit logCommand("oms__cancelSimulation__asynchronous("+commandLog+")", &commandTime);
1648
1649 QByteArray cref_utf8 = cref.toUtf8();
1650 modelica_integer result;
1651
1652 try {
1653 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
1654
1655 result = omc_OpenModelicaScriptingAPI_oms__cancelSimulation__asynchronous(threadData, mmc_mk_scon(cref_utf8.constData()));
1656
1657 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
1658 } catch(std::exception &exception) {
1659 emit throwException(QString("oms__cancelSimulation__asynchronous failed. %1").arg(exception.what()));
1660 }
1661
1662 QString responseLog;
1663 responseLog.append(QString::number(result));
1664 emit logResponse("oms__cancelSimulation__asynchronous("+commandLog+")", responseLog, &commandTime);
1665
1666 return result;
1667}
1668modelica_integer OMCInterface::oms_addTLMConnection(QString crefA, QString crefB, modelica_real delay, modelica_real alpha, modelica_real linearimpedance, modelica_real angularimpedance)
1669{
1670 QTime commandTime;
1671 commandTime.start();
1672 QString commandLog;
1673 commandLog.append("\"" + crefA + "\"");
1674 commandLog.append(",");
1675 commandLog.append("\"" + crefB + "\"");
1676 commandLog.append(",");
1677 commandLog.append(QString::number(delay));
1678 commandLog.append(",");
1679 commandLog.append(QString::number(alpha));
1680 commandLog.append(",");
1681 commandLog.append(QString::number(linearimpedance));
1682 commandLog.append(",");
1683 commandLog.append(QString::number(angularimpedance));
1684 emit logCommand("oms__addTLMConnection("+commandLog+")", &commandTime);
1685
1686 QByteArray crefA_utf8 = crefA.toUtf8();
1687 QByteArray crefB_utf8 = crefB.toUtf8();
1688 modelica_integer result;
1689
1690 try {
1691 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
1692
1693 result = omc_OpenModelicaScriptingAPI_oms__addTLMConnection(threadData, mmc_mk_scon(crefA_utf8.constData()), mmc_mk_scon(crefB_utf8.constData()), delay, alpha, linearimpedance, angularimpedance);
1694
1695 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
1696 } catch(std::exception &exception) {
1697 emit throwException(QString("oms__addTLMConnection failed. %1").arg(exception.what()));
1698 }
1699
1700 QString responseLog;
1701 responseLog.append(QString::number(result));
1702 emit logResponse("oms__addTLMConnection("+commandLog+")", responseLog, &commandTime);
1703
1704 return result;
1705}
1706modelica_integer OMCInterface::oms_addTimeIndicator(QString signal)
1707{
1708 QTime commandTime;
1709 commandTime.start();
1710 QString commandLog;
1711 commandLog.append("\"" + signal + "\"");
1712 emit logCommand("oms__addTimeIndicator("+commandLog+")", &commandTime);
1713
1714 QByteArray signal_utf8 = signal.toUtf8();
1715 modelica_integer result;
1716
1717 try {
1718 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
1719
1720 result = omc_OpenModelicaScriptingAPI_oms__addTimeIndicator(threadData, mmc_mk_scon(signal_utf8.constData()));
1721
1722 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
1723 } catch(std::exception &exception) {
1724 emit throwException(QString("oms__addTimeIndicator failed. %1").arg(exception.what()));
1725 }
1726
1727 QString responseLog;
1728 responseLog.append(QString::number(result));
1729 emit logResponse("oms__addTimeIndicator("+commandLog+")", responseLog, &commandTime);
1730
1731 return result;
1732}
1733modelica_integer OMCInterface::oms_addSubModel(QString cref, QString fmuPath)
1734{
1735 QTime commandTime;
1736 commandTime.start();
1737 QString commandLog;
1738 commandLog.append("\"" + cref + "\"");
1739 commandLog.append(",");
1740 commandLog.append("\"" + fmuPath + "\"");
1741 emit logCommand("oms__addSubModel("+commandLog+")", &commandTime);
1742
1743 QByteArray cref_utf8 = cref.toUtf8();
1744 QByteArray fmuPath_utf8 = fmuPath.toUtf8();
1745 modelica_integer result;
1746
1747 try {
1748 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
1749
1750 result = omc_OpenModelicaScriptingAPI_oms__addSubModel(threadData, mmc_mk_scon(cref_utf8.constData()), mmc_mk_scon(fmuPath_utf8.constData()));
1751
1752 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
1753 } catch(std::exception &exception) {
1754 emit throwException(QString("oms__addSubModel failed. %1").arg(exception.what()));
1755 }
1756
1757 QString responseLog;
1758 responseLog.append(QString::number(result));
1759 emit logResponse("oms__addSubModel("+commandLog+")", responseLog, &commandTime);
1760
1761 return result;
1762}
1763modelica_integer OMCInterface::oms_addStaticValueIndicator(QString signal, modelica_real lower, modelica_real upper, modelica_real stepSize)
1764{
1765 QTime commandTime;
1766 commandTime.start();
1767 QString commandLog;
1768 commandLog.append("\"" + signal + "\"");
1769 commandLog.append(",");
1770 commandLog.append(QString::number(lower));
1771 commandLog.append(",");
1772 commandLog.append(QString::number(upper));
1773 commandLog.append(",");
1774 commandLog.append(QString::number(stepSize));
1775 emit logCommand("oms__addStaticValueIndicator("+commandLog+")", &commandTime);
1776
1777 QByteArray signal_utf8 = signal.toUtf8();
1778 modelica_integer result;
1779
1780 try {
1781 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
1782
1783 result = omc_OpenModelicaScriptingAPI_oms__addStaticValueIndicator(threadData, mmc_mk_scon(signal_utf8.constData()), lower, upper, stepSize);
1784
1785 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
1786 } catch(std::exception &exception) {
1787 emit throwException(QString("oms__addStaticValueIndicator failed. %1").arg(exception.what()));
1788 }
1789
1790 QString responseLog;
1791 responseLog.append(QString::number(result));
1792 emit logResponse("oms__addStaticValueIndicator("+commandLog+")", responseLog, &commandTime);
1793
1794 return result;
1795}
1796modelica_integer OMCInterface::oms_addSignalsToResults(QString cref, QString regex)
1797{
1798 QTime commandTime;
1799 commandTime.start();
1800 QString commandLog;
1801 commandLog.append("\"" + cref + "\"");
1802 commandLog.append(",");
1803 commandLog.append("\"" + regex + "\"");
1804 emit logCommand("oms__addSignalsToResults("+commandLog+")", &commandTime);
1805
1806 QByteArray cref_utf8 = cref.toUtf8();
1807 QByteArray regex_utf8 = regex.toUtf8();
1808 modelica_integer result;
1809
1810 try {
1811 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
1812
1813 result = omc_OpenModelicaScriptingAPI_oms__addSignalsToResults(threadData, mmc_mk_scon(cref_utf8.constData()), mmc_mk_scon(regex_utf8.constData()));
1814
1815 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
1816 } catch(std::exception &exception) {
1817 emit throwException(QString("oms__addSignalsToResults failed. %1").arg(exception.what()));
1818 }
1819
1820 QString responseLog;
1821 responseLog.append(QString::number(result));
1822 emit logResponse("oms__addSignalsToResults("+commandLog+")", responseLog, &commandTime);
1823
1824 return result;
1825}
1826modelica_integer OMCInterface::oms_addExternalModel(QString cref, QString path, QString startscript)
1827{
1828 QTime commandTime;
1829 commandTime.start();
1830 QString commandLog;
1831 commandLog.append("\"" + cref + "\"");
1832 commandLog.append(",");
1833 commandLog.append("\"" + path + "\"");
1834 commandLog.append(",");
1835 commandLog.append("\"" + startscript + "\"");
1836 emit logCommand("oms__addExternalModel("+commandLog+")", &commandTime);
1837
1838 QByteArray cref_utf8 = cref.toUtf8();
1839 QByteArray path_utf8 = path.toUtf8();
1840 QByteArray startscript_utf8 = startscript.toUtf8();
1841 modelica_integer result;
1842
1843 try {
1844 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
1845
1846 result = omc_OpenModelicaScriptingAPI_oms__addExternalModel(threadData, mmc_mk_scon(cref_utf8.constData()), mmc_mk_scon(path_utf8.constData()), mmc_mk_scon(startscript_utf8.constData()));
1847
1848 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
1849 } catch(std::exception &exception) {
1850 emit throwException(QString("oms__addExternalModel failed. %1").arg(exception.what()));
1851 }
1852
1853 QString responseLog;
1854 responseLog.append(QString::number(result));
1855 emit logResponse("oms__addExternalModel("+commandLog+")", responseLog, &commandTime);
1856
1857 return result;
1858}
1859modelica_integer OMCInterface::oms_addEventIndicator(QString signal)
1860{
1861 QTime commandTime;
1862 commandTime.start();
1863 QString commandLog;
1864 commandLog.append("\"" + signal + "\"");
1865 emit logCommand("oms__addEventIndicator("+commandLog+")", &commandTime);
1866
1867 QByteArray signal_utf8 = signal.toUtf8();
1868 modelica_integer result;
1869
1870 try {
1871 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
1872
1873 result = omc_OpenModelicaScriptingAPI_oms__addEventIndicator(threadData, mmc_mk_scon(signal_utf8.constData()));
1874
1875 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
1876 } catch(std::exception &exception) {
1877 emit throwException(QString("oms__addEventIndicator failed. %1").arg(exception.what()));
1878 }
1879
1880 QString responseLog;
1881 responseLog.append(QString::number(result));
1882 emit logResponse("oms__addEventIndicator("+commandLog+")", responseLog, &commandTime);
1883
1884 return result;
1885}
1886modelica_integer OMCInterface::oms_addDynamicValueIndicator(QString signal, QString lower, QString upper, modelica_real stepSize)
1887{
1888 QTime commandTime;
1889 commandTime.start();
1890 QString commandLog;
1891 commandLog.append("\"" + signal + "\"");
1892 commandLog.append(",");
1893 commandLog.append("\"" + lower + "\"");
1894 commandLog.append(",");
1895 commandLog.append("\"" + upper + "\"");
1896 commandLog.append(",");
1897 commandLog.append(QString::number(stepSize));
1898 emit logCommand("oms__addDynamicValueIndicator("+commandLog+")", &commandTime);
1899
1900 QByteArray signal_utf8 = signal.toUtf8();
1901 QByteArray lower_utf8 = lower.toUtf8();
1902 QByteArray upper_utf8 = upper.toUtf8();
1903 modelica_integer result;
1904
1905 try {
1906 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
1907
1908 result = omc_OpenModelicaScriptingAPI_oms__addDynamicValueIndicator(threadData, mmc_mk_scon(signal_utf8.constData()), mmc_mk_scon(lower_utf8.constData()), mmc_mk_scon(upper_utf8.constData()), stepSize);
1909
1910 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
1911 } catch(std::exception &exception) {
1912 emit throwException(QString("oms__addDynamicValueIndicator failed. %1").arg(exception.what()));
1913 }
1914
1915 QString responseLog;
1916 responseLog.append(QString::number(result));
1917 emit logResponse("oms__addDynamicValueIndicator("+commandLog+")", responseLog, &commandTime);
1918
1919 return result;
1920}
1921modelica_integer OMCInterface::oms_addConnectorToTLMBus(QString busCref, QString connectorCref, QString type_)
1922{
1923 QTime commandTime;
1924 commandTime.start();
1925 QString commandLog;
1926 commandLog.append("\"" + busCref + "\"");
1927 commandLog.append(",");
1928 commandLog.append("\"" + connectorCref + "\"");
1929 commandLog.append(",");
1930 commandLog.append("\"" + type_ + "\"");
1931 emit logCommand("oms__addConnectorToTLMBus("+commandLog+")", &commandTime);
1932
1933 QByteArray busCref_utf8 = busCref.toUtf8();
1934 QByteArray connectorCref_utf8 = connectorCref.toUtf8();
1935 QByteArray type__utf8 = type_.toUtf8();
1936 modelica_integer result;
1937
1938 try {
1939 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
1940
1941 result = omc_OpenModelicaScriptingAPI_oms__addConnectorToTLMBus(threadData, mmc_mk_scon(busCref_utf8.constData()), mmc_mk_scon(connectorCref_utf8.constData()), mmc_mk_scon(type__utf8.constData()));
1942
1943 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
1944 } catch(std::exception &exception) {
1945 emit throwException(QString("oms__addConnectorToTLMBus failed. %1").arg(exception.what()));
1946 }
1947
1948 QString responseLog;
1949 responseLog.append(QString::number(result));
1950 emit logResponse("oms__addConnectorToTLMBus("+commandLog+")", responseLog, &commandTime);
1951
1952 return result;
1953}
1954modelica_integer OMCInterface::oms_addConnectorToBus(QString busCref, QString connectorCref)
1955{
1956 QTime commandTime;
1957 commandTime.start();
1958 QString commandLog;
1959 commandLog.append("\"" + busCref + "\"");
1960 commandLog.append(",");
1961 commandLog.append("\"" + connectorCref + "\"");
1962 emit logCommand("oms__addConnectorToBus("+commandLog+")", &commandTime);
1963
1964 QByteArray busCref_utf8 = busCref.toUtf8();
1965 QByteArray connectorCref_utf8 = connectorCref.toUtf8();
1966 modelica_integer result;
1967
1968 try {
1969 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
1970
1971 result = omc_OpenModelicaScriptingAPI_oms__addConnectorToBus(threadData, mmc_mk_scon(busCref_utf8.constData()), mmc_mk_scon(connectorCref_utf8.constData()));
1972
1973 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
1974 } catch(std::exception &exception) {
1975 emit throwException(QString("oms__addConnectorToBus failed. %1").arg(exception.what()));
1976 }
1977
1978 QString responseLog;
1979 responseLog.append(QString::number(result));
1980 emit logResponse("oms__addConnectorToBus("+commandLog+")", responseLog, &commandTime);
1981
1982 return result;
1983}
1984modelica_integer OMCInterface::oms_addConnection(QString crefA, QString crefB)
1985{
1986 QTime commandTime;
1987 commandTime.start();
1988 QString commandLog;
1989 commandLog.append("\"" + crefA + "\"");
1990 commandLog.append(",");
1991 commandLog.append("\"" + crefB + "\"");
1992 emit logCommand("oms__addConnection("+commandLog+")", &commandTime);
1993
1994 QByteArray crefA_utf8 = crefA.toUtf8();
1995 QByteArray crefB_utf8 = crefB.toUtf8();
1996 modelica_integer result;
1997
1998 try {
1999 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
2000
2001 result = omc_OpenModelicaScriptingAPI_oms__addConnection(threadData, mmc_mk_scon(crefA_utf8.constData()), mmc_mk_scon(crefB_utf8.constData()));
2002
2003 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
2004 } catch(std::exception &exception) {
2005 emit throwException(QString("oms__addConnection failed. %1").arg(exception.what()));
2006 }
2007
2008 QString responseLog;
2009 responseLog.append(QString::number(result));
2010 emit logResponse("oms__addConnection("+commandLog+")", responseLog, &commandTime);
2011
2012 return result;
2013}
2014modelica_integer OMCInterface::oms_addBus(QString cref)
2015{
2016 QTime commandTime;
2017 commandTime.start();
2018 QString commandLog;
2019 commandLog.append("\"" + cref + "\"");
2020 emit logCommand("oms__addBus("+commandLog+")", &commandTime);
2021
2022 QByteArray cref_utf8 = cref.toUtf8();
2023 modelica_integer result;
2024
2025 try {
2026 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
2027
2028 result = omc_OpenModelicaScriptingAPI_oms__addBus(threadData, mmc_mk_scon(cref_utf8.constData()));
2029
2030 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
2031 } catch(std::exception &exception) {
2032 emit throwException(QString("oms__addBus failed. %1").arg(exception.what()));
2033 }
2034
2035 QString responseLog;
2036 responseLog.append(QString::number(result));
2037 emit logResponse("oms__addBus("+commandLog+")", responseLog, &commandTime);
2038
2039 return result;
2040}
2041modelica_integer OMCInterface::unloadOMSimulator()
2042{
2043 QTime commandTime;
2044 commandTime.start();
2045 emit logCommand("unloadOMSimulator()", &commandTime);
2046
2047 modelica_integer result;
2048
2049 try {
2050 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
2051
2052 result = omc_OpenModelicaScriptingAPI_unloadOMSimulator(threadData);
2053
2054 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
2055 } catch(std::exception &exception) {
2056 emit throwException(QString("unloadOMSimulator failed. %1").arg(exception.what()));
2057 }
2058
2059 QString responseLog;
2060 responseLog.append(QString::number(result));
2061 emit logResponse("unloadOMSimulator()", responseLog, &commandTime);
2062
2063 return result;
2064}
2065modelica_integer OMCInterface::loadOMSimulator()
2066{
2067 QTime commandTime;
2068 commandTime.start();
2069 emit logCommand("loadOMSimulator()", &commandTime);
2070
2071 modelica_integer result;
2072
2073 try {
2074 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
2075
2076 result = omc_OpenModelicaScriptingAPI_loadOMSimulator(threadData);
2077
2078 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
2079 } catch(std::exception &exception) {
2080 emit throwException(QString("loadOMSimulator failed. %1").arg(exception.what()));
2081 }
2082
2083 QString responseLog;
2084 responseLog.append(QString::number(result));
2085 emit logResponse("loadOMSimulator()", responseLog, &commandTime);
2086
2087 return result;
2088}
2089OMCInterface::generateScriptingAPI_res OMCInterface::generateScriptingAPI(QString cl, QString name)
2090{
2091 QTime commandTime;
2092 commandTime.start();
2093 QString commandLog;
2094 commandLog.append(cl);
2095 commandLog.append(",");
2096 commandLog.append("\"" + name + "\"");
2097 emit logCommand("generateScriptingAPI("+commandLog+")", &commandTime);
2098
2099 QByteArray cl_utf8 = cl.toUtf8();
2100 QByteArray name_utf8 = name.toUtf8();
2101 generateScriptingAPI_res result;
2102 void *out2_mm = NULL__null;
2103 void *out3_mm = NULL__null;
2104 void *out4_mm = NULL__null;
2105
2106 try {
2107 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
2108
2109 result.success = omc_OpenModelicaScriptingAPI_generateScriptingAPI(threadData, mmc_mk_scon(cl_utf8.constData()), mmc_mk_scon(name_utf8.constData()), &out2_mm, &out3_mm, &out4_mm);
2110 result.moFile = QString::fromUtf8(MMC_STRINGDATA(out2_mm)(((struct mmc_string*)((void*)((char*)(out2_mm) - 3)))->data
)
);
2111 result.qtFile = QString::fromUtf8(MMC_STRINGDATA(out3_mm)(((struct mmc_string*)((void*)((char*)(out3_mm) - 3)))->data
)
);
2112 result.qtHeader = QString::fromUtf8(MMC_STRINGDATA(out4_mm)(((struct mmc_string*)((void*)((char*)(out4_mm) - 3)))->data
)
);
2113
2114 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
2115 } catch(std::exception &exception) {
2116 emit throwException(QString("generateScriptingAPI failed. %1").arg(exception.what()));
2117 }
2118
2119 QString responseLog;
2120 responseLog.append(result.toString());
2121 emit logResponse("generateScriptingAPI("+commandLog+")", responseLog, &commandTime);
2122
2123 return result;
2124}
2125modelica_boolean OMCInterface::deleteInitialState(QString cl, QString state)
2126{
2127 QTime commandTime;
2128 commandTime.start();
2129 QString commandLog;
2130 commandLog.append(cl);
2131 commandLog.append(",");
2132 commandLog.append("\"" + state + "\"");
2133 emit logCommand("deleteInitialState("+commandLog+")", &commandTime);
2134
2135 QByteArray cl_utf8 = cl.toUtf8();
2136 QByteArray state_utf8 = state.toUtf8();
2137 modelica_boolean result;
2138
2139 try {
2140 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
2141
2142 result = omc_OpenModelicaScriptingAPI_deleteInitialState(threadData, mmc_mk_scon(cl_utf8.constData()), mmc_mk_scon(state_utf8.constData()));
2143
2144 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
2145 } catch(std::exception &exception) {
2146 emit throwException(QString("deleteInitialState failed. %1").arg(exception.what()));
2147 }
2148
2149 QString responseLog;
2150 responseLog.append(result ? "true" : "false");
2151 emit logResponse("deleteInitialState("+commandLog+")", responseLog, &commandTime);
2152
2153 return result;
2154}
2155QList<QList<QString > > OMCInterface::getInitialStates(QString cl)
2156{
2157 QTime commandTime;
2158 commandTime.start();
2159 QString commandLog;
2160 commandLog.append(cl);
2161 emit logCommand("getInitialStates("+commandLog+")", &commandTime);
2162
2163 QByteArray cl_utf8 = cl.toUtf8();
2164 QList<QList<QString > > result;
2165 void *result_mm = NULL__null;
2166
2167 try {
2168 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
2169
2170 result_mm = omc_OpenModelicaScriptingAPI_getInitialStates(threadData, mmc_mk_scon(cl_utf8.constData()));
2171 result.clear();
2172 while (!listEmpty(result_mm)((*(mmc_uint_t*)((void*)((char*)(result_mm) - 3))) == (((0) <<
10) + (((0) & 255) << 2)))
) {
2173 QList<QString > result_elt;
2174 result_elt.clear();
2175 while (!listEmpty(MMC_CAR(result_mm))((*(mmc_uint_t*)((void*)((char*)((*(void**)(((void*)((void**)
(((void*)((char*)(result_mm) - 3))) + (1)))))) - 3))) == (((0
) << 10) + (((0) & 255) << 2)))
) {
2176 QString result_elt_elt;
2177 result_elt_elt = MMC_STRINGDATA(MMC_CAR(MMC_CAR(result_mm)))(((struct mmc_string*)((void*)((char*)((*(void**)(((void*)((void
**)(((void*)((char*)((*(void**)(((void*)((void**)(((void*)((char
*)(result_mm) - 3))) + (1)))))) - 3))) + (1)))))) - 3)))->
data)
;
2178 result_elt.push_back(result_elt_elt);
2179 MMC_CAR(result_mm)(*(void**)(((void*)((void**)(((void*)((char*)(result_mm) - 3)
)) + (1)))))
= MMC_CDR(MMC_CAR(result_mm))(*(void**)(((void*)((void**)(((void*)((char*)((*(void**)(((void
*)((void**)(((void*)((char*)(result_mm) - 3))) + (1)))))) - 3
))) + (2)))))
;
2180 }
2181 result.push_back(result_elt);
2182 result_mm = MMC_CDR(result_mm)(*(void**)(((void*)((void**)(((void*)((char*)(result_mm) - 3)
)) + (2)))))
;
2183 }
2184
2185 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
2186 } catch(std::exception &exception) {
2187 emit throwException(QString("getInitialStates failed. %1").arg(exception.what()));
2188 }
2189
2190 QString responseLog;
2191 responseLog.append("{");
2192 int result_i = 0;
2193 foreach(QList<QString > result_elt, result)for (auto _container_ = QtPrivate::qMakeForeachContainer(result
); _container_.control && _container_.i != _container_
.e; ++_container_.i, _container_.control ^= 1) for (QList<
QString > result_elt = *_container_.i; _container_.control
; _container_.control = 0)
{
2194 if (result_i) {
2195 responseLog.append(",");
2196 }
2197 responseLog.append("{");
2198 int result_elt_i = 0;
2199 foreach(QString result_elt_elt, result_elt)for (auto _container_ = QtPrivate::qMakeForeachContainer(result_elt
); _container_.control && _container_.i != _container_
.e; ++_container_.i, _container_.control ^= 1) for (QString result_elt_elt
= *_container_.i; _container_.control; _container_.control =
0)
{
2200 if (result_elt_i) {
2201 responseLog.append(",");
2202 }
2203 responseLog.append("\"" + result_elt_elt + "\"");
2204 result_elt_i++;
2205 }
2206 responseLog.append("}");
2207 result_i++;
2208 }
2209 responseLog.append("}");
2210 emit logResponse("getInitialStates("+commandLog+")", responseLog, &commandTime);
2211
2212 return result;
2213}
2214modelica_boolean OMCInterface::deleteTransition(QString cl, QString from, QString to, QString condition, modelica_boolean immediate, modelica_boolean reset, modelica_boolean synchronize, modelica_integer priority)
2215{
2216 QTime commandTime;
2217 commandTime.start();
2218 QString commandLog;
2219 commandLog.append(cl);
2220 commandLog.append(",");
2221 commandLog.append("\"" + from + "\"");
2222 commandLog.append(",");
2223 commandLog.append("\"" + to + "\"");
2224 commandLog.append(",");
2225 commandLog.append("\"" + condition + "\"");
2226 commandLog.append(",");
2227 commandLog.append(immediate ? "true" : "false");
2228 commandLog.append(",");
2229 commandLog.append(reset ? "true" : "false");
2230 commandLog.append(",");
2231 commandLog.append(synchronize ? "true" : "false");
2232 commandLog.append(",");
2233 commandLog.append(QString::number(priority));
2234 emit logCommand("deleteTransition("+commandLog+")", &commandTime);
2235
2236 QByteArray cl_utf8 = cl.toUtf8();
2237 QByteArray from_utf8 = from.toUtf8();
2238 QByteArray to_utf8 = to.toUtf8();
2239 QByteArray condition_utf8 = condition.toUtf8();
2240 modelica_boolean result;
2241
2242 try {
2243 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
2244
2245 result = omc_OpenModelicaScriptingAPI_deleteTransition(threadData, mmc_mk_scon(cl_utf8.constData()), mmc_mk_scon(from_utf8.constData()), mmc_mk_scon(to_utf8.constData()), mmc_mk_scon(condition_utf8.constData()), immediate, reset, synchronize, priority);
2246
2247 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
2248 } catch(std::exception &exception) {
2249 emit throwException(QString("deleteTransition failed. %1").arg(exception.what()));
2250 }
2251
2252 QString responseLog;
2253 responseLog.append(result ? "true" : "false");
2254 emit logResponse("deleteTransition("+commandLog+")", responseLog, &commandTime);
2255
2256 return result;
2257}
2258QList<QList<QString > > OMCInterface::getTransitions(QString cl)
2259{
2260 QTime commandTime;
2261 commandTime.start();
2262 QString commandLog;
2263 commandLog.append(cl);
2264 emit logCommand("getTransitions("+commandLog+")", &commandTime);
2265
2266 QByteArray cl_utf8 = cl.toUtf8();
2267 QList<QList<QString > > result;
2268 void *result_mm = NULL__null;
2269
2270 try {
2271 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
2272
2273 result_mm = omc_OpenModelicaScriptingAPI_getTransitions(threadData, mmc_mk_scon(cl_utf8.constData()));
2274 result.clear();
2275 while (!listEmpty(result_mm)((*(mmc_uint_t*)((void*)((char*)(result_mm) - 3))) == (((0) <<
10) + (((0) & 255) << 2)))
) {
2276 QList<QString > result_elt;
2277 result_elt.clear();
2278 while (!listEmpty(MMC_CAR(result_mm))((*(mmc_uint_t*)((void*)((char*)((*(void**)(((void*)((void**)
(((void*)((char*)(result_mm) - 3))) + (1)))))) - 3))) == (((0
) << 10) + (((0) & 255) << 2)))
) {
2279 QString result_elt_elt;
2280 result_elt_elt = MMC_STRINGDATA(MMC_CAR(MMC_CAR(result_mm)))(((struct mmc_string*)((void*)((char*)((*(void**)(((void*)((void
**)(((void*)((char*)((*(void**)(((void*)((void**)(((void*)((char
*)(result_mm) - 3))) + (1)))))) - 3))) + (1)))))) - 3)))->
data)
;
2281 result_elt.push_back(result_elt_elt);
2282 MMC_CAR(result_mm)(*(void**)(((void*)((void**)(((void*)((char*)(result_mm) - 3)
)) + (1)))))
= MMC_CDR(MMC_CAR(result_mm))(*(void**)(((void*)((void**)(((void*)((char*)((*(void**)(((void
*)((void**)(((void*)((char*)(result_mm) - 3))) + (1)))))) - 3
))) + (2)))))
;
2283 }
2284 result.push_back(result_elt);
2285 result_mm = MMC_CDR(result_mm)(*(void**)(((void*)((void**)(((void*)((char*)(result_mm) - 3)
)) + (2)))))
;
2286 }
2287
2288 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
2289 } catch(std::exception &exception) {
2290 emit throwException(QString("getTransitions failed. %1").arg(exception.what()));
2291 }
2292
2293 QString responseLog;
2294 responseLog.append("{");
2295 int result_i = 0;
2296 foreach(QList<QString > result_elt, result)for (auto _container_ = QtPrivate::qMakeForeachContainer(result
); _container_.control && _container_.i != _container_
.e; ++_container_.i, _container_.control ^= 1) for (QList<
QString > result_elt = *_container_.i; _container_.control
; _container_.control = 0)
{
2297 if (result_i) {
2298 responseLog.append(",");
2299 }
2300 responseLog.append("{");
2301 int result_elt_i = 0;
2302 foreach(QString result_elt_elt, result_elt)for (auto _container_ = QtPrivate::qMakeForeachContainer(result_elt
); _container_.control && _container_.i != _container_
.e; ++_container_.i, _container_.control ^= 1) for (QString result_elt_elt
= *_container_.i; _container_.control; _container_.control =
0)
{
2303 if (result_elt_i) {
2304 responseLog.append(",");
2305 }
2306 responseLog.append("\"" + result_elt_elt + "\"");
2307 result_elt_i++;
2308 }
2309 responseLog.append("}");
2310 result_i++;
2311 }
2312 responseLog.append("}");
2313 emit logResponse("getTransitions("+commandLog+")", responseLog, &commandTime);
2314
2315 return result;
2316}
2317OMCInterface::getClassInformation_res OMCInterface::getClassInformation(QString cl)
2318{
2319 QTime commandTime;
2320 commandTime.start();
2321 QString commandLog;
2322 commandLog.append(cl);
2323 emit logCommand("getClassInformation("+commandLog+")", &commandTime);
2324
2325 QByteArray cl_utf8 = cl.toUtf8();
2326 getClassInformation_res result;
2327 void *out1_mm = NULL__null;
2328 void *out2_mm = NULL__null;
2329 void *out6_mm = NULL__null;
2330 void *out12_mm = NULL__null;
2331 void *out15_mm = NULL__null;
2332 void *out16_mm = NULL__null;
2333 void *out18_mm = NULL__null;
2334
2335 try {
2336 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
2337
2338 out1_mm = omc_OpenModelicaScriptingAPI_getClassInformation(threadData, mmc_mk_scon(cl_utf8.constData()), &out2_mm, &result.partialPrefix, &result.finalPrefix, &result.encapsulatedPrefix, &out6_mm, &result.fileReadOnly, &result.lineNumberStart, &result.columnNumberStart, &result.lineNumberEnd, &result.columnNumberEnd, &out12_mm, &result.isProtectedClass, &result.isDocumentationClass, &out15_mm, &out16_mm, &result.state, &out18_mm);
2339 result.restriction = QString::fromUtf8(MMC_STRINGDATA(out1_mm)(((struct mmc_string*)((void*)((char*)(out1_mm) - 3)))->data
)
);
2340 result.comment = QString::fromUtf8(MMC_STRINGDATA(out2_mm)(((struct mmc_string*)((void*)((char*)(out2_mm) - 3)))->data
)
);
2341 result.fileName = QString::fromUtf8(MMC_STRINGDATA(out6_mm)(((struct mmc_string*)((void*)((char*)(out6_mm) - 3)))->data
)
);
2342 result.dimensions.clear();
2343 while (!listEmpty(out12_mm)((*(mmc_uint_t*)((void*)((char*)(out12_mm) - 3))) == (((0) <<
10) + (((0) & 255) << 2)))
) {
2344 QString out12_elt;
2345 out12_elt = MMC_STRINGDATA(MMC_CAR(out12_mm))(((struct mmc_string*)((void*)((char*)((*(void**)(((void*)((void
**)(((void*)((char*)(out12_mm) - 3))) + (1)))))) - 3)))->data
)
;
2346 result.dimensions.push_back(out12_elt);
2347 out12_mm = MMC_CDR(out12_mm)(*(void**)(((void*)((void**)(((void*)((char*)(out12_mm) - 3))
) + (2)))))
;
2348 }
2349 result.version = QString::fromUtf8(MMC_STRINGDATA(out15_mm)(((struct mmc_string*)((void*)((char*)(out15_mm) - 3)))->data
)
);
2350 result.preferredView = QString::fromUtf8(MMC_STRINGDATA(out16_mm)(((struct mmc_string*)((void*)((char*)(out16_mm) - 3)))->data
)
);
2351 result.access = QString::fromUtf8(MMC_STRINGDATA(out18_mm)(((struct mmc_string*)((void*)((char*)(out18_mm) - 3)))->data
)
);
2352
2353 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
2354 } catch(std::exception &exception) {
2355 emit throwException(QString("getClassInformation failed. %1").arg(exception.what()));
2356 }
2357
2358 QString responseLog;
2359 responseLog.append(result.toString());
2360 emit logResponse("getClassInformation("+commandLog+")", responseLog, &commandTime);
2361
2362 return result;
2363}
2364QList<QString > OMCInterface::sortStrings(QList<QString > arr)
2365{
2366 QTime commandTime;
2367 commandTime.start();
2368 QString commandLog;
2369 commandLog.append("{");
2370 int arr_i = 0;
2371 foreach(QString arr_elt, arr)for (auto _container_ = QtPrivate::qMakeForeachContainer(arr)
; _container_.control && _container_.i != _container_
.e; ++_container_.i, _container_.control ^= 1) for (QString arr_elt
= *_container_.i; _container_.control; _container_.control =
0)
{
2372 if (arr_i) {
2373 commandLog.append(",");
2374 }
2375 commandLog.append("\"" + arr_elt + "\"");
2376 arr_i++;
2377 }
2378 commandLog.append("}");
2379 emit logCommand("sortStrings("+commandLog+")", &commandTime);
2380
2381 void *arr_lst = mmc_mk_nil()((void*)((char*)(&(mmc_nil).header) + 3));
2382 for (int arr_i = arr.size()-1; arr_i>=0; arr_i--) {
2383 QString arr_elt = arr[arr_i];
2384 QByteArray arr_elt_utf8 = arr_elt.toUtf8();
2385 arr_lst = mmc_mk_cons(mmc_mk_scon(arr_elt_utf8.constData()), arr_lst);
2386 }
2387 QList<QString > result;
2388 void *result_mm = NULL__null;
2389
2390 try {
2391 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
2392
2393 result_mm = omc_OpenModelicaScriptingAPI_sortStrings(threadData, arr_lst);
2394 result.clear();
2395 while (!listEmpty(result_mm)((*(mmc_uint_t*)((void*)((char*)(result_mm) - 3))) == (((0) <<
10) + (((0) & 255) << 2)))
) {
2396 QString result_elt;
2397 result_elt = MMC_STRINGDATA(MMC_CAR(result_mm))(((struct mmc_string*)((void*)((char*)((*(void**)(((void*)((void
**)(((void*)((char*)(result_mm) - 3))) + (1)))))) - 3)))->
data)
;
2398 result.push_back(result_elt);
2399 result_mm = MMC_CDR(result_mm)(*(void**)(((void*)((void**)(((void*)((char*)(result_mm) - 3)
)) + (2)))))
;
2400 }
2401
2402 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
2403 } catch(std::exception &exception) {
2404 emit throwException(QString("sortStrings failed. %1").arg(exception.what()));
2405 }
2406
2407 QString responseLog;
2408 responseLog.append("{");
2409 int result_i = 0;
2410 foreach(QString result_elt, result)for (auto _container_ = QtPrivate::qMakeForeachContainer(result
); _container_.control && _container_.i != _container_
.e; ++_container_.i, _container_.control ^= 1) for (QString result_elt
= *_container_.i; _container_.control; _container_.control =
0)
{
2411 if (result_i) {
2412 responseLog.append(",");
2413 }
2414 responseLog.append("\"" + result_elt + "\"");
2415 result_i++;
2416 }
2417 responseLog.append("}");
2418 emit logResponse("sortStrings("+commandLog+")", responseLog, &commandTime);
2419
2420 return result;
2421}
2422modelica_boolean OMCInterface::checkInterfaceOfPackages(QString cl, QList<QList<QString > > dependencyMatrix)
2423{
2424 QTime commandTime;
2425 commandTime.start();
2426 QString commandLog;
2427 commandLog.append(cl);
2428 commandLog.append(",");
2429 commandLog.append("{");
2430 int dependencyMatrix_i = 0;
2431 foreach(QList<QString > dependencyMatrix_elt, dependencyMatrix)for (auto _container_ = QtPrivate::qMakeForeachContainer(dependencyMatrix
); _container_.control && _container_.i != _container_
.e; ++_container_.i, _container_.control ^= 1) for (QList<
QString > dependencyMatrix_elt = *_container_.i; _container_
.control; _container_.control = 0)
{
2432 if (dependencyMatrix_i) {
2433 commandLog.append(",");
2434 }
2435 commandLog.append("{");
2436 int dependencyMatrix_elt_i = 0;
2437 foreach(QString dependencyMatrix_elt_elt, dependencyMatrix_elt)for (auto _container_ = QtPrivate::qMakeForeachContainer(dependencyMatrix_elt
); _container_.control && _container_.i != _container_
.e; ++_container_.i, _container_.control ^= 1) for (QString dependencyMatrix_elt_elt
= *_container_.i; _container_.control; _container_.control =
0)
{
2438 if (dependencyMatrix_elt_i) {
2439 commandLog.append(",");
2440 }
2441 commandLog.append("\"" + dependencyMatrix_elt_elt + "\"");
2442 dependencyMatrix_elt_i++;
2443 }
2444 commandLog.append("}");
2445 dependencyMatrix_i++;
2446 }
2447 commandLog.append("}");
2448 emit logCommand("checkInterfaceOfPackages("+commandLog+")", &commandTime);
2449
2450 QByteArray cl_utf8 = cl.toUtf8();
2451 void *dependencyMatrix_lst = mmc_mk_nil()((void*)((char*)(&(mmc_nil).header) + 3));
2452 for (int dependencyMatrix_i = dependencyMatrix.size()-1; dependencyMatrix_i>=0; dependencyMatrix_i--) {
2453 QList<QString > dependencyMatrix_elt = dependencyMatrix[dependencyMatrix_i];
2454 void *dependencyMatrix_elt_lst = mmc_mk_nil()((void*)((char*)(&(mmc_nil).header) + 3));
2455 for (int dependencyMatrix_elt_i = dependencyMatrix_elt.size()-1; dependencyMatrix_elt_i>=0; dependencyMatrix_elt_i--) {
2456 QString dependencyMatrix_elt_elt = dependencyMatrix_elt[dependencyMatrix_elt_i];
2457 QByteArray dependencyMatrix_elt_elt_utf8 = dependencyMatrix_elt_elt.toUtf8();
2458 dependencyMatrix_elt_lst = mmc_mk_cons(mmc_mk_scon(dependencyMatrix_elt_elt_utf8.constData()), dependencyMatrix_elt_lst);
2459 }
2460 dependencyMatrix_lst = mmc_mk_cons(dependencyMatrix_elt_lst, dependencyMatrix_lst);
2461 }
2462 modelica_boolean result;
2463
2464 try {
2465 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
2466
2467 result = omc_OpenModelicaScriptingAPI_checkInterfaceOfPackages(threadData, mmc_mk_scon(cl_utf8.constData()), dependencyMatrix_lst);
2468
2469 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
2470 } catch(std::exception &exception) {
2471 emit throwException(QString("checkInterfaceOfPackages failed. %1").arg(exception.what()));
2472 }
2473
2474 QString responseLog;
2475 responseLog.append(result ? "true" : "false");
2476 emit logResponse("checkInterfaceOfPackages("+commandLog+")", responseLog, &commandTime);
2477
2478 return result;
2479}
2480modelica_boolean OMCInterface::GC_set_max_heap_size(modelica_integer size)
2481{
2482 QTime commandTime;
2483 commandTime.start();
2484 QString commandLog;
2485 commandLog.append(QString::number(size));
2486 emit logCommand("GC__set__max__heap__size("+commandLog+")", &commandTime);
2487
2488 modelica_boolean result;
2489
2490 try {
2491 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
2492
2493 result = omc_OpenModelicaScriptingAPI_GC__set__max__heap__size(threadData, size);
2494
2495 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
2496 } catch(std::exception &exception) {
2497 emit throwException(QString("GC__set__max__heap__size failed. %1").arg(exception.what()));
2498 }
2499
2500 QString responseLog;
2501 responseLog.append(result ? "true" : "false");
2502 emit logResponse("GC__set__max__heap__size("+commandLog+")", responseLog, &commandTime);
2503
2504 return result;
2505}
2506modelica_boolean OMCInterface::GC_expand_hp(modelica_integer size)
2507{
2508 QTime commandTime;
2509 commandTime.start();
2510 QString commandLog;
2511 commandLog.append(QString::number(size));
2512 emit logCommand("GC__expand__hp("+commandLog+")", &commandTime);
2513
2514 modelica_boolean result;
2515
2516 try {
2517 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
2518
2519 result = omc_OpenModelicaScriptingAPI_GC__expand__hp(threadData, size);
2520
2521 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
2522 } catch(std::exception &exception) {
2523 emit throwException(QString("GC__expand__hp failed. %1").arg(exception.what()));
2524 }
2525
2526 QString responseLog;
2527 responseLog.append(result ? "true" : "false");
2528 emit logResponse("GC__expand__hp("+commandLog+")", responseLog, &commandTime);
2529
2530 return result;
2531}
2532void OMCInterface::GC_gcollect_and_unmap()
2533{
2534 QTime commandTime;
2535 commandTime.start();
2536 emit logCommand("GC__gcollect__and__unmap()", &commandTime);
2537
2538
2539 try {
2540 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
2541
2542 omc_OpenModelicaScriptingAPI_GC__gcollect__and__unmap(threadData);
2543
2544 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
2545 } catch(std::exception &exception) {
2546 emit throwException(QString("GC__gcollect__and__unmap failed. %1").arg(exception.what()));
2547 }
2548
2549 QString responseLog;
2550 emit logResponse("GC__gcollect__and__unmap()", responseLog, &commandTime);
2551
2552}
2553modelica_real OMCInterface::getMemorySize()
2554{
2555 QTime commandTime;
2556 commandTime.start();
2557 emit logCommand("getMemorySize()", &commandTime);
2558
2559 modelica_real result;
2560
2561 try {
2562 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
2563
2564 result = omc_OpenModelicaScriptingAPI_getMemorySize(threadData);
2565
2566 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
2567 } catch(std::exception &exception) {
2568 emit throwException(QString("getMemorySize failed. %1").arg(exception.what()));
2569 }
2570
2571 QString responseLog;
2572 responseLog.append(QString::number(result));
2573 emit logResponse("getMemorySize()", responseLog, &commandTime);
2574
2575 return result;
2576}
2577void OMCInterface::threadWorkFailed()
2578{
2579 QTime commandTime;
2580 commandTime.start();
2581 emit logCommand("threadWorkFailed()", &commandTime);
2582
2583
2584 try {
2585 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
2586
2587 omc_OpenModelicaScriptingAPI_threadWorkFailed(threadData);
2588
2589 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
2590 } catch(std::exception &exception) {
2591 emit throwException(QString("threadWorkFailed failed. %1").arg(exception.what()));
2592 }
2593
2594 QString responseLog;
2595 emit logResponse("threadWorkFailed()", responseLog, &commandTime);
2596
2597}
2598void OMCInterface::exit(modelica_integer status)
2599{
2600 QTime commandTime;
2601 commandTime.start();
2602 QString commandLog;
2603 commandLog.append(QString::number(status));
2604 emit logCommand("exit("+commandLog+")", &commandTime);
2605
2606
2607 try {
2608 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
2609
2610 omc_OpenModelicaScriptingAPI_exit(threadData, status);
2611
2612 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
2613 } catch(std::exception &exception) {
2614 emit throwException(QString("exit failed. %1").arg(exception.what()));
2615 }
2616
2617 QString responseLog;
2618 emit logResponse("exit("+commandLog+")", responseLog, &commandTime);
2619
2620}
2621QList<modelica_boolean > OMCInterface::runScriptParallel(QList<QString > scripts, modelica_integer numThreads, modelica_boolean useThreads)
2622{
2623 QTime commandTime;
2624 commandTime.start();
2625 QString commandLog;
2626 commandLog.append("{");
2627 int scripts_i = 0;
2628 foreach(QString scripts_elt, scripts)for (auto _container_ = QtPrivate::qMakeForeachContainer(scripts
); _container_.control && _container_.i != _container_
.e; ++_container_.i, _container_.control ^= 1) for (QString scripts_elt
= *_container_.i; _container_.control; _container_.control =
0)
{
2629 if (scripts_i) {
2630 commandLog.append(",");
2631 }
2632 commandLog.append("\"" + scripts_elt + "\"");
2633 scripts_i++;
2634 }
2635 commandLog.append("}");commandLog.append(",");
2636 commandLog.append(QString::number(numThreads));
2637 commandLog.append(",");
2638 commandLog.append(useThreads ? "true" : "false");
2639 emit logCommand("runScriptParallel("+commandLog+")", &commandTime);
2640
2641 void *scripts_lst = mmc_mk_nil()((void*)((char*)(&(mmc_nil).header) + 3));
2642 for (int scripts_i = scripts.size()-1; scripts_i>=0; scripts_i--) {
2643 QString scripts_elt = scripts[scripts_i];
2644 QByteArray scripts_elt_utf8 = scripts_elt.toUtf8();
2645 scripts_lst = mmc_mk_cons(mmc_mk_scon(scripts_elt_utf8.constData()), scripts_lst);
2646 }
2647 QList<modelica_boolean > result;
2648 void *result_mm = NULL__null;
2649
2650 try {
2651 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
2652
2653 result_mm = omc_OpenModelicaScriptingAPI_runScriptParallel(threadData, scripts_lst, numThreads, useThreads);
2654 result.clear();
2655 while (!listEmpty(result_mm)((*(mmc_uint_t*)((void*)((char*)(result_mm) - 3))) == (((0) <<
10) + (((0) & 255) << 2)))
) {
2656 modelica_boolean result_elt;
2657 result_elt = mmc_unbox_boolean(MMC_CAR(result_mm))(((mmc_sint_t) ((*(void**)(((void*)((void**)(((void*)((char*)
(result_mm) - 3))) + (1))))))) >> 1)
;
2658 result.push_back(result_elt);
2659 result_mm = MMC_CDR(result_mm)(*(void**)(((void*)((void**)(((void*)((char*)(result_mm) - 3)
)) + (2)))))
;
2660 }
2661
2662 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
2663 } catch(std::exception &exception) {
2664 emit throwException(QString("runScriptParallel failed. %1").arg(exception.what()));
2665 }
2666
2667 QString responseLog;
2668 responseLog.append("{");
2669 int result_i = 0;
2670 foreach(modelica_boolean result_elt, result)for (auto _container_ = QtPrivate::qMakeForeachContainer(result
); _container_.control && _container_.i != _container_
.e; ++_container_.i, _container_.control ^= 1) for (modelica_boolean
result_elt = *_container_.i; _container_.control; _container_
.control = 0)
{
2671 if (result_i) {
2672 responseLog.append(",");
2673 }
2674 responseLog.append(result_elt ? "true" : "false");
2675 result_i++;
2676 }
2677 responseLog.append("}");
2678 emit logResponse("runScriptParallel("+commandLog+")", responseLog, &commandTime);
2679
2680 return result;
2681}
2682modelica_integer OMCInterface::numProcessors()
2683{
2684 QTime commandTime;
2685 commandTime.start();
2686 emit logCommand("numProcessors()", &commandTime);
2687
2688 modelica_integer result;
2689
2690 try {
2691 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
2692
2693 result = omc_OpenModelicaScriptingAPI_numProcessors(threadData);
2694
2695 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
2696 } catch(std::exception &exception) {
2697 emit throwException(QString("numProcessors failed. %1").arg(exception.what()));
2698 }
2699
2700 QString responseLog;
2701 responseLog.append(QString::number(result));
2702 emit logResponse("numProcessors()", responseLog, &commandTime);
2703
2704 return result;
2705}
2706void OMCInterface::generateEntryPoint(QString fileName, QString entryPoint, QString url)
2707{
2708 QTime commandTime;
2709 commandTime.start();
2710 QString commandLog;
2711 commandLog.append("\"" + fileName + "\"");
2712 commandLog.append(",");
2713 commandLog.append(entryPoint);
2714 commandLog.append(",");
2715 commandLog.append("\"" + url + "\"");
2716 emit logCommand("generateEntryPoint("+commandLog+")", &commandTime);
2717
2718 QByteArray fileName_utf8 = fileName.toUtf8();
2719 QByteArray entryPoint_utf8 = entryPoint.toUtf8();
2720 QByteArray url_utf8 = url.toUtf8();
2721
2722 try {
2723 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
2724
2725 omc_OpenModelicaScriptingAPI_generateEntryPoint(threadData, mmc_mk_scon(fileName_utf8.constData()), mmc_mk_scon(entryPoint_utf8.constData()), mmc_mk_scon(url_utf8.constData()));
2726
2727 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
2728 } catch(std::exception &exception) {
2729 emit throwException(QString("generateEntryPoint failed. %1").arg(exception.what()));
2730 }
2731
2732 QString responseLog;
2733 emit logResponse("generateEntryPoint("+commandLog+")", responseLog, &commandTime);
2734
2735}
2736QString OMCInterface::getDerivedClassModifierValue(QString className, QString modifierName)
2737{
2738 QTime commandTime;
2739 commandTime.start();
2740 QString commandLog;
2741 commandLog.append(className);
2742 commandLog.append(",");
2743 commandLog.append(modifierName);
2744 emit logCommand("getDerivedClassModifierValue("+commandLog+")", &commandTime);
2745
2746 QByteArray className_utf8 = className.toUtf8();
2747 QByteArray modifierName_utf8 = modifierName.toUtf8();
2748 QString result;
2749 void *result_mm = NULL__null;
2750
2751 try {
2752 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
2753
2754 result_mm = omc_OpenModelicaScriptingAPI_getDerivedClassModifierValue(threadData, mmc_mk_scon(className_utf8.constData()), mmc_mk_scon(modifierName_utf8.constData()));
2755 result = QString::fromUtf8(MMC_STRINGDATA(result_mm)(((struct mmc_string*)((void*)((char*)(result_mm) - 3)))->
data)
);
2756
2757 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
2758 } catch(std::exception &exception) {
2759 emit throwException(QString("getDerivedClassModifierValue failed. %1").arg(exception.what()));
2760 }
2761
2762 QString responseLog;
2763 responseLog.append("\"" + result + "\"");
2764 emit logResponse("getDerivedClassModifierValue("+commandLog+")", responseLog, &commandTime);
2765
2766 return result;
2767}
2768QList<QString > OMCInterface::getDerivedClassModifierNames(QString className)
2769{
2770 QTime commandTime;
2771 commandTime.start();
2772 QString commandLog;
2773 commandLog.append(className);
2774 emit logCommand("getDerivedClassModifierNames("+commandLog+")", &commandTime);
2775
2776 QByteArray className_utf8 = className.toUtf8();
2777 QList<QString > result;
2778 void *result_mm = NULL__null;
2779
2780 try {
2781 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
2782
2783 result_mm = omc_OpenModelicaScriptingAPI_getDerivedClassModifierNames(threadData, mmc_mk_scon(className_utf8.constData()));
2784 result.clear();
2785 while (!listEmpty(result_mm)((*(mmc_uint_t*)((void*)((char*)(result_mm) - 3))) == (((0) <<
10) + (((0) & 255) << 2)))
) {
2786 QString result_elt;
2787 result_elt = MMC_STRINGDATA(MMC_CAR(result_mm))(((struct mmc_string*)((void*)((char*)((*(void**)(((void*)((void
**)(((void*)((char*)(result_mm) - 3))) + (1)))))) - 3)))->
data)
;
2788 result.push_back(result_elt);
2789 result_mm = MMC_CDR(result_mm)(*(void**)(((void*)((void**)(((void*)((char*)(result_mm) - 3)
)) + (2)))))
;
2790 }
2791
2792 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
2793 } catch(std::exception &exception) {
2794 emit throwException(QString("getDerivedClassModifierNames failed. %1").arg(exception.what()));
2795 }
2796
2797 QString responseLog;
2798 responseLog.append("{");
2799 int result_i = 0;
2800 foreach(QString result_elt, result)for (auto _container_ = QtPrivate::qMakeForeachContainer(result
); _container_.control && _container_.i != _container_
.e; ++_container_.i, _container_.control ^= 1) for (QString result_elt
= *_container_.i; _container_.control; _container_.control =
0)
{
2801 if (result_i) {
2802 responseLog.append(",");
2803 }
2804 responseLog.append("\"" + result_elt + "\"");
2805 result_i++;
2806 }
2807 responseLog.append("}");
2808 emit logResponse("getDerivedClassModifierNames("+commandLog+")", responseLog, &commandTime);
2809
2810 return result;
2811}
2812QList<QList<QString > > OMCInterface::getUses(QString pack)
2813{
2814 QTime commandTime;
2815 commandTime.start();
2816 QString commandLog;
2817 commandLog.append(pack);
2818 emit logCommand("getUses("+commandLog+")", &commandTime);
2819
2820 QByteArray pack_utf8 = pack.toUtf8();
2821 QList<QList<QString > > result;
2822 void *result_mm = NULL__null;
2823
2824 try {
2825 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
2826
2827 result_mm = omc_OpenModelicaScriptingAPI_getUses(threadData, mmc_mk_scon(pack_utf8.constData()));
2828 result.clear();
2829 while (!listEmpty(result_mm)((*(mmc_uint_t*)((void*)((char*)(result_mm) - 3))) == (((0) <<
10) + (((0) & 255) << 2)))
) {
2830 QList<QString > result_elt;
2831 result_elt.clear();
2832 while (!listEmpty(MMC_CAR(result_mm))((*(mmc_uint_t*)((void*)((char*)((*(void**)(((void*)((void**)
(((void*)((char*)(result_mm) - 3))) + (1)))))) - 3))) == (((0
) << 10) + (((0) & 255) << 2)))
) {
2833 QString result_elt_elt;
2834 result_elt_elt = MMC_STRINGDATA(MMC_CAR(MMC_CAR(result_mm)))(((struct mmc_string*)((void*)((char*)((*(void**)(((void*)((void
**)(((void*)((char*)((*(void**)(((void*)((void**)(((void*)((char
*)(result_mm) - 3))) + (1)))))) - 3))) + (1)))))) - 3)))->
data)
;
2835 result_elt.push_back(result_elt_elt);
2836 MMC_CAR(result_mm)(*(void**)(((void*)((void**)(((void*)((char*)(result_mm) - 3)
)) + (1)))))
= MMC_CDR(MMC_CAR(result_mm))(*(void**)(((void*)((void**)(((void*)((char*)((*(void**)(((void
*)((void**)(((void*)((char*)(result_mm) - 3))) + (1)))))) - 3
))) + (2)))))
;
2837 }
2838 result.push_back(result_elt);
2839 result_mm = MMC_CDR(result_mm)(*(void**)(((void*)((void**)(((void*)((char*)(result_mm) - 3)
)) + (2)))))
;
2840 }
2841
2842 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
2843 } catch(std::exception &exception) {
2844 emit throwException(QString("getUses failed. %1").arg(exception.what()));
2845 }
2846
2847 QString responseLog;
2848 responseLog.append("{");
2849 int result_i = 0;
2850 foreach(QList<QString > result_elt, result)for (auto _container_ = QtPrivate::qMakeForeachContainer(result
); _container_.control && _container_.i != _container_
.e; ++_container_.i, _container_.control ^= 1) for (QList<
QString > result_elt = *_container_.i; _container_.control
; _container_.control = 0)
{
2851 if (result_i) {
2852 responseLog.append(",");
2853 }
2854 responseLog.append("{");
2855 int result_elt_i = 0;
2856 foreach(QString result_elt_elt, result_elt)for (auto _container_ = QtPrivate::qMakeForeachContainer(result_elt
); _container_.control && _container_.i != _container_
.e; ++_container_.i, _container_.control ^= 1) for (QString result_elt_elt
= *_container_.i; _container_.control; _container_.control =
0)
{
2857 if (result_elt_i) {
2858 responseLog.append(",");
2859 }
2860 responseLog.append("\"" + result_elt_elt + "\"");
2861 result_elt_i++;
2862 }
2863 responseLog.append("}");
2864 result_i++;
2865 }
2866 responseLog.append("}");
2867 emit logResponse("getUses("+commandLog+")", responseLog, &commandTime);
2868
2869 return result;
2870}
2871QList<QString > OMCInterface::getAvailableLibraries()
2872{
2873 QTime commandTime;
2874 commandTime.start();
2875 emit logCommand("getAvailableLibraries()", &commandTime);
2876
2877 QList<QString > result;
2878 void *result_mm = NULL__null;
2879
2880 try {
2881 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
2882
2883 result_mm = omc_OpenModelicaScriptingAPI_getAvailableLibraries(threadData);
2884 result.clear();
2885 while (!listEmpty(result_mm)((*(mmc_uint_t*)((void*)((char*)(result_mm) - 3))) == (((0) <<
10) + (((0) & 255) << 2)))
) {
2886 QString result_elt;
2887 result_elt = MMC_STRINGDATA(MMC_CAR(result_mm))(((struct mmc_string*)((void*)((char*)((*(void**)(((void*)((void
**)(((void*)((char*)(result_mm) - 3))) + (1)))))) - 3)))->
data)
;
2888 result.push_back(result_elt);
2889 result_mm = MMC_CDR(result_mm)(*(void**)(((void*)((void**)(((void*)((char*)(result_mm) - 3)
)) + (2)))))
;
2890 }
2891
2892 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
2893 } catch(std::exception &exception) {
2894 emit throwException(QString("getAvailableLibraries failed. %1").arg(exception.what()));
2895 }
2896
2897 QString responseLog;
2898 responseLog.append("{");
2899 int result_i = 0;
2900 foreach(QString result_elt, result)for (auto _container_ = QtPrivate::qMakeForeachContainer(result
); _container_.control && _container_.i != _container_
.e; ++_container_.i, _container_.control ^= 1) for (QString result_elt
= *_container_.i; _container_.control; _container_.control =
0)
{
2901 if (result_i) {
2902 responseLog.append(",");
2903 }
2904 responseLog.append("\"" + result_elt + "\"");
2905 result_i++;
2906 }
2907 responseLog.append("}");
2908 emit logResponse("getAvailableLibraries()", responseLog, &commandTime);
2909
2910 return result;
2911}
2912QList<QString > OMCInterface::searchClassNames(QString searchText, modelica_boolean findInText)
2913{
2914 QTime commandTime;
2915 commandTime.start();
2916 QString commandLog;
2917 commandLog.append("\"" + searchText + "\"");
2918 commandLog.append(",");
2919 commandLog.append(findInText ? "true" : "false");
2920 emit logCommand("searchClassNames("+commandLog+")", &commandTime);
2921
2922 QByteArray searchText_utf8 = searchText.toUtf8();
2923 QList<QString > result;
2924 void *result_mm = NULL__null;
2925
2926 try {
2927 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
2928
2929 result_mm = omc_OpenModelicaScriptingAPI_searchClassNames(threadData, mmc_mk_scon(searchText_utf8.constData()), findInText);
2930 result.clear();
2931 while (!listEmpty(result_mm)((*(mmc_uint_t*)((void*)((char*)(result_mm) - 3))) == (((0) <<
10) + (((0) & 255) << 2)))
) {
2932 QString result_elt;
2933 result_elt = MMC_STRINGDATA(MMC_CAR(result_mm))(((struct mmc_string*)((void*)((char*)((*(void**)(((void*)((void
**)(((void*)((char*)(result_mm) - 3))) + (1)))))) - 3)))->
data)
;
2934 result.push_back(result_elt);
2935 result_mm = MMC_CDR(result_mm)(*(void**)(((void*)((void**)(((void*)((char*)(result_mm) - 3)
)) + (2)))))
;
2936 }
2937
2938 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
2939 } catch(std::exception &exception) {
2940 emit throwException(QString("searchClassNames failed. %1").arg(exception.what()));
2941 }
2942
2943 QString responseLog;
2944 responseLog.append("{");
2945 int result_i = 0;
2946 foreach(QString result_elt, result)for (auto _container_ = QtPrivate::qMakeForeachContainer(result
); _container_.control && _container_.i != _container_
.e; ++_container_.i, _container_.control ^= 1) for (QString result_elt
= *_container_.i; _container_.control; _container_.control =
0)
{
2947 if (result_i) {
2948 responseLog.append(",");
2949 }
2950 responseLog.append(result_elt);
2951 result_i++;
2952 }
2953 responseLog.append("}");
2954 emit logResponse("searchClassNames("+commandLog+")", responseLog, &commandTime);
2955
2956 return result;
2957}
2958modelica_boolean OMCInterface::extendsFrom(QString className, QString baseClassName)
2959{
2960 QTime commandTime;
2961 commandTime.start();
2962 QString commandLog;
2963 commandLog.append(className);
2964 commandLog.append(",");
2965 commandLog.append(baseClassName);
2966 emit logCommand("extendsFrom("+commandLog+")", &commandTime);
2967
2968 QByteArray className_utf8 = className.toUtf8();
2969 QByteArray baseClassName_utf8 = baseClassName.toUtf8();
2970 modelica_boolean result;
2971
2972 try {
2973 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
2974
2975 result = omc_OpenModelicaScriptingAPI_extendsFrom(threadData, mmc_mk_scon(className_utf8.constData()), mmc_mk_scon(baseClassName_utf8.constData()));
2976
2977 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
2978 } catch(std::exception &exception) {
2979 emit throwException(QString("extendsFrom failed. %1").arg(exception.what()));
2980 }
2981
2982 QString responseLog;
2983 responseLog.append(result ? "true" : "false");
2984 emit logResponse("extendsFrom("+commandLog+")", responseLog, &commandTime);
2985
2986 return result;
2987}
2988modelica_boolean OMCInterface::getBooleanClassAnnotation(QString className, QString annotationName)
2989{
2990 QTime commandTime;
2991 commandTime.start();
2992 QString commandLog;
2993 commandLog.append(className);
2994 commandLog.append(",");
2995 commandLog.append(annotationName);
2996 emit logCommand("getBooleanClassAnnotation("+commandLog+")", &commandTime);
2997
2998 QByteArray className_utf8 = className.toUtf8();
2999 QByteArray annotationName_utf8 = annotationName.toUtf8();
3000 modelica_boolean result;
3001
3002 try {
3003 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
3004
3005 result = omc_OpenModelicaScriptingAPI_getBooleanClassAnnotation(threadData, mmc_mk_scon(className_utf8.constData()), mmc_mk_scon(annotationName_utf8.constData()));
3006
3007 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
3008 } catch(std::exception &exception) {
3009 emit throwException(QString("getBooleanClassAnnotation failed. %1").arg(exception.what()));
3010 }
3011
3012 QString responseLog;
3013 responseLog.append(result ? "true" : "false");
3014 emit logResponse("getBooleanClassAnnotation("+commandLog+")", responseLog, &commandTime);
3015
3016 return result;
3017}
3018modelica_boolean OMCInterface::classAnnotationExists(QString className, QString annotationName)
3019{
3020 QTime commandTime;
3021 commandTime.start();
3022 QString commandLog;
3023 commandLog.append(className);
3024 commandLog.append(",");
3025 commandLog.append(annotationName);
3026 emit logCommand("classAnnotationExists("+commandLog+")", &commandTime);
3027
3028 QByteArray className_utf8 = className.toUtf8();
3029 QByteArray annotationName_utf8 = annotationName.toUtf8();
3030 modelica_boolean result;
3031
3032 try {
3033 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
3034
3035 result = omc_OpenModelicaScriptingAPI_classAnnotationExists(threadData, mmc_mk_scon(className_utf8.constData()), mmc_mk_scon(annotationName_utf8.constData()));
3036
3037 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
3038 } catch(std::exception &exception) {
3039 emit throwException(QString("classAnnotationExists failed. %1").arg(exception.what()));
3040 }
3041
3042 QString responseLog;
3043 responseLog.append(result ? "true" : "false");
3044 emit logResponse("classAnnotationExists("+commandLog+")", responseLog, &commandTime);
3045
3046 return result;
3047}
3048QString OMCInterface::getAnnotationModifierValue(QString name, QString vendorannotation, QString modifiername)
3049{
3050 QTime commandTime;
3051 commandTime.start();
3052 QString commandLog;
3053 commandLog.append(name);
3054 commandLog.append(",");
3055 commandLog.append("\"" + vendorannotation + "\"");
3056 commandLog.append(",");
3057 commandLog.append("\"" + modifiername + "\"");
3058 emit logCommand("getAnnotationModifierValue("+commandLog+")", &commandTime);
3059
3060 QByteArray name_utf8 = name.toUtf8();
3061 QByteArray vendorannotation_utf8 = vendorannotation.toUtf8();
3062 QByteArray modifiername_utf8 = modifiername.toUtf8();
3063 QString result;
3064 void *result_mm = NULL__null;
3065
3066 try {
3067 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
3068
3069 result_mm = omc_OpenModelicaScriptingAPI_getAnnotationModifierValue(threadData, mmc_mk_scon(name_utf8.constData()), mmc_mk_scon(vendorannotation_utf8.constData()), mmc_mk_scon(modifiername_utf8.constData()));
3070 result = QString::fromUtf8(MMC_STRINGDATA(result_mm)(((struct mmc_string*)((void*)((char*)(result_mm) - 3)))->
data)
);
3071
3072 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
3073 } catch(std::exception &exception) {
3074 emit throwException(QString("getAnnotationModifierValue failed. %1").arg(exception.what()));
3075 }
3076
3077 QString responseLog;
3078 responseLog.append("\"" + result + "\"");
3079 emit logResponse("getAnnotationModifierValue("+commandLog+")", responseLog, &commandTime);
3080
3081 return result;
3082}
3083QList<QString > OMCInterface::getAnnotationNamedModifiers(QString name, QString vendorannotation)
3084{
3085 QTime commandTime;
3086 commandTime.start();
3087 QString commandLog;
3088 commandLog.append(name);
3089 commandLog.append(",");
3090 commandLog.append("\"" + vendorannotation + "\"");
3091 emit logCommand("getAnnotationNamedModifiers("+commandLog+")", &commandTime);
3092
3093 QByteArray name_utf8 = name.toUtf8();
3094 QByteArray vendorannotation_utf8 = vendorannotation.toUtf8();
3095 QList<QString > result;
3096 void *result_mm = NULL__null;
3097
3098 try {
3099 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
3100
3101 result_mm = omc_OpenModelicaScriptingAPI_getAnnotationNamedModifiers(threadData, mmc_mk_scon(name_utf8.constData()), mmc_mk_scon(vendorannotation_utf8.constData()));
3102 result.clear();
3103 while (!listEmpty(result_mm)((*(mmc_uint_t*)((void*)((char*)(result_mm) - 3))) == (((0) <<
10) + (((0) & 255) << 2)))
) {
3104 QString result_elt;
3105 result_elt = MMC_STRINGDATA(MMC_CAR(result_mm))(((struct mmc_string*)((void*)((char*)((*(void**)(((void*)((void
**)(((void*)((char*)(result_mm) - 3))) + (1)))))) - 3)))->
data)
;
3106 result.push_back(result_elt);
3107 result_mm = MMC_CDR(result_mm)(*(void**)(((void*)((void**)(((void*)((char*)(result_mm) - 3)
)) + (2)))))
;
3108 }
3109
3110 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
3111 } catch(std::exception &exception) {
3112 emit throwException(QString("getAnnotationNamedModifiers failed. %1").arg(exception.what()));
3113 }
3114
3115 QString responseLog;
3116 responseLog.append("{");
3117 int result_i = 0;
3118 foreach(QString result_elt, result)for (auto _container_ = QtPrivate::qMakeForeachContainer(result
); _container_.control && _container_.i != _container_
.e; ++_container_.i, _container_.control ^= 1) for (QString result_elt
= *_container_.i; _container_.control; _container_.control =
0)
{
3119 if (result_i) {
3120 responseLog.append(",");
3121 }
3122 responseLog.append("\"" + result_elt + "\"");
3123 result_i++;
3124 }
3125 responseLog.append("}");
3126 emit logResponse("getAnnotationNamedModifiers("+commandLog+")", responseLog, &commandTime);
3127
3128 return result;
3129}
3130OMCInterface::getSimulationOptions_res OMCInterface::getSimulationOptions(QString name, modelica_real defaultStartTime, modelica_real defaultStopTime, modelica_real defaultTolerance, modelica_integer defaultNumberOfIntervals, modelica_real defaultInterval)
3131{
3132 QTime commandTime;
3133 commandTime.start();
3134 QString commandLog;
3135 commandLog.append(name);
3136 commandLog.append(",");
3137 commandLog.append(QString::number(defaultStartTime));
3138 commandLog.append(",");
3139 commandLog.append(QString::number(defaultStopTime));
3140 commandLog.append(",");
3141 commandLog.append(QString::number(defaultTolerance));
3142 commandLog.append(",");
3143 commandLog.append(QString::number(defaultNumberOfIntervals));
3144 commandLog.append(",");
3145 commandLog.append(QString::number(defaultInterval));
3146 emit logCommand("getSimulationOptions("+commandLog+")", &commandTime);
3147
3148 QByteArray name_utf8 = name.toUtf8();
3149 getSimulationOptions_res result;
3150
3151 try {
3152 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
3153
3154 result.startTime = omc_OpenModelicaScriptingAPI_getSimulationOptions(threadData, mmc_mk_scon(name_utf8.constData()), defaultStartTime, defaultStopTime, defaultTolerance, defaultNumberOfIntervals, defaultInterval, &result.stopTime, &result.tolerance, &result.numberOfIntervals, &result.interval);
3155
3156 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
3157 } catch(std::exception &exception) {
3158 emit throwException(QString("getSimulationOptions failed. %1").arg(exception.what()));
3159 }
3160
3161 QString responseLog;
3162 responseLog.append(result.toString());
3163 emit logResponse("getSimulationOptions("+commandLog+")", responseLog, &commandTime);
3164
3165 return result;
3166}
3167modelica_boolean OMCInterface::isExperiment(QString name)
3168{
3169 QTime commandTime;
3170 commandTime.start();
3171 QString commandLog;
3172 commandLog.append(name);
3173 emit logCommand("isExperiment("+commandLog+")", &commandTime);
3174
3175 QByteArray name_utf8 = name.toUtf8();
3176 modelica_boolean result;
3177
3178 try {
3179 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
3180
3181 result = omc_OpenModelicaScriptingAPI_isExperiment(threadData, mmc_mk_scon(name_utf8.constData()));
3182
3183 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
3184 } catch(std::exception &exception) {
3185 emit throwException(QString("isExperiment failed. %1").arg(exception.what()));
3186 }
3187
3188 QString responseLog;
3189 responseLog.append(result ? "true" : "false");
3190 emit logResponse("isExperiment("+commandLog+")", responseLog, &commandTime);
3191
3192 return result;
3193}
3194QList<QString > OMCInterface::getInheritedClasses(QString name)
3195{
3196 QTime commandTime;
3197 commandTime.start();
3198 QString commandLog;
3199 commandLog.append(name);
3200 emit logCommand("getInheritedClasses("+commandLog+")", &commandTime);
3201
3202 QByteArray name_utf8 = name.toUtf8();
3203 QList<QString > result;
3204 void *result_mm = NULL__null;
3205
3206 try {
3207 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
3208
3209 result_mm = omc_OpenModelicaScriptingAPI_getInheritedClasses(threadData, mmc_mk_scon(name_utf8.constData()));
3210 result.clear();
3211 while (!listEmpty(result_mm)((*(mmc_uint_t*)((void*)((char*)(result_mm) - 3))) == (((0) <<
10) + (((0) & 255) << 2)))
) {
3212 QString result_elt;
3213 result_elt = MMC_STRINGDATA(MMC_CAR(result_mm))(((struct mmc_string*)((void*)((char*)((*(void**)(((void*)((void
**)(((void*)((char*)(result_mm) - 3))) + (1)))))) - 3)))->
data)
;
3214 result.push_back(result_elt);
3215 result_mm = MMC_CDR(result_mm)(*(void**)(((void*)((void**)(((void*)((char*)(result_mm) - 3)
)) + (2)))))
;
3216 }
3217
3218 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
3219 } catch(std::exception &exception) {
3220 emit throwException(QString("getInheritedClasses failed. %1").arg(exception.what()));
3221 }
3222
3223 QString responseLog;
3224 responseLog.append("{");
3225 int result_i = 0;
3226 foreach(QString result_elt, result)for (auto _container_ = QtPrivate::qMakeForeachContainer(result
); _container_.control && _container_.i != _container_
.e; ++_container_.i, _container_.control ^= 1) for (QString result_elt
= *_container_.i; _container_.control; _container_.control =
0)
{
3227 if (result_i) {
3228 responseLog.append(",");
3229 }
3230 responseLog.append(result_elt);
3231 result_i++;
3232 }
3233 responseLog.append("}");
3234 emit logResponse("getInheritedClasses("+commandLog+")", responseLog, &commandTime);
3235
3236 return result;
3237}
3238QString OMCInterface::getBuiltinType(QString cl)
3239{
3240 QTime commandTime;
3241 commandTime.start();
3242 QString commandLog;
3243 commandLog.append(cl);
3244 emit logCommand("getBuiltinType("+commandLog+")", &commandTime);
3245
3246 QByteArray cl_utf8 = cl.toUtf8();
3247 QString result;
3248 void *result_mm = NULL__null;
3249
3250 try {
3251 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
3252
3253 result_mm = omc_OpenModelicaScriptingAPI_getBuiltinType(threadData, mmc_mk_scon(cl_utf8.constData()));
3254 result = QString::fromUtf8(MMC_STRINGDATA(result_mm)(((struct mmc_string*)((void*)((char*)(result_mm) - 3)))->
data)
);
3255
3256 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
3257 } catch(std::exception &exception) {
3258 emit throwException(QString("getBuiltinType failed. %1").arg(exception.what()));
3259 }
3260
3261 QString responseLog;
3262 responseLog.append("\"" + result + "\"");
3263 emit logResponse("getBuiltinType("+commandLog+")", responseLog, &commandTime);
3264
3265 return result;
3266}
3267modelica_boolean OMCInterface::isProtectedClass(QString cl, QString c2)
3268{
3269 QTime commandTime;
3270 commandTime.start();
3271 QString commandLog;
3272 commandLog.append(cl);
3273 commandLog.append(",");
3274 commandLog.append("\"" + c2 + "\"");
3275 emit logCommand("isProtectedClass("+commandLog+")", &commandTime);
3276
3277 QByteArray cl_utf8 = cl.toUtf8();
3278 QByteArray c2_utf8 = c2.toUtf8();
3279 modelica_boolean result;
3280
3281 try {
3282 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
3283
3284 result = omc_OpenModelicaScriptingAPI_isProtectedClass(threadData, mmc_mk_scon(cl_utf8.constData()), mmc_mk_scon(c2_utf8.constData()));
3285
3286 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
3287 } catch(std::exception &exception) {
3288 emit throwException(QString("isProtectedClass failed. %1").arg(exception.what()));
3289 }
3290
3291 QString responseLog;
3292 responseLog.append(result ? "true" : "false");
3293 emit logResponse("isProtectedClass("+commandLog+")", responseLog, &commandTime);
3294
3295 return result;
3296}
3297modelica_boolean OMCInterface::isOperatorFunction(QString cl)
3298{
3299 QTime commandTime;
3300 commandTime.start();
3301 QString commandLog;
3302 commandLog.append(cl);
3303 emit logCommand("isOperatorFunction("+commandLog+")", &commandTime);
3304
3305 QByteArray cl_utf8 = cl.toUtf8();
3306 modelica_boolean result;
3307
3308 try {
3309 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
3310
3311 result = omc_OpenModelicaScriptingAPI_isOperatorFunction(threadData, mmc_mk_scon(cl_utf8.constData()));
3312
3313 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
3314 } catch(std::exception &exception) {
3315 emit throwException(QString("isOperatorFunction failed. %1").arg(exception.what()));
3316 }
3317
3318 QString responseLog;
3319 responseLog.append(result ? "true" : "false");
3320 emit logResponse("isOperatorFunction("+commandLog+")", responseLog, &commandTime);
3321
3322 return result;
3323}
3324modelica_boolean OMCInterface::isOperatorRecord(QString cl)
3325{
3326 QTime commandTime;
3327 commandTime.start();
3328 QString commandLog;
3329 commandLog.append(cl);
3330 emit logCommand("isOperatorRecord("+commandLog+")", &commandTime);
3331
3332 QByteArray cl_utf8 = cl.toUtf8();
3333 modelica_boolean result;
3334
3335 try {
3336 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
3337
3338 result = omc_OpenModelicaScriptingAPI_isOperatorRecord(threadData, mmc_mk_scon(cl_utf8.constData()));
3339
3340 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
3341 } catch(std::exception &exception) {
3342 emit throwException(QString("isOperatorRecord failed. %1").arg(exception.what()));
3343 }
3344
3345 QString responseLog;
3346 responseLog.append(result ? "true" : "false");
3347 emit logResponse("isOperatorRecord("+commandLog+")", responseLog, &commandTime);
3348
3349 return result;
3350}
3351modelica_boolean OMCInterface::isOperator(QString cl)
3352{
3353 QTime commandTime;
3354 commandTime.start();
3355 QString commandLog;
3356 commandLog.append(cl);
3357 emit logCommand("isOperator("+commandLog+")", &commandTime);
3358
3359 QByteArray cl_utf8 = cl.toUtf8();
3360 modelica_boolean result;
3361
3362 try {
3363 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
3364
3365 result = omc_OpenModelicaScriptingAPI_isOperator(threadData, mmc_mk_scon(cl_utf8.constData()));
3366
3367 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
3368 } catch(std::exception &exception) {
3369 emit throwException(QString("isOperator failed. %1").arg(exception.what()));
3370 }
3371
3372 QString responseLog;
3373 responseLog.append(result ? "true" : "false");
3374 emit logResponse("isOperator("+commandLog+")", responseLog, &commandTime);
3375
3376 return result;
3377}
3378modelica_boolean OMCInterface::isEnumeration(QString cl)
3379{
3380 QTime commandTime;
3381 commandTime.start();
3382 QString commandLog;
3383 commandLog.append(cl);
3384 emit logCommand("isEnumeration("+commandLog+")", &commandTime);
3385
3386 QByteArray cl_utf8 = cl.toUtf8();
3387 modelica_boolean result;
3388
3389 try {
3390 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
3391
3392 result = omc_OpenModelicaScriptingAPI_isEnumeration(threadData, mmc_mk_scon(cl_utf8.constData()));
3393
3394 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
3395 } catch(std::exception &exception) {
3396 emit throwException(QString("isEnumeration failed. %1").arg(exception.what()));
3397 }
3398
3399 QString responseLog;
3400 responseLog.append(result ? "true" : "false");
3401 emit logResponse("isEnumeration("+commandLog+")", responseLog, &commandTime);
3402
3403 return result;
3404}
3405modelica_boolean OMCInterface::isOptimization(QString cl)
3406{
3407 QTime commandTime;
3408 commandTime.start();
3409 QString commandLog;
3410 commandLog.append(cl);
3411 emit logCommand("isOptimization("+commandLog+")", &commandTime);
3412
3413 QByteArray cl_utf8 = cl.toUtf8();
3414 modelica_boolean result;
3415
3416 try {
3417 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
3418
3419 result = omc_OpenModelicaScriptingAPI_isOptimization(threadData, mmc_mk_scon(cl_utf8.constData()));
3420
3421 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
3422 } catch(std::exception &exception) {
3423 emit throwException(QString("isOptimization failed. %1").arg(exception.what()));
3424 }
3425
3426 QString responseLog;
3427 responseLog.append(result ? "true" : "false");
3428 emit logResponse("isOptimization("+commandLog+")", responseLog, &commandTime);
3429
3430 return result;
3431}
3432modelica_boolean OMCInterface::isConnector(QString cl)
3433{
3434 QTime commandTime;
3435 commandTime.start();
3436 QString commandLog;
3437 commandLog.append(cl);
3438 emit logCommand("isConnector("+commandLog+")", &commandTime);
3439
3440 QByteArray cl_utf8 = cl.toUtf8();
3441 modelica_boolean result;
3442
3443 try {
3444 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
3445
3446 result = omc_OpenModelicaScriptingAPI_isConnector(threadData, mmc_mk_scon(cl_utf8.constData()));
3447
3448 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
3449 } catch(std::exception &exception) {
3450 emit throwException(QString("isConnector failed. %1").arg(exception.what()));
3451 }
3452
3453 QString responseLog;
3454 responseLog.append(result ? "true" : "false");
3455 emit logResponse("isConnector("+commandLog+")", responseLog, &commandTime);
3456
3457 return result;
3458}
3459modelica_boolean OMCInterface::isModel(QString cl)
3460{
3461 QTime commandTime;
3462 commandTime.start();
3463 QString commandLog;
3464 commandLog.append(cl);
3465 emit logCommand("isModel("+commandLog+")", &commandTime);
3466
3467 QByteArray cl_utf8 = cl.toUtf8();
3468 modelica_boolean result;
3469
3470 try {
3471 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
3472
3473 result = omc_OpenModelicaScriptingAPI_isModel(threadData, mmc_mk_scon(cl_utf8.constData()));
3474
3475 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
3476 } catch(std::exception &exception) {
3477 emit throwException(QString("isModel failed. %1").arg(exception.what()));
3478 }
3479
3480 QString responseLog;
3481 responseLog.append(result ? "true" : "false");
3482 emit logResponse("isModel("+commandLog+")", responseLog, &commandTime);
3483
3484 return result;
3485}
3486modelica_boolean OMCInterface::isPartial(QString cl)
3487{
3488 QTime commandTime;
3489 commandTime.start();
3490 QString commandLog;
3491 commandLog.append(cl);
3492 emit logCommand("isPartial("+commandLog+")", &commandTime);
3493
3494 QByteArray cl_utf8 = cl.toUtf8();
3495 modelica_boolean result;
3496
3497 try {
3498 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
3499
3500 result = omc_OpenModelicaScriptingAPI_isPartial(threadData, mmc_mk_scon(cl_utf8.constData()));
3501
3502 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
3503 } catch(std::exception &exception) {
3504 emit throwException(QString("isPartial failed. %1").arg(exception.what()));
3505 }
3506
3507 QString responseLog;
3508 responseLog.append(result ? "true" : "false");
3509 emit logResponse("isPartial("+commandLog+")", responseLog, &commandTime);
3510
3511 return result;
3512}
3513modelica_boolean OMCInterface::isFunction(QString cl)
3514{
3515 QTime commandTime;
3516 commandTime.start();
3517 QString commandLog;
3518 commandLog.append(cl);
3519 emit logCommand("isFunction("+commandLog+")", &commandTime);
3520
3521 QByteArray cl_utf8 = cl.toUtf8();
3522 modelica_boolean result;
3523
3524 try {
3525 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
3526
3527 result = omc_OpenModelicaScriptingAPI_isFunction(threadData, mmc_mk_scon(cl_utf8.constData()));
3528
3529 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
3530 } catch(std::exception &exception) {
3531 emit throwException(QString("isFunction failed. %1").arg(exception.what()));
3532 }
3533
3534 QString responseLog;
3535 responseLog.append(result ? "true" : "false");
3536 emit logResponse("isFunction("+commandLog+")", responseLog, &commandTime);
3537
3538 return result;
3539}
3540modelica_boolean OMCInterface::isBlock(QString cl)
3541{
3542 QTime commandTime;
3543 commandTime.start();
3544 QString commandLog;
3545 commandLog.append(cl);
3546 emit logCommand("isBlock("+commandLog+")", &commandTime);
3547
3548 QByteArray cl_utf8 = cl.toUtf8();
3549 modelica_boolean result;
3550
3551 try {
3552 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
3553
3554 result = omc_OpenModelicaScriptingAPI_isBlock(threadData, mmc_mk_scon(cl_utf8.constData()));
3555
3556 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
3557 } catch(std::exception &exception) {
3558 emit throwException(QString("isBlock failed. %1").arg(exception.what()));
3559 }
3560
3561 QString responseLog;
3562 responseLog.append(result ? "true" : "false");
3563 emit logResponse("isBlock("+commandLog+")", responseLog, &commandTime);
3564
3565 return result;
3566}
3567modelica_boolean OMCInterface::isRecord(QString cl)
3568{
3569 QTime commandTime;
3570 commandTime.start();
3571 QString commandLog;
3572 commandLog.append(cl);
3573 emit logCommand("isRecord("+commandLog+")", &commandTime);
3574
3575 QByteArray cl_utf8 = cl.toUtf8();
3576 modelica_boolean result;
3577
3578 try {
3579 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
3580
3581 result = omc_OpenModelicaScriptingAPI_isRecord(threadData, mmc_mk_scon(cl_utf8.constData()));
3582
3583 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
3584 } catch(std::exception &exception) {
3585 emit throwException(QString("isRecord failed. %1").arg(exception.what()));
3586 }
3587
3588 QString responseLog;
3589 responseLog.append(result ? "true" : "false");
3590 emit logResponse("isRecord("+commandLog+")", responseLog, &commandTime);
3591
3592 return result;
3593}
3594modelica_boolean OMCInterface::isClass(QString cl)
3595{
3596 QTime commandTime;
3597 commandTime.start();
3598 QString commandLog;
3599 commandLog.append(cl);
3600 emit logCommand("isClass("+commandLog+")", &commandTime);
3601
3602 QByteArray cl_utf8 = cl.toUtf8();
3603 modelica_boolean result;
3604
3605 try {
3606 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
3607
3608 result = omc_OpenModelicaScriptingAPI_isClass(threadData, mmc_mk_scon(cl_utf8.constData()));
3609
3610 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
3611 } catch(std::exception &exception) {
3612 emit throwException(QString("isClass failed. %1").arg(exception.what()));
3613 }
3614
3615 QString responseLog;
3616 responseLog.append(result ? "true" : "false");
3617 emit logResponse("isClass("+commandLog+")", responseLog, &commandTime);
3618
3619 return result;
3620}
3621modelica_boolean OMCInterface::isPackage(QString cl)
3622{
3623 QTime commandTime;
3624 commandTime.start();
3625 QString commandLog;
3626 commandLog.append(cl);
3627 emit logCommand("isPackage("+commandLog+")", &commandTime);
3628
3629 QByteArray cl_utf8 = cl.toUtf8();
3630 modelica_boolean result;
3631
3632 try {
3633 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
3634
3635 result = omc_OpenModelicaScriptingAPI_isPackage(threadData, mmc_mk_scon(cl_utf8.constData()));
3636
3637 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
3638 } catch(std::exception &exception) {
3639 emit throwException(QString("isPackage failed. %1").arg(exception.what()));
3640 }
3641
3642 QString responseLog;
3643 responseLog.append(result ? "true" : "false");
3644 emit logResponse("isPackage("+commandLog+")", responseLog, &commandTime);
3645
3646 return result;
3647}
3648modelica_boolean OMCInterface::isType(QString cl)
3649{
3650 QTime commandTime;
3651 commandTime.start();
3652 QString commandLog;
3653 commandLog.append(cl);
3654 emit logCommand("isType("+commandLog+")", &commandTime);
3655
3656 QByteArray cl_utf8 = cl.toUtf8();
3657 modelica_boolean result;
3658
3659 try {
3660 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
3661
3662 result = omc_OpenModelicaScriptingAPI_isType(threadData, mmc_mk_scon(cl_utf8.constData()));
3663
3664 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
3665 } catch(std::exception &exception) {
3666 emit throwException(QString("isType failed. %1").arg(exception.what()));
3667 }
3668
3669 QString responseLog;
3670 responseLog.append(result ? "true" : "false");
3671 emit logResponse("isType("+commandLog+")", responseLog, &commandTime);
3672
3673 return result;
3674}
3675QString OMCInterface::getClassRestriction(QString cl)
3676{
3677 QTime commandTime;
3678 commandTime.start();
3679 QString commandLog;
3680 commandLog.append(cl);
3681 emit logCommand("getClassRestriction("+commandLog+")", &commandTime);
3682
3683 QByteArray cl_utf8 = cl.toUtf8();
3684 QString result;
3685 void *result_mm = NULL__null;
3686
3687 try {
3688 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
3689
3690 result_mm = omc_OpenModelicaScriptingAPI_getClassRestriction(threadData, mmc_mk_scon(cl_utf8.constData()));
3691 result = QString::fromUtf8(MMC_STRINGDATA(result_mm)(((struct mmc_string*)((void*)((char*)(result_mm) - 3)))->
data)
);
3692
3693 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
3694 } catch(std::exception &exception) {
3695 emit throwException(QString("getClassRestriction failed. %1").arg(exception.what()));
3696 }
3697
3698 QString responseLog;
3699 responseLog.append("\"" + result + "\"");
3700 emit logResponse("getClassRestriction("+commandLog+")", responseLog, &commandTime);
3701
3702 return result;
3703}
3704QString OMCInterface::basename(QString path)
3705{
3706 QTime commandTime;
3707 commandTime.start();
3708 QString commandLog;
3709 commandLog.append("\"" + path + "\"");
3710 emit logCommand("basename("+commandLog+")", &commandTime);
3711
3712 QByteArray path_utf8 = path.toUtf8();
3713 QString result;
3714 void *result_mm = NULL__null;
3715
3716 try {
3717 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
3718
3719 result_mm = omc_OpenModelicaScriptingAPI_basename(threadData, mmc_mk_scon(path_utf8.constData()));
3720 result = QString::fromUtf8(MMC_STRINGDATA(result_mm)(((struct mmc_string*)((void*)((char*)(result_mm) - 3)))->
data)
);
3721
3722 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
3723 } catch(std::exception &exception) {
3724 emit throwException(QString("basename failed. %1").arg(exception.what()));
3725 }
3726
3727 QString responseLog;
3728 responseLog.append("\"" + result + "\"");
3729 emit logResponse("basename("+commandLog+")", responseLog, &commandTime);
3730
3731 return result;
3732}
3733QString OMCInterface::dirname(QString path)
3734{
3735 QTime commandTime;
3736 commandTime.start();
3737 QString commandLog;
3738 commandLog.append("\"" + path + "\"");
3739 emit logCommand("dirname("+commandLog+")", &commandTime);
3740
3741 QByteArray path_utf8 = path.toUtf8();
3742 QString result;
3743 void *result_mm = NULL__null;
3744
3745 try {
3746 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
3747
3748 result_mm = omc_OpenModelicaScriptingAPI_dirname(threadData, mmc_mk_scon(path_utf8.constData()));
3749 result = QString::fromUtf8(MMC_STRINGDATA(result_mm)(((struct mmc_string*)((void*)((char*)(result_mm) - 3)))->
data)
);
3750
3751 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
3752 } catch(std::exception &exception) {
3753 emit throwException(QString("dirname failed. %1").arg(exception.what()));
3754 }
3755
3756 QString responseLog;
3757 responseLog.append("\"" + result + "\"");
3758 emit logResponse("dirname("+commandLog+")", responseLog, &commandTime);
3759
3760 return result;
3761}
3762QString OMCInterface::getClassComment(QString cl)
3763{
3764 QTime commandTime;
3765 commandTime.start();
3766 QString commandLog;
3767 commandLog.append(cl);
3768 emit logCommand("getClassComment("+commandLog+")", &commandTime);
3769
3770 QByteArray cl_utf8 = cl.toUtf8();
3771 QString result;
3772 void *result_mm = NULL__null;
3773
3774 try {
3775 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
3776
3777 result_mm = omc_OpenModelicaScriptingAPI_getClassComment(threadData, mmc_mk_scon(cl_utf8.constData()));
3778 result = QString::fromUtf8(MMC_STRINGDATA(result_mm)(((struct mmc_string*)((void*)((char*)(result_mm) - 3)))->
data)
);
3779
3780 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
3781 } catch(std::exception &exception) {
3782 emit throwException(QString("getClassComment failed. %1").arg(exception.what()));
3783 }
3784
3785 QString responseLog;
3786 responseLog.append("\"" + result + "\"");
3787 emit logResponse("getClassComment("+commandLog+")", responseLog, &commandTime);
3788
3789 return result;
3790}
3791QList<QString > OMCInterface::typeNameStrings(QString cl)
3792{
3793 QTime commandTime;
3794 commandTime.start();
3795 QString commandLog;
3796 commandLog.append(cl);
3797 emit logCommand("typeNameStrings("+commandLog+")", &commandTime);
3798
3799 QByteArray cl_utf8 = cl.toUtf8();
3800 QList<QString > result;
3801 void *result_mm = NULL__null;
3802
3803 try {
3804 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
3805
3806 result_mm = omc_OpenModelicaScriptingAPI_typeNameStrings(threadData, mmc_mk_scon(cl_utf8.constData()));
3807 result.clear();
3808 while (!listEmpty(result_mm)((*(mmc_uint_t*)((void*)((char*)(result_mm) - 3))) == (((0) <<
10) + (((0) & 255) << 2)))
) {
3809 QString result_elt;
3810 result_elt = MMC_STRINGDATA(MMC_CAR(result_mm))(((struct mmc_string*)((void*)((char*)((*(void**)(((void*)((void
**)(((void*)((char*)(result_mm) - 3))) + (1)))))) - 3)))->
data)
;
3811 result.push_back(result_elt);
3812 result_mm = MMC_CDR(result_mm)(*(void**)(((void*)((void**)(((void*)((char*)(result_mm) - 3)
)) + (2)))))
;
3813 }
3814
3815 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
3816 } catch(std::exception &exception) {
3817 emit throwException(QString("typeNameStrings failed. %1").arg(exception.what()));
3818 }
3819
3820 QString responseLog;
3821 responseLog.append("{");
3822 int result_i = 0;
3823 foreach(QString result_elt, result)for (auto _container_ = QtPrivate::qMakeForeachContainer(result
); _container_.control && _container_.i != _container_
.e; ++_container_.i, _container_.control ^= 1) for (QString result_elt
= *_container_.i; _container_.control; _container_.control =
0)
{
3824 if (result_i) {
3825 responseLog.append(",");
3826 }
3827 responseLog.append("\"" + result_elt + "\"");
3828 result_i++;
3829 }
3830 responseLog.append("}");
3831 emit logResponse("typeNameStrings("+commandLog+")", responseLog, &commandTime);
3832
3833 return result;
3834}
3835QString OMCInterface::typeNameString(QString cl)
3836{
3837 QTime commandTime;
3838 commandTime.start();
3839 QString commandLog;
3840 commandLog.append(cl);
3841 emit logCommand("typeNameString("+commandLog+")", &commandTime);
3842
3843 QByteArray cl_utf8 = cl.toUtf8();
3844 QString result;
3845 void *result_mm = NULL__null;
3846
3847 try {
3848 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
3849
3850 result_mm = omc_OpenModelicaScriptingAPI_typeNameString(threadData, mmc_mk_scon(cl_utf8.constData()));
3851 result = QString::fromUtf8(MMC_STRINGDATA(result_mm)(((struct mmc_string*)((void*)((char*)(result_mm) - 3)))->
data)
);
3852
3853 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
3854 } catch(std::exception &exception) {
3855 emit throwException(QString("typeNameString failed. %1").arg(exception.what()));
3856 }
3857
3858 QString responseLog;
3859 responseLog.append("\"" + result + "\"");
3860 emit logResponse("typeNameString("+commandLog+")", responseLog, &commandTime);
3861
3862 return result;
3863}
3864QString OMCInterface::stringTypeName(QString str)
3865{
3866 QTime commandTime;
3867 commandTime.start();
3868 QString commandLog;
3869 commandLog.append("\"" + str + "\"");
3870 emit logCommand("stringTypeName("+commandLog+")", &commandTime);
3871
3872 QByteArray str_utf8 = str.toUtf8();
3873 QString result;
3874 void *result_mm = NULL__null;
3875
3876 try {
3877 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
3878
3879 result_mm = omc_OpenModelicaScriptingAPI_stringTypeName(threadData, mmc_mk_scon(str_utf8.constData()));
3880 result = QString::fromUtf8(MMC_STRINGDATA(result_mm)(((struct mmc_string*)((void*)((char*)(result_mm) - 3)))->
data)
);
3881
3882 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
3883 } catch(std::exception &exception) {
3884 emit throwException(QString("stringTypeName failed. %1").arg(exception.what()));
3885 }
3886
3887 QString responseLog;
3888 responseLog.append(result);
3889 emit logResponse("stringTypeName("+commandLog+")", responseLog, &commandTime);
3890
3891 return result;
3892}
3893OMCInterface::getTimeStamp_res OMCInterface::getTimeStamp(QString cl)
3894{
3895 QTime commandTime;
3896 commandTime.start();
3897 QString commandLog;
3898 commandLog.append(cl);
3899 emit logCommand("getTimeStamp("+commandLog+")", &commandTime);
3900
3901 QByteArray cl_utf8 = cl.toUtf8();
3902 getTimeStamp_res result;
3903 void *out2_mm = NULL__null;
3904
3905 try {
3906 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
3907
3908 result.timeStamp = omc_OpenModelicaScriptingAPI_getTimeStamp(threadData, mmc_mk_scon(cl_utf8.constData()), &out2_mm);
3909 result.timeStampAsString = QString::fromUtf8(MMC_STRINGDATA(out2_mm)(((struct mmc_string*)((void*)((char*)(out2_mm) - 3)))->data
)
);
3910
3911 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
3912 } catch(std::exception &exception) {
3913 emit throwException(QString("getTimeStamp failed. %1").arg(exception.what()));
3914 }
3915
3916 QString responseLog;
3917 responseLog.append(result.toString());
3918 emit logResponse("getTimeStamp("+commandLog+")", responseLog, &commandTime);
3919
3920 return result;
3921}
3922modelica_boolean OMCInterface::setDocumentationAnnotation(QString class_, QString info, QString revisions)
3923{
3924 QTime commandTime;
3925 commandTime.start();
3926 QString commandLog;
3927 commandLog.append(class_);
3928 commandLog.append(",");
3929 commandLog.append("\"" + info + "\"");
3930 commandLog.append(",");
3931 commandLog.append("\"" + revisions + "\"");
3932 emit logCommand("setDocumentationAnnotation("+commandLog+")", &commandTime);
3933
3934 QByteArray class__utf8 = class_.toUtf8();
3935 QByteArray info_utf8 = info.toUtf8();
3936 QByteArray revisions_utf8 = revisions.toUtf8();
3937 modelica_boolean result;
3938
3939 try {
3940 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
3941
3942 result = omc_OpenModelicaScriptingAPI_setDocumentationAnnotation(threadData, mmc_mk_scon(class__utf8.constData()), mmc_mk_scon(info_utf8.constData()), mmc_mk_scon(revisions_utf8.constData()));
3943
3944 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
3945 } catch(std::exception &exception) {
3946 emit throwException(QString("setDocumentationAnnotation failed. %1").arg(exception.what()));
3947 }
3948
3949 QString responseLog;
3950 responseLog.append(result ? "true" : "false");
3951 emit logResponse("setDocumentationAnnotation("+commandLog+")", responseLog, &commandTime);
3952
3953 return result;
3954}
3955QList<QString > OMCInterface::getDocumentationAnnotation(QString cl)
3956{
3957 QTime commandTime;
3958 commandTime.start();
3959 QString commandLog;
3960 commandLog.append(cl);
3961 emit logCommand("getDocumentationAnnotation("+commandLog+")", &commandTime);
3962
3963 QByteArray cl_utf8 = cl.toUtf8();
3964 QList<QString > result;
3965 void *result_mm = NULL__null;
3966
3967 try {
3968 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
3969
3970 result_mm = omc_OpenModelicaScriptingAPI_getDocumentationAnnotation(threadData, mmc_mk_scon(cl_utf8.constData()));
3971 result.clear();
3972 while (!listEmpty(result_mm)((*(mmc_uint_t*)((void*)((char*)(result_mm) - 3))) == (((0) <<
10) + (((0) & 255) << 2)))
) {
3973 QString result_elt;
3974 result_elt = MMC_STRINGDATA(MMC_CAR(result_mm))(((struct mmc_string*)((void*)((char*)((*(void**)(((void*)((void
**)(((void*)((char*)(result_mm) - 3))) + (1)))))) - 3)))->
data)
;
3975 result.push_back(result_elt);
3976 result_mm = MMC_CDR(result_mm)(*(void**)(((void*)((void**)(((void*)((char*)(result_mm) - 3)
)) + (2)))))
;
3977 }
3978
3979 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
3980 } catch(std::exception &exception) {
3981 emit throwException(QString("getDocumentationAnnotation failed. %1").arg(exception.what()));
3982 }
3983
3984 QString responseLog;
3985 responseLog.append("{");
3986 int result_i = 0;
3987 foreach(QString result_elt, result)for (auto _container_ = QtPrivate::qMakeForeachContainer(result
); _container_.control && _container_.i != _container_
.e; ++_container_.i, _container_.control ^= 1) for (QString result_elt
= *_container_.i; _container_.control; _container_.control =
0)
{
3988 if (result_i) {
3989 responseLog.append(",");
3990 }
3991 responseLog.append("\"" + result_elt + "\"");
3992 result_i++;
3993 }
3994 responseLog.append("}");
3995 emit logResponse("getDocumentationAnnotation("+commandLog+")", responseLog, &commandTime);
3996
3997 return result;
3998}
3999QString OMCInterface::iconv(QString string, QString from, QString to)
4000{
4001 QTime commandTime;
4002 commandTime.start();
4003 QString commandLog;
4004 commandLog.append("\"" + string + "\"");
4005 commandLog.append(",");
4006 commandLog.append("\"" + from + "\"");
4007 commandLog.append(",");
4008 commandLog.append("\"" + to + "\"");
4009 emit logCommand("iconv("+commandLog+")", &commandTime);
4010
4011 QByteArray string_utf8 = string.toUtf8();
4012 QByteArray from_utf8 = from.toUtf8();
4013 QByteArray to_utf8 = to.toUtf8();
4014 QString result;
4015 void *result_mm = NULL__null;
4016
4017 try {
4018 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
4019
4020 result_mm = omc_OpenModelicaScriptingAPI_iconv(threadData, mmc_mk_scon(string_utf8.constData()), mmc_mk_scon(from_utf8.constData()), mmc_mk_scon(to_utf8.constData()));
4021 result = QString::fromUtf8(MMC_STRINGDATA(result_mm)(((struct mmc_string*)((void*)((char*)(result_mm) - 3)))->
data)
);
4022
4023 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
4024 } catch(std::exception &exception) {
4025 emit throwException(QString("iconv failed. %1").arg(exception.what()));
4026 }
4027
4028 QString responseLog;
4029 responseLog.append("\"" + result + "\"");
4030 emit logResponse("iconv("+commandLog+")", responseLog, &commandTime);
4031
4032 return result;
4033}
4034QList<QString > OMCInterface::getNthImport(QString class_, modelica_integer index)
4035{
4036 QTime commandTime;
4037 commandTime.start();
4038 QString commandLog;
4039 commandLog.append(class_);
4040 commandLog.append(",");
4041 commandLog.append(QString::number(index));
4042 emit logCommand("getNthImport("+commandLog+")", &commandTime);
4043
4044 QByteArray class__utf8 = class_.toUtf8();
4045 QList<QString > result;
4046 void *result_mm = NULL__null;
4047
4048 try {
4049 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
4050
4051 result_mm = omc_OpenModelicaScriptingAPI_getNthImport(threadData, mmc_mk_scon(class__utf8.constData()), index);
4052 result.clear();
4053 while (!listEmpty(result_mm)((*(mmc_uint_t*)((void*)((char*)(result_mm) - 3))) == (((0) <<
10) + (((0) & 255) << 2)))
) {
4054 QString result_elt;
4055 result_elt = MMC_STRINGDATA(MMC_CAR(result_mm))(((struct mmc_string*)((void*)((char*)((*(void**)(((void*)((void
**)(((void*)((char*)(result_mm) - 3))) + (1)))))) - 3)))->
data)
;
4056 result.push_back(result_elt);
4057 result_mm = MMC_CDR(result_mm)(*(void**)(((void*)((void**)(((void*)((char*)(result_mm) - 3)
)) + (2)))))
;
4058 }
4059
4060 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
4061 } catch(std::exception &exception) {
4062 emit throwException(QString("getNthImport failed. %1").arg(exception.what()));
4063 }
4064
4065 QString responseLog;
4066 responseLog.append("{");
4067 int result_i = 0;
4068 foreach(QString result_elt, result)for (auto _container_ = QtPrivate::qMakeForeachContainer(result
); _container_.control && _container_.i != _container_
.e; ++_container_.i, _container_.control ^= 1) for (QString result_elt
= *_container_.i; _container_.control; _container_.control =
0)
{
4069 if (result_i) {
4070 responseLog.append(",");
4071 }
4072 responseLog.append("\"" + result_elt + "\"");
4073 result_i++;
4074 }
4075 responseLog.append("}");
4076 emit logResponse("getNthImport("+commandLog+")", responseLog, &commandTime);
4077
4078 return result;
4079}
4080modelica_integer OMCInterface::getImportCount(QString class_)
4081{
4082 QTime commandTime;
4083 commandTime.start();
4084 QString commandLog;
4085 commandLog.append(class_);
4086 emit logCommand("getImportCount("+commandLog+")", &commandTime);
4087
4088 QByteArray class__utf8 = class_.toUtf8();
4089 modelica_integer result;
4090
4091 try {
4092 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
4093
4094 result = omc_OpenModelicaScriptingAPI_getImportCount(threadData, mmc_mk_scon(class__utf8.constData()));
4095
4096 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
4097 } catch(std::exception &exception) {
4098 emit throwException(QString("getImportCount failed. %1").arg(exception.what()));
4099 }
4100
4101 QString responseLog;
4102 responseLog.append(QString::number(result));
4103 emit logResponse("getImportCount("+commandLog+")", responseLog, &commandTime);
4104
4105 return result;
4106}
4107QString OMCInterface::getNthAnnotationString(QString class_, modelica_integer index)
4108{
4109 QTime commandTime;
4110 commandTime.start();
4111 QString commandLog;
4112 commandLog.append(class_);
4113 commandLog.append(",");
4114 commandLog.append(QString::number(index));
4115 emit logCommand("getNthAnnotationString("+commandLog+")", &commandTime);
4116
4117 QByteArray class__utf8 = class_.toUtf8();
4118 QString result;
4119 void *result_mm = NULL__null;
4120
4121 try {
4122 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
4123
4124 result_mm = omc_OpenModelicaScriptingAPI_getNthAnnotationString(threadData, mmc_mk_scon(class__utf8.constData()), index);
4125 result = QString::fromUtf8(MMC_STRINGDATA(result_mm)(((struct mmc_string*)((void*)((char*)(result_mm) - 3)))->
data)
);
4126
4127 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
4128 } catch(std::exception &exception) {
4129 emit throwException(QString("getNthAnnotationString failed. %1").arg(exception.what()));
4130 }
4131
4132 QString responseLog;
4133 responseLog.append("\"" + result + "\"");
4134 emit logResponse("getNthAnnotationString("+commandLog+")", responseLog, &commandTime);
4135
4136 return result;
4137}
4138modelica_integer OMCInterface::getAnnotationCount(QString class_)
4139{
4140 QTime commandTime;
4141 commandTime.start();
4142 QString commandLog;
4143 commandLog.append(class_);
4144 emit logCommand("getAnnotationCount("+commandLog+")", &commandTime);
4145
4146 QByteArray class__utf8 = class_.toUtf8();
4147 modelica_integer result;
4148
4149 try {
4150 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
4151
4152 result = omc_OpenModelicaScriptingAPI_getAnnotationCount(threadData, mmc_mk_scon(class__utf8.constData()));
4153
4154 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
4155 } catch(std::exception &exception) {
4156 emit throwException(QString("getAnnotationCount failed. %1").arg(exception.what()));
4157 }
4158
4159 QString responseLog;
4160 responseLog.append(QString::number(result));
4161 emit logResponse("getAnnotationCount("+commandLog+")", responseLog, &commandTime);
4162
4163 return result;
4164}
4165QString OMCInterface::getNthInitialEquationItem(QString class_, modelica_integer index)
4166{
4167 QTime commandTime;
4168 commandTime.start();
4169 QString commandLog;
4170 commandLog.append(class_);
4171 commandLog.append(",");
4172 commandLog.append(QString::number(index));
4173 emit logCommand("getNthInitialEquationItem("+commandLog+")", &commandTime);
4174
4175 QByteArray class__utf8 = class_.toUtf8();
4176 QString result;
4177 void *result_mm = NULL__null;
4178
4179 try {
4180 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
4181
4182 result_mm = omc_OpenModelicaScriptingAPI_getNthInitialEquationItem(threadData, mmc_mk_scon(class__utf8.constData()), index);
4183 result = QString::fromUtf8(MMC_STRINGDATA(result_mm)(((struct mmc_string*)((void*)((char*)(result_mm) - 3)))->
data)
);
4184
4185 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
4186 } catch(std::exception &exception) {
4187 emit throwException(QString("getNthInitialEquationItem failed. %1").arg(exception.what()));
4188 }
4189
4190 QString responseLog;
4191 responseLog.append("\"" + result + "\"");
4192 emit logResponse("getNthInitialEquationItem("+commandLog+")", responseLog, &commandTime);
4193
4194 return result;
4195}
4196modelica_integer OMCInterface::getInitialEquationItemsCount(QString class_)
4197{
4198 QTime commandTime;
4199 commandTime.start();
4200 QString commandLog;
4201 commandLog.append(class_);
4202 emit logCommand("getInitialEquationItemsCount("+commandLog+")", &commandTime);
4203
4204 QByteArray class__utf8 = class_.toUtf8();
4205 modelica_integer result;
4206
4207 try {
4208 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
4209
4210 result = omc_OpenModelicaScriptingAPI_getInitialEquationItemsCount(threadData, mmc_mk_scon(class__utf8.constData()));
4211
4212 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
4213 } catch(std::exception &exception) {
4214 emit throwException(QString("getInitialEquationItemsCount failed. %1").arg(exception.what()));
4215 }
4216
4217 QString responseLog;
4218 responseLog.append(QString::number(result));
4219 emit logResponse("getInitialEquationItemsCount("+commandLog+")", responseLog, &commandTime);
4220
4221 return result;
4222}
4223QString OMCInterface::getNthEquationItem(QString class_, modelica_integer index)
4224{
4225 QTime commandTime;
4226 commandTime.start();
4227 QString commandLog;
4228 commandLog.append(class_);
4229 commandLog.append(",");
4230 commandLog.append(QString::number(index));
4231 emit logCommand("getNthEquationItem("+commandLog+")", &commandTime);
4232
4233 QByteArray class__utf8 = class_.toUtf8();
4234 QString result;
4235 void *result_mm = NULL__null;
4236
4237 try {
4238 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
4239
4240 result_mm = omc_OpenModelicaScriptingAPI_getNthEquationItem(threadData, mmc_mk_scon(class__utf8.constData()), index);
4241 result = QString::fromUtf8(MMC_STRINGDATA(result_mm)(((struct mmc_string*)((void*)((char*)(result_mm) - 3)))->
data)
);
4242
4243 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
4244 } catch(std::exception &exception) {
4245 emit throwException(QString("getNthEquationItem failed. %1").arg(exception.what()));
4246 }
4247
4248 QString responseLog;
4249 responseLog.append("\"" + result + "\"");
4250 emit logResponse("getNthEquationItem("+commandLog+")", responseLog, &commandTime);
4251
4252 return result;
4253}
4254modelica_integer OMCInterface::getEquationItemsCount(QString class_)
4255{
4256 QTime commandTime;
4257 commandTime.start();
4258 QString commandLog;
4259 commandLog.append(class_);
4260 emit logCommand("getEquationItemsCount("+commandLog+")", &commandTime);
4261
4262 QByteArray class__utf8 = class_.toUtf8();
4263 modelica_integer result;
4264
4265 try {
4266 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
4267
4268 result = omc_OpenModelicaScriptingAPI_getEquationItemsCount(threadData, mmc_mk_scon(class__utf8.constData()));
4269
4270 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
4271 } catch(std::exception &exception) {
4272 emit throwException(QString("getEquationItemsCount failed. %1").arg(exception.what()));
4273 }
4274
4275 QString responseLog;
4276 responseLog.append(QString::number(result));
4277 emit logResponse("getEquationItemsCount("+commandLog+")", responseLog, &commandTime);
4278
4279 return result;
4280}
4281QString OMCInterface::getNthInitialEquation(QString class_, modelica_integer index)
4282{
4283 QTime commandTime;
4284 commandTime.start();
4285 QString commandLog;
4286 commandLog.append(class_);
4287 commandLog.append(",");
4288 commandLog.append(QString::number(index));
4289 emit logCommand("getNthInitialEquation("+commandLog+")", &commandTime);
4290
4291 QByteArray class__utf8 = class_.toUtf8();
4292 QString result;
4293 void *result_mm = NULL__null;
4294
4295 try {
4296 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
4297
4298 result_mm = omc_OpenModelicaScriptingAPI_getNthInitialEquation(threadData, mmc_mk_scon(class__utf8.constData()), index);
4299 result = QString::fromUtf8(MMC_STRINGDATA(result_mm)(((struct mmc_string*)((void*)((char*)(result_mm) - 3)))->
data)
);
4300
4301 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
4302 } catch(std::exception &exception) {
4303 emit throwException(QString("getNthInitialEquation failed. %1").arg(exception.what()));
4304 }
4305
4306 QString responseLog;
4307 responseLog.append("\"" + result + "\"");
4308 emit logResponse("getNthInitialEquation("+commandLog+")", responseLog, &commandTime);
4309
4310 return result;
4311}
4312modelica_integer OMCInterface::getInitialEquationCount(QString class_)
4313{
4314 QTime commandTime;
4315 commandTime.start();
4316 QString commandLog;
4317 commandLog.append(class_);
4318 emit logCommand("getInitialEquationCount("+commandLog+")", &commandTime);
4319
4320 QByteArray class__utf8 = class_.toUtf8();
4321 modelica_integer result;
4322
4323 try {
4324 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
4325
4326 result = omc_OpenModelicaScriptingAPI_getInitialEquationCount(threadData, mmc_mk_scon(class__utf8.constData()));
4327
4328 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
4329 } catch(std::exception &exception) {
4330 emit throwException(QString("getInitialEquationCount failed. %1").arg(exception.what()));
4331 }
4332
4333 QString responseLog;
4334 responseLog.append(QString::number(result));
4335 emit logResponse("getInitialEquationCount("+commandLog+")", responseLog, &commandTime);
4336
4337 return result;
4338}
4339QString OMCInterface::getNthEquation(QString class_, modelica_integer index)
4340{
4341 QTime commandTime;
4342 commandTime.start();
4343 QString commandLog;
4344 commandLog.append(class_);
4345 commandLog.append(",");
4346 commandLog.append(QString::number(index));
4347 emit logCommand("getNthEquation("+commandLog+")", &commandTime);
4348
4349 QByteArray class__utf8 = class_.toUtf8();
4350 QString result;
4351 void *result_mm = NULL__null;
4352
4353 try {
4354 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
4355
4356 result_mm = omc_OpenModelicaScriptingAPI_getNthEquation(threadData, mmc_mk_scon(class__utf8.constData()), index);
4357 result = QString::fromUtf8(MMC_STRINGDATA(result_mm)(((struct mmc_string*)((void*)((char*)(result_mm) - 3)))->
data)
);
4358
4359 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
4360 } catch(std::exception &exception) {
4361 emit throwException(QString("getNthEquation failed. %1").arg(exception.what()));
4362 }
4363
4364 QString responseLog;
4365 responseLog.append("\"" + result + "\"");
4366 emit logResponse("getNthEquation("+commandLog+")", responseLog, &commandTime);
4367
4368 return result;
4369}
4370modelica_integer OMCInterface::getEquationCount(QString class_)
4371{
4372 QTime commandTime;
4373 commandTime.start();
4374 QString commandLog;
4375 commandLog.append(class_);
4376 emit logCommand("getEquationCount("+commandLog+")", &commandTime);
4377
4378 QByteArray class__utf8 = class_.toUtf8();
4379 modelica_integer result;
4380
4381 try {
4382 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
4383
4384 result = omc_OpenModelicaScriptingAPI_getEquationCount(threadData, mmc_mk_scon(class__utf8.constData()));
4385
4386 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
4387 } catch(std::exception &exception) {
4388 emit throwException(QString("getEquationCount failed. %1").arg(exception.what()));
4389 }
4390
4391 QString responseLog;
4392 responseLog.append(QString::number(result));
4393 emit logResponse("getEquationCount("+commandLog+")", responseLog, &commandTime);
4394
4395 return result;
4396}
4397QString OMCInterface::getNthInitialAlgorithmItem(QString class_, modelica_integer index)
4398{
4399 QTime commandTime;
4400 commandTime.start();
4401 QString commandLog;
4402 commandLog.append(class_);
4403 commandLog.append(",");
4404 commandLog.append(QString::number(index));
4405 emit logCommand("getNthInitialAlgorithmItem("+commandLog+")", &commandTime);
4406
4407 QByteArray class__utf8 = class_.toUtf8();
4408 QString result;
4409 void *result_mm = NULL__null;
4410
4411 try {
4412 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
4413
4414 result_mm = omc_OpenModelicaScriptingAPI_getNthInitialAlgorithmItem(threadData, mmc_mk_scon(class__utf8.constData()), index);
4415 result = QString::fromUtf8(MMC_STRINGDATA(result_mm)(((struct mmc_string*)((void*)((char*)(result_mm) - 3)))->
data)
);
4416
4417 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
4418 } catch(std::exception &exception) {
4419 emit throwException(QString("getNthInitialAlgorithmItem failed. %1").arg(exception.what()));
4420 }
4421
4422 QString responseLog;
4423 responseLog.append("\"" + result + "\"");
4424 emit logResponse("getNthInitialAlgorithmItem("+commandLog+")", responseLog, &commandTime);
4425
4426 return result;
4427}
4428modelica_integer OMCInterface::getInitialAlgorithmItemsCount(QString class_)
4429{
4430 QTime commandTime;
4431 commandTime.start();
4432 QString commandLog;
4433 commandLog.append(class_);
4434 emit logCommand("getInitialAlgorithmItemsCount("+commandLog+")", &commandTime);
4435
4436 QByteArray class__utf8 = class_.toUtf8();
4437 modelica_integer result;
4438
4439 try {
4440 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
4441
4442 result = omc_OpenModelicaScriptingAPI_getInitialAlgorithmItemsCount(threadData, mmc_mk_scon(class__utf8.constData()));
4443
4444 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
4445 } catch(std::exception &exception) {
4446 emit throwException(QString("getInitialAlgorithmItemsCount failed. %1").arg(exception.what()));
4447 }
4448
4449 QString responseLog;
4450 responseLog.append(QString::number(result));
4451 emit logResponse("getInitialAlgorithmItemsCount("+commandLog+")", responseLog, &commandTime);
4452
4453 return result;
4454}
4455QString OMCInterface::getNthAlgorithmItem(QString class_, modelica_integer index)
4456{
4457 QTime commandTime;
4458 commandTime.start();
4459 QString commandLog;
4460 commandLog.append(class_);
4461 commandLog.append(",");
4462 commandLog.append(QString::number(index));
4463 emit logCommand("getNthAlgorithmItem("+commandLog+")", &commandTime);
4464
4465 QByteArray class__utf8 = class_.toUtf8();
4466 QString result;
4467 void *result_mm = NULL__null;
4468
4469 try {
4470 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
4471
4472 result_mm = omc_OpenModelicaScriptingAPI_getNthAlgorithmItem(threadData, mmc_mk_scon(class__utf8.constData()), index);
4473 result = QString::fromUtf8(MMC_STRINGDATA(result_mm)(((struct mmc_string*)((void*)((char*)(result_mm) - 3)))->
data)
);
4474
4475 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
4476 } catch(std::exception &exception) {
4477 emit throwException(QString("getNthAlgorithmItem failed. %1").arg(exception.what()));
4478 }
4479
4480 QString responseLog;
4481 responseLog.append("\"" + result + "\"");
4482 emit logResponse("getNthAlgorithmItem("+commandLog+")", responseLog, &commandTime);
4483
4484 return result;
4485}
4486modelica_integer OMCInterface::getAlgorithmItemsCount(QString class_)
4487{
4488 QTime commandTime;
4489 commandTime.start();
4490 QString commandLog;
4491 commandLog.append(class_);
4492 emit logCommand("getAlgorithmItemsCount("+commandLog+")", &commandTime);
4493
4494 QByteArray class__utf8 = class_.toUtf8();
4495 modelica_integer result;
4496
4497 try {
4498 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
4499
4500 result = omc_OpenModelicaScriptingAPI_getAlgorithmItemsCount(threadData, mmc_mk_scon(class__utf8.constData()));
4501
4502 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
4503 } catch(std::exception &exception) {
4504 emit throwException(QString("getAlgorithmItemsCount failed. %1").arg(exception.what()));
4505 }
4506
4507 QString responseLog;
4508 responseLog.append(QString::number(result));
4509 emit logResponse("getAlgorithmItemsCount("+commandLog+")", responseLog, &commandTime);
4510
4511 return result;
4512}
4513QString OMCInterface::getNthInitialAlgorithm(QString class_, modelica_integer index)
4514{
4515 QTime commandTime;
4516 commandTime.start();
4517 QString commandLog;
4518 commandLog.append(class_);
4519 commandLog.append(",");
4520 commandLog.append(QString::number(index));
4521 emit logCommand("getNthInitialAlgorithm("+commandLog+")", &commandTime);
4522
4523 QByteArray class__utf8 = class_.toUtf8();
4524 QString result;
4525 void *result_mm = NULL__null;
4526
4527 try {
4528 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
4529
4530 result_mm = omc_OpenModelicaScriptingAPI_getNthInitialAlgorithm(threadData, mmc_mk_scon(class__utf8.constData()), index);
4531 result = QString::fromUtf8(MMC_STRINGDATA(result_mm)(((struct mmc_string*)((void*)((char*)(result_mm) - 3)))->
data)
);
4532
4533 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
4534 } catch(std::exception &exception) {
4535 emit throwException(QString("getNthInitialAlgorithm failed. %1").arg(exception.what()));
4536 }
4537
4538 QString responseLog;
4539 responseLog.append("\"" + result + "\"");
4540 emit logResponse("getNthInitialAlgorithm("+commandLog+")", responseLog, &commandTime);
4541
4542 return result;
4543}
4544modelica_integer OMCInterface::getInitialAlgorithmCount(QString class_)
4545{
4546 QTime commandTime;
4547 commandTime.start();
4548 QString commandLog;
4549 commandLog.append(class_);
4550 emit logCommand("getInitialAlgorithmCount("+commandLog+")", &commandTime);
4551
4552 QByteArray class__utf8 = class_.toUtf8();
4553 modelica_integer result;
4554
4555 try {
4556 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
4557
4558 result = omc_OpenModelicaScriptingAPI_getInitialAlgorithmCount(threadData, mmc_mk_scon(class__utf8.constData()));
4559
4560 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
4561 } catch(std::exception &exception) {
4562 emit throwException(QString("getInitialAlgorithmCount failed. %1").arg(exception.what()));
4563 }
4564
4565 QString responseLog;
4566 responseLog.append(QString::number(result));
4567 emit logResponse("getInitialAlgorithmCount("+commandLog+")", responseLog, &commandTime);
4568
4569 return result;
4570}
4571QString OMCInterface::getNthAlgorithm(QString class_, modelica_integer index)
4572{
4573 QTime commandTime;
4574 commandTime.start();
4575 QString commandLog;
4576 commandLog.append(class_);
4577 commandLog.append(",");
4578 commandLog.append(QString::number(index));
4579 emit logCommand("getNthAlgorithm("+commandLog+")", &commandTime);
4580
4581 QByteArray class__utf8 = class_.toUtf8();
4582 QString result;
4583 void *result_mm = NULL__null;
4584
4585 try {
4586 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
4587
4588 result_mm = omc_OpenModelicaScriptingAPI_getNthAlgorithm(threadData, mmc_mk_scon(class__utf8.constData()), index);
4589 result = QString::fromUtf8(MMC_STRINGDATA(result_mm)(((struct mmc_string*)((void*)((char*)(result_mm) - 3)))->
data)
);
4590
4591 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
4592 } catch(std::exception &exception) {
4593 emit throwException(QString("getNthAlgorithm failed. %1").arg(exception.what()));
4594 }
4595
4596 QString responseLog;
4597 responseLog.append("\"" + result + "\"");
4598 emit logResponse("getNthAlgorithm("+commandLog+")", responseLog, &commandTime);
4599
4600 return result;
4601}
4602modelica_integer OMCInterface::getAlgorithmCount(QString class_)
4603{
4604 QTime commandTime;
4605 commandTime.start();
4606 QString commandLog;
4607 commandLog.append(class_);
4608 emit logCommand("getAlgorithmCount("+commandLog+")", &commandTime);
4609
4610 QByteArray class__utf8 = class_.toUtf8();
4611 modelica_integer result;
4612
4613 try {
4614 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
4615
4616 result = omc_OpenModelicaScriptingAPI_getAlgorithmCount(threadData, mmc_mk_scon(class__utf8.constData()));
4617
4618 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
4619 } catch(std::exception &exception) {
4620 emit throwException(QString("getAlgorithmCount failed. %1").arg(exception.what()));
4621 }
4622
4623 QString responseLog;
4624 responseLog.append(QString::number(result));
4625 emit logResponse("getAlgorithmCount("+commandLog+")", responseLog, &commandTime);
4626
4627 return result;
4628}
4629QList<QString > OMCInterface::getNthConnection(QString className, modelica_integer index)
4630{
4631 QTime commandTime;
4632 commandTime.start();
4633 QString commandLog;
4634 commandLog.append(className);
4635 commandLog.append(",");
4636 commandLog.append(QString::number(index));
4637 emit logCommand("getNthConnection("+commandLog+")", &commandTime);
4638
4639 QByteArray className_utf8 = className.toUtf8();
4640 QList<QString > result;
4641 void *result_mm = NULL__null;
4642
4643 try {
4644 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
4645
4646 result_mm = omc_OpenModelicaScriptingAPI_getNthConnection(threadData, mmc_mk_scon(className_utf8.constData()), index);
4647 result.clear();
4648 while (!listEmpty(result_mm)((*(mmc_uint_t*)((void*)((char*)(result_mm) - 3))) == (((0) <<
10) + (((0) & 255) << 2)))
) {
4649 QString result_elt;
4650 result_elt = MMC_STRINGDATA(MMC_CAR(result_mm))(((struct mmc_string*)((void*)((char*)((*(void**)(((void*)((void
**)(((void*)((char*)(result_mm) - 3))) + (1)))))) - 3)))->
data)
;
4651 result.push_back(result_elt);
4652 result_mm = MMC_CDR(result_mm)(*(void**)(((void*)((void**)(((void*)((char*)(result_mm) - 3)
)) + (2)))))
;
4653 }
4654
4655 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
4656 } catch(std::exception &exception) {
4657 emit throwException(QString("getNthConnection failed. %1").arg(exception.what()));
4658 }
4659
4660 QString responseLog;
4661 responseLog.append("{");
4662 int result_i = 0;
4663 foreach(QString result_elt, result)for (auto _container_ = QtPrivate::qMakeForeachContainer(result
); _container_.control && _container_.i != _container_
.e; ++_container_.i, _container_.control ^= 1) for (QString result_elt
= *_container_.i; _container_.control; _container_.control =
0)
{
4664 if (result_i) {
4665 responseLog.append(",");
4666 }
4667 responseLog.append("\"" + result_elt + "\"");
4668 result_i++;
4669 }
4670 responseLog.append("}");
4671 emit logResponse("getNthConnection("+commandLog+")", responseLog, &commandTime);
4672
4673 return result;
4674}
4675modelica_integer OMCInterface::getConnectionCount(QString className)
4676{
4677 QTime commandTime;
4678 commandTime.start();
4679 QString commandLog;
4680 commandLog.append(className);
4681 emit logCommand("getConnectionCount("+commandLog+")", &commandTime);
4682
4683 QByteArray className_utf8 = className.toUtf8();
4684 modelica_integer result;
4685
4686 try {
4687 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
4688
4689 result = omc_OpenModelicaScriptingAPI_getConnectionCount(threadData, mmc_mk_scon(className_utf8.constData()));
4690
4691 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
4692 } catch(std::exception &exception) {
4693 emit throwException(QString("getConnectionCount failed. %1").arg(exception.what()));
4694 }
4695
4696 QString responseLog;
4697 responseLog.append(QString::number(result));
4698 emit logResponse("getConnectionCount("+commandLog+")", responseLog, &commandTime);
4699
4700 return result;
4701}
4702modelica_boolean OMCInterface::updateConnectionNames(QString className, QString from, QString to, QString fromNew, QString toNew)
4703{
4704 QTime commandTime;
4705 commandTime.start();
4706 QString commandLog;
4707 commandLog.append(className);
4708 commandLog.append(",");
4709 commandLog.append("\"" + from + "\"");
4710 commandLog.append(",");
4711 commandLog.append("\"" + to + "\"");
4712 commandLog.append(",");
4713 commandLog.append("\"" + fromNew + "\"");
4714 commandLog.append(",");
4715 commandLog.append("\"" + toNew + "\"");
4716 emit logCommand("updateConnectionNames("+commandLog+")", &commandTime);
4717
4718 QByteArray className_utf8 = className.toUtf8();
4719 QByteArray from_utf8 = from.toUtf8();
4720 QByteArray to_utf8 = to.toUtf8();
4721 QByteArray fromNew_utf8 = fromNew.toUtf8();
4722 QByteArray toNew_utf8 = toNew.toUtf8();
4723 modelica_boolean result;
4724
4725 try {
4726 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
4727
4728 result = omc_OpenModelicaScriptingAPI_updateConnectionNames(threadData, mmc_mk_scon(className_utf8.constData()), mmc_mk_scon(from_utf8.constData()), mmc_mk_scon(to_utf8.constData()), mmc_mk_scon(fromNew_utf8.constData()), mmc_mk_scon(toNew_utf8.constData()));
4729
4730 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
4731 } catch(std::exception &exception) {
4732 emit throwException(QString("updateConnectionNames failed. %1").arg(exception.what()));
4733 }
4734
4735 QString responseLog;
4736 responseLog.append(result ? "true" : "false");
4737 emit logResponse("updateConnectionNames("+commandLog+")", responseLog, &commandTime);
4738
4739 return result;
4740}
4741modelica_boolean OMCInterface::removeExtendsModifiers(QString className, QString baseClassName, modelica_boolean keepRedeclares)
4742{
4743 QTime commandTime;
4744 commandTime.start();
4745 QString commandLog;
4746 commandLog.append(className);
4747 commandLog.append(",");
4748 commandLog.append(baseClassName);
4749 commandLog.append(",");
4750 commandLog.append(keepRedeclares ? "true" : "false");
4751 emit logCommand("removeExtendsModifiers("+commandLog+")", &commandTime);
4752
4753 QByteArray className_utf8 = className.toUtf8();
4754 QByteArray baseClassName_utf8 = baseClassName.toUtf8();
4755 modelica_boolean result;
4756
4757 try {
4758 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
4759
4760 result = omc_OpenModelicaScriptingAPI_removeExtendsModifiers(threadData, mmc_mk_scon(className_utf8.constData()), mmc_mk_scon(baseClassName_utf8.constData()), keepRedeclares);
4761
4762 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
4763 } catch(std::exception &exception) {
4764 emit throwException(QString("removeExtendsModifiers failed. %1").arg(exception.what()));
4765 }
4766
4767 QString responseLog;
4768 responseLog.append(result ? "true" : "false");
4769 emit logResponse("removeExtendsModifiers("+commandLog+")", responseLog, &commandTime);
4770
4771 return result;
4772}
4773modelica_boolean OMCInterface::removeComponentModifiers(QString class_, QString componentName, modelica_boolean keepRedeclares)
4774{
4775 QTime commandTime;
4776 commandTime.start();
4777 QString commandLog;
4778 commandLog.append(class_);
4779 commandLog.append(",");
4780 commandLog.append("\"" + componentName + "\"");
4781 commandLog.append(",");
4782 commandLog.append(keepRedeclares ? "true" : "false");
4783 emit logCommand("removeComponentModifiers("+commandLog+")", &commandTime);
4784
4785 QByteArray class__utf8 = class_.toUtf8();
4786 QByteArray componentName_utf8 = componentName.toUtf8();
4787 modelica_boolean result;
4788
4789 try {
4790 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
4791
4792 result = omc_OpenModelicaScriptingAPI_removeComponentModifiers(threadData, mmc_mk_scon(class__utf8.constData()), mmc_mk_scon(componentName_utf8.constData()), keepRedeclares);
4793
4794 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
4795 } catch(std::exception &exception) {
4796 emit throwException(QString("removeComponentModifiers failed. %1").arg(exception.what()));
4797 }
4798
4799 QString responseLog;
4800 responseLog.append(result ? "true" : "false");
4801 emit logResponse("removeComponentModifiers("+commandLog+")", responseLog, &commandTime);
4802
4803 return result;
4804}
4805QList<QString > OMCInterface::getInstantiatedParametersAndValues(QString cls)
4806{
4807 QTime commandTime;
4808 commandTime.start();
4809 QString commandLog;
4810 commandLog.append(cls);
4811 emit logCommand("getInstantiatedParametersAndValues("+commandLog+")", &commandTime);
4812
4813 QByteArray cls_utf8 = cls.toUtf8();
4814 QList<QString > result;
4815 void *result_mm = NULL__null;
4816
4817 try {
4818 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
4819
4820 result_mm = omc_OpenModelicaScriptingAPI_getInstantiatedParametersAndValues(threadData, mmc_mk_scon(cls_utf8.constData()));
4821 result.clear();
4822 while (!listEmpty(result_mm)((*(mmc_uint_t*)((void*)((char*)(result_mm) - 3))) == (((0) <<
10) + (((0) & 255) << 2)))
) {
4823 QString result_elt;
4824 result_elt = MMC_STRINGDATA(MMC_CAR(result_mm))(((struct mmc_string*)((void*)((char*)((*(void**)(((void*)((void
**)(((void*)((char*)(result_mm) - 3))) + (1)))))) - 3)))->
data)
;
4825 result.push_back(result_elt);
4826 result_mm = MMC_CDR(result_mm)(*(void**)(((void*)((void**)(((void*)((char*)(result_mm) - 3)
)) + (2)))))
;
4827 }
4828
4829 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
4830 } catch(std::exception &exception) {
4831 emit throwException(QString("getInstantiatedParametersAndValues failed. %1").arg(exception.what()));
4832 }
4833
4834 QString responseLog;
4835 responseLog.append("{");
4836 int result_i = 0;
4837 foreach(QString result_elt, result)for (auto _container_ = QtPrivate::qMakeForeachContainer(result
); _container_.control && _container_.i != _container_
.e; ++_container_.i, _container_.control ^= 1) for (QString result_elt
= *_container_.i; _container_.control; _container_.control =
0)
{
4838 if (result_i) {
4839 responseLog.append(",");
4840 }
4841 responseLog.append("\"" + result_elt + "\"");
4842 result_i++;
4843 }
4844 responseLog.append("}");
4845 emit logResponse("getInstantiatedParametersAndValues("+commandLog+")", responseLog, &commandTime);
4846
4847 return result;
4848}
4849QString OMCInterface::getComponentModifierValues(QString class_, QString modifier)
4850{
4851 QTime commandTime;
4852 commandTime.start();
4853 QString commandLog;
4854 commandLog.append(class_);
4855 commandLog.append(",");
4856 commandLog.append(modifier);
4857 emit logCommand("getComponentModifierValues("+commandLog+")", &commandTime);
4858
4859 QByteArray class__utf8 = class_.toUtf8();
4860 QByteArray modifier_utf8 = modifier.toUtf8();
4861 QString result;
4862 void *result_mm = NULL__null;
4863
4864 try {
4865 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
4866
4867 result_mm = omc_OpenModelicaScriptingAPI_getComponentModifierValues(threadData, mmc_mk_scon(class__utf8.constData()), mmc_mk_scon(modifier_utf8.constData()));
4868 result = QString::fromUtf8(MMC_STRINGDATA(result_mm)(((struct mmc_string*)((void*)((char*)(result_mm) - 3)))->
data)
);
4869
4870 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
4871 } catch(std::exception &exception) {
4872 emit throwException(QString("getComponentModifierValues failed. %1").arg(exception.what()));
4873 }
4874
4875 QString responseLog;
4876 responseLog.append("\"" + result + "\"");
4877 emit logResponse("getComponentModifierValues("+commandLog+")", responseLog, &commandTime);
4878
4879 return result;
4880}
4881QString OMCInterface::getComponentModifierValue(QString class_, QString modifier)
4882{
4883 QTime commandTime;
4884 commandTime.start();
4885 QString commandLog;
4886 commandLog.append(class_);
4887 commandLog.append(",");
4888 commandLog.append(modifier);
4889 emit logCommand("getComponentModifierValue("+commandLog+")", &commandTime);
4890
4891 QByteArray class__utf8 = class_.toUtf8();
4892 QByteArray modifier_utf8 = modifier.toUtf8();
4893 QString result;
4894 void *result_mm = NULL__null;
4895
4896 try {
4897 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
4898
4899 result_mm = omc_OpenModelicaScriptingAPI_getComponentModifierValue(threadData, mmc_mk_scon(class__utf8.constData()), mmc_mk_scon(modifier_utf8.constData()));
4900 result = QString::fromUtf8(MMC_STRINGDATA(result_mm)(((struct mmc_string*)((void*)((char*)(result_mm) - 3)))->
data)
);
4901
4902 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
4903 } catch(std::exception &exception) {
4904 emit throwException(QString("getComponentModifierValue failed. %1").arg(exception.what()));
4905 }
4906
4907 QString responseLog;
4908 responseLog.append("\"" + result + "\"");
4909 emit logResponse("getComponentModifierValue("+commandLog+")", responseLog, &commandTime);
4910
4911 return result;
4912}
4913QList<QString > OMCInterface::getComponentModifierNames(QString class_, QString componentName)
4914{
4915 QTime commandTime;
4916 commandTime.start();
4917 QString commandLog;
4918 commandLog.append(class_);
4919 commandLog.append(",");
4920 commandLog.append("\"" + componentName + "\"");
4921 emit logCommand("getComponentModifierNames("+commandLog+")", &commandTime);
4922
4923 QByteArray class__utf8 = class_.toUtf8();
4924 QByteArray componentName_utf8 = componentName.toUtf8();
4925 QList<QString > result;
4926 void *result_mm = NULL__null;
4927
4928 try {
4929 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
4930
4931 result_mm = omc_OpenModelicaScriptingAPI_getComponentModifierNames(threadData, mmc_mk_scon(class__utf8.constData()), mmc_mk_scon(componentName_utf8.constData()));
4932 result.clear();
4933 while (!listEmpty(result_mm)((*(mmc_uint_t*)((void*)((char*)(result_mm) - 3))) == (((0) <<
10) + (((0) & 255) << 2)))
) {
4934 QString result_elt;
4935 result_elt = MMC_STRINGDATA(MMC_CAR(result_mm))(((struct mmc_string*)((void*)((char*)((*(void**)(((void*)((void
**)(((void*)((char*)(result_mm) - 3))) + (1)))))) - 3)))->
data)
;
4936 result.push_back(result_elt);
4937 result_mm = MMC_CDR(result_mm)(*(void**)(((void*)((void**)(((void*)((char*)(result_mm) - 3)
)) + (2)))))
;
4938 }
4939
4940 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
4941 } catch(std::exception &exception) {
4942 emit throwException(QString("getComponentModifierNames failed. %1").arg(exception.what()));
4943 }
4944
4945 QString responseLog;
4946 responseLog.append("{");
4947 int result_i = 0;
4948 foreach(QString result_elt, result)for (auto _container_ = QtPrivate::qMakeForeachContainer(result
); _container_.control && _container_.i != _container_
.e; ++_container_.i, _container_.control ^= 1) for (QString result_elt
= *_container_.i; _container_.control; _container_.control =
0)
{
4949 if (result_i) {
4950 responseLog.append(",");
4951 }
4952 responseLog.append("\"" + result_elt + "\"");
4953 result_i++;
4954 }
4955 responseLog.append("}");
4956 emit logResponse("getComponentModifierNames("+commandLog+")", responseLog, &commandTime);
4957
4958 return result;
4959}
4960QString OMCInterface::getParameterValue(QString class_, QString parameterName)
4961{
4962 QTime commandTime;
4963 commandTime.start();
4964 QString commandLog;
4965 commandLog.append(class_);
4966 commandLog.append(",");
4967 commandLog.append("\"" + parameterName + "\"");
4968 emit logCommand("getParameterValue("+commandLog+")", &commandTime);
4969
4970 QByteArray class__utf8 = class_.toUtf8();
4971 QByteArray parameterName_utf8 = parameterName.toUtf8();
4972 QString result;
4973 void *result_mm = NULL__null;
4974
4975 try {
4976 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
4977
4978 result_mm = omc_OpenModelicaScriptingAPI_getParameterValue(threadData, mmc_mk_scon(class__utf8.constData()), mmc_mk_scon(parameterName_utf8.constData()));
4979 result = QString::fromUtf8(MMC_STRINGDATA(result_mm)(((struct mmc_string*)((void*)((char*)(result_mm) - 3)))->
data)
);
4980
4981 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
4982 } catch(std::exception &exception) {
4983 emit throwException(QString("getParameterValue failed. %1").arg(exception.what()));
4984 }
4985
4986 QString responseLog;
4987 responseLog.append("\"" + result + "\"");
4988 emit logResponse("getParameterValue("+commandLog+")", responseLog, &commandTime);
4989
4990 return result;
4991}
4992QList<QString > OMCInterface::getParameterNames(QString class_)
4993{
4994 QTime commandTime;
4995 commandTime.start();
4996 QString commandLog;
4997 commandLog.append(class_);
4998 emit logCommand("getParameterNames("+commandLog+")", &commandTime);
4999
5000 QByteArray class__utf8 = class_.toUtf8();
5001 QList<QString > result;
5002 void *result_mm = NULL__null;
5003
5004 try {
5005 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
5006
5007 result_mm = omc_OpenModelicaScriptingAPI_getParameterNames(threadData, mmc_mk_scon(class__utf8.constData()));
5008 result.clear();
5009 while (!listEmpty(result_mm)((*(mmc_uint_t*)((void*)((char*)(result_mm) - 3))) == (((0) <<
10) + (((0) & 255) << 2)))
) {
5010 QString result_elt;
5011 result_elt = MMC_STRINGDATA(MMC_CAR(result_mm))(((struct mmc_string*)((void*)((char*)((*(void**)(((void*)((void
**)(((void*)((char*)(result_mm) - 3))) + (1)))))) - 3)))->
data)
;
5012 result.push_back(result_elt);
5013 result_mm = MMC_CDR(result_mm)(*(void**)(((void*)((void**)(((void*)((char*)(result_mm) - 3)
)) + (2)))))
;
5014 }
5015
5016 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
5017 } catch(std::exception &exception) {
5018 emit throwException(QString("getParameterNames failed. %1").arg(exception.what()));
5019 }
5020
5021 QString responseLog;
5022 responseLog.append("{");
5023 int result_i = 0;
5024 foreach(QString result_elt, result)for (auto _container_ = QtPrivate::qMakeForeachContainer(result
); _container_.control && _container_.i != _container_
.e; ++_container_.i, _container_.control ^= 1) for (QString result_elt
= *_container_.i; _container_.control; _container_.control =
0)
{
5025 if (result_i) {
5026 responseLog.append(",");
5027 }
5028 responseLog.append("\"" + result_elt + "\"");
5029 result_i++;
5030 }
5031 responseLog.append("}");
5032 emit logResponse("getParameterNames("+commandLog+")", responseLog, &commandTime);
5033
5034 return result;
5035}
5036modelica_boolean OMCInterface::closeSimulationResultFile()
5037{
5038 QTime commandTime;
5039 commandTime.start();
5040 emit logCommand("closeSimulationResultFile()", &commandTime);
5041
5042 modelica_boolean result;
5043
5044 try {
5045 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
5046
5047 result = omc_OpenModelicaScriptingAPI_closeSimulationResultFile(threadData);
5048
5049 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
5050 } catch(std::exception &exception) {
5051 emit throwException(QString("closeSimulationResultFile failed. %1").arg(exception.what()));
5052 }
5053
5054 QString responseLog;
5055 responseLog.append(result ? "true" : "false");
5056 emit logResponse("closeSimulationResultFile()", responseLog, &commandTime);
5057
5058 return result;
5059}
5060QList<QString > OMCInterface::checkCodeGraph(QString graphfile, QString codefile)
5061{
5062 QTime commandTime;
5063 commandTime.start();
5064 QString commandLog;
5065 commandLog.append("\"" + graphfile + "\"");
5066 commandLog.append(",");
5067 commandLog.append("\"" + codefile + "\"");
5068 emit logCommand("checkCodeGraph("+commandLog+")", &commandTime);
5069
5070 QByteArray graphfile_utf8 = graphfile.toUtf8();
5071 QByteArray codefile_utf8 = codefile.toUtf8();
5072 QList<QString > result;
5073 void *result_mm = NULL__null;
5074
5075 try {
5076 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
5077
5078 result_mm = omc_OpenModelicaScriptingAPI_checkCodeGraph(threadData, mmc_mk_scon(graphfile_utf8.constData()), mmc_mk_scon(codefile_utf8.constData()));
5079 result.clear();
5080 while (!listEmpty(result_mm)((*(mmc_uint_t*)((void*)((char*)(result_mm) - 3))) == (((0) <<
10) + (((0) & 255) << 2)))
) {
5081 QString result_elt;
5082 result_elt = MMC_STRINGDATA(MMC_CAR(result_mm))(((struct mmc_string*)((void*)((char*)((*(void**)(((void*)((void
**)(((void*)((char*)(result_mm) - 3))) + (1)))))) - 3)))->
data)
;
5083 result.push_back(result_elt);
5084 result_mm = MMC_CDR(result_mm)(*(void**)(((void*)((void**)(((void*)((char*)(result_mm) - 3)
)) + (2)))))
;
5085 }
5086
5087 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
5088 } catch(std::exception &exception) {
5089 emit throwException(QString("checkCodeGraph failed. %1").arg(exception.what()));
5090 }
5091
5092 QString responseLog;
5093 responseLog.append("{");
5094 int result_i = 0;
5095 foreach(QString result_elt, result)for (auto _container_ = QtPrivate::qMakeForeachContainer(result
); _container_.control && _container_.i != _container_
.e; ++_container_.i, _container_.control ^= 1) for (QString result_elt
= *_container_.i; _container_.control; _container_.control =
0)
{
5096 if (result_i) {
5097 responseLog.append(",");
5098 }
5099 responseLog.append("\"" + result_elt + "\"");
5100 result_i++;
5101 }
5102 responseLog.append("}");
5103 emit logResponse("checkCodeGraph("+commandLog+")", responseLog, &commandTime);
5104
5105 return result;
5106}
5107QList<QString > OMCInterface::checkTaskGraph(QString filename, QString reffilename)
5108{
5109 QTime commandTime;
5110 commandTime.start();
5111 QString commandLog;
5112 commandLog.append("\"" + filename + "\"");
5113 commandLog.append(",");
5114 commandLog.append("\"" + reffilename + "\"");
5115 emit logCommand("checkTaskGraph("+commandLog+")", &commandTime);
5116
5117 QByteArray filename_utf8 = filename.toUtf8();
5118 QByteArray reffilename_utf8 = reffilename.toUtf8();
5119 QList<QString > result;
5120 void *result_mm = NULL__null;
5121
5122 try {
5123 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
5124
5125 result_mm = omc_OpenModelicaScriptingAPI_checkTaskGraph(threadData, mmc_mk_scon(filename_utf8.constData()), mmc_mk_scon(reffilename_utf8.constData()));
5126 result.clear();
5127 while (!listEmpty(result_mm)((*(mmc_uint_t*)((void*)((char*)(result_mm) - 3))) == (((0) <<
10) + (((0) & 255) << 2)))
) {
5128 QString result_elt;
5129 result_elt = MMC_STRINGDATA(MMC_CAR(result_mm))(((struct mmc_string*)((void*)((char*)((*(void**)(((void*)((void
**)(((void*)((char*)(result_mm) - 3))) + (1)))))) - 3)))->
data)
;
5130 result.push_back(result_elt);
5131 result_mm = MMC_CDR(result_mm)(*(void**)(((void*)((void**)(((void*)((char*)(result_mm) - 3)
)) + (2)))))
;
5132 }
5133
5134 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
5135 } catch(std::exception &exception) {
5136 emit throwException(QString("checkTaskGraph failed. %1").arg(exception.what()));
5137 }
5138
5139 QString responseLog;
5140 responseLog.append("{");
5141 int result_i = 0;
5142 foreach(QString result_elt, result)for (auto _container_ = QtPrivate::qMakeForeachContainer(result
); _container_.control && _container_.i != _container_
.e; ++_container_.i, _container_.control ^= 1) for (QString result_elt
= *_container_.i; _container_.control; _container_.control =
0)
{
5143 if (result_i) {
5144 responseLog.append(",");
5145 }
5146 responseLog.append("\"" + result_elt + "\"");
5147 result_i++;
5148 }
5149 responseLog.append("}");
5150 emit logResponse("checkTaskGraph("+commandLog+")", responseLog, &commandTime);
5151
5152 return result;
5153}
5154QString OMCInterface::diffSimulationResultsHtml(QString var, QString actualFile, QString expectedFile, modelica_real relTol, modelica_real relTolDiffMinMax, modelica_real rangeDelta)
5155{
5156 QTime commandTime;
5157 commandTime.start();
5158 QString commandLog;
5159 commandLog.append("\"" + var + "\"");
5160 commandLog.append(",");
5161 commandLog.append("\"" + actualFile + "\"");
5162 commandLog.append(",");
5163 commandLog.append("\"" + expectedFile + "\"");
5164 commandLog.append(",");
5165 commandLog.append(QString::number(relTol));
5166 commandLog.append(",");
5167 commandLog.append(QString::number(relTolDiffMinMax));
5168 commandLog.append(",");
5169 commandLog.append(QString::number(rangeDelta));
5170 emit logCommand("diffSimulationResultsHtml("+commandLog+")", &commandTime);
5171
5172 QByteArray var_utf8 = var.toUtf8();
5173 QByteArray actualFile_utf8 = actualFile.toUtf8();
5174 QByteArray expectedFile_utf8 = expectedFile.toUtf8();
5175 QString result;
5176 void *result_mm = NULL__null;
5177
5178 try {
5179 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
5180
5181 result_mm = omc_OpenModelicaScriptingAPI_diffSimulationResultsHtml(threadData, mmc_mk_scon(var_utf8.constData()), mmc_mk_scon(actualFile_utf8.constData()), mmc_mk_scon(expectedFile_utf8.constData()), relTol, relTolDiffMinMax, rangeDelta);
5182 result = QString::fromUtf8(MMC_STRINGDATA(result_mm)(((struct mmc_string*)((void*)((char*)(result_mm) - 3)))->
data)
);
5183
5184 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
5185 } catch(std::exception &exception) {
5186 emit throwException(QString("diffSimulationResultsHtml failed. %1").arg(exception.what()));
5187 }
5188
5189 QString responseLog;
5190 responseLog.append("\"" + result + "\"");
5191 emit logResponse("diffSimulationResultsHtml("+commandLog+")", responseLog, &commandTime);
5192
5193 return result;
5194}
5195OMCInterface::diffSimulationResults_res OMCInterface::diffSimulationResults(QString actualFile, QString expectedFile, QString diffPrefix, modelica_real relTol, modelica_real relTolDiffMinMax, modelica_real rangeDelta, QList<QString > vars, modelica_boolean keepEqualResults)
5196{
5197 QTime commandTime;
5198 commandTime.start();
5199 QString commandLog;
5200 commandLog.append("\"" + actualFile + "\"");
5201 commandLog.append(",");
5202 commandLog.append("\"" + expectedFile + "\"");
5203 commandLog.append(",");
5204 commandLog.append("\"" + diffPrefix + "\"");
5205 commandLog.append(",");
5206 commandLog.append(QString::number(relTol));
5207 commandLog.append(",");
5208 commandLog.append(QString::number(relTolDiffMinMax));
5209 commandLog.append(",");
5210 commandLog.append(QString::number(rangeDelta));
5211 commandLog.append(",");
5212 commandLog.append("{");
5213 int vars_i = 0;
5214 foreach(QString vars_elt, vars)for (auto _container_ = QtPrivate::qMakeForeachContainer(vars
); _container_.control && _container_.i != _container_
.e; ++_container_.i, _container_.control ^= 1) for (QString vars_elt
= *_container_.i; _container_.control; _container_.control =
0)
{
5215 if (vars_i) {
5216 commandLog.append(",");
5217 }
5218 commandLog.append("\"" + vars_elt + "\"");
5219 vars_i++;
5220 }
5221 commandLog.append("}");commandLog.append(",");
5222 commandLog.append(keepEqualResults ? "true" : "false");
5223 emit logCommand("diffSimulationResults("+commandLog+")", &commandTime);
5224
5225 QByteArray actualFile_utf8 = actualFile.toUtf8();
5226 QByteArray expectedFile_utf8 = expectedFile.toUtf8();
5227 QByteArray diffPrefix_utf8 = diffPrefix.toUtf8();
5228 void *vars_lst = mmc_mk_nil()((void*)((char*)(&(mmc_nil).header) + 3));
5229 for (int vars_i = vars.size()-1; vars_i>=0; vars_i--) {
5230 QString vars_elt = vars[vars_i];
5231 QByteArray vars_elt_utf8 = vars_elt.toUtf8();
5232 vars_lst = mmc_mk_cons(mmc_mk_scon(vars_elt_utf8.constData()), vars_lst);
5233 }
5234 diffSimulationResults_res result;
5235 void *out2_mm = NULL__null;
5236
5237 try {
5238 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
5239
5240 result.success = omc_OpenModelicaScriptingAPI_diffSimulationResults(threadData, mmc_mk_scon(actualFile_utf8.constData()), mmc_mk_scon(expectedFile_utf8.constData()), mmc_mk_scon(diffPrefix_utf8.constData()), relTol, relTolDiffMinMax, rangeDelta, vars_lst, keepEqualResults, &out2_mm);
5241 result.failVars.clear();
5242 while (!listEmpty(out2_mm)((*(mmc_uint_t*)((void*)((char*)(out2_mm) - 3))) == (((0) <<
10) + (((0) & 255) << 2)))
) {
5243 QString out2_elt;
5244 out2_elt = MMC_STRINGDATA(MMC_CAR(out2_mm))(((struct mmc_string*)((void*)((char*)((*(void**)(((void*)((void
**)(((void*)((char*)(out2_mm) - 3))) + (1)))))) - 3)))->data
)
;
5245 result.failVars.push_back(out2_elt);
5246 out2_mm = MMC_CDR(out2_mm)(*(void**)(((void*)((void**)(((void*)((char*)(out2_mm) - 3)))
+ (2)))))
;
5247 }
5248
5249 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
5250 } catch(std::exception &exception) {
5251 emit throwException(QString("diffSimulationResults failed. %1").arg(exception.what()));
5252 }
5253
5254 QString responseLog;
5255 responseLog.append(result.toString());
5256 emit logResponse("diffSimulationResults("+commandLog+")", responseLog, &commandTime);
5257
5258 return result;
5259}
5260modelica_real OMCInterface::deltaSimulationResults(QString filename, QString reffilename, QString method, QList<QString > vars)
5261{
5262 QTime commandTime;
5263 commandTime.start();
5264 QString commandLog;
5265 commandLog.append("\"" + filename + "\"");
5266 commandLog.append(",");
5267 commandLog.append("\"" + reffilename + "\"");
5268 commandLog.append(",");
5269 commandLog.append("\"" + method + "\"");
5270 commandLog.append(",");
5271 commandLog.append("{");
5272 int vars_i = 0;
5273 foreach(QString vars_elt, vars)for (auto _container_ = QtPrivate::qMakeForeachContainer(vars
); _container_.control && _container_.i != _container_
.e; ++_container_.i, _container_.control ^= 1) for (QString vars_elt
= *_container_.i; _container_.control; _container_.control =
0)
{
5274 if (vars_i) {
5275 commandLog.append(",");
5276 }
5277 commandLog.append("\"" + vars_elt + "\"");
5278 vars_i++;
5279 }
5280 commandLog.append("}");
5281 emit logCommand("deltaSimulationResults("+commandLog+")", &commandTime);
5282
5283 QByteArray filename_utf8 = filename.toUtf8();
5284 QByteArray reffilename_utf8 = reffilename.toUtf8();
5285 QByteArray method_utf8 = method.toUtf8();
5286 void *vars_lst = mmc_mk_nil()((void*)((char*)(&(mmc_nil).header) + 3));
5287 for (int vars_i = vars.size()-1; vars_i>=0; vars_i--) {
5288 QString vars_elt = vars[vars_i];
5289 QByteArray vars_elt_utf8 = vars_elt.toUtf8();
5290 vars_lst = mmc_mk_cons(mmc_mk_scon(vars_elt_utf8.constData()), vars_lst);
5291 }
5292 modelica_real result;
5293
5294 try {
5295 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
5296
5297 result = omc_OpenModelicaScriptingAPI_deltaSimulationResults(threadData, mmc_mk_scon(filename_utf8.constData()), mmc_mk_scon(reffilename_utf8.constData()), mmc_mk_scon(method_utf8.constData()), vars_lst);
5298
5299 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
5300 } catch(std::exception &exception) {
5301 emit throwException(QString("deltaSimulationResults failed. %1").arg(exception.what()));
5302 }
5303
5304 QString responseLog;
5305 responseLog.append(QString::number(result));
5306 emit logResponse("deltaSimulationResults("+commandLog+")", responseLog, &commandTime);
5307
5308 return result;
5309}
5310QList<QString > OMCInterface::compareSimulationResults(QString filename, QString reffilename, QString logfilename, modelica_real relTol, modelica_real absTol, QList<QString > vars)
5311{
5312 QTime commandTime;
5313 commandTime.start();
5314 QString commandLog;
5315 commandLog.append("\"" + filename + "\"");
5316 commandLog.append(",");
5317 commandLog.append("\"" + reffilename + "\"");
5318 commandLog.append(",");
5319 commandLog.append("\"" + logfilename + "\"");
5320 commandLog.append(",");
5321 commandLog.append(QString::number(relTol));
5322 commandLog.append(",");
5323 commandLog.append(QString::number(absTol));
5324 commandLog.append(",");
5325 commandLog.append("{");
5326 int vars_i = 0;
5327 foreach(QString vars_elt, vars)for (auto _container_ = QtPrivate::qMakeForeachContainer(vars
); _container_.control && _container_.i != _container_
.e; ++_container_.i, _container_.control ^= 1) for (QString vars_elt
= *_container_.i; _container_.control; _container_.control =
0)
{
5328 if (vars_i) {
5329 commandLog.append(",");
5330 }
5331 commandLog.append("\"" + vars_elt + "\"");
5332 vars_i++;
5333 }
5334 commandLog.append("}");
5335 emit logCommand("compareSimulationResults("+commandLog+")", &commandTime);
5336
5337 QByteArray filename_utf8 = filename.toUtf8();
5338 QByteArray reffilename_utf8 = reffilename.toUtf8();
5339 QByteArray logfilename_utf8 = logfilename.toUtf8();
5340 void *vars_lst = mmc_mk_nil()((void*)((char*)(&(mmc_nil).header) + 3));
5341 for (int vars_i = vars.size()-1; vars_i>=0; vars_i--) {
5342 QString vars_elt = vars[vars_i];
5343 QByteArray vars_elt_utf8 = vars_elt.toUtf8();
5344 vars_lst = mmc_mk_cons(mmc_mk_scon(vars_elt_utf8.constData()), vars_lst);
5345 }
5346 QList<QString > result;
5347 void *result_mm = NULL__null;
5348
5349 try {
5350 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
5351
5352 result_mm = omc_OpenModelicaScriptingAPI_compareSimulationResults(threadData, mmc_mk_scon(filename_utf8.constData()), mmc_mk_scon(reffilename_utf8.constData()), mmc_mk_scon(logfilename_utf8.constData()), relTol, absTol, vars_lst);
5353 result.clear();
5354 while (!listEmpty(result_mm)((*(mmc_uint_t*)((void*)((char*)(result_mm) - 3))) == (((0) <<
10) + (((0) & 255) << 2)))
) {
5355 QString result_elt;
5356 result_elt = MMC_STRINGDATA(MMC_CAR(result_mm))(((struct mmc_string*)((void*)((char*)((*(void**)(((void*)((void
**)(((void*)((char*)(result_mm) - 3))) + (1)))))) - 3)))->
data)
;
5357 result.push_back(result_elt);
5358 result_mm = MMC_CDR(result_mm)(*(void**)(((void*)((void**)(((void*)((char*)(result_mm) - 3)
)) + (2)))))
;
5359 }
5360
5361 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
5362 } catch(std::exception &exception) {
5363 emit throwException(QString("compareSimulationResults failed. %1").arg(exception.what()));
5364 }
5365
5366 QString responseLog;
5367 responseLog.append("{");
5368 int result_i = 0;
5369 foreach(QString result_elt, result)for (auto _container_ = QtPrivate::qMakeForeachContainer(result
); _container_.control && _container_.i != _container_
.e; ++_container_.i, _container_.control ^= 1) for (QString result_elt
= *_container_.i; _container_.control; _container_.control =
0)
{
5370 if (result_i) {
5371 responseLog.append(",");
5372 }
5373 responseLog.append("\"" + result_elt + "\"");
5374 result_i++;
5375 }
5376 responseLog.append("}");
5377 emit logResponse("compareSimulationResults("+commandLog+")", responseLog, &commandTime);
5378
5379 return result;
5380}
5381modelica_boolean OMCInterface::filterSimulationResults(QString inFile, QString outFile, QList<QString > vars, modelica_integer numberOfIntervals, modelica_boolean removeDescription)
5382{
5383 QTime commandTime;
5384 commandTime.start();
5385 QString commandLog;
5386 commandLog.append("\"" + inFile + "\"");
5387 commandLog.append(",");
5388 commandLog.append("\"" + outFile + "\"");
5389 commandLog.append(",");
5390 commandLog.append("{");
5391 int vars_i = 0;
5392 foreach(QString vars_elt, vars)for (auto _container_ = QtPrivate::qMakeForeachContainer(vars
); _container_.control && _container_.i != _container_
.e; ++_container_.i, _container_.control ^= 1) for (QString vars_elt
= *_container_.i; _container_.control; _container_.control =
0)
{
5393 if (vars_i) {
5394 commandLog.append(",");
5395 }
5396 commandLog.append("\"" + vars_elt + "\"");
5397 vars_i++;
5398 }
5399 commandLog.append("}");commandLog.append(",");
5400 commandLog.append(QString::number(numberOfIntervals));
5401 commandLog.append(",");
5402 commandLog.append(removeDescription ? "true" : "false");
5403 emit logCommand("filterSimulationResults("+commandLog+")", &commandTime);
5404
5405 QByteArray inFile_utf8 = inFile.toUtf8();
5406 QByteArray outFile_utf8 = outFile.toUtf8();
5407 void *vars_lst = mmc_mk_nil()((void*)((char*)(&(mmc_nil).header) + 3));
5408 for (int vars_i = vars.size()-1; vars_i>=0; vars_i--) {
5409 QString vars_elt = vars[vars_i];
5410 QByteArray vars_elt_utf8 = vars_elt.toUtf8();
5411 vars_lst = mmc_mk_cons(mmc_mk_scon(vars_elt_utf8.constData()), vars_lst);
5412 }
5413 modelica_boolean result;
5414
5415 try {
5416 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
5417
5418 result = omc_OpenModelicaScriptingAPI_filterSimulationResults(threadData, mmc_mk_scon(inFile_utf8.constData()), mmc_mk_scon(outFile_utf8.constData()), vars_lst, numberOfIntervals, removeDescription);
5419
5420 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
5421 } catch(std::exception &exception) {
5422 emit throwException(QString("filterSimulationResults failed. %1").arg(exception.what()));
5423 }
5424
5425 QString responseLog;
5426 responseLog.append(result ? "true" : "false");
5427 emit logResponse("filterSimulationResults("+commandLog+")", responseLog, &commandTime);
5428
5429 return result;
5430}
5431QList<QString > OMCInterface::readSimulationResultVars(QString fileName, modelica_boolean readParameters, modelica_boolean openmodelicaStyle)
5432{
5433 QTime commandTime;
5434 commandTime.start();
5435 QString commandLog;
5436 commandLog.append("\"" + fileName + "\"");
5437 commandLog.append(",");
5438 commandLog.append(readParameters ? "true" : "false");
5439 commandLog.append(",");
5440 commandLog.append(openmodelicaStyle ? "true" : "false");
5441 emit logCommand("readSimulationResultVars("+commandLog+")", &commandTime);
5442
5443 QByteArray fileName_utf8 = fileName.toUtf8();
5444 QList<QString > result;
5445 void *result_mm = NULL__null;
5446
5447 try {
5448 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
5449
5450 result_mm = omc_OpenModelicaScriptingAPI_readSimulationResultVars(threadData, mmc_mk_scon(fileName_utf8.constData()), readParameters, openmodelicaStyle);
5451 result.clear();
5452 while (!listEmpty(result_mm)((*(mmc_uint_t*)((void*)((char*)(result_mm) - 3))) == (((0) <<
10) + (((0) & 255) << 2)))
) {
5453 QString result_elt;
5454 result_elt = MMC_STRINGDATA(MMC_CAR(result_mm))(((struct mmc_string*)((void*)((char*)((*(void**)(((void*)((void
**)(((void*)((char*)(result_mm) - 3))) + (1)))))) - 3)))->
data)
;
5455 result.push_back(result_elt);
5456 result_mm = MMC_CDR(result_mm)(*(void**)(((void*)((void**)(((void*)((char*)(result_mm) - 3)
)) + (2)))))
;
5457 }
5458
5459 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
5460 } catch(std::exception &exception) {
5461 emit throwException(QString("readSimulationResultVars failed. %1").arg(exception.what()));
5462 }
5463
5464 QString responseLog;
5465 responseLog.append("{");
5466 int result_i = 0;
5467 foreach(QString result_elt, result)for (auto _container_ = QtPrivate::qMakeForeachContainer(result
); _container_.control && _container_.i != _container_
.e; ++_container_.i, _container_.control ^= 1) for (QString result_elt
= *_container_.i; _container_.control; _container_.control =
0)
{
5468 if (result_i) {
5469 responseLog.append(",");
5470 }
5471 responseLog.append("\"" + result_elt + "\"");
5472 result_i++;
5473 }
5474 responseLog.append("}");
5475 emit logResponse("readSimulationResultVars("+commandLog+")", responseLog, &commandTime);
5476
5477 return result;
5478}
5479modelica_integer OMCInterface::readSimulationResultSize(QString fileName)
5480{
5481 QTime commandTime;
5482 commandTime.start();
5483 QString commandLog;
5484 commandLog.append("\"" + fileName + "\"");
5485 emit logCommand("readSimulationResultSize("+commandLog+")", &commandTime);
5486
5487 QByteArray fileName_utf8 = fileName.toUtf8();
5488 modelica_integer result;
5489
5490 try {
5491 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
5492
5493 result = omc_OpenModelicaScriptingAPI_readSimulationResultSize(threadData, mmc_mk_scon(fileName_utf8.constData()));
5494
5495 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
5496 } catch(std::exception &exception) {
5497 emit throwException(QString("readSimulationResultSize failed. %1").arg(exception.what()));
5498 }
5499
5500 QString responseLog;
5501 responseLog.append(QString::number(result));
5502 emit logResponse("readSimulationResultSize("+commandLog+")", responseLog, &commandTime);
5503
5504 return result;
5505}
5506modelica_boolean OMCInterface::plotAll(modelica_boolean externalWindow, QString fileName, QString title, QString grid, modelica_boolean logX, modelica_boolean logY, QString xLabel, QString yLabel, QList<modelica_real > xRange, QList<modelica_real > yRange, modelica_real curveWidth, modelica_integer curveStyle, QString legendPosition, QString footer, modelica_boolean autoScale, modelica_boolean forceOMPlot)
5507{
5508 QTime commandTime;
5509 commandTime.start();
5510 QString commandLog;
5511 commandLog.append(externalWindow ? "true" : "false");
5512 commandLog.append(",");
5513 commandLog.append("\"" + fileName + "\"");
5514 commandLog.append(",");
5515 commandLog.append("\"" + title + "\"");
5516 commandLog.append(",");
5517 commandLog.append("\"" + grid + "\"");
5518 commandLog.append(",");
5519 commandLog.append(logX ? "true" : "false");
5520 commandLog.append(",");
5521 commandLog.append(logY ? "true" : "false");
5522 commandLog.append(",");
5523 commandLog.append("\"" + xLabel + "\"");
5524 commandLog.append(",");
5525 commandLog.append("\"" + yLabel + "\"");
5526 commandLog.append(",");
5527 commandLog.append("{");
5528 int xRange_i = 0;
5529 foreach(modelica_real xRange_elt, xRange)for (auto _container_ = QtPrivate::qMakeForeachContainer(xRange
); _container_.control && _container_.i != _container_
.e; ++_container_.i, _container_.control ^= 1) for (modelica_real
xRange_elt = *_container_.i; _container_.control; _container_
.control = 0)
{
5530 if (xRange_i) {
5531 commandLog.append(",");
5532 }
5533 commandLog.append(QString::number(xRange_elt));
5534 xRange_i++;
5535 }
5536 commandLog.append("}");commandLog.append(",");
5537 commandLog.append("{");
5538 int yRange_i = 0;
5539 foreach(modelica_real yRange_elt, yRange)for (auto _container_ = QtPrivate::qMakeForeachContainer(yRange
); _container_.control && _container_.i != _container_
.e; ++_container_.i, _container_.control ^= 1) for (modelica_real
yRange_elt = *_container_.i; _container_.control; _container_
.control = 0)
{
5540 if (yRange_i) {
5541 commandLog.append(",");
5542 }
5543 commandLog.append(QString::number(yRange_elt));
5544 yRange_i++;
5545 }
5546 commandLog.append("}");commandLog.append(",");
5547 commandLog.append(QString::number(curveWidth));
5548 commandLog.append(",");
5549 commandLog.append(QString::number(curveStyle));
5550 commandLog.append(",");
5551 commandLog.append("\"" + legendPosition + "\"");
5552 commandLog.append(",");
5553 commandLog.append("\"" + footer + "\"");
5554 commandLog.append(",");
5555 commandLog.append(autoScale ? "true" : "false");
5556 commandLog.append(",");
5557 commandLog.append(forceOMPlot ? "true" : "false");
5558 emit logCommand("plotAll("+commandLog+")", &commandTime);
5559
5560 QByteArray fileName_utf8 = fileName.toUtf8();
5561 QByteArray title_utf8 = title.toUtf8();
5562 QByteArray grid_utf8 = grid.toUtf8();
5563 QByteArray xLabel_utf8 = xLabel.toUtf8();
5564 QByteArray yLabel_utf8 = yLabel.toUtf8();
5565 void *xRange_lst = mmc_mk_nil()((void*)((char*)(&(mmc_nil).header) + 3));
5566 for (int xRange_i = xRange.size()-1; xRange_i>=0; xRange_i--) {
5567 modelica_real xRange_elt = xRange[xRange_i];
5568 xRange_lst = mmc_mk_cons(mmc_mk_rcon(xRange_elt), xRange_lst);
5569 }
5570 void *yRange_lst = mmc_mk_nil()((void*)((char*)(&(mmc_nil).header) + 3));
5571 for (int yRange_i = yRange.size()-1; yRange_i>=0; yRange_i--) {
5572 modelica_real yRange_elt = yRange[yRange_i];
5573 yRange_lst = mmc_mk_cons(mmc_mk_rcon(yRange_elt), yRange_lst);
5574 }
5575 QByteArray legendPosition_utf8 = legendPosition.toUtf8();
5576 QByteArray footer_utf8 = footer.toUtf8();
5577 modelica_boolean result;
5578
5579 try {
5580 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
5581
5582 result = omc_OpenModelicaScriptingAPI_plotAll(threadData, externalWindow, mmc_mk_scon(fileName_utf8.constData()), mmc_mk_scon(title_utf8.constData()), mmc_mk_scon(grid_utf8.constData()), logX, logY, mmc_mk_scon(xLabel_utf8.constData()), mmc_mk_scon(yLabel_utf8.constData()), xRange_lst, yRange_lst, curveWidth, curveStyle, mmc_mk_scon(legendPosition_utf8.constData()), mmc_mk_scon(footer_utf8.constData()), autoScale, forceOMPlot);
5583
5584 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
5585 } catch(std::exception &exception) {
5586 emit throwException(QString("plotAll failed. %1").arg(exception.what()));
5587 }
5588
5589 QString responseLog;
5590 responseLog.append(result ? "true" : "false");
5591 emit logResponse("plotAll("+commandLog+")", responseLog, &commandTime);
5592
5593 return result;
5594}
5595QList<QString > OMCInterface::getAllSubtypeOf(QString parentClass, QString class_, modelica_boolean qualified, modelica_boolean includePartial, modelica_boolean sort)
5596{
5597 QTime commandTime;
5598 commandTime.start();
5599 QString commandLog;
5600 commandLog.append(parentClass);
5601 commandLog.append(",");
5602 commandLog.append(class_);
5603 commandLog.append(",");
5604 commandLog.append(qualified ? "true" : "false");
5605 commandLog.append(",");
5606 commandLog.append(includePartial ? "true" : "false");
5607 commandLog.append(",");
5608 commandLog.append(sort ? "true" : "false");
5609 emit logCommand("getAllSubtypeOf("+commandLog+")", &commandTime);
5610
5611 QByteArray parentClass_utf8 = parentClass.toUtf8();
5612 QByteArray class__utf8 = class_.toUtf8();
5613 QList<QString > result;
5614 void *result_mm = NULL__null;
5615
5616 try {
5617 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
5618
5619 result_mm = omc_OpenModelicaScriptingAPI_getAllSubtypeOf(threadData, mmc_mk_scon(parentClass_utf8.constData()), mmc_mk_scon(class__utf8.constData()), qualified, includePartial, sort);
5620 result.clear();
5621 while (!listEmpty(result_mm)((*(mmc_uint_t*)((void*)((char*)(result_mm) - 3))) == (((0) <<
10) + (((0) & 255) << 2)))
) {
5622 QString result_elt;
5623 result_elt = MMC_STRINGDATA(MMC_CAR(result_mm))(((struct mmc_string*)((void*)((char*)((*(void**)(((void*)((void
**)(((void*)((char*)(result_mm) - 3))) + (1)))))) - 3)))->
data)
;
5624 result.push_back(result_elt);
5625 result_mm = MMC_CDR(result_mm)(*(void**)(((void*)((void**)(((void*)((char*)(result_mm) - 3)
)) + (2)))))
;
5626 }
5627
5628 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
5629 } catch(std::exception &exception) {
5630 emit throwException(QString("getAllSubtypeOf failed. %1").arg(exception.what()));
5631 }
5632
5633 QString responseLog;
5634 responseLog.append("{");
5635 int result_i = 0;
5636 foreach(QString result_elt, result)for (auto _container_ = QtPrivate::qMakeForeachContainer(result
); _container_.control && _container_.i != _container_
.e; ++_container_.i, _container_.control ^= 1) for (QString result_elt
= *_container_.i; _container_.control; _container_.control =
0)
{
5637 if (result_i) {
5638 responseLog.append(",");
5639 }
5640 responseLog.append(result_elt);
5641 result_i++;
5642 }
5643 responseLog.append("}");
5644 emit logResponse("getAllSubtypeOf("+commandLog+")", responseLog, &commandTime);
5645
5646 return result;
5647}
5648QList<QString > OMCInterface::getPackages(QString class_)
5649{
5650 QTime commandTime;
5651 commandTime.start();
5652 QString commandLog;
5653 commandLog.append(class_);
5654 emit logCommand("getPackages("+commandLog+")", &commandTime);
5655
5656 QByteArray class__utf8 = class_.toUtf8();
5657 QList<QString > result;
5658 void *result_mm = NULL__null;
5659
5660 try {
5661 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
5662
5663 result_mm = omc_OpenModelicaScriptingAPI_getPackages(threadData, mmc_mk_scon(class__utf8.constData()));
5664 result.clear();
5665 while (!listEmpty(result_mm)((*(mmc_uint_t*)((void*)((char*)(result_mm) - 3))) == (((0) <<
10) + (((0) & 255) << 2)))
) {
5666 QString result_elt;
5667 result_elt = MMC_STRINGDATA(MMC_CAR(result_mm))(((struct mmc_string*)((void*)((char*)((*(void**)(((void*)((void
**)(((void*)((char*)(result_mm) - 3))) + (1)))))) - 3)))->
data)
;
5668 result.push_back(result_elt);
5669 result_mm = MMC_CDR(result_mm)(*(void**)(((void*)((void**)(((void*)((char*)(result_mm) - 3)
)) + (2)))))
;
5670 }
5671
5672 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
5673 } catch(std::exception &exception) {
5674 emit throwException(QString("getPackages failed. %1").arg(exception.what()));
5675 }
5676
5677 QString responseLog;
5678 responseLog.append("{");
5679 int result_i = 0;
5680 foreach(QString result_elt, result)for (auto _container_ = QtPrivate::qMakeForeachContainer(result
); _container_.control && _container_.i != _container_
.e; ++_container_.i, _container_.control ^= 1) for (QString result_elt
= *_container_.i; _container_.control; _container_.control =
0)
{
5681 if (result_i) {
5682 responseLog.append(",");
5683 }
5684 responseLog.append(result_elt);
5685 result_i++;
5686 }
5687 responseLog.append("}");
5688 emit logResponse("getPackages("+commandLog+")", responseLog, &commandTime);
5689
5690 return result;
5691}
5692QList<QString > OMCInterface::getUsedClassNames(QString className)
5693{
5694 QTime commandTime;
5695 commandTime.start();
5696 QString commandLog;
5697 commandLog.append(className);
5698 emit logCommand("getUsedClassNames("+commandLog+")", &commandTime);
5699
5700 QByteArray className_utf8 = className.toUtf8();
5701 QList<QString > result;
5702 void *result_mm = NULL__null;
5703
5704 try {
5705 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
5706
5707 result_mm = omc_OpenModelicaScriptingAPI_getUsedClassNames(threadData, mmc_mk_scon(className_utf8.constData()));
5708 result.clear();
5709 while (!listEmpty(result_mm)((*(mmc_uint_t*)((void*)((char*)(result_mm) - 3))) == (((0) <<
10) + (((0) & 255) << 2)))
) {
5710 QString result_elt;
5711 result_elt = MMC_STRINGDATA(MMC_CAR(result_mm))(((struct mmc_string*)((void*)((char*)((*(void**)(((void*)((void
**)(((void*)((char*)(result_mm) - 3))) + (1)))))) - 3)))->
data)
;
5712 result.push_back(result_elt);
5713 result_mm = MMC_CDR(result_mm)(*(void**)(((void*)((void**)(((void*)((char*)(result_mm) - 3)
)) + (2)))))
;
5714 }
5715
5716 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
5717 } catch(std::exception &exception) {
5718 emit throwException(QString("getUsedClassNames failed. %1").arg(exception.what()));
5719 }
5720
5721 QString responseLog;
5722 responseLog.append("{");
5723 int result_i = 0;
5724 foreach(QString result_elt, result)for (auto _container_ = QtPrivate::qMakeForeachContainer(result
); _container_.control && _container_.i != _container_
.e; ++_container_.i, _container_.control ^= 1) for (QString result_elt
= *_container_.i; _container_.control; _container_.control =
0)
{
5725 if (result_i) {
5726 responseLog.append(",");
5727 }
5728 responseLog.append(result_elt);
5729 result_i++;
5730 }
5731 responseLog.append("}");
5732 emit logResponse("getUsedClassNames("+commandLog+")", responseLog, &commandTime);
5733
5734 return result;
5735}
5736QList<QString > OMCInterface::getClassNames(QString class_, modelica_boolean recursive, modelica_boolean qualified, modelica_boolean sort, modelica_boolean builtin, modelica_boolean showProtected, modelica_boolean includeConstants)
5737{
5738 QTime commandTime;
5739 commandTime.start();
5740 QString commandLog;
5741 commandLog.append(class_);
5742 commandLog.append(",");
5743 commandLog.append(recursive ? "true" : "false");
5744 commandLog.append(",");
5745 commandLog.append(qualified ? "true" : "false");
5746 commandLog.append(",");
5747 commandLog.append(sort ? "true" : "false");
5748 commandLog.append(",");
5749 commandLog.append(builtin ? "true" : "false");
5750 commandLog.append(",");
5751 commandLog.append(showProtected ? "true" : "false");
5752 commandLog.append(",");
5753 commandLog.append(includeConstants ? "true" : "false");
5754 emit logCommand("getClassNames("+commandLog+")", &commandTime);
5755
5756 QByteArray class__utf8 = class_.toUtf8();
5757 QList<QString > result;
5758 void *result_mm = NULL__null;
5759
5760 try {
5761 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
5762
5763 result_mm = omc_OpenModelicaScriptingAPI_getClassNames(threadData, mmc_mk_scon(class__utf8.constData()), recursive, qualified, sort, builtin, showProtected, includeConstants);
5764 result.clear();
5765 while (!listEmpty(result_mm)((*(mmc_uint_t*)((void*)((char*)(result_mm) - 3))) == (((0) <<
10) + (((0) & 255) << 2)))
) {
5766 QString result_elt;
5767 result_elt = MMC_STRINGDATA(MMC_CAR(result_mm))(((struct mmc_string*)((void*)((char*)((*(void**)(((void*)((void
**)(((void*)((char*)(result_mm) - 3))) + (1)))))) - 3)))->
data)
;
5768 result.push_back(result_elt);
5769 result_mm = MMC_CDR(result_mm)(*(void**)(((void*)((void**)(((void*)((char*)(result_mm) - 3)
)) + (2)))))
;
5770 }
5771
5772 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
5773 } catch(std::exception &exception) {
5774 emit throwException(QString("getClassNames failed. %1").arg(exception.what()));
5775 }
5776
5777 QString responseLog;
5778 responseLog.append("{");
5779 int result_i = 0;
5780 foreach(QString result_elt, result)for (auto _container_ = QtPrivate::qMakeForeachContainer(result
); _container_.control && _container_.i != _container_
.e; ++_container_.i, _container_.control ^= 1) for (QString result_elt
= *_container_.i; _container_.control; _container_.control =
0)
{
5781 if (result_i) {
5782 responseLog.append(",");
5783 }
5784 responseLog.append(result_elt);
5785 result_i++;
5786 }
5787 responseLog.append("}");
5788 emit logResponse("getClassNames("+commandLog+")", responseLog, &commandTime);
5789
5790 return result;
5791}
5792modelica_boolean OMCInterface::setClassComment(QString class_, QString filename)
5793{
5794 QTime commandTime;
5795 commandTime.start();
5796 QString commandLog;
5797 commandLog.append(class_);
5798 commandLog.append(",");
5799 commandLog.append("\"" + filename + "\"");
5800 emit logCommand("setClassComment("+commandLog+")", &commandTime);
5801
5802 QByteArray class__utf8 = class_.toUtf8();
5803 QByteArray filename_utf8 = filename.toUtf8();
5804 modelica_boolean result;
5805
5806 try {
5807 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
5808
5809 result = omc_OpenModelicaScriptingAPI_setClassComment(threadData, mmc_mk_scon(class__utf8.constData()), mmc_mk_scon(filename_utf8.constData()));
5810
5811 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
5812 } catch(std::exception &exception) {
5813 emit throwException(QString("setClassComment failed. %1").arg(exception.what()));
5814 }
5815
5816 QString responseLog;
5817 responseLog.append(result ? "true" : "false");
5818 emit logResponse("setClassComment("+commandLog+")", responseLog, &commandTime);
5819
5820 return result;
5821}
5822modelica_boolean OMCInterface::isShortDefinition(QString class_)
5823{
5824 QTime commandTime;
5825 commandTime.start();
5826 QString commandLog;
5827 commandLog.append(class_);
5828 emit logCommand("isShortDefinition("+commandLog+")", &commandTime);
5829
5830 QByteArray class__utf8 = class_.toUtf8();
5831 modelica_boolean result;
5832
5833 try {
5834 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
5835
5836 result = omc_OpenModelicaScriptingAPI_isShortDefinition(threadData, mmc_mk_scon(class__utf8.constData()));
5837
5838 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
5839 } catch(std::exception &exception) {
5840 emit throwException(QString("isShortDefinition failed. %1").arg(exception.what()));
5841 }
5842
5843 QString responseLog;
5844 responseLog.append(result ? "true" : "false");
5845 emit logResponse("isShortDefinition("+commandLog+")", responseLog, &commandTime);
5846
5847 return result;
5848}
5849modelica_boolean OMCInterface::setSourceFile(QString class_, QString filename)
5850{
5851 QTime commandTime;
5852 commandTime.start();
5853 QString commandLog;
5854 commandLog.append(class_);
5855 commandLog.append(",");
5856 commandLog.append("\"" + filename + "\"");
5857 emit logCommand("setSourceFile("+commandLog+")", &commandTime);
5858
5859 QByteArray class__utf8 = class_.toUtf8();
5860 QByteArray filename_utf8 = filename.toUtf8();
5861 modelica_boolean result;
5862
5863 try {
5864 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
5865
5866 result = omc_OpenModelicaScriptingAPI_setSourceFile(threadData, mmc_mk_scon(class__utf8.constData()), mmc_mk_scon(filename_utf8.constData()));
5867
5868 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
5869 } catch(std::exception &exception) {
5870 emit throwException(QString("setSourceFile failed. %1").arg(exception.what()));
5871 }
5872
5873 QString responseLog;
5874 responseLog.append(result ? "true" : "false");
5875 emit logResponse("setSourceFile("+commandLog+")", responseLog, &commandTime);
5876
5877 return result;
5878}
5879QString OMCInterface::getSourceFile(QString class_)
5880{
5881 QTime commandTime;
5882 commandTime.start();
5883 QString commandLog;
5884 commandLog.append(class_);
5885 emit logCommand("getSourceFile("+commandLog+")", &commandTime);
5886
5887 QByteArray class__utf8 = class_.toUtf8();
5888 QString result;
5889 void *result_mm = NULL__null;
5890
5891 try {
5892 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
5893
5894 result_mm = omc_OpenModelicaScriptingAPI_getSourceFile(threadData, mmc_mk_scon(class__utf8.constData()));
5895 result = QString::fromUtf8(MMC_STRINGDATA(result_mm)(((struct mmc_string*)((void*)((char*)(result_mm) - 3)))->
data)
);
5896
5897 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
5898 } catch(std::exception &exception) {
5899 emit throwException(QString("getSourceFile failed. %1").arg(exception.what()));
5900 }
5901
5902 QString responseLog;
5903 responseLog.append("\"" + result + "\"");
5904 emit logResponse("getSourceFile("+commandLog+")", responseLog, &commandTime);
5905
5906 return result;
5907}
5908modelica_boolean OMCInterface::copyClass(QString className, QString newClassName, QString withIn)
5909{
5910 QTime commandTime;
5911 commandTime.start();
5912 QString commandLog;
5913 commandLog.append(className);
5914 commandLog.append(",");
5915 commandLog.append("\"" + newClassName + "\"");
5916 commandLog.append(",");
5917 commandLog.append(withIn);
5918 emit logCommand("copyClass("+commandLog+")", &commandTime);
5919
5920 QByteArray className_utf8 = className.toUtf8();
5921 QByteArray newClassName_utf8 = newClassName.toUtf8();
5922 QByteArray withIn_utf8 = withIn.toUtf8();
5923 modelica_boolean result;
5924
5925 try {
5926 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
5927
5928 result = omc_OpenModelicaScriptingAPI_copyClass(threadData, mmc_mk_scon(className_utf8.constData()), mmc_mk_scon(newClassName_utf8.constData()), mmc_mk_scon(withIn_utf8.constData()));
5929
5930 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
5931 } catch(std::exception &exception) {
5932 emit throwException(QString("copyClass failed. %1").arg(exception.what()));
5933 }
5934
5935 QString responseLog;
5936 responseLog.append(result ? "true" : "false");
5937 emit logResponse("copyClass("+commandLog+")", responseLog, &commandTime);
5938
5939 return result;
5940}
5941modelica_boolean OMCInterface::moveClassToBottom(QString className)
5942{
5943 QTime commandTime;
5944 commandTime.start();
5945 QString commandLog;
5946 commandLog.append(className);
5947 emit logCommand("moveClassToBottom("+commandLog+")", &commandTime);
5948
5949 QByteArray className_utf8 = className.toUtf8();
5950 modelica_boolean result;
5951
5952 try {
5953 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
5954
5955 result = omc_OpenModelicaScriptingAPI_moveClassToBottom(threadData, mmc_mk_scon(className_utf8.constData()));
5956
5957 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
5958 } catch(std::exception &exception) {
5959 emit throwException(QString("moveClassToBottom failed. %1").arg(exception.what()));
5960 }
5961
5962 QString responseLog;
5963 responseLog.append(result ? "true" : "false");
5964 emit logResponse("moveClassToBottom("+commandLog+")", responseLog, &commandTime);
5965
5966 return result;
5967}
5968modelica_boolean OMCInterface::moveClassToTop(QString className)
5969{
5970 QTime commandTime;
5971 commandTime.start();
5972 QString commandLog;
5973 commandLog.append(className);
5974 emit logCommand("moveClassToTop("+commandLog+")", &commandTime);
5975
5976 QByteArray className_utf8 = className.toUtf8();
5977 modelica_boolean result;
5978
5979 try {
5980 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
5981
5982 result = omc_OpenModelicaScriptingAPI_moveClassToTop(threadData, mmc_mk_scon(className_utf8.constData()));
5983
5984 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
5985 } catch(std::exception &exception) {
5986 emit throwException(QString("moveClassToTop failed. %1").arg(exception.what()));
5987 }
5988
5989 QString responseLog;
5990 responseLog.append(result ? "true" : "false");
5991 emit logResponse("moveClassToTop("+commandLog+")", responseLog, &commandTime);
5992
5993 return result;
5994}
5995modelica_boolean OMCInterface::moveClass(QString className, modelica_integer offset)
5996{
5997 QTime commandTime;
5998 commandTime.start();
5999 QString commandLog;
6000 commandLog.append(className);
6001 commandLog.append(",");
6002 commandLog.append(QString::number(offset));
6003 emit logCommand("moveClass("+commandLog+")", &commandTime);
6004
6005 QByteArray className_utf8 = className.toUtf8();
6006 modelica_boolean result;
6007
6008 try {
6009 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
6010
6011 result = omc_OpenModelicaScriptingAPI_moveClass(threadData, mmc_mk_scon(className_utf8.constData()), offset);
6012
6013 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
6014 } catch(std::exception &exception) {
6015 emit throwException(QString("moveClass failed. %1").arg(exception.what()));
6016 }
6017
6018 QString responseLog;
6019 responseLog.append(result ? "true" : "false");
6020 emit logResponse("moveClass("+commandLog+")", responseLog, &commandTime);
6021
6022 return result;
6023}
6024QList<QString > OMCInterface::reduceTerms(QString className, modelica_real startTime, modelica_real stopTime, modelica_integer numberOfIntervals, modelica_real tolerance, QString method, QString fileNamePrefix, QString options, QString outputFormat, QString variableFilter, QString cflags, QString simflags, QString labelstoCancel)
6025{
6026 QTime commandTime;
6027 commandTime.start();
6028 QString commandLog;
6029 commandLog.append(className);
6030 commandLog.append(",");
6031 commandLog.append(QString::number(startTime));
6032 commandLog.append(",");
6033 commandLog.append(QString::number(stopTime));
6034 commandLog.append(",");
6035 commandLog.append(QString::number(numberOfIntervals));
6036 commandLog.append(",");
6037 commandLog.append(QString::number(tolerance));
6038 commandLog.append(",");
6039 commandLog.append("\"" + method + "\"");
6040 commandLog.append(",");
6041 commandLog.append("\"" + fileNamePrefix + "\"");
6042 commandLog.append(",");
6043 commandLog.append("\"" + options + "\"");
6044 commandLog.append(",");
6045 commandLog.append("\"" + outputFormat + "\"");
6046 commandLog.append(",");
6047 commandLog.append("\"" + variableFilter + "\"");
6048 commandLog.append(",");
6049 commandLog.append("\"" + cflags + "\"");
6050 commandLog.append(",");
6051 commandLog.append("\"" + simflags + "\"");
6052 commandLog.append(",");
6053 commandLog.append("\"" + labelstoCancel + "\"");
6054 emit logCommand("reduceTerms("+commandLog+")", &commandTime);
6055
6056 QByteArray className_utf8 = className.toUtf8();
6057 QByteArray method_utf8 = method.toUtf8();
6058 QByteArray fileNamePrefix_utf8 = fileNamePrefix.toUtf8();
6059 QByteArray options_utf8 = options.toUtf8();
6060 QByteArray outputFormat_utf8 = outputFormat.toUtf8();
6061 QByteArray variableFilter_utf8 = variableFilter.toUtf8();
6062 QByteArray cflags_utf8 = cflags.toUtf8();
6063 QByteArray simflags_utf8 = simflags.toUtf8();
6064 QByteArray labelstoCancel_utf8 = labelstoCancel.toUtf8();
6065 QList<QString > result;
6066 void *result_mm = NULL__null;
6067
6068 try {
6069 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
6070
6071 result_mm = omc_OpenModelicaScriptingAPI_reduceTerms(threadData, mmc_mk_scon(className_utf8.constData()), startTime, stopTime, numberOfIntervals, tolerance, mmc_mk_scon(method_utf8.constData()), mmc_mk_scon(fileNamePrefix_utf8.constData()), mmc_mk_scon(options_utf8.constData()), mmc_mk_scon(outputFormat_utf8.constData()), mmc_mk_scon(variableFilter_utf8.constData()), mmc_mk_scon(cflags_utf8.constData()), mmc_mk_scon(simflags_utf8.constData()), mmc_mk_scon(labelstoCancel_utf8.constData()));
6072 result.clear();
6073 while (!listEmpty(result_mm)((*(mmc_uint_t*)((void*)((char*)(result_mm) - 3))) == (((0) <<
10) + (((0) & 255) << 2)))
) {
6074 QString result_elt;
6075 result_elt = MMC_STRINGDATA(MMC_CAR(result_mm))(((struct mmc_string*)((void*)((char*)((*(void**)(((void*)((void
**)(((void*)((char*)(result_mm) - 3))) + (1)))))) - 3)))->
data)
;
6076 result.push_back(result_elt);
6077 result_mm = MMC_CDR(result_mm)(*(void**)(((void*)((void**)(((void*)((char*)(result_mm) - 3)
)) + (2)))))
;
6078 }
6079
6080 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
6081 } catch(std::exception &exception) {
6082 emit throwException(QString("reduceTerms failed. %1").arg(exception.what()));
6083 }
6084
6085 QString responseLog;
6086 responseLog.append("{");
6087 int result_i = 0;
6088 foreach(QString result_elt, result)for (auto _container_ = QtPrivate::qMakeForeachContainer(result
); _container_.control && _container_.i != _container_
.e; ++_container_.i, _container_.control ^= 1) for (QString result_elt
= *_container_.i; _container_.control; _container_.control =
0)
{
6089 if (result_i) {
6090 responseLog.append(",");
6091 }
6092 responseLog.append("\"" + result_elt + "\"");
6093 result_i++;
6094 }
6095 responseLog.append("}");
6096 emit logResponse("reduceTerms("+commandLog+")", responseLog, &commandTime);
6097
6098 return result;
6099}
6100QList<QString > OMCInterface::buildLabel(QString className, modelica_real startTime, modelica_real stopTime, modelica_integer numberOfIntervals, modelica_real tolerance, QString method, QString fileNamePrefix, QString options, QString outputFormat, QString variableFilter, QString cflags, QString simflags)
6101{
6102 QTime commandTime;
6103 commandTime.start();
6104 QString commandLog;
6105 commandLog.append(className);
6106 commandLog.append(",");
6107 commandLog.append(QString::number(startTime));
6108 commandLog.append(",");
6109 commandLog.append(QString::number(stopTime));
6110 commandLog.append(",");
6111 commandLog.append(QString::number(numberOfIntervals));
6112 commandLog.append(",");
6113 commandLog.append(QString::number(tolerance));
6114 commandLog.append(",");
6115 commandLog.append("\"" + method + "\"");
6116 commandLog.append(",");
6117 commandLog.append("\"" + fileNamePrefix + "\"");
6118 commandLog.append(",");
6119 commandLog.append("\"" + options + "\"");
6120 commandLog.append(",");
6121 commandLog.append("\"" + outputFormat + "\"");
6122 commandLog.append(",");
6123 commandLog.append("\"" + variableFilter + "\"");
6124 commandLog.append(",");
6125 commandLog.append("\"" + cflags + "\"");
6126 commandLog.append(",");
6127 commandLog.append("\"" + simflags + "\"");
6128 emit logCommand("buildLabel("+commandLog+")", &commandTime);
6129
6130 QByteArray className_utf8 = className.toUtf8();
6131 QByteArray method_utf8 = method.toUtf8();
6132 QByteArray fileNamePrefix_utf8 = fileNamePrefix.toUtf8();
6133 QByteArray options_utf8 = options.toUtf8();
6134 QByteArray outputFormat_utf8 = outputFormat.toUtf8();
6135 QByteArray variableFilter_utf8 = variableFilter.toUtf8();
6136 QByteArray cflags_utf8 = cflags.toUtf8();
6137 QByteArray simflags_utf8 = simflags.toUtf8();
6138 QList<QString > result;
6139 void *result_mm = NULL__null;
6140
6141 try {
6142 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
6143
6144 result_mm = omc_OpenModelicaScriptingAPI_buildLabel(threadData, mmc_mk_scon(className_utf8.constData()), startTime, stopTime, numberOfIntervals, tolerance, mmc_mk_scon(method_utf8.constData()), mmc_mk_scon(fileNamePrefix_utf8.constData()), mmc_mk_scon(options_utf8.constData()), mmc_mk_scon(outputFormat_utf8.constData()), mmc_mk_scon(variableFilter_utf8.constData()), mmc_mk_scon(cflags_utf8.constData()), mmc_mk_scon(simflags_utf8.constData()));
6145 result.clear();
6146 while (!listEmpty(result_mm)((*(mmc_uint_t*)((void*)((char*)(result_mm) - 3))) == (((0) <<
10) + (((0) & 255) << 2)))
) {
6147 QString result_elt;
6148 result_elt = MMC_STRINGDATA(MMC_CAR(result_mm))(((struct mmc_string*)((void*)((char*)((*(void**)(((void*)((void
**)(((void*)((char*)(result_mm) - 3))) + (1)))))) - 3)))->
data)
;
6149 result.push_back(result_elt);
6150 result_mm = MMC_CDR(result_mm)(*(void**)(((void*)((void**)(((void*)((char*)(result_mm) - 3)
)) + (2)))))
;
6151 }
6152
6153 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
6154 } catch(std::exception &exception) {
6155 emit throwException(QString("buildLabel failed. %1").arg(exception.what()));
6156 }
6157
6158 QString responseLog;
6159 responseLog.append("{");
6160 int result_i = 0;
6161 foreach(QString result_elt, result)for (auto _container_ = QtPrivate::qMakeForeachContainer(result
); _container_.control && _container_.i != _container_
.e; ++_container_.i, _container_.control ^= 1) for (QString result_elt
= *_container_.i; _container_.control; _container_.control =
0)
{
6162 if (result_i) {
6163 responseLog.append(",");
6164 }
6165 responseLog.append("\"" + result_elt + "\"");
6166 result_i++;
6167 }
6168 responseLog.append("}");
6169 emit logResponse("buildLabel("+commandLog+")", responseLog, &commandTime);
6170
6171 return result;
6172}
6173modelica_boolean OMCInterface::buildEncryptedPackage(QString className, modelica_boolean encrypt)
6174{
6175 QTime commandTime;
6176 commandTime.start();
6177 QString commandLog;
6178 commandLog.append(className);
6179 commandLog.append(",");
6180 commandLog.append(encrypt ? "true" : "false");
6181 emit logCommand("buildEncryptedPackage("+commandLog+")", &commandTime);
6182
6183 QByteArray className_utf8 = className.toUtf8();
6184 modelica_boolean result;
6185
6186 try {
6187 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
6188
6189 result = omc_OpenModelicaScriptingAPI_buildEncryptedPackage(threadData, mmc_mk_scon(className_utf8.constData()), encrypt);
6190
6191 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
6192 } catch(std::exception &exception) {
6193 emit throwException(QString("buildEncryptedPackage failed. %1").arg(exception.what()));
6194 }
6195
6196 QString responseLog;
6197 responseLog.append(result ? "true" : "false");
6198 emit logResponse("buildEncryptedPackage("+commandLog+")", responseLog, &commandTime);
6199
6200 return result;
6201}
6202QString OMCInterface::buildModelFMU(QString className, QString version, QString fmuType, QString fileNamePrefix, QList<QString > platforms, modelica_boolean includeResources)
6203{
6204 QTime commandTime;
6205 commandTime.start();
6206 QString commandLog;
6207 commandLog.append(className);
6208 commandLog.append(",");
6209 commandLog.append("\"" + version + "\"");
6210 commandLog.append(",");
6211 commandLog.append("\"" + fmuType + "\"");
6212 commandLog.append(",");
6213 commandLog.append("\"" + fileNamePrefix + "\"");
6214 commandLog.append(",");
6215 commandLog.append("{");
6216 int platforms_i = 0;
6217 foreach(QString platforms_elt, platforms)for (auto _container_ = QtPrivate::qMakeForeachContainer(platforms
); _container_.control && _container_.i != _container_
.e; ++_container_.i, _container_.control ^= 1) for (QString platforms_elt
= *_container_.i; _container_.control; _container_.control =
0)
{
6218 if (platforms_i) {
6219 commandLog.append(",");
6220 }
6221 commandLog.append("\"" + platforms_elt + "\"");
6222 platforms_i++;
6223 }
6224 commandLog.append("}");commandLog.append(",");
6225 commandLog.append(includeResources ? "true" : "false");
6226 emit logCommand("buildModelFMU("+commandLog+")", &commandTime);
6227
6228 QByteArray className_utf8 = className.toUtf8();
6229 QByteArray version_utf8 = version.toUtf8();
6230 QByteArray fmuType_utf8 = fmuType.toUtf8();
6231 QByteArray fileNamePrefix_utf8 = fileNamePrefix.toUtf8();
6232 void *platforms_lst = mmc_mk_nil()((void*)((char*)(&(mmc_nil).header) + 3));
6233 for (int platforms_i = platforms.size()-1; platforms_i>=0; platforms_i--) {
6234 QString platforms_elt = platforms[platforms_i];
6235 QByteArray platforms_elt_utf8 = platforms_elt.toUtf8();
6236 platforms_lst = mmc_mk_cons(mmc_mk_scon(platforms_elt_utf8.constData()), platforms_lst);
6237 }
6238 QString result;
6239 void *result_mm = NULL__null;
6240
6241 try {
6242 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
6243
6244 result_mm = omc_OpenModelicaScriptingAPI_buildModelFMU(threadData, mmc_mk_scon(className_utf8.constData()), mmc_mk_scon(version_utf8.constData()), mmc_mk_scon(fmuType_utf8.constData()), mmc_mk_scon(fileNamePrefix_utf8.constData()), platforms_lst, includeResources);
6245 result = QString::fromUtf8(MMC_STRINGDATA(result_mm)(((struct mmc_string*)((void*)((char*)(result_mm) - 3)))->
data)
);
6246
6247 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
6248 } catch(std::exception &exception) {
6249 emit throwException(QString("buildModelFMU failed. %1").arg(exception.what()));
6250 }
6251
6252 QString responseLog;
6253 responseLog.append("\"" + result + "\"");
6254 emit logResponse("buildModelFMU("+commandLog+")", responseLog, &commandTime);
6255
6256 return result;
6257}
6258QString OMCInterface::translateModelFMU(QString className, QString version, QString fmuType, QString fileNamePrefix, modelica_boolean includeResources)
6259{
6260 QTime commandTime;
6261 commandTime.start();
6262 QString commandLog;
6263 commandLog.append(className);
6264 commandLog.append(",");
6265 commandLog.append("\"" + version + "\"");
6266 commandLog.append(",");
6267 commandLog.append("\"" + fmuType + "\"");
6268 commandLog.append(",");
6269 commandLog.append("\"" + fileNamePrefix + "\"");
6270 commandLog.append(",");
6271 commandLog.append(includeResources ? "true" : "false");
6272 emit logCommand("translateModelFMU("+commandLog+")", &commandTime);
6273
6274 QByteArray className_utf8 = className.toUtf8();
6275 QByteArray version_utf8 = version.toUtf8();
6276 QByteArray fmuType_utf8 = fmuType.toUtf8();
6277 QByteArray fileNamePrefix_utf8 = fileNamePrefix.toUtf8();
6278 QString result;
6279 void *result_mm = NULL__null;
6280
6281 try {
6282 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
6283
6284 result_mm = omc_OpenModelicaScriptingAPI_translateModelFMU(threadData, mmc_mk_scon(className_utf8.constData()), mmc_mk_scon(version_utf8.constData()), mmc_mk_scon(fmuType_utf8.constData()), mmc_mk_scon(fileNamePrefix_utf8.constData()), includeResources);
6285 result = QString::fromUtf8(MMC_STRINGDATA(result_mm)(((struct mmc_string*)((void*)((char*)(result_mm) - 3)))->
data)
);
6286
6287 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
6288 } catch(std::exception &exception) {
6289 emit throwException(QString("translateModelFMU failed. %1").arg(exception.what()));
6290 }
6291
6292 QString responseLog;
6293 responseLog.append("\"" + result + "\"");
6294 emit logResponse("translateModelFMU("+commandLog+")", responseLog, &commandTime);
6295
6296 return result;
6297}
6298QString OMCInterface::importFMUModelDescription(QString filename, QString workdir, modelica_integer loglevel, modelica_boolean fullPath, modelica_boolean debugLogging, modelica_boolean generateInputConnectors, modelica_boolean generateOutputConnectors)
6299{
6300 QTime commandTime;
6301 commandTime.start();
6302 QString commandLog;
6303 commandLog.append("\"" + filename + "\"");
6304 commandLog.append(",");
6305 commandLog.append("\"" + workdir + "\"");
6306 commandLog.append(",");
6307 commandLog.append(QString::number(loglevel));
6308 commandLog.append(",");
6309 commandLog.append(fullPath ? "true" : "false");
6310 commandLog.append(",");
6311 commandLog.append(debugLogging ? "true" : "false");
6312 commandLog.append(",");
6313 commandLog.append(generateInputConnectors ? "true" : "false");
6314 commandLog.append(",");
6315 commandLog.append(generateOutputConnectors ? "true" : "false");
6316 emit logCommand("importFMUModelDescription("+commandLog+")", &commandTime);
6317
6318 QByteArray filename_utf8 = filename.toUtf8();
6319 QByteArray workdir_utf8 = workdir.toUtf8();
6320 QString result;
6321 void *result_mm = NULL__null;
6322
6323 try {
6324 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
6325
6326 result_mm = omc_OpenModelicaScriptingAPI_importFMUModelDescription(threadData, mmc_mk_scon(filename_utf8.constData()), mmc_mk_scon(workdir_utf8.constData()), loglevel, fullPath, debugLogging, generateInputConnectors, generateOutputConnectors);
6327 result = QString::fromUtf8(MMC_STRINGDATA(result_mm)(((struct mmc_string*)((void*)((char*)(result_mm) - 3)))->
data)
);
6328
6329 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
6330 } catch(std::exception &exception) {
6331 emit throwException(QString("importFMUModelDescription failed. %1").arg(exception.what()));
6332 }
6333
6334 QString responseLog;
6335 responseLog.append("\"" + result + "\"");
6336 emit logResponse("importFMUModelDescription("+commandLog+")", responseLog, &commandTime);
6337
6338 return result;
6339}
6340QString OMCInterface::importFMU(QString filename, QString workdir, modelica_integer loglevel, modelica_boolean fullPath, modelica_boolean debugLogging, modelica_boolean generateInputConnectors, modelica_boolean generateOutputConnectors)
6341{
6342 QTime commandTime;
6343 commandTime.start();
6344 QString commandLog;
6345 commandLog.append("\"" + filename + "\"");
6346 commandLog.append(",");
6347 commandLog.append("\"" + workdir + "\"");
6348 commandLog.append(",");
6349 commandLog.append(QString::number(loglevel));
6350 commandLog.append(",");
6351 commandLog.append(fullPath ? "true" : "false");
6352 commandLog.append(",");
6353 commandLog.append(debugLogging ? "true" : "false");
6354 commandLog.append(",");
6355 commandLog.append(generateInputConnectors ? "true" : "false");
6356 commandLog.append(",");
6357 commandLog.append(generateOutputConnectors ? "true" : "false");
6358 emit logCommand("importFMU("+commandLog+")", &commandTime);
6359
6360 QByteArray filename_utf8 = filename.toUtf8();
6361 QByteArray workdir_utf8 = workdir.toUtf8();
6362 QString result;
6363 void *result_mm = NULL__null;
6364
6365 try {
6366 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
6367
6368 result_mm = omc_OpenModelicaScriptingAPI_importFMU(threadData, mmc_mk_scon(filename_utf8.constData()), mmc_mk_scon(workdir_utf8.constData()), loglevel, fullPath, debugLogging, generateInputConnectors, generateOutputConnectors);
6369 result = QString::fromUtf8(MMC_STRINGDATA(result_mm)(((struct mmc_string*)((void*)((char*)(result_mm) - 3)))->
data)
);
6370
6371 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
6372 } catch(std::exception &exception) {
6373 emit throwException(QString("importFMU failed. %1").arg(exception.what()));
6374 }
6375
6376 QString responseLog;
6377 responseLog.append("\"" + result + "\"");
6378 emit logResponse("importFMU("+commandLog+")", responseLog, &commandTime);
6379
6380 return result;
6381}
6382QList<QList<QString > > OMCInterface::getLoadedLibraries()
6383{
6384 QTime commandTime;
6385 commandTime.start();
6386 emit logCommand("getLoadedLibraries()", &commandTime);
6387
6388 QList<QList<QString > > result;
6389 void *result_mm = NULL__null;
6390
6391 try {
6392 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
6393
6394 result_mm = omc_OpenModelicaScriptingAPI_getLoadedLibraries(threadData);
6395 result.clear();
6396 while (!listEmpty(result_mm)((*(mmc_uint_t*)((void*)((char*)(result_mm) - 3))) == (((0) <<
10) + (((0) & 255) << 2)))
) {
6397 QList<QString > result_elt;
6398 result_elt.clear();
6399 while (!listEmpty(MMC_CAR(result_mm))((*(mmc_uint_t*)((void*)((char*)((*(void**)(((void*)((void**)
(((void*)((char*)(result_mm) - 3))) + (1)))))) - 3))) == (((0
) << 10) + (((0) & 255) << 2)))
) {
6400 QString result_elt_elt;
6401 result_elt_elt = MMC_STRINGDATA(MMC_CAR(MMC_CAR(result_mm)))(((struct mmc_string*)((void*)((char*)((*(void**)(((void*)((void
**)(((void*)((char*)((*(void**)(((void*)((void**)(((void*)((char
*)(result_mm) - 3))) + (1)))))) - 3))) + (1)))))) - 3)))->
data)
;
6402 result_elt.push_back(result_elt_elt);
6403 MMC_CAR(result_mm)(*(void**)(((void*)((void**)(((void*)((char*)(result_mm) - 3)
)) + (1)))))
= MMC_CDR(MMC_CAR(result_mm))(*(void**)(((void*)((void**)(((void*)((char*)((*(void**)(((void
*)((void**)(((void*)((char*)(result_mm) - 3))) + (1)))))) - 3
))) + (2)))))
;
6404 }
6405 result.push_back(result_elt);
6406 result_mm = MMC_CDR(result_mm)(*(void**)(((void*)((void**)(((void*)((char*)(result_mm) - 3)
)) + (2)))))
;
6407 }
6408
6409 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
6410 } catch(std::exception &exception) {
6411 emit throwException(QString("getLoadedLibraries failed. %1").arg(exception.what()));
6412 }
6413
6414 QString responseLog;
6415 responseLog.append("{");
6416 int result_i = 0;
6417 foreach(QList<QString > result_elt, result)for (auto _container_ = QtPrivate::qMakeForeachContainer(result
); _container_.control && _container_.i != _container_
.e; ++_container_.i, _container_.control ^= 1) for (QList<
QString > result_elt = *_container_.i; _container_.control
; _container_.control = 0)
{
6418 if (result_i) {
6419 responseLog.append(",");
6420 }
6421 responseLog.append("{");
6422 int result_elt_i = 0;
6423 foreach(QString result_elt_elt, result_elt)for (auto _container_ = QtPrivate::qMakeForeachContainer(result_elt
); _container_.control && _container_.i != _container_
.e; ++_container_.i, _container_.control ^= 1) for (QString result_elt_elt
= *_container_.i; _container_.control; _container_.control =
0)
{
6424 if (result_elt_i) {
6425 responseLog.append(",");
6426 }
6427 responseLog.append("\"" + result_elt_elt + "\"");
6428 result_elt_i++;
6429 }
6430 responseLog.append("}");
6431 result_i++;
6432 }
6433 responseLog.append("}");
6434 emit logResponse("getLoadedLibraries()", responseLog, &commandTime);
6435
6436 return result;
6437}
6438QString OMCInterface::uriToFilename(QString uri)
6439{
6440 QTime commandTime;
6441 commandTime.start();
6442 QString commandLog;
6443 commandLog.append("\"" + uri + "\"");
6444 emit logCommand("uriToFilename("+commandLog+")", &commandTime);
6445
6446 QByteArray uri_utf8 = uri.toUtf8();
6447 QString result;
6448 void *result_mm = NULL__null;
6449
6450 try {
6451 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
6452
6453 result_mm = omc_OpenModelicaScriptingAPI_uriToFilename(threadData, mmc_mk_scon(uri_utf8.constData()));
6454 result = QString::fromUtf8(MMC_STRINGDATA(result_mm)(((struct mmc_string*)((void*)((char*)(result_mm) - 3)))->
data)
);
6455
6456 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
6457 } catch(std::exception &exception) {
6458 emit throwException(QString("uriToFilename failed. %1").arg(exception.what()));
6459 }
6460
6461 QString responseLog;
6462 responseLog.append("\"" + result + "\"");
6463 emit logResponse("uriToFilename("+commandLog+")", responseLog, &commandTime);
6464
6465 return result;
6466}
6467modelica_boolean OMCInterface::rewriteBlockCall(QString className, QString inDefs)
6468{
6469 QTime commandTime;
6470 commandTime.start();
6471 QString commandLog;
6472 commandLog.append(className);
6473 commandLog.append(",");
6474 commandLog.append(inDefs);
6475 emit logCommand("rewriteBlockCall("+commandLog+")", &commandTime);
6476
6477 QByteArray className_utf8 = className.toUtf8();
6478 QByteArray inDefs_utf8 = inDefs.toUtf8();
6479 modelica_boolean result;
6480
6481 try {
6482 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
6483
6484 result = omc_OpenModelicaScriptingAPI_rewriteBlockCall(threadData, mmc_mk_scon(className_utf8.constData()), mmc_mk_scon(inDefs_utf8.constData()));
6485
6486 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
6487 } catch(std::exception &exception) {
6488 emit throwException(QString("rewriteBlockCall failed. %1").arg(exception.what()));
6489 }
6490
6491 QString responseLog;
6492 responseLog.append(result ? "true" : "false");
6493 emit logResponse("rewriteBlockCall("+commandLog+")", responseLog, &commandTime);
6494
6495 return result;
6496}
6497modelica_boolean OMCInterface::generateVerificationScenarios(QString path)
6498{
6499 QTime commandTime;
6500 commandTime.start();
6501 QString commandLog;
6502 commandLog.append(path);
6503 emit logCommand("generateVerificationScenarios("+commandLog+")", &commandTime);
6504
6505 QByteArray path_utf8 = path.toUtf8();
6506 modelica_boolean result;
6507
6508 try {
6509 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
6510
6511 result = omc_OpenModelicaScriptingAPI_generateVerificationScenarios(threadData, mmc_mk_scon(path_utf8.constData()));
6512
6513 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
6514 } catch(std::exception &exception) {
6515 emit throwException(QString("generateVerificationScenarios failed. %1").arg(exception.what()));
6516 }
6517
6518 QString responseLog;
6519 responseLog.append(result ? "true" : "false");
6520 emit logResponse("generateVerificationScenarios("+commandLog+")", responseLog, &commandTime);
6521
6522 return result;
6523}
6524modelica_boolean OMCInterface::inferBindings(QString path)
6525{
6526 QTime commandTime;
6527 commandTime.start();
6528 QString commandLog;
6529 commandLog.append(path);
6530 emit logCommand("inferBindings("+commandLog+")", &commandTime);
6531
6532 QByteArray path_utf8 = path.toUtf8();
6533 modelica_boolean result;
6534
6535 try {
6536 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
6537
6538 result = omc_OpenModelicaScriptingAPI_inferBindings(threadData, mmc_mk_scon(path_utf8.constData()));
6539
6540 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
6541 } catch(std::exception &exception) {
6542 emit throwException(QString("inferBindings failed. %1").arg(exception.what()));
6543 }
6544
6545 QString responseLog;
6546 responseLog.append(result ? "true" : "false");
6547 emit logResponse("inferBindings("+commandLog+")", responseLog, &commandTime);
6548
6549 return result;
6550}
6551modelica_boolean OMCInterface::exportToFigaro(QString path, QString directory, QString database, QString mode, QString options, QString processor)
6552{
6553 QTime commandTime;
6554 commandTime.start();
6555 QString commandLog;
6556 commandLog.append(path);
6557 commandLog.append(",");
6558 commandLog.append("\"" + directory + "\"");
6559 commandLog.append(",");
6560 commandLog.append("\"" + database + "\"");
6561 commandLog.append(",");
6562 commandLog.append("\"" + mode + "\"");
6563 commandLog.append(",");
6564 commandLog.append("\"" + options + "\"");
6565 commandLog.append(",");
6566 commandLog.append("\"" + processor + "\"");
6567 emit logCommand("exportToFigaro("+commandLog+")", &commandTime);
6568
6569 QByteArray path_utf8 = path.toUtf8();
6570 QByteArray directory_utf8 = directory.toUtf8();
6571 QByteArray database_utf8 = database.toUtf8();
6572 QByteArray mode_utf8 = mode.toUtf8();
6573 QByteArray options_utf8 = options.toUtf8();
6574 QByteArray processor_utf8 = processor.toUtf8();
6575 modelica_boolean result;
6576
6577 try {
6578 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
6579
6580 result = omc_OpenModelicaScriptingAPI_exportToFigaro(threadData, mmc_mk_scon(path_utf8.constData()), mmc_mk_scon(directory_utf8.constData()), mmc_mk_scon(database_utf8.constData()), mmc_mk_scon(mode_utf8.constData()), mmc_mk_scon(options_utf8.constData()), mmc_mk_scon(processor_utf8.constData()));
6581
6582 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
6583 } catch(std::exception &exception) {
6584 emit throwException(QString("exportToFigaro failed. %1").arg(exception.what()));
6585 }
6586
6587 QString responseLog;
6588 responseLog.append(result ? "true" : "false");
6589 emit logResponse("exportToFigaro("+commandLog+")", responseLog, &commandTime);
6590
6591 return result;
6592}
6593QString OMCInterface::listFile(QString class_, modelica_boolean nestedClasses)
6594{
6595 QTime commandTime;
6596 commandTime.start();
6597 QString commandLog;
6598 commandLog.append(class_);
6599 commandLog.append(",");
6600 commandLog.append(nestedClasses ? "true" : "false");
6601 emit logCommand("listFile("+commandLog+")", &commandTime);
6602
6603 QByteArray class__utf8 = class_.toUtf8();
6604 QString result;
6605 void *result_mm = NULL__null;
6606
6607 try {
6608 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
6609
6610 result_mm = omc_OpenModelicaScriptingAPI_listFile(threadData, mmc_mk_scon(class__utf8.constData()), nestedClasses);
6611 result = QString::fromUtf8(MMC_STRINGDATA(result_mm)(((struct mmc_string*)((void*)((char*)(result_mm) - 3)))->
data)
);
6612
6613 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
6614 } catch(std::exception &exception) {
6615 emit throwException(QString("listFile failed. %1").arg(exception.what()));
6616 }
6617
6618 QString responseLog;
6619 responseLog.append("\"" + result + "\"");
6620 emit logResponse("listFile("+commandLog+")", responseLog, &commandTime);
6621
6622 return result;
6623}
6624QString OMCInterface::stringReplace(QString str, QString source, QString target)
6625{
6626 QTime commandTime;
6627 commandTime.start();
6628 QString commandLog;
6629 commandLog.append("\"" + str + "\"");
6630 commandLog.append(",");
6631 commandLog.append("\"" + source + "\"");
6632 commandLog.append(",");
6633 commandLog.append("\"" + target + "\"");
6634 emit logCommand("stringReplace("+commandLog+")", &commandTime);
6635
6636 QByteArray str_utf8 = str.toUtf8();
6637 QByteArray source_utf8 = source.toUtf8();
6638 QByteArray target_utf8 = target.toUtf8();
6639 QString result;
6640 void *result_mm = NULL__null;
6641
6642 try {
6643 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
6644
6645 result_mm = omc_OpenModelicaScriptingAPI_stringReplace(threadData, mmc_mk_scon(str_utf8.constData()), mmc_mk_scon(source_utf8.constData()), mmc_mk_scon(target_utf8.constData()));
6646 result = QString::fromUtf8(MMC_STRINGDATA(result_mm)(((struct mmc_string*)((void*)((char*)(result_mm) - 3)))->
data)
);
6647
6648 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
6649 } catch(std::exception &exception) {
6650 emit throwException(QString("stringReplace failed. %1").arg(exception.what()));
6651 }
6652
6653 QString responseLog;
6654 responseLog.append("\"" + result + "\"");
6655 emit logResponse("stringReplace("+commandLog+")", responseLog, &commandTime);
6656
6657 return result;
6658}
6659QList<QString > OMCInterface::stringSplit(QString string, QString token)
6660{
6661 QTime commandTime;
6662 commandTime.start();
6663 QString commandLog;
6664 commandLog.append("\"" + string + "\"");
6665 commandLog.append(",");
6666 commandLog.append("\"" + token + "\"");
6667 emit logCommand("stringSplit("+commandLog+")", &commandTime);
6668
6669 QByteArray string_utf8 = string.toUtf8();
6670 QByteArray token_utf8 = token.toUtf8();
6671 QList<QString > result;
6672 void *result_mm = NULL__null;
6673
6674 try {
6675 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
6676
6677 result_mm = omc_OpenModelicaScriptingAPI_stringSplit(threadData, mmc_mk_scon(string_utf8.constData()), mmc_mk_scon(token_utf8.constData()));
6678 result.clear();
6679 while (!listEmpty(result_mm)((*(mmc_uint_t*)((void*)((char*)(result_mm) - 3))) == (((0) <<
10) + (((0) & 255) << 2)))
) {
6680 QString result_elt;
6681 result_elt = MMC_STRINGDATA(MMC_CAR(result_mm))(((struct mmc_string*)((void*)((char*)((*(void**)(((void*)((void
**)(((void*)((char*)(result_mm) - 3))) + (1)))))) - 3)))->
data)
;
6682 result.push_back(result_elt);
6683 result_mm = MMC_CDR(result_mm)(*(void**)(((void*)((void**)(((void*)((char*)(result_mm) - 3)
)) + (2)))))
;
6684 }
6685
6686 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
6687 } catch(std::exception &exception) {
6688 emit throwException(QString("stringSplit failed. %1").arg(exception.what()));
6689 }
6690
6691 QString responseLog;
6692 responseLog.append("{");
6693 int result_i = 0;
6694 foreach(QString result_elt, result)for (auto _container_ = QtPrivate::qMakeForeachContainer(result
); _container_.control && _container_.i != _container_
.e; ++_container_.i, _container_.control ^= 1) for (QString result_elt
= *_container_.i; _container_.control; _container_.control =
0)
{
6695 if (result_i) {
6696 responseLog.append(",");
6697 }
6698 responseLog.append("\"" + result_elt + "\"");
6699 result_i++;
6700 }
6701 responseLog.append("}");
6702 emit logResponse("stringSplit("+commandLog+")", responseLog, &commandTime);
6703
6704 return result;
6705}
6706QList<QString > OMCInterface::strtok(QString string, QString token)
6707{
6708 QTime commandTime;
6709 commandTime.start();
6710 QString commandLog;
6711 commandLog.append("\"" + string + "\"");
6712 commandLog.append(",");
6713 commandLog.append("\"" + token + "\"");
6714 emit logCommand("strtok("+commandLog+")", &commandTime);
6715
6716 QByteArray string_utf8 = string.toUtf8();
6717 QByteArray token_utf8 = token.toUtf8();
6718 QList<QString > result;
6719 void *result_mm = NULL__null;
6720
6721 try {
6722 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
6723
6724 result_mm = omc_OpenModelicaScriptingAPI_strtok(threadData, mmc_mk_scon(string_utf8.constData()), mmc_mk_scon(token_utf8.constData()));
6725 result.clear();
6726 while (!listEmpty(result_mm)((*(mmc_uint_t*)((void*)((char*)(result_mm) - 3))) == (((0) <<
10) + (((0) & 255) << 2)))
) {
6727 QString result_elt;
6728 result_elt = MMC_STRINGDATA(MMC_CAR(result_mm))(((struct mmc_string*)((void*)((char*)((*(void**)(((void*)((void
**)(((void*)((char*)(result_mm) - 3))) + (1)))))) - 3)))->
data)
;
6729 result.push_back(result_elt);
6730 result_mm = MMC_CDR(result_mm)(*(void**)(((void*)((void**)(((void*)((char*)(result_mm) - 3)
)) + (2)))))
;
6731 }
6732
6733 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
6734 } catch(std::exception &exception) {
6735 emit throwException(QString("strtok failed. %1").arg(exception.what()));
6736 }
6737
6738 QString responseLog;
6739 responseLog.append("{");
6740 int result_i = 0;
6741 foreach(QString result_elt, result)for (auto _container_ = QtPrivate::qMakeForeachContainer(result
); _container_.control && _container_.i != _container_
.e; ++_container_.i, _container_.control ^= 1) for (QString result_elt
= *_container_.i; _container_.control; _container_.control =
0)
{
6742 if (result_i) {
6743 responseLog.append(",");
6744 }
6745 responseLog.append("\"" + result_elt + "\"");
6746 result_i++;
6747 }
6748 responseLog.append("}");
6749 emit logResponse("strtok("+commandLog+")", responseLog, &commandTime);
6750
6751 return result;
6752}
6753QList<QString > OMCInterface::listVariables()
6754{
6755 QTime commandTime;
6756 commandTime.start();
6757 emit logCommand("listVariables()", &commandTime);
6758
6759 QList<QString > result;
6760 void *result_mm = NULL__null;
6761
6762 try {
6763 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
6764
6765 result_mm = omc_OpenModelicaScriptingAPI_listVariables(threadData);
6766 result.clear();
6767 while (!listEmpty(result_mm)((*(mmc_uint_t*)((void*)((char*)(result_mm) - 3))) == (((0) <<
10) + (((0) & 255) << 2)))
) {
6768 QString result_elt;
6769 result_elt = MMC_STRINGDATA(MMC_CAR(result_mm))(((struct mmc_string*)((void*)((char*)((*(void**)(((void*)((void
**)(((void*)((char*)(result_mm) - 3))) + (1)))))) - 3)))->
data)
;
6770 result.push_back(result_elt);
6771 result_mm = MMC_CDR(result_mm)(*(void**)(((void*)((void**)(((void*)((char*)(result_mm) - 3)
)) + (2)))))
;
6772 }
6773
6774 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
6775 } catch(std::exception &exception) {
6776 emit throwException(QString("listVariables failed. %1").arg(exception.what()));
6777 }
6778
6779 QString responseLog;
6780 responseLog.append("{");
6781 int result_i = 0;
6782 foreach(QString result_elt, result)for (auto _container_ = QtPrivate::qMakeForeachContainer(result
); _container_.control && _container_.i != _container_
.e; ++_container_.i, _container_.control ^= 1) for (QString result_elt
= *_container_.i; _container_.control; _container_.control =
0)
{
6783 if (result_i) {
6784 responseLog.append(",");
6785 }
6786 responseLog.append(result_elt);
6787 result_i++;
6788 }
6789 responseLog.append("}");
6790 emit logResponse("listVariables()", responseLog, &commandTime);
6791
6792 return result;
6793}
6794QList<QString > OMCInterface::getDerivedUnits(QString baseUnit)
6795{
6796 QTime commandTime;
6797 commandTime.start();
6798 QString commandLog;
6799 commandLog.append("\"" + baseUnit + "\"");
6800 emit logCommand("getDerivedUnits("+commandLog+")", &commandTime);
6801
6802 QByteArray baseUnit_utf8 = baseUnit.toUtf8();
6803 QList<QString > result;
6804 void *result_mm = NULL__null;
6805
6806 try {
6807 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
6808
6809 result_mm = omc_OpenModelicaScriptingAPI_getDerivedUnits(threadData, mmc_mk_scon(baseUnit_utf8.constData()));
6810 result.clear();
6811 while (!listEmpty(result_mm)((*(mmc_uint_t*)((void*)((char*)(result_mm) - 3))) == (((0) <<
10) + (((0) & 255) << 2)))
) {
6812 QString result_elt;
6813 result_elt = MMC_STRINGDATA(MMC_CAR(result_mm))(((struct mmc_string*)((void*)((char*)((*(void**)(((void*)((void
**)(((void*)((char*)(result_mm) - 3))) + (1)))))) - 3)))->
data)
;
6814 result.push_back(result_elt);
6815 result_mm = MMC_CDR(result_mm)(*(void**)(((void*)((void**)(((void*)((char*)(result_mm) - 3)
)) + (2)))))
;
6816 }
6817
6818 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
6819 } catch(std::exception &exception) {
6820 emit throwException(QString("getDerivedUnits failed. %1").arg(exception.what()));
6821 }
6822
6823 QString responseLog;
6824 responseLog.append("{");
6825 int result_i = 0;
6826 foreach(QString result_elt, result)for (auto _container_ = QtPrivate::qMakeForeachContainer(result
); _container_.control && _container_.i != _container_
.e; ++_container_.i, _container_.control ^= 1) for (QString result_elt
= *_container_.i; _container_.control; _container_.control =
0)
{
6827 if (result_i) {
6828 responseLog.append(",");
6829 }
6830 responseLog.append("\"" + result_elt + "\"");
6831 result_i++;
6832 }
6833 responseLog.append("}");
6834 emit logResponse("getDerivedUnits("+commandLog+")", responseLog, &commandTime);
6835
6836 return result;
6837}
6838OMCInterface::convertUnits_res OMCInterface::convertUnits(QString s1, QString s2)
6839{
6840 QTime commandTime;
6841 commandTime.start();
6842 QString commandLog;
6843 commandLog.append("\"" + s1 + "\"");
6844 commandLog.append(",");
6845 commandLog.append("\"" + s2 + "\"");
6846 emit logCommand("convertUnits("+commandLog+")", &commandTime);
6847
6848 QByteArray s1_utf8 = s1.toUtf8();
6849 QByteArray s2_utf8 = s2.toUtf8();
6850 convertUnits_res result;
6851
6852 try {
6853 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
6854
6855 result.unitsCompatible = omc_OpenModelicaScriptingAPI_convertUnits(threadData, mmc_mk_scon(s1_utf8.constData()), mmc_mk_scon(s2_utf8.constData()), &result.scaleFactor, &result.offset);
6856
6857 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
6858 } catch(std::exception &exception) {
6859 emit throwException(QString("convertUnits failed. %1").arg(exception.what()));
6860 }
6861
6862 QString responseLog;
6863 responseLog.append(result.toString());
6864 emit logResponse("convertUnits("+commandLog+")", responseLog, &commandTime);
6865
6866 return result;
6867}
6868OMCInterface::dumpXMLDAE_res OMCInterface::dumpXMLDAE(QString className, QString translationLevel, modelica_boolean addOriginalAdjacencyMatrix, modelica_boolean addSolvingInfo, modelica_boolean addMathMLCode, modelica_boolean dumpResiduals, QString fileNamePrefix, QString rewriteRulesFile)
6869{
6870 QTime commandTime;
6871 commandTime.start();
6872 QString commandLog;
6873 commandLog.append(className);
6874 commandLog.append(",");
6875 commandLog.append("\"" + translationLevel + "\"");
6876 commandLog.append(",");
6877 commandLog.append(addOriginalAdjacencyMatrix ? "true" : "false");
6878 commandLog.append(",");
6879 commandLog.append(addSolvingInfo ? "true" : "false");
6880 commandLog.append(",");
6881 commandLog.append(addMathMLCode ? "true" : "false");
6882 commandLog.append(",");
6883 commandLog.append(dumpResiduals ? "true" : "false");
6884 commandLog.append(",");
6885 commandLog.append("\"" + fileNamePrefix + "\"");
6886 commandLog.append(",");
6887 commandLog.append("\"" + rewriteRulesFile + "\"");
6888 emit logCommand("dumpXMLDAE("+commandLog+")", &commandTime);
6889
6890 QByteArray className_utf8 = className.toUtf8();
6891 QByteArray translationLevel_utf8 = translationLevel.toUtf8();
6892 QByteArray fileNamePrefix_utf8 = fileNamePrefix.toUtf8();
6893 QByteArray rewriteRulesFile_utf8 = rewriteRulesFile.toUtf8();
6894 dumpXMLDAE_res result;
6895 void *out2_mm = NULL__null;
6896
6897 try {
6898 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
6899
6900 result.success = omc_OpenModelicaScriptingAPI_dumpXMLDAE(threadData, mmc_mk_scon(className_utf8.constData()), mmc_mk_scon(translationLevel_utf8.constData()), addOriginalAdjacencyMatrix, addSolvingInfo, addMathMLCode, dumpResiduals, mmc_mk_scon(fileNamePrefix_utf8.constData()), mmc_mk_scon(rewriteRulesFile_utf8.constData()), &out2_mm);
6901 result.xmlfileName = QString::fromUtf8(MMC_STRINGDATA(out2_mm)(((struct mmc_string*)((void*)((char*)(out2_mm) - 3)))->data
)
);
6902
6903 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
6904 } catch(std::exception &exception) {
6905 emit throwException(QString("dumpXMLDAE failed. %1").arg(exception.what()));
6906 }
6907
6908 QString responseLog;
6909 responseLog.append(result.toString());
6910 emit logResponse("dumpXMLDAE("+commandLog+")", responseLog, &commandTime);
6911
6912 return result;
6913}
6914QString OMCInterface::translateGraphics(QString className)
6915{
6916 QTime commandTime;
6917 commandTime.start();
6918 QString commandLog;
6919 commandLog.append(className);
6920 emit logCommand("translateGraphics("+commandLog+")", &commandTime);
6921
6922 QByteArray className_utf8 = className.toUtf8();
6923 QString result;
6924 void *result_mm = NULL__null;
6925
6926 try {
6927 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
6928
6929 result_mm = omc_OpenModelicaScriptingAPI_translateGraphics(threadData, mmc_mk_scon(className_utf8.constData()));
6930 result = QString::fromUtf8(MMC_STRINGDATA(result_mm)(((struct mmc_string*)((void*)((char*)(result_mm) - 3)))->
data)
);
6931
6932 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
6933 } catch(std::exception &exception) {
6934 emit throwException(QString("translateGraphics failed. %1").arg(exception.what()));
6935 }
6936
6937 QString responseLog;
6938 responseLog.append("\"" + result + "\"");
6939 emit logResponse("translateGraphics("+commandLog+")", responseLog, &commandTime);
6940
6941 return result;
6942}
6943modelica_boolean OMCInterface::save(QString className)
6944{
6945 QTime commandTime;
6946 commandTime.start();
6947 QString commandLog;
6948 commandLog.append(className);
6949 emit logCommand("save("+commandLog+")", &commandTime);
6950
6951 QByteArray className_utf8 = className.toUtf8();
6952 modelica_boolean result;
6953
6954 try {
6955 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
6956
6957 result = omc_OpenModelicaScriptingAPI_save(threadData, mmc_mk_scon(className_utf8.constData()));
6958
6959 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
6960 } catch(std::exception &exception) {
6961 emit throwException(QString("save failed. %1").arg(exception.what()));
6962 }
6963
6964 QString responseLog;
6965 responseLog.append(result ? "true" : "false");
6966 emit logResponse("save("+commandLog+")", responseLog, &commandTime);
6967
6968 return result;
6969}
6970modelica_boolean OMCInterface::saveTotalModel(QString fileName, QString className, modelica_boolean stripAnnotations, modelica_boolean stripComments)
6971{
6972 QTime commandTime;
6973 commandTime.start();
6974 QString commandLog;
6975 commandLog.append("\"" + fileName + "\"");
6976 commandLog.append(",");
6977 commandLog.append(className);
6978 commandLog.append(",");
6979 commandLog.append(stripAnnotations ? "true" : "false");
6980 commandLog.append(",");
6981 commandLog.append(stripComments ? "true" : "false");
6982 emit logCommand("saveTotalModel("+commandLog+")", &commandTime);
6983
6984 QByteArray fileName_utf8 = fileName.toUtf8();
6985 QByteArray className_utf8 = className.toUtf8();
6986 modelica_boolean result;
6987
6988 try {
6989 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
6990
6991 result = omc_OpenModelicaScriptingAPI_saveTotalModel(threadData, mmc_mk_scon(fileName_utf8.constData()), mmc_mk_scon(className_utf8.constData()), stripAnnotations, stripComments);
6992
6993 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
6994 } catch(std::exception &exception) {
6995 emit throwException(QString("saveTotalModel failed. %1").arg(exception.what()));
6996 }
6997
6998 QString responseLog;
6999 responseLog.append(result ? "true" : "false");
7000 emit logResponse("saveTotalModel("+commandLog+")", responseLog, &commandTime);
7001
7002 return result;
7003}
7004modelica_boolean OMCInterface::saveModel(QString fileName, QString className)
7005{
7006 QTime commandTime;
7007 commandTime.start();
7008 QString commandLog;
7009 commandLog.append("\"" + fileName + "\"");
7010 commandLog.append(",");
7011 commandLog.append(className);
7012 emit logCommand("saveModel("+commandLog+")", &commandTime);
7013
7014 QByteArray fileName_utf8 = fileName.toUtf8();
7015 QByteArray className_utf8 = className.toUtf8();
7016 modelica_boolean result;
7017
7018 try {
7019 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
7020
7021 result = omc_OpenModelicaScriptingAPI_saveModel(threadData, mmc_mk_scon(fileName_utf8.constData()), mmc_mk_scon(className_utf8.constData()));
7022
7023 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
7024 } catch(std::exception &exception) {
7025 emit throwException(QString("saveModel failed. %1").arg(exception.what()));
7026 }
7027
7028 QString responseLog;
7029 responseLog.append(result ? "true" : "false");
7030 emit logResponse("saveModel("+commandLog+")", responseLog, &commandTime);
7031
7032 return result;
7033}
7034modelica_boolean OMCInterface::deleteFile(QString fileName)
7035{
7036 QTime commandTime;
7037 commandTime.start();
7038 QString commandLog;
7039 commandLog.append("\"" + fileName + "\"");
7040 emit logCommand("deleteFile("+commandLog+")", &commandTime);
7041
7042 QByteArray fileName_utf8 = fileName.toUtf8();
7043 modelica_boolean result;
7044
7045 try {
7046 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
7047
7048 result = omc_OpenModelicaScriptingAPI_deleteFile(threadData, mmc_mk_scon(fileName_utf8.constData()));
7049
7050 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
7051 } catch(std::exception &exception) {
7052 emit throwException(QString("deleteFile failed. %1").arg(exception.what()));
7053 }
7054
7055 QString responseLog;
7056 responseLog.append(result ? "true" : "false");
7057 emit logResponse("deleteFile("+commandLog+")", responseLog, &commandTime);
7058
7059 return result;
7060}
7061modelica_boolean OMCInterface::loadModel(QString className, QList<QString > priorityVersion, modelica_boolean notify, QString languageStandard, modelica_boolean requireExactVersion)
7062{
7063 QTime commandTime;
7064 commandTime.start();
7065 QString commandLog;
7066 commandLog.append(className);
7067 commandLog.append(",");
7068 commandLog.append("{");
7069 int priorityVersion_i = 0;
7070 foreach(QString priorityVersion_elt, priorityVersion)for (auto _container_ = QtPrivate::qMakeForeachContainer(priorityVersion
); _container_.control && _container_.i != _container_
.e; ++_container_.i, _container_.control ^= 1) for (QString priorityVersion_elt
= *_container_.i; _container_.control; _container_.control =
0)
{
7071 if (priorityVersion_i) {
7072 commandLog.append(",");
7073 }
7074 commandLog.append("\"" + priorityVersion_elt + "\"");
7075 priorityVersion_i++;
7076 }
7077 commandLog.append("}");commandLog.append(",");
7078 commandLog.append(notify ? "true" : "false");
7079 commandLog.append(",");
7080 commandLog.append("\"" + languageStandard + "\"");
7081 commandLog.append(",");
7082 commandLog.append(requireExactVersion ? "true" : "false");
7083 emit logCommand("loadModel("+commandLog+")", &commandTime);
7084
7085 QByteArray className_utf8 = className.toUtf8();
7086 void *priorityVersion_lst = mmc_mk_nil()((void*)((char*)(&(mmc_nil).header) + 3));
7087 for (int priorityVersion_i = priorityVersion.size()-1; priorityVersion_i>=0; priorityVersion_i--) {
7088 QString priorityVersion_elt = priorityVersion[priorityVersion_i];
7089 QByteArray priorityVersion_elt_utf8 = priorityVersion_elt.toUtf8();
7090 priorityVersion_lst = mmc_mk_cons(mmc_mk_scon(priorityVersion_elt_utf8.constData()), priorityVersion_lst);
7091 }
7092 QByteArray languageStandard_utf8 = languageStandard.toUtf8();
7093 modelica_boolean result;
7094
7095 try {
7096 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
7097
7098 result = omc_OpenModelicaScriptingAPI_loadModel(threadData, mmc_mk_scon(className_utf8.constData()), priorityVersion_lst, notify, mmc_mk_scon(languageStandard_utf8.constData()), requireExactVersion);
7099
7100 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
7101 } catch(std::exception &exception) {
7102 emit throwException(QString("loadModel failed. %1").arg(exception.what()));
7103 }
7104
7105 QString responseLog;
7106 responseLog.append(result ? "true" : "false");
7107 emit logResponse("loadModel("+commandLog+")", responseLog, &commandTime);
7108
7109 return result;
7110}
7111modelica_boolean OMCInterface::generateCode(QString className)
7112{
7113 QTime commandTime;
7114 commandTime.start();
7115 QString commandLog;
7116 commandLog.append(className);
7117 emit logCommand("generateCode("+commandLog+")", &commandTime);
7118
7119 QByteArray className_utf8 = className.toUtf8();
7120 modelica_boolean result;
7121
7122 try {
7123 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
7124
7125 result = omc_OpenModelicaScriptingAPI_generateCode(threadData, mmc_mk_scon(className_utf8.constData()));
7126
7127 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
7128 } catch(std::exception &exception) {
7129 emit throwException(QString("generateCode failed. %1").arg(exception.what()));
7130 }
7131
7132 QString responseLog;
7133 responseLog.append(result ? "true" : "false");
7134 emit logResponse("generateCode("+commandLog+")", responseLog, &commandTime);
7135
7136 return result;
7137}
7138QString OMCInterface::runOpenTURNSPythonScript(QString pythonScriptFile)
7139{
7140 QTime commandTime;
7141 commandTime.start();
7142 QString commandLog;
7143 commandLog.append("\"" + pythonScriptFile + "\"");
7144 emit logCommand("runOpenTURNSPythonScript("+commandLog+")", &commandTime);
7145
7146 QByteArray pythonScriptFile_utf8 = pythonScriptFile.toUtf8();
7147 QString result;
7148 void *result_mm = NULL__null;
7149
7150 try {
7151 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
7152
7153 result_mm = omc_OpenModelicaScriptingAPI_runOpenTURNSPythonScript(threadData, mmc_mk_scon(pythonScriptFile_utf8.constData()));
7154 result = QString::fromUtf8(MMC_STRINGDATA(result_mm)(((struct mmc_string*)((void*)((char*)(result_mm) - 3)))->
data)
);
7155
7156 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
7157 } catch(std::exception &exception) {
7158 emit throwException(QString("runOpenTURNSPythonScript failed. %1").arg(exception.what()));
7159 }
7160
7161 QString responseLog;
7162 responseLog.append("\"" + result + "\"");
7163 emit logResponse("runOpenTURNSPythonScript("+commandLog+")", responseLog, &commandTime);
7164
7165 return result;
7166}
7167QString OMCInterface::buildOpenTURNSInterface(QString className, QString pythonTemplateFile, modelica_boolean showFlatModelica)
7168{
7169 QTime commandTime;
7170 commandTime.start();
7171 QString commandLog;
7172 commandLog.append(className);
7173 commandLog.append(",");
7174 commandLog.append("\"" + pythonTemplateFile + "\"");
7175 commandLog.append(",");
7176 commandLog.append(showFlatModelica ? "true" : "false");
7177 emit logCommand("buildOpenTURNSInterface("+commandLog+")", &commandTime);
7178
7179 QByteArray className_utf8 = className.toUtf8();
7180 QByteArray pythonTemplateFile_utf8 = pythonTemplateFile.toUtf8();
7181 QString result;
7182 void *result_mm = NULL__null;
7183
7184 try {
7185 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
7186
7187 result_mm = omc_OpenModelicaScriptingAPI_buildOpenTURNSInterface(threadData, mmc_mk_scon(className_utf8.constData()), mmc_mk_scon(pythonTemplateFile_utf8.constData()), showFlatModelica);
7188 result = QString::fromUtf8(MMC_STRINGDATA(result_mm)(((struct mmc_string*)((void*)((char*)(result_mm) - 3)))->
data)
);
7189
7190 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
7191 } catch(std::exception &exception) {
7192 emit throwException(QString("buildOpenTURNSInterface failed. %1").arg(exception.what()));
7193 }
7194
7195 QString responseLog;
7196 responseLog.append("\"" + result + "\"");
7197 emit logResponse("buildOpenTURNSInterface("+commandLog+")", responseLog, &commandTime);
7198
7199 return result;
7200}
7201QString OMCInterface::instantiateModel(QString className)
7202{
7203 QTime commandTime;
7204 commandTime.start();
7205 QString commandLog;
7206 commandLog.append(className);
7207 emit logCommand("instantiateModel("+commandLog+")", &commandTime);
7208
7209 QByteArray className_utf8 = className.toUtf8();
7210 QString result;
7211 void *result_mm = NULL__null;
7212
7213 try {
7214 MMC_TRY_TOP_INTERNAL(){ threadData_t *oldThreadData = (threadData_t*)pthread_getspecific
(mmc_thread_data_key); pthread_setspecific(mmc_thread_data_key
,threadData); pthread_mutex_init(&threadData->parentMutex
,__null); mmc_init_stackoverflow_fast(threadData, oldThreadData
); { jmp_buf new_mmc_jumper, *old_jumper __attribute__((unused
)) = threadData->mmc_jumper; threadData->mmc_jumper = &
new_mmc_jumper; if (_setjmp (new_mmc_jumper) == 0) { threadData
->mmc_stack_overflow_jumper = threadData->mmc_jumper;
7215
7216 result_mm = omc_OpenModelicaScriptingAPI_instantiateModel(threadData, mmc_mk_scon(className_utf8.constData()));
7217 result = QString::fromUtf8(MMC_STRINGDATA(result_mm)(((struct mmc_string*)((void*)((char*)(result_mm) - 3)))->
data)
);
7218
7219 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
7220 } catch(std::exception &e