Commit 04c83898 authored by Bo Thorsen's avatar Bo Thorsen

#13 Create a IVEditor library for the rest of the files and link this to main.cpp

parent 05f0eff6
build-TASTEeditor-*
TASTEeditor/TASTEeditor.pro.user
# generated for QtC:
*.pro.user
*.autosave
stages:
- build
build_debian10_gcc:
stage: build
tags:
- docker
image: registry.git.vikingsoftware.com/esa/taste3-ci-image:latest
script:
- mkdir -p build; cd build
- qmake -recursive ..
- make -j 8
# taste3
ESA's TASTE (https://taste.tools/) evolution (v3?)
Dependency list
===============
This repository depends on these parts:
* Qt (tested with 5.14.1, works with earlier as well)
* The Qt SVG module
* Grantlee (see below)
Grantlee templating engine
==========================
Grantlee is a Qt implementation of string template engine of Django syntax.
Sources of Grantlee are avalable from here https://github.com/steveire/grantlee
git clone https://github.com/steveire/grantlee.git
Template engine documentation
-----------------------------
The best source of documentation is in the grantlee website http://www.grantlee.org. Examples of use are found here: http://www.grantlee.org/apidox/examples.html.
Linux build
-----------
To build Grantlee, you need at least Qt5.3 (with development packages), CMake 3.1 and
some additional optional packages:
sudo apt install cmake lcov cccc doxygen
The current Grantlee release (v.5.2.0) has a problem with escape sequences.
Therefore you must apply a patch before:
cp <TASTE3_DIR>/grantlee/fix_escape.diff <GRANTLEE_DIR>
cd <GRANTLEE_DIR>
git apply fix_escape.diff
To build Taste3 correctly Grantlee should be installed into QTDIR directory:
export QTDIR=$(qmake -query QT_INSTALL_PREFIX)
export CMAKE_PREFIX_PATH=$QTDIR:$CMAKE_PREFIX_PATH
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=$QTDIR ..
cmake --build .
cmake --build . --target install
The last command can require root permissions. Then use the 'sudo' command as follows:
sudo cmake --build . --target install
Windows build
-------------
Make sure cmake, qmake and Visual Studio are installed and avalable in PATH.
Following instructions require git bash.
cp <TASTE3_DIR>/grantlee/fix_escape.diff <GRANTLEE_DIR>
cd <GRANTLEE_DIR>
git apply --ignore-space-change --ignore-whitespace fix_escape.diff
To build Taste3 correctly Grantlee should be installed into QTDIR directory (if CMAKE_PREFIX_PATH is already set, expand it instead of setting):
set QTDIR=C:\Qt\5.14.1\msvc2017_64
set CMAKE_PREFIX_PATH=%QTDIR%
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=%QTDIR% -A x64 ..
cmake --build . --config Release
cmake --build . --config Release --target install
cmake --build . --config Debug
cmake --build . --config Debug --target install
Taste3 build
============
Install dependendcies
---------------------
Nothing to do if pre-built Qt is used.
Otherwise it is required to install QtSvg module from debian packages.
sudo apt install libqt5svg5-dev
Clone sources
-------------
git clone ssh://git@git.vikingsoftware.com:2222/esa/taste3.git
Build
-----
mkdir build
cd build
qmake ../taste3
make -j<number_of_build_threads>
Grantlee notes
==============
**Steps to integrate the string template engine**<br>
The current implementation is based on the [Grantlee string template library](https://github.com/steveire/grantlee).
* Build and install *Grantlee* (please look at README.md).
* Add the next lines into your *.pro file:<br>
`GRANTLEE_LIB_DIR = $$[QT_INSTALL_LIBS]`<br>
`DEFINES += GRANTLEE_LIB_DIR='\\"$$GRANTLEE_LIB_DIR\\"'`<br>
`GRANTLEE_LIB=Grantlee_Templates`<br>
`win32: CONFIG(debug, debug|release):GRANTLEE_LIB = $$join(GRANTLEE_LIB,,,d)`<br>
`LIBS += -L$$GRANTLEE_LIB_DIR -l$$GRANTLEE_LIB`<br>
`macx: INCLUDEPATH += $$[QT_INSTALL_HEADERS]`
* Add next files from *taste3/TASTEeditor/templating/* to your project and set them in *.pro file:<br>
`HEADERS += \`<br>
` ...`<br>
` templating/abstractexportableobject.h \`<br>
` templating/exportableproperty.h \`<br>
` templating/stringtemplate.h \`<br>
` templating/templateeditor.h \`<br>
` templating/templatehighlighter.h \`<br>
` templating/xmlhighlighter.h \`<br>
` templating/templatesyntaxhelpdialog.h`<br>
`SOURCES += \`<br>
` ...`<br>
` templating/stringtemplate.cpp \`<br>
` templating/templateeditor.cpp \`<br>
` templating/templatehighlighter.cpp \`<br>
` templating/xmlhighlighter.cpp \`<br>
` templating/templatesyntaxhelpdialog.cpp`
* Write a successor of `AbstractExportableObject` as a lightweight wrapper to export your QObject-derived objects. Use implementation of `ExportableAADLObject` and its successors as a reference.
* Create exportable an object, cast it to `QVariant` and append it in `QHash<QString, QVariantList>` by using a `groupName()` as a key. Then invoke `StringTemplate::parseFile()` for parsing a template. Use implementation of `XmlDocExporter` from *taste3/TASTEeditor/app/* as a reference.
......@@ -3,210 +3,13 @@ set(APP_NAME IVeditor)
add_executable(${APP_NAME})
target_sources(${APP_NAME} PRIVATE
app/commandlineparser.cpp
app/commandlineparser.h
app/commandsstack.cpp
app/commandsstack.h
app/context/action/action.cpp
app/context/action/action.h
app/context/action/actionsmanager.cpp
app/context/action/actionsmanager.h
app/context/action/attrhandler.cpp
app/context/action/attrhandler.h
app/context/action/condition.cpp
app/context/action/condition.h
app/context/action/editor/actionsmodel.cpp
app/context/action/editor/actionsmodel.h
app/context/action/editor/attributesmodel.cpp
app/context/action/editor/attributesmodel.h
app/context/action/editor/conditiondialog.cpp
app/context/action/editor/conditiondialog.h
app/context/action/editor/conditiondialog.ui
app/context/action/editor/conditionsmodel.cpp
app/context/action/editor/conditionsmodel.h
app/context/action/editor/dynactioneditor.cpp
app/context/action/editor/dynactioneditor.h
app/context/action/editor/dynactioneditor.ui
app/context/action/extprocmonitor.cpp
app/context/action/extprocmonitor.h
app/aadltabdocument.cpp
app/aadltabdocument.h
app/mainwindow.cpp
app/mainwindow.h
app/mainwindow.ui
app/tabdocumentfactory.cpp
app/tabdocumentfactory.h
app/xmldocexporter.cpp
app/xmldocexporter.h
app/zoomcontroller.cpp
app/zoomcontroller.h
baseitems/common/abstractinteractiveobject.h
baseitems/common/drawrectinfo.cpp
baseitems/common/drawrectinfo.h
baseitems/common/highlightrectitem.cpp
baseitems/common/highlightrectitem.h
baseitems/common/utils.cpp
baseitems/common/utils.h
baseitems/graphicsview.cpp
baseitems/graphicsview.h
baseitems/grippoint.cpp
baseitems/grippoint.h
baseitems/grippointshandler.cpp
baseitems/grippointshandler.h
baseitems/interactiveobject.cpp
baseitems/interactiveobject.h
baseitems/textgraphicsitem.cpp
baseitems/textgraphicsitem.h
dummy/dummytabdocument.cpp
dummy/dummytabdocument.h
logging/logcategory.cpp
logging/logcategory.h
logging/loghandler.cpp
logging/loghandler.h
main.cpp
settings/appoptions.cpp
settings/appoptions.h
tab_concurrency/concurrencytabdocument.cpp
tab_concurrency/concurrencytabdocument.h
tab_data/datatabdocument.cpp
tab_data/datatabdocument.h
tab_deployment/deploymenttabdocument.cpp
tab_deployment/deploymenttabdocument.h
tab_interface/aadlcommentgraphicsitem.cpp
tab_interface/aadlcommentgraphicsitem.h
tab_interface/aadlconnectiongraphicsitem.cpp
tab_interface/aadlconnectiongraphicsitem.h
tab_interface/aadlfunctiongraphicsitem.cpp
tab_interface/aadlfunctiongraphicsitem.h
tab_interface/aadlfunctionnamegraphicsitem.cpp
tab_interface/aadlfunctionnamegraphicsitem.h
tab_interface/aadlfunctiontypegraphicsitem.cpp
tab_interface/aadlfunctiontypegraphicsitem.h
tab_interface/aadlinterfacegraphicsitem.cpp
tab_interface/aadlinterfacegraphicsitem.h
tab_interface/aadlrectgraphicsitem.cpp
tab_interface/aadlrectgraphicsitem.h
tab_interface/colors/colorhandlereditor.cpp
tab_interface/colors/colorhandlereditor.h
tab_interface/colors/colorhandlereditor.ui
tab_interface/colors/colormanager.cpp
tab_interface/colors/colormanager.h
tab_interface/colors/colormanagerdialog.cpp
tab_interface/colors/colormanagerdialog.h
tab_interface/colors/colormanagerdialog.ui
tab_interface/colors/colorselectorbutton.cpp
tab_interface/colors/colorselectorbutton.h
tab_interface/commands/cmdcommentitemcreate.cpp
tab_interface/commands/cmdcommentitemcreate.h
tab_interface/commands/cmdconnectionitemcreate.cpp
tab_interface/commands/cmdconnectionitemcreate.h
tab_interface/commands/cmdcontextparameterchange.cpp
tab_interface/commands/cmdcontextparameterchange.h
tab_interface/commands/cmdcontextparametercreate.cpp
tab_interface/commands/cmdcontextparametercreate.h
tab_interface/commands/cmdcontextparameterremove.cpp
tab_interface/commands/cmdcontextparameterremove.h
tab_interface/commands/cmdentityattributechange.cpp
tab_interface/commands/cmdentityattributechange.h
tab_interface/commands/cmdentityautolayout.cpp
tab_interface/commands/cmdentityautolayout.h
tab_interface/commands/cmdentitygeometrychange.cpp
tab_interface/commands/cmdentitygeometrychange.h
tab_interface/commands/cmdentitypropertychange.cpp
tab_interface/commands/cmdentitypropertychange.h
tab_interface/commands/cmdentitypropertycreate.cpp
tab_interface/commands/cmdentitypropertycreate.h
tab_interface/commands/cmdentitypropertyremove.cpp
tab_interface/commands/cmdentitypropertyremove.h
tab_interface/commands/cmdentitypropertyrename.cpp
tab_interface/commands/cmdentitypropertyrename.h
tab_interface/commands/cmdentityremove.cpp
tab_interface/commands/cmdentityremove.h
tab_interface/commands/cmdfunctionitemcreate.cpp
tab_interface/commands/cmdfunctionitemcreate.h
tab_interface/commands/cmdfunctiontypeitemcreate.cpp
tab_interface/commands/cmdfunctiontypeitemcreate.h
tab_interface/commands/cmdifaceattrchange.cpp
tab_interface/commands/cmdifaceattrchange.h
tab_interface/commands/cmdifacedatachangebase.cpp
tab_interface/commands/cmdifacedatachangebase.h
tab_interface/commands/cmdifaceparambase.cpp
tab_interface/commands/cmdifaceparambase.h
tab_interface/commands/cmdifaceparamchange.cpp
tab_interface/commands/cmdifaceparamchange.h
tab_interface/commands/cmdifaceparamcreate.cpp
tab_interface/commands/cmdifaceparamcreate.h
tab_interface/commands/cmdifaceparamremove.cpp
tab_interface/commands/cmdifaceparamremove.h
tab_interface/commands/cmdinterfaceitemcreate.cpp
tab_interface/commands/cmdinterfaceitemcreate.h
tab_interface/commands/cmdrequiredifacepropertychange.cpp
tab_interface/commands/cmdrequiredifacepropertychange.h
tab_interface/commands/cmdrootentitychange.cpp
tab_interface/commands/cmdrootentitychange.h
tab_interface/commands/commandids.h
tab_interface/commands/commandsfactory.cpp
tab_interface/commands/commandsfactory.h
tab_interface/commenttextdialog.cpp
tab_interface/commenttextdialog.h
tab_interface/commenttextdialog.ui
tab_interface/creatortool.cpp
tab_interface/creatortool.h
tab_interface/graphicsitemhelpers.cpp
tab_interface/graphicsitemhelpers.h
tab_interface/interfacetabdocument.cpp
tab_interface/interfacetabdocument.h
tab_interface/interfacetabgraphicsscene.cpp
tab_interface/interfacetabgraphicsscene.h
tab_interface/properties/adddynamicpropertydialog.h
tab_interface/properties/adddynamicpropertydialog.ui
tab_interface/properties/adddynamicropertydialog.cpp
tab_interface/properties/contextparametersmodel.cpp
tab_interface/properties/contextparametersmodel.h
tab_interface/properties/delegates/comboboxdelegate.cpp
tab_interface/properties/delegates/comboboxdelegate.h
tab_interface/properties/delegates/functionattrdelegate.cpp
tab_interface/properties/delegates/functionattrdelegate.h
tab_interface/properties/delegates/interfaceattrdelegate.cpp
tab_interface/properties/delegates/interfaceattrdelegate.h
tab_interface/properties/delegates/propertytypedelegate.cpp
tab_interface/properties/delegates/propertytypedelegate.h
tab_interface/properties/dynamicproperty.cpp
tab_interface/properties/dynamicproperty.h
tab_interface/properties/dynamicpropertyconfig.cpp
tab_interface/properties/dynamicpropertyconfig.h
tab_interface/properties/dynamicpropertymanager.cpp
tab_interface/properties/dynamicpropertymanager.h
tab_interface/properties/dynamicpropertymanager.ui
tab_interface/properties/ifaceparametersmodel.cpp
tab_interface/properties/ifaceparametersmodel.h
tab_interface/properties/propertiesdialog.cpp
tab_interface/properties/propertiesdialog.h
tab_interface/properties/propertiesdialog.ui
tab_interface/properties/propertieslistmodel.cpp
tab_interface/properties/propertieslistmodel.h
tab_interface/properties/propertiesmodelbase.cpp
tab_interface/properties/propertiesmodelbase.h
tab_interface/properties/propertiesviewbase.cpp
tab_interface/properties/propertiesviewbase.h
tab_interface/properties/propertiesviewbase.ui
tab_msc/msctabdocument.cpp
tab_msc/msctabdocument.h
templating/exportableaadlconnection.cpp
templating/exportableaadlconnection.h
templating/exportableaadlfunction.cpp
templating/exportableaadlfunction.h
templating/exportableaadliface.cpp
templating/exportableaadliface.h
templating/exportableaadlobject.cpp
templating/exportableaadlobject.h
resources.qrc
tab_interface/tab_interface_resources.qrc
)
target_link_libraries(${APP_NAME} PUBLIC
aadl
shared
libiveditor
templating
utils
Qt5::Concurrent
......@@ -215,25 +18,6 @@ target_link_libraries(${APP_NAME} PUBLIC
Qt5::Widgets
)
target_include_directories(${APP_NAME} PRIVATE
.
app
baseitems
document
dummy
logging
reports
settings
tab_aadl
tab_concurrency
tab_data
tab_deployment
tab_interface
tab_msc
templating
util
)
target_compile_definitions(${APP_NAME} PUBLIC QT_MESSAGELOGCONTEXT)
if (WIN32)
......
#-------------------------------------------------
#
# Project created by QtCreator 2019-06-18T13:46:51
#
#-------------------------------------------------
QT += core gui network concurrent svg
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = TASTEeditor
TEMPLATE = app
# The following define makes your compiler emit warnings if you use
# any feature of Qt which has been marked as deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS
# You can also make your code fail to compile if you use deprecated APIs.
# In order to do so, uncomment the following line.
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
include(version.pri)
CONFIG += c++11
DEFINES += QT_MESSAGELOGCONTEXT
macx {
CONFIG -= app_bundle
}
GRANTLEE_LIB_DIR = $$[QT_INSTALL_LIBS]
DEFINES += GRANTLEE_LIB_DIR='\\"$$GRANTLEE_LIB_DIR\\"'
GRANTLEE_LIB=Grantlee_Templates
win32: CONFIG(debug, debug|release):GRANTLEE_LIB = $$join(GRANTLEE_LIB,,,d)
LIBS += -L$$GRANTLEE_LIB_DIR -l$$GRANTLEE_LIB
macx: INCLUDEPATH += $$[QT_INSTALL_HEADERS]
SOURCES += \
app/commandlineparser.cpp \
app/commandsstack.cpp \
app/common.cpp \
app/context/action/action.cpp \
app/context/action/actionsmanager.cpp \
app/context/action/attrhandler.cpp \
app/context/action/condition.cpp \
app/context/action/editor/actionsmodel.cpp \
app/context/action/editor/attributesmodel.cpp \
app/context/action/editor/conditiondialog.cpp \
app/context/action/editor/conditionsmodel.cpp \
app/context/action/editor/dynactioneditor.cpp \
app/context/action/extprocmonitor.cpp \
app/datatypes/basicdatatype.cpp \
app/datatypes/datatypesstorage.cpp \
app/mainwindow.cpp \
app/xmldocexporter.cpp \
app/zoomcontroller.cpp \
baseitems/common/drawrectinfo.cpp \
baseitems/common/highlightrectitem.cpp \
baseitems/common/utils.cpp \
baseitems/graphicsview.cpp \
baseitems/grippoint.cpp \
baseitems/grippointshandler.cpp \
baseitems/interactiveobject.cpp \
baseitems/textgraphicsitem.cpp \
document/abstracttabdocument.cpp \
document/documentsmanager.cpp \
document/tabdocumentfactory.cpp \
dummy/dummytabdocument.cpp \
logging/logcategory.cpp \
logging/loghandler.cpp \
main.cpp \
tab_aadl/aadlnamevalidator.cpp \
tab_interface/commands/cmdentityautolayout.cpp \
tab_interface/commands/cmdifacedatachangebase.cpp \
tab_interface/commenttextdialog.cpp \
templating/exportableaadlconnection.cpp \
templating/exportableaadlfunction.cpp \
templating/exportableaadliface.cpp \
templating/exportableaadlobject.cpp \
templating/stringtemplate.cpp \
templating/templateeditor.cpp \
templating/templatehighlighter.cpp \
templating/xmlhighlighter.cpp \
templating/templatesyntaxhelpdialog.cpp \
reports/bugreportdialog.cpp \
reports/bugreporthandler.cpp \
settings/appoptions.cpp \
settings/settingsmanager.cpp \
tab_aadl/aadlcommonprops.cpp \
tab_aadl/aadlobject.cpp \
tab_aadl/aadlobjectcomment.cpp \
tab_aadl/aadlobjectconnection.cpp \
tab_aadl/aadlobjectfunction.cpp \
tab_aadl/aadlobjectfunctiontype.cpp \
tab_aadl/aadlobjectiface.cpp \
tab_aadl/aadlobjectsmodel.cpp \
tab_aadl/aadlparameter.cpp \
tab_aadl/aadltabdocument.cpp \
tab_aadl/aadlxmlreader.cpp \
tab_concurrency/concurrencytabdocument.cpp \
tab_data/datatabdocument.cpp \
tab_deployment/deploymenttabdocument.cpp \
tab_interface/aadlcommentgraphicsitem.cpp \
tab_interface/aadlconnectiongraphicsitem.cpp \
tab_interface/aadlfunctiongraphicsitem.cpp \
tab_interface/aadlfunctionnamegraphicsitem.cpp \
tab_interface/aadlfunctiontypegraphicsitem.cpp \
tab_interface/aadlinterfacegraphicsitem.cpp \
tab_interface/aadlrectgraphicsitem.cpp \
tab_interface/colors/colorhandlereditor.cpp \
tab_interface/colors/colormanager.cpp \
tab_interface/colors/colormanagerdialog.cpp \