diff --git a/src/GAudioOutput.cc b/src/GAudioOutput.cc index f8c498851542ef8aa6a1b8a4d33cd54710d4e7d7..2e48dbc16669a13987440d2e97cb0348afc033dd 100644 --- a/src/GAudioOutput.cc +++ b/src/GAudioOutput.cc @@ -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) { diff --git a/src/GAudioOutput.h b/src/GAudioOutput.h index ee97e8515c838224a8342d65a96bee1c9abb8b20..ffbd49dbf26000cee0416fef79a98aa55ab35260 100644 --- a/src/GAudioOutput.h +++ b/src/GAudioOutput.h @@ -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); diff --git a/src/MG.h b/src/MG.h index 8bc9426028092e8cf3df148f176c0150dde7adc8..f5b4cf9d3e7b47dd525a1d93850fa38bac00442f 100644 --- a/src/MG.h +++ b/src/MG.h @@ -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_ diff --git a/src/VehicleSetup/FirmwareUpgradeController.cc b/src/VehicleSetup/FirmwareUpgradeController.cc index 6b16a21049b344cbd4cd613f5c7f25aefa9b2674..0af15f33e0d70628eb7d7459192db34117f0cfbb 100644 --- a/src/VehicleSetup/FirmwareUpgradeController.cc +++ b/src/VehicleSetup/FirmwareUpgradeController.cc @@ -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) { diff --git a/src/VehicleSetup/FirmwareUpgradeController.h b/src/VehicleSetup/FirmwareUpgradeController.h index f3d3cce9f8c27a162d4cc24e18ddcb2c0f5de73d..d605143b7f1bbeea3f660aa2eb91d7b55e1a82d3 100644 --- a/src/VehicleSetup/FirmwareUpgradeController.h +++ b/src/VehicleSetup/FirmwareUpgradeController.h @@ -106,8 +106,6 @@ private: void _cancel(void); void _getFirmwareFile(void); - void _setBoardIcon(int boardID); - void _downloadFirmware(void); void _erase(void); diff --git a/src/uas/UAS.cc b/src/uas/UAS.cc index c16b6770950f4a9a76309d8372809274582d2d96..1eab9d35414d6a4beacd620629bd48ae8646ffc8 100644 --- a/src/uas/UAS.cc +++ b/src/uas/UAS.cc @@ -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; } } diff --git a/src/ui/AudioOutputWidget.cc b/src/ui/AudioOutputWidget.cc deleted file mode 100644 index bf157eb96d4272b89a4b2e49a0f958749756b11b..0000000000000000000000000000000000000000 --- a/src/ui/AudioOutputWidget.cc +++ /dev/null @@ -1,56 +0,0 @@ -/*===================================================================== - -QGroundControl Open Source Ground Control Station - -(c) 2009, 2010 QGROUNDCONTROL PROJECT - -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 . - -======================================================================*/ - -/** - * @file - * @brief Implementation of AudioOutputWidget - * @author Lorenz Meier - * - */ - -#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; - } -} diff --git a/src/ui/AudioOutputWidget.h b/src/ui/AudioOutputWidget.h deleted file mode 100644 index 4fd439872016d9eebcfed0aca8007ae7a1e84c91..0000000000000000000000000000000000000000 --- a/src/ui/AudioOutputWidget.h +++ /dev/null @@ -1,58 +0,0 @@ -/*===================================================================== - -QGroundControl Open Source Ground Control Station - -(c) 2009, 2010 QGROUNDCONTROL PROJECT - -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 . - -======================================================================*/ - -/** - * @file - * @brief Definition of class AudioOutputWidget - * @author Lorenz Meier - * - */ - -#ifndef AUDIOOUTPUTWIDGET_H -#define AUDIOOUTPUTWIDGET_H - -#include - -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 diff --git a/src/ui/AudioOutputWidget.ui b/src/ui/AudioOutputWidget.ui deleted file mode 100644 index a6b221191e41c503ceaf606a7c99b0b12f05620d..0000000000000000000000000000000000000000 --- a/src/ui/AudioOutputWidget.ui +++ /dev/null @@ -1,69 +0,0 @@ - - - AudioOutputWidget - - - - 0 - 0 - 195 - 95 - - - - Form - - - - 6 - - - - - Qt::Horizontal - - - - 53 - 20 - - - - - - - - Qt::Vertical - - - - 180 - 43 - - - - - - - - Mute - - - - :/files/images/status/audio-volume-muted.svg:/files/images/status/audio-volume-muted.svg - - - - 16 - 16 - - - - - - - - - - - diff --git a/src/ui/XbeeConfigurationWindow.cpp b/src/ui/XbeeConfigurationWindow.cpp index 72104bffd966b65cd69d67a0a754bf826bf202bf..847ab8e93dd22c73cfcd2962f7f775015b022e5a 100644 --- a/src/ui/XbeeConfigurationWindow.cpp +++ b/src/ui/XbeeConfigurationWindow.cpp @@ -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(); diff --git a/src/ui/XbeeConfigurationWindow.h b/src/ui/XbeeConfigurationWindow.h index afcdf4779ad9c822539cb003d36bed156f41c85f..1a6f233fd03c3fd292590f0cb413360e672a15d8 100644 --- a/src/ui/XbeeConfigurationWindow.h +++ b/src/ui/XbeeConfigurationWindow.h @@ -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;