Bug Summary

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

Annotated Source Code

[?] Use j/k keys for keyboard navigation

../../build/include/omc/scripting-API/OpenModelicaScriptingAPIQt.cpp

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;
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));
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());
1
Calling '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}
2812OMCInterface::getConversionsFromVersions_res OMCInterface::getConversionsFromVersions(QString pack)
2813{
2814 QTime commandTime;
2815 commandTime.start();
2816 QString commandLog;
2817 commandLog.append(pack);
2818 emit logCommand("getConversionsFromVersions("+commandLog+")", &commandTime);
2819
2820 QByteArray pack_utf8 = pack.toUtf8();
2821 getConversionsFromVersions_res result;
2822 void *out1_mm = NULL__null;
2823 void *out2_mm = NULL__null;
2824
2825 try {
2826 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;
2827
2828 out1_mm = omc_OpenModelicaScriptingAPI_getConversionsFromVersions(threadData, mmc_mk_scon(pack_utf8.constData()), &out2_mm);
2829 result.withoutConversion.clear();
2830 while (!listEmpty(out1_mm)((*(mmc_uint_t*)((void*)((char*)(out1_mm) - 3))) == (((0) <<
10) + (((0) & 255) << 2)))
) {
2831 QString out1_elt;
2832 out1_elt = MMC_STRINGDATA(MMC_CAR(out1_mm))(((struct mmc_string*)((void*)((char*)((*(void**)(((void*)((void
**)(((void*)((char*)(out1_mm) - 3))) + (1)))))) - 3)))->data
)
;
2833 result.withoutConversion.push_back(out1_elt);
2834 out1_mm = MMC_CDR(out1_mm)(*(void**)(((void*)((void**)(((void*)((char*)(out1_mm) - 3)))
+ (2)))))
;
2835 }
2836 result.withConversion.clear();
2837 while (!listEmpty(out2_mm)((*(mmc_uint_t*)((void*)((char*)(out2_mm) - 3))) == (((0) <<
10) + (((0) & 255) << 2)))
) {
2838 QString out2_elt;
2839 out2_elt = MMC_STRINGDATA(MMC_CAR(out2_mm))(((struct mmc_string*)((void*)((char*)((*(void**)(((void*)((void
**)(((void*)((char*)(out2_mm) - 3))) + (1)))))) - 3)))->data
)
;
2840 result.withConversion.push_back(out2_elt);
2841 out2_mm = MMC_CDR(out2_mm)(*(void**)(((void*)((void**)(((void*)((char*)(out2_mm) - 3)))
+ (2)))))
;
2842 }
2843
2844 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
2845 } catch(std::exception &exception) {
2846 emit throwException(QString("getConversionsFromVersions failed. %1").arg(exception.what()));
2847 }
2848
2849 QString responseLog;
2850 responseLog.append(result.toString());
2851 emit logResponse("getConversionsFromVersions("+commandLog+")", responseLog, &commandTime);
2852
2853 return result;
2854}
2855QList<QList<QString > > OMCInterface::getUses(QString pack)
2856{
2857 QTime commandTime;
2858 commandTime.start();
2859 QString commandLog;
2860 commandLog.append(pack);
2861 emit logCommand("getUses("+commandLog+")", &commandTime);
2862
2863 QByteArray pack_utf8 = pack.toUtf8();
2864 QList<QList<QString > > result;
2865 void *result_mm = NULL__null;
2866
2867 try {
2868 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;
2869
2870 result_mm = omc_OpenModelicaScriptingAPI_getUses(threadData, mmc_mk_scon(pack_utf8.constData()));
2871 result.clear();
2872 while (!listEmpty(result_mm)((*(mmc_uint_t*)((void*)((char*)(result_mm) - 3))) == (((0) <<
10) + (((0) & 255) << 2)))
) {
2873 QList<QString > result_elt;
2874 result_elt.clear();
2875 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)))
) {
2876 QString result_elt_elt;
2877 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)
;
2878 result_elt.push_back(result_elt_elt);
2879 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)))))
;
2880 }
2881 result.push_back(result_elt);
2882 result_mm = MMC_CDR(result_mm)(*(void**)(((void*)((void**)(((void*)((char*)(result_mm) - 3)
)) + (2)))))
;
2883 }
2884
2885 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
2886 } catch(std::exception &exception) {
2887 emit throwException(QString("getUses failed. %1").arg(exception.what()));
2888 }
2889
2890 QString responseLog;
2891 responseLog.append("{");
2892 int result_i = 0;
2893 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)
{
2894 if (result_i) {
2895 responseLog.append(",");
2896 }
2897 responseLog.append("{");
2898 int result_elt_i = 0;
2899 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)
{
2900 if (result_elt_i) {
2901 responseLog.append(",");
2902 }
2903 responseLog.append("\"" + result_elt_elt + "\"");
2904 result_elt_i++;
2905 }
2906 responseLog.append("}");
2907 result_i++;
2908 }
2909 responseLog.append("}");
2910 emit logResponse("getUses("+commandLog+")", responseLog, &commandTime);
2911
2912 return result;
2913}
2914QList<QString > OMCInterface::getAvailableLibraries()
2915{
2916 QTime commandTime;
2917 commandTime.start();
2918 emit logCommand("getAvailableLibraries()", &commandTime);
2919
2920 QList<QString > result;
2921 void *result_mm = NULL__null;
2922
2923 try {
2924 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;
2925
2926 result_mm = omc_OpenModelicaScriptingAPI_getAvailableLibraries(threadData);
2927 result.clear();
2928 while (!listEmpty(result_mm)((*(mmc_uint_t*)((void*)((char*)(result_mm) - 3))) == (((0) <<
10) + (((0) & 255) << 2)))
) {
2929 QString result_elt;
2930 result_elt = MMC_STRINGDATA(MMC_CAR(result_mm))(((struct mmc_string*)((void*)((char*)((*(void**)(((void*)((void
**)(((void*)((char*)(result_mm) - 3))) + (1)))))) - 3)))->
data)
;
2931 result.push_back(result_elt);
2932 result_mm = MMC_CDR(result_mm)(*(void**)(((void*)((void**)(((void*)((char*)(result_mm) - 3)
)) + (2)))))
;
2933 }
2934
2935 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
2936 } catch(std::exception &exception) {
2937 emit throwException(QString("getAvailableLibraries failed. %1").arg(exception.what()));
2938 }
2939
2940 QString responseLog;
2941 responseLog.append("{");
2942 int result_i = 0;
2943 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)
{
2944 if (result_i) {
2945 responseLog.append(",");
2946 }
2947 responseLog.append("\"" + result_elt + "\"");
2948 result_i++;
2949 }
2950 responseLog.append("}");
2951 emit logResponse("getAvailableLibraries()", responseLog, &commandTime);
2952
2953 return result;
2954}
2955QList<QString > OMCInterface::searchClassNames(QString searchText, modelica_boolean findInText)
2956{
2957 QTime commandTime;
2958 commandTime.start();
2959 QString commandLog;
2960 commandLog.append("\"" + searchText + "\"");
2961 commandLog.append(",");
2962 commandLog.append(findInText ? "true" : "false");
2963 emit logCommand("searchClassNames("+commandLog+")", &commandTime);
2964
2965 QByteArray searchText_utf8 = searchText.toUtf8();
2966 QList<QString > result;
2967 void *result_mm = NULL__null;
2968
2969 try {
2970 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;
2971
2972 result_mm = omc_OpenModelicaScriptingAPI_searchClassNames(threadData, mmc_mk_scon(searchText_utf8.constData()), findInText);
2973 result.clear();
2974 while (!listEmpty(result_mm)((*(mmc_uint_t*)((void*)((char*)(result_mm) - 3))) == (((0) <<
10) + (((0) & 255) << 2)))
) {
2975 QString result_elt;
2976 result_elt = MMC_STRINGDATA(MMC_CAR(result_mm))(((struct mmc_string*)((void*)((char*)((*(void**)(((void*)((void
**)(((void*)((char*)(result_mm) - 3))) + (1)))))) - 3)))->
data)
;
2977 result.push_back(result_elt);
2978 result_mm = MMC_CDR(result_mm)(*(void**)(((void*)((void**)(((void*)((char*)(result_mm) - 3)
)) + (2)))))
;
2979 }
2980
2981 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
2982 } catch(std::exception &exception) {
2983 emit throwException(QString("searchClassNames failed. %1").arg(exception.what()));
2984 }
2985
2986 QString responseLog;
2987 responseLog.append("{");
2988 int result_i = 0;
2989 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)
{
2990 if (result_i) {
2991 responseLog.append(",");
2992 }
2993 responseLog.append(result_elt);
2994 result_i++;
2995 }
2996 responseLog.append("}");
2997 emit logResponse("searchClassNames("+commandLog+")", responseLog, &commandTime);
2998
2999 return result;
3000}
3001modelica_boolean OMCInterface::extendsFrom(QString className, QString baseClassName)
3002{
3003 QTime commandTime;
3004 commandTime.start();
3005 QString commandLog;
3006 commandLog.append(className);
3007 commandLog.append(",");
3008 commandLog.append(baseClassName);
3009 emit logCommand("extendsFrom("+commandLog+")", &commandTime);
3010
3011 QByteArray className_utf8 = className.toUtf8();
3012 QByteArray baseClassName_utf8 = baseClassName.toUtf8();
3013 modelica_boolean result;
3014
3015 try {
3016 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;
3017
3018 result = omc_OpenModelicaScriptingAPI_extendsFrom(threadData, mmc_mk_scon(className_utf8.constData()), mmc_mk_scon(baseClassName_utf8.constData()));
3019
3020 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
3021 } catch(std::exception &exception) {
3022 emit throwException(QString("extendsFrom failed. %1").arg(exception.what()));
3023 }
3024
3025 QString responseLog;
3026 responseLog.append(result ? "true" : "false");
3027 emit logResponse("extendsFrom("+commandLog+")", responseLog, &commandTime);
3028
3029 return result;
3030}
3031modelica_boolean OMCInterface::getBooleanClassAnnotation(QString className, QString annotationName)
3032{
3033 QTime commandTime;
3034 commandTime.start();
3035 QString commandLog;
3036 commandLog.append(className);
3037 commandLog.append(",");
3038 commandLog.append(annotationName);
3039 emit logCommand("getBooleanClassAnnotation("+commandLog+")", &commandTime);
3040
3041 QByteArray className_utf8 = className.toUtf8();
3042 QByteArray annotationName_utf8 = annotationName.toUtf8();
3043 modelica_boolean result;
3044
3045 try {
3046 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;
3047
3048 result = omc_OpenModelicaScriptingAPI_getBooleanClassAnnotation(threadData, mmc_mk_scon(className_utf8.constData()), mmc_mk_scon(annotationName_utf8.constData()));
3049
3050 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
3051 } catch(std::exception &exception) {
3052 emit throwException(QString("getBooleanClassAnnotation failed. %1").arg(exception.what()));
3053 }
3054
3055 QString responseLog;
3056 responseLog.append(result ? "true" : "false");
3057 emit logResponse("getBooleanClassAnnotation("+commandLog+")", responseLog, &commandTime);
3058
3059 return result;
3060}
3061modelica_boolean OMCInterface::classAnnotationExists(QString className, QString annotationName)
3062{
3063 QTime commandTime;
3064 commandTime.start();
3065 QString commandLog;
3066 commandLog.append(className);
3067 commandLog.append(",");
3068 commandLog.append(annotationName);
3069 emit logCommand("classAnnotationExists("+commandLog+")", &commandTime);
3070
3071 QByteArray className_utf8 = className.toUtf8();
3072 QByteArray annotationName_utf8 = annotationName.toUtf8();
3073 modelica_boolean result;
3074
3075 try {
3076 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;
3077
3078 result = omc_OpenModelicaScriptingAPI_classAnnotationExists(threadData, mmc_mk_scon(className_utf8.constData()), mmc_mk_scon(annotationName_utf8.constData()));
3079
3080 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
3081 } catch(std::exception &exception) {
3082 emit throwException(QString("classAnnotationExists failed. %1").arg(exception.what()));
3083 }
3084
3085 QString responseLog;
3086 responseLog.append(result ? "true" : "false");
3087 emit logResponse("classAnnotationExists("+commandLog+")", responseLog, &commandTime);
3088
3089 return result;
3090}
3091QString OMCInterface::getAnnotationModifierValue(QString name, QString vendorannotation, QString modifiername)
3092{
3093 QTime commandTime;
3094 commandTime.start();
3095 QString commandLog;
3096 commandLog.append(name);
3097 commandLog.append(",");
3098 commandLog.append("\"" + vendorannotation + "\"");
3099 commandLog.append(",");
3100 commandLog.append("\"" + modifiername + "\"");
3101 emit logCommand("getAnnotationModifierValue("+commandLog+")", &commandTime);
3102
3103 QByteArray name_utf8 = name.toUtf8();
3104 QByteArray vendorannotation_utf8 = vendorannotation.toUtf8();
3105 QByteArray modifiername_utf8 = modifiername.toUtf8();
3106 QString result;
3107 void *result_mm = NULL__null;
3108
3109 try {
3110 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;
3111
3112 result_mm = omc_OpenModelicaScriptingAPI_getAnnotationModifierValue(threadData, mmc_mk_scon(name_utf8.constData()), mmc_mk_scon(vendorannotation_utf8.constData()), mmc_mk_scon(modifiername_utf8.constData()));
3113 result = QString::fromUtf8(MMC_STRINGDATA(result_mm)(((struct mmc_string*)((void*)((char*)(result_mm) - 3)))->
data)
);
3114
3115 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
3116 } catch(std::exception &exception) {
3117 emit throwException(QString("getAnnotationModifierValue failed. %1").arg(exception.what()));
3118 }
3119
3120 QString responseLog;
3121 responseLog.append("\"" + result + "\"");
3122 emit logResponse("getAnnotationModifierValue("+commandLog+")", responseLog, &commandTime);
3123
3124 return result;
3125}
3126QList<QString > OMCInterface::getAnnotationNamedModifiers(QString name, QString vendorannotation)
3127{
3128 QTime commandTime;
3129 commandTime.start();
3130 QString commandLog;
3131 commandLog.append(name);
3132 commandLog.append(",");
3133 commandLog.append("\"" + vendorannotation + "\"");
3134 emit logCommand("getAnnotationNamedModifiers("+commandLog+")", &commandTime);
3135
3136 QByteArray name_utf8 = name.toUtf8();
3137 QByteArray vendorannotation_utf8 = vendorannotation.toUtf8();
3138 QList<QString > result;
3139 void *result_mm = NULL__null;
3140
3141 try {
3142 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;
3143
3144 result_mm = omc_OpenModelicaScriptingAPI_getAnnotationNamedModifiers(threadData, mmc_mk_scon(name_utf8.constData()), mmc_mk_scon(vendorannotation_utf8.constData()));
3145 result.clear();
3146 while (!listEmpty(result_mm)((*(mmc_uint_t*)((void*)((char*)(result_mm) - 3))) == (((0) <<
10) + (((0) & 255) << 2)))
) {
3147 QString result_elt;
3148 result_elt = MMC_STRINGDATA(MMC_CAR(result_mm))(((struct mmc_string*)((void*)((char*)((*(void**)(((void*)((void
**)(((void*)((char*)(result_mm) - 3))) + (1)))))) - 3)))->
data)
;
3149 result.push_back(result_elt);
3150 result_mm = MMC_CDR(result_mm)(*(void**)(((void*)((void**)(((void*)((char*)(result_mm) - 3)
)) + (2)))))
;
3151 }
3152
3153 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
3154 } catch(std::exception &exception) {
3155 emit throwException(QString("getAnnotationNamedModifiers failed. %1").arg(exception.what()));
3156 }
3157
3158 QString responseLog;
3159 responseLog.append("{");
3160 int result_i = 0;
3161 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)
{
3162 if (result_i) {
3163 responseLog.append(",");
3164 }
3165 responseLog.append("\"" + result_elt + "\"");
3166 result_i++;
3167 }
3168 responseLog.append("}");
3169 emit logResponse("getAnnotationNamedModifiers("+commandLog+")", responseLog, &commandTime);
3170
3171 return result;
3172}
3173OMCInterface::getSimulationOptions_res OMCInterface::getSimulationOptions(QString name, modelica_real defaultStartTime, modelica_real defaultStopTime, modelica_real defaultTolerance, modelica_integer defaultNumberOfIntervals, modelica_real defaultInterval)
3174{
3175 QTime commandTime;
3176 commandTime.start();
3177 QString commandLog;
3178 commandLog.append(name);
3179 commandLog.append(",");
3180 commandLog.append(QString::number(defaultStartTime));
3181 commandLog.append(",");
3182 commandLog.append(QString::number(defaultStopTime));
3183 commandLog.append(",");
3184 commandLog.append(QString::number(defaultTolerance));
3185 commandLog.append(",");
3186 commandLog.append(QString::number(defaultNumberOfIntervals));
3187 commandLog.append(",");
3188 commandLog.append(QString::number(defaultInterval));
3189 emit logCommand("getSimulationOptions("+commandLog+")", &commandTime);
3190
3191 QByteArray name_utf8 = name.toUtf8();
3192 getSimulationOptions_res result;
3193
3194 try {
3195 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;
3196
3197 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);
3198
3199 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
3200 } catch(std::exception &exception) {
3201 emit throwException(QString("getSimulationOptions failed. %1").arg(exception.what()));
3202 }
3203
3204 QString responseLog;
3205 responseLog.append(result.toString());
3206 emit logResponse("getSimulationOptions("+commandLog+")", responseLog, &commandTime);
3207
3208 return result;
3209}
3210modelica_boolean OMCInterface::isExperiment(QString name)
3211{
3212 QTime commandTime;
3213 commandTime.start();
3214 QString commandLog;
3215 commandLog.append(name);
3216 emit logCommand("isExperiment("+commandLog+")", &commandTime);
3217
3218 QByteArray name_utf8 = name.toUtf8();
3219 modelica_boolean result;
3220
3221 try {
3222 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;
3223
3224 result = omc_OpenModelicaScriptingAPI_isExperiment(threadData, mmc_mk_scon(name_utf8.constData()));
3225
3226 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
3227 } catch(std::exception &exception) {
3228 emit throwException(QString("isExperiment failed. %1").arg(exception.what()));
3229 }
3230
3231 QString responseLog;
3232 responseLog.append(result ? "true" : "false");
3233 emit logResponse("isExperiment("+commandLog+")", responseLog, &commandTime);
3234
3235 return result;
3236}
3237QList<QString > OMCInterface::getInheritedClasses(QString name)
3238{
3239 QTime commandTime;
3240 commandTime.start();
3241 QString commandLog;
3242 commandLog.append(name);
3243 emit logCommand("getInheritedClasses("+commandLog+")", &commandTime);
3244
3245 QByteArray name_utf8 = name.toUtf8();
3246 QList<QString > result;
3247 void *result_mm = NULL__null;
3248
3249 try {
3250 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;
3251
3252 result_mm = omc_OpenModelicaScriptingAPI_getInheritedClasses(threadData, mmc_mk_scon(name_utf8.constData()));
3253 result.clear();
3254 while (!listEmpty(result_mm)((*(mmc_uint_t*)((void*)((char*)(result_mm) - 3))) == (((0) <<
10) + (((0) & 255) << 2)))
) {
3255 QString result_elt;
3256 result_elt = MMC_STRINGDATA(MMC_CAR(result_mm))(((struct mmc_string*)((void*)((char*)((*(void**)(((void*)((void
**)(((void*)((char*)(result_mm) - 3))) + (1)))))) - 3)))->
data)
;
3257 result.push_back(result_elt);
3258 result_mm = MMC_CDR(result_mm)(*(void**)(((void*)((void**)(((void*)((char*)(result_mm) - 3)
)) + (2)))))
;
3259 }
3260
3261 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
3262 } catch(std::exception &exception) {
3263 emit throwException(QString("getInheritedClasses failed. %1").arg(exception.what()));
3264 }
3265
3266 QString responseLog;
3267 responseLog.append("{");
3268 int result_i = 0;
3269 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)
{
3270 if (result_i) {
3271 responseLog.append(",");
3272 }
3273 responseLog.append(result_elt);
3274 result_i++;
3275 }
3276 responseLog.append("}");
3277 emit logResponse("getInheritedClasses("+commandLog+")", responseLog, &commandTime);
3278
3279 return result;
3280}
3281QString OMCInterface::getBuiltinType(QString cl)
3282{
3283 QTime commandTime;
3284 commandTime.start();
3285 QString commandLog;
3286 commandLog.append(cl);
3287 emit logCommand("getBuiltinType("+commandLog+")", &commandTime);
3288
3289 QByteArray cl_utf8 = cl.toUtf8();
3290 QString result;
3291 void *result_mm = NULL__null;
3292
3293 try {
3294 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;
3295
3296 result_mm = omc_OpenModelicaScriptingAPI_getBuiltinType(threadData, mmc_mk_scon(cl_utf8.constData()));
3297 result = QString::fromUtf8(MMC_STRINGDATA(result_mm)(((struct mmc_string*)((void*)((char*)(result_mm) - 3)))->
data)
);
3298
3299 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
3300 } catch(std::exception &exception) {
3301 emit throwException(QString("getBuiltinType failed. %1").arg(exception.what()));
3302 }
3303
3304 QString responseLog;
3305 responseLog.append("\"" + result + "\"");
3306 emit logResponse("getBuiltinType("+commandLog+")", responseLog, &commandTime);
3307
3308 return result;
3309}
3310modelica_boolean OMCInterface::isProtectedClass(QString cl, QString c2)
3311{
3312 QTime commandTime;
3313 commandTime.start();
3314 QString commandLog;
3315 commandLog.append(cl);
3316 commandLog.append(",");
3317 commandLog.append("\"" + c2 + "\"");
3318 emit logCommand("isProtectedClass("+commandLog+")", &commandTime);
3319
3320 QByteArray cl_utf8 = cl.toUtf8();
3321 QByteArray c2_utf8 = c2.toUtf8();
3322 modelica_boolean result;
3323
3324 try {
3325 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;
3326
3327 result = omc_OpenModelicaScriptingAPI_isProtectedClass(threadData, mmc_mk_scon(cl_utf8.constData()), mmc_mk_scon(c2_utf8.constData()));
3328
3329 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
3330 } catch(std::exception &exception) {
3331 emit throwException(QString("isProtectedClass failed. %1").arg(exception.what()));
3332 }
3333
3334 QString responseLog;
3335 responseLog.append(result ? "true" : "false");
3336 emit logResponse("isProtectedClass("+commandLog+")", responseLog, &commandTime);
3337
3338 return result;
3339}
3340modelica_boolean OMCInterface::isOperatorFunction(QString cl)
3341{
3342 QTime commandTime;
3343 commandTime.start();
3344 QString commandLog;
3345 commandLog.append(cl);
3346 emit logCommand("isOperatorFunction("+commandLog+")", &commandTime);
3347
3348 QByteArray cl_utf8 = cl.toUtf8();
3349 modelica_boolean result;
3350
3351 try {
3352 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;
3353
3354 result = omc_OpenModelicaScriptingAPI_isOperatorFunction(threadData, mmc_mk_scon(cl_utf8.constData()));
3355
3356 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
3357 } catch(std::exception &exception) {
3358 emit throwException(QString("isOperatorFunction failed. %1").arg(exception.what()));
3359 }
3360
3361 QString responseLog;
3362 responseLog.append(result ? "true" : "false");
3363 emit logResponse("isOperatorFunction("+commandLog+")", responseLog, &commandTime);
3364
3365 return result;
3366}
3367modelica_boolean OMCInterface::isOperatorRecord(QString cl)
3368{
3369 QTime commandTime;
3370 commandTime.start();
3371 QString commandLog;
3372 commandLog.append(cl);
3373 emit logCommand("isOperatorRecord("+commandLog+")", &commandTime);
3374
3375 QByteArray cl_utf8 = cl.toUtf8();
3376 modelica_boolean result;
3377
3378 try {
3379 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;
3380
3381 result = omc_OpenModelicaScriptingAPI_isOperatorRecord(threadData, mmc_mk_scon(cl_utf8.constData()));
3382
3383 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
3384 } catch(std::exception &exception) {
3385 emit throwException(QString("isOperatorRecord failed. %1").arg(exception.what()));
3386 }
3387
3388 QString responseLog;
3389 responseLog.append(result ? "true" : "false");
3390 emit logResponse("isOperatorRecord("+commandLog+")", responseLog, &commandTime);
3391
3392 return result;
3393}
3394modelica_boolean OMCInterface::isOperator(QString cl)
3395{
3396 QTime commandTime;
3397 commandTime.start();
3398 QString commandLog;
3399 commandLog.append(cl);
3400 emit logCommand("isOperator("+commandLog+")", &commandTime);
3401
3402 QByteArray cl_utf8 = cl.toUtf8();
3403 modelica_boolean result;
3404
3405 try {
3406 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;
3407
3408 result = omc_OpenModelicaScriptingAPI_isOperator(threadData, mmc_mk_scon(cl_utf8.constData()));
3409
3410 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
3411 } catch(std::exception &exception) {
3412 emit throwException(QString("isOperator failed. %1").arg(exception.what()));
3413 }
3414
3415 QString responseLog;
3416 responseLog.append(result ? "true" : "false");
3417 emit logResponse("isOperator("+commandLog+")", responseLog, &commandTime);
3418
3419 return result;
3420}
3421modelica_boolean OMCInterface::isEnumeration(QString cl)
3422{
3423 QTime commandTime;
3424 commandTime.start();
3425 QString commandLog;
3426 commandLog.append(cl);
3427 emit logCommand("isEnumeration("+commandLog+")", &commandTime);
3428
3429 QByteArray cl_utf8 = cl.toUtf8();
3430 modelica_boolean result;
3431
3432 try {
3433 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;
3434
3435 result = omc_OpenModelicaScriptingAPI_isEnumeration(threadData, mmc_mk_scon(cl_utf8.constData()));
3436
3437 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
3438 } catch(std::exception &exception) {
3439 emit throwException(QString("isEnumeration failed. %1").arg(exception.what()));
3440 }
3441
3442 QString responseLog;
3443 responseLog.append(result ? "true" : "false");
3444 emit logResponse("isEnumeration("+commandLog+")", responseLog, &commandTime);
3445
3446 return result;
3447}
3448modelica_boolean OMCInterface::isOptimization(QString cl)
3449{
3450 QTime commandTime;
3451 commandTime.start();
3452 QString commandLog;
3453 commandLog.append(cl);
3454 emit logCommand("isOptimization("+commandLog+")", &commandTime);
3455
3456 QByteArray cl_utf8 = cl.toUtf8();
3457 modelica_boolean result;
3458
3459 try {
3460 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;
3461
3462 result = omc_OpenModelicaScriptingAPI_isOptimization(threadData, mmc_mk_scon(cl_utf8.constData()));
3463
3464 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
3465 } catch(std::exception &exception) {
3466 emit throwException(QString("isOptimization failed. %1").arg(exception.what()));
3467 }
3468
3469 QString responseLog;
3470 responseLog.append(result ? "true" : "false");
3471 emit logResponse("isOptimization("+commandLog+")", responseLog, &commandTime);
3472
3473 return result;
3474}
3475modelica_boolean OMCInterface::isConnector(QString cl)
3476{
3477 QTime commandTime;
3478 commandTime.start();
3479 QString commandLog;
3480 commandLog.append(cl);
3481 emit logCommand("isConnector("+commandLog+")", &commandTime);
3482
3483 QByteArray cl_utf8 = cl.toUtf8();
3484 modelica_boolean result;
3485
3486 try {
3487 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;
3488
3489 result = omc_OpenModelicaScriptingAPI_isConnector(threadData, mmc_mk_scon(cl_utf8.constData()));
3490
3491 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
3492 } catch(std::exception &exception) {
3493 emit throwException(QString("isConnector failed. %1").arg(exception.what()));
3494 }
3495
3496 QString responseLog;
3497 responseLog.append(result ? "true" : "false");
3498 emit logResponse("isConnector("+commandLog+")", responseLog, &commandTime);
3499
3500 return result;
3501}
3502modelica_boolean OMCInterface::isModel(QString cl)
3503{
3504 QTime commandTime;
3505 commandTime.start();
3506 QString commandLog;
3507 commandLog.append(cl);
3508 emit logCommand("isModel("+commandLog+")", &commandTime);
3509
3510 QByteArray cl_utf8 = cl.toUtf8();
3511 modelica_boolean result;
3512
3513 try {
3514 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;
3515
3516 result = omc_OpenModelicaScriptingAPI_isModel(threadData, mmc_mk_scon(cl_utf8.constData()));
3517
3518 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
3519 } catch(std::exception &exception) {
3520 emit throwException(QString("isModel failed. %1").arg(exception.what()));
3521 }
3522
3523 QString responseLog;
3524 responseLog.append(result ? "true" : "false");
3525 emit logResponse("isModel("+commandLog+")", responseLog, &commandTime);
3526
3527 return result;
3528}
3529modelica_boolean OMCInterface::isPartial(QString cl)
3530{
3531 QTime commandTime;
3532 commandTime.start();
3533 QString commandLog;
3534 commandLog.append(cl);
3535 emit logCommand("isPartial("+commandLog+")", &commandTime);
3536
3537 QByteArray cl_utf8 = cl.toUtf8();
3538 modelica_boolean result;
3539
3540 try {
3541 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;
3542
3543 result = omc_OpenModelicaScriptingAPI_isPartial(threadData, mmc_mk_scon(cl_utf8.constData()));
3544
3545 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
3546 } catch(std::exception &exception) {
3547 emit throwException(QString("isPartial failed. %1").arg(exception.what()));
3548 }
3549
3550 QString responseLog;
3551 responseLog.append(result ? "true" : "false");
3552 emit logResponse("isPartial("+commandLog+")", responseLog, &commandTime);
3553
3554 return result;
3555}
3556modelica_boolean OMCInterface::isFunction(QString cl)
3557{
3558 QTime commandTime;
3559 commandTime.start();
3560 QString commandLog;
3561 commandLog.append(cl);
3562 emit logCommand("isFunction("+commandLog+")", &commandTime);
3563
3564 QByteArray cl_utf8 = cl.toUtf8();
3565 modelica_boolean result;
3566
3567 try {
3568 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;
3569
3570 result = omc_OpenModelicaScriptingAPI_isFunction(threadData, mmc_mk_scon(cl_utf8.constData()));
3571
3572 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
3573 } catch(std::exception &exception) {
3574 emit throwException(QString("isFunction failed. %1").arg(exception.what()));
3575 }
3576
3577 QString responseLog;
3578 responseLog.append(result ? "true" : "false");
3579 emit logResponse("isFunction("+commandLog+")", responseLog, &commandTime);
3580
3581 return result;
3582}
3583modelica_boolean OMCInterface::isBlock(QString cl)
3584{
3585 QTime commandTime;
3586 commandTime.start();
3587 QString commandLog;
3588 commandLog.append(cl);
3589 emit logCommand("isBlock("+commandLog+")", &commandTime);
3590
3591 QByteArray cl_utf8 = cl.toUtf8();
3592 modelica_boolean result;
3593
3594 try {
3595 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;
3596
3597 result = omc_OpenModelicaScriptingAPI_isBlock(threadData, mmc_mk_scon(cl_utf8.constData()));
3598
3599 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
3600 } catch(std::exception &exception) {
3601 emit throwException(QString("isBlock failed. %1").arg(exception.what()));
3602 }
3603
3604 QString responseLog;
3605 responseLog.append(result ? "true" : "false");
3606 emit logResponse("isBlock("+commandLog+")", responseLog, &commandTime);
3607
3608 return result;
3609}
3610modelica_boolean OMCInterface::isRecord(QString cl)
3611{
3612 QTime commandTime;
3613 commandTime.start();
3614 QString commandLog;
3615 commandLog.append(cl);
3616 emit logCommand("isRecord("+commandLog+")", &commandTime);
3617
3618 QByteArray cl_utf8 = cl.toUtf8();
3619 modelica_boolean result;
3620
3621 try {
3622 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;
3623
3624 result = omc_OpenModelicaScriptingAPI_isRecord(threadData, mmc_mk_scon(cl_utf8.constData()));
3625
3626 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
3627 } catch(std::exception &exception) {
3628 emit throwException(QString("isRecord failed. %1").arg(exception.what()));
3629 }
3630
3631 QString responseLog;
3632 responseLog.append(result ? "true" : "false");
3633 emit logResponse("isRecord("+commandLog+")", responseLog, &commandTime);
3634
3635 return result;
3636}
3637modelica_boolean OMCInterface::isClass(QString cl)
3638{
3639 QTime commandTime;
3640 commandTime.start();
3641 QString commandLog;
3642 commandLog.append(cl);
3643 emit logCommand("isClass("+commandLog+")", &commandTime);
3644
3645 QByteArray cl_utf8 = cl.toUtf8();
3646 modelica_boolean result;
3647
3648 try {
3649 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;
3650
3651 result = omc_OpenModelicaScriptingAPI_isClass(threadData, mmc_mk_scon(cl_utf8.constData()));
3652
3653 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
3654 } catch(std::exception &exception) {
3655 emit throwException(QString("isClass failed. %1").arg(exception.what()));
3656 }
3657
3658 QString responseLog;
3659 responseLog.append(result ? "true" : "false");
3660 emit logResponse("isClass("+commandLog+")", responseLog, &commandTime);
3661
3662 return result;
3663}
3664modelica_boolean OMCInterface::isPackage(QString cl)
3665{
3666 QTime commandTime;
3667 commandTime.start();
3668 QString commandLog;
3669 commandLog.append(cl);
3670 emit logCommand("isPackage("+commandLog+")", &commandTime);
3671
3672 QByteArray cl_utf8 = cl.toUtf8();
3673 modelica_boolean result;
3674
3675 try {
3676 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;
3677
3678 result = omc_OpenModelicaScriptingAPI_isPackage(threadData, mmc_mk_scon(cl_utf8.constData()));
3679
3680 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
3681 } catch(std::exception &exception) {
3682 emit throwException(QString("isPackage failed. %1").arg(exception.what()));
3683 }
3684
3685 QString responseLog;
3686 responseLog.append(result ? "true" : "false");
3687 emit logResponse("isPackage("+commandLog+")", responseLog, &commandTime);
3688
3689 return result;
3690}
3691modelica_boolean OMCInterface::isType(QString cl)
3692{
3693 QTime commandTime;
3694 commandTime.start();
3695 QString commandLog;
3696 commandLog.append(cl);
3697 emit logCommand("isType("+commandLog+")", &commandTime);
3698
3699 QByteArray cl_utf8 = cl.toUtf8();
3700 modelica_boolean result;
3701
3702 try {
3703 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;
3704
3705 result = omc_OpenModelicaScriptingAPI_isType(threadData, mmc_mk_scon(cl_utf8.constData()));
3706
3707 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
3708 } catch(std::exception &exception) {
3709 emit throwException(QString("isType failed. %1").arg(exception.what()));
3710 }
3711
3712 QString responseLog;
3713 responseLog.append(result ? "true" : "false");
3714 emit logResponse("isType("+commandLog+")", responseLog, &commandTime);
3715
3716 return result;
3717}
3718QString OMCInterface::getClassRestriction(QString cl)
3719{
3720 QTime commandTime;
3721 commandTime.start();
3722 QString commandLog;
3723 commandLog.append(cl);
3724 emit logCommand("getClassRestriction("+commandLog+")", &commandTime);
3725
3726 QByteArray cl_utf8 = cl.toUtf8();
3727 QString result;
3728 void *result_mm = NULL__null;
3729
3730 try {
3731 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;
3732
3733 result_mm = omc_OpenModelicaScriptingAPI_getClassRestriction(threadData, mmc_mk_scon(cl_utf8.constData()));
3734 result = QString::fromUtf8(MMC_STRINGDATA(result_mm)(((struct mmc_string*)((void*)((char*)(result_mm) - 3)))->
data)
);
3735
3736 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
3737 } catch(std::exception &exception) {
3738 emit throwException(QString("getClassRestriction failed. %1").arg(exception.what()));
3739 }
3740
3741 QString responseLog;
3742 responseLog.append("\"" + result + "\"");
3743 emit logResponse("getClassRestriction("+commandLog+")", responseLog, &commandTime);
3744
3745 return result;
3746}
3747QString OMCInterface::basename(QString path)
3748{
3749 QTime commandTime;
3750 commandTime.start();
3751 QString commandLog;
3752 commandLog.append("\"" + path + "\"");
3753 emit logCommand("basename("+commandLog+")", &commandTime);
3754
3755 QByteArray path_utf8 = path.toUtf8();
3756 QString result;
3757 void *result_mm = NULL__null;
3758
3759 try {
3760 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;
3761
3762 result_mm = omc_OpenModelicaScriptingAPI_basename(threadData, mmc_mk_scon(path_utf8.constData()));
3763 result = QString::fromUtf8(MMC_STRINGDATA(result_mm)(((struct mmc_string*)((void*)((char*)(result_mm) - 3)))->
data)
);
3764
3765 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
3766 } catch(std::exception &exception) {
3767 emit throwException(QString("basename failed. %1").arg(exception.what()));
3768 }
3769
3770 QString responseLog;
3771 responseLog.append("\"" + result + "\"");
3772 emit logResponse("basename("+commandLog+")", responseLog, &commandTime);
3773
3774 return result;
3775}
3776QString OMCInterface::dirname(QString path)
3777{
3778 QTime commandTime;
3779 commandTime.start();
3780 QString commandLog;
3781 commandLog.append("\"" + path + "\"");
3782 emit logCommand("dirname("+commandLog+")", &commandTime);
3783
3784 QByteArray path_utf8 = path.toUtf8();
3785 QString result;
3786 void *result_mm = NULL__null;
3787
3788 try {
3789 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;
3790
3791 result_mm = omc_OpenModelicaScriptingAPI_dirname(threadData, mmc_mk_scon(path_utf8.constData()));
3792 result = QString::fromUtf8(MMC_STRINGDATA(result_mm)(((struct mmc_string*)((void*)((char*)(result_mm) - 3)))->
data)
);
3793
3794 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
3795 } catch(std::exception &exception) {
3796 emit throwException(QString("dirname failed. %1").arg(exception.what()));
3797 }
3798
3799 QString responseLog;
3800 responseLog.append("\"" + result + "\"");
3801 emit logResponse("dirname("+commandLog+")", responseLog, &commandTime);
3802
3803 return result;
3804}
3805QString OMCInterface::getClassComment(QString cl)
3806{
3807 QTime commandTime;
3808 commandTime.start();
3809 QString commandLog;
3810 commandLog.append(cl);
3811 emit logCommand("getClassComment("+commandLog+")", &commandTime);
3812
3813 QByteArray cl_utf8 = cl.toUtf8();
3814 QString result;
3815 void *result_mm = NULL__null;
3816
3817 try {
3818 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;
3819
3820 result_mm = omc_OpenModelicaScriptingAPI_getClassComment(threadData, mmc_mk_scon(cl_utf8.constData()));
3821 result = QString::fromUtf8(MMC_STRINGDATA(result_mm)(((struct mmc_string*)((void*)((char*)(result_mm) - 3)))->
data)
);
3822
3823 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
3824 } catch(std::exception &exception) {
3825 emit throwException(QString("getClassComment failed. %1").arg(exception.what()));
3826 }
3827
3828 QString responseLog;
3829 responseLog.append("\"" + result + "\"");
3830 emit logResponse("getClassComment("+commandLog+")", responseLog, &commandTime);
3831
3832 return result;
3833}
3834QList<QString > OMCInterface::typeNameStrings(QString cl)
3835{
3836 QTime commandTime;
3837 commandTime.start();
3838 QString commandLog;
3839 commandLog.append(cl);
3840 emit logCommand("typeNameStrings("+commandLog+")", &commandTime);
3841
3842 QByteArray cl_utf8 = cl.toUtf8();
3843 QList<QString > result;
3844 void *result_mm = NULL__null;
3845
3846 try {
3847 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;
3848
3849 result_mm = omc_OpenModelicaScriptingAPI_typeNameStrings(threadData, mmc_mk_scon(cl_utf8.constData()));
3850 result.clear();
3851 while (!listEmpty(result_mm)((*(mmc_uint_t*)((void*)((char*)(result_mm) - 3))) == (((0) <<
10) + (((0) & 255) << 2)))
) {
3852 QString result_elt;
3853 result_elt = MMC_STRINGDATA(MMC_CAR(result_mm))(((struct mmc_string*)((void*)((char*)((*(void**)(((void*)((void
**)(((void*)((char*)(result_mm) - 3))) + (1)))))) - 3)))->
data)
;
3854 result.push_back(result_elt);
3855 result_mm = MMC_CDR(result_mm)(*(void**)(((void*)((void**)(((void*)((char*)(result_mm) - 3)
)) + (2)))))
;
3856 }
3857
3858 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
3859 } catch(std::exception &exception) {
3860 emit throwException(QString("typeNameStrings failed. %1").arg(exception.what()));
3861 }
3862
3863 QString responseLog;
3864 responseLog.append("{");
3865 int result_i = 0;
3866 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)
{
3867 if (result_i) {
3868 responseLog.append(",");
3869 }
3870 responseLog.append("\"" + result_elt + "\"");
3871 result_i++;
3872 }
3873 responseLog.append("}");
3874 emit logResponse("typeNameStrings("+commandLog+")", responseLog, &commandTime);
3875
3876 return result;
3877}
3878QString OMCInterface::typeNameString(QString cl)
3879{
3880 QTime commandTime;
3881 commandTime.start();
3882 QString commandLog;
3883 commandLog.append(cl);
3884 emit logCommand("typeNameString("+commandLog+")", &commandTime);
3885
3886 QByteArray cl_utf8 = cl.toUtf8();
3887 QString result;
3888 void *result_mm = NULL__null;
3889
3890 try {
3891 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;
3892
3893 result_mm = omc_OpenModelicaScriptingAPI_typeNameString(threadData, mmc_mk_scon(cl_utf8.constData()));
3894 result = QString::fromUtf8(MMC_STRINGDATA(result_mm)(((struct mmc_string*)((void*)((char*)(result_mm) - 3)))->
data)
);
3895
3896 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
3897 } catch(std::exception &exception) {
3898 emit throwException(QString("typeNameString failed. %1").arg(exception.what()));
3899 }
3900
3901 QString responseLog;
3902 responseLog.append("\"" + result + "\"");
3903 emit logResponse("typeNameString("+commandLog+")", responseLog, &commandTime);
3904
3905 return result;
3906}
3907QString OMCInterface::stringTypeName(QString str)
3908{
3909 QTime commandTime;
3910 commandTime.start();
3911 QString commandLog;
3912 commandLog.append("\"" + str + "\"");
3913 emit logCommand("stringTypeName("+commandLog+")", &commandTime);
3914
3915 QByteArray str_utf8 = str.toUtf8();
3916 QString result;
3917 void *result_mm = NULL__null;
3918
3919 try {
3920 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;
3921
3922 result_mm = omc_OpenModelicaScriptingAPI_stringTypeName(threadData, mmc_mk_scon(str_utf8.constData()));
3923 result = QString::fromUtf8(MMC_STRINGDATA(result_mm)(((struct mmc_string*)((void*)((char*)(result_mm) - 3)))->
data)
);
3924
3925 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
3926 } catch(std::exception &exception) {
3927 emit throwException(QString("stringTypeName failed. %1").arg(exception.what()));
3928 }
3929
3930 QString responseLog;
3931 responseLog.append(result);
3932 emit logResponse("stringTypeName("+commandLog+")", responseLog, &commandTime);
3933
3934 return result;
3935}
3936OMCInterface::getTimeStamp_res OMCInterface::getTimeStamp(QString cl)
3937{
3938 QTime commandTime;
3939 commandTime.start();
3940 QString commandLog;
3941 commandLog.append(cl);
3942 emit logCommand("getTimeStamp("+commandLog+")", &commandTime);
3943
3944 QByteArray cl_utf8 = cl.toUtf8();
3945 getTimeStamp_res result;
3946 void *out2_mm = NULL__null;
3947
3948 try {
3949 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;
3950
3951 result.timeStamp = omc_OpenModelicaScriptingAPI_getTimeStamp(threadData, mmc_mk_scon(cl_utf8.constData()), &out2_mm);
3952 result.timeStampAsString = QString::fromUtf8(MMC_STRINGDATA(out2_mm)(((struct mmc_string*)((void*)((char*)(out2_mm) - 3)))->data
)
);
3953
3954 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
3955 } catch(std::exception &exception) {
3956 emit throwException(QString("getTimeStamp failed. %1").arg(exception.what()));
3957 }
3958
3959 QString responseLog;
3960 responseLog.append(result.toString());
3961 emit logResponse("getTimeStamp("+commandLog+")", responseLog, &commandTime);
3962
3963 return result;
3964}
3965modelica_boolean OMCInterface::setDocumentationAnnotation(QString class_, QString info, QString revisions)
3966{
3967 QTime commandTime;
3968 commandTime.start();
3969 QString commandLog;
3970 commandLog.append(class_);
3971 commandLog.append(",");
3972 commandLog.append("\"" + info + "\"");
3973 commandLog.append(",");
3974 commandLog.append("\"" + revisions + "\"");
3975 emit logCommand("setDocumentationAnnotation("+commandLog+")", &commandTime);
3976
3977 QByteArray class__utf8 = class_.toUtf8();
3978 QByteArray info_utf8 = info.toUtf8();
3979 QByteArray revisions_utf8 = revisions.toUtf8();
3980 modelica_boolean result;
3981
3982 try {
3983 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;
3984
3985 result = omc_OpenModelicaScriptingAPI_setDocumentationAnnotation(threadData, mmc_mk_scon(class__utf8.constData()), mmc_mk_scon(info_utf8.constData()), mmc_mk_scon(revisions_utf8.constData()));
3986
3987 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
3988 } catch(std::exception &exception) {
3989 emit throwException(QString("setDocumentationAnnotation failed. %1").arg(exception.what()));
3990 }
3991
3992 QString responseLog;
3993 responseLog.append(result ? "true" : "false");
3994 emit logResponse("setDocumentationAnnotation("+commandLog+")", responseLog, &commandTime);
3995
3996 return result;
3997}
3998QList<QString > OMCInterface::getDocumentationAnnotation(QString cl)
3999{
4000 QTime commandTime;
4001 commandTime.start();
4002 QString commandLog;
4003 commandLog.append(cl);
4004 emit logCommand("getDocumentationAnnotation("+commandLog+")", &commandTime);
4005
4006 QByteArray cl_utf8 = cl.toUtf8();
4007 QList<QString > result;
4008 void *result_mm = NULL__null;
4009
4010 try {
4011 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;
4012
4013 result_mm = omc_OpenModelicaScriptingAPI_getDocumentationAnnotation(threadData, mmc_mk_scon(cl_utf8.constData()));
4014 result.clear();
4015 while (!listEmpty(result_mm)((*(mmc_uint_t*)((void*)((char*)(result_mm) - 3))) == (((0) <<
10) + (((0) & 255) << 2)))
) {
4016 QString result_elt;
4017 result_elt = MMC_STRINGDATA(MMC_CAR(result_mm))(((struct mmc_string*)((void*)((char*)((*(void**)(((void*)((void
**)(((void*)((char*)(result_mm) - 3))) + (1)))))) - 3)))->
data)
;
4018 result.push_back(result_elt);
4019 result_mm = MMC_CDR(result_mm)(*(void**)(((void*)((void**)(((void*)((char*)(result_mm) - 3)
)) + (2)))))
;
4020 }
4021
4022 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
4023 } catch(std::exception &exception) {
4024 emit throwException(QString("getDocumentationAnnotation failed. %1").arg(exception.what()));
4025 }
4026
4027 QString responseLog;
4028 responseLog.append("{");
4029 int result_i = 0;
4030 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)
{
4031 if (result_i) {
4032 responseLog.append(",");
4033 }
4034 responseLog.append("\"" + result_elt + "\"");
4035 result_i++;
4036 }
4037 responseLog.append("}");
4038 emit logResponse("getDocumentationAnnotation("+commandLog+")", responseLog, &commandTime);
4039
4040 return result;
4041}
4042QString OMCInterface::iconv(QString string, QString from, QString to)
4043{
4044 QTime commandTime;
4045 commandTime.start();
4046 QString commandLog;
4047 commandLog.append("\"" + string + "\"");
4048 commandLog.append(",");
4049 commandLog.append("\"" + from + "\"");
4050 commandLog.append(",");
4051 commandLog.append("\"" + to + "\"");
4052 emit logCommand("iconv("+commandLog+")", &commandTime);
4053
4054 QByteArray string_utf8 = string.toUtf8();
4055 QByteArray from_utf8 = from.toUtf8();
4056 QByteArray to_utf8 = to.toUtf8();
4057 QString result;
4058 void *result_mm = NULL__null;
4059
4060 try {
4061 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;
4062
4063 result_mm = omc_OpenModelicaScriptingAPI_iconv(threadData, mmc_mk_scon(string_utf8.constData()), mmc_mk_scon(from_utf8.constData()), mmc_mk_scon(to_utf8.constData()));
4064 result = QString::fromUtf8(MMC_STRINGDATA(result_mm)(((struct mmc_string*)((void*)((char*)(result_mm) - 3)))->
data)
);
4065
4066 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
4067 } catch(std::exception &exception) {
4068 emit throwException(QString("iconv failed. %1").arg(exception.what()));
4069 }
4070
4071 QString responseLog;
4072 responseLog.append("\"" + result + "\"");
4073 emit logResponse("iconv("+commandLog+")", responseLog, &commandTime);
4074
4075 return result;
4076}
4077QList<QString > OMCInterface::getNthImport(QString class_, modelica_integer index)
4078{
4079 QTime commandTime;
4080 commandTime.start();
4081 QString commandLog;
4082 commandLog.append(class_);
4083 commandLog.append(",");
4084 commandLog.append(QString::number(index));
4085 emit logCommand("getNthImport("+commandLog+")", &commandTime);
4086
4087 QByteArray class__utf8 = class_.toUtf8();
4088 QList<QString > result;
4089 void *result_mm = NULL__null;
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_mm = omc_OpenModelicaScriptingAPI_getNthImport(threadData, mmc_mk_scon(class__utf8.constData()), index);
4095 result.clear();
4096 while (!listEmpty(result_mm)((*(mmc_uint_t*)((void*)((char*)(result_mm) - 3))) == (((0) <<
10) + (((0) & 255) << 2)))
) {
4097 QString result_elt;
4098 result_elt = MMC_STRINGDATA(MMC_CAR(result_mm))(((struct mmc_string*)((void*)((char*)((*(void**)(((void*)((void
**)(((void*)((char*)(result_mm) - 3))) + (1)))))) - 3)))->
data)
;
4099 result.push_back(result_elt);
4100 result_mm = MMC_CDR(result_mm)(*(void**)(((void*)((void**)(((void*)((char*)(result_mm) - 3)
)) + (2)))))
;
4101 }
4102
4103 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
4104 } catch(std::exception &exception) {
4105 emit throwException(QString("getNthImport failed. %1").arg(exception.what()));
4106 }
4107
4108 QString responseLog;
4109 responseLog.append("{");
4110 int result_i = 0;
4111 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)
{
4112 if (result_i) {
4113 responseLog.append(",");
4114 }
4115 responseLog.append("\"" + result_elt + "\"");
4116 result_i++;
4117 }
4118 responseLog.append("}");
4119 emit logResponse("getNthImport("+commandLog+")", responseLog, &commandTime);
4120
4121 return result;
4122}
4123modelica_integer OMCInterface::getImportCount(QString class_)
4124{
4125 QTime commandTime;
4126 commandTime.start();
4127 QString commandLog;
4128 commandLog.append(class_);
4129 emit logCommand("getImportCount("+commandLog+")", &commandTime);
4130
4131 QByteArray class__utf8 = class_.toUtf8();
4132 modelica_integer result;
4133
4134 try {
4135 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;
4136
4137 result = omc_OpenModelicaScriptingAPI_getImportCount(threadData, mmc_mk_scon(class__utf8.constData()));
4138
4139 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
4140 } catch(std::exception &exception) {
4141 emit throwException(QString("getImportCount failed. %1").arg(exception.what()));
4142 }
4143
4144 QString responseLog;
4145 responseLog.append(QString::number(result));
4146 emit logResponse("getImportCount("+commandLog+")", responseLog, &commandTime);
4147
4148 return result;
4149}
4150QString OMCInterface::getNthAnnotationString(QString class_, modelica_integer index)
4151{
4152 QTime commandTime;
4153 commandTime.start();
4154 QString commandLog;
4155 commandLog.append(class_);
4156 commandLog.append(",");
4157 commandLog.append(QString::number(index));
4158 emit logCommand("getNthAnnotationString("+commandLog+")", &commandTime);
4159
4160 QByteArray class__utf8 = class_.toUtf8();
4161 QString result;
4162 void *result_mm = NULL__null;
4163
4164 try {
4165 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;
4166
4167 result_mm = omc_OpenModelicaScriptingAPI_getNthAnnotationString(threadData, mmc_mk_scon(class__utf8.constData()), index);
4168 result = QString::fromUtf8(MMC_STRINGDATA(result_mm)(((struct mmc_string*)((void*)((char*)(result_mm) - 3)))->
data)
);
4169
4170 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
4171 } catch(std::exception &exception) {
4172 emit throwException(QString("getNthAnnotationString failed. %1").arg(exception.what()));
4173 }
4174
4175 QString responseLog;
4176 responseLog.append("\"" + result + "\"");
4177 emit logResponse("getNthAnnotationString("+commandLog+")", responseLog, &commandTime);
4178
4179 return result;
4180}
4181modelica_integer OMCInterface::getAnnotationCount(QString class_)
4182{
4183 QTime commandTime;
4184 commandTime.start();
4185 QString commandLog;
4186 commandLog.append(class_);
4187 emit logCommand("getAnnotationCount("+commandLog+")", &commandTime);
4188
4189 QByteArray class__utf8 = class_.toUtf8();
4190 modelica_integer result;
4191
4192 try {
4193 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;
4194
4195 result = omc_OpenModelicaScriptingAPI_getAnnotationCount(threadData, mmc_mk_scon(class__utf8.constData()));
4196
4197 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
4198 } catch(std::exception &exception) {
4199 emit throwException(QString("getAnnotationCount failed. %1").arg(exception.what()));
4200 }
4201
4202 QString responseLog;
4203 responseLog.append(QString::number(result));
4204 emit logResponse("getAnnotationCount("+commandLog+")", responseLog, &commandTime);
4205
4206 return result;
4207}
4208QString OMCInterface::getNthInitialEquationItem(QString class_, modelica_integer index)
4209{
4210 QTime commandTime;
4211 commandTime.start();
4212 QString commandLog;
4213 commandLog.append(class_);
4214 commandLog.append(",");
4215 commandLog.append(QString::number(index));
4216 emit logCommand("getNthInitialEquationItem("+commandLog+")", &commandTime);
4217
4218 QByteArray class__utf8 = class_.toUtf8();
4219 QString result;
4220 void *result_mm = NULL__null;
4221
4222 try {
4223 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;
4224
4225 result_mm = omc_OpenModelicaScriptingAPI_getNthInitialEquationItem(threadData, mmc_mk_scon(class__utf8.constData()), index);
4226 result = QString::fromUtf8(MMC_STRINGDATA(result_mm)(((struct mmc_string*)((void*)((char*)(result_mm) - 3)))->
data)
);
4227
4228 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
4229 } catch(std::exception &exception) {
4230 emit throwException(QString("getNthInitialEquationItem failed. %1").arg(exception.what()));
4231 }
4232
4233 QString responseLog;
4234 responseLog.append("\"" + result + "\"");
4235 emit logResponse("getNthInitialEquationItem("+commandLog+")", responseLog, &commandTime);
4236
4237 return result;
4238}
4239modelica_integer OMCInterface::getInitialEquationItemsCount(QString class_)
4240{
4241 QTime commandTime;
4242 commandTime.start();
4243 QString commandLog;
4244 commandLog.append(class_);
4245 emit logCommand("getInitialEquationItemsCount("+commandLog+")", &commandTime);
4246
4247 QByteArray class__utf8 = class_.toUtf8();
4248 modelica_integer result;
4249
4250 try {
4251 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;
4252
4253 result = omc_OpenModelicaScriptingAPI_getInitialEquationItemsCount(threadData, mmc_mk_scon(class__utf8.constData()));
4254
4255 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
4256 } catch(std::exception &exception) {
4257 emit throwException(QString("getInitialEquationItemsCount failed. %1").arg(exception.what()));
4258 }
4259
4260 QString responseLog;
4261 responseLog.append(QString::number(result));
4262 emit logResponse("getInitialEquationItemsCount("+commandLog+")", responseLog, &commandTime);
4263
4264 return result;
4265}
4266QString OMCInterface::getNthEquationItem(QString class_, modelica_integer index)
4267{
4268 QTime commandTime;
4269 commandTime.start();
4270 QString commandLog;
4271 commandLog.append(class_);
4272 commandLog.append(",");
4273 commandLog.append(QString::number(index));
4274 emit logCommand("getNthEquationItem("+commandLog+")", &commandTime);
4275
4276 QByteArray class__utf8 = class_.toUtf8();
4277 QString result;
4278 void *result_mm = NULL__null;
4279
4280 try {
4281 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;
4282
4283 result_mm = omc_OpenModelicaScriptingAPI_getNthEquationItem(threadData, mmc_mk_scon(class__utf8.constData()), index);
4284 result = QString::fromUtf8(MMC_STRINGDATA(result_mm)(((struct mmc_string*)((void*)((char*)(result_mm) - 3)))->
data)
);
4285
4286 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
4287 } catch(std::exception &exception) {
4288 emit throwException(QString("getNthEquationItem failed. %1").arg(exception.what()));
4289 }
4290
4291 QString responseLog;
4292 responseLog.append("\"" + result + "\"");
4293 emit logResponse("getNthEquationItem("+commandLog+")", responseLog, &commandTime);
4294
4295 return result;
4296}
4297modelica_integer OMCInterface::getEquationItemsCount(QString class_)
4298{
4299 QTime commandTime;
4300 commandTime.start();
4301 QString commandLog;
4302 commandLog.append(class_);
4303 emit logCommand("getEquationItemsCount("+commandLog+")", &commandTime);
4304
4305 QByteArray class__utf8 = class_.toUtf8();
4306 modelica_integer result;
4307
4308 try {
4309 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;
4310
4311 result = omc_OpenModelicaScriptingAPI_getEquationItemsCount(threadData, mmc_mk_scon(class__utf8.constData()));
4312
4313 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
4314 } catch(std::exception &exception) {
4315 emit throwException(QString("getEquationItemsCount failed. %1").arg(exception.what()));
4316 }
4317
4318 QString responseLog;
4319 responseLog.append(QString::number(result));
4320 emit logResponse("getEquationItemsCount("+commandLog+")", responseLog, &commandTime);
4321
4322 return result;
4323}
4324QString OMCInterface::getNthInitialEquation(QString class_, modelica_integer index)
4325{
4326 QTime commandTime;
4327 commandTime.start();
4328 QString commandLog;
4329 commandLog.append(class_);
4330 commandLog.append(",");
4331 commandLog.append(QString::number(index));
4332 emit logCommand("getNthInitialEquation("+commandLog+")", &commandTime);
4333
4334 QByteArray class__utf8 = class_.toUtf8();
4335 QString result;
4336 void *result_mm = NULL__null;
4337
4338 try {
4339 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;
4340
4341 result_mm = omc_OpenModelicaScriptingAPI_getNthInitialEquation(threadData, mmc_mk_scon(class__utf8.constData()), index);
4342 result = QString::fromUtf8(MMC_STRINGDATA(result_mm)(((struct mmc_string*)((void*)((char*)(result_mm) - 3)))->
data)
);
4343
4344 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
4345 } catch(std::exception &exception) {
4346 emit throwException(QString("getNthInitialEquation failed. %1").arg(exception.what()));
4347 }
4348
4349 QString responseLog;
4350 responseLog.append("\"" + result + "\"");
4351 emit logResponse("getNthInitialEquation("+commandLog+")", responseLog, &commandTime);
4352
4353 return result;
4354}
4355modelica_integer OMCInterface::getInitialEquationCount(QString class_)
4356{
4357 QTime commandTime;
4358 commandTime.start();
4359 QString commandLog;
4360 commandLog.append(class_);
4361 emit logCommand("getInitialEquationCount("+commandLog+")", &commandTime);
4362
4363 QByteArray class__utf8 = class_.toUtf8();
4364 modelica_integer result;
4365
4366 try {
4367 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;
4368
4369 result = omc_OpenModelicaScriptingAPI_getInitialEquationCount(threadData, mmc_mk_scon(class__utf8.constData()));
4370
4371 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
4372 } catch(std::exception &exception) {
4373 emit throwException(QString("getInitialEquationCount failed. %1").arg(exception.what()));
4374 }
4375
4376 QString responseLog;
4377 responseLog.append(QString::number(result));
4378 emit logResponse("getInitialEquationCount("+commandLog+")", responseLog, &commandTime);
4379
4380 return result;
4381}
4382QString OMCInterface::getNthEquation(QString class_, modelica_integer index)
4383{
4384 QTime commandTime;
4385 commandTime.start();
4386 QString commandLog;
4387 commandLog.append(class_);
4388 commandLog.append(",");
4389 commandLog.append(QString::number(index));
4390 emit logCommand("getNthEquation("+commandLog+")", &commandTime);
4391
4392 QByteArray class__utf8 = class_.toUtf8();
4393 QString result;
4394 void *result_mm = NULL__null;
4395
4396 try {
4397 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;
4398
4399 result_mm = omc_OpenModelicaScriptingAPI_getNthEquation(threadData, mmc_mk_scon(class__utf8.constData()), index);
4400 result = QString::fromUtf8(MMC_STRINGDATA(result_mm)(((struct mmc_string*)((void*)((char*)(result_mm) - 3)))->
data)
);
4401
4402 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
4403 } catch(std::exception &exception) {
4404 emit throwException(QString("getNthEquation failed. %1").arg(exception.what()));
4405 }
4406
4407 QString responseLog;
4408 responseLog.append("\"" + result + "\"");
4409 emit logResponse("getNthEquation("+commandLog+")", responseLog, &commandTime);
4410
4411 return result;
4412}
4413modelica_integer OMCInterface::getEquationCount(QString class_)
4414{
4415 QTime commandTime;
4416 commandTime.start();
4417 QString commandLog;
4418 commandLog.append(class_);
4419 emit logCommand("getEquationCount("+commandLog+")", &commandTime);
4420
4421 QByteArray class__utf8 = class_.toUtf8();
4422 modelica_integer result;
4423
4424 try {
4425 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;
4426
4427 result = omc_OpenModelicaScriptingAPI_getEquationCount(threadData, mmc_mk_scon(class__utf8.constData()));
4428
4429 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
4430 } catch(std::exception &exception) {
4431 emit throwException(QString("getEquationCount failed. %1").arg(exception.what()));
4432 }
4433
4434 QString responseLog;
4435 responseLog.append(QString::number(result));
4436 emit logResponse("getEquationCount("+commandLog+")", responseLog, &commandTime);
4437
4438 return result;
4439}
4440QString OMCInterface::getNthInitialAlgorithmItem(QString class_, modelica_integer index)
4441{
4442 QTime commandTime;
4443 commandTime.start();
4444 QString commandLog;
4445 commandLog.append(class_);
4446 commandLog.append(",");
4447 commandLog.append(QString::number(index));
4448 emit logCommand("getNthInitialAlgorithmItem("+commandLog+")", &commandTime);
4449
4450 QByteArray class__utf8 = class_.toUtf8();
4451 QString result;
4452 void *result_mm = NULL__null;
4453
4454 try {
4455 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;
4456
4457 result_mm = omc_OpenModelicaScriptingAPI_getNthInitialAlgorithmItem(threadData, mmc_mk_scon(class__utf8.constData()), index);
4458 result = QString::fromUtf8(MMC_STRINGDATA(result_mm)(((struct mmc_string*)((void*)((char*)(result_mm) - 3)))->
data)
);
4459
4460 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
4461 } catch(std::exception &exception) {
4462 emit throwException(QString("getNthInitialAlgorithmItem failed. %1").arg(exception.what()));
4463 }
4464
4465 QString responseLog;
4466 responseLog.append("\"" + result + "\"");
4467 emit logResponse("getNthInitialAlgorithmItem("+commandLog+")", responseLog, &commandTime);
4468
4469 return result;
4470}
4471modelica_integer OMCInterface::getInitialAlgorithmItemsCount(QString class_)
4472{
4473 QTime commandTime;
4474 commandTime.start();
4475 QString commandLog;
4476 commandLog.append(class_);
4477 emit logCommand("getInitialAlgorithmItemsCount("+commandLog+")", &commandTime);
4478
4479 QByteArray class__utf8 = class_.toUtf8();
4480 modelica_integer result;
4481
4482 try {
4483 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;
4484
4485 result = omc_OpenModelicaScriptingAPI_getInitialAlgorithmItemsCount(threadData, mmc_mk_scon(class__utf8.constData()));
4486
4487 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
4488 } catch(std::exception &exception) {
4489 emit throwException(QString("getInitialAlgorithmItemsCount failed. %1").arg(exception.what()));
4490 }
4491
4492 QString responseLog;
4493 responseLog.append(QString::number(result));
4494 emit logResponse("getInitialAlgorithmItemsCount("+commandLog+")", responseLog, &commandTime);
4495
4496 return result;
4497}
4498QString OMCInterface::getNthAlgorithmItem(QString class_, modelica_integer index)
4499{
4500 QTime commandTime;
4501 commandTime.start();
4502 QString commandLog;
4503 commandLog.append(class_);
4504 commandLog.append(",");
4505 commandLog.append(QString::number(index));
4506 emit logCommand("getNthAlgorithmItem("+commandLog+")", &commandTime);
4507
4508 QByteArray class__utf8 = class_.toUtf8();
4509 QString result;
4510 void *result_mm = NULL__null;
4511
4512 try {
4513 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;
4514
4515 result_mm = omc_OpenModelicaScriptingAPI_getNthAlgorithmItem(threadData, mmc_mk_scon(class__utf8.constData()), index);
4516 result = QString::fromUtf8(MMC_STRINGDATA(result_mm)(((struct mmc_string*)((void*)((char*)(result_mm) - 3)))->
data)
);
4517
4518 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
4519 } catch(std::exception &exception) {
4520 emit throwException(QString("getNthAlgorithmItem failed. %1").arg(exception.what()));
4521 }
4522
4523 QString responseLog;
4524 responseLog.append("\"" + result + "\"");
4525 emit logResponse("getNthAlgorithmItem("+commandLog+")", responseLog, &commandTime);
4526
4527 return result;
4528}
4529modelica_integer OMCInterface::getAlgorithmItemsCount(QString class_)
4530{
4531 QTime commandTime;
4532 commandTime.start();
4533 QString commandLog;
4534 commandLog.append(class_);
4535 emit logCommand("getAlgorithmItemsCount("+commandLog+")", &commandTime);
4536
4537 QByteArray class__utf8 = class_.toUtf8();
4538 modelica_integer result;
4539
4540 try {
4541 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;
4542
4543 result = omc_OpenModelicaScriptingAPI_getAlgorithmItemsCount(threadData, mmc_mk_scon(class__utf8.constData()));
4544
4545 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
4546 } catch(std::exception &exception) {
4547 emit throwException(QString("getAlgorithmItemsCount failed. %1").arg(exception.what()));
4548 }
4549
4550 QString responseLog;
4551 responseLog.append(QString::number(result));
4552 emit logResponse("getAlgorithmItemsCount("+commandLog+")", responseLog, &commandTime);
4553
4554 return result;
4555}
4556QString OMCInterface::getNthInitialAlgorithm(QString class_, modelica_integer index)
4557{
4558 QTime commandTime;
4559 commandTime.start();
4560 QString commandLog;
4561 commandLog.append(class_);
4562 commandLog.append(",");
4563 commandLog.append(QString::number(index));
4564 emit logCommand("getNthInitialAlgorithm("+commandLog+")", &commandTime);
4565
4566 QByteArray class__utf8 = class_.toUtf8();
4567 QString result;
4568 void *result_mm = NULL__null;
4569
4570 try {
4571 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;
4572
4573 result_mm = omc_OpenModelicaScriptingAPI_getNthInitialAlgorithm(threadData, mmc_mk_scon(class__utf8.constData()), index);
4574 result = QString::fromUtf8(MMC_STRINGDATA(result_mm)(((struct mmc_string*)((void*)((char*)(result_mm) - 3)))->
data)
);
4575
4576 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
4577 } catch(std::exception &exception) {
4578 emit throwException(QString("getNthInitialAlgorithm failed. %1").arg(exception.what()));
4579 }
4580
4581 QString responseLog;
4582 responseLog.append("\"" + result + "\"");
4583 emit logResponse("getNthInitialAlgorithm("+commandLog+")", responseLog, &commandTime);
4584
4585 return result;
4586}
4587modelica_integer OMCInterface::getInitialAlgorithmCount(QString class_)
4588{
4589 QTime commandTime;
4590 commandTime.start();
4591 QString commandLog;
4592 commandLog.append(class_);
4593 emit logCommand("getInitialAlgorithmCount("+commandLog+")", &commandTime);
4594
4595 QByteArray class__utf8 = class_.toUtf8();
4596 modelica_integer result;
4597
4598 try {
4599 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;
4600
4601 result = omc_OpenModelicaScriptingAPI_getInitialAlgorithmCount(threadData, mmc_mk_scon(class__utf8.constData()));
4602
4603 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
4604 } catch(std::exception &exception) {
4605 emit throwException(QString("getInitialAlgorithmCount failed. %1").arg(exception.what()));
4606 }
4607
4608 QString responseLog;
4609 responseLog.append(QString::number(result));
4610 emit logResponse("getInitialAlgorithmCount("+commandLog+")", responseLog, &commandTime);
4611
4612 return result;
4613}
4614QString OMCInterface::getNthAlgorithm(QString class_, modelica_integer index)
4615{
4616 QTime commandTime;
4617 commandTime.start();
4618 QString commandLog;
4619 commandLog.append(class_);
4620 commandLog.append(",");
4621 commandLog.append(QString::number(index));
4622 emit logCommand("getNthAlgorithm("+commandLog+")", &commandTime);
4623
4624 QByteArray class__utf8 = class_.toUtf8();
4625 QString result;
4626 void *result_mm = NULL__null;
4627
4628 try {
4629 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;
4630
4631 result_mm = omc_OpenModelicaScriptingAPI_getNthAlgorithm(threadData, mmc_mk_scon(class__utf8.constData()), index);
4632 result = QString::fromUtf8(MMC_STRINGDATA(result_mm)(((struct mmc_string*)((void*)((char*)(result_mm) - 3)))->
data)
);
4633
4634 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
4635 } catch(std::exception &exception) {
4636 emit throwException(QString("getNthAlgorithm failed. %1").arg(exception.what()));
4637 }
4638
4639 QString responseLog;
4640 responseLog.append("\"" + result + "\"");
4641 emit logResponse("getNthAlgorithm("+commandLog+")", responseLog, &commandTime);
4642
4643 return result;
4644}
4645modelica_integer OMCInterface::getAlgorithmCount(QString class_)
4646{
4647 QTime commandTime;
4648 commandTime.start();
4649 QString commandLog;
4650 commandLog.append(class_);
4651 emit logCommand("getAlgorithmCount("+commandLog+")", &commandTime);
4652
4653 QByteArray class__utf8 = class_.toUtf8();
4654 modelica_integer result;
4655
4656 try {
4657 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;
4658
4659 result = omc_OpenModelicaScriptingAPI_getAlgorithmCount(threadData, mmc_mk_scon(class__utf8.constData()));
4660
4661 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
4662 } catch(std::exception &exception) {
4663 emit throwException(QString("getAlgorithmCount failed. %1").arg(exception.what()));
4664 }
4665
4666 QString responseLog;
4667 responseLog.append(QString::number(result));
4668 emit logResponse("getAlgorithmCount("+commandLog+")", responseLog, &commandTime);
4669
4670 return result;
4671}
4672QList<QString > OMCInterface::getNthConnection(QString className, modelica_integer index)
4673{
4674 QTime commandTime;
4675 commandTime.start();
4676 QString commandLog;
4677 commandLog.append(className);
4678 commandLog.append(",");
4679 commandLog.append(QString::number(index));
4680 emit logCommand("getNthConnection("+commandLog+")", &commandTime);
4681
4682 QByteArray className_utf8 = className.toUtf8();
4683 QList<QString > result;
4684 void *result_mm = NULL__null;
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_mm = omc_OpenModelicaScriptingAPI_getNthConnection(threadData, mmc_mk_scon(className_utf8.constData()), index);
4690 result.clear();
4691 while (!listEmpty(result_mm)((*(mmc_uint_t*)((void*)((char*)(result_mm) - 3))) == (((0) <<
10) + (((0) & 255) << 2)))
) {
4692 QString result_elt;
4693 result_elt = MMC_STRINGDATA(MMC_CAR(result_mm))(((struct mmc_string*)((void*)((char*)((*(void**)(((void*)((void
**)(((void*)((char*)(result_mm) - 3))) + (1)))))) - 3)))->
data)
;
4694 result.push_back(result_elt);
4695 result_mm = MMC_CDR(result_mm)(*(void**)(((void*)((void**)(((void*)((char*)(result_mm) - 3)
)) + (2)))))
;
4696 }
4697
4698 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
4699 } catch(std::exception &exception) {
4700 emit throwException(QString("getNthConnection failed. %1").arg(exception.what()));
4701 }
4702
4703 QString responseLog;
4704 responseLog.append("{");
4705 int result_i = 0;
4706 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)
{
4707 if (result_i) {
4708 responseLog.append(",");
4709 }
4710 responseLog.append("\"" + result_elt + "\"");
4711 result_i++;
4712 }
4713 responseLog.append("}");
4714 emit logResponse("getNthConnection("+commandLog+")", responseLog, &commandTime);
4715
4716 return result;
4717}
4718modelica_integer OMCInterface::getConnectionCount(QString className)
4719{
4720 QTime commandTime;
4721 commandTime.start();
4722 QString commandLog;
4723 commandLog.append(className);
4724 emit logCommand("getConnectionCount("+commandLog+")", &commandTime);
4725
4726 QByteArray className_utf8 = className.toUtf8();
4727 modelica_integer result;
4728
4729 try {
4730 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;
4731
4732 result = omc_OpenModelicaScriptingAPI_getConnectionCount(threadData, mmc_mk_scon(className_utf8.constData()));
4733
4734 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
4735 } catch(std::exception &exception) {
4736 emit throwException(QString("getConnectionCount failed. %1").arg(exception.what()));
4737 }
4738
4739 QString responseLog;
4740 responseLog.append(QString::number(result));
4741 emit logResponse("getConnectionCount("+commandLog+")", responseLog, &commandTime);
4742
4743 return result;
4744}
4745modelica_boolean OMCInterface::updateConnectionNames(QString className, QString from, QString to, QString fromNew, QString toNew)
4746{
4747 QTime commandTime;
4748 commandTime.start();
4749 QString commandLog;
4750 commandLog.append(className);
4751 commandLog.append(",");
4752 commandLog.append("\"" + from + "\"");
4753 commandLog.append(",");
4754 commandLog.append("\"" + to + "\"");
4755 commandLog.append(",");
4756 commandLog.append("\"" + fromNew + "\"");
4757 commandLog.append(",");
4758 commandLog.append("\"" + toNew + "\"");
4759 emit logCommand("updateConnectionNames("+commandLog+")", &commandTime);
4760
4761 QByteArray className_utf8 = className.toUtf8();
4762 QByteArray from_utf8 = from.toUtf8();
4763 QByteArray to_utf8 = to.toUtf8();
4764 QByteArray fromNew_utf8 = fromNew.toUtf8();
4765 QByteArray toNew_utf8 = toNew.toUtf8();
4766 modelica_boolean result;
4767
4768 try {
4769 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;
4770
4771 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()));
4772
4773 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
4774 } catch(std::exception &exception) {
4775 emit throwException(QString("updateConnectionNames failed. %1").arg(exception.what()));
4776 }
4777
4778 QString responseLog;
4779 responseLog.append(result ? "true" : "false");
4780 emit logResponse("updateConnectionNames("+commandLog+")", responseLog, &commandTime);
4781
4782 return result;
4783}
4784modelica_boolean OMCInterface::removeExtendsModifiers(QString className, QString baseClassName, modelica_boolean keepRedeclares)
4785{
4786 QTime commandTime;
4787 commandTime.start();
4788 QString commandLog;
4789 commandLog.append(className);
4790 commandLog.append(",");
4791 commandLog.append(baseClassName);
4792 commandLog.append(",");
4793 commandLog.append(keepRedeclares ? "true" : "false");
4794 emit logCommand("removeExtendsModifiers("+commandLog+")", &commandTime);
4795
4796 QByteArray className_utf8 = className.toUtf8();
4797 QByteArray baseClassName_utf8 = baseClassName.toUtf8();
4798 modelica_boolean result;
4799
4800 try {
4801 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;
4802
4803 result = omc_OpenModelicaScriptingAPI_removeExtendsModifiers(threadData, mmc_mk_scon(className_utf8.constData()), mmc_mk_scon(baseClassName_utf8.constData()), keepRedeclares);
4804
4805 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
4806 } catch(std::exception &exception) {
4807 emit throwException(QString("removeExtendsModifiers failed. %1").arg(exception.what()));
4808 }
4809
4810 QString responseLog;
4811 responseLog.append(result ? "true" : "false");
4812 emit logResponse("removeExtendsModifiers("+commandLog+")", responseLog, &commandTime);
4813
4814 return result;
4815}
4816modelica_boolean OMCInterface::removeComponentModifiers(QString class_, QString componentName, modelica_boolean keepRedeclares)
4817{
4818 QTime commandTime;
4819 commandTime.start();
4820 QString commandLog;
4821 commandLog.append(class_);
4822 commandLog.append(",");
4823 commandLog.append("\"" + componentName + "\"");
4824 commandLog.append(",");
4825 commandLog.append(keepRedeclares ? "true" : "false");
4826 emit logCommand("removeComponentModifiers("+commandLog+")", &commandTime);
4827
4828 QByteArray class__utf8 = class_.toUtf8();
4829 QByteArray componentName_utf8 = componentName.toUtf8();
4830 modelica_boolean result;
4831
4832 try {
4833 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;
4834
4835 result = omc_OpenModelicaScriptingAPI_removeComponentModifiers(threadData, mmc_mk_scon(class__utf8.constData()), mmc_mk_scon(componentName_utf8.constData()), keepRedeclares);
4836
4837 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
4838 } catch(std::exception &exception) {
4839 emit throwException(QString("removeComponentModifiers failed. %1").arg(exception.what()));
4840 }
4841
4842 QString responseLog;
4843 responseLog.append(result ? "true" : "false");
4844 emit logResponse("removeComponentModifiers("+commandLog+")", responseLog, &commandTime);
4845
4846 return result;
4847}
4848QList<QString > OMCInterface::getInstantiatedParametersAndValues(QString cls)
4849{
4850 QTime commandTime;
4851 commandTime.start();
4852 QString commandLog;
4853 commandLog.append(cls);
4854 emit logCommand("getInstantiatedParametersAndValues("+commandLog+")", &commandTime);
4855
4856 QByteArray cls_utf8 = cls.toUtf8();
4857 QList<QString > result;
4858 void *result_mm = NULL__null;
4859
4860 try {
4861 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;
4862
4863 result_mm = omc_OpenModelicaScriptingAPI_getInstantiatedParametersAndValues(threadData, mmc_mk_scon(cls_utf8.constData()));
4864 result.clear();
4865 while (!listEmpty(result_mm)((*(mmc_uint_t*)((void*)((char*)(result_mm) - 3))) == (((0) <<
10) + (((0) & 255) << 2)))
) {
4866 QString result_elt;
4867 result_elt = MMC_STRINGDATA(MMC_CAR(result_mm))(((struct mmc_string*)((void*)((char*)((*(void**)(((void*)((void
**)(((void*)((char*)(result_mm) - 3))) + (1)))))) - 3)))->
data)
;
4868 result.push_back(result_elt);
4869 result_mm = MMC_CDR(result_mm)(*(void**)(((void*)((void**)(((void*)((char*)(result_mm) - 3)
)) + (2)))))
;
4870 }
4871
4872 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
4873 } catch(std::exception &exception) {
4874 emit throwException(QString("getInstantiatedParametersAndValues failed. %1").arg(exception.what()));
4875 }
4876
4877 QString responseLog;
4878 responseLog.append("{");
4879 int result_i = 0;
4880 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)
{
4881 if (result_i) {
4882 responseLog.append(",");
4883 }
4884 responseLog.append("\"" + result_elt + "\"");
4885 result_i++;
4886 }
4887 responseLog.append("}");
4888 emit logResponse("getInstantiatedParametersAndValues("+commandLog+")", responseLog, &commandTime);
4889
4890 return result;
4891}
4892QString OMCInterface::getComponentModifierValues(QString class_, QString modifier)
4893{
4894 QTime commandTime;
4895 commandTime.start();
4896 QString commandLog;
4897 commandLog.append(class_);
4898 commandLog.append(",");
4899 commandLog.append(modifier);
4900 emit logCommand("getComponentModifierValues("+commandLog+")", &commandTime);
4901
4902 QByteArray class__utf8 = class_.toUtf8();
4903 QByteArray modifier_utf8 = modifier.toUtf8();
4904 QString result;
4905 void *result_mm = NULL__null;
4906
4907 try {
4908 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;
4909
4910 result_mm = omc_OpenModelicaScriptingAPI_getComponentModifierValues(threadData, mmc_mk_scon(class__utf8.constData()), mmc_mk_scon(modifier_utf8.constData()));
4911 result = QString::fromUtf8(MMC_STRINGDATA(result_mm)(((struct mmc_string*)((void*)((char*)(result_mm) - 3)))->
data)
);
4912
4913 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
4914 } catch(std::exception &exception) {
4915 emit throwException(QString("getComponentModifierValues failed. %1").arg(exception.what()));
4916 }
4917
4918 QString responseLog;
4919 responseLog.append("\"" + result + "\"");
4920 emit logResponse("getComponentModifierValues("+commandLog+")", responseLog, &commandTime);
4921
4922 return result;
4923}
4924QString OMCInterface::getComponentModifierValue(QString class_, QString modifier)
4925{
4926 QTime commandTime;
4927 commandTime.start();
4928 QString commandLog;
4929 commandLog.append(class_);
4930 commandLog.append(",");
4931 commandLog.append(modifier);
4932 emit logCommand("getComponentModifierValue("+commandLog+")", &commandTime);
4933
4934 QByteArray class__utf8 = class_.toUtf8();
4935 QByteArray modifier_utf8 = modifier.toUtf8();
4936 QString result;
4937 void *result_mm = NULL__null;
4938
4939 try {
4940 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;
4941
4942 result_mm = omc_OpenModelicaScriptingAPI_getComponentModifierValue(threadData, mmc_mk_scon(class__utf8.constData()), mmc_mk_scon(modifier_utf8.constData()));
4943 result = QString::fromUtf8(MMC_STRINGDATA(result_mm)(((struct mmc_string*)((void*)((char*)(result_mm) - 3)))->
data)
);
4944
4945 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
4946 } catch(std::exception &exception) {
4947 emit throwException(QString("getComponentModifierValue failed. %1").arg(exception.what()));
4948 }
4949
4950 QString responseLog;
4951 responseLog.append("\"" + result + "\"");
4952 emit logResponse("getComponentModifierValue("+commandLog+")", responseLog, &commandTime);
4953
4954 return result;
4955}
4956QList<QString > OMCInterface::getComponentModifierNames(QString class_, QString componentName)
4957{
4958 QTime commandTime;
4959 commandTime.start();
4960 QString commandLog;
4961 commandLog.append(class_);
4962 commandLog.append(",");
4963 commandLog.append("\"" + componentName + "\"");
4964 emit logCommand("getComponentModifierNames("+commandLog+")", &commandTime);
4965
4966 QByteArray class__utf8 = class_.toUtf8();
4967 QByteArray componentName_utf8 = componentName.toUtf8();
4968 QList<QString > result;
4969 void *result_mm = NULL__null;
4970
4971 try {
4972 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;
4973
4974 result_mm = omc_OpenModelicaScriptingAPI_getComponentModifierNames(threadData, mmc_mk_scon(class__utf8.constData()), mmc_mk_scon(componentName_utf8.constData()));
4975 result.clear();
4976 while (!listEmpty(result_mm)((*(mmc_uint_t*)((void*)((char*)(result_mm) - 3))) == (((0) <<
10) + (((0) & 255) << 2)))
) {
4977 QString result_elt;
4978 result_elt = MMC_STRINGDATA(MMC_CAR(result_mm))(((struct mmc_string*)((void*)((char*)((*(void**)(((void*)((void
**)(((void*)((char*)(result_mm) - 3))) + (1)))))) - 3)))->
data)
;
4979 result.push_back(result_elt);
4980 result_mm = MMC_CDR(result_mm)(*(void**)(((void*)((void**)(((void*)((char*)(result_mm) - 3)
)) + (2)))))
;
4981 }
4982
4983 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
4984 } catch(std::exception &exception) {
4985 emit throwException(QString("getComponentModifierNames failed. %1").arg(exception.what()));
4986 }
4987
4988 QString responseLog;
4989 responseLog.append("{");
4990 int result_i = 0;
4991 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)
{
4992 if (result_i) {
4993 responseLog.append(",");
4994 }
4995 responseLog.append("\"" + result_elt + "\"");
4996 result_i++;
4997 }
4998 responseLog.append("}");
4999 emit logResponse("getComponentModifierNames("+commandLog+")", responseLog, &commandTime);
5000
5001 return result;
5002}
5003QString OMCInterface::getParameterValue(QString class_, QString parameterName)
5004{
5005 QTime commandTime;
5006 commandTime.start();
5007 QString commandLog;
5008 commandLog.append(class_);
5009 commandLog.append(",");
5010 commandLog.append("\"" + parameterName + "\"");
5011 emit logCommand("getParameterValue("+commandLog+")", &commandTime);
5012
5013 QByteArray class__utf8 = class_.toUtf8();
5014 QByteArray parameterName_utf8 = parameterName.toUtf8();
5015 QString result;
5016 void *result_mm = NULL__null;
5017
5018 try {
5019 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;
5020
5021 result_mm = omc_OpenModelicaScriptingAPI_getParameterValue(threadData, mmc_mk_scon(class__utf8.constData()), mmc_mk_scon(parameterName_utf8.constData()));
5022 result = QString::fromUtf8(MMC_STRINGDATA(result_mm)(((struct mmc_string*)((void*)((char*)(result_mm) - 3)))->
data)
);
5023
5024 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
5025 } catch(std::exception &exception) {
5026 emit throwException(QString("getParameterValue failed. %1").arg(exception.what()));
5027 }
5028
5029 QString responseLog;
5030 responseLog.append("\"" + result + "\"");
5031 emit logResponse("getParameterValue("+commandLog+")", responseLog, &commandTime);
5032
5033 return result;
5034}
5035QList<QString > OMCInterface::getParameterNames(QString class_)
5036{
5037 QTime commandTime;
5038 commandTime.start();
5039 QString commandLog;
5040 commandLog.append(class_);
5041 emit logCommand("getParameterNames("+commandLog+")", &commandTime);
5042
5043 QByteArray class__utf8 = class_.toUtf8();
5044 QList<QString > result;
5045 void *result_mm = NULL__null;
5046
5047 try {
5048 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;
5049
5050 result_mm = omc_OpenModelicaScriptingAPI_getParameterNames(threadData, mmc_mk_scon(class__utf8.constData()));
5051 result.clear();
5052 while (!listEmpty(result_mm)((*(mmc_uint_t*)((void*)((char*)(result_mm) - 3))) == (((0) <<
10) + (((0) & 255) << 2)))
) {
5053 QString result_elt;
5054 result_elt = MMC_STRINGDATA(MMC_CAR(result_mm))(((struct mmc_string*)((void*)((char*)((*(void**)(((void*)((void
**)(((void*)((char*)(result_mm) - 3))) + (1)))))) - 3)))->
data)
;
5055 result.push_back(result_elt);
5056 result_mm = MMC_CDR(result_mm)(*(void**)(((void*)((void**)(((void*)((char*)(result_mm) - 3)
)) + (2)))))
;
5057 }
5058
5059 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
5060 } catch(std::exception &exception) {
5061 emit throwException(QString("getParameterNames failed. %1").arg(exception.what()));
5062 }
5063
5064 QString responseLog;
5065 responseLog.append("{");
5066 int result_i = 0;
5067 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)
{
5068 if (result_i) {
5069 responseLog.append(",");
5070 }
5071 responseLog.append("\"" + result_elt + "\"");
5072 result_i++;
5073 }
5074 responseLog.append("}");
5075 emit logResponse("getParameterNames("+commandLog+")", responseLog, &commandTime);
5076
5077 return result;
5078}
5079modelica_boolean OMCInterface::closeSimulationResultFile()
5080{
5081 QTime commandTime;
5082 commandTime.start();
5083 emit logCommand("closeSimulationResultFile()", &commandTime);
5084
5085 modelica_boolean result;
5086
5087 try {
5088 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;
5089
5090 result = omc_OpenModelicaScriptingAPI_closeSimulationResultFile(threadData);
5091
5092 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
5093 } catch(std::exception &exception) {
5094 emit throwException(QString("closeSimulationResultFile failed. %1").arg(exception.what()));
5095 }
5096
5097 QString responseLog;
5098 responseLog.append(result ? "true" : "false");
5099 emit logResponse("closeSimulationResultFile()", responseLog, &commandTime);
5100
5101 return result;
5102}
5103QList<QString > OMCInterface::checkCodeGraph(QString graphfile, QString codefile)
5104{
5105 QTime commandTime;
5106 commandTime.start();
5107 QString commandLog;
5108 commandLog.append("\"" + graphfile + "\"");
5109 commandLog.append(",");
5110 commandLog.append("\"" + codefile + "\"");
5111 emit logCommand("checkCodeGraph("+commandLog+")", &commandTime);
5112
5113 QByteArray graphfile_utf8 = graphfile.toUtf8();
5114 QByteArray codefile_utf8 = codefile.toUtf8();
5115 QList<QString > result;
5116 void *result_mm = NULL__null;
5117
5118 try {
5119 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;
5120
5121 result_mm = omc_OpenModelicaScriptingAPI_checkCodeGraph(threadData, mmc_mk_scon(graphfile_utf8.constData()), mmc_mk_scon(codefile_utf8.constData()));
5122 result.clear();
5123 while (!listEmpty(result_mm)((*(mmc_uint_t*)((void*)((char*)(result_mm) - 3))) == (((0) <<
10) + (((0) & 255) << 2)))
) {
5124 QString result_elt;
5125 result_elt = MMC_STRINGDATA(MMC_CAR(result_mm))(((struct mmc_string*)((void*)((char*)((*(void**)(((void*)((void
**)(((void*)((char*)(result_mm) - 3))) + (1)))))) - 3)))->
data)
;
5126 result.push_back(result_elt);
5127 result_mm = MMC_CDR(result_mm)(*(void**)(((void*)((void**)(((void*)((char*)(result_mm) - 3)
)) + (2)))))
;
5128 }
5129
5130 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
5131 } catch(std::exception &exception) {
5132 emit throwException(QString("checkCodeGraph failed. %1").arg(exception.what()));
5133 }
5134
5135 QString responseLog;
5136 responseLog.append("{");
5137 int result_i = 0;
5138 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)
{
5139 if (result_i) {
5140 responseLog.append(",");
5141 }
5142 responseLog.append("\"" + result_elt + "\"");
5143 result_i++;
5144 }
5145 responseLog.append("}");
5146 emit logResponse("checkCodeGraph("+commandLog+")", responseLog, &commandTime);
5147
5148 return result;
5149}
5150QList<QString > OMCInterface::checkTaskGraph(QString filename, QString reffilename)
5151{
5152 QTime commandTime;
5153 commandTime.start();
5154 QString commandLog;
5155 commandLog.append("\"" + filename + "\"");
5156 commandLog.append(",");
5157 commandLog.append("\"" + reffilename + "\"");
5158 emit logCommand("checkTaskGraph("+commandLog+")", &commandTime);
5159
5160 QByteArray filename_utf8 = filename.toUtf8();
5161 QByteArray reffilename_utf8 = reffilename.toUtf8();
5162 QList<QString > result;
5163 void *result_mm = NULL__null;
5164
5165 try {
5166 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;
5167
5168 result_mm = omc_OpenModelicaScriptingAPI_checkTaskGraph(threadData, mmc_mk_scon(filename_utf8.constData()), mmc_mk_scon(reffilename_utf8.constData()));
5169 result.clear();
5170 while (!listEmpty(result_mm)((*(mmc_uint_t*)((void*)((char*)(result_mm) - 3))) == (((0) <<
10) + (((0) & 255) << 2)))
) {
5171 QString result_elt;
5172 result_elt = MMC_STRINGDATA(MMC_CAR(result_mm))(((struct mmc_string*)((void*)((char*)((*(void**)(((void*)((void
**)(((void*)((char*)(result_mm) - 3))) + (1)))))) - 3)))->
data)
;
5173 result.push_back(result_elt);
5174 result_mm = MMC_CDR(result_mm)(*(void**)(((void*)((void**)(((void*)((char*)(result_mm) - 3)
)) + (2)))))
;
5175 }
5176
5177 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
5178 } catch(std::exception &exception) {
5179 emit throwException(QString("checkTaskGraph failed. %1").arg(exception.what()));
5180 }
5181
5182 QString responseLog;
5183 responseLog.append("{");
5184 int result_i = 0;
5185 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)
{
5186 if (result_i) {
5187 responseLog.append(",");
5188 }
5189 responseLog.append("\"" + result_elt + "\"");
5190 result_i++;
5191 }
5192 responseLog.append("}");
5193 emit logResponse("checkTaskGraph("+commandLog+")", responseLog, &commandTime);
5194
5195 return result;
5196}
5197QString OMCInterface::diffSimulationResultsHtml(QString var, QString actualFile, QString expectedFile, modelica_real relTol, modelica_real relTolDiffMinMax, modelica_real rangeDelta)
5198{
5199 QTime commandTime;
5200 commandTime.start();
5201 QString commandLog;
5202 commandLog.append("\"" + var + "\"");
5203 commandLog.append(",");
5204 commandLog.append("\"" + actualFile + "\"");
5205 commandLog.append(",");
5206 commandLog.append("\"" + expectedFile + "\"");
5207 commandLog.append(",");
5208 commandLog.append(QString::number(relTol));
5209 commandLog.append(",");
5210 commandLog.append(QString::number(relTolDiffMinMax));
5211 commandLog.append(",");
5212 commandLog.append(QString::number(rangeDelta));
5213 emit logCommand("diffSimulationResultsHtml("+commandLog+")", &commandTime);
5214
5215 QByteArray var_utf8 = var.toUtf8();
5216 QByteArray actualFile_utf8 = actualFile.toUtf8();
5217 QByteArray expectedFile_utf8 = expectedFile.toUtf8();
5218 QString result;
5219 void *result_mm = NULL__null;
5220
5221 try {
5222 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;
5223
5224 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);
5225 result = QString::fromUtf8(MMC_STRINGDATA(result_mm)(((struct mmc_string*)((void*)((char*)(result_mm) - 3)))->
data)
);
5226
5227 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
5228 } catch(std::exception &exception) {
5229 emit throwException(QString("diffSimulationResultsHtml failed. %1").arg(exception.what()));
5230 }
5231
5232 QString responseLog;
5233 responseLog.append("\"" + result + "\"");
5234 emit logResponse("diffSimulationResultsHtml("+commandLog+")", responseLog, &commandTime);
5235
5236 return result;
5237}
5238OMCInterface::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)
5239{
5240 QTime commandTime;
5241 commandTime.start();
5242 QString commandLog;
5243 commandLog.append("\"" + actualFile + "\"");
5244 commandLog.append(",");
5245 commandLog.append("\"" + expectedFile + "\"");
5246 commandLog.append(",");
5247 commandLog.append("\"" + diffPrefix + "\"");
5248 commandLog.append(",");
5249 commandLog.append(QString::number(relTol));
5250 commandLog.append(",");
5251 commandLog.append(QString::number(relTolDiffMinMax));
5252 commandLog.append(",");
5253 commandLog.append(QString::number(rangeDelta));
5254 commandLog.append(",");
5255 commandLog.append("{");
5256 int vars_i = 0;
5257 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)
{
5258 if (vars_i) {
5259 commandLog.append(",");
5260 }
5261 commandLog.append("\"" + vars_elt + "\"");
5262 vars_i++;
5263 }
5264 commandLog.append("}");commandLog.append(",");
5265 commandLog.append(keepEqualResults ? "true" : "false");
5266 emit logCommand("diffSimulationResults("+commandLog+")", &commandTime);
5267
5268 QByteArray actualFile_utf8 = actualFile.toUtf8();
5269 QByteArray expectedFile_utf8 = expectedFile.toUtf8();
5270 QByteArray diffPrefix_utf8 = diffPrefix.toUtf8();
5271 void *vars_lst = mmc_mk_nil()((void*)((char*)(&(mmc_nil).header) + 3));
5272 for (int vars_i = vars.size()-1; vars_i>=0; vars_i--) {
5273 QString vars_elt = vars[vars_i];
5274 QByteArray vars_elt_utf8 = vars_elt.toUtf8();
5275 vars_lst = mmc_mk_cons(mmc_mk_scon(vars_elt_utf8.constData()), vars_lst);
5276 }
5277 diffSimulationResults_res result;
5278 void *out2_mm = NULL__null;
5279
5280 try {
5281 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;
5282
5283 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);
5284 result.failVars.clear();
5285 while (!listEmpty(out2_mm)((*(mmc_uint_t*)((void*)((char*)(out2_mm) - 3))) == (((0) <<
10) + (((0) & 255) << 2)))
) {
5286 QString out2_elt;
5287 out2_elt = MMC_STRINGDATA(MMC_CAR(out2_mm))(((struct mmc_string*)((void*)((char*)((*(void**)(((void*)((void
**)(((void*)((char*)(out2_mm) - 3))) + (1)))))) - 3)))->data
)
;
5288 result.failVars.push_back(out2_elt);
5289 out2_mm = MMC_CDR(out2_mm)(*(void**)(((void*)((void**)(((void*)((char*)(out2_mm) - 3)))
+ (2)))))
;
5290 }
5291
5292 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
5293 } catch(std::exception &exception) {
5294 emit throwException(QString("diffSimulationResults failed. %1").arg(exception.what()));
5295 }
5296
5297 QString responseLog;
5298 responseLog.append(result.toString());
5299 emit logResponse("diffSimulationResults("+commandLog+")", responseLog, &commandTime);
5300
5301 return result;
5302}
5303modelica_real OMCInterface::deltaSimulationResults(QString filename, QString reffilename, QString method, QList<QString > vars)
5304{
5305 QTime commandTime;
5306 commandTime.start();
5307 QString commandLog;
5308 commandLog.append("\"" + filename + "\"");
5309 commandLog.append(",");
5310 commandLog.append("\"" + reffilename + "\"");
5311 commandLog.append(",");
5312 commandLog.append("\"" + method + "\"");
5313 commandLog.append(",");
5314 commandLog.append("{");
5315 int vars_i = 0;
5316 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)
{
5317 if (vars_i) {
5318 commandLog.append(",");
5319 }
5320 commandLog.append("\"" + vars_elt + "\"");
5321 vars_i++;
5322 }
5323 commandLog.append("}");
5324 emit logCommand("deltaSimulationResults("+commandLog+")", &commandTime);
5325
5326 QByteArray filename_utf8 = filename.toUtf8();
5327 QByteArray reffilename_utf8 = reffilename.toUtf8();
5328 QByteArray method_utf8 = method.toUtf8();
5329 void *vars_lst = mmc_mk_nil()((void*)((char*)(&(mmc_nil).header) + 3));
5330 for (int vars_i = vars.size()-1; vars_i>=0; vars_i--) {
5331 QString vars_elt = vars[vars_i];
5332 QByteArray vars_elt_utf8 = vars_elt.toUtf8();
5333 vars_lst = mmc_mk_cons(mmc_mk_scon(vars_elt_utf8.constData()), vars_lst);
5334 }
5335 modelica_real result;
5336
5337 try {
5338 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;
5339
5340 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);
5341
5342 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
5343 } catch(std::exception &exception) {
5344 emit throwException(QString("deltaSimulationResults failed. %1").arg(exception.what()));
5345 }
5346
5347 QString responseLog;
5348 responseLog.append(QString::number(result));
5349 emit logResponse("deltaSimulationResults("+commandLog+")", responseLog, &commandTime);
5350
5351 return result;
5352}
5353QList<QString > OMCInterface::compareSimulationResults(QString filename, QString reffilename, QString logfilename, modelica_real relTol, modelica_real absTol, QList<QString > vars)
5354{
5355 QTime commandTime;
5356 commandTime.start();
5357 QString commandLog;
5358 commandLog.append("\"" + filename + "\"");
5359 commandLog.append(",");
5360 commandLog.append("\"" + reffilename + "\"");
5361 commandLog.append(",");
5362 commandLog.append("\"" + logfilename + "\"");
5363 commandLog.append(",");
5364 commandLog.append(QString::number(relTol));
5365 commandLog.append(",");
5366 commandLog.append(QString::number(absTol));
5367 commandLog.append(",");
5368 commandLog.append("{");
5369 int vars_i = 0;
5370 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)
{
5371 if (vars_i) {
5372 commandLog.append(",");
5373 }
5374 commandLog.append("\"" + vars_elt + "\"");
5375 vars_i++;
5376 }
5377 commandLog.append("}");
5378 emit logCommand("compareSimulationResults("+commandLog+")", &commandTime);
5379
5380 QByteArray filename_utf8 = filename.toUtf8();
5381 QByteArray reffilename_utf8 = reffilename.toUtf8();
5382 QByteArray logfilename_utf8 = logfilename.toUtf8();
5383 void *vars_lst = mmc_mk_nil()((void*)((char*)(&(mmc_nil).header) + 3));
5384 for (int vars_i = vars.size()-1; vars_i>=0; vars_i--) {
5385 QString vars_elt = vars[vars_i];
5386 QByteArray vars_elt_utf8 = vars_elt.toUtf8();
5387 vars_lst = mmc_mk_cons(mmc_mk_scon(vars_elt_utf8.constData()), vars_lst);
5388 }
5389 QList<QString > result;
5390 void *result_mm = NULL__null;
5391
5392 try {
5393 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;
5394
5395 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);
5396 result.clear();
5397 while (!listEmpty(result_mm)((*(mmc_uint_t*)((void*)((char*)(result_mm) - 3))) == (((0) <<
10) + (((0) & 255) << 2)))
) {
5398 QString result_elt;
5399 result_elt = MMC_STRINGDATA(MMC_CAR(result_mm))(((struct mmc_string*)((void*)((char*)((*(void**)(((void*)((void
**)(((void*)((char*)(result_mm) - 3))) + (1)))))) - 3)))->
data)
;
5400 result.push_back(result_elt);
5401 result_mm = MMC_CDR(result_mm)(*(void**)(((void*)((void**)(((void*)((char*)(result_mm) - 3)
)) + (2)))))
;
5402 }
5403
5404 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
5405 } catch(std::exception &exception) {
5406 emit throwException(QString("compareSimulationResults failed. %1").arg(exception.what()));
5407 }
5408
5409 QString responseLog;
5410 responseLog.append("{");
5411 int result_i = 0;
5412 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)
{
5413 if (result_i) {
5414 responseLog.append(",");
5415 }
5416 responseLog.append("\"" + result_elt + "\"");
5417 result_i++;
5418 }
5419 responseLog.append("}");
5420 emit logResponse("compareSimulationResults("+commandLog+")", responseLog, &commandTime);
5421
5422 return result;
5423}
5424modelica_boolean OMCInterface::filterSimulationResults(QString inFile, QString outFile, QList<QString > vars, modelica_integer numberOfIntervals, modelica_boolean removeDescription)
5425{
5426 QTime commandTime;
5427 commandTime.start();
5428 QString commandLog;
5429 commandLog.append("\"" + inFile + "\"");
5430 commandLog.append(",");
5431 commandLog.append("\"" + outFile + "\"");
5432 commandLog.append(",");
5433 commandLog.append("{");
5434 int vars_i = 0;
5435 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)
{
5436 if (vars_i) {
5437 commandLog.append(",");
5438 }
5439 commandLog.append("\"" + vars_elt + "\"");
5440 vars_i++;
5441 }
5442 commandLog.append("}");commandLog.append(",");
5443 commandLog.append(QString::number(numberOfIntervals));
5444 commandLog.append(",");
5445 commandLog.append(removeDescription ? "true" : "false");
5446 emit logCommand("filterSimulationResults("+commandLog+")", &commandTime);
5447
5448 QByteArray inFile_utf8 = inFile.toUtf8();
5449 QByteArray outFile_utf8 = outFile.toUtf8();
5450 void *vars_lst = mmc_mk_nil()((void*)((char*)(&(mmc_nil).header) + 3));
5451 for (int vars_i = vars.size()-1; vars_i>=0; vars_i--) {
5452 QString vars_elt = vars[vars_i];
5453 QByteArray vars_elt_utf8 = vars_elt.toUtf8();
5454 vars_lst = mmc_mk_cons(mmc_mk_scon(vars_elt_utf8.constData()), vars_lst);
5455 }
5456 modelica_boolean result;
5457
5458 try {
5459 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;
5460
5461 result = omc_OpenModelicaScriptingAPI_filterSimulationResults(threadData, mmc_mk_scon(inFile_utf8.constData()), mmc_mk_scon(outFile_utf8.constData()), vars_lst, numberOfIntervals, removeDescription);
5462
5463 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
5464 } catch(std::exception &exception) {
5465 emit throwException(QString("filterSimulationResults failed. %1").arg(exception.what()));
5466 }
5467
5468 QString responseLog;
5469 responseLog.append(result ? "true" : "false");
5470 emit logResponse("filterSimulationResults("+commandLog+")", responseLog, &commandTime);
5471
5472 return result;
5473}
5474QList<QString > OMCInterface::readSimulationResultVars(QString fileName, modelica_boolean readParameters, modelica_boolean openmodelicaStyle)
5475{
5476 QTime commandTime;
5477 commandTime.start();
5478 QString commandLog;
5479 commandLog.append("\"" + fileName + "\"");
5480 commandLog.append(",");
5481 commandLog.append(readParameters ? "true" : "false");
5482 commandLog.append(",");
5483 commandLog.append(openmodelicaStyle ? "true" : "false");
5484 emit logCommand("readSimulationResultVars("+commandLog+")", &commandTime);
5485
5486 QByteArray fileName_utf8 = fileName.toUtf8();
5487 QList<QString > result;
5488 void *result_mm = NULL__null;
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_mm = omc_OpenModelicaScriptingAPI_readSimulationResultVars(threadData, mmc_mk_scon(fileName_utf8.constData()), readParameters, openmodelicaStyle);
5494 result.clear();
5495 while (!listEmpty(result_mm)((*(mmc_uint_t*)((void*)((char*)(result_mm) - 3))) == (((0) <<
10) + (((0) & 255) << 2)))
) {
5496 QString result_elt;
5497 result_elt = MMC_STRINGDATA(MMC_CAR(result_mm))(((struct mmc_string*)((void*)((char*)((*(void**)(((void*)((void
**)(((void*)((char*)(result_mm) - 3))) + (1)))))) - 3)))->
data)
;
5498 result.push_back(result_elt);
5499 result_mm = MMC_CDR(result_mm)(*(void**)(((void*)((void**)(((void*)((char*)(result_mm) - 3)
)) + (2)))))
;
5500 }
5501
5502 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
5503 } catch(std::exception &exception) {
5504 emit throwException(QString("readSimulationResultVars failed. %1").arg(exception.what()));
5505 }
5506
5507 QString responseLog;
5508 responseLog.append("{");
5509 int result_i = 0;
5510 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)
{
5511 if (result_i) {
5512 responseLog.append(",");
5513 }
5514 responseLog.append("\"" + result_elt + "\"");
5515 result_i++;
5516 }
5517 responseLog.append("}");
5518 emit logResponse("readSimulationResultVars("+commandLog+")", responseLog, &commandTime);
5519
5520 return result;
5521}
5522modelica_integer OMCInterface::readSimulationResultSize(QString fileName)
5523{
5524 QTime commandTime;
5525 commandTime.start();
5526 QString commandLog;
5527 commandLog.append("\"" + fileName + "\"");
5528 emit logCommand("readSimulationResultSize("+commandLog+")", &commandTime);
5529
5530 QByteArray fileName_utf8 = fileName.toUtf8();
5531 modelica_integer result;
5532
5533 try {
5534 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;
5535
5536 result = omc_OpenModelicaScriptingAPI_readSimulationResultSize(threadData, mmc_mk_scon(fileName_utf8.constData()));
5537
5538 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
5539 } catch(std::exception &exception) {
5540 emit throwException(QString("readSimulationResultSize failed. %1").arg(exception.what()));
5541 }
5542
5543 QString responseLog;
5544 responseLog.append(QString::number(result));
5545 emit logResponse("readSimulationResultSize("+commandLog+")", responseLog, &commandTime);
5546
5547 return result;
5548}
5549modelica_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)
5550{
5551 QTime commandTime;
5552 commandTime.start();
5553 QString commandLog;
5554 commandLog.append(externalWindow ? "true" : "false");
5555 commandLog.append(",");
5556 commandLog.append("\"" + fileName + "\"");
5557 commandLog.append(",");
5558 commandLog.append("\"" + title + "\"");
5559 commandLog.append(",");
5560 commandLog.append("\"" + grid + "\"");
5561 commandLog.append(",");
5562 commandLog.append(logX ? "true" : "false");
5563 commandLog.append(",");
5564 commandLog.append(logY ? "true" : "false");
5565 commandLog.append(",");
5566 commandLog.append("\"" + xLabel + "\"");
5567 commandLog.append(",");
5568 commandLog.append("\"" + yLabel + "\"");
5569 commandLog.append(",");
5570 commandLog.append("{");
5571 int xRange_i = 0;
5572 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)
{
5573 if (xRange_i) {
5574 commandLog.append(",");
5575 }
5576 commandLog.append(QString::number(xRange_elt));
5577 xRange_i++;
5578 }
5579 commandLog.append("}");commandLog.append(",");
5580 commandLog.append("{");
5581 int yRange_i = 0;
5582 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)
{
5583 if (yRange_i) {
5584 commandLog.append(",");
5585 }
5586 commandLog.append(QString::number(yRange_elt));
5587 yRange_i++;
5588 }
5589 commandLog.append("}");commandLog.append(",");
5590 commandLog.append(QString::number(curveWidth));
5591 commandLog.append(",");
5592 commandLog.append(QString::number(curveStyle));
5593 commandLog.append(",");
5594 commandLog.append("\"" + legendPosition + "\"");
5595 commandLog.append(",");
5596 commandLog.append("\"" + footer + "\"");
5597 commandLog.append(",");
5598 commandLog.append(autoScale ? "true" : "false");
5599 commandLog.append(",");
5600 commandLog.append(forceOMPlot ? "true" : "false");
5601 emit logCommand("plotAll("+commandLog+")", &commandTime);
5602
5603 QByteArray fileName_utf8 = fileName.toUtf8();
5604 QByteArray title_utf8 = title.toUtf8();
5605 QByteArray grid_utf8 = grid.toUtf8();
5606 QByteArray xLabel_utf8 = xLabel.toUtf8();
5607 QByteArray yLabel_utf8 = yLabel.toUtf8();
5608 void *xRange_lst = mmc_mk_nil()((void*)((char*)(&(mmc_nil).header) + 3));
5609 for (int xRange_i = xRange.size()-1; xRange_i>=0; xRange_i--) {
5610 modelica_real xRange_elt = xRange[xRange_i];
5611 xRange_lst = mmc_mk_cons(mmc_mk_rcon(xRange_elt), xRange_lst);
5612 }
5613 void *yRange_lst = mmc_mk_nil()((void*)((char*)(&(mmc_nil).header) + 3));
5614 for (int yRange_i = yRange.size()-1; yRange_i>=0; yRange_i--) {
5615 modelica_real yRange_elt = yRange[yRange_i];
5616 yRange_lst = mmc_mk_cons(mmc_mk_rcon(yRange_elt), yRange_lst);
5617 }
5618 QByteArray legendPosition_utf8 = legendPosition.toUtf8();
5619 QByteArray footer_utf8 = footer.toUtf8();
5620 modelica_boolean result;
5621
5622 try {
5623 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;
5624
5625 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);
5626
5627 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
5628 } catch(std::exception &exception) {
5629 emit throwException(QString("plotAll failed. %1").arg(exception.what()));
5630 }
5631
5632 QString responseLog;
5633 responseLog.append(result ? "true" : "false");
5634 emit logResponse("plotAll("+commandLog+")", responseLog, &commandTime);
5635
5636 return result;
5637}
5638QList<QString > OMCInterface::getAllSubtypeOf(QString parentClass, QString class_, modelica_boolean qualified, modelica_boolean includePartial, modelica_boolean sort)
5639{
5640 QTime commandTime;
5641 commandTime.start();
5642 QString commandLog;
5643 commandLog.append(parentClass);
5644 commandLog.append(",");
5645 commandLog.append(class_);
5646 commandLog.append(",");
5647 commandLog.append(qualified ? "true" : "false");
5648 commandLog.append(",");
5649 commandLog.append(includePartial ? "true" : "false");
5650 commandLog.append(",");
5651 commandLog.append(sort ? "true" : "false");
5652 emit logCommand("getAllSubtypeOf("+commandLog+")", &commandTime);
5653
5654 QByteArray parentClass_utf8 = parentClass.toUtf8();
5655 QByteArray class__utf8 = class_.toUtf8();
5656 QList<QString > result;
5657 void *result_mm = NULL__null;
5658
5659 try {
5660 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;
5661
5662 result_mm = omc_OpenModelicaScriptingAPI_getAllSubtypeOf(threadData, mmc_mk_scon(parentClass_utf8.constData()), mmc_mk_scon(class__utf8.constData()), qualified, includePartial, sort);
5663 result.clear();
5664 while (!listEmpty(result_mm)((*(mmc_uint_t*)((void*)((char*)(result_mm) - 3))) == (((0) <<
10) + (((0) & 255) << 2)))
) {
5665 QString result_elt;
5666 result_elt = MMC_STRINGDATA(MMC_CAR(result_mm))(((struct mmc_string*)((void*)((char*)((*(void**)(((void*)((void
**)(((void*)((char*)(result_mm) - 3))) + (1)))))) - 3)))->
data)
;
5667 result.push_back(result_elt);
5668 result_mm = MMC_CDR(result_mm)(*(void**)(((void*)((void**)(((void*)((char*)(result_mm) - 3)
)) + (2)))))
;
5669 }
5670
5671 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
5672 } catch(std::exception &exception) {
5673 emit throwException(QString("getAllSubtypeOf failed. %1").arg(exception.what()));
5674 }
5675
5676 QString responseLog;
5677 responseLog.append("{");
5678 int result_i = 0;
5679 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)
{
5680 if (result_i) {
5681 responseLog.append(",");
5682 }
5683 responseLog.append(result_elt);
5684 result_i++;
5685 }
5686 responseLog.append("}");
5687 emit logResponse("getAllSubtypeOf("+commandLog+")", responseLog, &commandTime);
5688
5689 return result;
5690}
5691QList<QString > OMCInterface::getPackages(QString class_)
5692{
5693 QTime commandTime;
5694 commandTime.start();
5695 QString commandLog;
5696 commandLog.append(class_);
5697 emit logCommand("getPackages("+commandLog+")", &commandTime);
5698
5699 QByteArray class__utf8 = class_.toUtf8();
5700 QList<QString > result;
5701 void *result_mm = NULL__null;
5702
5703 try {
5704 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;
5705
5706 result_mm = omc_OpenModelicaScriptingAPI_getPackages(threadData, mmc_mk_scon(class__utf8.constData()));
5707 result.clear();
5708 while (!listEmpty(result_mm)((*(mmc_uint_t*)((void*)((char*)(result_mm) - 3))) == (((0) <<
10) + (((0) & 255) << 2)))
) {
5709 QString result_elt;
5710 result_elt = MMC_STRINGDATA(MMC_CAR(result_mm))(((struct mmc_string*)((void*)((char*)((*(void**)(((void*)((void
**)(((void*)((char*)(result_mm) - 3))) + (1)))))) - 3)))->
data)
;
5711 result.push_back(result_elt);
5712 result_mm = MMC_CDR(result_mm)(*(void**)(((void*)((void**)(((void*)((char*)(result_mm) - 3)
)) + (2)))))
;
5713 }
5714
5715 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
5716 } catch(std::exception &exception) {
5717 emit throwException(QString("getPackages failed. %1").arg(exception.what()));
5718 }
5719
5720 QString responseLog;
5721 responseLog.append("{");
5722 int result_i = 0;
5723 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)
{
5724 if (result_i) {
5725 responseLog.append(",");
5726 }
5727 responseLog.append(result_elt);
5728 result_i++;
5729 }
5730 responseLog.append("}");
5731 emit logResponse("getPackages("+commandLog+")", responseLog, &commandTime);
5732
5733 return result;
5734}
5735QList<QString > OMCInterface::getUsedClassNames(QString className)
5736{
5737 QTime commandTime;
5738 commandTime.start();
5739 QString commandLog;
5740 commandLog.append(className);
5741 emit logCommand("getUsedClassNames("+commandLog+")", &commandTime);
5742
5743 QByteArray className_utf8 = className.toUtf8();
5744 QList<QString > result;
5745 void *result_mm = NULL__null;
5746
5747 try {
5748 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;
5749
5750 result_mm = omc_OpenModelicaScriptingAPI_getUsedClassNames(threadData, mmc_mk_scon(className_utf8.constData()));
5751 result.clear();
5752 while (!listEmpty(result_mm)((*(mmc_uint_t*)((void*)((char*)(result_mm) - 3))) == (((0) <<
10) + (((0) & 255) << 2)))
) {
5753 QString result_elt;
5754 result_elt = MMC_STRINGDATA(MMC_CAR(result_mm))(((struct mmc_string*)((void*)((char*)((*(void**)(((void*)((void
**)(((void*)((char*)(result_mm) - 3))) + (1)))))) - 3)))->
data)
;
5755 result.push_back(result_elt);
5756 result_mm = MMC_CDR(result_mm)(*(void**)(((void*)((void**)(((void*)((char*)(result_mm) - 3)
)) + (2)))))
;
5757 }
5758
5759 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
5760 } catch(std::exception &exception) {
5761 emit throwException(QString("getUsedClassNames failed. %1").arg(exception.what()));
5762 }
5763
5764 QString responseLog;
5765 responseLog.append("{");
5766 int result_i = 0;
5767 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)
{
5768 if (result_i) {
5769 responseLog.append(",");
5770 }
5771 responseLog.append(result_elt);
5772 result_i++;
5773 }
5774 responseLog.append("}");
5775 emit logResponse("getUsedClassNames("+commandLog+")", responseLog, &commandTime);
5776
5777 return result;
5778}
5779QList<QString > OMCInterface::getClassNames(QString class_, modelica_boolean recursive, modelica_boolean qualified, modelica_boolean sort, modelica_boolean builtin, modelica_boolean showProtected, modelica_boolean includeConstants)
5780{
5781 QTime commandTime;
5782 commandTime.start();
5783 QString commandLog;
5784 commandLog.append(class_);
5785 commandLog.append(",");
5786 commandLog.append(recursive ? "true" : "false");
5787 commandLog.append(",");
5788 commandLog.append(qualified ? "true" : "false");
5789 commandLog.append(",");
5790 commandLog.append(sort ? "true" : "false");
5791 commandLog.append(",");
5792 commandLog.append(builtin ? "true" : "false");
5793 commandLog.append(",");
5794 commandLog.append(showProtected ? "true" : "false");
5795 commandLog.append(",");
5796 commandLog.append(includeConstants ? "true" : "false");
5797 emit logCommand("getClassNames("+commandLog+")", &commandTime);
5798
5799 QByteArray class__utf8 = class_.toUtf8();
5800 QList<QString > result;
5801 void *result_mm = NULL__null;
5802
5803 try {
5804 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;
5805
5806 result_mm = omc_OpenModelicaScriptingAPI_getClassNames(threadData, mmc_mk_scon(class__utf8.constData()), recursive, qualified, sort, builtin, showProtected, includeConstants);
5807 result.clear();
5808 while (!listEmpty(result_mm)((*(mmc_uint_t*)((void*)((char*)(result_mm) - 3))) == (((0) <<
10) + (((0) & 255) << 2)))
) {
5809 QString result_elt;
5810 result_elt = MMC_STRINGDATA(MMC_CAR(result_mm))(((struct mmc_string*)((void*)((char*)((*(void**)(((void*)((void
**)(((void*)((char*)(result_mm) - 3))) + (1)))))) - 3)))->
data)
;
5811 result.push_back(result_elt);
5812 result_mm = MMC_CDR(result_mm)(*(void**)(((void*)((void**)(((void*)((char*)(result_mm) - 3)
)) + (2)))))
;
5813 }
5814
5815 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
5816 } catch(std::exception &exception) {
5817 emit throwException(QString("getClassNames failed. %1").arg(exception.what()));
5818 }
5819
5820 QString responseLog;
5821 responseLog.append("{");
5822 int result_i = 0;
5823 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)
{
5824 if (result_i) {
5825 responseLog.append(",");
5826 }
5827 responseLog.append(result_elt);
5828 result_i++;
5829 }
5830 responseLog.append("}");
5831 emit logResponse("getClassNames("+commandLog+")", responseLog, &commandTime);
5832
5833 return result;
5834}
5835modelica_boolean OMCInterface::setClassComment(QString class_, QString filename)
5836{
5837 QTime commandTime;
5838 commandTime.start();
5839 QString commandLog;
5840 commandLog.append(class_);
5841 commandLog.append(",");
5842 commandLog.append("\"" + filename + "\"");
5843 emit logCommand("setClassComment("+commandLog+")", &commandTime);
5844
5845 QByteArray class__utf8 = class_.toUtf8();
5846 QByteArray filename_utf8 = filename.toUtf8();
5847 modelica_boolean result;
5848
5849 try {
5850 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;
5851
5852 result = omc_OpenModelicaScriptingAPI_setClassComment(threadData, mmc_mk_scon(class__utf8.constData()), mmc_mk_scon(filename_utf8.constData()));
5853
5854 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
5855 } catch(std::exception &exception) {
5856 emit throwException(QString("setClassComment failed. %1").arg(exception.what()));
5857 }
5858
5859 QString responseLog;
5860 responseLog.append(result ? "true" : "false");
5861 emit logResponse("setClassComment("+commandLog+")", responseLog, &commandTime);
5862
5863 return result;
5864}
5865modelica_boolean OMCInterface::isShortDefinition(QString class_)
5866{
5867 QTime commandTime;
5868 commandTime.start();
5869 QString commandLog;
5870 commandLog.append(class_);
5871 emit logCommand("isShortDefinition("+commandLog+")", &commandTime);
5872
5873 QByteArray class__utf8 = class_.toUtf8();
5874 modelica_boolean result;
5875
5876 try {
5877 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;
5878
5879 result = omc_OpenModelicaScriptingAPI_isShortDefinition(threadData, mmc_mk_scon(class__utf8.constData()));
5880
5881 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
5882 } catch(std::exception &exception) {
5883 emit throwException(QString("isShortDefinition failed. %1").arg(exception.what()));
5884 }
5885
5886 QString responseLog;
5887 responseLog.append(result ? "true" : "false");
5888 emit logResponse("isShortDefinition("+commandLog+")", responseLog, &commandTime);
5889
5890 return result;
5891}
5892modelica_boolean OMCInterface::setSourceFile(QString class_, QString filename)
5893{
5894 QTime commandTime;
5895 commandTime.start();
5896 QString commandLog;
5897 commandLog.append(class_);
5898 commandLog.append(",");
5899 commandLog.append("\"" + filename + "\"");
5900 emit logCommand("setSourceFile("+commandLog+")", &commandTime);
5901
5902 QByteArray class__utf8 = class_.toUtf8();
5903 QByteArray filename_utf8 = filename.toUtf8();
5904 modelica_boolean result;
5905
5906 try {
5907 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;
5908
5909 result = omc_OpenModelicaScriptingAPI_setSourceFile(threadData, mmc_mk_scon(class__utf8.constData()), mmc_mk_scon(filename_utf8.constData()));
5910
5911 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
5912 } catch(std::exception &exception) {
5913 emit throwException(QString("setSourceFile failed. %1").arg(exception.what()));
5914 }
5915
5916 QString responseLog;
5917 responseLog.append(result ? "true" : "false");
5918 emit logResponse("setSourceFile("+commandLog+")", responseLog, &commandTime);
5919
5920 return result;
5921}
5922QString OMCInterface::getSourceFile(QString class_)
5923{
5924 QTime commandTime;
5925 commandTime.start();
5926 QString commandLog;
5927 commandLog.append(class_);
5928 emit logCommand("getSourceFile("+commandLog+")", &commandTime);
5929
5930 QByteArray class__utf8 = class_.toUtf8();
5931 QString result;
5932 void *result_mm = NULL__null;
5933
5934 try {
5935 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;
5936
5937 result_mm = omc_OpenModelicaScriptingAPI_getSourceFile(threadData, mmc_mk_scon(class__utf8.constData()));
5938 result = QString::fromUtf8(MMC_STRINGDATA(result_mm)(((struct mmc_string*)((void*)((char*)(result_mm) - 3)))->
data)
);
5939
5940 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
5941 } catch(std::exception &exception) {
5942 emit throwException(QString("getSourceFile failed. %1").arg(exception.what()));
5943 }
5944
5945 QString responseLog;
5946 responseLog.append("\"" + result + "\"");
5947 emit logResponse("getSourceFile("+commandLog+")", responseLog, &commandTime);
5948
5949 return result;
5950}
5951modelica_boolean OMCInterface::copyClass(QString className, QString newClassName, QString withIn)
5952{
5953 QTime commandTime;
5954 commandTime.start();
5955 QString commandLog;
5956 commandLog.append(className);
5957 commandLog.append(",");
5958 commandLog.append("\"" + newClassName + "\"");
5959 commandLog.append(",");
5960 commandLog.append(withIn);
5961 emit logCommand("copyClass("+commandLog+")", &commandTime);
5962
5963 QByteArray className_utf8 = className.toUtf8();
5964 QByteArray newClassName_utf8 = newClassName.toUtf8();
5965 QByteArray withIn_utf8 = withIn.toUtf8();
5966 modelica_boolean result;
5967
5968 try {
5969 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;
5970
5971 result = omc_OpenModelicaScriptingAPI_copyClass(threadData, mmc_mk_scon(className_utf8.constData()), mmc_mk_scon(newClassName_utf8.constData()), mmc_mk_scon(withIn_utf8.constData()));
5972
5973 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
5974 } catch(std::exception &exception) {
5975 emit throwException(QString("copyClass failed. %1").arg(exception.what()));
5976 }
5977
5978 QString responseLog;
5979 responseLog.append(result ? "true" : "false");
5980 emit logResponse("copyClass("+commandLog+")", responseLog, &commandTime);
5981
5982 return result;
5983}
5984modelica_boolean OMCInterface::moveClassToBottom(QString className)
5985{
5986 QTime commandTime;
5987 commandTime.start();
5988 QString commandLog;
5989 commandLog.append(className);
5990 emit logCommand("moveClassToBottom("+commandLog+")", &commandTime);
5991
5992 QByteArray className_utf8 = className.toUtf8();
5993 modelica_boolean result;
5994
5995 try {
5996 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;
5997
5998 result = omc_OpenModelicaScriptingAPI_moveClassToBottom(threadData, mmc_mk_scon(className_utf8.constData()));
5999
6000 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
6001 } catch(std::exception &exception) {
6002 emit throwException(QString("moveClassToBottom failed. %1").arg(exception.what()));
6003 }
6004
6005 QString responseLog;
6006 responseLog.append(result ? "true" : "false");
6007 emit logResponse("moveClassToBottom("+commandLog+")", responseLog, &commandTime);
6008
6009 return result;
6010}
6011modelica_boolean OMCInterface::moveClassToTop(QString className)
6012{
6013 QTime commandTime;
6014 commandTime.start();
6015 QString commandLog;
6016 commandLog.append(className);
6017 emit logCommand("moveClassToTop("+commandLog+")", &commandTime);
6018
6019 QByteArray className_utf8 = className.toUtf8();
6020 modelica_boolean result;
6021
6022 try {
6023 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;
6024
6025 result = omc_OpenModelicaScriptingAPI_moveClassToTop(threadData, mmc_mk_scon(className_utf8.constData()));
6026
6027 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
6028 } catch(std::exception &exception) {
6029 emit throwException(QString("moveClassToTop failed. %1").arg(exception.what()));
6030 }
6031
6032 QString responseLog;
6033 responseLog.append(result ? "true" : "false");
6034 emit logResponse("moveClassToTop("+commandLog+")", responseLog, &commandTime);
6035
6036 return result;
6037}
6038modelica_boolean OMCInterface::moveClass(QString className, modelica_integer offset)
6039{
6040 QTime commandTime;
6041 commandTime.start();
6042 QString commandLog;
6043 commandLog.append(className);
6044 commandLog.append(",");
6045 commandLog.append(QString::number(offset));
6046 emit logCommand("moveClass("+commandLog+")", &commandTime);
6047
6048 QByteArray className_utf8 = className.toUtf8();
6049 modelica_boolean result;
6050
6051 try {
6052 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;
6053
6054 result = omc_OpenModelicaScriptingAPI_moveClass(threadData, mmc_mk_scon(className_utf8.constData()), offset);
6055
6056 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
6057 } catch(std::exception &exception) {
6058 emit throwException(QString("moveClass failed. %1").arg(exception.what()));
6059 }
6060
6061 QString responseLog;
6062 responseLog.append(result ? "true" : "false");
6063 emit logResponse("moveClass("+commandLog+")", responseLog, &commandTime);
6064
6065 return result;
6066}
6067QList<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)
6068{
6069 QTime commandTime;
6070 commandTime.start();
6071 QString commandLog;
6072 commandLog.append(className);
6073 commandLog.append(",");
6074 commandLog.append(QString::number(startTime));
6075 commandLog.append(",");
6076 commandLog.append(QString::number(stopTime));
6077 commandLog.append(",");
6078 commandLog.append(QString::number(numberOfIntervals));
6079 commandLog.append(",");
6080 commandLog.append(QString::number(tolerance));
6081 commandLog.append(",");
6082 commandLog.append("\"" + method + "\"");
6083 commandLog.append(",");
6084 commandLog.append("\"" + fileNamePrefix + "\"");
6085 commandLog.append(",");
6086 commandLog.append("\"" + options + "\"");
6087 commandLog.append(",");
6088 commandLog.append("\"" + outputFormat + "\"");
6089 commandLog.append(",");
6090 commandLog.append("\"" + variableFilter + "\"");
6091 commandLog.append(",");
6092 commandLog.append("\"" + cflags + "\"");
6093 commandLog.append(",");
6094 commandLog.append("\"" + simflags + "\"");
6095 commandLog.append(",");
6096 commandLog.append("\"" + labelstoCancel + "\"");
6097 emit logCommand("reduceTerms("+commandLog+")", &commandTime);
6098
6099 QByteArray className_utf8 = className.toUtf8();
6100 QByteArray method_utf8 = method.toUtf8();
6101 QByteArray fileNamePrefix_utf8 = fileNamePrefix.toUtf8();
6102 QByteArray options_utf8 = options.toUtf8();
6103 QByteArray outputFormat_utf8 = outputFormat.toUtf8();
6104 QByteArray variableFilter_utf8 = variableFilter.toUtf8();
6105 QByteArray cflags_utf8 = cflags.toUtf8();
6106 QByteArray simflags_utf8 = simflags.toUtf8();
6107 QByteArray labelstoCancel_utf8 = labelstoCancel.toUtf8();
6108 QList<QString > result;
6109 void *result_mm = NULL__null;
6110
6111 try {
6112 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;
6113
6114 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()));
6115 result.clear();
6116 while (!listEmpty(result_mm)((*(mmc_uint_t*)((void*)((char*)(result_mm) - 3))) == (((0) <<
10) + (((0) & 255) << 2)))
) {
6117 QString result_elt;
6118 result_elt = MMC_STRINGDATA(MMC_CAR(result_mm))(((struct mmc_string*)((void*)((char*)((*(void**)(((void*)((void
**)(((void*)((char*)(result_mm) - 3))) + (1)))))) - 3)))->
data)
;
6119 result.push_back(result_elt);
6120 result_mm = MMC_CDR(result_mm)(*(void**)(((void*)((void**)(((void*)((char*)(result_mm) - 3)
)) + (2)))))
;
6121 }
6122
6123 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
6124 } catch(std::exception &exception) {
6125 emit throwException(QString("reduceTerms failed. %1").arg(exception.what()));
6126 }
6127
6128 QString responseLog;
6129 responseLog.append("{");
6130 int result_i = 0;
6131 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)
{
6132 if (result_i) {
6133 responseLog.append(",");
6134 }
6135 responseLog.append("\"" + result_elt + "\"");
6136 result_i++;
6137 }
6138 responseLog.append("}");
6139 emit logResponse("reduceTerms("+commandLog+")", responseLog, &commandTime);
6140
6141 return result;
6142}
6143QList<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)
6144{
6145 QTime commandTime;
6146 commandTime.start();
6147 QString commandLog;
6148 commandLog.append(className);
6149 commandLog.append(",");
6150 commandLog.append(QString::number(startTime));
6151 commandLog.append(",");
6152 commandLog.append(QString::number(stopTime));
6153 commandLog.append(",");
6154 commandLog.append(QString::number(numberOfIntervals));
6155 commandLog.append(",");
6156 commandLog.append(QString::number(tolerance));
6157 commandLog.append(",");
6158 commandLog.append("\"" + method + "\"");
6159 commandLog.append(",");
6160 commandLog.append("\"" + fileNamePrefix + "\"");
6161 commandLog.append(",");
6162 commandLog.append("\"" + options + "\"");
6163 commandLog.append(",");
6164 commandLog.append("\"" + outputFormat + "\"");
6165 commandLog.append(",");
6166 commandLog.append("\"" + variableFilter + "\"");
6167 commandLog.append(",");
6168 commandLog.append("\"" + cflags + "\"");
6169 commandLog.append(",");
6170 commandLog.append("\"" + simflags + "\"");
6171 emit logCommand("buildLabel("+commandLog+")", &commandTime);
6172
6173 QByteArray className_utf8 = className.toUtf8();
6174 QByteArray method_utf8 = method.toUtf8();
6175 QByteArray fileNamePrefix_utf8 = fileNamePrefix.toUtf8();
6176 QByteArray options_utf8 = options.toUtf8();
6177 QByteArray outputFormat_utf8 = outputFormat.toUtf8();
6178 QByteArray variableFilter_utf8 = variableFilter.toUtf8();
6179 QByteArray cflags_utf8 = cflags.toUtf8();
6180 QByteArray simflags_utf8 = simflags.toUtf8();
6181 QList<QString > result;
6182 void *result_mm = NULL__null;
6183
6184 try {
6185 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;
6186
6187 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()));
6188 result.clear();
6189 while (!listEmpty(result_mm)((*(mmc_uint_t*)((void*)((char*)(result_mm) - 3))) == (((0) <<
10) + (((0) & 255) << 2)))
) {
6190 QString result_elt;
6191 result_elt = MMC_STRINGDATA(MMC_CAR(result_mm))(((struct mmc_string*)((void*)((char*)((*(void**)(((void*)((void
**)(((void*)((char*)(result_mm) - 3))) + (1)))))) - 3)))->
data)
;
6192 result.push_back(result_elt);
6193 result_mm = MMC_CDR(result_mm)(*(void**)(((void*)((void**)(((void*)((char*)(result_mm) - 3)
)) + (2)))))
;
6194 }
6195
6196 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
6197 } catch(std::exception &exception) {
6198 emit throwException(QString("buildLabel failed. %1").arg(exception.what()));
6199 }
6200
6201 QString responseLog;
6202 responseLog.append("{");
6203 int result_i = 0;
6204 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)
{
6205 if (result_i) {
6206 responseLog.append(",");
6207 }
6208 responseLog.append("\"" + result_elt + "\"");
6209 result_i++;
6210 }
6211 responseLog.append("}");
6212 emit logResponse("buildLabel("+commandLog+")", responseLog, &commandTime);
6213
6214 return result;
6215}
6216modelica_boolean OMCInterface::buildEncryptedPackage(QString className, modelica_boolean encrypt)
6217{
6218 QTime commandTime;
6219 commandTime.start();
6220 QString commandLog;
6221 commandLog.append(className);
6222 commandLog.append(",");
6223 commandLog.append(encrypt ? "true" : "false");
6224 emit logCommand("buildEncryptedPackage("+commandLog+")", &commandTime);
6225
6226 QByteArray className_utf8 = className.toUtf8();
6227 modelica_boolean result;
6228
6229 try {
6230 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;
6231
6232 result = omc_OpenModelicaScriptingAPI_buildEncryptedPackage(threadData, mmc_mk_scon(className_utf8.constData()), encrypt);
6233
6234 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
6235 } catch(std::exception &exception) {
6236 emit throwException(QString("buildEncryptedPackage failed. %1").arg(exception.what()));
6237 }
6238
6239 QString responseLog;
6240 responseLog.append(result ? "true" : "false");
6241 emit logResponse("buildEncryptedPackage("+commandLog+")", responseLog, &commandTime);
6242
6243 return result;
6244}
6245QString OMCInterface::buildModelFMU(QString className, QString version, QString fmuType, QString fileNamePrefix, QList<QString > platforms, modelica_boolean includeResources)
6246{
6247 QTime commandTime;
6248 commandTime.start();
6249 QString commandLog;
6250 commandLog.append(className);
6251 commandLog.append(",");
6252 commandLog.append("\"" + version + "\"");
6253 commandLog.append(",");
6254 commandLog.append("\"" + fmuType + "\"");
6255 commandLog.append(",");
6256 commandLog.append("\"" + fileNamePrefix + "\"");
6257 commandLog.append(",");
6258 commandLog.append("{");
6259 int platforms_i = 0;
6260 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)
{
6261 if (platforms_i) {
6262 commandLog.append(",");
6263 }
6264 commandLog.append("\"" + platforms_elt + "\"");
6265 platforms_i++;
6266 }
6267 commandLog.append("}");commandLog.append(",");
6268 commandLog.append(includeResources ? "true" : "false");
6269 emit logCommand("buildModelFMU("+commandLog+")", &commandTime);
6270
6271 QByteArray className_utf8 = className.toUtf8();
6272 QByteArray version_utf8 = version.toUtf8();
6273 QByteArray fmuType_utf8 = fmuType.toUtf8();
6274 QByteArray fileNamePrefix_utf8 = fileNamePrefix.toUtf8();
6275 void *platforms_lst = mmc_mk_nil()((void*)((char*)(&(mmc_nil).header) + 3));
6276 for (int platforms_i = platforms.size()-1; platforms_i>=0; platforms_i--) {
6277 QString platforms_elt = platforms[platforms_i];
6278 QByteArray platforms_elt_utf8 = platforms_elt.toUtf8();
6279 platforms_lst = mmc_mk_cons(mmc_mk_scon(platforms_elt_utf8.constData()), platforms_lst);
6280 }
6281 QString result;
6282 void *result_mm = NULL__null;
6283
6284 try {
6285 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;
6286
6287 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);
6288 result = QString::fromUtf8(MMC_STRINGDATA(result_mm)(((struct mmc_string*)((void*)((char*)(result_mm) - 3)))->
data)
);
6289
6290 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
6291 } catch(std::exception &exception) {
6292 emit throwException(QString("buildModelFMU failed. %1").arg(exception.what()));
6293 }
6294
6295 QString responseLog;
6296 responseLog.append("\"" + result + "\"");
6297 emit logResponse("buildModelFMU("+commandLog+")", responseLog, &commandTime);
6298
6299 return result;
6300}
6301QString OMCInterface::translateModelFMU(QString className, QString version, QString fmuType, QString fileNamePrefix, modelica_boolean includeResources)
6302{
6303 QTime commandTime;
6304 commandTime.start();
6305 QString commandLog;
6306 commandLog.append(className);
6307 commandLog.append(",");
6308 commandLog.append("\"" + version + "\"");
6309 commandLog.append(",");
6310 commandLog.append("\"" + fmuType + "\"");
6311 commandLog.append(",");
6312 commandLog.append("\"" + fileNamePrefix + "\"");
6313 commandLog.append(",");
6314 commandLog.append(includeResources ? "true" : "false");
6315 emit logCommand("translateModelFMU("+commandLog+")", &commandTime);
6316
6317 QByteArray className_utf8 = className.toUtf8();
6318 QByteArray version_utf8 = version.toUtf8();
6319 QByteArray fmuType_utf8 = fmuType.toUtf8();
6320 QByteArray fileNamePrefix_utf8 = fileNamePrefix.toUtf8();
6321 QString result;
6322 void *result_mm = NULL__null;
6323
6324 try {
6325 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;
6326
6327 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);
6328 result = QString::fromUtf8(MMC_STRINGDATA(result_mm)(((struct mmc_string*)((void*)((char*)(result_mm) - 3)))->
data)
);
6329
6330 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
6331 } catch(std::exception &exception) {
6332 emit throwException(QString("translateModelFMU failed. %1").arg(exception.what()));
6333 }
6334
6335 QString responseLog;
6336 responseLog.append("\"" + result + "\"");
6337 emit logResponse("translateModelFMU("+commandLog+")", responseLog, &commandTime);
6338
6339 return result;
6340}
6341QString OMCInterface::importFMUModelDescription(QString filename, QString workdir, modelica_integer loglevel, modelica_boolean fullPath, modelica_boolean debugLogging, modelica_boolean generateInputConnectors, modelica_boolean generateOutputConnectors)
6342{
6343 QTime commandTime;
6344 commandTime.start();
6345 QString commandLog;
6346 commandLog.append("\"" + filename + "\"");
6347 commandLog.append(",");
6348 commandLog.append("\"" + workdir + "\"");
6349 commandLog.append(",");
6350 commandLog.append(QString::number(loglevel));
6351 commandLog.append(",");
6352 commandLog.append(fullPath ? "true" : "false");
6353 commandLog.append(",");
6354 commandLog.append(debugLogging ? "true" : "false");
6355 commandLog.append(",");
6356 commandLog.append(generateInputConnectors ? "true" : "false");
6357 commandLog.append(",");
6358 commandLog.append(generateOutputConnectors ? "true" : "false");
6359 emit logCommand("importFMUModelDescription("+commandLog+")", &commandTime);
6360
6361 QByteArray filename_utf8 = filename.toUtf8();
6362 QByteArray workdir_utf8 = workdir.toUtf8();
6363 QString result;
6364 void *result_mm = NULL__null;
6365
6366 try {
6367 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;
6368
6369 result_mm = omc_OpenModelicaScriptingAPI_importFMUModelDescription(threadData, mmc_mk_scon(filename_utf8.constData()), mmc_mk_scon(workdir_utf8.constData()), loglevel, fullPath, debugLogging, generateInputConnectors, generateOutputConnectors);
6370 result = QString::fromUtf8(MMC_STRINGDATA(result_mm)(((struct mmc_string*)((void*)((char*)(result_mm) - 3)))->
data)
);
6371
6372 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
6373 } catch(std::exception &exception) {
6374 emit throwException(QString("importFMUModelDescription failed. %1").arg(exception.what()));
6375 }
6376
6377 QString responseLog;
6378 responseLog.append("\"" + result + "\"");
6379 emit logResponse("importFMUModelDescription("+commandLog+")", responseLog, &commandTime);
6380
6381 return result;
6382}
6383QString OMCInterface::importFMU(QString filename, QString workdir, modelica_integer loglevel, modelica_boolean fullPath, modelica_boolean debugLogging, modelica_boolean generateInputConnectors, modelica_boolean generateOutputConnectors)
6384{
6385 QTime commandTime;
6386 commandTime.start();
6387 QString commandLog;
6388 commandLog.append("\"" + filename + "\"");
6389 commandLog.append(",");
6390 commandLog.append("\"" + workdir + "\"");
6391 commandLog.append(",");
6392 commandLog.append(QString::number(loglevel));
6393 commandLog.append(",");
6394 commandLog.append(fullPath ? "true" : "false");
6395 commandLog.append(",");
6396 commandLog.append(debugLogging ? "true" : "false");
6397 commandLog.append(",");
6398 commandLog.append(generateInputConnectors ? "true" : "false");
6399 commandLog.append(",");
6400 commandLog.append(generateOutputConnectors ? "true" : "false");
6401 emit logCommand("importFMU("+commandLog+")", &commandTime);
6402
6403 QByteArray filename_utf8 = filename.toUtf8();
6404 QByteArray workdir_utf8 = workdir.toUtf8();
6405 QString result;
6406 void *result_mm = NULL__null;
6407
6408 try {
6409 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;
6410
6411 result_mm = omc_OpenModelicaScriptingAPI_importFMU(threadData, mmc_mk_scon(filename_utf8.constData()), mmc_mk_scon(workdir_utf8.constData()), loglevel, fullPath, debugLogging, generateInputConnectors, generateOutputConnectors);
6412 result = QString::fromUtf8(MMC_STRINGDATA(result_mm)(((struct mmc_string*)((void*)((char*)(result_mm) - 3)))->
data)
);
6413
6414 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
6415 } catch(std::exception &exception) {
6416 emit throwException(QString("importFMU failed. %1").arg(exception.what()));
6417 }
6418
6419 QString responseLog;
6420 responseLog.append("\"" + result + "\"");
6421 emit logResponse("importFMU("+commandLog+")", responseLog, &commandTime);
6422
6423 return result;
6424}
6425QList<QList<QString > > OMCInterface::getLoadedLibraries()
6426{
6427 QTime commandTime;
6428 commandTime.start();
6429 emit logCommand("getLoadedLibraries()", &commandTime);
6430
6431 QList<QList<QString > > result;
6432 void *result_mm = NULL__null;
6433
6434 try {
6435 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;
6436
6437 result_mm = omc_OpenModelicaScriptingAPI_getLoadedLibraries(threadData);
6438 result.clear();
6439 while (!listEmpty(result_mm)((*(mmc_uint_t*)((void*)((char*)(result_mm) - 3))) == (((0) <<
10) + (((0) & 255) << 2)))
) {
6440 QList<QString > result_elt;
6441 result_elt.clear();
6442 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)))
) {
6443 QString result_elt_elt;
6444 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)
;
6445 result_elt.push_back(result_elt_elt);
6446 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)))))
;
6447 }
6448 result.push_back(result_elt);
6449 result_mm = MMC_CDR(result_mm)(*(void**)(((void*)((void**)(((void*)((char*)(result_mm) - 3)
)) + (2)))))
;
6450 }
6451
6452 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
6453 } catch(std::exception &exception) {
6454 emit throwException(QString("getLoadedLibraries failed. %1").arg(exception.what()));
6455 }
6456
6457 QString responseLog;
6458 responseLog.append("{");
6459 int result_i = 0;
6460 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)
{
6461 if (result_i) {
6462 responseLog.append(",");
6463 }
6464 responseLog.append("{");
6465 int result_elt_i = 0;
6466 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)
{
6467 if (result_elt_i) {
6468 responseLog.append(",");
6469 }
6470 responseLog.append("\"" + result_elt_elt + "\"");
6471 result_elt_i++;
6472 }
6473 responseLog.append("}");
6474 result_i++;
6475 }
6476 responseLog.append("}");
6477 emit logResponse("getLoadedLibraries()", responseLog, &commandTime);
6478
6479 return result;
6480}
6481QString OMCInterface::uriToFilename(QString uri)
6482{
6483 QTime commandTime;
6484 commandTime.start();
6485 QString commandLog;
6486 commandLog.append("\"" + uri + "\"");
6487 emit logCommand("uriToFilename("+commandLog+")", &commandTime);
6488
6489 QByteArray uri_utf8 = uri.toUtf8();
6490 QString result;
6491 void *result_mm = NULL__null;
6492
6493 try {
6494 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;
6495
6496 result_mm = omc_OpenModelicaScriptingAPI_uriToFilename(threadData, mmc_mk_scon(uri_utf8.constData()));
6497 result = QString::fromUtf8(MMC_STRINGDATA(result_mm)(((struct mmc_string*)((void*)((char*)(result_mm) - 3)))->
data)
);
6498
6499 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
6500 } catch(std::exception &exception) {
6501 emit throwException(QString("uriToFilename failed. %1").arg(exception.what()));
6502 }
6503
6504 QString responseLog;
6505 responseLog.append("\"" + result + "\"");
6506 emit logResponse("uriToFilename("+commandLog+")", responseLog, &commandTime);
6507
6508 return result;
6509}
6510modelica_boolean OMCInterface::rewriteBlockCall(QString className, QString inDefs)
6511{
6512 QTime commandTime;
6513 commandTime.start();
6514 QString commandLog;
6515 commandLog.append(className);
6516 commandLog.append(",");
6517 commandLog.append(inDefs);
6518 emit logCommand("rewriteBlockCall("+commandLog+")", &commandTime);
6519
6520 QByteArray className_utf8 = className.toUtf8();
6521 QByteArray inDefs_utf8 = inDefs.toUtf8();
6522 modelica_boolean result;
6523
6524 try {
6525 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;
6526
6527 result = omc_OpenModelicaScriptingAPI_rewriteBlockCall(threadData, mmc_mk_scon(className_utf8.constData()), mmc_mk_scon(inDefs_utf8.constData()));
6528
6529 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
6530 } catch(std::exception &exception) {
6531 emit throwException(QString("rewriteBlockCall failed. %1").arg(exception.what()));
6532 }
6533
6534 QString responseLog;
6535 responseLog.append(result ? "true" : "false");
6536 emit logResponse("rewriteBlockCall("+commandLog+")", responseLog, &commandTime);
6537
6538 return result;
6539}
6540modelica_boolean OMCInterface::generateVerificationScenarios(QString path)
6541{
6542 QTime commandTime;
6543 commandTime.start();
6544 QString commandLog;
6545 commandLog.append(path);
6546 emit logCommand("generateVerificationScenarios("+commandLog+")", &commandTime);
6547
6548 QByteArray path_utf8 = path.toUtf8();
6549 modelica_boolean result;
6550
6551 try {
6552 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;
6553
6554 result = omc_OpenModelicaScriptingAPI_generateVerificationScenarios(threadData, mmc_mk_scon(path_utf8.constData()));
6555
6556 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
6557 } catch(std::exception &exception) {
6558 emit throwException(QString("generateVerificationScenarios failed. %1").arg(exception.what()));
6559 }
6560
6561 QString responseLog;
6562 responseLog.append(result ? "true" : "false");
6563 emit logResponse("generateVerificationScenarios("+commandLog+")", responseLog, &commandTime);
6564
6565 return result;
6566}
6567modelica_boolean OMCInterface::inferBindings(QString path)
6568{
6569 QTime commandTime;
6570 commandTime.start();
6571 QString commandLog;
6572 commandLog.append(path);
6573 emit logCommand("inferBindings("+commandLog+")", &commandTime);
6574
6575 QByteArray path_utf8 = path.toUtf8();
6576 modelica_boolean result;
6577
6578 try {
6579 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;
6580
6581 result = omc_OpenModelicaScriptingAPI_inferBindings(threadData, mmc_mk_scon(path_utf8.constData()));
6582
6583 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
6584 } catch(std::exception &exception) {
6585 emit throwException(QString("inferBindings failed. %1").arg(exception.what()));
6586 }
6587
6588 QString responseLog;
6589 responseLog.append(result ? "true" : "false");
6590 emit logResponse("inferBindings("+commandLog+")", responseLog, &commandTime);
6591
6592 return result;
6593}
6594modelica_boolean OMCInterface::exportToFigaro(QString path, QString directory, QString database, QString mode, QString options, QString processor)
6595{
6596 QTime commandTime;
6597 commandTime.start();
6598 QString commandLog;
6599 commandLog.append(path);
6600 commandLog.append(",");
6601 commandLog.append("\"" + directory + "\"");
6602 commandLog.append(",");
6603 commandLog.append("\"" + database + "\"");
6604 commandLog.append(",");
6605 commandLog.append("\"" + mode + "\"");
6606 commandLog.append(",");
6607 commandLog.append("\"" + options + "\"");
6608 commandLog.append(",");
6609 commandLog.append("\"" + processor + "\"");
6610 emit logCommand("exportToFigaro("+commandLog+")", &commandTime);
6611
6612 QByteArray path_utf8 = path.toUtf8();
6613 QByteArray directory_utf8 = directory.toUtf8();
6614 QByteArray database_utf8 = database.toUtf8();
6615 QByteArray mode_utf8 = mode.toUtf8();
6616 QByteArray options_utf8 = options.toUtf8();
6617 QByteArray processor_utf8 = processor.toUtf8();
6618 modelica_boolean result;
6619
6620 try {
6621 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;
6622
6623 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()));
6624
6625 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
6626 } catch(std::exception &exception) {
6627 emit throwException(QString("exportToFigaro failed. %1").arg(exception.what()));
6628 }
6629
6630 QString responseLog;
6631 responseLog.append(result ? "true" : "false");
6632 emit logResponse("exportToFigaro("+commandLog+")", responseLog, &commandTime);
6633
6634 return result;
6635}
6636QString OMCInterface::listFile(QString class_, modelica_boolean nestedClasses)
6637{
6638 QTime commandTime;
6639 commandTime.start();
6640 QString commandLog;
6641 commandLog.append(class_);
6642 commandLog.append(",");
6643 commandLog.append(nestedClasses ? "true" : "false");
6644 emit logCommand("listFile("+commandLog+")", &commandTime);
6645
6646 QByteArray class__utf8 = class_.toUtf8();
6647 QString result;
6648 void *result_mm = NULL__null;
6649
6650 try {
6651 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;
6652
6653 result_mm = omc_OpenModelicaScriptingAPI_listFile(threadData, mmc_mk_scon(class__utf8.constData()), nestedClasses);
6654 result = QString::fromUtf8(MMC_STRINGDATA(result_mm)(((struct mmc_string*)((void*)((char*)(result_mm) - 3)))->
data)
);
6655
6656 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
6657 } catch(std::exception &exception) {
6658 emit throwException(QString("listFile failed. %1").arg(exception.what()));
6659 }
6660
6661 QString responseLog;
6662 responseLog.append("\"" + result + "\"");
6663 emit logResponse("listFile("+commandLog+")", responseLog, &commandTime);
6664
6665 return result;
6666}
6667QString OMCInterface::stringReplace(QString str, QString source, QString target)
6668{
6669 QTime commandTime;
6670 commandTime.start();
6671 QString commandLog;
6672 commandLog.append("\"" + str + "\"");
6673 commandLog.append(",");
6674 commandLog.append("\"" + source + "\"");
6675 commandLog.append(",");
6676 commandLog.append("\"" + target + "\"");
6677 emit logCommand("stringReplace("+commandLog+")", &commandTime);
6678
6679 QByteArray str_utf8 = str.toUtf8();
6680 QByteArray source_utf8 = source.toUtf8();
6681 QByteArray target_utf8 = target.toUtf8();
6682 QString result;
6683 void *result_mm = NULL__null;
6684
6685 try {
6686 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;
6687
6688 result_mm = omc_OpenModelicaScriptingAPI_stringReplace(threadData, mmc_mk_scon(str_utf8.constData()), mmc_mk_scon(source_utf8.constData()), mmc_mk_scon(target_utf8.constData()));
6689 result = QString::fromUtf8(MMC_STRINGDATA(result_mm)(((struct mmc_string*)((void*)((char*)(result_mm) - 3)))->
data)
);
6690
6691 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
6692 } catch(std::exception &exception) {
6693 emit throwException(QString("stringReplace failed. %1").arg(exception.what()));
6694 }
6695
6696 QString responseLog;
6697 responseLog.append("\"" + result + "\"");
6698 emit logResponse("stringReplace("+commandLog+")", responseLog, &commandTime);
6699
6700 return result;
6701}
6702QList<QString > OMCInterface::stringSplit(QString string, QString token)
6703{
6704 QTime commandTime;
6705 commandTime.start();
6706 QString commandLog;
6707 commandLog.append("\"" + string + "\"");
6708 commandLog.append(",");
6709 commandLog.append("\"" + token + "\"");
6710 emit logCommand("stringSplit("+commandLog+")", &commandTime);
6711
6712 QByteArray string_utf8 = string.toUtf8();
6713 QByteArray token_utf8 = token.toUtf8();
6714 QList<QString > result;
6715 void *result_mm = NULL__null;
6716
6717 try {
6718 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;
6719
6720 result_mm = omc_OpenModelicaScriptingAPI_stringSplit(threadData, mmc_mk_scon(string_utf8.constData()), mmc_mk_scon(token_utf8.constData()));
6721 result.clear();
6722 while (!listEmpty(result_mm)((*(mmc_uint_t*)((void*)((char*)(result_mm) - 3))) == (((0) <<
10) + (((0) & 255) << 2)))
) {
6723 QString result_elt;
6724 result_elt = MMC_STRINGDATA(MMC_CAR(result_mm))(((struct mmc_string*)((void*)((char*)((*(void**)(((void*)((void
**)(((void*)((char*)(result_mm) - 3))) + (1)))))) - 3)))->
data)
;
6725 result.push_back(result_elt);
6726 result_mm = MMC_CDR(result_mm)(*(void**)(((void*)((void**)(((void*)((char*)(result_mm) - 3)
)) + (2)))))
;
6727 }
6728
6729 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
6730 } catch(std::exception &exception) {
6731 emit throwException(QString("stringSplit failed. %1").arg(exception.what()));
6732 }
6733
6734 QString responseLog;
6735 responseLog.append("{");
6736 int result_i = 0;
6737 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)
{
6738 if (result_i) {
6739 responseLog.append(",");
6740 }
6741 responseLog.append("\"" + result_elt + "\"");
6742 result_i++;
6743 }
6744 responseLog.append("}");
6745 emit logResponse("stringSplit("+commandLog+")", responseLog, &commandTime);
6746
6747 return result;
6748}
6749QList<QString > OMCInterface::strtok(QString string, QString token)
6750{
6751 QTime commandTime;
6752 commandTime.start();
6753 QString commandLog;
6754 commandLog.append("\"" + string + "\"");
6755 commandLog.append(",");
6756 commandLog.append("\"" + token + "\"");
6757 emit logCommand("strtok("+commandLog+")", &commandTime);
6758
6759 QByteArray string_utf8 = string.toUtf8();
6760 QByteArray token_utf8 = token.toUtf8();
6761 QList<QString > result;
6762 void *result_mm = NULL__null;
6763
6764 try {
6765 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;
6766
6767 result_mm = omc_OpenModelicaScriptingAPI_strtok(threadData, mmc_mk_scon(string_utf8.constData()), mmc_mk_scon(token_utf8.constData()));
6768 result.clear();
6769 while (!listEmpty(result_mm)((*(mmc_uint_t*)((void*)((char*)(result_mm) - 3))) == (((0) <<
10) + (((0) & 255) << 2)))
) {
6770 QString result_elt;
6771 result_elt = MMC_STRINGDATA(MMC_CAR(result_mm))(((struct mmc_string*)((void*)((char*)((*(void**)(((void*)((void
**)(((void*)((char*)(result_mm) - 3))) + (1)))))) - 3)))->
data)
;
6772 result.push_back(result_elt);
6773 result_mm = MMC_CDR(result_mm)(*(void**)(((void*)((void**)(((void*)((char*)(result_mm) - 3)
)) + (2)))))
;
6774 }
6775
6776 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
6777 } catch(std::exception &exception) {
6778 emit throwException(QString("strtok failed. %1").arg(exception.what()));
6779 }
6780
6781 QString responseLog;
6782 responseLog.append("{");
6783 int result_i = 0;
6784 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)
{
6785 if (result_i) {
6786 responseLog.append(",");
6787 }
6788 responseLog.append("\"" + result_elt + "\"");
6789 result_i++;
6790 }
6791 responseLog.append("}");
6792 emit logResponse("strtok("+commandLog+")", responseLog, &commandTime);
6793
6794 return result;
6795}
6796QList<QString > OMCInterface::listVariables()
6797{
6798 QTime commandTime;
6799 commandTime.start();
6800 emit logCommand("listVariables()", &commandTime);
6801
6802 QList<QString > result;
6803 void *result_mm = NULL__null;
6804
6805 try {
6806 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;
6807
6808 result_mm = omc_OpenModelicaScriptingAPI_listVariables(threadData);
6809 result.clear();
6810 while (!listEmpty(result_mm)((*(mmc_uint_t*)((void*)((char*)(result_mm) - 3))) == (((0) <<
10) + (((0) & 255) << 2)))
) {
6811 QString result_elt;
6812 result_elt = MMC_STRINGDATA(MMC_CAR(result_mm))(((struct mmc_string*)((void*)((char*)((*(void**)(((void*)((void
**)(((void*)((char*)(result_mm) - 3))) + (1)))))) - 3)))->
data)
;
6813 result.push_back(result_elt);
6814 result_mm = MMC_CDR(result_mm)(*(void**)(((void*)((void**)(((void*)((char*)(result_mm) - 3)
)) + (2)))))
;
6815 }
6816
6817 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
6818 } catch(std::exception &exception) {
6819 emit throwException(QString("listVariables failed. %1").arg(exception.what()));
6820 }
6821
6822 QString responseLog;
6823 responseLog.append("{");
6824 int result_i = 0;
6825 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)
{
6826 if (result_i) {
6827 responseLog.append(",");
6828 }
6829 responseLog.append(result_elt);
6830 result_i++;
6831 }
6832 responseLog.append("}");
6833 emit logResponse("listVariables()", responseLog, &commandTime);
6834
6835 return result;
6836}
6837QList<QString > OMCInterface::getDerivedUnits(QString baseUnit)
6838{
6839 QTime commandTime;
6840 commandTime.start();
6841 QString commandLog;
6842 commandLog.append("\"" + baseUnit + "\"");
6843 emit logCommand("getDerivedUnits("+commandLog+")", &commandTime);
6844
6845 QByteArray baseUnit_utf8 = baseUnit.toUtf8();
6846 QList<QString > result;
6847 void *result_mm = NULL__null;
6848
6849 try {
6850 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;
6851
6852 result_mm = omc_OpenModelicaScriptingAPI_getDerivedUnits(threadData, mmc_mk_scon(baseUnit_utf8.constData()));
6853 result.clear();
6854 while (!listEmpty(result_mm)((*(mmc_uint_t*)((void*)((char*)(result_mm) - 3))) == (((0) <<
10) + (((0) & 255) << 2)))
) {
6855 QString result_elt;
6856 result_elt = MMC_STRINGDATA(MMC_CAR(result_mm))(((struct mmc_string*)((void*)((char*)((*(void**)(((void*)((void
**)(((void*)((char*)(result_mm) - 3))) + (1)))))) - 3)))->
data)
;
6857 result.push_back(result_elt);
6858 result_mm = MMC_CDR(result_mm)(*(void**)(((void*)((void**)(((void*)((char*)(result_mm) - 3)
)) + (2)))))
;
6859 }
6860
6861 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
6862 } catch(std::exception &exception) {
6863 emit throwException(QString("getDerivedUnits failed. %1").arg(exception.what()));
6864 }
6865
6866 QString responseLog;
6867 responseLog.append("{");
6868 int result_i = 0;
6869 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)
{
6870 if (result_i) {
6871 responseLog.append(",");
6872 }
6873 responseLog.append("\"" + result_elt + "\"");
6874 result_i++;
6875 }
6876 responseLog.append("}");
6877 emit logResponse("getDerivedUnits("+commandLog+")", responseLog, &commandTime);
6878
6879 return result;
6880}
6881OMCInterface::convertUnits_res OMCInterface::convertUnits(QString s1, QString s2)
6882{
6883 QTime commandTime;
6884 commandTime.start();
6885 QString commandLog;
6886 commandLog.append("\"" + s1 + "\"");
6887 commandLog.append(",");
6888 commandLog.append("\"" + s2 + "\"");
6889 emit logCommand("convertUnits("+commandLog+")", &commandTime);
6890
6891 QByteArray s1_utf8 = s1.toUtf8();
6892 QByteArray s2_utf8 = s2.toUtf8();
6893 convertUnits_res result;
6894
6895 try {
6896 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;
6897
6898 result.unitsCompatible = omc_OpenModelicaScriptingAPI_convertUnits(threadData, mmc_mk_scon(s1_utf8.constData()), mmc_mk_scon(s2_utf8.constData()), &result.scaleFactor, &result.offset);
6899
6900 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
6901 } catch(std::exception &exception) {
6902 emit throwException(QString("convertUnits failed. %1").arg(exception.what()));
6903 }
6904
6905 QString responseLog;
6906 responseLog.append(result.toString());
6907 emit logResponse("convertUnits("+commandLog+")", responseLog, &commandTime);
6908
6909 return result;
6910}
6911OMCInterface::dumpXMLDAE_res OMCInterface::dumpXMLDAE(QString className, QString translationLevel, modelica_boolean addOriginalAdjacencyMatrix, modelica_boolean addSolvingInfo, modelica_boolean addMathMLCode, modelica_boolean dumpResiduals, QString fileNamePrefix, QString rewriteRulesFile)
6912{
6913 QTime commandTime;
6914 commandTime.start();
6915 QString commandLog;
6916 commandLog.append(className);
6917 commandLog.append(",");
6918 commandLog.append("\"" + translationLevel + "\"");
6919 commandLog.append(",");
6920 commandLog.append(addOriginalAdjacencyMatrix ? "true" : "false");
6921 commandLog.append(",");
6922 commandLog.append(addSolvingInfo ? "true" : "false");
6923 commandLog.append(",");
6924 commandLog.append(addMathMLCode ? "true" : "false");
6925 commandLog.append(",");
6926 commandLog.append(dumpResiduals ? "true" : "false");
6927 commandLog.append(",");
6928 commandLog.append("\"" + fileNamePrefix + "\"");
6929 commandLog.append(",");
6930 commandLog.append("\"" + rewriteRulesFile + "\"");
6931 emit logCommand("dumpXMLDAE("+commandLog+")", &commandTime);
6932
6933 QByteArray className_utf8 = className.toUtf8();
6934 QByteArray translationLevel_utf8 = translationLevel.toUtf8();
6935 QByteArray fileNamePrefix_utf8 = fileNamePrefix.toUtf8();
6936 QByteArray rewriteRulesFile_utf8 = rewriteRulesFile.toUtf8();
6937 dumpXMLDAE_res result;
6938 void *out2_mm = NULL__null;
6939
6940 try {
6941 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;
6942
6943 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);
6944 result.xmlfileName = QString::fromUtf8(MMC_STRINGDATA(out2_mm)(((struct mmc_string*)((void*)((char*)(out2_mm) - 3)))->data
)
);
6945
6946 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
6947 } catch(std::exception &exception) {
6948 emit throwException(QString("dumpXMLDAE failed. %1").arg(exception.what()));
6949 }
6950
6951 QString responseLog;
6952 responseLog.append(result.toString());
6953 emit logResponse("dumpXMLDAE("+commandLog+")", responseLog, &commandTime);
6954
6955 return result;
6956}
6957QString OMCInterface::translateGraphics(QString className)
6958{
6959 QTime commandTime;
6960 commandTime.start();
6961 QString commandLog;
6962 commandLog.append(className);
6963 emit logCommand("translateGraphics("+commandLog+")", &commandTime);
6964
6965 QByteArray className_utf8 = className.toUtf8();
6966 QString result;
6967 void *result_mm = NULL__null;
6968
6969 try {
6970 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;
6971
6972 result_mm = omc_OpenModelicaScriptingAPI_translateGraphics(threadData, mmc_mk_scon(className_utf8.constData()));
6973 result = QString::fromUtf8(MMC_STRINGDATA(result_mm)(((struct mmc_string*)((void*)((char*)(result_mm) - 3)))->
data)
);
6974
6975 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
6976 } catch(std::exception &exception) {
6977 emit throwException(QString("translateGraphics failed. %1").arg(exception.what()));
6978 }
6979
6980 QString responseLog;
6981 responseLog.append("\"" + result + "\"");
6982 emit logResponse("translateGraphics("+commandLog+")", responseLog, &commandTime);
6983
6984 return result;
6985}
6986modelica_boolean OMCInterface::save(QString className)
6987{
6988 QTime commandTime;
6989 commandTime.start();
6990 QString commandLog;
6991 commandLog.append(className);
6992 emit logCommand("save("+commandLog+")", &commandTime);
6993
6994 QByteArray className_utf8 = className.toUtf8();
6995 modelica_boolean result;
6996
6997 try {
6998 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;
6999
7000 result = omc_OpenModelicaScriptingAPI_save(threadData, mmc_mk_scon(className_utf8.constData()));
7001
7002 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
7003 } catch(std::exception &exception) {
7004 emit throwException(QString("save failed. %1").arg(exception.what()));
7005 }
7006
7007 QString responseLog;
7008 responseLog.append(result ? "true" : "false");
7009 emit logResponse("save("+commandLog+")", responseLog, &commandTime);
7010
7011 return result;
7012}
7013modelica_boolean OMCInterface::saveTotalModel(QString fileName, QString className, modelica_boolean stripAnnotations, modelica_boolean stripComments)
7014{
7015 QTime commandTime;
7016 commandTime.start();
7017 QString commandLog;
7018 commandLog.append("\"" + fileName + "\"");
7019 commandLog.append(",");
7020 commandLog.append(className);
7021 commandLog.append(",");
7022 commandLog.append(stripAnnotations ? "true" : "false");
7023 commandLog.append(",");
7024 commandLog.append(stripComments ? "true" : "false");
7025 emit logCommand("saveTotalModel("+commandLog+")", &commandTime);
7026
7027 QByteArray fileName_utf8 = fileName.toUtf8();
7028 QByteArray className_utf8 = className.toUtf8();
7029 modelica_boolean result;
7030
7031 try {
7032 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;
7033
7034 result = omc_OpenModelicaScriptingAPI_saveTotalModel(threadData, mmc_mk_scon(fileName_utf8.constData()), mmc_mk_scon(className_utf8.constData()), stripAnnotations, stripComments);
7035
7036 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
7037 } catch(std::exception &exception) {
7038 emit throwException(QString("saveTotalModel failed. %1").arg(exception.what()));
7039 }
7040
7041 QString responseLog;
7042 responseLog.append(result ? "true" : "false");
7043 emit logResponse("saveTotalModel("+commandLog+")", responseLog, &commandTime);
7044
7045 return result;
7046}
7047modelica_boolean OMCInterface::saveModel(QString fileName, QString className)
7048{
7049 QTime commandTime;
7050 commandTime.start();
7051 QString commandLog;
7052 commandLog.append("\"" + fileName + "\"");
7053 commandLog.append(",");
7054 commandLog.append(className);
7055 emit logCommand("saveModel("+commandLog+")", &commandTime);
7056
7057 QByteArray fileName_utf8 = fileName.toUtf8();
7058 QByteArray className_utf8 = className.toUtf8();
7059 modelica_boolean result;
7060
7061 try {
7062 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;
7063
7064 result = omc_OpenModelicaScriptingAPI_saveModel(threadData, mmc_mk_scon(fileName_utf8.constData()), mmc_mk_scon(className_utf8.constData()));
7065
7066 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
7067 } catch(std::exception &exception) {
7068 emit throwException(QString("saveModel failed. %1").arg(exception.what()));
7069 }
7070
7071 QString responseLog;
7072 responseLog.append(result ? "true" : "false");
7073 emit logResponse("saveModel("+commandLog+")", responseLog, &commandTime);
7074
7075 return result;
7076}
7077modelica_boolean OMCInterface::deleteFile(QString fileName)
7078{
7079 QTime commandTime;
7080 commandTime.start();
7081 QString commandLog;
7082 commandLog.append("\"" + fileName + "\"");
7083 emit logCommand("deleteFile("+commandLog+")", &commandTime);
7084
7085 QByteArray fileName_utf8 = fileName.toUtf8();
7086 modelica_boolean result;
7087
7088 try {
7089 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;
7090
7091 result = omc_OpenModelicaScriptingAPI_deleteFile(threadData, mmc_mk_scon(fileName_utf8.constData()));
7092
7093 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
7094 } catch(std::exception &exception) {
7095 emit throwException(QString("deleteFile failed. %1").arg(exception.what()));
7096 }
7097
7098 QString responseLog;
7099 responseLog.append(result ? "true" : "false");
7100 emit logResponse("deleteFile("+commandLog+")", responseLog, &commandTime);
7101
7102 return result;
7103}
7104modelica_boolean OMCInterface::loadModel(QString className, QList<QString > priorityVersion, modelica_boolean notify, QString languageStandard, modelica_boolean requireExactVersion)
7105{
7106 QTime commandTime;
7107 commandTime.start();
7108 QString commandLog;
7109 commandLog.append(className);
7110 commandLog.append(",");
7111 commandLog.append("{");
7112 int priorityVersion_i = 0;
7113 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)
{
7114 if (priorityVersion_i) {
7115 commandLog.append(",");
7116 }
7117 commandLog.append("\"" + priorityVersion_elt + "\"");
7118 priorityVersion_i++;
7119 }
7120 commandLog.append("}");commandLog.append(",");
7121 commandLog.append(notify ? "true" : "false");
7122 commandLog.append(",");
7123 commandLog.append("\"" + languageStandard + "\"");
7124 commandLog.append(",");
7125 commandLog.append(requireExactVersion ? "true" : "false");
7126 emit logCommand("loadModel("+commandLog+")", &commandTime);
7127
7128 QByteArray className_utf8 = className.toUtf8();
7129 void *priorityVersion_lst = mmc_mk_nil()((void*)((char*)(&(mmc_nil).header) + 3));
7130 for (int priorityVersion_i = priorityVersion.size()-1; priorityVersion_i>=0; priorityVersion_i--) {
7131 QString priorityVersion_elt = priorityVersion[priorityVersion_i];
7132 QByteArray priorityVersion_elt_utf8 = priorityVersion_elt.toUtf8();
7133 priorityVersion_lst = mmc_mk_cons(mmc_mk_scon(priorityVersion_elt_utf8.constData()), priorityVersion_lst);
7134 }
7135 QByteArray languageStandard_utf8 = languageStandard.toUtf8();
7136 modelica_boolean result;
7137
7138 try {
7139 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;
7140
7141 result = omc_OpenModelicaScriptingAPI_loadModel(threadData, mmc_mk_scon(className_utf8.constData()), priorityVersion_lst, notify, mmc_mk_scon(languageStandard_utf8.constData()), requireExactVersion);
7142
7143 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
7144 } catch(std::exception &exception) {
7145 emit throwException(QString("loadModel failed. %1").arg(exception.what()));
7146 }
7147
7148 QString responseLog;
7149 responseLog.append(result ? "true" : "false");
7150 emit logResponse("loadModel("+commandLog+")", responseLog, &commandTime);
7151
7152 return result;
7153}
7154modelica_boolean OMCInterface::generateCode(QString className)
7155{
7156 QTime commandTime;
7157 commandTime.start();
7158 QString commandLog;
7159 commandLog.append(className);
7160 emit logCommand("generateCode("+commandLog+")", &commandTime);
7161
7162 QByteArray className_utf8 = className.toUtf8();
7163 modelica_boolean result;
7164
7165 try {
7166 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;
7167
7168 result = omc_OpenModelicaScriptingAPI_generateCode(threadData, mmc_mk_scon(className_utf8.constData()));
7169
7170 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
7171 } catch(std::exception &exception) {
7172 emit throwException(QString("generateCode failed. %1").arg(exception.what()));
7173 }
7174
7175 QString responseLog;
7176 responseLog.append(result ? "true" : "false");
7177 emit logResponse("generateCode("+commandLog+")", responseLog, &commandTime);
7178
7179 return result;
7180}
7181QString OMCInterface::runOpenTURNSPythonScript(QString pythonScriptFile)
7182{
7183 QTime commandTime;
7184 commandTime.start();
7185 QString commandLog;
7186 commandLog.append("\"" + pythonScriptFile + "\"");
7187 emit logCommand("runOpenTURNSPythonScript("+commandLog+")", &commandTime);
7188
7189 QByteArray pythonScriptFile_utf8 = pythonScriptFile.toUtf8();
7190 QString result;
7191 void *result_mm = NULL__null;
7192
7193 try {
7194 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;
7195
7196 result_mm = omc_OpenModelicaScriptingAPI_runOpenTURNSPythonScript(threadData, mmc_mk_scon(pythonScriptFile_utf8.constData()));
7197 result = QString::fromUtf8(MMC_STRINGDATA(result_mm)(((struct mmc_string*)((void*)((char*)(result_mm) - 3)))->
data)
);
7198
7199 MMC_CATCH_TOP()pthread_setspecific(mmc_thread_data_key,oldThreadData); } else
{pthread_setspecific(mmc_thread_data_key,oldThreadData);;}}}
7200 } catch(std::exception &exception) {
7201 emit throwException(QString("runOpenTURNSPythonScript failed. %1").arg(exception.what()));
7202 }
7203
7204 QString responseLog;
7205 responseLog.append("\"" + result + "\"");
7206 emit logResponse("runOpenTURNSPythonScript("+commandLog+")", responseLog, &commandTime);
7207
7208 return result;
7209}
7210QString OMCInterface::buildOpenTURNSInterface(QString className, QString pythonTemplateFile, modelica_boolean showFlatModelica)
7211{
7212 QTime commandTime;
7213 commandTime.start();
7214 QString commandLog;
7215 commandLog.append(className);
7216 commandLog.append(",");
7217 commandLog.append("\"" + pythonTemplateFile + "\"");
7218 commandLog.append(",");
7219 commandLog.append(showFlatModelica ? "true" : "false");
7220 emit logCommand("buildOpenTURNSInterface("+commandLog+")", &commandTime);
7221
7222 QByteArray className_utf8 = className.toUtf8();
7223 QByteArray pythonTemplateFile_utf8 = pythonTemplateFile.toUtf8();
7224