Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
6fe1f1d6
Commit
6fe1f1d6
authored
Apr 02, 2015
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unused code
parent
da099c28
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
0 additions
and
383 deletions
+0
-383
GAudioOutput.cc
src/GAudioOutput.cc
+0
-63
GAudioOutput.h
src/GAudioOutput.h
+0
-12
MG.h
src/MG.h
+0
-58
FirmwareUpgradeController.cc
src/VehicleSetup/FirmwareUpgradeController.cc
+0
-34
FirmwareUpgradeController.h
src/VehicleSetup/FirmwareUpgradeController.h
+0
-2
UAS.cc
src/uas/UAS.cc
+0
-21
AudioOutputWidget.cc
src/ui/AudioOutputWidget.cc
+0
-56
AudioOutputWidget.h
src/ui/AudioOutputWidget.h
+0
-58
AudioOutputWidget.ui
src/ui/AudioOutputWidget.ui
+0
-69
XbeeConfigurationWindow.cpp
src/ui/XbeeConfigurationWindow.cpp
+0
-7
XbeeConfigurationWindow.h
src/ui/XbeeConfigurationWindow.h
+0
-3
No files found.
src/GAudioOutput.cc
View file @
6fe1f1d6
...
@@ -103,69 +103,6 @@ bool GAudioOutput::alert(QString text)
...
@@ -103,69 +103,6 @@ bool GAudioOutput::alert(QString text)
return
true
;
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
()
void
GAudioOutput
::
beep
()
{
{
if
(
!
muted
)
{
if
(
!
muted
)
{
...
...
src/GAudioOutput.h
View file @
6fe1f1d6
...
@@ -80,20 +80,8 @@ public slots:
...
@@ -80,20 +80,8 @@ public slots:
bool
say
(
QString
text
,
int
severity
=
6
);
bool
say
(
QString
text
,
int
severity
=
6
);
/** @brief Play alert sound and say notification message */
/** @brief Play alert sound and say notification message */
bool
alert
(
QString
text
);
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 */
/** @brief Play emergency sound once */
void
beep
();
void
beep
();
/** @brief Notify about positive event */
void
notifyPositive
();
/** @brief Notify about negative event */
void
notifyNegative
();
/** @brief Mute/unmute sound */
/** @brief Mute/unmute sound */
void
mute
(
bool
mute
);
void
mute
(
bool
mute
);
...
...
src/MG.h
View file @
6fe1f1d6
...
@@ -341,64 +341,6 @@ public:
...
@@ -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_
#endif // _MG_H_
src/VehicleSetup/FirmwareUpgradeController.cc
View file @
6fe1f1d6
...
@@ -146,40 +146,6 @@ void FirmwareUpgradeController::_findTimeout(void)
...
@@ -146,40 +146,6 @@ void FirmwareUpgradeController::_findTimeout(void)
_cancel
();
_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.
/// @brief Prompts the user to select a firmware file if needed and moves the state machine to the next state.
void
FirmwareUpgradeController
::
_getFirmwareFile
(
void
)
void
FirmwareUpgradeController
::
_getFirmwareFile
(
void
)
{
{
...
...
src/VehicleSetup/FirmwareUpgradeController.h
View file @
6fe1f1d6
...
@@ -106,8 +106,6 @@ private:
...
@@ -106,8 +106,6 @@ private:
void
_cancel
(
void
);
void
_cancel
(
void
);
void
_getFirmwareFile
(
void
);
void
_getFirmwareFile
(
void
);
void
_setBoardIcon
(
int
boardID
);
void
_downloadFirmware
(
void
);
void
_downloadFirmware
(
void
);
void
_erase
(
void
);
void
_erase
(
void
);
...
...
src/uas/UAS.cc
View file @
6fe1f1d6
...
@@ -347,13 +347,6 @@ void UAS::updateState()
...
@@ -347,13 +347,6 @@ void UAS::updateState()
{
{
positionLock
=
false
;
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)
...
@@ -565,7 +558,6 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message)
}
}
else
if
(
modechanged
||
statechanged
)
else
if
(
modechanged
||
statechanged
)
{
{
GAudioOutput
::
instance
()
->
stopEmergency
();
GAudioOutput
::
instance
()
->
say
(
audiostring
.
toLower
());
GAudioOutput
::
instance
()
->
say
(
audiostring
.
toLower
());
}
}
}
}
...
@@ -816,11 +808,6 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message)
...
@@ -816,11 +808,6 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message)
emit
localPositionChanged
(
this
,
localX
,
localY
,
localZ
,
time
);
emit
localPositionChanged
(
this
,
localX
,
localY
,
localZ
,
time
);
emit
velocityChanged_NED
(
this
,
speedX
,
speedY
,
speedZ
,
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
;
positionLock
=
true
;
isLocalPositionKnown
=
true
;
isLocalPositionKnown
=
true
;
}
}
...
@@ -863,12 +850,6 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message)
...
@@ -863,12 +850,6 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message)
setGroundSpeed
(
qSqrt
(
speedX
*
speedX
+
speedY
*
speedY
));
setGroundSpeed
(
qSqrt
(
speedX
*
speedX
+
speedY
*
speedY
));
emit
speedChanged
(
this
,
groundSpeed
,
airSpeed
,
time
);
emit
speedChanged
(
this
,
groundSpeed
,
airSpeed
,
time
);
// Set internal state
if
(
!
positionLock
)
{
// If position was not locked before, notify positive
GAudioOutput
::
instance
()
->
notifyPositive
();
}
positionLock
=
true
;
positionLock
=
true
;
isGlobalPositionKnown
=
true
;
isGlobalPositionKnown
=
true
;
}
}
...
@@ -3351,7 +3332,6 @@ void UAS::startLowBattAlarm()
...
@@ -3351,7 +3332,6 @@ void UAS::startLowBattAlarm()
if
(
!
lowBattAlarm
)
if
(
!
lowBattAlarm
)
{
{
GAudioOutput
::
instance
()
->
alert
(
tr
(
"System %1 has low battery"
).
arg
(
getUASID
()));
GAudioOutput
::
instance
()
->
alert
(
tr
(
"System %1 has low battery"
).
arg
(
getUASID
()));
QTimer
::
singleShot
(
3000
,
GAudioOutput
::
instance
(),
SLOT
(
startEmergency
()));
lowBattAlarm
=
true
;
lowBattAlarm
=
true
;
}
}
}
}
...
@@ -3360,7 +3340,6 @@ void UAS::stopLowBattAlarm()
...
@@ -3360,7 +3340,6 @@ void UAS::stopLowBattAlarm()
{
{
if
(
lowBattAlarm
)
if
(
lowBattAlarm
)
{
{
GAudioOutput
::
instance
()
->
stopEmergency
();
lowBattAlarm
=
false
;
lowBattAlarm
=
false
;
}
}
}
}
...
...
src/ui/AudioOutputWidget.cc
deleted
100644 → 0
View file @
da099c28
/*=====================================================================
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
;
}
}
src/ui/AudioOutputWidget.h
deleted
100644 → 0
View file @
da099c28
/*=====================================================================
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
src/ui/AudioOutputWidget.ui
deleted
100644 → 0
View file @
da099c28
<?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>
src/ui/XbeeConfigurationWindow.cpp
View file @
6fe1f1d6
...
@@ -204,8 +204,6 @@ XbeeConfigurationWindow::XbeeConfigurationWindow(LinkInterface* link, QWidget *p
...
@@ -204,8 +204,6 @@ XbeeConfigurationWindow::XbeeConfigurationWindow(LinkInterface* link, QWidget *p
{
{
this
->
link
=
xbeeLink
;
this
->
link
=
xbeeLink
;
action
=
new
QAction
(
QIcon
(
":/files/images/devices/network-wireless.svg"
),
""
,
link
);
baudLabel
=
new
QLabel
;
baudLabel
=
new
QLabel
;
baudLabel
->
setText
(
tr
(
"Baut Rate"
));
baudLabel
->
setText
(
tr
(
"Baut Rate"
));
baudBox
=
new
QComboBox
;
baudBox
=
new
QComboBox
;
...
@@ -402,11 +400,6 @@ void XbeeConfigurationWindow::hideEvent(QHideEvent* event)
...
@@ -402,11 +400,6 @@ void XbeeConfigurationWindow::hideEvent(QHideEvent* event)
portCheckTimer
->
stop
();
portCheckTimer
->
stop
();
}
}
QAction
*
XbeeConfigurationWindow
::
getAction
()
{
return
action
;
}
void
XbeeConfigurationWindow
::
configureCommunication
()
void
XbeeConfigurationWindow
::
configureCommunication
()
{
{
this
->
setupPortList
();
this
->
setupPortList
();
...
...
src/ui/XbeeConfigurationWindow.h
View file @
6fe1f1d6
...
@@ -23,8 +23,6 @@ public:
...
@@ -23,8 +23,6 @@ public:
XbeeConfigurationWindow
(
LinkInterface
*
link
,
QWidget
*
parent
=
0
,
Qt
::
WindowFlags
flags
=
Qt
::
Sheet
);
XbeeConfigurationWindow
(
LinkInterface
*
link
,
QWidget
*
parent
=
0
,
Qt
::
WindowFlags
flags
=
Qt
::
Sheet
);
~
XbeeConfigurationWindow
();
~
XbeeConfigurationWindow
();
QAction
*
getAction
();
public
slots
:
public
slots
:
void
configureCommunication
();
void
configureCommunication
();
void
setPortName
(
QString
port
);
void
setPortName
(
QString
port
);
...
@@ -49,7 +47,6 @@ private:
...
@@ -49,7 +47,6 @@ private:
QHBoxLayout
*
xbeeLayout
;
QHBoxLayout
*
xbeeLayout
;
QVBoxLayout
*
tmpLayout
;
QVBoxLayout
*
tmpLayout
;
XbeeLinkInterface
*
link
;
XbeeLinkInterface
*
link
;
QAction
*
action
;
QTimer
*
portCheckTimer
;
QTimer
*
portCheckTimer
;
HexSpinBox
*
highAddr
;
HexSpinBox
*
highAddr
;
HexSpinBox
*
lowAddr
;
HexSpinBox
*
lowAddr
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment