├── .gitattributes ├── .gitignore ├── .gitmodules ├── Makefile.in ├── Makefile.omdev.mingw ├── OMEdit └── OMEditGUI │ ├── Animation │ ├── AbstractAnimationWindow.cpp │ ├── AbstractAnimationWindow.h │ ├── AnimationUtil.h │ ├── AnimationWindow.cpp │ ├── AnimationWindow.h │ ├── ExtraShapes.cpp │ ├── ExtraShapes.h │ ├── FMUSettingsDialog.cpp │ ├── FMUSettingsDialog.h │ ├── FMUWrapper.cpp │ ├── FMUWrapper.h │ ├── GLWidget.cpp │ ├── GLWidget.h │ ├── OpenGLWidget.cpp │ ├── OpenGLWidget.h │ ├── Shapes.cpp │ ├── Shapes.h │ ├── ThreeDViewer.cpp │ ├── ThreeDViewer.h │ ├── TimeManager.cpp │ ├── TimeManager.h │ ├── ViewerWidget.cpp │ ├── ViewerWidget.h │ ├── Visualizer.cpp │ ├── Visualizer.h │ ├── VisualizerCSV.cpp │ ├── VisualizerCSV.h │ ├── VisualizerFMU.cpp │ ├── VisualizerFMU.h │ ├── VisualizerMAT.cpp │ ├── VisualizerMAT.h │ └── rapidxml.hpp │ ├── Annotations │ ├── BitmapAnnotation.cpp │ ├── BitmapAnnotation.h │ ├── EllipseAnnotation.cpp │ ├── EllipseAnnotation.h │ ├── LineAnnotation.cpp │ ├── LineAnnotation.h │ ├── PolygonAnnotation.cpp │ ├── PolygonAnnotation.h │ ├── RectangleAnnotation.cpp │ ├── RectangleAnnotation.h │ ├── ShapeAnnotation.cpp │ ├── ShapeAnnotation.h │ ├── ShapePropertiesDialog.cpp │ ├── ShapePropertiesDialog.h │ ├── TextAnnotation.cpp │ └── TextAnnotation.h │ ├── Component │ ├── Component.cpp │ ├── Component.h │ ├── ComponentProperties.cpp │ ├── ComponentProperties.h │ ├── CornerItem.cpp │ ├── CornerItem.h │ ├── Transformation.cpp │ └── Transformation.h │ ├── CrashReport │ ├── CrashReportDialog.cpp │ ├── CrashReportDialog.h │ ├── GDBBacktrace.cpp │ ├── GDBBacktrace.h │ ├── backtrace.c │ └── backtrace.h │ ├── Debugger │ ├── Attach │ │ ├── AttachToProcessDialog.cpp │ │ ├── AttachToProcessDialog.h │ │ ├── ProcessListModel.cpp │ │ └── ProcessListModel.h │ ├── Breakpoints │ │ ├── BreakpointDialog.cpp │ │ ├── BreakpointDialog.h │ │ ├── BreakpointMarker.cpp │ │ ├── BreakpointMarker.h │ │ ├── BreakpointsWidget.cpp │ │ └── BreakpointsWidget.h │ ├── DebuggerConfigurationsDialog.cpp │ ├── DebuggerConfigurationsDialog.h │ ├── GDB │ │ ├── CommandFactory.cpp │ │ ├── CommandFactory.h │ │ ├── GDBAdapter.cpp │ │ └── GDBAdapter.h │ ├── Locals │ │ ├── LocalsWidget.cpp │ │ ├── LocalsWidget.h │ │ ├── ModelicaValue.cpp │ │ └── ModelicaValue.h │ ├── Parser │ │ ├── GDBMIOutput.g │ │ ├── GDBMIParser.cpp │ │ ├── GDBMIParser.h │ │ ├── Makefile.common │ │ ├── Makefile.lib.common │ │ ├── Makefile.lib.omdev.mingw │ │ ├── Makefile.lib.unix.in │ │ ├── Makefile.omdev.mingw │ │ ├── Makefile.unix.in │ │ ├── README.txt │ │ ├── SampleGDBMIOutput.txt │ │ └── main.cpp │ └── StackFrames │ │ ├── StackFramesWidget.cpp │ │ └── StackFramesWidget.h │ ├── Editors │ ├── BaseEditor.cpp │ ├── BaseEditor.h │ ├── CEditor.cpp │ ├── CEditor.h │ ├── CompositeModelEditor.cpp │ ├── CompositeModelEditor.h │ ├── HTMLEditor.cpp │ ├── HTMLEditor.h │ ├── MetaModelicaEditor.cpp │ ├── MetaModelicaEditor.h │ ├── ModelicaEditor.cpp │ ├── ModelicaEditor.h │ ├── OMSimulatorEditor.cpp │ ├── OMSimulatorEditor.h │ ├── TextEditor.cpp │ ├── TextEditor.h │ ├── TransformationsEditor.cpp │ └── TransformationsEditor.h │ ├── FMI │ ├── ImportFMUDialog.cpp │ ├── ImportFMUDialog.h │ ├── ImportFMUModelDescriptionDialog.cpp │ └── ImportFMUModelDescriptionDialog.h │ ├── Git │ ├── CleanDialog.cpp │ ├── CleanDialog.h │ ├── CommitChangesDialog.cpp │ ├── CommitChangesDialog.h │ ├── GitCommands.cpp │ ├── GitCommands.h │ ├── RevertCommitsDialog.cpp │ └── RevertCommitsDialog.h │ ├── Info.plist │ ├── MainWindow.cpp │ ├── MainWindow.h │ ├── Makefile.omdev.mingw │ ├── Makefile.unix.in │ ├── Modeling │ ├── CoOrdinateSystem.cpp │ ├── CoOrdinateSystem.h │ ├── Commands.cpp │ ├── Commands.h │ ├── DocumentationWidget.cpp │ ├── DocumentationWidget.h │ ├── FunctionArgumentDialog.cpp │ ├── FunctionArgumentDialog.h │ ├── ItemDelegate.cpp │ ├── ItemDelegate.h │ ├── LibraryTreeWidget.cpp │ ├── LibraryTreeWidget.h │ ├── MessagesWidget.cpp │ ├── MessagesWidget.h │ ├── ModelWidgetContainer.cpp │ ├── ModelWidgetContainer.h │ ├── ModelicaClassDialog.cpp │ └── ModelicaClassDialog.h │ ├── OMC │ ├── OMCProxy.cpp │ └── OMCProxy.h │ ├── OMEdit.config.in │ ├── OMEdit.manifest │ ├── OMEditApplication.cpp │ ├── OMEditApplication.h │ ├── OMEditGUI.pro │ ├── OMS │ ├── BusDialog.cpp │ ├── BusDialog.h │ ├── ElementPropertiesDialog.cpp │ ├── ElementPropertiesDialog.h │ ├── InstantiateDialog.cpp │ ├── InstantiateDialog.h │ ├── ModelDialog.cpp │ ├── ModelDialog.h │ ├── OMSProxy.cpp │ ├── OMSProxy.h │ ├── OMSSimulationDialog.cpp │ ├── OMSSimulationDialog.h │ ├── OMSSimulationOptions.h │ ├── OMSSimulationOutputWidget.cpp │ ├── OMSSimulationOutputWidget.h │ ├── SystemSimulationInformationDialog.cpp │ └── SystemSimulationInformationDialog.h │ ├── Options │ ├── NotificationsDialog.cpp │ ├── NotificationsDialog.h │ ├── OptionsDialog.cpp │ └── OptionsDialog.h │ ├── Plotting │ ├── DiagramWindow.cpp │ ├── DiagramWindow.h │ ├── PlotInteractiveCurveData_copy.cpp │ ├── PlotWindowContainer.cpp │ ├── PlotWindowContainer.h │ ├── VariablesWidget.cpp │ └── VariablesWidget.h │ ├── Resources │ ├── XMLSchema │ │ └── tlmModelDescription.xsd │ ├── bitmaps │ │ └── check.png │ ├── css │ │ └── stylesheet.qss │ ├── icons │ │ ├── add-connector.svg │ │ ├── add-icon.svg │ │ ├── add-system.svg │ │ ├── align-center.svg │ │ ├── align-interfaces.svg │ │ ├── align-left.svg │ │ ├── align-right.svg │ │ ├── animation.svg │ │ ├── array-parametric-plot-window.svg │ │ ├── array-plot-window.svg │ │ ├── arrow-end-fill.svg │ │ ├── arrow-end-open-half.svg │ │ ├── arrow-end-open.svg │ │ ├── arrow-start-fill.svg │ │ ├── arrow-start-open-half.svg │ │ ├── arrow-start-open.svg │ │ ├── background-color-icon.svg │ │ ├── bitmap-delete.svg │ │ ├── bitmap-shape.svg │ │ ├── block-icon.svg │ │ ├── bold-icon.svg │ │ ├── boolean-input-connector.svg │ │ ├── boolean-output-connector.svg │ │ ├── bottom.svg │ │ ├── breakpoint_disabled.svg │ │ ├── breakpoint_enabled.svg │ │ ├── bring-forward.svg │ │ ├── bring-to-front.svg │ │ ├── bullet-list.svg │ │ ├── bus-connector.svg │ │ ├── bus.svg │ │ ├── changeColor.svg │ │ ├── check-all.svg │ │ ├── check.svg │ │ ├── checkered.svg │ │ ├── class-icon.svg │ │ ├── clear.svg │ │ ├── completerClass.svg │ │ ├── completerCodeSnippets.svg │ │ ├── completerComponent.svg │ │ ├── completerType.svg │ │ ├── completerkeyword.svg │ │ ├── connect-mode.svg │ │ ├── connector-icon.svg │ │ ├── console.svg │ │ ├── control-panel.svg │ │ ├── copy.svg │ │ ├── csv.svg │ │ ├── cut.svg │ │ ├── debugger.svg │ │ ├── decrease-indent.svg │ │ ├── delete.svg │ │ ├── down.svg │ │ ├── duplicate.svg │ │ ├── edit-icon.svg │ │ ├── edit-info-header.svg │ │ ├── edit-info.svg │ │ ├── edit-revisions.svg │ │ ├── ellipse-shape.svg │ │ ├── equational-debugger.svg │ │ ├── exit.svg │ │ ├── export-fmu.svg │ │ ├── export-omnotebook.svg │ │ ├── export-variables.svg │ │ ├── export-xml.svg │ │ ├── fill-backward.svg │ │ ├── fill-cross-diagnol.svg │ │ ├── fill-cross.svg │ │ ├── fill-forward.svg │ │ ├── fill-horizontal-cylinder.svg │ │ ├── fill-horizontal.svg │ │ ├── fill-none.svg │ │ ├── fill-solid.svg │ │ ├── fill-sphere.svg │ │ ├── fill-vertical-cylinder.svg │ │ ├── fill-vertical.svg │ │ ├── fillstyle.svg │ │ ├── flatmodel.svg │ │ ├── flip-horizontal.svg │ │ ├── flip-vertical.svg │ │ ├── fmi.svg │ │ ├── fmu-icon.svg │ │ ├── function-icon.svg │ │ ├── general.svg │ │ ├── grid.svg │ │ ├── import-fmu.svg │ │ ├── import-omnotebook.svg │ │ ├── increase-indent.svg │ │ ├── info-icon.svg │ │ ├── initialize.svg │ │ ├── instantiate.svg │ │ ├── integer-input-connector.svg │ │ ├── integer-output-connector.svg │ │ ├── interaction.svg │ │ ├── interface-data.svg │ │ ├── interrupt.svg │ │ ├── invisible.svg │ │ ├── italic-icon.svg │ │ ├── justify.svg │ │ ├── libraries.svg │ │ ├── line-dash-dot-dot.svg │ │ ├── line-dash-dot.svg │ │ ├── line-dash.svg │ │ ├── line-dot.svg │ │ ├── line-none.svg │ │ ├── line-shape.svg │ │ ├── line-solid.svg │ │ ├── linestyle.svg │ │ ├── link-external.svg │ │ ├── link.svg │ │ ├── lock.svg │ │ ├── mat.svg │ │ ├── messages.svg │ │ ├── model-icon.svg │ │ ├── model.svg │ │ ├── modeling.png │ │ ├── modeltext.svg │ │ ├── new.svg │ │ ├── next.svg │ │ ├── notificationicon.svg │ │ ├── numbered-list.svg │ │ ├── omedit.icns │ │ ├── omedit.ico │ │ ├── omedit.png │ │ ├── omedit_splashscreen.png │ │ ├── omplot.png │ │ ├── omshell.svg │ │ ├── open.svg │ │ ├── optimization-icon.svg │ │ ├── options.svg │ │ ├── order.svg │ │ ├── package-icon.svg │ │ ├── parametric-plot-window.svg │ │ ├── paste.svg │ │ ├── pause.svg │ │ ├── perspective0.svg │ │ ├── perspective1.svg │ │ ├── perspective2.svg │ │ ├── perspective3.svg │ │ ├── play_animation.svg │ │ ├── plot-window.svg │ │ ├── plt.svg │ │ ├── polygon-shape.svg │ │ ├── previous.svg │ │ ├── print.svg │ │ ├── quit.svg │ │ ├── re-simulate.svg │ │ ├── re-simulation-center.svg │ │ ├── real-input-connector.svg │ │ ├── real-output-connector.svg │ │ ├── record-icon.svg │ │ ├── rectangle-shape.svg │ │ ├── redo.svg │ │ ├── refresh.svg │ │ ├── resume.svg │ │ ├── rotateCameraLeft.svg │ │ ├── rotateCameraRight.svg │ │ ├── rotateanticlockwise.svg │ │ ├── rotateclockwise.svg │ │ ├── save.svg │ │ ├── saveall.svg │ │ ├── saveas.svg │ │ ├── sc-system-icon.svg │ │ ├── send-backward.svg │ │ ├── send-to-back.svg │ │ ├── simulate-animation.svg │ │ ├── simulate-debug.svg │ │ ├── simulate-equation.svg │ │ ├── simulate.svg │ │ ├── simulation-center.svg │ │ ├── simulation-parameters.svg │ │ ├── step-into.svg │ │ ├── step-over.svg │ │ ├── step-return.svg │ │ ├── strikethrough-icon.svg │ │ ├── subscript-icon.svg │ │ ├── superscript-icon.svg │ │ ├── switch.svg │ │ ├── text-color-icon.svg │ │ ├── text-shape.svg │ │ ├── texture.svg │ │ ├── tlm-bus.svg │ │ ├── tlm-electric-bus-connector.svg │ │ ├── tlm-hydraulic-bus-connector.svg │ │ ├── tlm-icon.svg │ │ ├── tlm-input-bus-connector.svg │ │ ├── tlm-mechanical-bus-connector.svg │ │ ├── tlm-output-bus-connector.svg │ │ ├── tlm-rotational-bus-connector.svg │ │ ├── tlm-simulate.svg │ │ ├── tlm-system-icon.svg │ │ ├── top.svg │ │ ├── traceability.svg │ │ ├── transition-mode.svg │ │ ├── transparency.svg │ │ ├── txt.svg │ │ ├── type-icon.svg │ │ ├── underline-icon.svg │ │ ├── undo.svg │ │ ├── unlink.svg │ │ ├── unlock.svg │ │ ├── up.svg │ │ ├── update.svg │ │ ├── wc-system-icon.svg │ │ ├── zoomIn.svg │ │ ├── zoomOut.svg │ │ └── zoomReset.svg │ └── nls │ │ ├── OMEdit_de.ts │ │ ├── OMEdit_es.ts │ │ ├── OMEdit_fr.ts │ │ ├── OMEdit_it.ts │ │ ├── OMEdit_ja.ts │ │ ├── OMEdit_ro.ts │ │ ├── OMEdit_ru.ts │ │ ├── OMEdit_sv.ts │ │ ├── OMEdit_zh_CN.ts │ │ ├── README.md │ │ └── tsupdate.bat │ ├── Search │ ├── SearchWidget.cpp │ └── SearchWidget.h │ ├── Simulation │ ├── OpcUaClient.cpp │ ├── OpcUaClient.h │ ├── SimulationDialog.cpp │ ├── SimulationDialog.h │ ├── SimulationOptions.h │ ├── SimulationOutputHandler.cpp │ ├── SimulationOutputHandler.h │ ├── SimulationOutputWidget.cpp │ ├── SimulationOutputWidget.h │ ├── SimulationProcessThread.cpp │ ├── SimulationProcessThread.h │ ├── TranslationFlagsWidget.cpp │ └── TranslationFlagsWidget.h │ ├── TLM │ ├── FetchInterfaceDataDialog.cpp │ ├── FetchInterfaceDataDialog.h │ ├── FetchInterfaceDataThread.cpp │ ├── FetchInterfaceDataThread.h │ ├── TLMCoSimulationDialog.cpp │ ├── TLMCoSimulationDialog.h │ ├── TLMCoSimulationOptions.h │ ├── TLMCoSimulationOutputWidget.cpp │ ├── TLMCoSimulationOutputWidget.h │ ├── TLMCoSimulationThread.cpp │ └── TLMCoSimulationThread.h │ ├── Traceability │ ├── TraceabilityGraphViewWidget.cpp │ ├── TraceabilityGraphViewWidget.h │ ├── TraceabilityInformationURI.cpp │ └── TraceabilityInformationURI.h │ ├── TransformationalDebugger │ ├── OMDumpXML.cpp │ ├── OMDumpXML.h │ ├── TransformationsWidget.cpp │ ├── TransformationsWidget.h │ ├── diff_match_patch.cpp │ └── diff_match_patch.h │ ├── Util │ ├── Helper.cpp │ ├── Helper.h │ ├── StringHandler.cpp │ ├── StringHandler.h │ ├── Utilities.cpp │ └── Utilities.h │ ├── main.cpp │ ├── omc_config.h.in │ ├── rc_omedit.rc │ └── resource_omedit.qrc ├── README.md ├── configure.ac ├── doc └── manpages │ └── OMEdit.1 └── qjson ├── .gitignore ├── CMakeLists.txt ├── COPYING.lib ├── ChangeLog ├── QJSONConfig.cmake.in ├── QJSONConfigVersion.cmake.in ├── QJson.pc.in ├── README.license ├── README.md ├── cmake_uninstall.cmake.in ├── doc ├── Doxyfile ├── footer.html ├── header.html └── qjson.dox ├── include └── QJson │ ├── Parser │ ├── QObjectHelper │ └── Serializer ├── src ├── .gitignore ├── CMakeLists.txt ├── FlexLexer.h ├── json_parser.cc ├── json_parser.hh ├── json_parser.yy ├── json_scanner.cc ├── json_scanner.cpp ├── json_scanner.h ├── json_scanner.yy ├── location.hh ├── parser.cpp ├── parser.h ├── parser_p.h ├── parserrunnable.cpp ├── parserrunnable.h ├── position.hh ├── qjson_debug.h ├── qjson_export.h ├── qobjecthelper.cpp ├── qobjecthelper.h ├── serializer.cpp ├── serializer.h ├── serializerrunnable.cpp ├── serializerrunnable.h └── stack.hh └── tests ├── .gitignore ├── CMakeLists.txt ├── benchmarks ├── CMakeLists.txt ├── parsingbenchmark.cpp └── qlocalevsstrtod_l.cpp ├── cmdline_tester ├── .gitignore ├── CMakeLists.txt ├── cmdline_tester.cpp ├── cmdlineparser.cpp ├── cmdlineparser.h └── example.txt ├── parser ├── .gitignore ├── CMakeLists.txt └── testparser.cpp ├── qobjecthelper ├── .gitignore ├── CMakeLists.txt ├── person.cpp ├── person.h └── testqobjecthelper.cpp ├── scanner ├── CMakeLists.txt └── testscanner.cpp └── serializer ├── .gitignore ├── CMakeLists.txt └── testserializer.cpp /.gitattributes: -------------------------------------------------------------------------------- 1 | *.c text eol=lf 2 | *.cpp text eol=lf 3 | *.h text eol=lf 4 | *.m4 text eol=lf 5 | .gitattributes text eol=lf 6 | .gitignore text eol=lf 7 | *.md text eol=lf 8 | LICENSE text eol=lf 9 | configure.ac text eol=lf 10 | Makefile* text eol=lf 11 | *.pro text eol=lf 12 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.a 2 | *.config 3 | *.dll 4 | *.exe 5 | *.lib 6 | *.o 7 | *.qm 8 | *.so 9 | /autom4te.cache/ 10 | /build/ 11 | /config.guess 12 | /config.log 13 | /config.status 14 | /config.sub 15 | /configure 16 | /install-sh 17 | /Makefile 18 | /OMEdit*/bin/ 19 | /OMEdit*/build/release/ 20 | /OMEdit/generatedfiles/ 21 | /OMEdit/OMEditGUI/.qmake.stash 22 | /OMEdit/OMEditGUI/Debugger/Parser/GDBMIOutput.tokens 23 | /OMEdit/OMEditGUI/Debugger/Parser/GDBMIOutputLexer.c 24 | /OMEdit/OMEditGUI/Debugger/Parser/GDBMIOutputLexer.h 25 | /OMEdit/OMEditGUI/Debugger/Parser/GDBMIOutputParser.c 26 | /OMEdit/OMEditGUI/Debugger/Parser/GDBMIOutputParser.h 27 | /OMEdit/OMEditGUI/Debugger/Parser/libGDBMIParser.a 28 | /OMEdit/OMEditGUI/Debugger/Parser/Makefile.lib.unix 29 | /OMEdit/OMEditGUI/Makefile 30 | /OMEdit/OMEditGUI/Makefile.Debug 31 | /OMEdit/OMEditGUI/Makefile.Release 32 | /OMEdit/OMEditGUI/object_script.* 33 | /OMEdit/OMEditGUI/omc_config.h 34 | /OMEdit/OMEditGUI/OMC/Parser/OMCOutput.tokens 35 | /OMEdit/OMEditGUI/OMC/Parser/OMCOutputLexer.c 36 | /OMEdit/OMEditGUI/OMC/Parser/OMCOutputLexer.cpp 37 | /OMEdit/OMEditGUI/OMC/Parser/OMCOutputLexer.h 38 | /OMEdit/OMEditGUI/OMC/Parser/OMCOutputParser.c 39 | /OMEdit/OMEditGUI/OMC/Parser/OMCOutputParser.cpp 40 | /OMEdit/OMEditGUI/OMC/Parser/OMCOutputParser.h 41 | /OMEdit/OMEditGUI/OMEditGUI.pro.* 42 | /OMEdit/OMEditGUI/version.h 43 | /qjson-0.8.1/build/ 44 | /qmake.sh 45 | Makefile.unix 46 | qm.stamp 47 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "common"] 2 | path = common 3 | url = ../OpenModelica-common.git 4 | -------------------------------------------------------------------------------- /Makefile.in: -------------------------------------------------------------------------------- 1 | all: omedit 2 | 3 | prefix = @prefix@ 4 | exec_prefix = @exec_prefix@ 5 | bindir = @bindir@ 6 | CMAKE=CC="@CC@" CXX="@CXX@" CFLAGS="@CFLAGS@" CPPFLAGS="@CPPFLAGS@" cmake 7 | CMAKE_TARGET = "Unix Makefiles" 8 | 9 | ifeq (@APP@,) 10 | install: 11 | mkdir -p ${DESTDIR}/@bindir@ 12 | cp -a build/bin/OMEdit@EXE@ ${DESTDIR}/@bindir@ 13 | else 14 | install: 15 | mkdir -p ${DESTDIR}/Applications/ 16 | cp -a build/Applications/OMEdit@APP@ ${DESTDIR}/Applications/ 17 | endif 18 | mkdir -p ${DESTDIR}/lib/@host_short@/omc/ ${DESTDIR}/share/omedit/nls/ 19 | cp -a build/lib/@host_short@/omc/* ${DESTDIR}/lib/@host_short@/omc/ 20 | cp -a build/share/omedit/nls/* ${DESTDIR}/share/omedit/nls/ 21 | 22 | mkbuilddirs: 23 | mkdir -p build/bin @OMBUILDDIR@/share/omedit/nls @OMBUILDDIR@/lib/@host_short@/omc 24 | omedit: mkbuilddirs qjson-build 25 | $(MAKE) -C OMEdit/OMEditGUI -f Makefile.unix 26 | clean: 27 | $(MAKE) -C OMEdit/OMEditGUI -f Makefile.unix clean 28 | test ! -f qjson/build/Makefile || $(MAKE) -C qjson/build clean 29 | rm -rf qjson/build 30 | distclean: clean 31 | rm -f config.status configure Makefile OMEdit/OMEditGUI/Makefile.unix OMEdit/OMEditGUI/OMEdit.config 32 | Makefile: Makefile.in config.status 33 | ./config.status 34 | config.status: configure 35 | ./config.status -recheck 36 | configure: configure.ac common/m4/corba.m4 common/m4/omhome.m4 common/m4/qmake.m4 37 | autoconf 38 | 39 | qjson-build: 40 | test -d qjson 41 | mkdir -p qjson/build/include/qjson 42 | (cd qjson/build && test -f Makefile || CC="@CC@" CXX="@CXX@" CFLAGS="@CFLAGS@" CPPFLAGS="@CPPFLAGS@" CXXFLAGS="@CXXFLAGS@" $(CMAKE) .. @QT4BUILD@ -G $(CMAKE_TARGET)) 43 | test -f qjson/build/lib/libqjson$(SHREXT) || $(MAKE) -C qjson/build 44 | test ! `uname` = Darwin || install_name_tool -id @rpath/libqjson.0.dylib qjson/build/lib/libqjson.0.dylib 45 | cp -a qjson/build/lib/libqjson*$(SHREXT)* @OMBUILDDIR@/lib/@host_short@/omc/ 46 | cp -a qjson/src/*.h qjson/build/include/qjson 47 | -------------------------------------------------------------------------------- /Makefile.omdev.mingw: -------------------------------------------------------------------------------- 1 | ifeq ($(OMBUILDDIR),) 2 | $(error OMBUILDDIR variable is not set.) 3 | endif 4 | 5 | buildbin=$(OMBUILDDIR)/bin 6 | buildlib=$(OMBUILDDIR)/lib/omc 7 | 8 | OMDEVMSYS=$(shell cygpath $$OMDEV) 9 | 10 | all: omedit 11 | 12 | CC = gcc 13 | CXX = g++ 14 | 15 | ifeq (gcc,$(findstring gcc,$(CC))) 16 | override CFLAGS +=-falign-functions -fstack-protector-all 17 | endif 18 | AR = ar 19 | CMAKE = $(OMDEVMSYS)/bin/cmake/bin/cmake 20 | CMAKE_TARGET = "MSYS Makefiles" 21 | SHREXT=.dll 22 | 23 | mkbuilddirs: 24 | mkdir -p $(OMBUILDDIR)/share/omedit/nls 25 | mkdir -p $(buildlib) 26 | mkdir -p $(buildbin) 27 | 28 | omedit: mkbuilddirs qjson-build 29 | $(MAKE) -C OMEdit/OMEditGUI -f Makefile.omdev.mingw 30 | cp -puf common/pre-commit.sh $(shell git rev-parse --git-dir)/hooks/pre-commit 31 | 32 | clean: 33 | cd qjson && rm -rf build 34 | $(MAKE) -C OMEdit/OMEditGUI -f Makefile.omdev.mingw clean 35 | 36 | qjson-build: 37 | test -d qjson 38 | mkdir -p qjson/build/include/qjson 39 | (cd qjson/build && test -f Makefile || CC="$(CC)" CXX="$(CXX)" CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" $(CMAKE) -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -D CMAKE_AR:String="$(AR)" .. -DQT4_BUILD:Boolean=OFF -G $(CMAKE_TARGET) -DCMAKE_INSTALL_PREFIX:PATH=`pwd`) 40 | test -f qjson/build/lib/libqjson$(SHREXT) || $(MAKE) -C qjson/build install 41 | cp -a qjson/build/lib/libqjson*$(SHREXT)* $(OMBUILDDIR)/lib/omc/ 42 | cp -a qjson/build/bin/libqjson*$(SHREXT)* $(OMBUILDDIR)/lib/omc/ 43 | cp -a qjson/build/lib/libqjson*$(SHREXT)* $(OMBUILDDIR)/bin/ 44 | cp -a qjson/build/bin/libqjson*$(SHREXT)* $(OMBUILDDIR)/bin/ 45 | cp -a qjson/src/*.h qjson/build/include/qjson 46 | -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/Animation/AnimationWindow.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of OpenModelica. 3 | * 4 | * Copyright (c) 1998-CurrentYear, Open Source Modelica Consortium (OSMC), 5 | * c/o Linköpings universitet, Department of Computer and Information Science, 6 | * SE-58183 Linköping, Sweden. 7 | * 8 | * All rights reserved. 9 | * 10 | * THIS PROGRAM IS PROVIDED UNDER THE TERMS OF GPL VERSION 3 LICENSE OR 11 | * THIS OSMC PUBLIC LICENSE (OSMC-PL) VERSION 1.2. 12 | * ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS PROGRAM CONSTITUTES 13 | * RECIPIENT'S ACCEPTANCE OF THE OSMC PUBLIC LICENSE OR THE GPL VERSION 3, 14 | * ACCORDING TO RECIPIENTS CHOICE. 15 | * 16 | * The OpenModelica software and the Open Source Modelica 17 | * Consortium (OSMC) Public License (OSMC-PL) are obtained 18 | * from OSMC, either from the above address, 19 | * from the URLs: http://www.ida.liu.se/projects/OpenModelica or 20 | * http://www.openmodelica.org, and in the OpenModelica distribution. 21 | * GNU version 3 is obtained from: http://www.gnu.org/copyleft/gpl.html. 22 | * 23 | * This program is distributed WITHOUT ANY WARRANTY; without 24 | * even the implied warranty of MERCHANTABILITY or FITNESS 25 | * FOR A PARTICULAR PURPOSE, EXCEPT AS EXPRESSLY SET FORTH 26 | * IN THE BY RECIPIENT SELECTED SUBSIDIARY LICENSE CONDITIONS OF OSMC-PL. 27 | * 28 | * See the full OSMC Public License conditions for more details. 29 | * 30 | */ 31 | /* 32 | * @author Volker Waurich 33 | */ 34 | 35 | #ifndef ANIMATIONWINDOW_H 36 | #define ANIMATIONWINDOW_H 37 | 38 | #include "AbstractAnimationWindow.h" 39 | 40 | class AnimationWindow : public AbstractAnimationWindow 41 | { 42 | Q_OBJECT 43 | public: 44 | AnimationWindow(QWidget *pParent); 45 | ~AnimationWindow(); 46 | 47 | void createActions() override; 48 | }; 49 | 50 | #endif // ANIMATIONWINDOW_H 51 | -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/Animation/FMUSettingsDialog.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of OpenModelica. 3 | * 4 | * Copyright (c) 1998-CurrentYear, Open Source Modelica Consortium (OSMC), 5 | * c/o Linköpings universitet, Department of Computer and Information Science, 6 | * SE-58183 Linköping, Sweden. 7 | * 8 | * All rights reserved. 9 | * 10 | * THIS PROGRAM IS PROVIDED UNDER THE TERMS OF GPL VERSION 3 LICENSE OR 11 | * THIS OSMC PUBLIC LICENSE (OSMC-PL) VERSION 1.2. 12 | * ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS PROGRAM CONSTITUTES 13 | * RECIPIENT'S ACCEPTANCE OF THE OSMC PUBLIC LICENSE OR THE GPL VERSION 3, 14 | * ACCORDING TO RECIPIENTS CHOICE. 15 | * 16 | * The OpenModelica software and the Open Source Modelica 17 | * Consortium (OSMC) Public License (OSMC-PL) are obtained 18 | * from OSMC, either from the above address, 19 | * from the URLs: http://www.ida.liu.se/projects/OpenModelica or 20 | * http://www.openmodelica.org, and in the OpenModelica distribution. 21 | * GNU version 3 is obtained from: http://www.gnu.org/copyleft/gpl.html. 22 | * 23 | * This program is distributed WITHOUT ANY WARRANTY; without 24 | * even the implied warranty of MERCHANTABILITY or FITNESS 25 | * FOR A PARTICULAR PURPOSE, EXCEPT AS EXPRESSLY SET FORTH 26 | * IN THE BY RECIPIENT SELECTED SUBSIDIARY LICENSE CONDITIONS OF OSMC-PL. 27 | * 28 | * See the full OSMC Public License conditions for more details. 29 | * 30 | */ 31 | /* 32 | * @author Volker Waurich 33 | */ 34 | 35 | 36 | #ifndef FMU_SETTINGS_WINDOW_H 37 | #define FMU_SETTINGS_WINDOW_H 38 | 39 | #include "VisualizerFMU.h" 40 | 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | #include 47 | #include 48 | 49 | class FMUSettingsDialog : public QDialog 50 | { 51 | Q_OBJECT 52 | public: 53 | FMUSettingsDialog(QWidget *pParent, VisualizerFMU *pVisualizerFMU); 54 | private: 55 | VisualizerFMU *mpVisualizerFMU; 56 | double mStepSize; 57 | double mRenderFreq; 58 | bool mHandleEvents; 59 | QLineEdit* mpStepSizeLineEdit; 60 | QCheckBox* mpHandleEventsCheck; 61 | QComboBox* mpSolverComboBox; 62 | QPushButton *mpOkButton; 63 | QPushButton *mpCancelButton; 64 | QDialogButtonBox *mpButtonBox; 65 | public slots: 66 | void saveSimSettings(); 67 | }; 68 | 69 | 70 | #endif // end FMU_SETTINGS_WINDOW_H 71 | -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/Animation/GLWidget.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of OpenModelica. 3 | * 4 | * Copyright (c) 1998-CurrentYear, Open Source Modelica Consortium (OSMC), 5 | * c/o Linköpings universitet, Department of Computer and Information Science, 6 | * SE-58183 Linköping, Sweden. 7 | * 8 | * All rights reserved. 9 | * 10 | * THIS PROGRAM IS PROVIDED UNDER THE TERMS OF GPL VERSION 3 LICENSE OR 11 | * THIS OSMC PUBLIC LICENSE (OSMC-PL) VERSION 1.2. 12 | * ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE 13 | * OF THE OSMC PUBLIC LICENSE OR THE GPL VERSION 3, ACCORDING TO RECIPIENTS CHOICE. 14 | * 15 | * The OpenModelica software and the Open Source Modelica 16 | * Consortium (OSMC) Public License (OSMC-PL) are obtained 17 | * from OSMC, either from the above address, 18 | * from the URLs: http://www.ida.liu.se/projects/OpenModelica or 19 | * http://www.openmodelica.org, and in the OpenModelica distribution. 20 | * GNU version 3 is obtained from: http://www.gnu.org/copyleft/gpl.html. 21 | * 22 | * This program is distributed WITHOUT ANY WARRANTY; without 23 | * even the implied warranty of MERCHANTABILITY or FITNESS 24 | * FOR A PARTICULAR PURPOSE, EXCEPT AS EXPRESSLY SET FORTH 25 | * IN THE BY RECIPIENT SELECTED SUBSIDIARY LICENSE CONDITIONS OF OSMC-PL. 26 | * 27 | * See the full OSMC Public License conditions for more details. 28 | * 29 | */ 30 | /* 31 | * @author Adeel Asghar 32 | */ 33 | 34 | #include "GLWidget.h" 35 | 36 | /*! 37 | * \class GLWidget 38 | * \brief Qt 4 builds use this class for ViewerWidget.\n 39 | * QOpenGLWidget is only availble from Qt 5.4 40 | */ 41 | /*! 42 | * \brief GLWidget::GLWidget 43 | * \param parent 44 | * \param flags 45 | */ 46 | GLWidget::GLWidget(QWidget* parent, Qt::WindowFlags flags) 47 | : QGLWidget(parent, nullptr, flags) 48 | { 49 | 50 | } 51 | -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/Animation/GLWidget.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of OpenModelica. 3 | * 4 | * Copyright (c) 1998-CurrentYear, Open Source Modelica Consortium (OSMC), 5 | * c/o Linköpings universitet, Department of Computer and Information Science, 6 | * SE-58183 Linköping, Sweden. 7 | * 8 | * All rights reserved. 9 | * 10 | * THIS PROGRAM IS PROVIDED UNDER THE TERMS OF GPL VERSION 3 LICENSE OR 11 | * THIS OSMC PUBLIC LICENSE (OSMC-PL) VERSION 1.2. 12 | * ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE 13 | * OF THE OSMC PUBLIC LICENSE OR THE GPL VERSION 3, ACCORDING TO RECIPIENTS CHOICE. 14 | * 15 | * The OpenModelica software and the Open Source Modelica 16 | * Consortium (OSMC) Public License (OSMC-PL) are obtained 17 | * from OSMC, either from the above address, 18 | * from the URLs: http://www.ida.liu.se/projects/OpenModelica or 19 | * http://www.openmodelica.org, and in the OpenModelica distribution. 20 | * GNU version 3 is obtained from: http://www.gnu.org/copyleft/gpl.html. 21 | * 22 | * This program is distributed WITHOUT ANY WARRANTY; without 23 | * even the implied warranty of MERCHANTABILITY or FITNESS 24 | * FOR A PARTICULAR PURPOSE, EXCEPT AS EXPRESSLY SET FORTH 25 | * IN THE BY RECIPIENT SELECTED SUBSIDIARY LICENSE CONDITIONS OF OSMC-PL. 26 | * 27 | * See the full OSMC Public License conditions for more details. 28 | * 29 | */ 30 | /* 31 | * @author Adeel Asghar 32 | */ 33 | 34 | #ifndef GLWIDGET_H 35 | #define GLWIDGET_H 36 | 37 | #include 38 | 39 | class GLWidget : public QGLWidget 40 | { 41 | public: 42 | GLWidget(QWidget *pParent = 0, Qt::WindowFlags flags = 0); 43 | }; 44 | 45 | #endif // GLWIDGET_H 46 | -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/Animation/OpenGLWidget.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of OpenModelica. 3 | * 4 | * Copyright (c) 1998-CurrentYear, Open Source Modelica Consortium (OSMC), 5 | * c/o Linköpings universitet, Department of Computer and Information Science, 6 | * SE-58183 Linköping, Sweden. 7 | * 8 | * All rights reserved. 9 | * 10 | * THIS PROGRAM IS PROVIDED UNDER THE TERMS OF GPL VERSION 3 LICENSE OR 11 | * THIS OSMC PUBLIC LICENSE (OSMC-PL) VERSION 1.2. 12 | * ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE 13 | * OF THE OSMC PUBLIC LICENSE OR THE GPL VERSION 3, ACCORDING TO RECIPIENTS CHOICE. 14 | * 15 | * The OpenModelica software and the Open Source Modelica 16 | * Consortium (OSMC) Public License (OSMC-PL) are obtained 17 | * from OSMC, either from the above address, 18 | * from the URLs: http://www.ida.liu.se/projects/OpenModelica or 19 | * http://www.openmodelica.org, and in the OpenModelica distribution. 20 | * GNU version 3 is obtained from: http://www.gnu.org/copyleft/gpl.html. 21 | * 22 | * This program is distributed WITHOUT ANY WARRANTY; without 23 | * even the implied warranty of MERCHANTABILITY or FITNESS 24 | * FOR A PARTICULAR PURPOSE, EXCEPT AS EXPRESSLY SET FORTH 25 | * IN THE BY RECIPIENT SELECTED SUBSIDIARY LICENSE CONDITIONS OF OSMC-PL. 26 | * 27 | * See the full OSMC Public License conditions for more details. 28 | * 29 | */ 30 | /* 31 | * @author Adeel Asghar 32 | */ 33 | 34 | #include "OpenGLWidget.h" 35 | 36 | /*! 37 | * \class GLWidget 38 | * \brief Qt 5.4 or greater builds use this class for ViewerWidget.\n 39 | */ 40 | /*! 41 | * \brief GLWidget::GLWidget 42 | * \param parent 43 | * \param flags 44 | */ 45 | GLWidget::GLWidget(QWidget* parent, Qt::WindowFlags flags) 46 | : QOpenGLWidget(parent, flags) 47 | { 48 | 49 | } 50 | -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/Animation/OpenGLWidget.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of OpenModelica. 3 | * 4 | * Copyright (c) 1998-CurrentYear, Open Source Modelica Consortium (OSMC), 5 | * c/o Linköpings universitet, Department of Computer and Information Science, 6 | * SE-58183 Linköping, Sweden. 7 | * 8 | * All rights reserved. 9 | * 10 | * THIS PROGRAM IS PROVIDED UNDER THE TERMS OF GPL VERSION 3 LICENSE OR 11 | * THIS OSMC PUBLIC LICENSE (OSMC-PL) VERSION 1.2. 12 | * ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE 13 | * OF THE OSMC PUBLIC LICENSE OR THE GPL VERSION 3, ACCORDING TO RECIPIENTS CHOICE. 14 | * 15 | * The OpenModelica software and the Open Source Modelica 16 | * Consortium (OSMC) Public License (OSMC-PL) are obtained 17 | * from OSMC, either from the above address, 18 | * from the URLs: http://www.ida.liu.se/projects/OpenModelica or 19 | * http://www.openmodelica.org, and in the OpenModelica distribution. 20 | * GNU version 3 is obtained from: http://www.gnu.org/copyleft/gpl.html. 21 | * 22 | * This program is distributed WITHOUT ANY WARRANTY; without 23 | * even the implied warranty of MERCHANTABILITY or FITNESS 24 | * FOR A PARTICULAR PURPOSE, EXCEPT AS EXPRESSLY SET FORTH 25 | * IN THE BY RECIPIENT SELECTED SUBSIDIARY LICENSE CONDITIONS OF OSMC-PL. 26 | * 27 | * See the full OSMC Public License conditions for more details. 28 | * 29 | */ 30 | /* 31 | * @author Adeel Asghar 32 | */ 33 | 34 | #ifndef OPENGLWIDGET_H 35 | #define OPENGLWIDGET_H 36 | 37 | #include 38 | 39 | class GLWidget : public QOpenGLWidget 40 | { 41 | public: 42 | GLWidget(QWidget *pParent = 0, Qt::WindowFlags flags = 0); 43 | }; 44 | 45 | #endif // OPENGLWIDGET_H 46 | -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/Animation/ThreeDViewer.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of OpenModelica. 3 | * 4 | * Copyright (c) 1998-CurrentYear, Open Source Modelica Consortium (OSMC), 5 | * c/o Linköpings universitet, Department of Computer and Information Science, 6 | * SE-58183 Linköping, Sweden. 7 | * 8 | * All rights reserved. 9 | * 10 | * THIS PROGRAM IS PROVIDED UNDER THE TERMS OF GPL VERSION 3 LICENSE OR 11 | * THIS OSMC PUBLIC LICENSE (OSMC-PL) VERSION 1.2. 12 | * ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE 13 | * OF THE OSMC PUBLIC LICENSE OR THE GPL VERSION 3, ACCORDING TO RECIPIENTS CHOICE. 14 | * 15 | * The OpenModelica software and the Open Source Modelica 16 | * Consortium (OSMC) Public License (OSMC-PL) are obtained 17 | * from OSMC, either from the above address, 18 | * from the URLs: http://www.ida.liu.se/projects/OpenModelica or 19 | * http://www.openmodelica.org, and in the OpenModelica distribution. 20 | * GNU version 3 is obtained from: http://www.gnu.org/copyleft/gpl.html. 21 | * 22 | * This program is distributed WITHOUT ANY WARRANTY; without 23 | * even the implied warranty of MERCHANTABILITY or FITNESS 24 | * FOR A PARTICULAR PURPOSE, EXCEPT AS EXPRESSLY SET FORTH 25 | * IN THE BY RECIPIENT SELECTED SUBSIDIARY LICENSE CONDITIONS OF OSMC-PL. 26 | * 27 | * See the full OSMC Public License conditions for more details. 28 | * 29 | */ 30 | /* 31 | * @author Adeel Asghar 32 | */ 33 | 34 | #include "ThreeDViewer.h" 35 | #include "Visualizer.h" 36 | 37 | /*! 38 | * \class ThreeDViewer 39 | * \brief A QMainWindow for 3d view. 40 | */ 41 | /*! 42 | * \brief ThreeDViewer::ThreeDViewer 43 | * \param pParent 44 | */ 45 | ThreeDViewer::ThreeDViewer(QWidget *pParent) 46 | : AbstractAnimationWindow(pParent) 47 | { 48 | createActions(); 49 | } 50 | 51 | /*! 52 | * \brief ThreeDViewer::~ThreeDViewer 53 | */ 54 | ThreeDViewer::~ThreeDViewer() 55 | { 56 | if (mpVisualizer) { 57 | delete mpVisualizer; 58 | } 59 | } 60 | 61 | /*! 62 | * \brief ThreeDViewer::createActions 63 | */ 64 | void ThreeDViewer::createActions() 65 | { 66 | AbstractAnimationWindow::createActions(); 67 | mpAnimationToolBar->addWidget(mpPerspectiveDropDownBox); 68 | mpAnimationToolBar->addAction(mpRotateCameraLeftAction); 69 | mpAnimationToolBar->addAction(mpRotateCameraRightAction); 70 | } 71 | -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/Animation/ThreeDViewer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of OpenModelica. 3 | * 4 | * Copyright (c) 1998-CurrentYear, Open Source Modelica Consortium (OSMC), 5 | * c/o Linköpings universitet, Department of Computer and Information Science, 6 | * SE-58183 Linköping, Sweden. 7 | * 8 | * All rights reserved. 9 | * 10 | * THIS PROGRAM IS PROVIDED UNDER THE TERMS OF GPL VERSION 3 LICENSE OR 11 | * THIS OSMC PUBLIC LICENSE (OSMC-PL) VERSION 1.2. 12 | * ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE 13 | * OF THE OSMC PUBLIC LICENSE OR THE GPL VERSION 3, ACCORDING TO RECIPIENTS CHOICE. 14 | * 15 | * The OpenModelica software and the Open Source Modelica 16 | * Consortium (OSMC) Public License (OSMC-PL) are obtained 17 | * from OSMC, either from the above address, 18 | * from the URLs: http://www.ida.liu.se/projects/OpenModelica or 19 | * http://www.openmodelica.org, and in the OpenModelica distribution. 20 | * GNU version 3 is obtained from: http://www.gnu.org/copyleft/gpl.html. 21 | * 22 | * This program is distributed WITHOUT ANY WARRANTY; without 23 | * even the implied warranty of MERCHANTABILITY or FITNESS 24 | * FOR A PARTICULAR PURPOSE, EXCEPT AS EXPRESSLY SET FORTH 25 | * IN THE BY RECIPIENT SELECTED SUBSIDIARY LICENSE CONDITIONS OF OSMC-PL. 26 | * 27 | * See the full OSMC Public License conditions for more details. 28 | * 29 | */ 30 | /* 31 | * @author Adeel Asghar 32 | */ 33 | 34 | #ifndef THREEDVIEWER_H 35 | #define THREEDVIEWER_H 36 | 37 | #include "AbstractAnimationWindow.h" 38 | 39 | class ThreeDViewer : public AbstractAnimationWindow 40 | { 41 | Q_OBJECT 42 | public: 43 | ThreeDViewer(QWidget *pParent); 44 | ~ThreeDViewer(); 45 | void createActions() override; 46 | }; 47 | 48 | #endif // THREEDVIEWER_H 49 | -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/Animation/VisualizerCSV.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of OpenModelica. 3 | * 4 | * Copyright (c) 1998-CurrentYear, Open Source Modelica Consortium (OSMC), 5 | * c/o Linköpings universitet, Department of Computer and Information Science, 6 | * SE-58183 Linköping, Sweden. 7 | * 8 | * All rights reserved. 9 | * 10 | * THIS PROGRAM IS PROVIDED UNDER THE TERMS OF GPL VERSION 3 LICENSE OR 11 | * THIS OSMC PUBLIC LICENSE (OSMC-PL) VERSION 1.2. 12 | * ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE 13 | * OF THE OSMC PUBLIC LICENSE OR THE GPL VERSION 3, ACCORDING TO RECIPIENTS CHOICE. 14 | * 15 | * The OpenModelica software and the Open Source Modelica 16 | * Consortium (OSMC) Public License (OSMC-PL) are obtained 17 | * from OSMC, either from the above address, 18 | * from the URLs: http://www.ida.liu.se/projects/OpenModelica or 19 | * http://www.openmodelica.org, and in the OpenModelica distribution. 20 | * GNU version 3 is obtained from: http://www.gnu.org/copyleft/gpl.html. 21 | * 22 | * This program is distributed WITHOUT ANY WARRANTY; without 23 | * even the implied warranty of MERCHANTABILITY or FITNESS 24 | * FOR A PARTICULAR PURPOSE, EXCEPT AS EXPRESSLY SET FORTH 25 | * IN THE BY RECIPIENT SELECTED SUBSIDIARY LICENSE CONDITIONS OF OSMC-PL. 26 | * 27 | * See the full OSMC Public License conditions for more details. 28 | * 29 | */ 30 | /* 31 | * @author Adeel Asghar 32 | */ 33 | #ifndef VISUALIZERCSV_H 34 | #define VISUALIZERCSV_H 35 | 36 | #include "Visualizer.h" 37 | #include "util/read_csv.h" 38 | 39 | class VisualizerCSV : public VisualizerAbstract 40 | { 41 | public: 42 | VisualizerCSV() = delete; 43 | VisualizerCSV(const std::string& fileName, const std::string& path); 44 | ~VisualizerCSV(); 45 | VisualizerCSV(const VisualizerCSV& omvm) = delete; 46 | VisualizerCSV& operator=(const VisualizerCSV& omvm) = delete; 47 | void initData() override; 48 | void initializeVisAttributes(const double time = -1.0) override; 49 | void readCSV(const std::string& modelFile, const std::string& path); 50 | void simulate(TimeManager& omvm) override {Q_UNUSED(omvm);} 51 | void updateVisAttributes(const double time) override; 52 | void updateScene(const double time) override; 53 | void updateObjectAttributeCSV(ShapeObjectAttribute* attr, double time); 54 | double omcGetVarValue(const char* varName, double time); 55 | private: 56 | csv_data *mpCSVData; 57 | }; 58 | 59 | #endif // VISUALIZERCSV_H 60 | -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/Animation/VisualizerMAT.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of OpenModelica. 3 | * 4 | * Copyright (c) 1998-CurrentYear, Open Source Modelica Consortium (OSMC), 5 | * c/o Linköpings universitet, Department of Computer and Information Science, 6 | * SE-58183 Linköping, Sweden. 7 | * 8 | * All rights reserved. 9 | * 10 | * THIS PROGRAM IS PROVIDED UNDER THE TERMS OF GPL VERSION 3 LICENSE OR 11 | * THIS OSMC PUBLIC LICENSE (OSMC-PL) VERSION 1.2. 12 | * ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS PROGRAM CONSTITUTES 13 | * RECIPIENT'S ACCEPTANCE OF THE OSMC PUBLIC LICENSE OR THE GPL VERSION 3, 14 | * ACCORDING TO RECIPIENTS CHOICE. 15 | * 16 | * The OpenModelica software and the Open Source Modelica 17 | * Consortium (OSMC) Public License (OSMC-PL) are obtained 18 | * from OSMC, either from the above address, 19 | * from the URLs: http://www.ida.liu.se/projects/OpenModelica or 20 | * http://www.openmodelica.org, and in the OpenModelica distribution. 21 | * GNU version 3 is obtained from: http://www.gnu.org/copyleft/gpl.html. 22 | * 23 | * This program is distributed WITHOUT ANY WARRANTY; without 24 | * even the implied warranty of MERCHANTABILITY or FITNESS 25 | * FOR A PARTICULAR PURPOSE, EXCEPT AS EXPRESSLY SET FORTH 26 | * IN THE BY RECIPIENT SELECTED SUBSIDIARY LICENSE CONDITIONS OF OSMC-PL. 27 | * 28 | * See the full OSMC Public License conditions for more details. 29 | * 30 | */ 31 | /* 32 | * @author Volker Waurich 33 | */ 34 | 35 | #ifndef VISUALIZERMAT_H 36 | #define VISUALIZERMAT_H 37 | 38 | #include "Visualizer.h" 39 | #include "util/read_matlab4.h" 40 | 41 | class VisualizerMAT : public VisualizerAbstract 42 | { 43 | public: 44 | VisualizerMAT() = delete; 45 | VisualizerMAT(const std::string& fileName, const std::string& path); 46 | ~VisualizerMAT(); 47 | VisualizerMAT(const VisualizerMAT& omvm) = delete; 48 | VisualizerMAT& operator=(const VisualizerMAT& omvm) = delete; 49 | void initData() override; 50 | void initializeVisAttributes(const double time = -1.0) override; 51 | void readMat(const std::string& modelFile, const std::string& path); 52 | void setSimulationSettings(const UserSimSettingsMAT& simSetMAT); 53 | void simulate(TimeManager& omvm) override {Q_UNUSED(omvm);} 54 | void updateVisAttributes(const double time) override; 55 | void updateScene(const double time) override; 56 | void updateObjectAttributeMAT(ShapeObjectAttribute* attr, double time, ModelicaMatReader* reader); 57 | double omcGetVarValue(ModelicaMatReader* reader, const char* varName, double time); 58 | private: 59 | ModelicaMatReader _matReader; 60 | }; 61 | 62 | #endif // end VISUALIZERMAT_H 63 | -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/Annotations/BitmapAnnotation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of OpenModelica. 3 | * 4 | * Copyright (c) 1998-CurrentYear, Open Source Modelica Consortium (OSMC), 5 | * c/o Linköpings universitet, Department of Computer and Information Science, 6 | * SE-58183 Linköping, Sweden. 7 | * 8 | * All rights reserved. 9 | * 10 | * THIS PROGRAM IS PROVIDED UNDER THE TERMS OF GPL VERSION 3 LICENSE OR 11 | * THIS OSMC PUBLIC LICENSE (OSMC-PL) VERSION 1.2. 12 | * ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS PROGRAM CONSTITUTES 13 | * RECIPIENT'S ACCEPTANCE OF THE OSMC PUBLIC LICENSE OR THE GPL VERSION 3, 14 | * ACCORDING TO RECIPIENTS CHOICE. 15 | * 16 | * The OpenModelica software and the Open Source Modelica 17 | * Consortium (OSMC) Public License (OSMC-PL) are obtained 18 | * from OSMC, either from the above address, 19 | * from the URLs: http://www.ida.liu.se/projects/OpenModelica or 20 | * http://www.openmodelica.org, and in the OpenModelica distribution. 21 | * GNU version 3 is obtained from: http://www.gnu.org/copyleft/gpl.html. 22 | * 23 | * This program is distributed WITHOUT ANY WARRANTY; without 24 | * even the implied warranty of MERCHANTABILITY or FITNESS 25 | * FOR A PARTICULAR PURPOSE, EXCEPT AS EXPRESSLY SET FORTH 26 | * IN THE BY RECIPIENT SELECTED SUBSIDIARY LICENSE CONDITIONS OF OSMC-PL. 27 | * 28 | * See the full OSMC Public License conditions for more details. 29 | * 30 | */ 31 | /* 32 | * @author Adeel Asghar 33 | */ 34 | 35 | #ifndef BITMAPANNOTATION_H 36 | #define BITMAPANNOTATION_H 37 | 38 | #include "ShapeAnnotation.h" 39 | #include "Util/Utilities.h" 40 | 41 | class Component; 42 | class BitmapAnnotation : public ShapeAnnotation 43 | { 44 | Q_OBJECT 45 | public: 46 | // Used for icon/diagram shape 47 | BitmapAnnotation(QString classFileName, QString annotation, GraphicsView *pGraphicsView); 48 | // Used for shape inside a component 49 | BitmapAnnotation(ShapeAnnotation *pShapeAnnotation, Component *pParent); 50 | // Used for icon/diagram inherited shape 51 | BitmapAnnotation(ShapeAnnotation *pShapeAnnotation, GraphicsView *pGraphicsView); 52 | // Used for OMSimulator FMU 53 | BitmapAnnotation(QString classFileName, GraphicsView *pGraphicsView); 54 | void parseShapeAnnotation(QString annotation); 55 | QRectF boundingRect() const; 56 | QPainterPath shape() const; 57 | void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0); 58 | void drawBitmapAnnotaion(QPainter *painter); 59 | QString getOMCShapeAnnotation(); 60 | QString getShapeAnnotation(); 61 | void updateShape(ShapeAnnotation *pShapeAnnotation); 62 | private: 63 | Component *mpComponent; 64 | public slots: 65 | void duplicate(); 66 | }; 67 | 68 | #endif // BITMAPANNOTATION_H 69 | -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/Annotations/EllipseAnnotation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of OpenModelica. 3 | * 4 | * Copyright (c) 1998-CurrentYear, Open Source Modelica Consortium (OSMC), 5 | * c/o Linköpings universitet, Department of Computer and Information Science, 6 | * SE-58183 Linköping, Sweden. 7 | * 8 | * All rights reserved. 9 | * 10 | * THIS PROGRAM IS PROVIDED UNDER THE TERMS OF GPL VERSION 3 LICENSE OR 11 | * THIS OSMC PUBLIC LICENSE (OSMC-PL) VERSION 1.2. 12 | * ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS PROGRAM CONSTITUTES 13 | * RECIPIENT'S ACCEPTANCE OF THE OSMC PUBLIC LICENSE OR THE GPL VERSION 3, 14 | * ACCORDING TO RECIPIENTS CHOICE. 15 | * 16 | * The OpenModelica software and the Open Source Modelica 17 | * Consortium (OSMC) Public License (OSMC-PL) are obtained 18 | * from OSMC, either from the above address, 19 | * from the URLs: http://www.ida.liu.se/projects/OpenModelica or 20 | * http://www.openmodelica.org, and in the OpenModelica distribution. 21 | * GNU version 3 is obtained from: http://www.gnu.org/copyleft/gpl.html. 22 | * 23 | * This program is distributed WITHOUT ANY WARRANTY; without 24 | * even the implied warranty of MERCHANTABILITY or FITNESS 25 | * FOR A PARTICULAR PURPOSE, EXCEPT AS EXPRESSLY SET FORTH 26 | * IN THE BY RECIPIENT SELECTED SUBSIDIARY LICENSE CONDITIONS OF OSMC-PL. 27 | * 28 | * See the full OSMC Public License conditions for more details. 29 | * 30 | */ 31 | /* 32 | * @author Adeel Asghar 33 | */ 34 | 35 | #ifndef ELLIPSEANNOTATION_H 36 | #define ELLIPSEANNOTATION_H 37 | 38 | #include "ShapeAnnotation.h" 39 | 40 | class Component; 41 | class EllipseAnnotation : public ShapeAnnotation 42 | { 43 | Q_OBJECT 44 | public: 45 | // Used for icon/diagram shape 46 | EllipseAnnotation(QString annotation, GraphicsView *pGraphicsView); 47 | // Used for shape inside a component 48 | EllipseAnnotation(ShapeAnnotation *pShapeAnnotation, Component *pParent); 49 | // Used for icon/diagram inherited shape 50 | EllipseAnnotation(ShapeAnnotation *pShapeAnnotation, GraphicsView *pGraphicsView); 51 | void parseShapeAnnotation(QString annotation); 52 | QRectF boundingRect() const; 53 | QPainterPath shape() const; 54 | void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0); 55 | void drawEllipseAnnotaion(QPainter *painter); 56 | QString getOMCShapeAnnotation(); 57 | QString getShapeAnnotation(); 58 | void updateShape(ShapeAnnotation *pShapeAnnotation); 59 | public slots: 60 | void duplicate(); 61 | }; 62 | 63 | #endif // ELLIPSEANNOTATION_H 64 | -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/Annotations/PolygonAnnotation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of OpenModelica. 3 | * 4 | * Copyright (c) 1998-CurrentYear, Open Source Modelica Consortium (OSMC), 5 | * c/o Linköpings universitet, Department of Computer and Information Science, 6 | * SE-58183 Linköping, Sweden. 7 | * 8 | * All rights reserved. 9 | * 10 | * THIS PROGRAM IS PROVIDED UNDER THE TERMS OF GPL VERSION 3 LICENSE OR 11 | * THIS OSMC PUBLIC LICENSE (OSMC-PL) VERSION 1.2. 12 | * ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS PROGRAM CONSTITUTES 13 | * RECIPIENT'S ACCEPTANCE OF THE OSMC PUBLIC LICENSE OR THE GPL VERSION 3, 14 | * ACCORDING TO RECIPIENTS CHOICE. 15 | * 16 | * The OpenModelica software and the Open Source Modelica 17 | * Consortium (OSMC) Public License (OSMC-PL) are obtained 18 | * from OSMC, either from the above address, 19 | * from the URLs: http://www.ida.liu.se/projects/OpenModelica or 20 | * http://www.openmodelica.org, and in the OpenModelica distribution. 21 | * GNU version 3 is obtained from: http://www.gnu.org/copyleft/gpl.html. 22 | * 23 | * This program is distributed WITHOUT ANY WARRANTY; without 24 | * even the implied warranty of MERCHANTABILITY or FITNESS 25 | * FOR A PARTICULAR PURPOSE, EXCEPT AS EXPRESSLY SET FORTH 26 | * IN THE BY RECIPIENT SELECTED SUBSIDIARY LICENSE CONDITIONS OF OSMC-PL. 27 | * 28 | * See the full OSMC Public License conditions for more details. 29 | * 30 | */ 31 | /* 32 | * @author Adeel Asghar 33 | */ 34 | 35 | #ifndef POLYGONANNOTATION_H 36 | #define POLYGONANNOTATION_H 37 | 38 | #include "ShapeAnnotation.h" 39 | 40 | class Component; 41 | class PolygonAnnotation : public ShapeAnnotation 42 | { 43 | Q_OBJECT 44 | public: 45 | // Used for icon/diagram shape 46 | PolygonAnnotation(QString annotation, GraphicsView *pGraphicsView); 47 | // Used for shape inside a component 48 | PolygonAnnotation(ShapeAnnotation *pShapeAnnotation, Component *pParent); 49 | // Used for icon/diagram inherited shape 50 | PolygonAnnotation(ShapeAnnotation *pShapeAnnotation, GraphicsView *pGraphicsView); 51 | // Used for default input/output component 52 | PolygonAnnotation(Component *pParent); 53 | void parseShapeAnnotation(QString annotation); 54 | QPainterPath getShape() const; 55 | QRectF boundingRect() const; 56 | QPainterPath shape() const; 57 | void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0); 58 | void drawPolygonAnnotaion(QPainter *painter); 59 | QString getOMCShapeAnnotation(); 60 | QString getShapeAnnotation(); 61 | void addPoint(QPointF point); 62 | void removePoint(int index); 63 | void clearPoints(); 64 | void updateEndPoint(QPointF point); 65 | void updateShape(ShapeAnnotation *pShapeAnnotation); 66 | public slots: 67 | void duplicate(); 68 | }; 69 | 70 | #endif // POLYGONANNOTATION_H 71 | -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/Annotations/RectangleAnnotation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of OpenModelica. 3 | * 4 | * Copyright (c) 1998-CurrentYear, Open Source Modelica Consortium (OSMC), 5 | * c/o Linköpings universitet, Department of Computer and Information Science, 6 | * SE-58183 Linköping, Sweden. 7 | * 8 | * All rights reserved. 9 | * 10 | * THIS PROGRAM IS PROVIDED UNDER THE TERMS OF GPL VERSION 3 LICENSE OR 11 | * THIS OSMC PUBLIC LICENSE (OSMC-PL) VERSION 1.2. 12 | * ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS PROGRAM CONSTITUTES 13 | * RECIPIENT'S ACCEPTANCE OF THE OSMC PUBLIC LICENSE OR THE GPL VERSION 3, 14 | * ACCORDING TO RECIPIENTS CHOICE. 15 | * 16 | * The OpenModelica software and the Open Source Modelica 17 | * Consortium (OSMC) Public License (OSMC-PL) are obtained 18 | * from OSMC, either from the above address, 19 | * from the URLs: http://www.ida.liu.se/projects/OpenModelica or 20 | * http://www.openmodelica.org, and in the OpenModelica distribution. 21 | * GNU version 3 is obtained from: http://www.gnu.org/copyleft/gpl.html. 22 | * 23 | * This program is distributed WITHOUT ANY WARRANTY; without 24 | * even the implied warranty of MERCHANTABILITY or FITNESS 25 | * FOR A PARTICULAR PURPOSE, EXCEPT AS EXPRESSLY SET FORTH 26 | * IN THE BY RECIPIENT SELECTED SUBSIDIARY LICENSE CONDITIONS OF OSMC-PL. 27 | * 28 | * See the full OSMC Public License conditions for more details. 29 | * 30 | */ 31 | /* 32 | * @author Adeel Asghar 33 | */ 34 | 35 | #ifndef RECTANGLEANNOTATION_H 36 | #define RECTANGLEANNOTATION_H 37 | 38 | #include "ShapeAnnotation.h" 39 | 40 | class Component; 41 | class RectangleAnnotation : public ShapeAnnotation 42 | { 43 | Q_OBJECT 44 | public: 45 | // Used for icon/diagram shape 46 | RectangleAnnotation(QString annotation, GraphicsView *pGraphicsView); 47 | // Used for shape inside a component 48 | RectangleAnnotation(ShapeAnnotation *pShapeAnnotation, Component *pParent); 49 | // Used for icon/diagram inherited shape 50 | RectangleAnnotation(ShapeAnnotation *pShapeAnnotation, GraphicsView *pGraphicsView); 51 | // Used for default component 52 | RectangleAnnotation(Component *pParent); 53 | // Used for OMSimulator FMU 54 | RectangleAnnotation(GraphicsView *pGraphicsView); 55 | void parseShapeAnnotation(QString annotation); 56 | QRectF boundingRect() const; 57 | QPainterPath shape() const; 58 | void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0); 59 | void drawRectangleAnnotaion(QPainter *painter); 60 | QString getOMCShapeAnnotation(); 61 | QString getShapeAnnotation(); 62 | void updateShape(ShapeAnnotation *pShapeAnnotation); 63 | public slots: 64 | void duplicate(); 65 | }; 66 | 67 | #endif // RECTANGLEANNOTATION_H 68 | -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/CrashReport/CrashReportDialog.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of OpenModelica. 3 | * 4 | * Copyright (c) 1998-CurrentYear, Open Source Modelica Consortium (OSMC), 5 | * c/o Linköpings universitet, Department of Computer and Information Science, 6 | * SE-58183 Linköping, Sweden. 7 | * 8 | * All rights reserved. 9 | * 10 | * THIS PROGRAM IS PROVIDED UNDER THE TERMS OF GPL VERSION 3 LICENSE OR 11 | * THIS OSMC PUBLIC LICENSE (OSMC-PL) VERSION 1.2. 12 | * ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE 13 | * OF THE OSMC PUBLIC LICENSE OR THE GPL VERSION 3, ACCORDING TO RECIPIENTS CHOICE. 14 | * 15 | * The OpenModelica software and the Open Source Modelica 16 | * Consortium (OSMC) Public License (OSMC-PL) are obtained 17 | * from OSMC, either from the above address, 18 | * from the URLs: http://www.ida.liu.se/projects/OpenModelica or 19 | * http://www.openmodelica.org, and in the OpenModelica distribution. 20 | * GNU version 3 is obtained from: http://www.gnu.org/copyleft/gpl.html. 21 | * 22 | * This program is distributed WITHOUT ANY WARRANTY; without 23 | * even the implied warranty of MERCHANTABILITY or FITNESS 24 | * FOR A PARTICULAR PURPOSE, EXCEPT AS EXPRESSLY SET FORTH 25 | * IN THE BY RECIPIENT SELECTED SUBSIDIARY LICENSE CONDITIONS OF OSMC-PL. 26 | * 27 | * See the full OSMC Public License conditions for more details. 28 | * 29 | */ 30 | /* 31 | * @author Adeel Asghar 32 | */ 33 | 34 | #ifndef CRASHREPORTDIALOG_H 35 | #define CRASHREPORTDIALOG_H 36 | 37 | #include 38 | #if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)) 39 | #include 40 | #include 41 | #else 42 | #include 43 | #endif 44 | 45 | #include "Util/Utilities.h" 46 | 47 | #include 48 | #include 49 | #include 50 | 51 | class CrashReportDialog : public QDialog 52 | { 53 | Q_OBJECT 54 | public: 55 | CrashReportDialog(QString stacktrace); 56 | private: 57 | QString mStackTrace; 58 | Label *mpCrashReportHeading; 59 | QFrame *mpHorizontalLine; 60 | Label *mpEmailLabel; 61 | QLineEdit *mpEmailTextBox; 62 | Label *mpBugDescriptionLabel; 63 | QPlainTextEdit *mpBugDescriptionTextBox; 64 | Label *mpFilesDescriptionLabel; 65 | QCheckBox *mpOMEditCommunicationLogFileCheckBox; 66 | QCheckBox *mpOMEditCommandsMosFileCheckBox; 67 | QCheckBox *mpOMStackTraceFileCheckBox; 68 | QPushButton *mpSendReportButton; 69 | QPushButton *mpCancelButton; 70 | QDialogButtonBox *mpButtonBox; 71 | Label *mpProgressLabel; 72 | QProgressBar *mpProgressBar; 73 | 74 | void createGDBBacktrace(); 75 | public slots: 76 | void sendReport(); 77 | void reportSent(QNetworkReply *pNetworkReply); 78 | }; 79 | 80 | #endif // CRASHREPORTDIALOG_H 81 | -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/CrashReport/GDBBacktrace.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of OpenModelica. 3 | * 4 | * Copyright (c) 1998-CurrentYear, Open Source Modelica Consortium (OSMC), 5 | * c/o Linköpings universitet, Department of Computer and Information Science, 6 | * SE-58183 Linköping, Sweden. 7 | * 8 | * All rights reserved. 9 | * 10 | * THIS PROGRAM IS PROVIDED UNDER THE TERMS OF GPL VERSION 3 LICENSE OR 11 | * THIS OSMC PUBLIC LICENSE (OSMC-PL) VERSION 1.2. 12 | * ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE 13 | * OF THE OSMC PUBLIC LICENSE OR THE GPL VERSION 3, ACCORDING TO RECIPIENTS CHOICE. 14 | * 15 | * The OpenModelica software and the Open Source Modelica 16 | * Consortium (OSMC) Public License (OSMC-PL) are obtained 17 | * from OSMC, either from the above address, 18 | * from the URLs: http://www.ida.liu.se/projects/OpenModelica or 19 | * http://www.openmodelica.org, and in the OpenModelica distribution. 20 | * GNU version 3 is obtained from: http://www.gnu.org/copyleft/gpl.html. 21 | * 22 | * This program is distributed WITHOUT ANY WARRANTY; without 23 | * even the implied warranty of MERCHANTABILITY or FITNESS 24 | * FOR A PARTICULAR PURPOSE, EXCEPT AS EXPRESSLY SET FORTH 25 | * IN THE BY RECIPIENT SELECTED SUBSIDIARY LICENSE CONDITIONS OF OSMC-PL. 26 | * 27 | * See the full OSMC Public License conditions for more details. 28 | * 29 | */ 30 | /* 31 | * @author Adeel Asghar 32 | */ 33 | 34 | #ifndef GDBBACKTRACE_H 35 | #define GDBBACKTRACE_H 36 | 37 | #include 38 | 39 | class GDBBacktrace : public QObject 40 | { 41 | Q_OBJECT 42 | public: 43 | GDBBacktrace(QObject *parent = 0); 44 | QString output() {return mOutput;} 45 | bool errorOccurred() {return mErrorOccurred;} 46 | private: 47 | QString mOutput; 48 | bool mErrorOccurred; 49 | 50 | QString createCommandsFile(QString *errorString); 51 | }; 52 | 53 | #endif // GDBBACKTRACE_H 54 | -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/CrashReport/backtrace.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2010 , 3 | Cloud Wu . All rights reserved. 4 | 5 | http://www.codingnow.com 6 | 7 | Use, modification and distribution are subject to the "New BSD License" 8 | as listed at . 9 | */ 10 | 11 | #ifndef BACKTRACE_H 12 | #define BACKTRACE_H 13 | 14 | #ifdef QT_NO_DEBUG 15 | 16 | #define GCC_VERSION (__GNUC__ * 10000 \ 17 | + __GNUC_MINOR__ * 100 \ 18 | + __GNUC_PATCHLEVEL__) 19 | 20 | #ifdef WIN32 21 | #ifdef __cplusplus 22 | extern "C" { 23 | #endif 24 | 25 | #include 26 | #include 27 | #include 28 | #if defined(__MINGW32__) && ((GCC_VERSION > 40900) || defined(__clang__)) 29 | #define PACKAGE OMEdit 30 | #include 31 | #else 32 | #include 33 | #endif 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | 41 | #define BUFFER_MAX (16*1024) 42 | 43 | struct bfd_ctx { 44 | bfd * handle; 45 | asymbol ** symbol; 46 | }; 47 | 48 | struct bfd_set { 49 | char * name; 50 | struct bfd_ctx * bc; 51 | struct bfd_set *next; 52 | }; 53 | 54 | struct find_info { 55 | asymbol **symbol; 56 | bfd_vma counter; 57 | const char *file; 58 | const char *func; 59 | unsigned line; 60 | }; 61 | 62 | struct output_buffer { 63 | char * buf; 64 | size_t sz; 65 | size_t ptr; 66 | }; 67 | 68 | void output_init(struct output_buffer *ob, char * buf, size_t sz); 69 | void output_print(struct output_buffer *ob, const char * format, ...); 70 | void _backtrace(struct output_buffer *ob, struct bfd_set *set, int depth , LPCONTEXT context); 71 | void release_set(struct bfd_set *set); 72 | 73 | #ifdef __cplusplus 74 | } /* extern "C" */ 75 | #endif 76 | #endif // #ifdef WIN32 77 | #endif // #ifdef QT_NO_DEBUG 78 | #endif // BACKTRACE_H 79 | -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/Debugger/Attach/AttachToProcessDialog.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of OpenModelica. 3 | * 4 | * Copyright (c) 1998-CurrentYear, Open Source Modelica Consortium (OSMC), 5 | * c/o Linköpings universitet, Department of Computer and Information Science, 6 | * SE-58183 Linköping, Sweden. 7 | * 8 | * All rights reserved. 9 | * 10 | * THIS PROGRAM IS PROVIDED UNDER THE TERMS OF GPL VERSION 3 LICENSE OR 11 | * THIS OSMC PUBLIC LICENSE (OSMC-PL) VERSION 1.2. 12 | * ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE 13 | * OF THE OSMC PUBLIC LICENSE OR THE GPL VERSION 3, ACCORDING TO RECIPIENTS CHOICE. 14 | * 15 | * The OpenModelica software and the Open Source Modelica 16 | * Consortium (OSMC) Public License (OSMC-PL) are obtained 17 | * from OSMC, either from the above address, 18 | * from the URLs: http://www.ida.liu.se/projects/OpenModelica or 19 | * http://www.openmodelica.org, and in the OpenModelica distribution. 20 | * GNU version 3 is obtained from: http://www.gnu.org/copyleft/gpl.html. 21 | * 22 | * This program is distributed WITHOUT ANY WARRANTY; without 23 | * even the implied warranty of MERCHANTABILITY or FITNESS 24 | * FOR A PARTICULAR PURPOSE, EXCEPT AS EXPRESSLY SET FORTH 25 | * IN THE BY RECIPIENT SELECTED SUBSIDIARY LICENSE CONDITIONS OF OSMC-PL. 26 | * 27 | * See the full OSMC Public License conditions for more details. 28 | * 29 | */ 30 | /* 31 | * @author Adeel Asghar 32 | */ 33 | 34 | #ifndef ATTACHTOPROCESSDIALOG_H 35 | #define ATTACHTOPROCESSDIALOG_H 36 | 37 | #include 38 | #include 39 | #include 40 | #include 41 | 42 | #include "ProcessListModel.h" 43 | 44 | class Label; 45 | class AttachToProcessDialog : public QDialog 46 | { 47 | Q_OBJECT 48 | public: 49 | AttachToProcessDialog(QWidget *pParent = 0); 50 | private: 51 | Label *mpAttachToProcessIDLabel; 52 | QLineEdit *mpAttachToProcessIDTextBox; 53 | QLineEdit *mpFilterProcessesTextBox; 54 | ProcessListModel *mpProcessListModel; 55 | ProcessListFilterModel mProcessListFilterModel; 56 | QTreeView *mpProcessesTreeView; 57 | QPushButton *mpOkButton; 58 | QPushButton *mpRefreshButton; 59 | QPushButton *mpCancelButton; 60 | QDialogButtonBox *mpButtonBox; 61 | public slots: 62 | void attachProcess(); 63 | void updateProcessList(); 64 | void processIDChanged(const QString &pid); 65 | void setFilterString(const QString &filter); 66 | void processSelected(const QModelIndex &index); 67 | void processClicked(const QModelIndex &index); 68 | }; 69 | 70 | #endif // ATTACHTOPROCESSDIALOG_H 71 | -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/Debugger/Breakpoints/BreakpointDialog.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of OpenModelica. 3 | * 4 | * Copyright (c) 1998-CurrentYear, Open Source Modelica Consortium (OSMC), 5 | * c/o Linköpings universitet, Department of Computer and Information Science, 6 | * SE-58183 Linköping, Sweden. 7 | * 8 | * All rights reserved. 9 | * 10 | * THIS PROGRAM IS PROVIDED UNDER THE TERMS OF GPL VERSION 3 LICENSE OR 11 | * THIS OSMC PUBLIC LICENSE (OSMC-PL) VERSION 1.2. 12 | * ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE 13 | * OF THE OSMC PUBLIC LICENSE OR THE GPL VERSION 3, ACCORDING TO RECIPIENTS CHOICE. 14 | * 15 | * The OpenModelica software and the Open Source Modelica 16 | * Consortium (OSMC) Public License (OSMC-PL) are obtained 17 | * from OSMC, either from the above address, 18 | * from the URLs: http://www.ida.liu.se/projects/OpenModelica or 19 | * http://www.openmodelica.org, and in the OpenModelica distribution. 20 | * GNU version 3 is obtained from: http://www.gnu.org/copyleft/gpl.html. 21 | * 22 | * This program is distributed WITHOUT ANY WARRANTY; without 23 | * even the implied warranty of MERCHANTABILITY or FITNESS 24 | * FOR A PARTICULAR PURPOSE, EXCEPT AS EXPRESSLY SET FORTH 25 | * IN THE BY RECIPIENT SELECTED SUBSIDIARY LICENSE CONDITIONS OF OSMC-PL. 26 | * 27 | * See the full OSMC Public License conditions for more details. 28 | * 29 | */ 30 | /* 31 | * @author Adeel Asghar 32 | */ 33 | 34 | #ifndef BREAKPOINTDIALOG_H 35 | #define BREAKPOINTDIALOG_H 36 | 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | 43 | class BreakpointTreeItem; 44 | class BreakpointsTreeModel; 45 | class Label; 46 | 47 | class BreakpointDialog : public QDialog 48 | { 49 | Q_OBJECT 50 | public: 51 | BreakpointDialog(BreakpointTreeItem *pBreakpointTreeItem, BreakpointsTreeModel* pBreakpointsTreeModel); 52 | private: 53 | BreakpointTreeItem *mpBreakpointTreeItem; 54 | BreakpointsTreeModel *mpBreakpointsTreeModel; 55 | Label *mpFileNameLabel; 56 | QLineEdit *mpFileNameTextBox; 57 | QPushButton *mpBrowseClassesButton; 58 | QPushButton *mpBrowseFileSystemButton; 59 | Label *mpLineNumberLabel; 60 | QLineEdit *mpLineNumberTextBox; 61 | Label *mpEnableLabel; 62 | QCheckBox *mpEnableCheckBox; 63 | Label *mpIgnoreCountLabel; 64 | QSpinBox *mpIgnoreCountSpinBox; 65 | Label *mpConditionLabel; 66 | QLineEdit *mpConditionTextBox; 67 | Label *mpConditionHintLabel; 68 | QPushButton *mpOkButton; 69 | QPushButton *mpCancelButton; 70 | QDialogButtonBox *mpButtonBox; 71 | public slots: 72 | void browseClasses(); 73 | void browseFileSystem(); 74 | void addOrEditBreakpoint(); 75 | }; 76 | 77 | #endif // BREAKPOINTDIALOG_H 78 | -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/Debugger/Parser/Makefile.common: -------------------------------------------------------------------------------- 1 | ANTLRCMD=java -cp $(ANTLRJAR) org.antlr.Tool -Xconversiontimeout 10000 -report 2 | 3 | all: parsergen $(EXE) libantlr3.a 4 | 5 | $(ANTLR)/antlr3config.h: $(ANTLR)/antlr3config.h.in $(ANTLR)/configure 6 | (cd $(ANTLR) && ./configure $(ANTLR64) $(ANTLRDEBUG) CC="$(CC)" LDFLAGS="" CFLAGS="" CPPFLAGS="") 7 | libantlr3.a: $(ANTLR)/src/*.c $(ANTLR)/include/*.h $(ANTLR)/antlr3config.h 8 | # build the library 9 | $(CC) ${CFLAGS} ${CPPFLAGS} -c $(ANTLR)/src/*.c -I$(ANTLR)/include -I$(ANTLR) 10 | rm -f $@ 11 | ar -ru libantlr3.a antlr3*.o 12 | ranlib libantlr3.a 13 | rm -f antlr3*.o 14 | 15 | parsergen: GDBMIOutput.g 16 | $(ANTLRCMD) GDBMIOutput.g 17 | 18 | OBJS = GDBMIOutputLexer.o \ 19 | GDBMIOutputParser.o \ 20 | GDBMIParser.o \ 21 | main.o 22 | 23 | GDBMIOutputLexer.c: parsergen 24 | GDBMIOutputParser.c: parsergen 25 | GDBMIParser.cpp: GDBMIOutputLexer.c GDBMIOutputParser.c 26 | 27 | GDBMIOutputLexer.o: GDBMIOutputLexer.c $(ANTLR)/antlr3config.h 28 | $(CXX) $(CFLAGS) $(CPPFLAGS) $< -o $@ 29 | 30 | GDBMIOutputParser.o: GDBMIOutputParser.c $(ANTLR)/antlr3config.h 31 | $(CXX) $(CFLAGS) $(CPPFLAGS) $< -o $@ 32 | 33 | GDBMIParser.o: GDBMIParser.cpp $(ANTLR)/antlr3config.h 34 | $(CXX) $(CFLAGS) $(CPPFLAGS) $< -o $@ 35 | 36 | main.o: main.cpp 37 | $(CXX) $(CFLAGS) $(CPPFLAGS) $< -o $@ 38 | 39 | $(EXE): $(OBJS) 40 | $(CXX) $(CPPFLAGS) $(OBJS) $(LDFLAGS) -o $@ 41 | 42 | clean: 43 | rm -f *.o $(EXE) \ 44 | GDBMIOutput.tokens \ 45 | GDBMIOutputLexer.c GDBMIOutputLexer.h \ 46 | GDBMIOutputParser.c GDBMIOutputParser.h 47 | -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/Debugger/Parser/Makefile.lib.common: -------------------------------------------------------------------------------- 1 | ANTLRCMD=java -cp $(ANTLRJAR) org.antlr.Tool -Xconversiontimeout 10000 -report 2 | PARSERGEN=GDBMIOutputLexer.c GDBMIOutputLexer.h GDBMIOutputParser.c GDBMIOutputParser.h 3 | 4 | all: $(PARSERGEN) libGDBMIParser.a 5 | 6 | GDBMIOutputParser.c: GDBMIOutputLexer.c 7 | GDBMIOutputLexer.h: GDBMIOutputLexer.c 8 | GDBMIOutputParser.h: GDBMIOutputLexer.c 9 | GDBMIOutputLexer.c: GDBMIOutput.g 10 | $(ANTLRCMD) $< 11 | 12 | OBJS = GDBMIOutputLexer.o \ 13 | GDBMIOutputParser.o \ 14 | GDBMIParser.o 15 | 16 | GDBMIParser.cpp: GDBMIOutputLexer.c GDBMIOutputParser.c 17 | 18 | GDBMIOutputLexer.o: GDBMIOutputLexer.c 19 | $(CXX) $(CFLAGS) $(CPPFLAGS) $< -o $@ 20 | 21 | GDBMIOutputParser.o: GDBMIOutputParser.c 22 | $(CXX) $(CFLAGS) $(CPPFLAGS) $< -o $@ 23 | 24 | GDBMIParser.o: GDBMIParser.cpp 25 | $(CXX) $(CFLAGS) $(CPPFLAGS) $< -o $@ 26 | 27 | libGDBMIParser.a: $(OBJS) 28 | rm -f $@ 29 | ar -ru $@ $(OBJS) 30 | ranlib $@ 31 | 32 | clean: 33 | rm -f *.o *.a \ 34 | GDBMIOutput.tokens \ 35 | GDBMIOutputLexer.c GDBMIOutputLexer.h \ 36 | GDBMIOutputParser.c GDBMIOutputParser.h 37 | -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/Debugger/Parser/Makefile.lib.omdev.mingw: -------------------------------------------------------------------------------- 1 | ifeq ($(OMBUILDDIR),) 2 | $(error OMBUILDDIR variable is not set.) 3 | endif 4 | 5 | builddir=$(OMBUILDDIR) 6 | ANTLRJAR=$(OMBUILDDIR)/share/omc/java/antlr-3.2.jar 7 | 8 | CC=gcc 9 | CXX=g++ 10 | #CFLAGS=-c -g -O0 11 | CFLAGS=-c -O3 12 | CPPFLAGS=-I. -I$(OMBUILDDIR)/include/omc/antlr3 13 | 14 | include Makefile.lib.common -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/Debugger/Parser/Makefile.lib.unix.in: -------------------------------------------------------------------------------- 1 | OMBUILDDIR=@OMBUILDDIR@ 2 | ANTLRJAR=@OPENMODELICAHOME@/share/omc/java/antlr-3.2.jar 3 | 4 | CC=@CC@ 5 | CXX=@CXX@ 6 | CFLAGS=-c @CFLAGS@ 7 | CPPFLAGS=@CPPFLAGS@ -I@OPENMODELICAHOME@/include/@host_short@/omc/antlr3 8 | ifeq (x86_64,@target_cpu@) 9 | ANTLR64=--enable-64bit 10 | endif 11 | ifeq (arm,@target_cpu@) 12 | ANTLRDEBUG="--disable-antlrdebug --disable-abiflags" 13 | endif 14 | 15 | include Makefile.lib.common 16 | 17 | Makefile.lib.unix: Makefile.lib.unix.in 18 | (cd @top_builddir@ && ./config.status) 19 | -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/Debugger/Parser/Makefile.omdev.mingw: -------------------------------------------------------------------------------- 1 | builddir=$(OMBUILDDIR) 2 | ANTLRJAR=$(OMBUILDDIR)/share/omc/java/antlr-3.2.jar 3 | 4 | CC=gcc 5 | CXX=g++ 6 | #CFLAGS=-c -g -O0 7 | CFLAGS=-c -O3 8 | CPPFLAGS=-I. -I$(OMBUILDDIR)/include/omc/antlr3 9 | LDFLAGS=-L$(OMBUILDDIR)/lib/omc -lomantlr3 10 | EXE=GDBMIParser.exe 11 | 12 | include Makefile.common -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/Debugger/Parser/Makefile.unix.in: -------------------------------------------------------------------------------- 1 | OMBUILDDIR=@OMBUILDDIR@ 2 | ANTLRJAR=@ANTLRJAR@ 3 | 4 | CC=@CC@ 5 | CXX=@CXX@ 6 | CFLAGS=@CFLAGS@ 7 | CPPFLAGS=@CPPFLAGS@ 8 | LDFLAGS=-L$(OMBUILDDIR)/lib/@host_short@/omc -lantlr3 9 | EXE=GDBMIParser 10 | ifeq (x86_64,@target_cpu@) 11 | ANTLR64=--enable-64bit 12 | endif 13 | ifeq (arm,@target_cpu@) 14 | ANTLRDEBUG="--disable-antlrdebug --disable-abiflags" 15 | endif 16 | 17 | include Makefile.common 18 | -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/Debugger/Parser/README.txt: -------------------------------------------------------------------------------- 1 | /* 2 | * RCS: $Id: README.txt 22008 2014-08-26 23:13:07Z hudson $ 3 | */ 4 | 5 | Windows 6 | ------------------------------ 7 | - If you want to build the GDBMIParser static build use the Makefile.lib.omdev.mingw 8 | - If you want to build the GDBMIParser sample executable use the Makefile.omdev.mingw 9 | 10 | Linux 11 | ------------------------------ 12 | - If you want to build the GDBMIParser static build use the Makefile.lib.unix 13 | - If you want to build the GDBMIParser sample executable use the Makefile.unix 14 | 15 | ------------------------------ 16 | Adeel. 17 | adeel.asghar@liu.se 18 | -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/Editors/TextEditor.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of OpenModelica. 3 | * 4 | * Copyright (c) 1998-CurrentYear, Open Source Modelica Consortium (OSMC), 5 | * c/o Linköpings universitet, Department of Computer and Information Science, 6 | * SE-58183 Linköping, Sweden. 7 | * 8 | * All rights reserved. 9 | * 10 | * THIS PROGRAM IS PROVIDED UNDER THE TERMS OF GPL VERSION 3 LICENSE OR 11 | * THIS OSMC PUBLIC LICENSE (OSMC-PL) VERSION 1.2. 12 | * ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE 13 | * OF THE OSMC PUBLIC LICENSE OR THE GPL VERSION 3, ACCORDING TO RECIPIENTS CHOICE. 14 | * 15 | * The OpenModelica software and the Open Source Modelica 16 | * Consortium (OSMC) Public License (OSMC-PL) are obtained 17 | * from OSMC, either from the above address, 18 | * from the URLs: http://www.ida.liu.se/projects/OpenModelica or 19 | * http://www.openmodelica.org, and in the OpenModelica distribution. 20 | * GNU version 3 is obtained from: http://www.gnu.org/copyleft/gpl.html. 21 | * 22 | * This program is distributed WITHOUT ANY WARRANTY; without 23 | * even the implied warranty of MERCHANTABILITY or FITNESS 24 | * FOR A PARTICULAR PURPOSE, EXCEPT AS EXPRESSLY SET FORTH 25 | * IN THE BY RECIPIENT SELECTED SUBSIDIARY LICENSE CONDITIONS OF OSMC-PL. 26 | * 27 | * See the full OSMC Public License conditions for more details. 28 | * 29 | */ 30 | /* 31 | * @author Adeel Asghar 32 | */ 33 | 34 | #ifndef TEXTEDITOR_H 35 | #define TEXTEDITOR_H 36 | 37 | #include "Editors/BaseEditor.h" 38 | 39 | class TextEditor : public BaseEditor 40 | { 41 | Q_OBJECT 42 | public: 43 | TextEditor(QWidget *pParent); 44 | void setPlainText(const QString &text); 45 | virtual void popUpCompleter(); 46 | private slots: 47 | virtual void showContextMenu(QPoint point); 48 | public slots: 49 | virtual void contentsHasChanged(int position, int charsRemoved, int charsAdded); 50 | virtual void toggleCommentSelection() {} 51 | }; 52 | 53 | #endif // TEXTEDITOR_H 54 | -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/Editors/TransformationsEditor.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of OpenModelica. 3 | * 4 | * Copyright (c) 1998-CurrentYear, Open Source Modelica Consortium (OSMC), 5 | * c/o Linköpings universitet, Department of Computer and Information Science, 6 | * SE-58183 Linköping, Sweden. 7 | * 8 | * All rights reserved. 9 | * 10 | * THIS PROGRAM IS PROVIDED UNDER THE TERMS OF GPL VERSION 3 LICENSE OR 11 | * THIS OSMC PUBLIC LICENSE (OSMC-PL) VERSION 1.2. 12 | * ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE 13 | * OF THE OSMC PUBLIC LICENSE OR THE GPL VERSION 3, ACCORDING TO RECIPIENTS CHOICE. 14 | * 15 | * The OpenModelica software and the Open Source Modelica 16 | * Consortium (OSMC) Public License (OSMC-PL) are obtained 17 | * from OSMC, either from the above address, 18 | * from the URLs: http://www.ida.liu.se/projects/OpenModelica or 19 | * http://www.openmodelica.org, and in the OpenModelica distribution. 20 | * GNU version 3 is obtained from: http://www.gnu.org/copyleft/gpl.html. 21 | * 22 | * This program is distributed WITHOUT ANY WARRANTY; without 23 | * even the implied warranty of MERCHANTABILITY or FITNESS 24 | * FOR A PARTICULAR PURPOSE, EXCEPT AS EXPRESSLY SET FORTH 25 | * IN THE BY RECIPIENT SELECTED SUBSIDIARY LICENSE CONDITIONS OF OSMC-PL. 26 | * 27 | * See the full OSMC Public License conditions for more details. 28 | * 29 | */ 30 | /* 31 | * @author Adeel Asghar 32 | */ 33 | 34 | #ifndef TRANSFORMATIONSEDITOR_H 35 | #define TRANSFORMATIONSEDITOR_H 36 | 37 | #include "Editors/BaseEditor.h" 38 | #include "TransformationalDebugger/TransformationsWidget.h" 39 | 40 | class TransformationsWidget; 41 | class TransformationsEditor : public BaseEditor 42 | { 43 | Q_OBJECT 44 | public: 45 | TransformationsEditor(TransformationsWidget *pTransformationsWidget); 46 | virtual void popUpCompleter(); 47 | private: 48 | TransformationsWidget *mpTransformationsWidget; 49 | private slots: 50 | virtual void showContextMenu(QPoint point); 51 | public slots: 52 | virtual void contentsHasChanged(int position, int charsRemoved, int charsAdded); 53 | virtual void toggleCommentSelection() {} 54 | }; 55 | 56 | #endif // TRANSFORMATIONSEDITOR_H 57 | -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/FMI/ImportFMUDialog.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of OpenModelica. 3 | * 4 | * Copyright (c) 1998-CurrentYear, Open Source Modelica Consortium (OSMC), 5 | * c/o Linköpings universitet, Department of Computer and Information Science, 6 | * SE-58183 Linköping, Sweden. 7 | * 8 | * All rights reserved. 9 | * 10 | * THIS PROGRAM IS PROVIDED UNDER THE TERMS OF GPL VERSION 3 LICENSE OR 11 | * THIS OSMC PUBLIC LICENSE (OSMC-PL) VERSION 1.2. 12 | * ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS PROGRAM CONSTITUTES 13 | * RECIPIENT'S ACCEPTANCE OF THE OSMC PUBLIC LICENSE OR THE GPL VERSION 3, 14 | * ACCORDING TO RECIPIENTS CHOICE. 15 | * 16 | * The OpenModelica software and the Open Source Modelica 17 | * Consortium (OSMC) Public License (OSMC-PL) are obtained 18 | * from OSMC, either from the above address, 19 | * from the URLs: http://www.ida.liu.se/projects/OpenModelica or 20 | * http://www.openmodelica.org, and in the OpenModelica distribution. 21 | * GNU version 3 is obtained from: http://www.gnu.org/copyleft/gpl.html. 22 | * 23 | * This program is distributed WITHOUT ANY WARRANTY; without 24 | * even the implied warranty of MERCHANTABILITY or FITNESS 25 | * FOR A PARTICULAR PURPOSE, EXCEPT AS EXPRESSLY SET FORTH 26 | * IN THE BY RECIPIENT SELECTED SUBSIDIARY LICENSE CONDITIONS OF OSMC-PL. 27 | * 28 | * See the full OSMC Public License conditions for more details. 29 | * 30 | */ 31 | /* 32 | * @author Adeel Asghar 33 | */ 34 | 35 | #ifndef IMPORTFMUDIALOG_H 36 | #define IMPORTFMUDIALOG_H 37 | 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | 44 | class Label; 45 | class ImportFMUDialog : public QDialog 46 | { 47 | Q_OBJECT 48 | public: 49 | ImportFMUDialog(QWidget *pParent = 0); 50 | private: 51 | Label *mpImportFMUHeading; 52 | QFrame *mpHorizontalLine; 53 | Label *mpFmuFileLabel; 54 | QLineEdit *mpFmuFileTextBox; 55 | QPushButton *mpBrowseFileButton; 56 | Label *mpOutputDirectoryLabel; 57 | QLineEdit *mpOutputDirectoryTextBox; 58 | QPushButton *mpBrowseDirectoryButton; 59 | Label *mpLogLevelLabel; 60 | QComboBox *mpLogLevelComboBox; 61 | QCheckBox *mpDebugLoggingCheckBox; 62 | QCheckBox *mpGenerateIntputConnectors; 63 | QCheckBox *mpGenerateOutputConnectors; 64 | Label *mpOutputDirectoryNoteLabel; 65 | QPushButton *mpImportButton; 66 | private slots: 67 | void setSelectedFile(); 68 | void setSelectedDirectory(); 69 | void importFMU(); 70 | }; 71 | 72 | #endif // IMPORTFMUDIALOG_H 73 | -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/FMI/ImportFMUModelDescriptionDialog.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of OpenModelica. 3 | * 4 | * Copyright (c) 1998-CurrentYear, Open Source Modelica Consortium (OSMC), 5 | * c/o Linköpings universitet, Department of Computer and Information Science, 6 | * SE-58183 Linköping, Sweden. 7 | * 8 | * All rights reserved. 9 | * 10 | * THIS PROGRAM IS PROVIDED UNDER THE TERMS OF GPL VERSION 3 LICENSE OR 11 | * THIS OSMC PUBLIC LICENSE (OSMC-PL) VERSION 1.2. 12 | * ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS PROGRAM CONSTITUTES 13 | * RECIPIENT'S ACCEPTANCE OF THE OSMC PUBLIC LICENSE OR THE GPL VERSION 3, 14 | * ACCORDING TO RECIPIENTS CHOICE. 15 | * 16 | * The OpenModelica software and the Open Source Modelica 17 | * Consortium (OSMC) Public License (OSMC-PL) are obtained 18 | * from OSMC, either from the above address, 19 | * from the URLs: http://www.ida.liu.se/projects/OpenModelica or 20 | * http://www.openmodelica.org, and in the OpenModelica distribution. 21 | * GNU version 3 is obtained from: http://www.gnu.org/copyleft/gpl.html. 22 | * 23 | * This program is distributed WITHOUT ANY WARRANTY; without 24 | * even the implied warranty of MERCHANTABILITY or FITNESS 25 | * FOR A PARTICULAR PURPOSE, EXCEPT AS EXPRESSLY SET FORTH 26 | * IN THE BY RECIPIENT SELECTED SUBSIDIARY LICENSE CONDITIONS OF OSMC-PL. 27 | * 28 | * See the full OSMC Public License conditions for more details. 29 | * 30 | */ 31 | /* 32 | * @author Alachew Mengist 33 | */ 34 | 35 | #ifndef IMPORTFMUMODELDESCRIPTIONDIALOG_H 36 | #define IMPORTFMUMODELDESCRIPTIONDIALOG_H 37 | 38 | #include 39 | #include 40 | 41 | class Label; 42 | class ImportFMUModelDescriptionDialog : public QDialog 43 | { 44 | Q_OBJECT 45 | public: 46 | ImportFMUModelDescriptionDialog(QWidget *pParent = 0); 47 | private: 48 | Label *mpFmuModelDescriptionLabel; 49 | QLineEdit *mpFmuModelDescriptionTextBox; 50 | QPushButton *mpBrowseFileButton; 51 | Label *mpOutputDirectoryLabel; 52 | QLineEdit *mpOutputDirectoryTextBox; 53 | Label *mpOutputDirectoryNoteLabel; 54 | QPushButton *mpBrowseDirectoryButton; 55 | QPushButton *mpImportButton; 56 | private slots: 57 | void setSelectedFile(); 58 | void setSelectedDirectory(); 59 | void importFMUModelDescription(); 60 | }; 61 | 62 | #endif // IMPORTFMUMODELDESCRIPTIONDIALOG_H 63 | -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/Git/CleanDialog.h: -------------------------------------------------------------------------------- 1 | #ifndef CLEANDIALOG_H 2 | #define CLEANDIALOG_H 3 | 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | 15 | class CleanDialog : public QDialog 16 | { 17 | Q_OBJECT 18 | public: 19 | CleanDialog(QWidget *pParent = 0); 20 | private: 21 | QStandardItemModel *mpCleanFilesModel; 22 | QTreeView * mpCleanFilesTreeView; 23 | QString *mpworkingDirectory; 24 | void getUntrackedFiles(); 25 | QStringList checkedFiles() const; 26 | void addFile(const QString &workingDirectory, QString fileName, bool checked); 27 | QCheckBox *mpSelectAllCheckBox; 28 | QPushButton *mpCleanRepositoryButton; 29 | QPushButton *mpCancelButton; 30 | QDialogButtonBox *mpButtonBox; 31 | QProcess *mpProcess; 32 | //private slots: 33 | // void revertCommit(); 34 | // void browseCommitLog(); 35 | // void workingDirectoryChanged(const QString &workingDirectory); 36 | // void browseWorkingDirectory(); 37 | // void commitTextChanged(const QString &commit); 38 | public slots: 39 | void selectAllItems(bool checked); 40 | void updateSelectAllCheckBox(void); 41 | }; 42 | 43 | #endif // CLEANDIALOG_H 44 | -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/Git/CommitChangesDialog.h: -------------------------------------------------------------------------------- 1 | #ifndef COMMITCHANGESDIALOG_H 2 | #define COMMITCHANGESDIALOG_H 3 | 4 | #include "QDialog" 5 | #include "QStandardItemModel" 6 | #include "QTreeView" 7 | #include "QPlainTextEdit" 8 | #include "QLineEdit" 9 | #include "QCheckBox" 10 | #include "QDialogButtonBox" 11 | 12 | class Label; 13 | class CommitChangesDialog : public QDialog 14 | { 15 | Q_OBJECT 16 | public: 17 | CommitChangesDialog(QWidget *pParent = 0); 18 | void generateTraceabilityURI(QString activity, QString modelFileName, QString nameStructure, QString fmuFileName); 19 | void commitAndGenerateTraceabilityURI(QString fileName); 20 | private: 21 | QStandardItemModel *mpCommitChangedFilesModel; 22 | QTreeView * mpCommitChangedFilesTreeView; 23 | void getChangedFiles(); 24 | void addFile(QString fileStatus, QString fileName, bool checked); 25 | QString getFileStatus(QString status); 26 | QStringList mpModifiedFiles; 27 | Label *mpRepositoryLabel; 28 | QLineEdit *mpRepositoryNameTextBox; 29 | Label *mpBranchLabel; 30 | QLineEdit *mpBranchNameTextBox; 31 | Label *mpAuthorLabel; 32 | QLineEdit *mpAuthorTextBox; 33 | Label *mpEmailLabel; 34 | QLineEdit *mpEmailTextBox; 35 | Label *mpCommitDescriptionLabel; 36 | QPlainTextEdit *mpCommitDescriptionTextBox; 37 | QCheckBox *mpSelectAllCheckBox; 38 | QPushButton *mpCommitButton; 39 | QPushButton *mpCancelButton; 40 | QDialogButtonBox *mpButtonBox; 41 | private slots: 42 | void commitFiles(); 43 | void commitDescriptionTextChanged(); 44 | }; 45 | 46 | #endif // COMMITCHANGESDIALOG_H 47 | -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/Git/GitCommands.h: -------------------------------------------------------------------------------- 1 | #ifndef GITCOMMANDS_H 2 | #define GITCOMMANDS_H 3 | 4 | 5 | #include 6 | #include "QStandardItemModel" 7 | #include "QTreeView" 8 | #include "QPlainTextEdit" 9 | #include "QCheckBox" 10 | #include "QDialogButtonBox" 11 | #include 12 | 13 | 14 | class GitCommands : public QObject 15 | { 16 | Q_OBJECT 17 | private: 18 | // the only class that is allowed to create and destroy 19 | friend class MainWindow; 20 | 21 | static void create(); 22 | static void destroy(); 23 | GitCommands(QWidget *pParent = 0); 24 | static GitCommands *mpInstance; 25 | static QString getGitStdout(const QStringList &args); 26 | static QString getGitStdout(const QString &fileName, const QStringList &args); 27 | public: 28 | // GitCommands(QObject *pParent = 0); 29 | static GitCommands* instance() {return mpInstance;} 30 | void logCurrentFile(QString currentFile); 31 | void stageCurrentFileForCommit(QString currentFile); 32 | void unstageCurrentFileFromCommit(QString currentFile); 33 | void cleanWorkingDirectory(); 34 | void createGitRepository(QString reporitoryPath); 35 | void addStructuresToRepository(QString reporitoryPath); 36 | bool isGitInstalled(); 37 | bool isSavedUnderGitRepository(QString filePath); 38 | QStringList getUntrackedFiles(QString workingDirectory); 39 | QStringList getChangedFiles(QString filePath); 40 | QString getSingleFileStatus(QString fileName); 41 | QString getRepositoryName(QString directory); 42 | QString getBranchName(QString directory); 43 | QString getAuthorName(); 44 | QString getEmailName(); 45 | QString getGitHash(QString fileName); 46 | void commitFiles(QString repositoryPath, QString commitMessage); 47 | QString commitAndGetFileHash(QString fileName, QString activity); 48 | private: 49 | QString mGitProgram; 50 | QStringList mGitArguments; 51 | void runGitCommand(QString driectory, QStringList args); 52 | private slots: 53 | // void gitProcessStarted(); 54 | // void readGitStandardOutput(); 55 | // void readGitStandardError(); 56 | // void gitProcessFinished(int exitCode, QProcess::ExitStatus exitStatus); 57 | //signals: 58 | // void sendGitProcessStarted(); 59 | // void sendGitProcessOutput(QString, StringHandler::SimulationMessageType type); 60 | // void sendGitProcessFinished(int, QProcess::ExitStatus); 61 | // void sendGitProgress(int); 62 | }; 63 | 64 | #endif // GITCOMMANDS_H 65 | -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/Git/RevertCommitsDialog.h: -------------------------------------------------------------------------------- 1 | #ifndef REVERTCOMMITSDIALOG_H 2 | #define REVERTCOMMITSDIALOG_H 3 | 4 | #include "QStandardItemModel" 5 | #include "QTreeView" 6 | #include "QPlainTextEdit" 7 | #include "QCheckBox" 8 | #include "QDialogButtonBox" 9 | #include 10 | 11 | #include 12 | 13 | class Label; 14 | class RevertCommitsDialog : public QDialog 15 | { 16 | Q_OBJECT 17 | public: 18 | RevertCommitsDialog(QWidget *pParent = 0); 19 | void setCommit(QString commit ); 20 | private: 21 | void getCommitHistory(); 22 | Label *mpWorkingDirectoryLabel; 23 | QLineEdit *mpWorkingDirectoryTextBox; 24 | QPushButton *mpDirectoryBrowseButton; 25 | Label *mpCommitLabel; 26 | QLineEdit *mpCommitTextBox; 27 | QPushButton *mpCommitBrowseButton; 28 | QPlainTextEdit *mpCommitDescriptionTextBox; 29 | QPushButton *mpRevertButton; 30 | QPushButton *mpCancelButton; 31 | QDialogButtonBox *mpButtonBox; 32 | QProcess *mpProcess; 33 | private slots: 34 | void revertCommit(); 35 | void browseCommitLog(); 36 | void workingDirectoryChanged(const QString &workingDirectory); 37 | void browseWorkingDirectory(); 38 | void commitTextChanged(const QString &commit); 39 | }; 40 | 41 | 42 | class LogCommitDialog : public QDialog 43 | { 44 | Q_OBJECT 45 | public: 46 | LogCommitDialog(RevertCommitsDialog *pRevertCommitsDialog); 47 | QString commit() const; 48 | int commitIndex() const; 49 | const QStandardItem *currentItem(int column = 0) const; 50 | private: 51 | RevertCommitsDialog *mpRevertCommitsDialog; 52 | void getCommitLog(); 53 | QStandardItemModel *mpLogModel; 54 | QTreeView *mpLogTreeView; 55 | QPushButton *mpOkButton; 56 | QPushButton *mpCancelButton; 57 | QDialogButtonBox *mpButtonBox; 58 | QProcess *mpProcess; 59 | private slots: 60 | void ok(); 61 | 62 | }; 63 | 64 | #endif // REVERTCOMMITSDIALOG_H 65 | -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDocumentTypes 6 | 7 | 8 | CFBundleTypeExtensions 9 | 10 | mo 11 | 12 | CFBundleTypeIconFile 13 | @ICON@ 14 | CFBundleTypeName 15 | Modelica Model 16 | CFBundleTypeRole 17 | Editor 18 | LSIsAppleDefaultForType 19 | 20 | 21 | 22 | NSPrincipalClass 23 | NSApplication 24 | CFBundleIconFile 25 | @ICON@ 26 | CFBundlePackageType 27 | APPL 28 | CFBundleGetInfoString 29 | Created by Qt/QMake 30 | CFBundleSignature 31 | @TYPEINFO@ 32 | CFBundleExecutable 33 | @EXECUTABLE@ 34 | CFBundleIdentifier 35 | com.yourcompany.@EXECUTABLE@ 36 | NOTE 37 | This file was generated by Qt/QMake. 38 | 39 | 40 | -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/Makefile.unix.in: -------------------------------------------------------------------------------- 1 | # @author Martin Sjölund 2 | # 3 | # RCS: $Id: Makefile.unix.in 13565 2012-10-23 01:07:41Z adeas31 $ 4 | # 5 | 6 | .PHONY: install build $(NAME) always 7 | 8 | top_builddir=@top_builddir@ 9 | resourcedir=./Resources/nls/ 10 | 11 | NAME=OMEdit 12 | EXE=@EXE@ 13 | APP=@APP@ 14 | QMAKE=@QMAKE@ 15 | LRELEASE=@LRELEASE@ 16 | 17 | install: build Resources/nls/qm.stamp 18 | mkdir -p ../../build/share/omedit/nls/ 19 | cp -p $(resourcedir)/*.qm @OMBUILDDIR@/share/omedit/nls/ 20 | if [ "$(APP)" = ".app" ]; then mkdir -p @OMBUILDDIR@/Applications/ ; cp -rp ../bin/OMEdit.app @OMBUILDDIR@/Applications/ ; else cp -p ../bin/OMEdit @OMBUILDDIR@/bin/OMEdit; fi 21 | 22 | Resources/nls/qm.stamp: OMEditGUI.pro Resources/nls/*.ts 23 | $(LRELEASE) $< 24 | @touch $@ 25 | 26 | always: 27 | 28 | $(NAME): parsergen Makefile OMEdit.config omc_config.h 29 | $(MAKE) -f Makefile 30 | 31 | clean: 32 | $(MAKE) -C Debugger/Parser -f Makefile.lib.unix clean 33 | test ! -f Makefile || $(MAKE) -f Makefile clean 34 | rm -f ../bin/*.o 35 | 36 | parsergen: 37 | $(MAKE) -C Debugger/Parser -f Makefile.lib.unix 38 | 39 | build: $(NAME) 40 | 41 | Makefile: OMEditGUI.pro OMEdit.config 42 | @test ! -f $@ || rm $@ 43 | $(QMAKE) 44 | Makefile.unix: Makefile.unix.in 45 | (cd @top_builddir@; ./config.status) 46 | OMEdit.config: OMEdit.config.in 47 | (cd @top_builddir@ && ./config.status) 48 | omc_config.h: omc_config.h.in 49 | (cd @top_builddir@ && ./config.status) 50 | -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/Modeling/CoOrdinateSystem.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of OpenModelica. 3 | * 4 | * Copyright (c) 1998-CurrentYear, Open Source Modelica Consortium (OSMC), 5 | * c/o Linköpings universitet, Department of Computer and Information Science, 6 | * SE-58183 Linköping, Sweden. 7 | * 8 | * All rights reserved. 9 | * 10 | * THIS PROGRAM IS PROVIDED UNDER THE TERMS OF GPL VERSION 3 LICENSE OR 11 | * THIS OSMC PUBLIC LICENSE (OSMC-PL) VERSION 1.2. 12 | * ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE 13 | * OF THE OSMC PUBLIC LICENSE OR THE GPL VERSION 3, ACCORDING TO RECIPIENTS CHOICE. 14 | * 15 | * The OpenModelica software and the Open Source Modelica 16 | * Consortium (OSMC) Public License (OSMC-PL) are obtained 17 | * from OSMC, either from the above address, 18 | * from the URLs: http://www.ida.liu.se/projects/OpenModelica or 19 | * http://www.openmodelica.org, and in the OpenModelica distribution. 20 | * GNU version 3 is obtained from: http://www.gnu.org/copyleft/gpl.html. 21 | * 22 | * This program is distributed WITHOUT ANY WARRANTY; without 23 | * even the implied warranty of MERCHANTABILITY or FITNESS 24 | * FOR A PARTICULAR PURPOSE, EXCEPT AS EXPRESSLY SET FORTH 25 | * IN THE BY RECIPIENT SELECTED SUBSIDIARY LICENSE CONDITIONS OF OSMC-PL. 26 | * 27 | * See the full OSMC Public License conditions for more details. 28 | * 29 | */ 30 | /* 31 | * @author Adeel Asghar 32 | */ 33 | 34 | #ifndef COORDINATESYSTEM_H 35 | #define COORDINATESYSTEM_H 36 | 37 | #include 38 | #include 39 | 40 | class CoOrdinateSystem 41 | { 42 | public: 43 | CoOrdinateSystem(); 44 | CoOrdinateSystem(const CoOrdinateSystem &coOrdinateSystem); 45 | void setExtent(QList extent) {mExtent = extent;} 46 | QList getExtent() const {return mExtent;} 47 | void setPreserveAspectRatio(bool PreserveAspectRatio) {mPreserveAspectRatio = PreserveAspectRatio;} 48 | bool getPreserveAspectRatio() const {return mPreserveAspectRatio;} 49 | void setInitialScale(qreal initialScale) {mInitialScale = initialScale;} 50 | qreal getInitialScale() const {return mInitialScale;} 51 | void setGrid(QPointF grid) {mGrid = grid;} 52 | QPointF getGrid() const {return mGrid;} 53 | qreal getHorizontalGridStep(); 54 | qreal getVerticalGridStep(); 55 | void setValid(bool valid) {mValid = valid;} 56 | bool isValid() const {return mValid;} 57 | private: 58 | QList mExtent; 59 | bool mPreserveAspectRatio; 60 | qreal mInitialScale; 61 | QPointF mGrid; // horizontal and vertical spacing for grid 62 | bool mValid; 63 | }; 64 | 65 | #endif // COORDINATESYSTEM_H 66 | -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/Modeling/FunctionArgumentDialog.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of OpenModelica. 3 | * 4 | * Copyright (c) 1998-CurrentYear, Open Source Modelica Consortium (OSMC), 5 | * c/o Linköpings universitet, Department of Computer and Information Science, 6 | * SE-58183 Linköping, Sweden. 7 | * 8 | * All rights reserved. 9 | * 10 | * THIS PROGRAM IS PROVIDED UNDER THE TERMS OF GPL VERSION 3 LICENSE OR 11 | * THIS OSMC PUBLIC LICENSE (OSMC-PL) VERSION 1.2. 12 | * ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS PROGRAM CONSTITUTES 13 | * RECIPIENT'S ACCEPTANCE OF THE OSMC PUBLIC LICENSE OR THE GPL VERSION 3, 14 | * ACCORDING TO RECIPIENTS CHOICE. 15 | * 16 | * The OpenModelica software and the Open Source Modelica 17 | * Consortium (OSMC) Public License (OSMC-PL) are obtained 18 | * from OSMC, either from the above address, 19 | * from the URLs: http://www.ida.liu.se/projects/OpenModelica or 20 | * http://www.openmodelica.org, and in the OpenModelica distribution. 21 | * GNU version 3 is obtained from: http://www.gnu.org/copyleft/gpl.html. 22 | * 23 | * This program is distributed WITHOUT ANY WARRANTY; without 24 | * even the implied warranty of MERCHANTABILITY or FITNESS 25 | * FOR A PARTICULAR PURPOSE, EXCEPT AS EXPRESSLY SET FORTH 26 | * IN THE BY RECIPIENT SELECTED SUBSIDIARY LICENSE CONDITIONS OF OSMC-PL. 27 | * 28 | * See the full OSMC Public License conditions for more details. 29 | * 30 | */ 31 | 32 | #ifndef FUNCTIONPARAMETERDIALOG_H 33 | #define FUNCTIONPARAMETERDIALOG_H 34 | 35 | #include 36 | 37 | class LibraryTreeItem; 38 | class ComponentInfo; 39 | class QLineEdit; 40 | 41 | class FunctionArgumentDialog : public QDialog 42 | { 43 | public: 44 | explicit FunctionArgumentDialog(LibraryTreeItem *pLibraryTreeItem, QWidget *parent = 0); 45 | QString getFunctionCallCommand(); 46 | private: 47 | bool isInput(ComponentInfo *pComponentInfo); 48 | 49 | LibraryTreeItem *mpLibraryTreeItem; 50 | QList mComponents; 51 | QList mEditors; 52 | }; 53 | 54 | #endif // FUNCTIONPARAMETERDIALOG_H 55 | -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/OMEdit.config.in: -------------------------------------------------------------------------------- 1 | # @author Martin Sjölund 2 | 3 | QMAKE_CC = @CC@ 4 | QMAKE_CXX = @CXX@ 5 | QMAKE_LINK = @CXX@ 6 | 7 | OPENMODELICAHOME = @OPENMODELICAHOME@ 8 | 9 | LIBS += -L @OPENMODELICAHOME@/lib/@host_short@/omc -lOMPlot -lomqwt -lfmilib_shared -L../OMEditGUI/Debugger/Parser -lGDBMIParser -lomantlr3 @RPATH_QMAKE@ -lOpenModelicaCompiler -lOpenModelicaRuntimeC -lomcgc -L@OMBUILDDIR@/lib/@host_short@/omc @LIBOSG@ -lomopcua -L@OMBUILDDIR@/lib -lOMSimulator -lomtlmsimulator @LIB_BOOST_REGEX@ 10 | INCLUDEPATH += @OPENMODELICAHOME@/include/omc/scripting-API @OPENMODELICAHOME@/include/omplot @OPENMODELICAHOME@/include/omplot/qwt @OPENMODELICAHOME@/include/@host_short@/omc/antlr3 @OPENMODELICAHOME@/include/omc/c ../../qjson-0.8.1/build/include @OPENMODELICAHOME@/include 11 | 12 | QMAKE_CXXFLAGS_RELEASE -= -O1 13 | QMAKE_CXXFLAGS_RELEASE -= -O2 14 | 15 | QMAKE_CFLAGS = @CFLAGS@ @CPPFLAGS@ 16 | QMAKE_CXXFLAGS = @CXXFLAGS@ @CPPFLAGS@ 17 | QMAKE_LFLAGS += @LDFLAGS@ 18 | 19 | @QMAKE_CONFIG_OSG@ 20 | -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/OMEdit.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/OMEditApplication.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of OpenModelica. 3 | * 4 | * Copyright (c) 1998-CurrentYear, Open Source Modelica Consortium (OSMC), 5 | * c/o Linköpings universitet, Department of Computer and Information Science, 6 | * SE-58183 Linköping, Sweden. 7 | * 8 | * All rights reserved. 9 | * 10 | * THIS PROGRAM IS PROVIDED UNDER THE TERMS OF GPL VERSION 3 LICENSE OR 11 | * THIS OSMC PUBLIC LICENSE (OSMC-PL) VERSION 1.2. 12 | * ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE 13 | * OF THE OSMC PUBLIC LICENSE OR THE GPL VERSION 3, ACCORDING TO RECIPIENTS CHOICE. 14 | * 15 | * The OpenModelica software and the Open Source Modelica 16 | * Consortium (OSMC) Public License (OSMC-PL) are obtained 17 | * from OSMC, either from the above address, 18 | * from the URLs: http://www.ida.liu.se/projects/OpenModelica or 19 | * http://www.openmodelica.org, and in the OpenModelica distribution. 20 | * GNU version 3 is obtained from: http://www.gnu.org/copyleft/gpl.html. 21 | * 22 | * This program is distributed WITHOUT ANY WARRANTY; without 23 | * even the implied warranty of MERCHANTABILITY or FITNESS 24 | * FOR A PARTICULAR PURPOSE, EXCEPT AS EXPRESSLY SET FORTH 25 | * IN THE BY RECIPIENT SELECTED SUBSIDIARY LICENSE CONDITIONS OF OSMC-PL. 26 | * 27 | * See the full OSMC Public License conditions for more details. 28 | * 29 | */ 30 | /* 31 | * @author Adeel Asghar 32 | */ 33 | 34 | #ifndef OMEDITAPPLICATION_H 35 | #define OMEDITAPPLICATION_H 36 | 37 | extern "C" { 38 | #include "meta/meta_modelica.h" 39 | #include "omc_config.h" 40 | #include "gc.h" 41 | } 42 | 43 | #include 44 | #include 45 | 46 | class OMEditApplication : public QApplication 47 | { 48 | public: 49 | OMEditApplication(int& argc, char**argv, threadData_t *threadData); 50 | private: 51 | QStringList mFilesToOpenList; 52 | protected: 53 | virtual bool event(QEvent *pEvent); 54 | }; 55 | 56 | #endif // OMEDITAPPLICATION_H 57 | -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/OMS/InstantiateDialog.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of OpenModelica. 3 | * 4 | * Copyright (c) 1998-CurrentYear, Open Source Modelica Consortium (OSMC), 5 | * c/o Linköpings universitet, Department of Computer and Information Science, 6 | * SE-58183 Linköping, Sweden. 7 | * 8 | * All rights reserved. 9 | * 10 | * THIS PROGRAM IS PROVIDED UNDER THE TERMS OF GPL VERSION 3 LICENSE OR 11 | * THIS OSMC PUBLIC LICENSE (OSMC-PL) VERSION 1.2. 12 | * ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE 13 | * OF THE OSMC PUBLIC LICENSE OR THE GPL VERSION 3, ACCORDING TO RECIPIENTS CHOICE. 14 | * 15 | * The OpenModelica software and the Open Source Modelica 16 | * Consortium (OSMC) Public License (OSMC-PL) are obtained 17 | * from OSMC, either from the above address, 18 | * from the URLs: http://www.ida.liu.se/projects/OpenModelica or 19 | * http://www.openmodelica.org, and in the OpenModelica distribution. 20 | * GNU version 3 is obtained from: http://www.gnu.org/copyleft/gpl.html. 21 | * 22 | * This program is distributed WITHOUT ANY WARRANTY; without 23 | * even the implied warranty of MERCHANTABILITY or FITNESS 24 | * FOR A PARTICULAR PURPOSE, EXCEPT AS EXPRESSLY SET FORTH 25 | * IN THE BY RECIPIENT SELECTED SUBSIDIARY LICENSE CONDITIONS OF OSMC-PL. 26 | * 27 | * See the full OSMC Public License conditions for more details. 28 | * 29 | */ 30 | /* 31 | * @author Adeel Asghar 32 | */ 33 | 34 | #ifndef INSTANTIATEDIALOG_H 35 | #define INSTANTIATEDIALOG_H 36 | 37 | #include "Util/Utilities.h" 38 | #include "Util/Helper.h" 39 | #include "OMSSimulationOptions.h" 40 | 41 | #include 42 | #include 43 | 44 | class LibraryTreeItem; 45 | class SystemSimulationInformationWidget; 46 | 47 | class InstantiateDialog : public QDialog 48 | { 49 | Q_OBJECT 50 | public: 51 | InstantiateDialog(LibraryTreeItem *pLibraryTreeItem, QWidget *pParent = 0); 52 | private: 53 | LibraryTreeItem *mpLibraryTreeItem; 54 | Label *mpSimulationHeading; 55 | QFrame *mpHorizontalLine; 56 | SystemSimulationInformationWidget *mpSystemSimulationInformationWidget; 57 | Label *mpStartTimeLabel; 58 | QLineEdit *mpStartTimeTextBox; 59 | Label *mpStopTimeLabel; 60 | QLineEdit *mpStopTimeTextBox; 61 | Label *mpResultFileLabel; 62 | QLineEdit *mpResultFileTextBox; 63 | Label *mpResultFileBufferSizeLabel; 64 | QSpinBox *mpResultFileBufferSizeSpinBox; 65 | Label *mpLoggingIntervalLabel; 66 | QLineEdit *mpLoggingIntervalTextBox; 67 | Label *mpSignalFilterLabel; 68 | QLineEdit *mpSignalFilterTextBox; 69 | QPushButton *mpOkButton; 70 | QPushButton *mpCancelButton; 71 | QDialogButtonBox *mpButtonBox; 72 | private slots: 73 | void instantiate(); 74 | }; 75 | 76 | #endif // INSTANTIATEDIALOG_H 77 | -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/Plotting/DiagramWindow.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of OpenModelica. 3 | * 4 | * Copyright (c) 1998-CurrentYear, Open Source Modelica Consortium (OSMC), 5 | * c/o Linköpings universitet, Department of Computer and Information Science, 6 | * SE-58183 Linköping, Sweden. 7 | * 8 | * All rights reserved. 9 | * 10 | * THIS PROGRAM IS PROVIDED UNDER THE TERMS OF GPL VERSION 3 LICENSE OR 11 | * THIS OSMC PUBLIC LICENSE (OSMC-PL) VERSION 1.2. 12 | * ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE 13 | * OF THE OSMC PUBLIC LICENSE OR THE GPL VERSION 3, ACCORDING TO RECIPIENTS CHOICE. 14 | * 15 | * The OpenModelica software and the Open Source Modelica 16 | * Consortium (OSMC) Public License (OSMC-PL) are obtained 17 | * from OSMC, either from the above address, 18 | * from the URLs: http://www.ida.liu.se/projects/OpenModelica or 19 | * http://www.openmodelica.org, and in the OpenModelica distribution. 20 | * GNU version 3 is obtained from: http://www.gnu.org/copyleft/gpl.html. 21 | * 22 | * This program is distributed WITHOUT ANY WARRANTY; without 23 | * even the implied warranty of MERCHANTABILITY or FITNESS 24 | * FOR A PARTICULAR PURPOSE, EXCEPT AS EXPRESSLY SET FORTH 25 | * IN THE BY RECIPIENT SELECTED SUBSIDIARY LICENSE CONDITIONS OF OSMC-PL. 26 | * 27 | * See the full OSMC Public License conditions for more details. 28 | * 29 | */ 30 | /* 31 | * @author Adeel Asghar 32 | */ 33 | 34 | #ifndef DIAGRAMWINDOW_H 35 | #define DIAGRAMWINDOW_H 36 | 37 | #include 38 | #include 39 | #include 40 | 41 | class GraphicsScene; 42 | class GraphicsView; 43 | class DiagramWindow : public QWidget 44 | { 45 | Q_OBJECT 46 | public: 47 | explicit DiagramWindow(QWidget *parent = 0); 48 | GraphicsView* getGraphicsView() {return mpGraphicsView;} 49 | void drawDiagram(); 50 | private: 51 | GraphicsScene *mpGraphicsScene; 52 | GraphicsView *mpGraphicsView; 53 | QVBoxLayout *mpMainLayout; 54 | signals: 55 | 56 | public slots: 57 | }; 58 | 59 | #endif // DIAGRAMWINDOW_H 60 | -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/Plotting/PlotInteractiveCurveData_copy.cpp: -------------------------------------------------------------------------------- 1 | #include "PlotInteractiveCurveData.h" 2 | 3 | QPointF PlotInteractiveCurveData::sample(size_t i) const 4 | { 5 | return MainWindow::instance()->getSimulationDialog()->getOpcUaClient()->getVariables()->find(mVariableName).value().at(i); 6 | } 7 | 8 | size_t PlotInteractiveCurveData::size() const 9 | { 10 | return MainWindow::instance()->getSimulationDialog()->getOpcUaClient()->getVariables()->find(mVariableName).value().size(); 11 | } 12 | 13 | QRectF PlotInteractiveCurveData::boundingRect() const 14 | { 15 | /* FIX: This should be much more nice */ 16 | std::cout << "boundingRect() called!" << std::endl; 17 | QRectF plotArea; 18 | plotArea.setRect(0.0, 1.0, 50.0, 4.0); 19 | plotArea.moveBottom(2); 20 | 21 | return plotArea; 22 | } 23 | -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/Resources/bitmaps/check.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenModelica/OMEdit/21f82a33bf74193b96a90a473999778440c87380/OMEdit/OMEditGUI/Resources/bitmaps/check.png -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/Resources/icons/add-icon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 20 | 39 | 41 | 42 | 44 | image/svg+xml 45 | 47 | 48 | 49 | 50 | 51 | 55 | 59 | 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/Resources/icons/bold-icon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 20 | 40 | 43 | 44 | 46 | 47 | 49 | image/svg+xml 50 | 52 | 53 | 54 | 55 | 56 | 60 | B 73 | 74 | 75 | -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/Resources/icons/boolean-input-connector.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 20 | 40 | 43 | 44 | 46 | 47 | 49 | image/svg+xml 50 | 52 | 53 | 54 | 55 | 56 | 60 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/Resources/icons/boolean-output-connector.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 20 | 40 | 43 | 44 | 46 | 47 | 49 | image/svg+xml 50 | 52 | 53 | 54 | 55 | 56 | 60 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/Resources/icons/breakpoint_disabled.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 20 | 22 | 26 | 30 | 31 | 32 | 51 | 53 | 54 | 56 | image/svg+xml 57 | 59 | 60 | 61 | 62 | 63 | 67 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/Resources/icons/check.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 20 | 39 | 41 | 42 | 44 | image/svg+xml 45 | 47 | 48 | 49 | 50 | 51 | 55 | 65 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/Resources/icons/completerClass.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 19 | 21 | 39 | 41 | 42 | 44 | image/svg+xml 45 | 47 | 48 | 49 | 50 | 51 | 56 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/Resources/icons/completerCodeSnippets.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 19 | 21 | 39 | 41 | 42 | 44 | image/svg+xml 45 | 47 | 48 | 49 | 50 | 51 | 56 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/Resources/icons/completerComponent.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 19 | 21 | 39 | 41 | 42 | 44 | image/svg+xml 45 | 47 | 48 | 49 | 50 | 51 | 56 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/Resources/icons/completerType.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 19 | 21 | 39 | 41 | 42 | 44 | image/svg+xml 45 | 47 | 48 | 49 | 50 | 51 | 56 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/Resources/icons/completerkeyword.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 19 | 21 | 39 | 41 | 42 | 44 | image/svg+xml 45 | 47 | 48 | 49 | 50 | 51 | 56 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/Resources/icons/delete.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/Resources/icons/exit.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 20 | 39 | 41 | 42 | 44 | image/svg+xml 45 | 47 | 48 | 49 | 50 | 51 | 55 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/Resources/icons/fill-forward.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 37 | 39 | 41 | 42 | 44 | image/svg+xml 45 | 47 | 48 | 49 | 50 | 51 | 55 | 63 | 68 | 73 | 78 | 79 | 80 | -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/Resources/icons/fill-none.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 20 | 39 | 41 | 42 | 44 | image/svg+xml 45 | 47 | 48 | 49 | 50 | 51 | 55 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/Resources/icons/fill-solid.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 20 | 39 | 41 | 42 | 44 | image/svg+xml 45 | 47 | 48 | 49 | 50 | 51 | 55 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/Resources/icons/grid.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 20 | 39 | 41 | 42 | 44 | image/svg+xml 45 | 47 | 48 | 49 | 50 | 51 | 55 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/Resources/icons/initialize.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 19 | 21 | 43 | 45 | 46 | 48 | image/svg+xml 49 | 51 | 52 | 53 | 54 | 55 | 60 | 66 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/Resources/icons/integer-input-connector.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 20 | 40 | 43 | 44 | 46 | 47 | 49 | image/svg+xml 50 | 52 | 53 | 54 | 55 | 56 | 60 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/Resources/icons/integer-output-connector.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 20 | 40 | 43 | 44 | 46 | 47 | 49 | image/svg+xml 50 | 52 | 53 | 54 | 55 | 56 | 60 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/Resources/icons/interrupt.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 20 | 39 | 41 | 42 | 44 | image/svg+xml 45 | 47 | 48 | 49 | 50 | 51 | 55 | 63 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/Resources/icons/italic-icon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 20 | 40 | 43 | 44 | 46 | 47 | 49 | image/svg+xml 50 | 52 | 53 | 54 | 55 | 56 | 60 | I 73 | 74 | 75 | -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/Resources/icons/link-external.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 20 | 39 | 41 | 42 | 44 | image/svg+xml 45 | 47 | 48 | 49 | 50 | 51 | 55 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/Resources/icons/lock.svg: -------------------------------------------------------------------------------- 1 | 2 | 17 | 19 | 20 | 22 | image/svg+xml 23 | 25 | 26 | 27 | 28 | 29 | 49 | 51 | 53 | 59 | 62 | 67 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/Resources/icons/modeling.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenModelica/OMEdit/21f82a33bf74193b96a90a473999778440c87380/OMEdit/OMEditGUI/Resources/icons/modeling.png -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/Resources/icons/omedit.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenModelica/OMEdit/21f82a33bf74193b96a90a473999778440c87380/OMEdit/OMEditGUI/Resources/icons/omedit.icns -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/Resources/icons/omedit.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenModelica/OMEdit/21f82a33bf74193b96a90a473999778440c87380/OMEdit/OMEditGUI/Resources/icons/omedit.ico -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/Resources/icons/omedit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenModelica/OMEdit/21f82a33bf74193b96a90a473999778440c87380/OMEdit/OMEditGUI/Resources/icons/omedit.png -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/Resources/icons/omedit_splashscreen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenModelica/OMEdit/21f82a33bf74193b96a90a473999778440c87380/OMEdit/OMEditGUI/Resources/icons/omedit_splashscreen.png -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/Resources/icons/omplot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenModelica/OMEdit/21f82a33bf74193b96a90a473999778440c87380/OMEdit/OMEditGUI/Resources/icons/omplot.png -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/Resources/icons/pause.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 19 | 21 | 43 | 45 | 46 | 48 | image/svg+xml 49 | 51 | 52 | 53 | 54 | 55 | 60 | 66 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/Resources/icons/play_animation.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 19 | 21 | 43 | 45 | 46 | 48 | image/svg+xml 49 | 51 | 52 | 53 | 54 | 55 | 60 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/Resources/icons/print.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/Resources/icons/real-input-connector.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 20 | 39 | 42 | 43 | 45 | 46 | 48 | image/svg+xml 49 | 51 | 52 | 53 | 54 | 55 | 59 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/Resources/icons/real-output-connector.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 20 | 40 | 43 | 44 | 46 | 47 | 49 | image/svg+xml 50 | 52 | 53 | 54 | 55 | 56 | 60 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/Resources/icons/switch.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 37 | 39 | 46 | 50 | 54 | 55 | 56 | 58 | 59 | 61 | image/svg+xml 62 | 64 | 65 | 66 | 67 | 68 | 72 | 80 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/Resources/icons/unlock.svg: -------------------------------------------------------------------------------- 1 | 2 | 17 | 19 | 20 | 22 | image/svg+xml 23 | 25 | 26 | 27 | 28 | 29 | 49 | 51 | 53 | 59 | 62 | 67 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/Resources/nls/README.md: -------------------------------------------------------------------------------- 1 | ## Creating and maintaining a new Translation File .ts 2 | 3 | - Open OMEditGUI.pro and add a new language entry in `TRANSLATIONS` variable. 4 | - The format for the language entry is `.ts>`. For correct `` see http://www.loc.gov/standards/iso639-2/php/code_list.php. 5 | - To generate and update translation files (Note :: The following command updates all the new translation strings. Do not try to create the ts-file manually.) 6 | 7 | ### Unix 8 | ```bash 9 | lupdate -noobsolete ../../OMEditGUI.pro 10 | ``` 11 | 12 | ### Windows 13 | Open `Qt Command Prompt` or add `lupdate` in `PATH`. 14 | ```bash 15 | tsupdate.bat 16 | ``` 17 | 18 | - Open your generated file with `Qt Linguist` for writing translations 19 | - Mark finished translations (green checkbox) 20 | - Do not try to edit the ts-files manually. You will forget things. 21 | 22 | ## Creating a .qm file 23 | 24 | - Generating .qm files from .ts files is performed by the Makefile. You don't need to worry. 25 | -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/Resources/nls/tsupdate.bat: -------------------------------------------------------------------------------- 1 | lupdate -noobsolete ../../OMEditGUI.pro 2 | -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/TLM/FetchInterfaceDataThread.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of OpenModelica. 3 | * 4 | * Copyright (c) 1998-CurrentYear, Open Source Modelica Consortium (OSMC), 5 | * c/o Linköpings universitet, Department of Computer and Information Science, 6 | * SE-58183 Linköping, Sweden. 7 | * 8 | * All rights reserved. 9 | * 10 | * THIS PROGRAM IS PROVIDED UNDER THE TERMS OF GPL VERSION 3 LICENSE OR 11 | * THIS OSMC PUBLIC LICENSE (OSMC-PL) VERSION 1.2. 12 | * ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE 13 | * OF THE OSMC PUBLIC LICENSE OR THE GPL VERSION 3, ACCORDING TO RECIPIENTS CHOICE. 14 | * 15 | * The OpenModelica software and the Open Source Modelica 16 | * Consortium (OSMC) Public License (OSMC-PL) are obtained 17 | * from OSMC, either from the above address, 18 | * from the URLs: http://www.ida.liu.se/projects/OpenModelica or 19 | * http://www.openmodelica.org, and in the OpenModelica distribution. 20 | * GNU version 3 is obtained from: http://www.gnu.org/copyleft/gpl.html. 21 | * 22 | * This program is distributed WITHOUT ANY WARRANTY; without 23 | * even the implied warranty of MERCHANTABILITY or FITNESS 24 | * FOR A PARTICULAR PURPOSE, EXCEPT AS EXPRESSLY SET FORTH 25 | * IN THE BY RECIPIENT SELECTED SUBSIDIARY LICENSE CONDITIONS OF OSMC-PL. 26 | * 27 | * See the full OSMC Public License conditions for more details. 28 | * 29 | */ 30 | 31 | #ifndef FETCHINTERFACEDATATHREAD_H 32 | #define FETCHINTERFACEDATATHREAD_H 33 | 34 | #include "FetchInterfaceDataDialog.h" 35 | 36 | #include 37 | 38 | class FetchInterfaceDataDialog; 39 | class FetchInterfaceDataThread : public QThread 40 | { 41 | Q_OBJECT 42 | public: 43 | FetchInterfaceDataThread(FetchInterfaceDataDialog *pFetchInterfaceDataDialog); 44 | QProcess* getManagerProcess() {return mpManagerProcess;} 45 | void setIsManagerProcessRunning(bool isManagerProcessRunning) {mIsManagerProcessRunning = isManagerProcessRunning;} 46 | bool isManagerProcessRunning() {return mIsManagerProcessRunning;} 47 | protected: 48 | virtual void run(); 49 | private: 50 | FetchInterfaceDataDialog *mpFetchInterfaceDataDialog; 51 | QProcess *mpManagerProcess; 52 | qint64 mManagerProcessId; 53 | bool mIsManagerProcessRunning; 54 | private slots: 55 | void managerProcessStarted(); 56 | void readManagerStandardOutput(); 57 | void readManagerStandardError(); 58 | void managerProcessFinished(int exitCode, QProcess::ExitStatus exitStatus); 59 | signals: 60 | void sendManagerStarted(); 61 | void sendManagerOutput(QString, StringHandler::SimulationMessageType type); 62 | void sendManagerFinished(int, QProcess::ExitStatus); 63 | }; 64 | 65 | #endif // FETCHINTERFACEDATATHREAD_H 66 | -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/Traceability/TraceabilityGraphViewWidget.cpp: -------------------------------------------------------------------------------- 1 | #include "TraceabilityGraphViewWidget.h" 2 | 3 | TraceabilityGraphViewWidget::TraceabilityGraphViewWidget(QWidget *pParent) 4 | : QWidget(pParent) 5 | { 6 | mpTraceabilityGraphWebView = new QWebView; 7 | mpTraceabilityGraphWebView->load(QUrl("http://localhost:7474/browser/")); 8 | mpTraceabilityGraphViewLabel = new QLabel(tr("Traceability Graph View")); 9 | QFont font; 10 | font.setPointSize(15); 11 | font.setBold(true); 12 | mpTraceabilityGraphViewLabel->setFont(font); 13 | // set the layout 14 | QGridLayout *pMainLayout = new QGridLayout; 15 | pMainLayout->setContentsMargins(0, 0, 0, 0); 16 | pMainLayout->addWidget(mpTraceabilityGraphViewLabel, 0, 0); 17 | pMainLayout->addWidget(mpTraceabilityGraphWebView, 1, 0); 18 | setLayout(pMainLayout); 19 | } 20 | -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/Traceability/TraceabilityGraphViewWidget.h: -------------------------------------------------------------------------------- 1 | #ifndef TRACEABILITYGRAPHVIEWWIDGET_H 2 | #define TRACEABILITYGRAPHVIEWWIDGET_H 3 | 4 | 5 | #include 6 | #if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)) 7 | #include 8 | #else 9 | #include 10 | #include 11 | #endif 12 | 13 | #include "QWidget" 14 | #include "QWebView" 15 | #include "QUrl" 16 | 17 | class TraceabilityGraphViewWidget: public QWidget 18 | { 19 | Q_OBJECT 20 | public: 21 | TraceabilityGraphViewWidget(QWidget *pParent = 0); 22 | private: 23 | QWebView *mpTraceabilityGraphWebView; 24 | QLabel *mpTraceabilityGraphViewLabel; 25 | }; 26 | 27 | #endif // TRACEABILITYGRAPHVIEWWIDGET_H 28 | -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/Traceability/TraceabilityInformationURI.h: -------------------------------------------------------------------------------- 1 | #ifndef TRACEABILITYINFORMATIONURI_H 2 | #define TRACEABILITYINFORMATIONURI_H 3 | 4 | #include 5 | #include 6 | #if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)) 7 | #include 8 | #include 9 | #else 10 | #include 11 | #include 12 | #include 13 | #endif 14 | 15 | 16 | class Label; 17 | class TraceabilityInformationURI : public QObject 18 | { 19 | Q_OBJECT 20 | public: 21 | TraceabilityInformationURI(QObject *pParent = 0); 22 | void translateURIToJsonMessageFormat(QString modelingActivity, QString toolURI, QString activityURI, QString agentURI, QString sourceModelFileNameURI, QString fmuFileNameURI, QString entityType, QString path, QString gitHash); 23 | void translateModelCreationURIToJsonMessageFormat(QString modelingActivity, QString toolURI, QString activityURI, QString agentURI, QString fileNameURI, QString entityType, QString path, QString gitHash); 24 | private: 25 | void sendTraceabilityInformation(QString jsonMessageFormat); 26 | private slots: 27 | void traceabilityInformationSent(QNetworkReply *pNetworkReply); 28 | }; 29 | 30 | #endif // TRACEABILITYINFORMATIONURI_H 31 | -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/omc_config.h.in: -------------------------------------------------------------------------------- 1 | #define CONFIG_DEFAULT_OPENMODELICAHOME "@OPENMODELICAHOME@" 2 | #define GIT_SHA "@SOURCE_REVISION@" 3 | @LSB_RELEASE@ 4 | -------------------------------------------------------------------------------- /OMEdit/OMEditGUI/rc_omedit.rc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | VS_VERSION_INFO VERSIONINFO 4 | BEGIN 5 | BLOCK "VarFileInfo" 6 | BEGIN 7 | VALUE "Translation", 0x409, 1200 8 | END 9 | BLOCK "StringFileInfo" 10 | BEGIN 11 | BLOCK "040904b0" 12 | BEGIN 13 | VALUE "CompanyName", "Open Source Modelica Consortium (OSMC)\0" 14 | VALUE "FileDescription", "OMEdit\0" 15 | VALUE "FileVersion", "0.0.0.0\0" 16 | VALUE "InternalName", "OMEdit\0" 17 | VALUE "OriginalFilename", "OMEdit.exe\0" 18 | VALUE "ProductName", "OMEdit - OpenModelica Connection Editor\0" 19 | VALUE "ProductVersion", "0.0.0.0\0" 20 | END 21 | END 22 | END 23 | IDI_ICON1 ICON DISCARDABLE "Resources\\icons\\omedit.ico" 24 | 1 24 DISCARDABLE "OMEdit.manifest" -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # OMEdit 2 | A Modelica connection editor for OpenModelica. 3 | 4 | ## Dependencies 5 | 6 | - [OpenModelica](https://openmodelica.org) 7 | - [OMPlot](../../../OMPlot) 8 | - [OMSimulator](../../../OMSimulator) 9 | 10 | ## Build instructions 11 | 12 | Install the dependencies. 13 | 14 | ### Unix 15 | ```bash 16 | $ autoconf 17 | # OPENMODELICAHOME is usually /usr, /opt, /opt/openmodelica, or /path/to/OpenModelica/build 18 | $ ./configure --prefix=/path/to/OPENMODELICAHOME 19 | $ make 20 | $ make install 21 | ``` 22 | 23 | ### Windows MinGW 24 | - If you don't have OMDev then download it from the svn repository [here](https://openmodelica.org/svn/OpenModelicaExternal/trunk/tools/windows/OMDev). 25 | - Follow the instructions in [INSTALL.txt](https://openmodelica.org/svn/OpenModelicaExternal/trunk/tools/windows/OMDev/INSTALL.txt). 26 | - Open msys terminal. Either `$OMDEV/tools/msys/mingw32_shell.bat` OR `$OMDEV/tools/msys/mingw64_shell.bat`. 27 | ```bash 28 | $ cd /path/to/OpenModelica 29 | $ make -f Makefile.omdev.mingw omedit 30 | ``` 31 | - Start OMEdit from `/path/to/OpenModelica/build/bin/OMEdit.exe` 32 | 33 | ## Coding Style 34 | 35 | - 2 spaces not tab 36 | - CamelCase except that first letter should be small. 37 | - Member variables should start with `m` and member pointers should start with `mp`. 38 | - Local pointers should start with `p`. 39 | - Use meaningful name for variables and functions. 40 | 41 | 42 | ## Bug Reports 43 | 44 | - Submit bugs through the [OpenModelica trac](https://trac.openmodelica.org/OpenModelica/newticket). 45 | - [Pull requests](../../pulls) are welcome. 46 | -------------------------------------------------------------------------------- /doc/manpages/OMEdit.1: -------------------------------------------------------------------------------- 1 | .\" -------------------------------------------------------------------- 2 | .\" Title 3 | .\" -------------------------------------------------------------------- 4 | . 5 | .TH OMEdit 1 "The Open Source Modelica Consortium" "1.7.0" "The OpenModelica Project" -*- nroff -*- 6 | . 7 | . 8 | .\" -------------------------------------------------------------------- 9 | .SH NAME 10 | .\" -------------------------------------------------------------------- 11 | . 12 | OMEdit \- A Modelica connection editor for OpenModelica 13 | . 14 | . 15 | .\" -------------------------------------------------------------------- 16 | .SH "SYNOPSIS" 17 | .\" -------------------------------------------------------------------- 18 | . 19 | .B OMEdit 20 | [\fIFILE\fR]... 21 | . 22 | . 23 | .\" -------------------------------------------------------------------- 24 | .SH DESCRIPTION 25 | .\" -------------------------------------------------------------------- 26 | . 27 | .B OMEdit 28 | is a graphical connection editor for Modelica 3.1 libraries. It uses the 29 | OpenModelica Compiler, \fBomc\fP, for communication. 30 | . 31 | .\" -------------------------------------------------------------------- 32 | .SH AUTHOR 33 | .\" -------------------------------------------------------------------- 34 | . 35 | See OpenModelicaUsersGuide.pdf for a full list of contributors to the 36 | \%OpenModelica project. 37 | . 38 | .\" -------------------------------------------------------------------- 39 | .SH BUGS 40 | .\" -------------------------------------------------------------------- 41 | . 42 | If you find a bug, please report it at: 43 | .P 44 | <\fBhttp://openmodelica.org:8080/cb/project/1\fR> 45 | . 46 | .\" -------------------------------------------------------------------- 47 | .SH "SEE ALSO" 48 | .\" -------------------------------------------------------------------- 49 | . 50 | .BR omc (1), 51 | .BR omlibrary-msl31 (1) 52 | . 53 | -------------------------------------------------------------------------------- /qjson/.gitignore: -------------------------------------------------------------------------------- 1 | lib 2 | Makefile 3 | doc/html 4 | build 5 | *.user 6 | 7 | # -- kdevelop 8 | .kdev4 9 | *.kdev4 10 | -------------------------------------------------------------------------------- /qjson/QJSONConfig.cmake.in: -------------------------------------------------------------------------------- 1 | GET_FILENAME_COMPONENT(myDir ${CMAKE_CURRENT_LIST_FILE} PATH) 2 | 3 | SET(QJSON_LIBRARIES qjson) 4 | SET(QJSON_INCLUDE_DIR "@INCLUDE_INSTALL_DIR@") 5 | 6 | include(${myDir}/QJSONTargets.cmake) 7 | -------------------------------------------------------------------------------- /qjson/QJSONConfigVersion.cmake.in: -------------------------------------------------------------------------------- 1 | SET(PACKAGE_VERSION "@QJSON_LIB_VERSION_STRING@") 2 | IF (PACKAGE_FIND_VERSION VERSION_EQUAL PACKAGE_VERSION) 3 | SET(PACKAGE_VERSION_EXACT TRUE) 4 | ENDIF (PACKAGE_FIND_VERSION VERSION_EQUAL PACKAGE_VERSION) 5 | IF (NOT PACKAGE_FIND_VERSION VERSION_GREATER PACKAGE_VERSION) 6 | SET(PACKAGE_VERSION_COMPATIBLE TRUE) 7 | ELSE (NOT PACKAGE_FIND_VERSION VERSION_GREATER PACKAGE_VERSION) 8 | SET(PACKAGE_VERSION_UNSUITABLE TRUE) 9 | ENDIF (NOT PACKAGE_FIND_VERSION VERSION_GREATER PACKAGE_VERSION) 10 | -------------------------------------------------------------------------------- /qjson/QJson.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@CMAKE_INSTALL_PREFIX@ 2 | exec_prefix=${prefix} 3 | libdir=@LIB_INSTALL_DIR@ 4 | includedir=@INCLUDE_INSTALL_DIR@ 5 | 6 | Name: QJson 7 | Description: QJson is a qt-based library that maps JSON data to QVariant objects 8 | Version: @QJSON_LIB_MAJOR_VERSION@.@QJSON_LIB_MINOR_VERSION@.@QJSON_LIB_PATCH_VERSION@ 9 | Requires: @PC_Requires@ 10 | Libs: -L${libdir} -lqjson 11 | Cflags: -I${includedir} -------------------------------------------------------------------------------- /qjson/README.md: -------------------------------------------------------------------------------- 1 | # QJson 2 | JSON (JavaScript Object Notation) is a lightweight data-interchange format. 3 | It can represents integer, real number, string, an ordered sequence of value, and a collection of name/value pairs. 4 | 5 | QJson is a qt-based library that maps JSON data to QVariant objects. 6 | JSON arrays will be mapped to QVariantList instances, while JSON's objects will be mapped to QVariantMap. 7 | 8 | # Install 9 | 10 | QJson requires: 11 | - Qt 4.5 or greater 12 | - cmake 2.6 or greater 13 | 14 | Some possible cmake options: 15 | - `-DCMAKE_BUILD_TYPE=DEBUG`: enables some debug output (other than making 16 | easier to debug the code) 17 | - `-DQJSON_BUILD_TESTS=yes` or `-DKDE4_BUILD_TESTS=yes`: builds the unit tests 18 | - `-DCMAKE_INSTALL_PREFIX=${HOME}/testinstall`: install qjson in a custom directory 19 | - `-DCMAKE_INCLUDE_PATH=${HOME}/testinstall/include`: include a custom include directory 20 | - `-DCMAKE_LIBRARY_PATH=${HOME}/testinstall/lib`: include a custom library directory 21 | - `-DLIB_DESTINATION=lib64`: if you have a 64 bit system with separate 22 | libraries for 64 bit libraries 23 | - `-DQJSON_VERBOSE_DEBUG_OUTPUT:BOOL=ON`: more debugging statements are 24 | generated by the parser. It's useful only if you are trying to fix 25 | the bison grammar. 26 | 27 | For Unix/Linux/Mac: 28 | 29 | mkdir build 30 | cd build 31 | cmake -DCMAKE_INSTALL_PREFIX=_preferred_path_ .. 32 | make 33 | make install 34 | /sbin/ldconfig #if necessary 35 | 36 | # License 37 | This library is licensed under the Lesser GNU General Public License version 2.1. 38 | See the COPYING.lib file for more information. 39 | 40 | # Resources 41 | 42 | * [Website](http://qjson.sourceforge.net/) 43 | * [Mailing List](https://lists.sourceforge.net/mailman/listinfo/qjson-devel) 44 | * Project Lead/Maintainer (2008-current): [Flavio Castelli](mailto:flavio@castelli.name). 45 | -------------------------------------------------------------------------------- /qjson/cmake_uninstall.cmake.in: -------------------------------------------------------------------------------- 1 | IF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") 2 | MESSAGE(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"") 3 | ENDIF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") 4 | 5 | FILE(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files) 6 | STRING(REGEX REPLACE "\n" ";" files "${files}") 7 | FOREACH(file ${files}) 8 | MESSAGE(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"") 9 | EXEC_PROGRAM( 10 | "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" 11 | OUTPUT_VARIABLE rm_out 12 | RETURN_VALUE rm_retval 13 | ) 14 | IF(NOT "${rm_retval}" STREQUAL 0) 15 | MESSAGE(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"") 16 | ENDIF(NOT "${rm_retval}" STREQUAL 0) 17 | ENDFOREACH(file) 18 | -------------------------------------------------------------------------------- /qjson/doc/footer.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | 10 | 13 | 15 | 19 | 20 |
5 | 6 | SourceForge Logo 9 | 11 | hosts this site. 12 | 14 | 16 | Send comments to:
17 | QJson Developers 18 |
21 | 22 | 26 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /qjson/doc/header.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | QJson - a Qt based library for mapping JSON data to QVariant objects 5 | 6 | 7 | 8 | 9 | 10 | 11 | QJson home page 12 | 13 |
14 | -------------------------------------------------------------------------------- /qjson/doc/qjson.dox: -------------------------------------------------------------------------------- 1 | /** 2 | \mainpage 3 | \section _intro Introduction 4 | 5 | JSON (JavaScript Object Notation) 6 | is a lightweight data-interchange format. 7 | It can represents integer, real number, string, an ordered sequence of value, and 8 | a collection of name/value pairs. 9 | 10 | QJson is a qt-based library that maps JSON data to QVariant objects. 11 | 12 | JSON arrays will be mapped to QVariantList instances, while JSON's objects will 13 | be mapped to QVariantMap. 14 | 15 | \section _usage Usage 16 | Converting JSON's data to QVariant instance is really simple: 17 | \code 18 | // create a JSonDriver instance 19 | QJson::Parser parser; 20 | 21 | bool ok; 22 | 23 | // json is a QString containing the data to convert 24 | QVariant result = parser.parse (json, &ok); 25 | \endcode 26 | 27 | Suppose you're going to convert this JSON data: 28 | \verbatim 29 | { 30 | "encoding" : "UTF-8", 31 | "plug-ins" : [ 32 | "python", 33 | "c++", 34 | "ruby" 35 | ], 36 | "indent" : { "length" : 3, "use_space" : true } 37 | } 38 | \endverbatim 39 | 40 | The following code would convert the JSON data and parse it: 41 | \code 42 | QJson::Parser parser; 43 | bool ok; 44 | 45 | QVariantMap result = parser.parse (json, &ok).toMap(); 46 | if (!ok) { 47 | qFatal("An error occurred during parsing"); 48 | exit (1); 49 | } 50 | 51 | qDebug() << "encoding:" << result["encoding"].toString(); 52 | qDebug() << "plugins:"; 53 | 54 | foreach (QVariant plugin, result["plug-ins"].toList()) { 55 | qDebug() << "\t-" << plugin.toString(); 56 | } 57 | 58 | QVariantMap nestedMap = result["indent"].toMap(); 59 | qDebug() << "length:" << nestedMap["length"].toInt(); 60 | qDebug() << "use_space:" << nestedMap["use_space"].toBool(); 61 | \endcode 62 | The output would be: 63 | \verbatim 64 | encoding: "UTF-8" 65 | plugins: 66 | - "python" 67 | - "c++" 68 | - "ruby" 69 | length: 3 70 | use_space: true 71 | \endverbatim 72 | 73 | The QJson::QObjectHelper class permits to serialize QObject instances into JSON. QJson::QObjectHelper also allows to 74 | initialize a QObject using the values stored inside of a JSON object. 75 | 76 | \section _build Build instructions 77 | QJson build system is based on cmake. Download QJson sources, extract them, move inside the sources directory and then: 78 | \code 79 | mkdir build 80 | cd build 81 | cmake .. 82 | make 83 | sudo make install 84 | \endcode 85 | 86 | \author Flavio Castelli 87 | */ 88 | -------------------------------------------------------------------------------- /qjson/include/QJson/Parser: -------------------------------------------------------------------------------- 1 | #include "../../src/parser.h" 2 | -------------------------------------------------------------------------------- /qjson/include/QJson/QObjectHelper: -------------------------------------------------------------------------------- 1 | #include "../../src/qobjecthelper.h" 2 | -------------------------------------------------------------------------------- /qjson/include/QJson/Serializer: -------------------------------------------------------------------------------- 1 | #include "../../src/serializer.h" 2 | -------------------------------------------------------------------------------- /qjson/src/.gitignore: -------------------------------------------------------------------------------- 1 | moc_* 2 | *.o 3 | Makefile 4 | -------------------------------------------------------------------------------- /qjson/src/json_scanner.cpp: -------------------------------------------------------------------------------- 1 | /* This file is part of QJson 2 | * 3 | * Copyright (C) 2008 Flavio Castelli 4 | * Copyright (C) 2013 Silvio Moioli 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License version 2.1, as published by the Free Software Foundation. 9 | * 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with this library; see the file COPYING.LIB. If not, write to 18 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 19 | * Boston, MA 02110-1301, USA. 20 | */ 21 | #include "json_scanner.cc" 22 | 23 | #include "qjson_debug.h" 24 | #include "json_scanner.h" 25 | #include "json_parser.hh" 26 | 27 | #include 28 | 29 | #include 30 | #include 31 | 32 | #include 33 | 34 | 35 | JSonScanner::JSonScanner(QIODevice* io) 36 | : m_allowSpecialNumbers(false), 37 | m_io (io), 38 | m_criticalError(false), 39 | m_C_locale(QLocale::C) 40 | { 41 | 42 | } 43 | 44 | JSonScanner::~JSonScanner() 45 | { 46 | } 47 | 48 | void JSonScanner::allowSpecialNumbers(bool allow) { 49 | m_allowSpecialNumbers = allow; 50 | } 51 | 52 | int JSonScanner::yylex(YYSTYPE* yylval, yy::location *yylloc) { 53 | m_yylval = yylval; 54 | m_yylloc = yylloc; 55 | m_yylloc->step(); 56 | int result = yylex(); 57 | 58 | if (m_criticalError) { 59 | return -1; 60 | } 61 | 62 | return result; 63 | } 64 | 65 | int JSonScanner::LexerInput(char* buf, int max_size) { 66 | if (!m_io->isOpen()) { 67 | qCritical() << "JSonScanner::yylex - io device is not open"; 68 | m_criticalError = true; 69 | return 0; 70 | } 71 | 72 | int readBytes = m_io->read(buf, max_size); 73 | if(readBytes < 0) { 74 | qCritical() << "JSonScanner::yylex - error while reading from io device"; 75 | m_criticalError = true; 76 | return 0; 77 | } 78 | 79 | return readBytes; 80 | } 81 | 82 | 83 | -------------------------------------------------------------------------------- /qjson/src/json_scanner.h: -------------------------------------------------------------------------------- 1 | /* This file is part of QJson 2 | * 3 | * Copyright (C) 2008 Flavio Castelli 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License version 2.1, as published by the Free Software Foundation. 8 | * 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this library; see the file COPYING.LIB. If not, write to 17 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 18 | * Boston, MA 02110-1301, USA. 19 | */ 20 | 21 | #ifndef _JSON_SCANNER 22 | #define _JSON_SCANNER 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | #define YYSTYPE QVariant 29 | 30 | // Only include FlexLexer.h if it hasn't been already included 31 | #if ! defined(yyFlexLexerOnce) 32 | #include 33 | #endif 34 | 35 | #include "parser_p.h" 36 | 37 | 38 | 39 | namespace yy { 40 | class location; 41 | int yylex(YYSTYPE *yylval, yy::location *yylloc, QJson::ParserPrivate* driver); 42 | } 43 | 44 | class JSonScanner : public yyFlexLexer 45 | { 46 | public: 47 | explicit JSonScanner(QIODevice* io); 48 | ~JSonScanner(); 49 | 50 | void allowSpecialNumbers(bool allow); 51 | 52 | int yylex(YYSTYPE* yylval, yy::location *yylloc); 53 | int yylex(); 54 | int LexerInput(char* buf, int max_size); 55 | protected: 56 | bool m_allowSpecialNumbers; 57 | QIODevice* m_io; 58 | 59 | YYSTYPE* m_yylval; 60 | yy::location* m_yylloc; 61 | bool m_criticalError; 62 | QString m_currentString; 63 | QLocale m_C_locale; 64 | }; 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /qjson/src/parser_p.h: -------------------------------------------------------------------------------- 1 | /* This file is part of QJson 2 | * 3 | * Copyright (C) 2008 Flavio Castelli 4 | * Copyright (C) 2009 Michael Leupold 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License version 2.1, as published by the Free Software Foundation. 9 | * 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with this library; see the file COPYING.LIB. If not, write to 18 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 19 | * Boston, MA 02110-1301, USA. 20 | */ 21 | 22 | #ifndef QJSON_PARSER_P_H 23 | #define QJSON_PARSER_P_H 24 | 25 | #include "parser.h" 26 | 27 | #include 28 | #include 29 | 30 | class JSonScanner; 31 | 32 | namespace yy { 33 | class json_parser; 34 | } 35 | 36 | namespace QJson { 37 | 38 | class ParserPrivate 39 | { 40 | public: 41 | ParserPrivate(); 42 | ~ParserPrivate(); 43 | 44 | void reset(); 45 | 46 | void setError(QString errorMsg, int line); 47 | 48 | JSonScanner* m_scanner; 49 | bool m_error; 50 | int m_errorLine; 51 | QString m_errorMsg; 52 | QVariant m_result; 53 | bool m_specialNumbersAllowed; 54 | }; 55 | } 56 | 57 | #endif // QJSON_PARSER_H 58 | -------------------------------------------------------------------------------- /qjson/src/parserrunnable.cpp: -------------------------------------------------------------------------------- 1 | /* This file is part of qjson 2 | * 3 | * Copyright (C) 2009 Flavio Castelli 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License version 2.1, as published by the Free Software Foundation. 8 | * 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this library; see the file COPYING.LIB. If not, write to 17 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 18 | * Boston, MA 02110-1301, USA. 19 | */ 20 | 21 | #include "parserrunnable.h" 22 | 23 | #include "parser.h" 24 | 25 | #include 26 | #include 27 | 28 | using namespace QJson; 29 | 30 | class QJson::ParserRunnable::Private 31 | { 32 | public: 33 | QByteArray m_data; 34 | }; 35 | 36 | ParserRunnable::ParserRunnable(QObject* parent) 37 | : QObject(parent), 38 | QRunnable(), 39 | d(new Private) 40 | { 41 | qRegisterMetaType("QVariant"); 42 | } 43 | 44 | ParserRunnable::~ParserRunnable() 45 | { 46 | delete d; 47 | } 48 | 49 | void ParserRunnable::setData( const QByteArray& data ) { 50 | d->m_data = data; 51 | } 52 | 53 | void ParserRunnable::run() 54 | { 55 | qDebug() << Q_FUNC_INFO; 56 | 57 | bool ok; 58 | Parser parser; 59 | QVariant result = parser.parse (d->m_data, &ok); 60 | if (ok) { 61 | qDebug() << "successfully converted json item to QVariant object"; 62 | emit parsingFinished(result, true, QString()); 63 | } else { 64 | const QString errorText = tr("An error occurred while parsing json: %1").arg(parser.errorString()); 65 | qCritical() << errorText; 66 | emit parsingFinished(QVariant(), false, errorText); 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /qjson/src/parserrunnable.h: -------------------------------------------------------------------------------- 1 | /* This file is part of qjson 2 | * 3 | * Copyright (C) 2009 Flavio Castelli 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License version 2.1, as published by the Free Software Foundation. 8 | * 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this library; see the file COPYING.LIB. If not, write to 17 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 18 | * Boston, MA 02110-1301, USA. 19 | */ 20 | 21 | #ifndef PARSERRUNNABLE_H 22 | #define PARSERRUNNABLE_H 23 | 24 | #include "qjson_export.h" 25 | 26 | #include 27 | #include 28 | 29 | QT_BEGIN_NAMESPACE 30 | class QVariant; 31 | QT_END_NAMESPACE 32 | 33 | namespace QJson { 34 | /** 35 | * @brief Convenience class for converting JSON data to QVariant objects using a dedicated thread 36 | */ 37 | class QJSON_EXPORT ParserRunnable : public QObject, public QRunnable 38 | { 39 | Q_OBJECT 40 | public: 41 | explicit ParserRunnable(QObject* parent = 0); 42 | ~ParserRunnable(); 43 | 44 | void setData( const QByteArray& data ); 45 | 46 | void run(); 47 | 48 | Q_SIGNALS: 49 | /** 50 | * This signal is emitted when the parsing process has been completed 51 | * @param json contains the result of the parsing 52 | * @param ok if a parsing error occurs ok is set to false, otherwise it's set to true. 53 | * @param error_msg contains a string explaining the failure reason 54 | **/ 55 | void parsingFinished(const QVariant& json, bool ok, const QString& error_msg); 56 | 57 | private: 58 | Q_DISABLE_COPY(ParserRunnable) 59 | class Private; 60 | Private* const d; 61 | }; 62 | } 63 | 64 | #endif // PARSERRUNNABLE_H 65 | -------------------------------------------------------------------------------- /qjson/src/qjson_debug.h: -------------------------------------------------------------------------------- 1 | /* This file is part of qjson 2 | * 3 | * Copyright (C) 2009 Michael Leupold 4 | * Copyright (C) 2013 Silvio Moioli 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License version 2.1, as published by the Free Software Foundation. 9 | * 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with this library; see the file COPYING.LIB. If not, write to 18 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 19 | * Boston, MA 02110-1301, USA. 20 | */ 21 | 22 | #ifndef QJSON_DEBUG_H 23 | #define QJSON_DEBUG_H 24 | 25 | #include 26 | 27 | // define qjsonDebug() 28 | #ifdef QJSON_VERBOSE_DEBUG_OUTPUT 29 | inline QDebug qjsonDebug() { return QDebug(QtDebugMsg); } 30 | #else 31 | #define qjsonDebug() if(false) QDebug(QtDebugMsg) 32 | #endif 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /qjson/src/qjson_export.h: -------------------------------------------------------------------------------- 1 | /* This file is part of the KDE project 2 | Copyright (C) 2009 Pino Toscano 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License version 2.1, as published by the Free Software Foundation. 7 | 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public License 15 | along with this library; see the file COPYING.LIB. If not, write to 16 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | #ifndef QJSON_EXPORT_H 21 | #define QJSON_EXPORT_H 22 | 23 | #include 24 | 25 | #ifndef QJSON_STATIC 26 | # ifndef QJSON_EXPORT 27 | # if defined(QJSON_MAKEDLL) 28 | /* We are building this library */ 29 | # define QJSON_EXPORT Q_DECL_EXPORT 30 | # else 31 | /* We are using this library */ 32 | # define QJSON_EXPORT Q_DECL_IMPORT 33 | # endif 34 | # endif 35 | #endif 36 | #ifndef QJSON_EXPORT 37 | # define QJSON_EXPORT 38 | #endif 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /qjson/src/serializerrunnable.cpp: -------------------------------------------------------------------------------- 1 | #include "serializerrunnable.h" 2 | 3 | /* This file is part of qjson 4 | * 5 | * Copyright (C) 2009 Flavio Castelli 6 | * 2009 Frank Osterfeld 7 | * 8 | * This library is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU Lesser General Public 10 | * License version 2.1, as published by the Free Software Foundation. 11 | * 12 | * 13 | * This library is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this library; see the file COPYING.LIB. If not, write to 20 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 21 | * Boston, MA 02110-1301, USA. 22 | */ 23 | 24 | #include "parserrunnable.h" 25 | #include "serializer.h" 26 | 27 | #include 28 | #include 29 | 30 | using namespace QJson; 31 | 32 | class SerializerRunnable::Private 33 | { 34 | public: 35 | QVariant json; 36 | }; 37 | 38 | SerializerRunnable::SerializerRunnable(QObject* parent) 39 | : QObject(parent), 40 | QRunnable(), 41 | d(new Private) 42 | { 43 | qRegisterMetaType("QVariant"); 44 | } 45 | 46 | SerializerRunnable::~SerializerRunnable() 47 | { 48 | delete d; 49 | } 50 | 51 | void SerializerRunnable::setJsonObject( const QVariant& json ) 52 | { 53 | d->json = json; 54 | } 55 | 56 | void SerializerRunnable::run() 57 | { 58 | Serializer serializer; 59 | bool ok; 60 | const QByteArray serialized = serializer.serialize( d->json, &ok); 61 | emit parsingFinished( serialized, ok, serializer.errorMessage() ); 62 | } 63 | -------------------------------------------------------------------------------- /qjson/src/serializerrunnable.h: -------------------------------------------------------------------------------- 1 | /* This file is part of qjson 2 | * 3 | * Copyright (C) 2009 Frank Osterfeld 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License version 2.1, as published by the Free Software Foundation. 8 | * 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this library; see the file COPYING.LIB. If not, write to 17 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 18 | * Boston, MA 02110-1301, USA. 19 | */ 20 | 21 | #ifndef SERIALIZERRUNNABLE_H 22 | #define SERIALIZERRUNNABLE_H 23 | 24 | #include "qjson_export.h" 25 | 26 | #include 27 | #include 28 | 29 | QT_BEGIN_NAMESPACE 30 | class QByteArray; 31 | class QString; 32 | class QVariant; 33 | QT_END_NAMESPACE 34 | 35 | namespace QJson { 36 | /** 37 | * @brief Convenience class for converting JSON data to QVariant objects using a dedicated thread 38 | */ 39 | class QJSON_EXPORT SerializerRunnable : public QObject, public QRunnable 40 | { 41 | Q_OBJECT 42 | public: 43 | explicit SerializerRunnable(QObject* parent = 0); 44 | ~SerializerRunnable(); 45 | 46 | /** 47 | * Sets the json object to serialize. 48 | * 49 | * @param json QVariant containing the json representation to be serialized 50 | */ 51 | void setJsonObject( const QVariant& json ); 52 | 53 | /* reimp */ void run(); 54 | 55 | Q_SIGNALS: 56 | /** 57 | * This signal is emitted when the serialization process has been completed 58 | * @param serialized contains the result of the serialization 59 | * @param ok if a serialization error occurs ok is set to false, otherwise it's set to true. 60 | * @param error_msg contains a string explaining the failure reason 61 | **/ 62 | void parsingFinished(const QByteArray& serialized, bool ok, const QString& error_msg); 63 | 64 | private: 65 | Q_DISABLE_COPY(SerializerRunnable) 66 | class Private; 67 | Private* const d; 68 | }; 69 | } 70 | 71 | #endif // SERIALIZERRUNNABLE_H 72 | -------------------------------------------------------------------------------- /qjson/tests/.gitignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | -------------------------------------------------------------------------------- /qjson/tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | IF (Qt5Core_FOUND) 2 | FIND_PACKAGE( Qt5Test REQUIRED ) 3 | 4 | INCLUDE_DIRECTORIES(${Qt5Test_INCLUDE_DIRS}) 5 | ADD_DEFINITIONS(${Qt5Test_DEFINITIONS}) 6 | SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Test_EXECUTABLE_COMPILE_FLAGS}") 7 | 8 | SET (TEST_LIBRARIES ${Qt5Test_LIBRARIES}) 9 | ENDIF() 10 | 11 | ADD_SUBDIRECTORY(cmdline_tester) 12 | ADD_SUBDIRECTORY(parser) 13 | ADD_SUBDIRECTORY(scanner) 14 | ADD_SUBDIRECTORY(qobjecthelper) 15 | ADD_SUBDIRECTORY(serializer) 16 | -------------------------------------------------------------------------------- /qjson/tests/benchmarks/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ##### Probably don't want to edit below this line ##### 2 | 3 | SET( QT_USE_QTTEST TRUE ) 4 | 5 | INCLUDE(AddFileDependencies) 6 | 7 | # Include the library include directories, and the current build directory (moc) 8 | INCLUDE_DIRECTORIES( 9 | ../../include 10 | ${CMAKE_CURRENT_BINARY_DIR} 11 | ) 12 | 13 | SET( UNIT_TESTS 14 | parsingbenchmark 15 | qlocalevsstrtod_l 16 | ) 17 | 18 | # Build the tests 19 | FOREACH(test ${UNIT_TESTS}) 20 | MESSAGE(STATUS "Building ${test}") 21 | ADD_EXECUTABLE( 22 | ${test} 23 | ${test}.cpp 24 | ) 25 | 26 | TARGET_LINK_LIBRARIES( 27 | ${test} 28 | ${QT_LIBRARIES} 29 | ${TEST_LIBRARIES} 30 | qjson 31 | ) 32 | if (QJSON_TEST_OUTPUT STREQUAL "xml") 33 | # produce XML output 34 | add_test( ${test} ${test} -xml -o ${test}.tml ) 35 | else (QJSON_TEST_OUTPUT STREQUAL "xml") 36 | add_test( ${test} ${test} ) 37 | endif (QJSON_TEST_OUTPUT STREQUAL "xml") 38 | ENDFOREACH() 39 | -------------------------------------------------------------------------------- /qjson/tests/benchmarks/parsingbenchmark.cpp: -------------------------------------------------------------------------------- 1 | /* This file is part of QJson 2 | * 3 | * Copyright (C) 2014 Sune Vuorela 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License version 2.1, as published by the Free Software Foundation. 8 | * 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this library; see the file COPYING.LIB. If not, write to 17 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 18 | * Boston, MA 02110-1301, USA. 19 | */ 20 | 21 | #include 22 | #include 23 | #include 24 | #include 25 | 26 | class ParsingBenchmark: public QObject { 27 | Q_OBJECT 28 | private Q_SLOTS: 29 | void benchmark(); 30 | }; 31 | 32 | void ParsingBenchmark::benchmark() { 33 | QString path = QFINDTESTDATA("largefile.json"); 34 | 35 | QVERIFY(QFile::exists(path)); 36 | 37 | QFile f(path); 38 | QVERIFY(f.open(QIODevice::ReadOnly)); 39 | 40 | QByteArray data = f.readAll(); 41 | 42 | QVariant result; 43 | 44 | QJson::Parser parser; 45 | QBENCHMARK { 46 | result = parser.parse(data); 47 | } 48 | 49 | Q_UNUSED(result); 50 | } 51 | 52 | 53 | QTEST_MAIN(ParsingBenchmark) 54 | 55 | #include "parsingbenchmark.moc" 56 | -------------------------------------------------------------------------------- /qjson/tests/benchmarks/qlocalevsstrtod_l.cpp: -------------------------------------------------------------------------------- 1 | /* This file is part of QJson 2 | * 3 | * Copyright (C) 2014 Sune Vuorela 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License version 2.1, as published by the Free Software Foundation. 8 | * 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this library; see the file COPYING.LIB. If not, write to 17 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 18 | * Boston, MA 02110-1301, USA. 19 | */ 20 | 21 | #include 22 | #include 23 | #include 24 | 25 | class QLocaleVsStrtod_l : public QObject { 26 | Q_OBJECT 27 | private Q_SLOTS: 28 | void benchmark(); 29 | void benchmark_data(); 30 | 31 | }; 32 | 33 | void QLocaleVsStrtod_l::benchmark() { 34 | QFETCH(bool, useQLocale); 35 | QList l; 36 | l << strdup("0.123") << strdup("0.947834") << strdup("8.8373") << strdup("884.82921"); 37 | 38 | double result; 39 | 40 | if(useQLocale) { 41 | QLocale c(QLocale::C); 42 | QBENCHMARK { 43 | Q_FOREACH(const char* str, l) { 44 | result = c.toDouble(QString(str)); 45 | } 46 | } 47 | } else { 48 | locale_t c = newlocale(LC_NUMERIC_MASK, "C", NULL); 49 | QBENCHMARK { 50 | Q_FOREACH(const char* str, l) { 51 | result = strtod_l(str, NULL, c); 52 | } 53 | } 54 | } 55 | 56 | 57 | Q_FOREACH(char* str, l) { 58 | free(str); 59 | } 60 | } 61 | 62 | void QLocaleVsStrtod_l::benchmark_data() { 63 | QTest::addColumn("useQLocale"); 64 | 65 | QTest::newRow("using QLocale") << true; 66 | QTest::newRow("using strtod_l") << false; 67 | } 68 | 69 | QTEST_MAIN(QLocaleVsStrtod_l); 70 | #include "qlocalevsstrtod_l.moc" 71 | -------------------------------------------------------------------------------- /qjson/tests/cmdline_tester/.gitignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | *.o 3 | *.moc 4 | cmdline_tester 5 | -------------------------------------------------------------------------------- /qjson/tests/cmdline_tester/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ##### Probably don't want to edit below this line ##### 2 | 3 | IF (WIN32 AND Qt5Core_FOUND) 4 | FIND_PACKAGE( Qt5Widgets REQUIRED ) 5 | 6 | INCLUDE_DIRECTORIES(${Qt5Widgets_INCLUDE_DIRS}) 7 | ADD_DEFINITIONS(${Qt5Widgets_DEFINITIONS}) 8 | SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}") 9 | ENDIF() 10 | 11 | IF (NOT Qt5Core_FOUND) 12 | # Use it 13 | INCLUDE( ${QT_USE_FILE} ) 14 | ENDIF() 15 | 16 | INCLUDE(AddFileDependencies) 17 | 18 | # Include the library include directories, and the current build directory (moc) 19 | INCLUDE_DIRECTORIES( 20 | ../../include 21 | ${CMAKE_CURRENT_BINARY_DIR} 22 | ) 23 | 24 | ADD_EXECUTABLE( 25 | cmdline_tester 26 | cmdline_tester.cpp 27 | cmdlineparser.cpp 28 | ) 29 | 30 | TARGET_LINK_LIBRARIES( 31 | cmdline_tester 32 | ${QT_LIBRARIES} 33 | ${Qt5Widgets_LIBRARIES} 34 | qjson 35 | ) 36 | -------------------------------------------------------------------------------- /qjson/tests/cmdline_tester/cmdlineparser.h: -------------------------------------------------------------------------------- 1 | /* This file is part of qjson 2 | * 3 | * Copyright (C) 2010 Flavio Castelli 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License version 2.1, as published by the Free Software Foundation. 8 | * 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this library; see the file COPYING.LIB. If not, write to 17 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 18 | * Boston, MA 02110-1301, USA. 19 | */ 20 | 21 | #ifndef CMDLINEPARSER_H 22 | #define CMDLINEPARSER_H 23 | 24 | #include 25 | #include 26 | 27 | #include 28 | 29 | namespace QJson { 30 | class CmdLineParser 31 | { 32 | public: 33 | enum Result {Ok, Help, Error}; 34 | 35 | CmdLineParser(const QStringList &arguments); 36 | Result parse(); 37 | 38 | void setIndentationMode(const IndentMode &mode); 39 | IndentMode indentationMode() const; 40 | QString helpFile() const; 41 | QString file() const; 42 | bool serialize(); 43 | bool quiet(); 44 | 45 | void showMessage(const QString &msg, bool error); 46 | 47 | private: 48 | bool hasMoreArgs() const; 49 | const QString &nextArg(); 50 | void handleSetIndentationMode(); 51 | 52 | QStringList m_arguments; 53 | int m_pos; 54 | IndentMode m_indentationMode; 55 | QString m_file; 56 | bool m_serialize; 57 | bool m_quiet; 58 | static const QString m_helpMessage; 59 | QString m_error; 60 | }; 61 | } 62 | 63 | #endif 64 | 65 | -------------------------------------------------------------------------------- /qjson/tests/cmdline_tester/example.txt: -------------------------------------------------------------------------------- 1 | { 2 | "glossary": { 3 | "title": "example glossary", 4 | "GlossDiv": { 5 | "title": "S", 6 | "GlossList": { 7 | "GlossEntry": { 8 | "ID": "SGML", 9 | "SortAs": "SGML", 10 | "GlossTerm": "Standard Generalized Markup Language", 11 | "Acronym": "SGML", 12 | "Abbrev": "ISO 8879:1986", 13 | "GlossDef": { 14 | "para": "A meta-markup language, used to create markup languages such as DocBook.", 15 | "GlossSeeAlso": ["GML", "XML"] 16 | }, 17 | "GlossSee": "markup" 18 | } 19 | } 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /qjson/tests/parser/.gitignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | *.o 3 | *.moc 4 | parser 5 | -------------------------------------------------------------------------------- /qjson/tests/parser/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ##### Probably don't want to edit below this line ##### 2 | 3 | SET( QT_USE_QTTEST TRUE ) 4 | 5 | IF (NOT Qt5Core_FOUND) 6 | # Use it 7 | INCLUDE( ${QT_USE_FILE} ) 8 | ENDIF() 9 | 10 | INCLUDE(AddFileDependencies) 11 | 12 | # Include the library include directories, and the current build directory (moc) 13 | INCLUDE_DIRECTORIES( 14 | ../../include 15 | ${CMAKE_CURRENT_BINARY_DIR} 16 | ) 17 | 18 | SET( UNIT_TESTS 19 | testparser 20 | ) 21 | 22 | # Build the tests 23 | FOREACH(test ${UNIT_TESTS}) 24 | MESSAGE(STATUS "Building ${test}") 25 | IF (NOT Qt5Core_FOUND) 26 | QT4_WRAP_CPP(MOC_SOURCE ${test}.cpp) 27 | ENDIF() 28 | ADD_EXECUTABLE( 29 | ${test} 30 | ${test}.cpp 31 | ) 32 | 33 | ADD_FILE_DEPENDENCIES(${test}.cpp ${MOC_SOURCE}) 34 | TARGET_LINK_LIBRARIES( 35 | ${test} 36 | ${QT_LIBRARIES} 37 | ${TEST_LIBRARIES} 38 | qjson 39 | ) 40 | if (QJSON_TEST_OUTPUT STREQUAL "xml") 41 | # produce XML output 42 | add_test( ${test} ${test} -xml -o ${test}.tml ) 43 | else (QJSON_TEST_OUTPUT STREQUAL "xml") 44 | add_test( ${test} ${test} ) 45 | endif (QJSON_TEST_OUTPUT STREQUAL "xml") 46 | ENDFOREACH() 47 | -------------------------------------------------------------------------------- /qjson/tests/qobjecthelper/.gitignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | *.o 3 | *.moc 4 | moc_* 5 | qobjecthelper 6 | -------------------------------------------------------------------------------- /qjson/tests/qobjecthelper/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ##### Probably don't want to edit below this line ##### 2 | 3 | SET( QT_USE_QTTEST TRUE ) 4 | 5 | IF (NOT Qt5Core_FOUND) 6 | # Use it 7 | INCLUDE( ${QT_USE_FILE} ) 8 | ENDIF() 9 | 10 | INCLUDE(AddFileDependencies) 11 | 12 | # Include the library include directories, and the current build directory (moc) 13 | INCLUDE_DIRECTORIES( 14 | ../../include 15 | ${CMAKE_CURRENT_BINARY_DIR} 16 | ) 17 | 18 | SET (qjson_test_support_SRCS person.cpp) 19 | IF (NOT Qt5Core_FOUND) 20 | QT4_WRAP_CPP(qjson_test_support_MOC_SRCS person.h) 21 | ENDIF() 22 | 23 | ADD_LIBRARY (qjson_test_support STATIC ${qjson_test_support_SRCS} 24 | ${qjson_test_support_MOC_SRCS}) 25 | 26 | SET( UNIT_TESTS 27 | testqobjecthelper 28 | ) 29 | 30 | # Build the tests 31 | FOREACH(test ${UNIT_TESTS}) 32 | MESSAGE(STATUS "Building ${test}") 33 | IF (NOT Qt5Core_FOUND) 34 | QT4_WRAP_CPP(MOC_SOURCE ${test}.cpp) 35 | ENDIF() 36 | ADD_EXECUTABLE( 37 | ${test} 38 | ${test}.cpp 39 | ) 40 | 41 | ADD_FILE_DEPENDENCIES(${test}.cpp ${MOC_SOURCE}) 42 | TARGET_LINK_LIBRARIES( 43 | ${test} 44 | ${QT_LIBRARIES} 45 | ${TEST_LIBRARIES} 46 | qjson 47 | qjson_test_support 48 | ) 49 | if (QJSON_TEST_OUTPUT STREQUAL "xml") 50 | # produce XML output 51 | add_test( ${test} ${test} -xml -o ${test}.tml ) 52 | else (QJSON_TEST_OUTPUT STREQUAL "xml") 53 | add_test( ${test} ${test} ) 54 | endif (QJSON_TEST_OUTPUT STREQUAL "xml") 55 | ENDFOREACH() 56 | -------------------------------------------------------------------------------- /qjson/tests/qobjecthelper/person.cpp: -------------------------------------------------------------------------------- 1 | #include "person.h" 2 | 3 | Person::Person(QObject* parent) 4 | : QObject(parent), 5 | m_name(), 6 | m_phoneNumber(0), 7 | m_gender(Female), 8 | m_luckyNumber(0) 9 | { 10 | } 11 | 12 | Person::~Person() 13 | { 14 | } 15 | 16 | QString Person::name() const 17 | { 18 | return m_name; 19 | } 20 | 21 | void Person::setName(const QString& name) 22 | { 23 | m_name = name; 24 | } 25 | 26 | int Person::phoneNumber() const 27 | { 28 | return m_phoneNumber; 29 | } 30 | 31 | void Person::setPhoneNumber(const int phoneNumber) 32 | { 33 | m_phoneNumber = phoneNumber; 34 | } 35 | 36 | void Person::setGender(Gender gender) 37 | { 38 | m_gender = gender; 39 | } 40 | 41 | Person::Gender Person::gender() const 42 | { 43 | return m_gender; 44 | } 45 | 46 | QDate Person::dob() const 47 | { 48 | return m_dob; 49 | } 50 | 51 | void Person::setDob(const QDate& dob) 52 | { 53 | m_dob = dob; 54 | } 55 | 56 | QVariant Person::customField() const 57 | { 58 | return m_customField; 59 | } 60 | 61 | void Person::setCustomField(const QVariant& customField) 62 | { 63 | m_customField = customField; 64 | } 65 | 66 | const quint16 Person::luckyNumber() const 67 | { 68 | return m_luckyNumber; 69 | } 70 | 71 | void Person::setLuckyNumber(const quint16 luckyNumber) 72 | { 73 | m_luckyNumber = luckyNumber; 74 | } 75 | 76 | -------------------------------------------------------------------------------- /qjson/tests/qobjecthelper/person.h: -------------------------------------------------------------------------------- 1 | /* This file is part of qjson 2 | * 3 | * Copyright (C) 2009 Till Adam 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License version 2.1, as published by the Free Software Foundation. 8 | * 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this library; see the file COPYING.LIB. If not, write to 17 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 18 | * Boston, MA 02110-1301, USA. 19 | */ 20 | 21 | #ifndef PERSON_H 22 | #define PERSON_H 23 | 24 | #include 25 | #include 26 | #include 27 | #include 28 | 29 | class Person : public QObject 30 | { 31 | Q_OBJECT 32 | 33 | Q_PROPERTY(QString name READ name WRITE setName) 34 | Q_PROPERTY(int phoneNumber READ phoneNumber WRITE setPhoneNumber) 35 | Q_PROPERTY(Gender gender READ gender WRITE setGender) 36 | Q_PROPERTY(QDate dob READ dob WRITE setDob) 37 | Q_PROPERTY(QVariant customField READ customField WRITE setCustomField) 38 | Q_PROPERTY(quint16 luckyNumber READ luckyNumber WRITE setLuckyNumber) 39 | Q_ENUMS(Gender) 40 | 41 | public: 42 | Person(QObject* parent = 0); 43 | ~Person(); 44 | 45 | QString name() const; 46 | void setName(const QString& name); 47 | 48 | int phoneNumber() const; 49 | void setPhoneNumber(const int phoneNumber); 50 | 51 | enum Gender {Male, Female}; 52 | void setGender(Gender gender); 53 | Gender gender() const; 54 | 55 | QDate dob() const; 56 | void setDob(const QDate& dob); 57 | 58 | QVariant customField() const; 59 | void setCustomField(const QVariant& customField); 60 | 61 | const quint16 luckyNumber() const; 62 | void setLuckyNumber(const quint16 luckyNumber); 63 | 64 | private: 65 | QString m_name; 66 | int m_phoneNumber; 67 | Gender m_gender; 68 | QDate m_dob; 69 | QVariant m_customField; 70 | quint16 m_luckyNumber; 71 | }; 72 | 73 | #endif 74 | -------------------------------------------------------------------------------- /qjson/tests/scanner/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ##### Probably don't want to edit below this line ##### 2 | 3 | SET( QT_USE_QTTEST TRUE ) 4 | 5 | IF (NOT Qt5Core_FOUND) 6 | # Use it 7 | INCLUDE( ${QT_USE_FILE} ) 8 | ENDIF() 9 | 10 | INCLUDE(AddFileDependencies) 11 | 12 | # Include the library include directories, and the current build directory (moc) 13 | INCLUDE_DIRECTORIES( 14 | ../../src 15 | ../../include 16 | ${CMAKE_CURRENT_BINARY_DIR} 17 | ) 18 | 19 | SET( UNIT_TESTS 20 | testscanner 21 | ) 22 | 23 | # Build the tests 24 | FOREACH(test ${UNIT_TESTS}) 25 | MESSAGE(STATUS "Building ${test}") 26 | IF (NOT Qt5Core_FOUND) 27 | QT4_WRAP_CPP(MOC_SOURCE ${test}.cpp) 28 | ENDIF() 29 | ADD_EXECUTABLE( 30 | ${test} 31 | ${test}.cpp 32 | ) 33 | 34 | if(WIN32 AND BUILD_SHARED_LIBS) 35 | set(QJSON_SCANNER qjson_scanner) 36 | endif() 37 | 38 | ADD_FILE_DEPENDENCIES(${test}.cpp ${MOC_SOURCE}) 39 | TARGET_LINK_LIBRARIES( 40 | ${test} 41 | ${QT_LIBRARIES} 42 | ${TEST_LIBRARIES} 43 | qjson 44 | ${QJSON_SCANNER} 45 | ) 46 | if (QJSON_TEST_OUTPUT STREQUAL "xml") 47 | # produce XML output 48 | add_test( ${test} ${test} -xml -o ${test}.tml ) 49 | else (QJSON_TEST_OUTPUT STREQUAL "xml") 50 | add_test( ${test} ${test} ) 51 | endif (QJSON_TEST_OUTPUT STREQUAL "xml") 52 | ENDFOREACH() 53 | -------------------------------------------------------------------------------- /qjson/tests/serializer/.gitignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | *.o 3 | *.moc 4 | serializer 5 | -------------------------------------------------------------------------------- /qjson/tests/serializer/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ##### Probably don't want to edit below this line ##### 2 | 3 | SET( QT_USE_QTTEST TRUE ) 4 | 5 | IF (NOT Qt5Core_FOUND) 6 | # Use it 7 | INCLUDE( ${QT_USE_FILE} ) 8 | ENDIF() 9 | 10 | INCLUDE(AddFileDependencies) 11 | 12 | # Include the library include directories, and the current build directory (moc) 13 | INCLUDE_DIRECTORIES( 14 | ../../include 15 | ${CMAKE_CURRENT_BINARY_DIR} 16 | ) 17 | 18 | SET( UNIT_TESTS 19 | testserializer 20 | ) 21 | 22 | # Build the tests 23 | FOREACH(test ${UNIT_TESTS}) 24 | MESSAGE(STATUS "Building ${test}") 25 | IF (NOT Qt5Core_FOUND) 26 | QT4_WRAP_CPP(MOC_SOURCE ${test}.cpp) 27 | ENDIF() 28 | ADD_EXECUTABLE( 29 | ${test} 30 | ${test}.cpp 31 | ) 32 | 33 | ADD_FILE_DEPENDENCIES(${test}.cpp ${MOC_SOURCE}) 34 | TARGET_LINK_LIBRARIES( 35 | ${test} 36 | ${QT_LIBRARIES} 37 | ${TEST_LIBRARIES} 38 | qjson 39 | ) 40 | if (QJSON_TEST_OUTPUT STREQUAL "xml") 41 | # produce XML output 42 | add_test( ${test} ${test} -xml -o ${test}.tml ) 43 | else (QJSON_TEST_OUTPUT STREQUAL "xml") 44 | add_test( ${test} ${test} ) 45 | endif (QJSON_TEST_OUTPUT STREQUAL "xml") 46 | ENDFOREACH() 47 | --------------------------------------------------------------------------------