Commit 6fe1f1d6 authored by Don Gagne's avatar Don Gagne

Remove unused code

parent da099c28
......@@ -103,69 +103,6 @@ bool GAudioOutput::alert(QString text)
return true;
}
void GAudioOutput::notifyPositive()
{
if (!muted)
{
// Use QFile to transform path for all OS
// FIXME: Get working with Qt5's QtMultimedia module
//QFile f(QCoreApplication::applicationDirPath() + QString("/files/audio/double_notify.wav"));
//m_media->setCurrentSource(Phonon::MediaSource(f.fileName().toStdString().c_str()));
//m_media->play();
}
}
void GAudioOutput::notifyNegative()
{
if (!muted)
{
// Use QFile to transform path for all OS
// FIXME: Get working with Qt5's QtMultimedia module
//QFile f(QCoreApplication::applicationDirPath() + QString("/files/audio/flat_notify.wav"));
//m_media->setCurrentSource(Phonon::MediaSource(f.fileName().toStdString().c_str()));
//m_media->play();
}
}
/**
* The emergency sound will be played continously during the emergency.
* call stopEmergency() to disable it again. No speech synthesis or other
* audio output is available during the emergency.
*
* @return true if the emergency could be started, false else
*/
bool GAudioOutput::startEmergency()
{
// if (!emergency)
// {
// emergency = true;
// // Beep immediately and then start timer
// emergencyTimer->start(1500);
// QTimer::singleShot(5000, this, SLOT(stopEmergency()));
// }
return true;
}
/**
* Stops the continous emergency sound. Use startEmergency() to start
* the emergency sound.
*
* @return true if the emergency could be stopped, false else
*/
bool GAudioOutput::stopEmergency()
{
// if (emergency)
// {
// emergency = false;
// emergencyTimer->stop();
// }
return true;
}
void GAudioOutput::beep()
{
if (!muted) {
......
......@@ -80,20 +80,8 @@ public slots:
bool say(QString text, int severity = 6);
/** @brief Play alert sound and say notification message */
bool alert(QString text);
/** @brief Start emergency sound */
bool startEmergency();
/** @brief Stop emergency sound */
bool stopEmergency();
// /** @brief Select female voice */
// void selectFemaleVoice();
// /** @brief Select male voice */
// void selectMaleVoice();
/** @brief Play emergency sound once */
void beep();
/** @brief Notify about positive event */
void notifyPositive();
/** @brief Notify about negative event */
void notifyNegative();
/** @brief Mute/unmute sound */
void mute(bool mute);
......
......@@ -341,64 +341,6 @@ public:
}
};
class DIR
{
public:
/**
* @brief Get the current support file directory.
*
* The support files are files like icons or fonts and are typically found in the
* same directory as the main executable.
*
* @return The absolute path of the directory
**/
static QString getSupportFilesDirectory() {
// Checks if the software is executed in the development environment
QString path = QDir::current().absolutePath();
QDir currentDir = QDir::current();
if (QDir::current().dirName().toLower() == "debug") {
// Debug folder of development environment
path.append("/..");
} else if (QDir::current().dirName().toLower() == "release") {
// Release folder of development environment
path.append("/..");
} else if (QDir::current().dirName().toLower() == "bin") {
// Release folder of development environment
path.append("/..");
} else if (QDir::current().dirName().toLower() == "macos") {
// Mac application bundle in development environment
path.append("/../../../../..");
}
// Check if we are still in a development folder
if(currentDir.cdUp()) {
if(currentDir.dirName().toLower() == "build") {
path.append("/..");
}
}
//TODO The Mac application bundle in distribution is not yet included here
//qDebug() << "MG::supportfilesdirectory" << path;
return path;
}
/**
* @brief Get the current icon directory.
*
* The icon directory is typically a subdirectory of the main directory,
* but depends on the platform. For example in OS X it is part of the bundle.
*
* @return The absolute path of the icon directory
**/
static QString getIconDirectory() {
return MG::DIR::getSupportFilesDirectory() + "/files/images/";
}
};
}
#endif // _MG_H_
......@@ -146,40 +146,6 @@ void FirmwareUpgradeController::_findTimeout(void)
_cancel();
}
/// @brief Sets the board image into the icon label according to the board id.
void FirmwareUpgradeController::_setBoardIcon(int boardID)
{
QString imageFile;
switch (boardID) {
case _boardIDPX4FMUV1:
imageFile = ":/files/images/px4/boards/px4fmu_1.x.png";
break;
case _boardIDPX4Flow:
imageFile = ":/files/images/px4/boards/px4flow_1.x.png";
break;
case _boardIDPX4FMUV2:
imageFile = ":/files/images/px4/boards/px4fmu_2.x.png";
break;
}
if (!imageFile.isEmpty()) {
bool success = _boardIcon.load(imageFile);
Q_ASSERT(success);
Q_UNUSED(success);
/*
// FIXME: NYI
int w = _ui->icon->width();
int h = _ui->icon->height();
_ui->icon->setPixmap(_boardIcon.scaled(w, h, Qt::KeepAspectRatio));
*/
}
}
/// @brief Prompts the user to select a firmware file if needed and moves the state machine to the next state.
void FirmwareUpgradeController::_getFirmwareFile(void)
{
......
......@@ -106,8 +106,6 @@ private:
void _cancel(void);
void _getFirmwareFile(void);
void _setBoardIcon(int boardID);
void _downloadFirmware(void);
void _erase(void);
......
......@@ -347,13 +347,6 @@ void UAS::updateState()
{
positionLock = false;
}
else
{
if (((base_mode & MAV_MODE_FLAG_DECODE_POSITION_AUTO) || (base_mode & MAV_MODE_FLAG_DECODE_POSITION_GUIDED)) && positionLock)
{
GAudioOutput::instance()->notifyNegative();
}
}
}
/**
......@@ -565,7 +558,6 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message)
}
else if (modechanged || statechanged)
{
GAudioOutput::instance()->stopEmergency();
GAudioOutput::instance()->say(audiostring.toLower());
}
}
......@@ -816,11 +808,6 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message)
emit localPositionChanged(this, localX, localY, localZ, time);
emit velocityChanged_NED(this, speedX, speedY, speedZ, time);
// Set internal state
if (!positionLock) {
// If position was not locked before, notify positive
GAudioOutput::instance()->notifyPositive();
}
positionLock = true;
isLocalPositionKnown = true;
}
......@@ -863,12 +850,6 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message)
setGroundSpeed(qSqrt(speedX*speedX+speedY*speedY));
emit speedChanged(this, groundSpeed, airSpeed, time);
// Set internal state
if (!positionLock)
{
// If position was not locked before, notify positive
GAudioOutput::instance()->notifyPositive();
}
positionLock = true;
isGlobalPositionKnown = true;
}
......@@ -3351,7 +3332,6 @@ void UAS::startLowBattAlarm()
if (!lowBattAlarm)
{
GAudioOutput::instance()->alert(tr("System %1 has low battery").arg(getUASID()));
QTimer::singleShot(3000, GAudioOutput::instance(), SLOT(startEmergency()));
lowBattAlarm = true;
}
}
......@@ -3360,7 +3340,6 @@ void UAS::stopLowBattAlarm()
{
if (lowBattAlarm)
{
GAudioOutput::instance()->stopEmergency();
lowBattAlarm = false;
}
}
......
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009, 2010 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
* @brief Implementation of AudioOutputWidget
* @author Lorenz Meier <mavteam@student.ethz.ch>
*
*/
#include "AudioOutputWidget.h"
#include "ui_AudioOutputWidget.h"
AudioOutputWidget::AudioOutputWidget(QWidget *parent) :
QWidget(parent),
m_ui(new Ui::AudioOutputWidget)
{
m_ui->setupUi(this);
}
AudioOutputWidget::~AudioOutputWidget()
{
delete m_ui;
}
void AudioOutputWidget::changeEvent(QEvent *e)
{
QWidget::changeEvent(e);
switch (e->type()) {
case QEvent::LanguageChange:
m_ui->retranslateUi(this);
break;
default:
break;
}
}
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009, 2010 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
* @brief Definition of class AudioOutputWidget
* @author Lorenz Meier <mavteam@student.ethz.ch>
*
*/
#ifndef AUDIOOUTPUTWIDGET_H
#define AUDIOOUTPUTWIDGET_H
#include <QWidget>
namespace Ui
{
class AudioOutputWidget;
}
/**
* @brief Widget to control audio/volume/mute
*/
class AudioOutputWidget : public QWidget
{
Q_OBJECT
public:
AudioOutputWidget(QWidget *parent = 0);
~AudioOutputWidget();
protected:
void changeEvent(QEvent *e);
private:
Ui::AudioOutputWidget *m_ui;
};
#endif // AUDIOOUTPUTWIDGET_H
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>AudioOutputWidget</class>
<widget class="QWidget" name="AudioOutputWidget">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>195</width>
<height>95</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="margin">
<number>6</number>
</property>
<item row="0" column="2" colspan="2">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>53</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="0" colspan="4">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>180</width>
<height>43</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="0">
<widget class="QPushButton" name="muteButton">
<property name="text">
<string>Mute</string>
</property>
<property name="icon">
<iconset resource="../../qgroundcontrol.qrc">
<normaloff>:/files/images/status/audio-volume-muted.svg</normaloff>:/files/images/status/audio-volume-muted.svg</iconset>
</property>
<property name="iconSize">
<size>
<width>16</width>
<height>16</height>
</size>
</property>
</widget>
</item>
</layout>
</widget>
<resources>
<include location="../../qgroundcontrol.qrc"/>
</resources>
<connections/>
</ui>
......@@ -204,8 +204,6 @@ XbeeConfigurationWindow::XbeeConfigurationWindow(LinkInterface* link, QWidget *p
{
this->link = xbeeLink;
action = new QAction(QIcon(":/files/images/devices/network-wireless.svg"), "", link);
baudLabel = new QLabel;
baudLabel->setText(tr("Baut Rate"));
baudBox = new QComboBox;
......@@ -402,11 +400,6 @@ void XbeeConfigurationWindow::hideEvent(QHideEvent* event)
portCheckTimer->stop();
}
QAction* XbeeConfigurationWindow::getAction()
{
return action;
}
void XbeeConfigurationWindow::configureCommunication()
{
this->setupPortList();
......
......@@ -23,8 +23,6 @@ public:
XbeeConfigurationWindow(LinkInterface* link, QWidget *parent = 0, Qt::WindowFlags flags = Qt::Sheet);
~XbeeConfigurationWindow();
QAction* getAction();
public slots:
void configureCommunication();
void setPortName(QString port);
......@@ -49,7 +47,6 @@ private:
QHBoxLayout *xbeeLayout;
QVBoxLayout *tmpLayout;
XbeeLinkInterface* link;
QAction* action;
QTimer* portCheckTimer;
HexSpinBox* highAddr;
HexSpinBox* lowAddr;
......
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