-
Notifications
You must be signed in to change notification settings - Fork 299
/
Helper.cpp
640 lines (633 loc) · 28 KB
/
Helper.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
/*
* This file is part of OpenModelica.
*
* Copyright (c) 1998-2014, Open Source Modelica Consortium (OSMC),
* c/o Linköpings universitet, Department of Computer and Information Science,
* SE-58183 Linköping, Sweden.
*
* All rights reserved.
*
* THIS PROGRAM IS PROVIDED UNDER THE TERMS OF GPL VERSION 3 LICENSE OR
* THIS OSMC PUBLIC LICENSE (OSMC-PL) VERSION 1.2.
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS PROGRAM CONSTITUTES
* RECIPIENT'S ACCEPTANCE OF THE OSMC PUBLIC LICENSE OR THE GPL VERSION 3,
* ACCORDING TO RECIPIENTS CHOICE.
*
* The OpenModelica software and the Open Source Modelica
* Consortium (OSMC) Public License (OSMC-PL) are obtained
* from OSMC, either from the above address,
* from the URLs: http://www.ida.liu.se/projects/OpenModelica or
* http://www.openmodelica.org, and in the OpenModelica distribution.
* GNU version 3 is obtained from: http://www.gnu.org/copyleft/gpl.html.
*
* This program is distributed WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE, EXCEPT AS EXPRESSLY SET FORTH
* IN THE BY RECIPIENT SELECTED SUBSIDIARY LICENSE CONDITIONS OF OSMC-PL.
*
* See the full OSMC Public License conditions for more details.
*
*/
/*
*
* @author Adeel Asghar <adeel.asghar@liu.se>
*
* RCS: $Id$
*
*/
#include "Helper.h"
#include <QDir>
/* Global non-translated variables */
QString Helper::applicationName = "OMEdit";
QString Helper::applicationIntroText = "OpenModelica Connection Editor";
QString Helper::organization = "openmodelica"; /* case-sensitive string. Don't change it. Used by ini settings file. */
QString Helper::application = "omedit"; /* case-sensitive string. Don't change it. Used by ini settings file. */
// these two variables are set once we are connected to OMC......in OMCProxy::startServer().
QString Helper::OpenModelicaVersion = "";
QString Helper::OpenModelicaHome = "";
QString Helper::OpenModelicaLibrary = "";
QString Helper::OMCServerName = "OMEdit";
QString Helper::omFileTypes = "Modelica Files (*.mo)";
QString Helper::omnotebookFileTypes = "OMNotebook Files (*.onb *.onbz *.nb)";
QString Helper::ngspiceNetlistFileTypes = "ngspice Netlist Files (*.cir *.sp *.spice)";
QString Helper::imageFileTypes = "SVG (*.svg);;PNG image (*.png);;Windows BMP image (*.bmp);;TIFF (*.tiff)";
QString Helper::bitmapFileTypes = "PNG image (*.png);;Windows BMP image (*.bmp);;JPEG (*.jpg *.jpeg)";
QString Helper::fmuFileTypes = "FMU Files (*.fmu)";
QString Helper::xmlFileTypes = "XML Files (*.xml)";
QString Helper::infoXmlFileTypes = "OM Info Files (*_info.xml *_info.json)";
QString Helper::matFileTypes = "MAT Files (*.mat)";
QString Helper::omResultFileTypes = "OpenModelica Result Files (*.mat *.plt *.csv)";
#ifdef WIN32
QString Helper::exeFileTypes = "EXE Files (*.exe)";
#else
QString Helper::exeFileTypes = "Executable files (*)";
#endif
QString Helper::txtFileTypes = "TXT Files (*.txt)";
QString Helper::figaroFileTypes = "Figaro Files (*.fi)";
int Helper::treeIndentation = 13;
QSize Helper::iconSize = QSize(20, 20);
QSize Helper::buttonIconSize = QSize(16, 16);
int Helper::tabWidth = 20;
QString Helper::modelicaComponentFormat = "image/modelica-component";
QString Helper::modelicaFileFormat = "text/uri-list";
qreal Helper::shapesStrokeWidth = 2.0;
int Helper::headingFontSize = 18;
QString Helper::ModelicaInitializationMethods = ",none,symbolic";
QString Helper::ModelicaSimulationOutputFormats = "mat,plt,csv";
QString Helper::clockOptions = ",RT,CYC,CPU";
QString Helper::linearSolvers = ",lapack";
QString Helper::nonLinearSolvers = ",hybrid,kinsol,newton";
QString Helper::notificationLevel = ".OpenModelica.Scripting.ErrorLevel.notification";
QString Helper::warningLevel = ".OpenModelica.Scripting.ErrorLevel.warning";
QString Helper::errorLevel = ".OpenModelica.Scripting.ErrorLevel.error";
QString Helper::syntaxKind = ".OpenModelica.Scripting.ErrorKind.syntax";
QString Helper::grammarKind = ".OpenModelica.Scripting.ErrorKind.grammar";
QString Helper::translationKind = ".OpenModelica.Scripting.ErrorKind.translation";
QString Helper::symbolicKind = ".OpenModelica.Scripting.ErrorKind.symbolic";
QString Helper::simulationKind = ".OpenModelica.Scripting.ErrorKind.simulation";
QString Helper::scriptingKind = ".OpenModelica.Scripting.ErrorKind.scripting";
QString Helper::tabbed = "Tabbed";
QString Helper::subWindow = "SubWindow";
QString Helper::structuredOutput = "Structured";
QString Helper::textOutput = "Text";
QString Helper::utf8 = "UTF-8";
QFontInfo Helper::systemFontInfo = QFontInfo(QFont());
QFontInfo Helper::monospacedFontInfo = QFontInfo(QFont());
QString Helper::defaultComponentAnnotationString = QString("{-100.0,-100.0,100.0,100.0,true,0.1,2.0,2.0,"
"{Rectangle(true, {0.0, 0.0}, 0, {0, 0, 0}, {240, 240, 240}, LinePattern.Solid, FillPattern.Solid, 0.25, BorderPattern.None, {{-100, 100}, {100, -100}}, 0),"
"Text(true, {0.0, 0.0}, 0, {0, 0, 0}, {0, 0, 0}, LinePattern.Solid, FillPattern.None, 0.25, {{-100, 20}, {100, -20}}, \"%name\", 0, TextAlignment.Center)}}");
QString Helper::errorComponentAnnotationString = QString("{-100.0,-100.0,100.0,100.0,false,0.1,2.0,2.0,"
"{Rectangle(true, {0.0, 0.0}, 0, {255, 0, 0}, {0, 0, 0}, LinePattern.Solid, FillPattern.None, 0.25, BorderPattern.None, {{-100, -100}, {100, 100}}, 0),"
"Line(true, {0.0, 0.0}, 0, {{-100, 100}, {100, -100}}, {255, 0, 0}, LinePattern.Solid, 0.25, {Arrow.None, Arrow.None}, 3, Smooth.None),"
"Line(true, {0.0, 0.0}, 0, {{100, 100}, {-100, -100}}, {255, 0, 0}, LinePattern.Solid, 0.25, {Arrow.None, Arrow.None}, 3, Smooth.None)}}");
/* Meta Modelica Types */
QString Helper::MODELICA_METATYPE = QString("modelica_metatype");
QString Helper::MODELICA_STRING = QString("modelica_string");
QString Helper::MODELICA_BOOLEAN = QString("modelica_boolean");
QString Helper::MODELICA_INETGER = QString("modelica_integer");
QString Helper::MODELICA_REAL = QString("modelica_real");
QString Helper::REPLACEABLE_TYPE_ANY = QString("replaceable type Any");
QString Helper::RECORD = QString("record");
QString Helper::LIST = QString("list");
QString Helper::OPTION = QString("Option");
QString Helper::TUPLE = QString("tuple");
QString Helper::ARRAY = QString("Array");
QString Helper::VALUE_OPTIMIZED_OUT = QString("value has been optimized out");
/* Modelica Types */
QString Helper::STRING = QString("String");
QString Helper::BOOLEAN = QString("Boolean");
QString Helper::INTEGER = QString("Integer");
QString Helper::REAL = QString("Real");
/* Global translated variables */
QString Helper::newModelicaClass;
QString Helper::createNewModelicaClass;
QString Helper::findClasses;
QString Helper::openModelicaFiles;
QString Helper::openConvertModelicaFiles;
QString Helper::libraries;
QString Helper::clearRecentFiles;
QString Helper::encoding;
QString Helper::file;
QString Helper::browse;
QString Helper::ok;
QString Helper::cancel;
QString Helper::close;
QString Helper::error;
QString Helper::chooseFile;
QString Helper::chooseFiles;
QString Helper::attributes;
QString Helper::properties;
QString Helper::add;
QString Helper::edit;
QString Helper::save;
QString Helper::apply;
QString Helper::chooseDirectory;
QString Helper::general;
QString Helper::output;
QString Helper::parameters;
QString Helper::name;
QString Helper::comment;
QString Helper::path;
QString Helper::type;
QString Helper::information;
QString Helper::rename;
QString Helper::checkModel;
QString Helper::checkModelTip;
QString Helper::checkAllModels;
QString Helper::checkAllModelsTip;
QString Helper::instantiateModel;
QString Helper::instantiateModelTip;
QString Helper::exportFMU;
QString Helper::exportFMUTip;
QString Helper::importFMU;
QString Helper::importFMUTip;
QString Helper::exportXML;
QString Helper::exportXMLTip;
QString Helper::exportToOMNotebook;
QString Helper::exportToOMNotebookTip;
QString Helper::importFromOMNotebook;
QString Helper::importNgspiceNetlist;
QString Helper::importFromOMNotebookTip;
QString Helper::importNgspiceNetlistTip;
QString Helper::line;
QString Helper::exportAsImage;
QString Helper::exportAsImageTip;
QString Helper::exportFigaro;
QString Helper::exportFigaroTip;
QString Helper::OpenModelicaCompilerCLI;
QString Helper::deleteStr;
QString Helper::copy;
QString Helper::paste;
QString Helper::loading;
QString Helper::question;
QString Helper::search;
QString Helper::unloadClass;
QString Helper::duplicate;
QString Helper::duplicateTip;
QString Helper::unloadClassTip;
QString Helper::unloadXMLTip;
QString Helper::refresh;
QString Helper::simulate;
QString Helper::simulateTip;
QString Helper::reSimulate;
QString Helper::reSimulateTip;
QString Helper::reSimulateSetup;
QString Helper::reSimulateSetupTip;
QString Helper::simulateWithTransformationalDebugger;
QString Helper::simulateWithTransformationalDebuggerTip;
QString Helper::simulateWithAlgorithmicDebugger;
QString Helper::simulateWithAlgorithmicDebuggerTip;
QString Helper::simulationSetup;
QString Helper::simulationSetupTip;
QString Helper::simulation;
QString Helper::reSimulation;
QString Helper::interactiveSimulation;
QString Helper::options;
QString Helper::extent;
QString Helper::bottom;
QString Helper::top;
QString Helper::grid;
QString Helper::horizontal;
QString Helper::vertical;
QString Helper::component;
QString Helper::scaleFactor;
QString Helper::preserveAspectRatio;
QString Helper::originX;
QString Helper::originY;
QString Helper::rotation;
QString Helper::thickness;
QString Helper::smooth;
QString Helper::bezier;
QString Helper::startArrow;
QString Helper::endArrow;
QString Helper::arrowSize;
QString Helper::size;
QString Helper::lineStyle;
QString Helper::color;
QString Helper::fontAndColors;
QString Helper::fontFamily;
QString Helper::fontSize;
QString Helper::pickColor;
QString Helper::pattern;
QString Helper::fillStyle;
QString Helper::extent1X;
QString Helper::extent1Y;
QString Helper::extent2X;
QString Helper::extent2Y;
QString Helper::radius;
QString Helper::startAngle;
QString Helper::endAngle;
QString Helper::curveStyle;
QString Helper::figaro;
QString Helper::remove;
QString Helper::fileLocation;
QString Helper::errorLocation;
QString Helper::readOnly;
QString Helper::writable;
QString Helper::workingDirectory;
QString Helper::iconView;
QString Helper::diagramView;
QString Helper::textView;
QString Helper::documentationView;
QString Helper::searchModelicaClass;
QString Helper::findReplaceModelicaText;
QString Helper::left;
QString Helper::center;
QString Helper::right;
QString Helper::connectArray;
QString Helper::findVariables;
QString Helper::viewClass;
QString Helper::viewClassTip;
QString Helper::viewDocumentation;
QString Helper::viewDocumentationTip;
QString Helper::dontShowThisMessageAgain;
QString Helper::clickAndDragToResize;
QString Helper::variables;
QString Helper::variablesBrowser;
QString Helper::description;
QString Helper::previous;
QString Helper::next;
QString Helper::reload;
QString Helper::index;
QString Helper::equation;
QString Helper::transformationalDebugger;
QString Helper::executionCount;
QString Helper::executionMaxTime;
QString Helper::executionTime;
QString Helper::executionFraction;
QString Helper::debuggingFileNotSaveInfo;
QString Helper::algorithmicDebugger;
QString Helper::debugConfigurations;
QString Helper::resume;
QString Helper::interrupt;
QString Helper::exit;
QString Helper::stepOver;
QString Helper::stepInto;
QString Helper::stepReturn;
QString Helper::attachToRunningProcess;
QString Helper::crashReport;
QString Helper::parsingFailedJson;
QString Helper::expandAll;
QString Helper::collapseAll;
QString Helper::version;
QString Helper::unlimited;
QString Helper::simulationOutput;
QString Helper::cancelSimulation;
QString Helper::fetchInterfaceData;
QString Helper::fetchInterfaceDataTip;
QString Helper::tlmCoSimulationSetup;
QString Helper::tlmCoSimulationSetupTip;
QString Helper::tlmCoSimulation;
QString Helper::running;
QString Helper::finished;
void Helper::initHelperVariables()
{
/* Global translated variables */
Helper::newModelicaClass = tr("New Modelica Class");
Helper::createNewModelicaClass = tr("Create New Modelica Class");
Helper::findClasses = tr("Find Classes");
Helper::openModelicaFiles = tr("Open Model/Library File(s)");
Helper::openConvertModelicaFiles = tr("Open/Convert Modelica File(s) With Encoding");
Helper::libraries = tr("Libraries");
Helper::clearRecentFiles = tr("Clear Recent Files");
Helper::encoding = tr("Encoding:");
Helper::file = tr("File:");
Helper::browse = tr("Browse...");
Helper::ok = tr("OK");
Helper::cancel = tr("Cancel");
Helper::close = tr("Close");
Helper::error = tr("Error");
Helper::chooseFile = tr("Choose File");
Helper::chooseFiles = tr("Choose File(s)");
Helper::attributes = tr("Attributes");
Helper::properties = tr("Properties");
Helper::add = tr("Add");
Helper::edit = tr("Edit");
Helper::save = tr("Save");
Helper::apply = tr("Apply");
Helper::importFMU = tr("Import FMU");
Helper::chooseDirectory = tr("Choose Directory");
Helper::general = tr("General");
Helper::output = tr("Output");
Helper::parameters = tr("Parameters");
Helper::name = tr("Name:");
Helper::comment = tr("Comment:");
Helper::path = tr("Path:");
Helper::type = tr("Type");
Helper::information = tr("Information");
Helper::rename = tr("rename");
Helper::checkModel = tr("Check Model");
Helper::checkModelTip = tr("Check the Modelica class");
Helper::checkAllModels = tr("Check All Models");
Helper::checkAllModelsTip = tr("Checks all nested modelica classes");
Helper::instantiateModel = tr("Instantiate Model");
Helper::instantiateModelTip = tr("Instantiate/Flatten the Modelica class");
Helper::exportFMU = tr("Export FMU");
Helper::exportFMUTip = tr("Exports the model as Functional Mockup Unit (FMU)");
Helper::importFMU = tr("Import FMU");
Helper::importFMUTip = tr("Imports the model from Functional Mockup Interface (FMU)");
Helper::exportXML = tr("Export XML");
Helper::exportXMLTip = tr("Exports the model as XML");
Helper::exportToOMNotebook = tr("Export to OMNotebook");
Helper::exportToOMNotebookTip = tr("Exports the current model to OMNotebook");
Helper::importFromOMNotebook = tr("Import from OMNotebook");
Helper::importNgspiceNetlist = tr("Import ngspice netlist");
Helper::importFromOMNotebookTip = tr("Imports the model(s) from OMNotebook");
Helper::importNgspiceNetlistTip = tr("Converts ngspice netlist(s) to Modelica code");
Helper::line = tr("Line");
Helper::exportAsImage = tr("Export as an Image");
Helper::exportAsImageTip = tr("Exports the current model to Image");
Helper::exportFigaro = tr("Export Figaro");
Helper::exportFigaroTip = tr("Exports the current model to Figaro");
Helper::OpenModelicaCompilerCLI = tr("OpenModelica Compiler CLI");
Helper::deleteStr = tr("Delete");
Helper::copy = tr("Copy");
Helper::paste = tr("Paste");
Helper::loading = tr("Loading");
Helper::question = tr("Question");
Helper::search = tr("Search");
Helper::duplicate = tr("Duplicate");
Helper::duplicateTip = tr("Duplicates the item");
Helper::unloadClass = tr("Unload");
Helper::unloadClassTip = tr("Unload the Modelica class");
Helper::unloadXMLTip = tr("Unload the XML file");
Helper::refresh = tr("Refresh");
Helper::simulate = tr("Simulate");
Helper::simulateTip = tr("Simulates the Modelica class");
Helper::reSimulate = tr("Re-simulate");
Helper::reSimulateTip = tr("Re-simulates the Modelica class");
Helper::reSimulateSetup = tr("Re-simulate Setup");
Helper::reSimulateSetupTip = tr("Setup re-simulation settings");
Helper::simulateWithTransformationalDebugger = tr("Simulate with Transformational Debugger");
Helper::simulateWithTransformationalDebuggerTip = tr("Simulates the Modelica class with Transformational Debugger");
Helper::simulateWithAlgorithmicDebugger = tr("Simulate with Algorithmic Debugger");
Helper::simulateWithAlgorithmicDebuggerTip = tr("Simulates the Modelica class with Algorithmic Debugger");
Helper::simulationSetup = tr("Simulation Setup");
Helper::simulationSetupTip = tr("Setup simulation settings");
Helper::simulation = tr("Simulation");
Helper::reSimulation = tr("Re-simulation");
Helper::interactiveSimulation = tr("Interactive Simulation");
Helper::options = tr("Options");
Helper::extent = tr("Extent");
Helper::bottom = tr("Bottom:");
Helper::top = tr("Top:");
Helper::grid = tr("Grid");
Helper::horizontal = tr("Horizontal");
Helper::vertical = tr("Vertical");
Helper::component = tr("Component");
Helper::scaleFactor = tr("Scale factor:");
Helper::preserveAspectRatio = tr("Preserve aspect ratio");
Helper::originX = tr("OriginX:");
Helper::originY = tr("OriginY:");
Helper::rotation = tr("Rotation:");
Helper::thickness = tr("Thickness:");
Helper::smooth = tr("Smooth:");
Helper::bezier = tr("Bezier");
Helper::startArrow = tr("Start Arrow:");
Helper::endArrow = tr("End Arrow:");
Helper::arrowSize = tr("Arrow Size:");
Helper::size = tr("Size:");
Helper::lineStyle = tr("Line Style");
Helper::color = tr("Color:");
Helper::fontAndColors = tr("Font and Colors");
Helper::fontFamily = tr("Font Family:");
Helper::fontSize = tr("Font Size:");
Helper::pickColor = tr("Pick Color");
Helper::fillStyle = tr("Fill Style");
Helper::pattern = tr("Pattern:");
Helper::extent1X = tr("Extent1X:");
Helper::extent1Y = tr("Extent1Y:");
Helper::extent2X = tr("Extent2X:");
Helper::extent2Y = tr("Extent2Y:");
Helper::radius = tr("Radius:");
Helper::startAngle = tr("Start Angle:");
Helper::endAngle = tr("End Angle:");
Helper::curveStyle = tr("Curve Style");
Helper::figaro = tr("Figaro");
Helper::remove = tr("Remove");
Helper::fileLocation = tr("Location", "For files");
Helper::errorLocation = tr("Location", "For errors");
Helper::readOnly = tr("Read-Only");
Helper::writable = tr("Writable");
Helper::workingDirectory = tr("Working Directory:");
Helper::iconView = tr("Icon View");
Helper::diagramView = tr("Diagram View");
Helper::textView = tr("Text View");
Helper::documentationView = tr("Documentation View");
Helper::searchModelicaClass = tr("Search Modelica Class");
Helper::findReplaceModelicaText = tr("Find/Replace...");
Helper::left = tr("Left");
Helper::center = tr("Center");
Helper::right = tr("Right");
Helper::connectArray = tr("Connect Array");
Helper::findVariables = tr("Find Variables");
Helper::viewClass = tr("View Class");
Helper::viewClassTip = tr("Opens the class details");
Helper::viewDocumentation = tr("View Documentation");
Helper::viewDocumentationTip = tr("Opens the class documentation");
Helper::dontShowThisMessageAgain = tr("Don't show this message again");
Helper::clickAndDragToResize = tr("Click and drag to resize");
Helper::variables = tr("Variables");
Helper::variablesBrowser = tr("Variables Browser");
Helper::description = tr("Description");
Helper::previous = tr("Previous");
Helper::next = tr("Next");
Helper::reload = tr("Reload");
Helper::index = tr("Index");
Helper::equation = tr("Equation");
Helper::transformationalDebugger = tr("Transformational Debugger");
Helper::executionCount = tr("Executions");
Helper::executionMaxTime = tr("Max time");
Helper::executionTime = tr("Time");
Helper::executionFraction = tr("Fraction");
Helper::debuggingFileNotSaveInfo = tr("<b>Info: </b>Update the actual model in <b>Modeling</b> perspective and simulate again. This is only shown for debugging purpose. Your changes will not be saved.");
Helper::algorithmicDebugger = tr("Algorithmic Debugger");
Helper::debugConfigurations = tr("Debug Configurations");
Helper::resume = tr("Resume");
Helper::interrupt = tr("Interrupt");
Helper::exit = tr("Exit");
Helper::stepOver = tr("Step Over");
Helper::stepInto = tr("Step Into");
Helper::stepReturn = tr("Step Return");
Helper::attachToRunningProcess = tr("Attach to Running Process");
Helper::crashReport = tr("Crash Report");
Helper::parsingFailedJson = tr("Parsing of JSON file failed");
Helper::expandAll = tr("Expand All");
Helper::collapseAll = tr("Collapse All");
Helper::version = tr("Version:");
Helper::unlimited = tr("unlimited");
Helper::simulationOutput = tr("Simulation Output");
Helper::cancelSimulation = tr("Cancel Simulation");
Helper::fetchInterfaceData = tr("Fetch Interface Data");
Helper::fetchInterfaceDataTip = tr("Fetches the interface data for TLM co-simulation");
Helper::tlmCoSimulationSetup = tr("TLM Co-Simulation Setup");
Helper::tlmCoSimulationSetupTip = tr("Opens the TLM co-simulation setup");
Helper::tlmCoSimulation = tr("TLM Co-Simulation");
Helper::running = tr("Running");
Helper::finished = tr("Finished");
}
QString GUIMessages::getMessage(int type)
{
switch (type)
{
case CHECK_MESSAGES_BROWSER:
return tr("Please check the Messages Browser for more error specific details.");
case SAME_COMPONENT_NAME:
return tr("A Component with the same name already exists. Please choose another Name.");
case SAME_COMPONENT_CONNECT:
return tr("You cannot connect a component to itself.");
case NO_MODELICA_CLASS_OPEN:
return tr("There is no Modelica Class opened for %1.");
case SIMULATION_STARTTIME_LESSTHAN_STOPTIME:
return tr("Simulation Start Time should be less than or equal to Stop Time.");
case ENTER_NAME:
return tr("Please enter <b>%1</b> Name.");
case EXTENDS_CLASS_NOT_FOUND:
return tr("Extends class <b>%1</b> does not exist.");
case INSERT_IN_CLASS_NOT_FOUND:
return tr("Insert in class <b>%1</b> does not exist.");
case INSERT_IN_SYSTEM_LIBRARY_NOT_ALLOWED:
return tr("Insert in class <b>%1</b> is a system library. System libraries are read-only.");
case MODEL_ALREADY_EXISTS:
return tr("<b>%1</b> <i>%2</i> already exists in <b>%3</b>.");
case ITEM_ALREADY_EXISTS:
return tr("An item with the same name already exists. Please try some other name.");
case OPENMODELICAHOME_NOT_FOUND:
return tr("Could not find environment variable OPENMODELICAHOME. Please make sure OpenModelica is installed properly.");
case ERROR_OCCURRED:
return tr("Following error has occurred. \n\n%1");
case ERROR_IN_MODELICA_TEXT:
return tr("Problems are found in Modelica Text. <br />");
case REVERT_PREVIOUS_OR_FIX_ERRORS_MANUALLY:
return tr("<br /><br />For normal users it is recommended to choose <b>Revert from previous</b>. You can also choose <b>Fix errors manually</b> if you want to fix them by your own.");
case NO_OPENMODELICA_KEYWORDS:
return tr("Please make sure you are not using any OpenModelica Keywords like (model, package, record, class etc.)");
case UNABLE_TO_LOAD_FILE:
return tr("Error has occurred while loading the file/library <b>%1</b>. Unable to load the file/library.");
case FILE_NOT_FOUND:
return tr("The file <b>%1</b> not found.");
case ERROR_OPENING_FILE:
return tr("Error opening the file <b>%1</b>. %2");
case UNABLE_TO_LOAD_MODEL:
return tr("Error has occurred while loading the model : \n%1.");
case DELETE_AND_LOAD:
return tr("Delete the existing class(es) before loading the file/library <b>%1</b>.");
case REDEFINING_EXISTING_CLASSES:
return tr("Redefining class(es) <b>%1</b> which already exist(s).");
case MULTIPLE_TOP_LEVEL_CLASSES:
return tr("Only single nonstructured entity is allowed to be stored in the file. <b>%1</b> contains following classes <b>%2</b>.");
case DIAGRAM_VIEW_DROP_MSG:
return tr("You cannot insert <b>%1</b>, it is a <b>%2</b>. Only <b>model</b>, <b>class</b>, <b>connector</b>, <b>record</b> or <b>block</b> is allowed on the diagram layer.");
case ICON_VIEW_DROP_MSG:
return tr("You cannot insert <b>%1</b>, it is a <b>%2</b>. Only <b>connector</b> is allowed on the icon layer.");
case PLOT_PARAMETRIC_DIFF_FILES:
return tr("You cannot do a plot parametric between two different simulation result files. Make sure you select two variables from the same simulation result file.");
case FILE_FORMAT_NOT_SUPPORTED:
return tr("The file <b>%1</b> is not a valid Modelica file. The file format is not supported. You can only open <b>%2</b>.");
case ENTER_VALID_NUMBER:
return tr("Enter a valid number value for <b>%1</b>.");
case ITEM_DROPPED_ON_ITSELF:
return tr("You cannot drop an item on itself.");
case MAKE_REPLACEABLE_IF_PARTIAL:
return tr("The <b>%1</b> <i>%2</i> is defined as <b>partial</b>.<br />The component will be added as a <b>replaceable</b> component.");
case INNER_MODEL_NAME_CHANGED:
return tr("A component with the name <b>%1</b> already exists. The name is changed from <b>%1</b> to <b>%2</b>.<br /><br />This is probably wrong because the component is declared as <b>inner</b>.");
case FMU_GENERATED:
return tr("The FMU %1.fmu is generated at %2");
case XML_GENERATED:
return tr("The XML is generated at %1/%2.xml");
case FIGARO_GENERATED:
return tr("The FIGARO is generated.");
case DELETE_CLASS_MSG:
return tr("Are you sure you want to unload <b>%1</b>? Everything contained inside this class will also be unloaded.");
case DELETE_TEXT_FILE_MSG:
return tr("Are you sure you want to unload <b>%1</b>?");
case WRONG_MODIFIER:
return tr("The Modifier <b>%1</b> format is invalid. The correct format is <b>phi(start=1)</b>");
case SET_INFO_XML_FLAG:
return tr("The operations were not generated. Check Generate Operations in %1 OR you must set the +d=infoXmlOperations flag via %2 and simulate again.");
case GENERATE_OPERATIONS_MSG:
return tr("Tools->Options->Debugger->Transformational Debugger");
case GENERATE_OPERATIONS_MSG_MAC:
return tr("OMEdit->Preferences->Debugger->Transformational Debugger");
case SET_INFO_XML_FLAG_MSG:
return tr("Tools->Options->Simulation->OMC Flags");
case SET_INFO_XML_FLAG_MSG_MAC:
return tr("OMEdit->Preferences->Simulation->OMC Flags");
case DEBUG_CONFIGURATION_EXISTS_MSG:
return tr("A debug configuration with name <b>%1</b> already exists. Error occurred while saving the debug configuration <b>%2<b>.");
case DEBUG_CONFIGURATION_SIZE_EXCEED:
return tr("Maximum <b>%1</b> debug configurations are allowed.");
case DELETE_DEBUG_CONFIGURATION_MSG:
return tr("Are you sure you want to delete <b>%1</b> debug configuration?");
case DEBUGGER_ALREADY_RUNNING:
return tr("A debugging session is already running. Only one debugging session is allowed.");
case CLASS_NOT_FOUND:
return tr("Unable to find the class <b>%1</b>.");
case BREAKPOINT_INSERT_NOT_SAVED:
return tr("The class <b>%1</b> is not saved. Breakpoints are only allowed on saved classes.");
case BREAKPOINT_INSERT_NOT_MODELICA_CLASS:
return tr("The class <b>%1</b> is not a modelica class. Breakpoints are only allowed on modelica classes.");
case TLMMANAGER_NOT_SET:
return tr("TLM Manager executable path is not set. Set it via <b>%1</b>");
case TLMMANAGER_NOT_SET_MSG:
return tr("Tools->Options->TLM");
case TLMMANAGER_NOT_SET_MSG_MAC:
return tr("OMEdit->Preferences->TLM");
case METAMODEL_UNSAVED:
return tr("Metamodel <b>%1</b> has unsaved changes. Do you want to save?");
case TLMCOSIMULATION_ALREADY_RUNNING:
return tr("TLM co-simulation session is already running. Only one session is allowed.");
default:
return "";
}
}
QString& OpenModelica::tempDirectory()
{
static int init = 0;
static QString tmpPath;
if (!init) {
init = 1;
#ifdef WIN32
tmpPath = QDir::tempPath() + "/OpenModelica/OMEdit/";
#else // UNIX environment
char *user = getenv("USER");
tmpPath = QDir::tempPath() + "/OpenModelica_" + QString(user ? user : "nobody") + "/OMEdit/";
#endif
tmpPath.remove("\"");
if (!QDir().exists(tmpPath))
QDir().mkpath(tmpPath);
}
return tmpPath;
}
QSettings* OpenModelica::getApplicationSettings()
{
static int init = 0;
static QSettings *pSettings;
if (!init) {
init = 1;
pSettings = new QSettings(QSettings::IniFormat, QSettings::UserScope, Helper::organization, Helper::application);
pSettings->setIniCodec(Helper::utf8.toStdString().data());
}
return pSettings;
}