Commit 1d843f21 authored by Don Gagne's avatar Don Gagne

Remove unused code

parent fb43c442
......@@ -200,7 +200,6 @@ FORMS += \
src/ui/uas/UASQuickView.ui \
src/ui/uas/UASQuickViewItemSelect.ui \
src/ui/UASInfo.ui \
src/ui/UASRawStatusView.ui \
}
HEADERS += \
......@@ -317,7 +316,6 @@ HEADERS += \
src/ui/uas/UASQuickViewItem.h \
src/ui/uas/UASQuickViewItemSelect.h \
src/ui/uas/UASQuickViewTextItem.h \
src/ui/UASRawStatusView.h \
src/VehicleSetup/JoystickConfigController.h \
src/ViewWidgets/CustomCommandWidget.h \
src/ViewWidgets/CustomCommandWidgetController.h \
......@@ -423,7 +421,6 @@ SOURCES += \
src/ui/uas/UASQuickViewItem.cc \
src/ui/uas/UASQuickViewItemSelect.cc \
src/ui/uas/UASQuickViewTextItem.cc \
src/ui/UASRawStatusView.cpp \
src/VehicleSetup/JoystickConfigController.cc \
src/ViewWidgets/CustomCommandWidget.cc \
src/ViewWidgets/CustomCommandWidgetController.cc \
......
......@@ -59,7 +59,6 @@ UAS::UAS(MAVLinkProtocol* protocol, Vehicle* vehicle, FirmwarePluginManager * fi
receiveDropRate(0),
sendDropRate(0),
autopilot(vehicle->firmwareType()),
base_mode(0),
custom_mode(0),
status(-1),
......
......@@ -368,7 +368,6 @@ protected: //COMMENTS FOR TEST UNIT
QTimer statusTimeout; ///< Timer for various status timeouts
/// BASIC UAS TYPE, NAME AND STATE
int autopilot; ///< Type of the Autopilot: -1: None, 0: Generic, 1: PIXHAWK, 2: SLUGS, 3: Ardupilot (up to 15 types), defined in MAV_AUTOPILOT_TYPE ENUM
uint8_t base_mode; ///< The current mode of the MAV
uint32_t custom_mode; ///< The current mode of the MAV
int status; ///< The current status of the MAV
......@@ -479,8 +478,6 @@ protected: //COMMENTS FOR TEST UNIT
#endif
public:
/** @brief Set the current battery type */
void setBattery(BatteryType type, int cells);
/** @brief Get the current charge level */
float getChargeLevel();
/** @brief Get the human-readable status message for this code */
......@@ -499,17 +496,8 @@ public:
QImage getImage();
void requestImage();
int getAutopilotType(){
return autopilot;
}
public slots:
/** @brief Set the autopilot type */
void setAutopilotType(int apType)
{
autopilot = apType;
emit systemSpecsChanged(uasId);
}
/** @brief Executes a command with 7 params */
void executeCommand(MAV_CMD command, int confirmation, float param1, float param2, float param3, float param4, float param5, float param6, float param7, int component);
......
......@@ -43,16 +43,6 @@ This file is part of the QGROUNDCONTROL project
class FileManager;
enum BatteryType
{
NICD = 0,
NIMH = 1,
LIION = 2,
LIPOLY = 3,
LIFE = 4,
AGZN = 5
}; ///< The type of battery used
/**
* @brief Interface for all robots.
*
......@@ -122,10 +112,6 @@ public:
return colors[nextColor];//return the next color
}
/** @brief Get the type of the autopilot (PIXHAWK, APM, UDB, PPZ,..) */
virtual int getAutopilotType() = 0;
virtual void setAutopilotType(int apType) = 0;
virtual QMap<int, QString> getComponents() = 0;
QColor getColor()
......
......@@ -60,7 +60,6 @@ This file is part of the QGROUNDCONTROL project
#include "QGCUASFileViewMulti.h"
#include "UASQuickView.h"
#include "QGCTabbedInfoView.h"
#include "UASRawStatusView.h"
#include "CustomCommandWidget.h"
#include "QGCDockWidget.h"
#include "UASInfoWidget.h"
......
......@@ -6,12 +6,8 @@ QGCTabbedInfoView::QGCTabbedInfoView(const QString& title, QAction* action, QWid
{
ui.setupUi(this);
messageView = new UASMessageViewWidget(qgcApp()->toolbox()->uasMessageHandler(), this);
//actionsWidget = new UASActionsWidget(this);
quickView = new UASQuickView(this);
//rawView = new UASRawStatusView(this);
ui.tabWidget->addTab(quickView,"Quick");
//ui.tabWidget->addTab(actionsWidget,"Actions");
//ui.tabWidget->addTab(rawView,"Status");
ui.tabWidget->addTab(messageView,"Messages");
loadSettings();
......@@ -19,7 +15,6 @@ QGCTabbedInfoView::QGCTabbedInfoView(const QString& title, QAction* action, QWid
void QGCTabbedInfoView::addSource(MAVLinkDecoder *decoder)
{
m_decoder = decoder;
//rawView->addSource(decoder);
quickView->addSource(decoder);
}
......
......@@ -5,7 +5,6 @@
#include "MAVLinkDecoder.h"
#include "UASMessageView.h"
#include "UASQuickView.h"
#include "UASRawStatusView.h"
#include "ui_QGCTabbedInfoView.h"
......@@ -22,7 +21,6 @@ private:
Ui::QGCTabbedInfoView ui;
UASMessageViewWidget *messageView;
UASQuickView *quickView;
UASRawStatusView *rawView;
};
#endif // QGCTABBEDINFOVIEW_H
#include "UASRawStatusView.h"
#include "MAVLinkDecoder.h"
#include "UASInterface.h"
#include "UAS.h"
#include <QTimer>
#include <QScrollBar>
UASRawStatusView::UASRawStatusView(QWidget *parent) : QWidget(parent)
{
ui.setupUi(this);
ui.tableWidget->setColumnCount(2);
ui.tableWidget->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
ui.tableWidget->setShowGrid(false);
ui.tableWidget->setEditTriggers(QAbstractItemView::NoEditTriggers);
QTimer *timer = new QTimer(this);
connect(timer,SIGNAL(timeout()),this,SLOT(updateTableTimerTick()));
// FIXME reinstate once fixed.
//timer->start(2000);
}
void UASRawStatusView::addSource(MAVLinkDecoder *decoder)
{
connect(decoder,SIGNAL(valueChanged(int,QString,QString,QVariant,quint64)),this,SLOT(valueChanged(int,QString,QString,QVariant,quint64)));
}
void UASRawStatusView::valueChanged(const int uasId, const QString& name, const QString& unit, const QVariant &variant, const quint64 msec)
{
Q_UNUSED(uasId);
Q_UNUSED(unit);
Q_UNUSED(msec);
bool ok;
double value = variant.toDouble(&ok);
QMetaType::Type type = static_cast<QMetaType::Type>(variant.type());
if(!ok || type == QMetaType::QString || type == QMetaType::QByteArray)
return;
valueMap[name] = value;
if (nameToUpdateWidgetMap.contains(name))
{
nameToUpdateWidgetMap[name]->setText(QString::number(value));
}
else
{
m_tableDirty = true;
}
return;
}
void UASRawStatusView::resizeEvent(QResizeEvent *event)
{
Q_UNUSED(event);
m_tableDirty = true;
}
void UASRawStatusView::updateTableTimerTick()
{
if (m_tableDirty)
{
m_tableDirty = false;
int columncount = 2;
bool good = false;
while (!good)
{
ui.tableWidget->clear();
ui.tableWidget->setRowCount(0);
ui.tableWidget->setColumnCount(columncount);
ui.tableWidget->horizontalHeader()->hide();
ui.tableWidget->verticalHeader()->hide();
int currcolumn = 0;
int currrow = 0;
int totalheight = 2 + ui.tableWidget->horizontalScrollBar()->height();
bool broke = false;
for (QMap<QString,double>::const_iterator i=valueMap.constBegin();i!=valueMap.constEnd();i++)
{
if (ui.tableWidget->rowCount() < currrow+1)
{
ui.tableWidget->setRowCount(currrow+1);
}
ui.tableWidget->setItem(currrow,currcolumn,new QTableWidgetItem(i.key().split(".")[1]));
QTableWidgetItem *item = new QTableWidgetItem(QString::number(i.value()));
nameToUpdateWidgetMap[i.key()] = item;
ui.tableWidget->setItem(currrow,currcolumn+1,item);
ui.tableWidget->resizeRowToContents(currrow);
totalheight += ui.tableWidget->rowHeight(currrow);
currrow++;
if ((totalheight + ui.tableWidget->rowHeight(currrow-1)) > ui.tableWidget->height())
{
currcolumn+=2;
totalheight = 2 + ui.tableWidget->horizontalScrollBar()->height();
currrow = 0;
if (currcolumn >= columncount)
{
//We're over what we can do. Add a column and continue.
columncount+=2;
broke = true;
i = valueMap.constEnd(); // Ensure loop breakout.
break;
}
}
}
if (!broke)
{
good = true;
}
}
ui.tableWidget->resizeColumnsToContents();
//ui.tableWidget->columnCount()-2
}
}
UASRawStatusView::~UASRawStatusView()
{
}
#ifndef UASRAWSTATUSVIEW_H
#define UASRAWSTATUSVIEW_H
#include <QWidget>
#include "MAVLinkDecoder.h"
#include "ui_UASRawStatusView.h"
class UASRawStatusView : public QWidget
{
Q_OBJECT
public:
explicit UASRawStatusView(QWidget *parent = 0);
~UASRawStatusView();
void addSource(MAVLinkDecoder *decoder);
private slots:
void updateTableTimerTick();
void valueChanged(const int uasId, const QString& name, const QString& unit, const QVariant& value, const quint64 msec);
protected:
void resizeEvent(QResizeEvent *event);
private:
QMap<QString,double> valueMap;
QMap<QString,QTableWidgetItem*> nameToUpdateWidgetMap;
Ui::UASRawStatusView ui;
bool m_tableDirty;
};
#endif // UASRAWSTATUSVIEW_H
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>UASRawStatusView</class>
<widget class="QWidget" name="UASRawStatusView">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QTableWidget" name="tableWidget"/>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
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