Commit ee95997e authored by Uwe Woessner's avatar Uwe Woessner
Browse files

merged master branch to hlrs


Signed-off-by: Uwe Woessner's avatarhpcwoess <woessner@hlrs.de>
parent c561f3db
Parts of OpenPASS use the Qt Toolkit licensed under LGPL v3:
The Qt Toolkit is Copyright (C) 2016 The Qt Company Ltd.
Contact: http://www.qt.io/licensing/
**
Parts of OpenPASS use the Boost library under BSL v1.0
https://www.boost.org/
**
Parts of OpenPASS use the OSI (open simulation interface) library under MPL v2.0
https://github.com/OpenSimulationInterface
**
This software is based in part on the work of the Independent JPEG Group.
**
Parts of OpenPASS use the FMI Library (https://github.com/modelon-community/fmi-library):
Copyright (C) 2012 Modelon AB
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
Neither the name of the Modelon AB nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL MODELON AB BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
openPASS is an open-source platform for the prospective safety assessment of ADAS and AD technologies. Originally, the term “openPASS” formed a backronym for “Open Platform for the Assessment of Safety Systems”, but openPASS has been expanded beyond the limitations of safety systems towards any kind of ADAS and AD functions. Thus, one of the main agreed target objectives is to become a broadly accepted effectiveness assessment platform for ADAS and AD functions. In line with our target objective, the Eclipse working group behind openPASS aims to develop a trustworthy, reliable, and transparent platform.
\ No newline at end of file
......@@ -507,6 +507,32 @@ function(add_to_global_target_list target_list target_name)
set_property(GLOBAL PROPERTY ${target_list} ${tmp})
endfunction()
function(gui_common_set_target_properties target_name)
if("${GUI_Plugin}" STREQUAL "")
set_target_properties(${target_name} PROPERTIES FOLDER gui)
else()
set_target_properties(${target_name} PROPERTIES FOLDER gui/${GUI_Plugin})
endif()
target_compile_options(${target_name} PRIVATE
$<$<CXX_COMPILER_ID:MSVC>:
-wd4251 -wd4335 -wd4250>)
set_target_properties(${target_name} PROPERTIES DEBUG_POSTFIX "${CMAKE_DEBUG_POSTFIX}")
set_target_properties(${target_name} PROPERTIES PROJECT_LABEL "${PARSED_ARG_NAME}")
endfunction()
function(gui_set_target_properties target_name)
if(OPENPASS_ADJUST_OUTPUT)
openpass_adjust_output_dir(${target_name} bin)
endif()
gui_common_set_target_properties(${target_name})
endfunction()
function(gui_plugin_set_target_properties target_name)
if(OPENPASS_ADJUST_OUTPUT)
openpass_adjust_output_dir(${target_name} gui)
endif()
gui_common_set_target_properties(${target_name})
endfunction()
# Macro to add OPENPASS modules (executables with a module-category)
#MACRO(ADD_OPENPASS_PLUGIN targetname component)
......
# /*********************************************************************
# * Copyright (c) 2019 Volkswagen Group of America.
# * Copyright (c) 2020 ITK Engineering GmbH.
# * Copyright (c) 2020 HLRS, University of Stuttgart.
# *
# * This program and the accompanying materials are made
# * available under the terms of the Eclipse Public License 2.0
......@@ -10,14 +11,17 @@
# **********************************************************************/
project(Gui)
set(FOLDER gui)
cmake_minimum_required(VERSION 3.14)
add_subdirectory(application)
#add_subdirectory(plugins/agentConfiguration)
add_subdirectory(plugins/agentConfiguration)
add_subdirectory(plugins/component)
add_subdirectory(plugins/project)
add_subdirectory(plugins/statistics)
add_subdirectory(plugins/system)
add_subdirectory(plugins/timePlot)
#add_subdirectory(plugins/trafficSimulation)
add_subdirectory(plugins/trafficSimulation)
add_subdirectory(plugins/window)
add_subdirectory(plugins/About)
# /*********************************************************************
# * Copyright (c) 2019 Volkswagen Group of America.
# * Copyright (c) 2020 HLRS, University of Stuttgart.
# *
# * This program and the accompanying materials are made
# * available under the terms of the Eclipse Public License 2.0
......@@ -19,7 +20,7 @@ set(CMAKE_AUTOUIC ON)
set(CMAKE_CXX_FLAGS "${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}")
# add definitions: this needs to be in a certain gloabl file TODO
add_definitions(-DAPPLICATION_NAME="openPASS" -DAPPLICATION_VERSION="0.6" -DSUBDIR_LIB_GUI="/gui")
add_definitions(-DAPPLICATION_NAME="openPASS" -DAPPLICATION_VERSION="0.7" -DSUBDIR_LIB_GUI="/gui")
add_definitions(${Qt5Widgets_DEFINITIONS})
# include QtWidgets package
......@@ -48,6 +49,18 @@ target_link_libraries(openPASS PRIVATE
${PROJECT_NAME}_Models
${PROJECT_NAME}_Interfaces)
# target directories. Needs to be defined in some global file TODO
# target directories. Needs to be defined in some global file TODO ... is already defined in global.cmake
set_target_properties(openPASS PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "C:/OpenPASS/bin")
RUNTIME_OUTPUT_DIRECTORY ${OPENPASS_DESTDIR})
gui_set_target_properties(openPASS)
install(DIRECTORY components/ DESTINATION ${SUBDIR_XML_COMPONENTS} FILES_MATCHING PATTERN "*.xml")
if(OPENPASS_ADJUST_OUTPUT)
add_custom_command(TARGET openPASS POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_SOURCE_DIR}/gui/components $<TARGET_FILE_DIR:openPASS>/../${SUBDIR_XML_COMPONENTS})
endif()
# /*********************************************************************
# * Copyright (c) 2019 Volkswagen Group of America.
# * Copyright (c) 2020 HLRS, University of Stuttgart.
# *
# * This program and the accompanying materials are made
# * available under the terms of the Eclipse Public License 2.0
......@@ -16,3 +17,5 @@ include(openPASS/CMakeLists.txt)
# build interface libraries
add_library(${PROJECT_NAME}_Interfaces STATIC ${HEADERS})
gui_plugin_set_target_properties(${PROJECT_NAME}_Interfaces)
\ No newline at end of file
# /*********************************************************************
# * Copyright (c) 2019 Volkswagen Group of America.
# * Copyright (c) 2020 HLRS, University of Stuttgart.
# *
# * This program and the accompanying materials are made
# * available under the terms of the Eclipse Public License 2.0
......@@ -19,4 +20,5 @@ set(HEADERS
)
add_library(${PROJECT_NAME}_Models STATIC ${SOURCES} ${HEADERS})
gui_plugin_set_target_properties(${PROJECT_NAME}_Models)
/******************************************************************************
* Copyright (c) 2017, 2019 Volkswagen Group of America.
* Copyright (c) 2021 HLRS, University of Stuttgart.
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
......@@ -34,7 +35,7 @@ int main(int argc, char *argv[])
// Schedule application
QTimer::singleShot(0, [&plugins]() {
// Load plugins
plugins.loadDirectory(QDir(QApplication::applicationDirPath() + SUBDIR_LIB_GUI));
plugins.loadDirectory(QDir(QApplication::applicationDirPath() + "/.." + SUBDIR_LIB_GUI));
// Emit signal 'started'
Q_EMIT plugins.started();
......
/******************************************************************************
* Copyright (c) 2020 HLRS, University of Stuttgart.
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
******************************************************************************/
#include "AboutPlugin.h"
#include "openPASS-Window/WindowInterface.h"
#include "Views/AboutView.h"
AboutPlugin::AboutPlugin(QObject *const parent)
: QObject(parent)
, aboutView(nullptr)
{
}
bool AboutPlugin::initialize()
{
WindowInterface *const window = WindowInterface::instance();
if (window)
{
aboutView = new AboutView(window);
return true;
}
return false;
}
bool AboutPlugin::deinitialize()
{
delete aboutView;
return true;
}
/******************************************************************************
* Copyright (c) 2020 HLRS, University of Stuttgart.
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
******************************************************************************/
#ifndef ABOUTPLUGIN_H
#define ABOUTPLUGIN_H
#include "openPASS/PluginInterface.h"
#include <QObject>
class AboutModel;
class AboutPresenter;
class AboutView;
class AboutPlugin : public QObject, public PluginInterface
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "openPASS.About")
Q_INTERFACES(PluginInterface)
public:
explicit AboutPlugin(QObject * const parent = nullptr);
virtual ~AboutPlugin() = default;
public:
virtual bool initialize() override;
virtual bool deinitialize() override;
protected:
AboutView * aboutView;
};
#endif // ABOUTPLUGIN_H
# /*********************************************************************
# * Copyright (c) 2019 Volkswagen Group of America.
# * Copyright (c) 2020 HLRS, University of Stuttgart.
# *
# * This program and the accompanying materials are made
# * available under the terms of the Eclipse Public License 2.0
# * which is available at https://www.eclipse.org/legal/epl-2.0/
# *
# * SPDX-License-Identifier: EPL-2.0
# **********************************************************************/
project(openPASS-About)
cmake_minimum_required(VERSION 3.14)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
# include QtWidgets package
find_package(Qt5Widgets REQUIRED)
# set include directories
include_directories(.)
include_directories(../project/Interfaces)
include_directories(../window/Interfaces)
include_directories(../component/Interfaces)
include_directories(../../application/Interfaces)
include_directories(${Qt5Widgets_INCLUDE_DIRS})
set(GUI_Plugin About)
# include interfaces, models and views
add_subdirectory(Views)
# include headers and sources of this plugin
set(SOURCES AboutPlugin.cpp)
set(HEADERS AboutPlugin.h)
qt5_add_resources(openPASS-About.qrc)
# declare target library
add_library(About SHARED ${SOURCES} ${HEADERS} openPASS-About.qrc)
# link with Qt libraries, models, views and Interfaces
target_link_libraries(About PRIVATE
Qt5::Widgets
${PROJECT_NAME}_Views)
# target directories. Needs to be defined in some global file TODO
set_target_properties(About PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${OPENPASS_DESTDIR}"/gui"
PREFIX "")
gui_plugin_set_target_properties(About)
#/*******************************************************************************
#* Copyright (c) 2020 HLRS, University of Stuttgart
#*
#* This program and the accompanying materials are made
#* available under the terms of the Eclipse Public License 2.0
#* which is available at https://www.eclipse.org/legal/epl-2.0/
#*
#* SPDX-License-Identifier: EPL-2.0
#*******************************************************************************/
set(COMPONENT_NAME About)
add_compile_definitions(About_LIBRARY)
include_directories(.)
add_openpass_target(
NAME ${COMPONENT_NAME} TYPE library LINKAGE shared LINKGUI COMPONENT gui
HEADERS
AboutPlugin.h
Views/AboutView.h
SOURCES
AboutPlugin.cpp
Views/AboutView.cpp
UIS
Views/AboutView.ui
QRCS
openPASS-About.qrc
LIBRARIES
openPASSInterfaces
)
/******************************************************************************
* Copyright (c) 2020 HLRS, University of Stuttgart.
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
******************************************************************************/
#include "Views/AboutView.h"
#include "ui_AboutView.h"
#include <QCoreApplication>
#include <QDir>
#include <QFileDialog>
#include <QFile>
#include <QKeyEvent>
#include <QStandardPaths>
#include <QString>
const WindowInterface::ID AboutView::ViewID = QStringLiteral("openPASS.About");
AboutView::AboutView(WindowInterface *const window,
QWidget *parent)
: QWidget(parent)
, window(window)
, ui(new Ui::AboutView)
{
// Create UI
ui->setupUi(this);
QFile file(":/README-3rd-party.txt");
if (file.open(QIODevice::ReadOnly))
{
QString data(file.readAll());
ui->textEdit->setPlainText(data);
}
QFile fileOP(":/README-OpenPASS.txt");
if (fileOP.open(QIODevice::ReadOnly))
{
QString data(fileOP.readAll());
ui->textEditOpenPASS->setPlainText(data);
}
// Register view
window->add(ViewID, WindowInterface::createButton(tr("About"), 0, 07000), this,
{});
}
AboutView::~AboutView()
{
// Deregister view
window->remove(ViewID);
// Destroy UI
delete ui;
}
/******************************************************************************
* Copyright (c) 2020 HLRS, University of Stuttgart.
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
******************************************************************************/
#ifndef ABOUTVIEW_H
#define ABOUTVIEW_H
#include "openPASS-Window/WindowInterface.h"
#include <QString>
#include <QWidget>
namespace Ui {
class AboutView;
}
class AboutPresenter;
class AboutView : public QWidget
{
Q_OBJECT
public:
explicit AboutView(WindowInterface * const window,
QWidget *parent = 0);
virtual ~AboutView();
private:
static WindowInterface::ID const ViewID;
private:
WindowInterface * const window;
private:
Ui::AboutView *ui;
};
#endif // ABOUTVIEW_H
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>AboutView</class>
<widget class="QWidget" name="AboutView">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>921</width>
<height>716</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<property name="styleSheet">
<string notr="true">QGroupBox{border:2px solid gray;border-radius:5px;margin-top: 4ex;} QGroupBox::title{subcontrol-origin: margin;subcontrol-position:top center;padding:0 3px;}</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<property name="leftMargin">
<number>150</number>
</property>
<property name="topMargin">
<number>100</number>
</property>
<property name="rightMargin">
<number>150</number>
</property>
<property name="bottomMargin">
<number>80</number>
</property>
<item>
<widget class="QGroupBox" name="inputConfigBox">
<property name="minimumSize">
<size>
<width>621</width>
<height>0</height>
</size>
</property>
<property name="font">
<font>
<pointsize>11</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="title">
<string>OpenPASS</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="leftMargin">
<number>30</number>
</property>
<property name="topMargin">
<number>20</number>
</property>
<property name="rightMargin">
<number>30</number>
</property>
<property name="bottomMargin">
<number>15</number>
</property>
<item row="0" column="0">
<widget class="QTextEdit" name="textEditOpenPASS"/>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="outputConfigBox">
<property name="minimumSize">
<size>
<width>621</width>
<height>0</height>
</size>
</property>
<property name="font">
<font>
<pointsize>11</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="title">
<string>Licenses</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<property name="leftMargin">
<number>30</number>
</property>
<property name="topMargin">
<number>20</number>
</property>
<property name="rightMargin">
<number>30</number>
</property>
<property name="bottomMargin">
<number>15</number>
</property>
<item row="5" column="0" colspan="2">
<widget class="QLabel" name="logLevelLabel">
<property name="font">
<font>
<pointsize>10</pointsize>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>OpenPASS uses the following external open source libraries:</string>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QTextEdit" name="textEdit"/>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
# /*********************************************************************
# * Copyright (c) 2019 Volkswagen Group of America.
# * Copyright (c) 2020 HLRS, University of Stuttgart.
# *
# * This program and the accompanying materials are made
# * available under the terms of the Eclipse Public License 2.0
# * which is available at https://www.eclipse.org/legal/epl-2.0/
# *
# * SPDX-License-Identifier: EPL-2.0
# **********************************************************************/
set(SOURCES
AboutView.cpp
)
set(HEADERS
AboutView.h
)
set(UI
AboutView.ui