Commit ee7c380a authored by Jason Gainey's avatar Jason Gainey
Browse files

* Bug #981 addressed:

- used subfolder "gui" defined in Global.pri for GUI plugins
- added subfolder "components" for Component XML files to Global.pri

* Bug #1075 fixed:
- OSI Use Case can be simulated using the Simulation Plugin
- Start button is enabled when all forms of simulation and project plugins are filled

* further Bugfixes:
- action menu of initially shown plugin now visible
- avoided squeezed openPASS logo
parent 7cfa31c8
......@@ -31,6 +31,10 @@ DEFINES += SUBDIR_LIB_SIM=\\\"/sim\\\"
SUBDIR_LIB_GUIS = "/gui"
DEFINES += SUBDIR_LIB_GUI=\\\"/gui\\\"
## component libraries destination sub-directory ##
SUBDIR_LIB_COMPONENTS = "/components"
DEFINES += SUBDIR_LIB_COMPONENT=\\\"/components\\\"
## Qt plugins sub-directory ##
DEFINES += SUBDIR_LIB_PLUGIN=\\\"/plugin\\\"
......
TEMPLATE = subdirs
SUBDIRS = \
openPASS/OpenPass_OSI.pro
openPASS/OpenPass_OSI.pro \
openPASS_GUI/OpenPass_GUI_OSI.pro
......@@ -27,9 +27,9 @@ DIR_PRO = $${PWD}
win32 {
DIR_PRO ~= s,/,\\,g
DIR_BIN ~= s,/,\\,g
copydata.commands = xcopy $$DIR_PRO\openPASS_Resource\OpenPass_PCM_UseCase $$DIR_BIN /S /D
copydata.commands = xcopy $$DIR_PRO\openPASS_Resource\OpenPass_PCM_UseCase $$DIR_BIN\components\ /S /D
} else {
copydata.commands = cp -ru $$DIR_PRO/openPASS_Resource/OpenPass_PCM_UseCase $$DIR_BIN
copydata.commands = cp -ru $$DIR_PRO/openPASS_Resource/OpenPass_PCM_UseCase $$DIR_BIN/components/
}
first.depends = $(first) copydata
export(first.depends)
......
......@@ -25,8 +25,8 @@ QMAKE_TARGET_DESCRIPTION = openPASS Component
QMAKE_TARGET_COMPANY = Volkswagen Group of America
QMAKE_TARGET_COPYRIGHT = Volkswagen Group of America
Release:DESTDIR = $$DIR_RELEASE
Debug:DESTDIR = $$DIR_DEBUG
Release:DESTDIR = $${DIR_RELEASE}$${SUBDIR_LIB_GUIS}
Debug:DESTDIR = $${DIR_DEBUG}$${SUBDIR_LIB_GUIS}
win32: TARGET_EXT = .dll
include(Interfaces/Interfaces.pri)
......
......@@ -12,6 +12,8 @@
#include "ui_ViewPcm.h"
#include "GUI_Definitions.h"
#include <math.h>
const WindowInterface::ID ViewPcm::ViewID = QStringLiteral("openPASS.PCM");
ViewPcm::ViewPcm(WindowInterface *const window,
......
......@@ -20,8 +20,8 @@ QMAKE_TARGET_DESCRIPTION = openPASS PCM
QMAKE_TARGET_COMPANY = ITK Engineering GmbH
QMAKE_TARGET_COPYRIGHT = ITK Engineering GmbH
Release:DESTDIR = $$DIR_RELEASE
Debug:DESTDIR = $$DIR_DEBUG
Release:DESTDIR = $${DIR_RELEASE}$${SUBDIR_LIB_GUIS}
Debug:DESTDIR = $${DIR_DEBUG}$${SUBDIR_LIB_GUIS}
win32: TARGET_EXT = .dll
......
......@@ -20,8 +20,8 @@ QMAKE_TARGET_DESCRIPTION = openPASS PCM
QMAKE_TARGET_COMPANY = ITK Engineering GmbH
QMAKE_TARGET_COPYRIGHT = ITK Engineering GmbH
Release:DESTDIR = $$DIR_RELEASE
Debug:DESTDIR = $$DIR_DEBUG
Release:DESTDIR = $${DIR_RELEASE}$${SUBDIR_LIB_GUIS}
Debug:DESTDIR = $${DIR_DEBUG}$${SUBDIR_LIB_GUIS}
win32: TARGET_EXT = .dll
......
......@@ -38,6 +38,7 @@ public:
using AgentConfig = QString;
using RunConfig = QString;
using SceneryConfig = QString;
using ScenarioFile = QString;
using LogMaster = QString;
using LogSlave = QString;
using LogLevel = unsigned int;
......@@ -82,6 +83,10 @@ public:
virtual bool setRunConfigFile(ProjectInterface::RunConfig const &runConfig) = 0;
virtual ProjectInterface::RunConfig getRunConfigFile() const = 0;
public:
virtual bool setScenarioFile(ProjectInterface::ScenarioFile const &scenarioFile) = 0;
virtual ProjectInterface::ScenarioFile getScenarioFile() const = 0;
public:
virtual bool setSceneryConfigFile(ProjectInterface::SceneryConfig const &sceneryConfig) = 0;
virtual ProjectInterface::SceneryConfig getSceneryConfigFile() const = 0;
......
......@@ -28,6 +28,7 @@ ProjectInterface::Result const ProjectModel::DefaultResult = QStringLiteral("");
ProjectInterface::AgentConfig const ProjectModel::DefaultAgent = QStringLiteral("");
ProjectInterface::RunConfig const ProjectModel::DefaultRunConfig = QStringLiteral("");
ProjectInterface::SceneryConfig const ProjectModel::DefaultScenery = QStringLiteral("");
ProjectInterface::ScenarioFile const ProjectModel::DefaultScenario = QStringLiteral("");
ProjectInterface::LogMaster const ProjectModel::DefaultLogMaster = QStringLiteral("");
ProjectInterface::LogSlave const ProjectModel::DefaultLogSlave = QStringLiteral("");
......@@ -39,6 +40,7 @@ ProjectModel::ProjectModel(QObject *parent)
, _agent(DefaultAgent)
, _runConfig(DefaultRunConfig)
, _scenery(DefaultScenery)
, _scenario(DefaultScenario)
, _logMaster(DefaultLogMaster)
, _logSlave(DefaultLogSlave)
, _logLevel(0)
......@@ -83,6 +85,7 @@ bool ProjectModel::clear()
setAgentConfigFile(DefaultAgent);
setRunConfigFile(DefaultRunConfig);
setSceneryConfigFile(DefaultScenery);
setScenarioFile(DefaultScenario);
setLogMaster(DefaultLogMaster);
setLogSlave(DefaultLogSlave);
setLogLevel(0);
......@@ -210,6 +213,20 @@ ProjectInterface::SceneryConfig ProjectModel::getSceneryConfigFile() const
return _scenery;
}
bool ProjectModel::setScenarioFile(ProjectInterface::ScenarioFile const &scenarioFile)
{
// Update the path to the directory containing the Open Scenario File
_scenario = scenarioFile;
Q_EMIT update();
return true;
}
ProjectInterface::ScenarioFile ProjectModel::getScenarioFile() const
{
// Get the path of the directory containing the Open Scenario File
return _scenario;
}
bool ProjectModel::setLogMaster(ProjectInterface::LogMaster const &logMaster)
{
// Update the path to the directory containing the Log File of the Master
......@@ -268,7 +285,8 @@ bool ProjectModel::getProjectStatus() const
{
if ((!_logSlave.isEmpty())&&(!_logMaster.isEmpty())
&&(!_result.isEmpty())&&(!_agent.isEmpty())
&&(!_runConfig.isEmpty())&&(!_scenery.isEmpty()))
&&(!_runConfig.isEmpty())&&(!_scenery.isEmpty())
&&(!_scenario.isEmpty()))
return true;
return false;
}
......@@ -46,6 +46,10 @@ public:
virtual bool setAgentConfigFile(ProjectInterface::AgentConfig const &agentConfig) override;
virtual ProjectInterface::AgentConfig getAgentConfigFile() const override;
public:
virtual bool setScenarioFile(ProjectInterface::ScenarioFile const &scenarioFile) override;
virtual ProjectInterface::ScenarioFile getScenarioFile() const override;
public:
virtual bool setRunConfigFile(ProjectInterface::RunConfig const &runConfig) override;
virtual ProjectInterface::RunConfig getRunConfigFile() const override;
......@@ -80,6 +84,7 @@ protected:
static ProjectInterface::AgentConfig const DefaultAgent;
static ProjectInterface::RunConfig const DefaultRunConfig;
static ProjectInterface::SceneryConfig const DefaultScenery;
static ProjectInterface::ScenarioFile const DefaultScenario;
static ProjectInterface::LogMaster const DefaultLogMaster;
static ProjectInterface::LogSlave const DefaultLogSlave;
......@@ -90,6 +95,7 @@ protected:
ProjectInterface::AgentConfig _agent;
ProjectInterface::RunConfig _runConfig;
ProjectInterface::SceneryConfig _scenery;
ProjectInterface::ScenarioFile _scenario;
ProjectInterface::LogMaster _logMaster;
ProjectInterface::LogSlave _logSlave;
ProjectInterface::LogLevel _logLevel;
......
......@@ -16,6 +16,7 @@ QString const ProjectXMLBaseModel::KeyResultPath = QStringLiteral("ResultPath");
QString const ProjectXMLBaseModel::KeyAgentConfigFile = QStringLiteral("AgentConfigFile");
QString const ProjectXMLBaseModel::KeyRunConfigFile = QStringLiteral("RunConfigFile");
QString const ProjectXMLBaseModel::KeySceneryConfigFile = QStringLiteral("SceneryConfigFile");
QString const ProjectXMLBaseModel::KeyScenarioFile = QStringLiteral("ScenarioConfigFile");
QString const ProjectXMLBaseModel::KeyLogFileMaster = QStringLiteral("LogFileMaster");
QString const ProjectXMLBaseModel::KeyLogFileSlave = QStringLiteral("LogFileSlave");
QString const ProjectXMLBaseModel::KeyLogLevel = QStringLiteral("LogLevel");
......@@ -27,6 +28,7 @@ QList<QString> const ProjectXMLBaseModel::KeyListFrameworkConfig = {
ProjectXMLBaseModel::KeyAgentConfigFile,
ProjectXMLBaseModel::KeyRunConfigFile,
ProjectXMLBaseModel::KeySceneryConfigFile,
ProjectXMLBaseModel::KeyScenarioFile,
ProjectXMLBaseModel::KeyLogFileMaster,
ProjectXMLBaseModel::KeyLogFileSlave,
ProjectXMLBaseModel::KeyLogLevel,
......
......@@ -27,6 +27,7 @@ protected:
static QString const KeyAgentConfigFile;
static QString const KeyRunConfigFile;
static QString const KeySceneryConfigFile;
static QString const KeyScenarioFile;
static QString const KeyLogFileMaster;
static QString const KeyLogFileSlave;
static QString const KeyLogLevel;
......
......@@ -62,6 +62,8 @@ bool ProjectXMLLoadModel::loadProject(QXmlStreamReader & xml,
project->setRunConfigFile(xml.readElementText());
else if (xml.name() == KeySceneryConfigFile)
project->setSceneryConfigFile(xml.readElementText());
else if (xml.name() == KeyScenarioFile)
project->setScenarioFile(xml.readElementText());
else if (xml.name() == KeyLogFileMaster)
project->setLogMaster(xml.readElementText());
else if (xml.name() == KeyLogFileSlave)
......
......@@ -50,6 +50,7 @@ void ProjectXMLSaveModel::saveProject(QXmlStreamWriter &xml, const ProjectModel
xml.writeTextElement(KeyAgentConfigFile, project->getAgentConfigFile());
xml.writeTextElement(KeyRunConfigFile, project->getRunConfigFile());
xml.writeTextElement(KeySceneryConfigFile, project->getSceneryConfigFile());
xml.writeTextElement(KeyScenarioFile, project->getScenarioFile());
xml.writeTextElement(KeyLogFileMaster, project->getLogMaster());
xml.writeTextElement(KeyLogFileSlave, project->getLogSlave());
xml.writeTextElement(KeyLogLevel, QString::number(project->getLogLevel()));
......
......@@ -31,7 +31,7 @@ bool ProjectPlugin::initialize()
{
projectModel = new ProjectModel();
projectPresenter = new ProjectPresenter(projectModel);
//projectView = new ProjectView(window, projectPresenter);
projectView = new ProjectView(window, projectPresenter);
return true;
}
return false;
......
......@@ -17,6 +17,7 @@
#include <QCoreApplication>
#include <QDir>
#include <QFileDialog>
#include <QFile>
#include <QKeyEvent>
#include <QStandardPaths>
#include <QString>
......@@ -123,9 +124,9 @@ void ProjectView::on_logLevelSpinBox_valueChanged(int level)
void ProjectView::on_logMasterBrowseButton_clicked()
{
QDir const root = QDir(QCoreApplication::applicationDirPath());
QString const filepath = QFileDialog::getOpenFileName(
QString const filepath = QFileDialog::getSaveFileName(
this, tr("openPASS / Directory to save Log files"), root.canonicalPath(),
QStringLiteral("Log Master File (*.xml);;All files (*)"));
QStringLiteral("Log Master File (*.log);;All files (*)"));
if (!filepath.isNull())
{
projectPresenter->setLogMaster(filepath);
......@@ -136,9 +137,9 @@ void ProjectView::on_logMasterBrowseButton_clicked()
void ProjectView::on_logSlaveBrowseButton_clicked()
{
QDir const root = QDir(QCoreApplication::applicationDirPath());
QString const filepath = QFileDialog::getOpenFileName(
QString const filepath = QFileDialog::getSaveFileName(
this, tr("openPASS / Directory to save Log files"), root.canonicalPath(),
QStringLiteral("Log Slave File (*.xml);;All files (*)"));
QStringLiteral("Log Slave File (*.log);;All files (*)"));
if (!filepath.isNull())
{
projectPresenter->setLogSlave(filepath);
......
......@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>1200</width>
<height>600</height>
<height>631</height>
</rect>
</property>
<property name="windowTitle">
......@@ -125,7 +125,7 @@
</font>
</property>
<property name="text">
<string>Component Library:</string>
<string>Libraries:</string>
</property>
</widget>
</item>
......
......@@ -25,8 +25,8 @@ QMAKE_TARGET_DESCRIPTION = openPASS Project
QMAKE_TARGET_COMPANY = Volkswagen Group of America
QMAKE_TARGET_COPYRIGHT = Volkswagen Group of America
Release:DESTDIR = $$DIR_RELEASE
Debug:DESTDIR = $$DIR_DEBUG
Release:DESTDIR = $${DIR_RELEASE}$${SUBDIR_LIB_GUIS}
Debug:DESTDIR = $${DIR_DEBUG}$${SUBDIR_LIB_GUIS}
win32: TARGET_EXT = .dll
......
......@@ -12,7 +12,8 @@
#include <QCoreApplication>
#include <QDir>
#include <qprocess.h>
#include <QProcess>
//#include <qprocess.h>
SimulationModel::SimulationModel(ProjectInterface * const project, QObject *parent)
: QObject(parent)
......@@ -31,7 +32,8 @@ SimulationModel::SimulationModel(ProjectInterface * const project, QObject *pare
this, &SimulationModel::update);
// update process state
connect(_process, SIGNAL(finished(int exitCode)), this, SLOT(setSimulationStatus()));
connect(_process, static_cast<void (QProcess::*)(int)>(&QProcess::finished),
this, &SimulationModel::setSimulationStatus);
}
bool SimulationModel::load(QString const &filepath)
......@@ -44,11 +46,26 @@ bool SimulationModel::save(QString const &filepath) const
return _project->save(filepath);
}
bool SimulationModel::setSceneryConfigFile(const ProjectInterface::SceneryConfig &sceneryConfig)
{
return _project->setSceneryConfigFile(sceneryConfig);
}
ProjectInterface::SceneryConfig SimulationModel::getSceneryConfigFile() const
{
return _project->getSceneryConfigFile();
}
bool SimulationModel::setScenarioFile(const ProjectInterface::ScenarioFile &scenarioFile)
{
return _project->setScenarioFile(scenarioFile);
}
ProjectInterface::ScenarioFile SimulationModel::getScenarioFile() const
{
return _project->getScenarioFile();
}
bool SimulationModel::setAgentConfigFile(ProjectInterface::AgentConfig const &agentConfig)
{
return _project->setAgentConfigFile(agentConfig);
......@@ -85,10 +102,10 @@ bool SimulationModel::getSimulationStatus() const
return simulationStatus;
}
bool SimulationModel::startSimulation()
bool SimulationModel::startSimulation(QString filepath)
{
QDir const root = QDir(QCoreApplication::applicationDirPath());
QString master = (root.canonicalPath()).append("/OpenPassMaster.exe");
QString master = (root.canonicalPath()).append("/OpenPassMaster.exe --frameworkConfigFile %1").arg(filepath);
if (!master.isNull()){
_process->start(master);
simulationStatus = true;
......
......@@ -32,8 +32,13 @@ public:
virtual bool save(QString const &filepath) const;
public:
virtual bool setSceneryConfigFile(ProjectInterface::SceneryConfig const &sceneryConfig);
virtual ProjectInterface::SceneryConfig getSceneryConfigFile() const;
public:
virtual bool setScenarioFile(ProjectInterface::ScenarioFile const &scenarioFile);
virtual ProjectInterface::ScenarioFile getScenarioFile() const;
public:
virtual bool setAgentConfigFile(ProjectInterface::AgentConfig const &agentConfig);
virtual ProjectInterface::AgentConfig getAgentConfigFile() const;
......@@ -47,7 +52,7 @@ public:
virtual bool getSimulationStatus() const;
public:
virtual bool startSimulation();
virtual bool startSimulation(QString filepath);
virtual bool stopSimulation();
protected:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment