Skip to content

Commit

Permalink
Remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
DonLakeFlyer committed Apr 2, 2015
1 parent da099c2 commit 6fe1f1d
Show file tree
Hide file tree
Showing 11 changed files with 0 additions and 383 deletions.
63 changes: 0 additions & 63 deletions src/GAudioOutput.cc
Expand Up @@ -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) {
Expand Down
12 changes: 0 additions & 12 deletions src/GAudioOutput.h
Expand Up @@ -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);

Expand Down
58 changes: 0 additions & 58 deletions src/MG.h
Expand Up @@ -341,64 +341,6 @@ class TIME
}

};

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_
34 changes: 0 additions & 34 deletions src/VehicleSetup/FirmwareUpgradeController.cc
Expand Up @@ -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)
{
Expand Down
2 changes: 0 additions & 2 deletions src/VehicleSetup/FirmwareUpgradeController.h
Expand Up @@ -106,8 +106,6 @@ private slots:
void _cancel(void);
void _getFirmwareFile(void);

void _setBoardIcon(int boardID);

void _downloadFirmware(void);

void _erase(void);
Expand Down
21 changes: 0 additions & 21 deletions src/uas/UAS.cc
Expand Up @@ -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();
}
}
}

/**
Expand Down Expand Up @@ -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());
}
}
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
}
Expand All @@ -3360,7 +3340,6 @@ void UAS::stopLowBattAlarm()
{
if (lowBattAlarm)
{
GAudioOutput::instance()->stopEmergency();
lowBattAlarm = false;
}
}
Expand Down
56 changes: 0 additions & 56 deletions src/ui/AudioOutputWidget.cc

This file was deleted.

58 changes: 0 additions & 58 deletions src/ui/AudioOutputWidget.h

This file was deleted.

0 comments on commit 6fe1f1d

Please sign in to comment.