2012-08-23 18:37:55 +02:00
|
|
|
/**
|
|
|
|
******************************************************************************
|
|
|
|
*
|
|
|
|
* @file connectiondiagram.cpp
|
|
|
|
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012.
|
|
|
|
* @addtogroup
|
|
|
|
* @{
|
|
|
|
* @addtogroup ConnectionDiagram
|
|
|
|
* @{
|
|
|
|
* @brief
|
|
|
|
*****************************************************************************/
|
|
|
|
/*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful, but
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
|
|
|
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
|
|
* for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
*/
|
|
|
|
|
2012-08-24 00:48:09 +02:00
|
|
|
#include <QDebug>
|
|
|
|
#include <QFile>
|
2012-08-23 18:37:55 +02:00
|
|
|
#include "connectiondiagram.h"
|
|
|
|
#include "ui_connectiondiagram.h"
|
|
|
|
|
2012-08-24 00:48:09 +02:00
|
|
|
ConnectionDiagram::ConnectionDiagram(QWidget *parent, VehicleConfigurationSource* configSource) :
|
|
|
|
QDialog(parent), m_configSource(configSource),
|
2012-08-23 18:37:55 +02:00
|
|
|
ui(new Ui::ConnectionDiagram)
|
|
|
|
{
|
2012-08-24 00:48:09 +02:00
|
|
|
setWindowTitle(tr("Connection Diagram"));
|
2012-08-23 18:37:55 +02:00
|
|
|
ui->setupUi(this);
|
2012-08-24 00:48:09 +02:00
|
|
|
|
|
|
|
QGraphicsScene *scene = new QGraphicsScene(this);
|
|
|
|
ui->connectionDiagram->setScene(scene);
|
|
|
|
ui->connectionDiagram->setViewportUpdateMode(QGraphicsView::FullViewportUpdate);
|
|
|
|
m_renderer = new QSvgRenderer();
|
|
|
|
if (m_renderer->load(QString(":/setupwizard/resources/connection-diagrams.svg")) && m_renderer->isValid())
|
|
|
|
{
|
|
|
|
scene->clear();
|
|
|
|
QGraphicsSvgItem* ccPic = new QGraphicsSvgItem();
|
|
|
|
ccPic->setSharedRenderer(m_renderer);
|
|
|
|
ccPic->setElementId("cc");
|
|
|
|
scene->addItem(ccPic);
|
|
|
|
qDebug() << "Scene complete";
|
|
|
|
|
|
|
|
//ui->connectionDiagram->setSceneRect(ccPic->boundingRect());
|
|
|
|
//ui->connectionDiagram->fitInView(ccPic, Qt::KeepAspectRatio);
|
|
|
|
}
|
2012-08-23 18:37:55 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
ConnectionDiagram::~ConnectionDiagram()
|
|
|
|
{
|
|
|
|
delete ui;
|
|
|
|
}
|