Commit 7a9691fb authored by Don Gagne's avatar Don Gagne

Delete unused files

No longer needed with move to summary page qml
parent 32d0ca68
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009 - 2014 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL 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.
QGROUNDCONTROL 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 QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
/// @file
/// @author Don Gagne <don@thegagnes.com>
#include "SummaryPage.h"
#include "ui_SummaryPage.h"
#include <QGroupBox>
#include <QTableWidget>
#include <QSpacerItem>
#include <QDebug>
SummaryPage::SummaryPage(QList<VehicleComponent*>& components, QWidget* parent) :
QWidget(parent),
_components(components),
_ui(new Ui::SummaryPage)
{
_ui->setupUi(this);
// Loop over all components, creating summary widgets
int row = 0;
int col = 0;
foreach(VehicleComponent* component, _components) {
QList<QStringList> summaryItems = component->summaryItems();
if (summaryItems.count()) {
// Rows without columns, bad
Q_ASSERT(summaryItems[0].count());
QGroupBox* box = new QGroupBox(component->name(), this);
QVBoxLayout* layout = new QVBoxLayout(box);
QTableWidget* table = new QTableWidget(summaryItems.count(), summaryItems[0].count(), box);
table->setShowGrid(false);
table->horizontalHeader()->setVisible(false);
table->verticalHeader()->setVisible(false);
QTableWidgetItem* item;
for (int tRow=0; tRow<summaryItems.count(); tRow++) {
for (int tCol=0; tCol<summaryItems[tRow].count(); tCol++) {
item = new QTableWidgetItem(summaryItems[tRow][tCol]);
table->setItem(tRow, tCol, item);
}
}
table->resizeColumnsToContents();
layout->addWidget(table);
_ui->gridLayout->addWidget(box, row, col++, Qt::AlignLeft | Qt::AlignTop);
}
if (col == 2) {
row++;
col = 0;
}
}
// Add spacers to force the grid to collapse to it's smallest size
QSpacerItem* spacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
_ui->gridLayout->addItem(spacer, 0, 2, 1, 1);
spacer = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding);
_ui->gridLayout->addItem(spacer, row, 0, 1, 1);
}
SummaryPage::~SummaryPage()
{
delete _ui;
}
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009 - 2014 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL 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.
QGROUNDCONTROL 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 QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
#ifndef SUMMARYPAGE_H
#define SUMMARYPAGE_H
#include <QWidget>
#include <QList>
#include "VehicleComponent.h"
/// @file
/// @brief This class is used to display the Summary Page portion of the Vehicle Setup UI.
/// @author Don Gagne <don@thegagnes.com>
namespace Ui {
class SummaryPage;
}
class SummaryPage : public QWidget
{
Q_OBJECT
public:
explicit SummaryPage(QList<VehicleComponent*>& components, QWidget* parent = 0);
~SummaryPage();
private:
QList<VehicleComponent*> _components; ///< VehicleComponents for active UAS
Ui::SummaryPage* _ui;
};
#endif
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>SummaryPage</class>
<widget class="QWidget" name="SummaryPage">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>1537</width>
<height>1100</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout"/>
</widget>
<resources/>
<connections/>
</ui>
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009 - 2014 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL 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.
QGROUNDCONTROL 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 QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
#ifndef VEHICLECOMPONENTBUTTON_H
#define VEHICLECOMPONENTBUTTON_H
#include "VehicleSetupButton.h"
#include "VehicleComponent.h"
/// @file
/// @brief This class is used for the push buttons in the Vehicle Setup display.
/// @author Don Gagne <don@thegagnes.com>
class VehicleComponentButton : public VehicleSetupButton
{
Q_OBJECT
public:
/// @param component VehicleComponent associated witht this button
VehicleComponentButton(VehicleComponent* component, QWidget* parent = NULL) :
VehicleSetupButton(parent),
_component(component)
{
Q_ASSERT(component);
}
/// @brief Returns the component associated with the button
VehicleComponent* component(void) { return _component; }
private:
VehicleComponent* _component;
};
#endif
import QtQuick 2.2
import QtQuick.Controls 1.2
import QGroundControlFactControls 1.0
SetupButton {
width: 300
height: 200
title: vehicleComponent.name
}
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009 - 2014 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL 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.
QGROUNDCONTROL 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 QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
#ifndef VEHICLESETUPBUTTON_H
#define VEHICLESETUPBUTTON_H
#include <QPushButton>
/// @file
/// @brief This class is used for the push button in the Vehicle Setup display. We use a seperate class
/// so we can assign a seperate style for them.
/// @author Don Gagne <don@thegagnes.com>
class VehicleSetupButton : public QPushButton
{
Q_OBJECT
public:
VehicleSetupButton(QWidget* parent = NULL) : QPushButton(parent) { }
};
#endif
// Currently unused but leaving here for future conversion to QML
import QtQuick 2.0
import QtQuick.Controls 1.2
Rectangle {
SystemPalette { id: myPalette; colorGroup: SystemPalette.Active }
color: myPalette.dark
anchors.fill: parent
id: buttonParent
signal componentButtonClicked(variant varComponent)
Button {
id: summaryButton
objectName: "summaryButton"
height: 50
width: 150
text: "Summary"
}
Button {
id: firmwareButton
objectName: "firmwareButton"
height: 50
width: 150
anchors.top: summaryButton.bottom
text: "Firmware"
}
ListModel {
id: vehicleComponentModelTest
ListElement {
name: "Radio"
setupComplete: true
icon: "/Users/Don/repos/qgroundcontrol/files/images/px4/menu/remote.png"
}
ListElement {
name: "Gyroscope"
setupCompleted: false
icon: "qrc:/files/images/px4/menu/remote.png"
}
ListElement {
name: "Magnetometer"
icon: "qrc:/files/images/px4/menu/remote.png"
}
}
ListView {
id: componentList
width: 200; height: contentItem.childrenRect.height
snapMode: ListView.NoSnap
anchors.top: firmwareButton.bottom
model: vehicleComponentModel
delegate: Button {
objectName: name + "SetupButton"
height: 50
width: 150
text: name
iconSource: icon
onClicked: {
console.log("Setup button clicked")
buttonParent.componentButtonClicked(modelData)
}
Rectangle {
width: 10
height: 10
color: setupComplete ? "green" : "red"
border.color: "black"
}
}
}
}
// Currently unused but leaving here for future conversion to QML
import QtQuick 2.0
import QtQuick.Controls 1.2
Item {
width: parent.width
height: parent.height
ListModel {
id: vehicleComponentModelTest
ListElement {
name: "Gyroscope"
description: "Long description"
setupComplete: false
}
ListElement {
name: "Magnetometer"
description: "Long description"
setupComplete: false
}
ListElement {
name: "Radio"
description: "Long description"
setupComplete: true
}
}
ListView {
id: componentList
anchors.fill: parent
model: vehicleComponentModel
section.property: "setupComplete"
section.criteria: ViewSection.FullString
section.delegate: Text { text: section == "true" ? "Setup complete" : "Requires setup" }
delegate: Item {
width: 180; height: 40
Column {
Text { text: "Component:" + model.name }
Text { text: model.description }
}
}
}
}
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