Commit 18d74deb authored by James Goppert's avatar James Goppert

K/R formatting, debugging serialport.

parent 48f4d3ba
......@@ -155,6 +155,7 @@ if(QSERIAL_BUILD_FROM_SOURCE)
${PROJECT_SOURCE_DIR}/thirdParty/qserial/include/QtSerialPort
${PROJECT_SOURCE_DIR}/thirdParty/qserial/src
)
set(QSERIAL_LIBRARIES qserial)
add_custom_command(OUTPUT QSERIAL_BUILD.stamp
COMMAND touch QSERIAL_BUILD.stamp)
endif()
......@@ -216,6 +217,7 @@ endif()
message(STATUS "\t\tQSERIAL\t\t${QSERIAL_FOUND}")
if (QSERIAL_FOUND)
list(APPEND qgroundcontrolIncludes ${QSERIAL_INCLUDE_DIRS})
list(APPEND qgroundcontrolLibs ${QSERIAL_LIBRARIES})
endif()
message(STATUS "\t\tOpenSceneGraph\t${OPENSCENEGRAPH_FOUND}")
......@@ -792,13 +794,13 @@ set (qserialHdrs
thirdParty/qserial/include/QtSerialPort/qserialport_export.h
thirdParty/qserial/include/QtSerialPort/QSerialPort
thirdParty/qserial/include/QtSerialPort/qportsettings.h
thirdParty/qserial/include/QtSerialPort/qserialport.h
thirdParty/qserial/include/QtSerialPort/qserialportnative.h
)
# qserial headers with Q_OBJECT
# r !grep -Rl Q_OBJECT thirdParty/qserial
set (qserialMocSrc
thirdParty/qserial/include/QtSerialPort/qserialport.h
thirdParty/qserial/include/QtSerialPort/qserialportnative.h
)
)
# qserial src
set (qserialSrc
thirdParty/qserial/src/common/qserialport.cpp
......@@ -812,28 +814,32 @@ set(qserialRscSrc
)
# qserial native code
if (WIN32)
list(APPEND qSerialMocSrc
thirdParty/qserial/src/win32/qwincommevtnotifier.h
thirdParty/qserial/src/win32/wincommevtbreaker.h
)
list(APPEND qSerialSrc
thirdParty/qserial/src/win32/qserialportnative_win32.cpp
thirdParty/qserial/src/win32/commdcbhelper.h
thirdParty/qserial/src/win32/commdcbhelper.cpp
thirdParty/qserial/src/win32/qserialportnative_wince.cpp
thirdParty/qserial/src/win32/wincommevtbreaker.cpp
thirdParty/qserial/src/win32/qwincommevtnotifier.cpp
)
elseif(UNIX OR APPLE)
list(APPEND qSerialSrc
#if (WIN32)
#list(APPEND qserialHdrs
#thirdParty/qserial/src/win32/commdcbhelper.h
#)
#list(APPEND qserialMocSrc
#thirdParty/qserial/src/win32/qwincommevtnotifier.h
#thirdParty/qserial/src/win32/wincommevtbreaker.h
#)
#list(APPEND qserialSrc
#thirdParty/qserial/src/win32/qserialportnative_win32.cpp
#thirdParty/qserial/src/win32/commdcbhelper.cpp
#thirdParty/qserial/src/win32/qwincommevtnotifier.cpp
##thirdParty/qserial/src/win32/qserialportnative_wince.cpp
##thirdParty/qserial/src/win32/wincommevtbreaker.cpp
#)
#elseif(UNIX OR APPLE)
list(APPEND qserialHdrs
thirdParty/qserial/src/posix/termioshelper.h
)
list(APPEND qserialSrc
thirdParty/qserial/src/posix/termioshelper.cpp
thirdParty/qserial/src/posix/qserialportnative_posix.cpp
)
else()
message(FATAL_ERROR "unknown OS")
endif()
#else()
#message(FATAL_ERROR "unknown OS")
#endif()
# qserial linking
qt4_wrap_cpp(qserialMoc ${qserialMocSrc})
......
# - Try to find QSERIAL
# Once done, this will define
#
# QSERIAL_FOUND - system has scicoslab
# QSERIAL_INCLUDE_DIRS - the scicoslab include directories
# QSERIAL_LIBRARIES - libraries to link to
include(LibFindMacros)
# Include dir
find_path(QSERIAL_INCLUDE_DIR
NAMES QSerialPort
PATHS
/usr/include/QtSerialPort
/usr/local/include/QtSerialPort
/usr/local/qserialport/include/QtSerialPort
)
# Finally the library itself
find_library(QSERIAL_LIBRARY
NAMES
QtSerialPort
PATHS
/usr/lib
/usr/local/lib
/usr/local/qserialport/lib
)
# Set the include dir variables and the libraries and let libfind_process do the rest.
# NOTE: Singular variables for this library, plural for libraries this this lib depends on.
set(QSERIAL_PROCESS_INCLUDES QSERIAL_INCLUDE_DIR)
set(QSERIAL_PROCESS_LIBS QSERIAL_LIBRARY QSERIAL_LIBRARIES)
libfind_process(QSERIAL)
#!/bin/bash
astyle --style=k/r $(find src -regex ".*\.\(cpp\|cc\|h\|hpp\)")
rm -f $(find . -regex '.*orig$')
git commit
#include "AudioOutput.h"
#ifdef Q_OS_MAC
#include <ApplicationServices/ApplicationServices.h>
#include <ApplicationServices/ApplicationServices.h>
#else
#include <flite.h>
#include <phonon/mediaobject.h>
#include <QTemporaryFile>
#include <flite.h>
#include <phonon/mediaobject.h>
#include <QTemporaryFile>
#endif
#include <QDebug>
......@@ -25,17 +25,16 @@ extern "C" {
};
#endif
AudioOutput::AudioOutput(QString voice, QObject* parent)
: QObject(parent),
voice(NULL),
voiceIndex(0)
AudioOutput::AudioOutput(QString voice, QObject* parent)
: QObject(parent),
voice(NULL),
voiceIndex(0)
{
#if !defined(Q_OS_WIN32) && !defined(Q_OS_MAC)
flite_init();
#endif
switch (voiceIndex)
{
switch (voiceIndex) {
case 0:
selectFemaleVoice();
break;
......@@ -73,20 +72,19 @@ bool AudioOutput::say(QString text, int severity)
#if defined(Q_OS_WIN32)
qDebug() << "Synthesized: " << text << ", NO OUTPUT SUPPORT ON WINDOWS!";
#elif defined(Q_OS_MAC)
// FIXME, copy string, set callback to free the copy
SpeakString((const unsigned char*)text.toAscii().data());
qDebug() << "Synthesized: " << text;
// FIXME, copy string, set callback to free the copy
SpeakString((const unsigned char*)text.toAscii().data());
qDebug() << "Synthesized: " << text;
#else
QTemporaryFile file;
file.setFileTemplate("XXXXXX.wav");
if (file.open())
{
if (file.open()) {
cst_wave* wav = flite_text_to_wave(text.toStdString().c_str(), this->voice);
// file.fileName() returns the unique file name
cst_wave_save(wav, file.fileName().toStdString().c_str(), "riff");
Phonon::MediaObject *music =
Phonon::createPlayer(Phonon::MusicCategory,
Phonon::MediaSource(file.fileName().toStdString().c_str()));
Phonon::createPlayer(Phonon::MusicCategory,
Phonon::MediaSource(file.fileName().toStdString().c_str()));
music->play();
qDebug() << "Synthesized: " << text << ", tmp file:" << file.fileName().toStdString().c_str();
}
......@@ -155,9 +153,9 @@ extern "C" {
l.append(s);
}
printf("\n");
*/
*/
#endif
return l;
return l;
}
#ifdef __cplusplus
}
......
......@@ -87,20 +87,16 @@ Core::Core(int &argc, char* argv[]) : QApplication(argc, argv)
// Show user an upgrade message if QGC got upgraded (see code below, after splash screen)
bool upgraded = false;
QString lastApplicationVersion("");
if (settings.contains("QGC_APPLICATION_VERSION"))
{
if (settings.contains("QGC_APPLICATION_VERSION")) {
QString qgcVersion = settings.value("QGC_APPLICATION_VERSION").toString();
if (qgcVersion != QGC_APPLICATION_VERSION)
{
if (qgcVersion != QGC_APPLICATION_VERSION) {
lastApplicationVersion = qgcVersion;
settings.clear();
// Write current application version
settings.setValue("QGC_APPLICATION_VERSION", QGC_APPLICATION_VERSION);
upgraded = true;
}
}
else
{
} else {
// If application version is not set, clear settings anyway
settings.clear();
// Write current application version
......@@ -172,8 +168,7 @@ Core::Core(int &argc, char* argv[]) : QApplication(argc, argv)
if (upgraded) mainWindow->showInfoMessage(tr("Default Settings Loaded"), tr("QGroundControl has been upgraded from version %1 to version %2. Some of your user preferences have been reset to defaults for safety reasons. Please adjust them where needed.").arg(lastApplicationVersion).arg(QGC_APPLICATION_VERSION));
// Check if link could be connected
if (!udpLink->connect())
{
if (!udpLink->connect()) {
QMessageBox msgBox;
msgBox.setIcon(QMessageBox::Critical);
msgBox.setText("Could not connect UDP port. Is an instance of " + qAppName() + "already running?");
......@@ -186,8 +181,7 @@ Core::Core(int &argc, char* argv[]) : QApplication(argc, argv)
QTimer::singleShot(5000, &msgBox, SLOT(reject()));
// Exit application
if (ret == QMessageBox::Yes)
{
if (ret == QMessageBox::Yes) {
//mainWindow->close();
QTimer::singleShot(200, mainWindow, SLOT(close()));
}
......@@ -244,8 +238,7 @@ void Core::startUASManager()
if (pluginsDir.dirName().toLower() == "debug" || pluginsDir.dirName().toLower() == "release")
pluginsDir.cdUp();
#elif defined(Q_OS_MAC)
if (pluginsDir.dirName() == "MacOS")
{
if (pluginsDir.dirName() == "MacOS") {
pluginsDir.cdUp();
pluginsDir.cdUp();
pluginsDir.cdUp();
......@@ -259,12 +252,10 @@ void Core::startUASManager()
QStringList pluginFileNames;
foreach (QString fileName, pluginsDir.entryList(QDir::Files))
{
foreach (QString fileName, pluginsDir.entryList(QDir::Files)) {
QPluginLoader loader(pluginsDir.absoluteFilePath(fileName));
QObject *plugin = loader.instance();
if (plugin)
{
if (plugin) {
//populateMenus(plugin);
pluginFileNames += fileName;
//printf(QString("Loaded plugin from " + fileName + "\n").toStdString().c_str());
......
......@@ -53,25 +53,25 @@ This file is part of the PIXHAWK project
**/
class Core : public QApplication
{
Q_OBJECT
Q_OBJECT
public:
Core(int &argc, char* argv[]);
~Core();
Core(int &argc, char* argv[]);
~Core();
protected:
void startLinkManager();
void startLinkManager();
/**
* @brief Start the robot managing system
*
* The robot manager keeps track of the configured robots.
**/
void startUASManager();
/**
* @brief Start the robot managing system
*
* The robot manager keeps track of the configured robots.
**/
void startUASManager();
private:
MainWindow* mainWindow;
//ViconTarsusProtocol* tarsus;
MainWindow* mainWindow;
//ViconTarsusProtocol* tarsus;
};
#endif /* _CORE_H_ */
......@@ -89,9 +89,9 @@ GAudioOutput* GAudioOutput::instance()
#define QGC_GAUDIOOUTPUT_KEY QString("QGC_AUDIOOUTPUT_")
GAudioOutput::GAudioOutput(QObject* parent) : QObject(parent),
voiceIndex(0),
emergency(false),
muted(false)
voiceIndex(0),
emergency(false),
muted(false)
{
// Load settings
QSettings settings;
......@@ -103,24 +103,20 @@ muted(false)
flite_init();
#endif
#if _MSC_VER2
ISpVoice * pVoice = NULL;
if (FAILED(::CoInitialize(NULL)))
{
qDebug("Creating COM object for audio output failed!");
}
else
{
HRESULT hr = CoCreateInstance(CLSID_SpVoice, NULL, CLSCTX_ALL, IID_ISpVoice, (void **)&pVoice;);
if( SUCCEEDED( hr ) )
{
hr = pVoice->Speak(L"Hello world", 0, NULL);
pVoice->Release();
pVoice = NULL;
#if _MSC_VER2
ISpVoice * pVoice = NULL;
if (FAILED(::CoInitialize(NULL))) {
qDebug("Creating COM object for audio output failed!");
} else {
HRESULT hr = CoCreateInstance(CLSID_SpVoice, NULL, CLSCTX_ALL, IID_ISpVoice, (void **)&pVoice;);
if( SUCCEEDED( hr ) ) {
hr = pVoice->Speak(L"Hello world", 0, NULL);
pVoice->Release();
pVoice = NULL;
}
}
}
#endif
// Initialize audio output
m_media = new Phonon::MediaObject(this);
......@@ -131,8 +127,7 @@ muted(false)
emergencyTimer = new QTimer();
connect(emergencyTimer, SIGNAL(timeout()), this, SLOT(beep()));
switch (voiceIndex)
{
switch (voiceIndex) {
case 0:
selectFemaleVoice();
break;
......@@ -145,14 +140,13 @@ muted(false)
GAudioOutput::~GAudioOutput()
{
#ifdef _MSC_VER2
::CoUninitialize();
::CoUninitialize();
#endif
}
void GAudioOutput::mute(bool mute)
{
if (mute != muted)
{
if (mute != muted) {
this->muted = mute;
QSettings settings;
settings.setValue(QGC_GAUDIOOUTPUT_KEY+"muted", this->muted);
......@@ -168,52 +162,47 @@ bool GAudioOutput::isMuted()
bool GAudioOutput::say(QString text, int severity)
{
if (!muted)
{
// TODO Add severity filter
Q_UNUSED(severity);
bool res = false;
if (!emergency)
{
// Speech synthesis is only supported with MSVC compiler
if (!muted) {
// TODO Add severity filter
Q_UNUSED(severity);
bool res = false;
if (!emergency) {
// Speech synthesis is only supported with MSVC compiler
#ifdef _MSC_VER2
SpeechSynthesizer synth = new SpeechSynthesizer();
synth.SelectVoice("Microsoft Anna");
synth.SpeakText(text.toStdString().c_str());
res = true;
SpeechSynthesizer synth = new SpeechSynthesizer();
synth.SelectVoice("Microsoft Anna");
synth.SpeakText(text.toStdString().c_str());
res = true;
#endif
#ifdef Q_OS_LINUX
QTemporaryFile file;
file.setFileTemplate("XXXXXX.wav");
if (file.open())
{
cst_voice* v = register_cmu_us_kal(NULL);
cst_wave* wav = flite_text_to_wave(text.toStdString().c_str(), v);
// file.fileName() returns the unique file name
cst_wave_save(wav, file.fileName().toStdString().c_str(), "riff");
m_media->setCurrentSource(Phonon::MediaSource(file.fileName().toStdString().c_str()));
m_media->play();
res = true;
}
QTemporaryFile file;
file.setFileTemplate("XXXXXX.wav");
if (file.open()) {
cst_voice* v = register_cmu_us_kal(NULL);
cst_wave* wav = flite_text_to_wave(text.toStdString().c_str(), v);
// file.fileName() returns the unique file name
cst_wave_save(wav, file.fileName().toStdString().c_str(), "riff");
m_media->setCurrentSource(Phonon::MediaSource(file.fileName().toStdString().c_str()));
m_media->play();
res = true;
}
#endif
#ifdef Q_OS_MAC
// Slashes necessary to have the right start to the sentence
// copying data prevents SpeakString from reading additional chars
text = "\\" + text;
QStdWString str = text.toStdWString();
unsigned char str2[1024] = {};
memcpy(str2, text.toAscii().data(), str.length());
SpeakString(str2);
res = true;
// Slashes necessary to have the right start to the sentence
// copying data prevents SpeakString from reading additional chars
text = "\\" + text;
QStdWString str = text.toStdWString();
unsigned char str2[1024] = {};
memcpy(str2, text.toAscii().data(), str.length());
SpeakString(str2);
res = true;
#endif
}
return res;
}
else
{
}
return res;
} else {
return false;
}
}
......@@ -223,40 +212,35 @@ bool GAudioOutput::say(QString text, int severity)
*/
bool GAudioOutput::alert(QString text)
{
if (!emergency || !muted)
{
if (!emergency || !muted) {
// Play alert sound
beep();
// Say alert message
say(text, 2);
return true;
}
else
{
} else {
return false;
}
}
void GAudioOutput::notifyPositive()
{
if (!muted)
{
// Use QFile to transform path for all OS
QFile f(QCoreApplication::applicationDirPath()+QString("/audio/double_notify.wav"));
m_media->setCurrentSource(Phonon::MediaSource(f.fileName().toStdString().c_str()));
m_media->play();
}
if (!muted) {
// Use QFile to transform path for all OS
QFile f(QCoreApplication::applicationDirPath()+QString("/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
QFile f(QCoreApplication::applicationDirPath()+QString("/audio/flat_notify.wav"));
m_media->setCurrentSource(Phonon::MediaSource(f.fileName().toStdString().c_str()));
m_media->play();
}
if (!muted) {
// Use QFile to transform path for all OS
QFile f(QCoreApplication::applicationDirPath()+QString("/audio/flat_notify.wav"));
m_media->setCurrentSource(Phonon::MediaSource(f.fileName().toStdString().c_str()));
m_media->play();
}
}
/**
......@@ -268,8 +252,7 @@ void GAudioOutput::notifyNegative()
*/
bool GAudioOutput::startEmergency()
{
if (!emergency)
{
if (!emergency) {
emergency = true;
// Beep immediately and then start timer
if (!muted) beep();
......@@ -287,8 +270,7 @@ bool GAudioOutput::startEmergency()
*/
bool GAudioOutput::stopEmergency()
{
if (emergency)
{
if (emergency) {
emergency = false;
emergencyTimer->stop();
}
......@@ -297,8 +279,7 @@ bool GAudioOutput::stopEmergency()
void GAudioOutput::beep()
{
if (!muted)
{
if (!muted) {
// Use QFile to transform path for all OS
QFile f(QCoreApplication::applicationDirPath()+QString("/audio/alert.wav"));
qDebug() << "FILE:" << f.fileName();
......@@ -339,8 +320,7 @@ QStringList GAudioOutput::listVoices(void)
printf("Voices available: ");
for (v=flite_voice_list; v; v=val_cdr(v))
{
for (v=flite_voice_list; v; v=val_cdr(v)) {
voice = val_voice(val_car(v));
QString s;
s.sprintf("%s",voice->name);
......
......@@ -59,7 +59,7 @@ This file is part of the PIXHAWK project
extern "C" {
cst_voice *REGISTER_VOX(const char *voxdir);
void UNREGISTER_VOX(cst_voice *vox);
cst_voice* register_cmu_us_kal16(const char *voxdir);
cst_voice* register_cmu_us_kal16(const char *voxdir);
}
#endif
......@@ -124,7 +124,7 @@ protected:
bool muted;
private:
GAudioOutput(QObject* parent=NULL);
~GAudioOutput();
~GAudioOutput();
};
#endif // AUDIOOUTPUT_H
......@@ -9,15 +9,15 @@ This file is part of the QGROUNDCONTROL project
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/>.
======================================================================*/
/**
......@@ -40,12 +40,12 @@ This file is part of the QGROUNDCONTROL project
* It will only get active upon calling startCompression()
*/
LogCompressor::LogCompressor(QString logFileName, QString outFileName, int uasid) :
logFileName(logFileName),
outFileName(outFileName),
running(true),
currentDataLine(0),
dataLines(1),
uasid(uasid)
logFileName(logFileName),
outFileName(outFileName),
running(true),
currentDataLine(0),
dataLines(1),
uasid(uasid)
{
}
......@@ -60,22 +60,20 @@ void LogCompressor::run()
QList<quint64> finalTimes;
qDebug() << "LOG COMPRESSOR: Starting" << fileName;
if (!file.exists() || !file.open(QIODevice::ReadOnly | QIODevice::Text))
{
if (!file.exists() || !file.open(QIODevice::ReadOnly | QIODevice::Text)) {
//qDebug() << "LOG COMPRESSOR: INPUT FILE DOES NOT EXIST";
emit logProcessingStatusChanged(tr("Log Compressor: Cannot start/compress log file, since input file %1 is not readable").arg(QFileInfo(fileName).absoluteFilePath()));
return;
}
// Check if file is writeable
if (outFileName == ""/* || !QFileInfo(outfile).isWritable()*/)
{
//qDebug() << "LOG COMPRESSOR: OUTPUT FILE DOES NOT EXIST" << outFileName;
emit logProcessingStatusChanged(tr("Log Compressor: Cannot start/compress log file, since output file %1 is not writable").arg(QFileInfo(outFileName).absoluteFilePath()));
return;
}
// Check if file is writeable
if (outFileName == ""/* || !QFileInfo(outfile).isWritable()*/) {
//qDebug() << "LOG COMPRESSOR: OUTPUT FILE DOES NOT EXIST" << outFileName;
emit logProcessingStatusChanged(tr("Log Compressor: Cannot start/compress log file, since output file %1 is not writable").arg(QFileInfo(outFileName).absoluteFilePath()));
return;
}
// Find all keys
QTextStream in(&file);
......@@ -95,50 +93,45 @@ void LogCompressor::run()
keyCounter++;
}
keys->sort();
QString header = "";
QString spacer = "";
for (int i = 0; i < keys->length(); i++)
{
for (int i = 0; i < keys->length(); i++) {
header += keys->at(i) + separator;
spacer += " " + separator;
}
emit logProcessingStatusChanged(tr("Log compressor: Dataset contains dimension: ") + header);
//qDebug() << header;
//qDebug() << "NOW READING TIMES";
// Find all times
//in.reset();
file.reset();
in.reset();
in.resetStatus();
bool ok;
while (!in.atEnd())
{
while (!in.atEnd()) {
QString line = in.readLine();
// Accumulate map of keys
// Data field name is at position 2b
quint64 time = static_cast<QString>(line.split(separator).at(0)).toLongLong(&ok);
if (ok)
{
if (ok) {
times.append(time);
}
}
qSort(times);
qint64 lastTime = -1;
// Create lines
QStringList* outLines = new QStringList();
for (int i = 0; i < times.length(); i++)
{
for (int i = 0; i < times.length(); i++) {
// Cast to signed on purpose, 64 bit timestamp still long enough
if (static_cast<qint64>(times.at(i)) != lastTime)
{
if (static_cast<qint64>(times.at(i)) != lastTime) {
outLines->append(QString("%1").arg(times.at(i)) + separator + spacer);
lastTime = static_cast<qint64>(times.at(i));
finalTimes.append(times.at(i));
......@@ -149,16 +142,15 @@ void LogCompressor::run()
dataLines = finalTimes.length();
emit logProcessingStatusChanged(tr("Log compressor: Now processing %1 log lines").arg(finalTimes.length()));
// Fill in the values for all keys
file.reset();
QTextStream data(&file);
int linecounter = 0;
quint64 lastTimeIndex = 0;
bool failed = false;
while (!data.atEnd())
{
while (!data.atEnd()) {
linecounter++;
currentDataLine = linecounter;
QString line = data.readLine();
......@@ -168,12 +160,11 @@ void LogCompressor::run()
QString field = parts.at(2);
QString value = parts.at(3);
// Enforce NaN if no value is present
if (value.length() == 0 || value == "" || value == " " || value == "\t" || value == "\n")
{
if (value.length() == 0 || value == "" || value == " " || value == "\t" || value == "\n") {
value = "NaN";
}
// Get matching output line
// Constraining the search area might result in not finding a key,
// but it significantly reduces the time needed for the search
// setting a window of 1000 entries means that a 1 Hz data point
......@@ -185,29 +176,21 @@ void LogCompressor::run()
// Search the index until it is valid (!= -1)
// or the start of the list has been reached (failed)
while (index == -1 && !failed)
{
if (lastTimeIndex > offsetLimit)
{
while (index == -1 && !failed) {
if (lastTimeIndex > offsetLimit) {
offset = lastTimeIndex - offsetLimit;
}
else
{
} else {
offset = 0;
}
index = finalTimes.indexOf(time, offset);
if (index == -1)
{
if (offset == 0)
{
if (index == -1) {
if (offset == 0) {
emit logProcessingStatusChanged(tr("Log compressor: Timestamp %1 not found in dataset, ignoring log line %2").arg(time).arg(linecounter));
qDebug() << "Completely failed finding value";
//continue;
failed = true;
}
else
{
} else {
emit logProcessingStatusChanged(tr("Log compressor: Timestamp %1 not found in dataset, restarting search.").arg(time));
offsetLimit*=2;
}
......@@ -215,9 +198,8 @@ void LogCompressor::run()
}
if (dataLines > 100) if (index % (dataLines/100) == 0) emit logProcessingStatusChanged(tr("Log compressor: Processed %1% of %2 lines").arg(index/(float)dataLines*100, 0, 'f', 2).arg(dataLines));
if (!failed)
{
if (!failed) {
// When the algorithm reaches here the correct index was found
lastTimeIndex = index;
QString outLine = outLines->at(index);
......@@ -228,13 +210,12 @@ void LogCompressor::run()
outLines->replace(index, outLine);
}
}
// Add header, write out file
file.close();
if (outFileName == logFileName)
{
if (outFileName == logFileName) {
QFile::remove(file.fileName());
outfile.setFileName(file.fileName());
......@@ -244,15 +225,14 @@ void LogCompressor::run()
outfile.write(QString(QString("unix_timestamp") + separator + header.replace(" ", "_") + QString("\n")).toLatin1());
emit logProcessingStatusChanged(tr("Log Compressor: Writing output to file %1").arg(QFileInfo(outFileName).absoluteFilePath()));
//QString fileHeader = QString("unix_timestamp") + header.replace(" ", "_") + QString("\n");
// File output
for (int i = 0; i < outLines->length(); i++)
{
for (int i = 0; i < outLines->length(); i++) {
//qDebug() << outLines->at(i);
outfile.write(QString(outLines->at(i) + "\n").toLatin1());
}
currentDataLine = 0;
dataLines = 1;
delete keys;
......
This diff is collapsed.
......@@ -26,7 +26,8 @@ This file is part of the QGROUNDCONTROL project
#include <qmath.h>
#include <float.h>
namespace QGC {
namespace QGC
{
quint64 groundTimeUsecs()
{
......@@ -48,13 +49,11 @@ quint64 groundTimeMilliseconds()
float limitAngleToPMPIf(float angle)
{
while (angle > ((float)M_PI+FLT_EPSILON))
{
while (angle > ((float)M_PI+FLT_EPSILON)) {
angle -= 2.0f * (float)M_PI;
}
while (angle <= -((float)M_PI+FLT_EPSILON))
{
while (angle <= -((float)M_PI+FLT_EPSILON)) {
angle += 2.0f * (float)M_PI;
}
......@@ -63,17 +62,12 @@ float limitAngleToPMPIf(float angle)
double limitAngleToPMPId(double angle)
{
if (angle < -M_PI)
{
while (angle < -M_PI)
{
if (angle < -M_PI) {
while (angle < -M_PI) {
angle += M_PI;
}
}
else if (angle > M_PI)
{
while (angle > M_PI)
{
} else if (angle > M_PI) {
while (angle > M_PI) {
angle -= M_PI;
}
}
......
......@@ -9,58 +9,55 @@
namespace QGC
{
const static int defaultSystemId = 255;
const static int defaultComponentId = 0;
const static int defaultSystemId = 255;
const static int defaultComponentId = 0;
const QColor colorCyan(55, 154, 195);
const QColor colorRed(154, 20, 20);
const QColor colorGreen(20, 200, 20);
const QColor colorYellow(255, 255, 0);
const QColor colorOrange(255, 140, 0);
const QColor colorDarkYellow(180, 180, 0);
const QColor colorBackground("#050508");
const QColor colorBlack(0, 0, 0);
const QColor colorCyan(55, 154, 195);
const QColor colorRed(154, 20, 20);
const QColor colorGreen(20, 200, 20);
const QColor colorYellow(255, 255, 0);
const QColor colorOrange(255, 140, 0);
const QColor colorDarkYellow(180, 180, 0);
const QColor colorBackground("#050508");
const QColor colorBlack(0, 0, 0);
/** @brief Get the current ground time in microseconds */
quint64 groundTimeUsecs();
/** @brief Get the current ground time in milliseconds */
quint64 groundTimeMilliseconds();
/** @brief Returns the angle limited to -pi - pi */
float limitAngleToPMPIf(float angle);
/** @brief Returns the angle limited to -pi - pi */
double limitAngleToPMPId(double angle);
int applicationVersion();
/** @brief Get the current ground time in microseconds */
quint64 groundTimeUsecs();
/** @brief Get the current ground time in milliseconds */
quint64 groundTimeMilliseconds();
/** @brief Returns the angle limited to -pi - pi */
float limitAngleToPMPIf(float angle);
/** @brief Returns the angle limited to -pi - pi */
double limitAngleToPMPId(double angle);
int applicationVersion();
const static int MAX_FLIGHT_TIME = 60 * 60 * 24 * 21;
const static int MAX_FLIGHT_TIME = 60 * 60 * 24 * 21;
class SLEEP : public QThread
{
public:
/**
* @brief Set a thread to sleep for seconds
* @param s time in seconds to sleep
**/
static void sleep(unsigned long s)
{
QThread::sleep(s);
}
/**
* @brief Set a thread to sleep for milliseconds
* @param ms time in milliseconds to sleep
**/
static void msleep(unsigned long ms)
{
QThread::msleep(ms);
}
/**
* @brief Set a thread to sleep for microseconds
* @param us time in microseconds to sleep
**/
static void usleep(unsigned long us)
{
QThread::usleep(us);
}
};
class SLEEP : public QThread
{
public:
/**
* @brief Set a thread to sleep for seconds
* @param s time in seconds to sleep
**/
static void sleep(unsigned long s) {
QThread::sleep(s);
}
/**
* @brief Set a thread to sleep for milliseconds
* @param ms time in milliseconds to sleep
**/
static void msleep(unsigned long ms) {
QThread::msleep(ms);
}
/**
* @brief Set a thread to sleep for microseconds
* @param us time in microseconds to sleep
**/
static void usleep(unsigned long us) {
QThread::usleep(us);
}
};
}
......
......@@ -35,20 +35,20 @@ This file is part of the QGROUNDCONTROL project
#include "Waypoint.h"
Waypoint::Waypoint(quint16 _id, double _x, double _y, double _z, double _param1, double _param2, double _param3, double _param4,
bool _autocontinue, bool _current, MAV_FRAME _frame, MAV_CMD _action)
bool _autocontinue, bool _current, MAV_FRAME _frame, MAV_CMD _action)
: id(_id),
x(_x),
y(_y),
z(_z),
yaw(_param4),
frame(_frame),
action(_action),
autocontinue(_autocontinue),
current(_current),
orbit(_param3),
param1(_param1),
param2(_param2),
name(QString("WP%1").arg(id, 2, 10, QChar('0')))
x(_x),
y(_y),
z(_z),
yaw(_param4),
frame(_frame),
action(_action),
autocontinue(_autocontinue),
current(_current),
orbit(_param3),
param1(_param1),
param2(_param2),
name(QString("WP%1").arg(id, 2, 10, QChar('0')))
{
}
......@@ -78,8 +78,7 @@ void Waypoint::save(QTextStream &saveStream)
bool Waypoint::load(QTextStream &loadStream)
{
const QStringList &wpParams = loadStream.readLine().split("\t");
if (wpParams.size() == 12)
{
if (wpParams.size() == 12) {
this->id = wpParams[0].toInt();
this->current = (wpParams[1].toInt() == 1 ? true : false);
this->frame = (MAV_FRAME) wpParams[2].toInt();
......@@ -107,8 +106,7 @@ void Waypoint::setId(quint16 id)
void Waypoint::setX(double x)
{
if (this->x != x)
{
if (this->x != x) {
this->x = x;
emit changed(this);
}
......@@ -116,8 +114,7 @@ void Waypoint::setX(double x)
void Waypoint::setY(double y)
{
if (this->y != y)
{
if (this->y != y) {
this->y = y;
emit changed(this);
}
......@@ -125,8 +122,7 @@ void Waypoint::setY(double y)
void Waypoint::setZ(double z)
{
if (this->z != z)
{
if (this->z != z) {
this->z = z;
emit changed(this);
}
......@@ -134,8 +130,7 @@ void Waypoint::setZ(double z)
void Waypoint::setLatitude(double lat)
{
if (this->x != lat)
{
if (this->x != lat) {
this->x = lat;
this->frame = MAV_FRAME_GLOBAL;
emit changed(this);
......@@ -144,8 +139,7 @@ void Waypoint::setLatitude(double lat)
void Waypoint::setLongitude(double lon)
{
if (this->y != lon)
{
if (this->y != lon) {
this->y = lon;
this->frame = MAV_FRAME_GLOBAL;
emit changed(this);
......@@ -154,8 +148,7 @@ void Waypoint::setLongitude(double lon)
void Waypoint::setAltitude(double altitude)
{
if (this->z != altitude)
{
if (this->z != altitude) {
this->z = altitude;
this->frame = MAV_FRAME_GLOBAL;
emit changed(this);
......@@ -164,8 +157,7 @@ void Waypoint::setAltitude(double altitude)
void Waypoint::setYaw(int yaw)
{
if (this->yaw != yaw)
{
if (this->yaw != yaw) {
this->yaw = yaw;
emit changed(this);
}
......@@ -173,8 +165,7 @@ void Waypoint::setYaw(int yaw)
void Waypoint::setYaw(double yaw)
{
if (this->yaw != yaw)
{
if (this->yaw != yaw) {
this->yaw = yaw;
emit changed(this);
}
......@@ -182,8 +173,7 @@ void Waypoint::setYaw(double yaw)
void Waypoint::setAction(int action)
{
if (this->action != (MAV_CMD)action)
{
if (this->action != (MAV_CMD)action) {
this->action = (MAV_CMD)action;
emit changed(this);
}
......@@ -191,8 +181,7 @@ void Waypoint::setAction(int action)
void Waypoint::setAction(MAV_CMD action)
{
if (this->action != action)
{
if (this->action != action) {
this->action = action;
emit changed(this);
}
......@@ -200,8 +189,7 @@ void Waypoint::setAction(MAV_CMD action)
void Waypoint::setFrame(MAV_FRAME frame)
{
if (this->frame != frame)
{
if (this->frame != frame) {
this->frame = frame;
emit changed(this);
}
......@@ -209,8 +197,7 @@ void Waypoint::setFrame(MAV_FRAME frame)
void Waypoint::setAutocontinue(bool autoContinue)
{
if (this->autocontinue != autocontinue)
{
if (this->autocontinue != autocontinue) {
this->autocontinue = autoContinue;
emit changed(this);
}
......@@ -218,8 +205,7 @@ void Waypoint::setAutocontinue(bool autoContinue)
void Waypoint::setCurrent(bool current)
{
if (this->current != current)
{
if (this->current != current) {
this->current = current;
emit changed(this);
}
......@@ -227,8 +213,7 @@ void Waypoint::setCurrent(bool current)
void Waypoint::setAcceptanceRadius(double radius)
{
if (this->param2 != radius)
{
if (this->param2 != radius) {
this->param2 = radius;
emit changed(this);
}
......@@ -238,8 +223,7 @@ void Waypoint::setParam1(double param1)
{
qDebug() << "SENDER:" << QObject::sender();
qDebug() << "PARAM1 SET REQ:" << param1;
if (this->param1 != param1)
{
if (this->param1 != param1) {
this->param1 = param1;
emit changed(this);
}
......@@ -247,8 +231,7 @@ void Waypoint::setParam1(double param1)
void Waypoint::setParam2(double param2)
{
if (this->param2 != param2)
{
if (this->param2 != param2) {
this->param2 = param2;
emit changed(this);
}
......@@ -256,8 +239,7 @@ void Waypoint::setParam2(double param2)
void Waypoint::setParam3(double param3)
{
if (this->orbit != param3)
{
if (this->orbit != param3) {
this->orbit = param3;
emit changed(this);
}
......@@ -265,8 +247,7 @@ void Waypoint::setParam3(double param3)
void Waypoint::setParam4(double param4)
{
if (this->yaw != param4)
{
if (this->yaw != param4) {
this->yaw = param4;
emit changed(this);
}
......@@ -274,8 +255,7 @@ void Waypoint::setParam4(double param4)
void Waypoint::setParam5(double param5)
{
if (this->x != param5)
{
if (this->x != param5) {
this->x = param5;
emit changed(this);
}
......@@ -283,8 +263,7 @@ void Waypoint::setParam5(double param5)
void Waypoint::setParam6(double param6)
{
if (this->y != param6)
{
if (this->y != param6) {
this->y = param6;
emit changed(this);
}
......@@ -292,8 +271,7 @@ void Waypoint::setParam6(double param6)
void Waypoint::setParam7(double param7)
{
if (this->z != param7)
{
if (this->z != param7) {
this->z = param7;
emit changed(this);
}
......@@ -301,8 +279,7 @@ void Waypoint::setParam7(double param7)
void Waypoint::setLoiterOrbit(double orbit)
{
if (this->orbit != orbit)
{
if (this->orbit != orbit) {
this->orbit = orbit;
emit changed(this);
}
......@@ -310,8 +287,7 @@ void Waypoint::setLoiterOrbit(double orbit)
void Waypoint::setHoldTime(int holdTime)
{
if (this->param1 != holdTime)
{
if (this->param1 != holdTime) {
this->param1 = holdTime;
emit changed(this);
}
......@@ -319,8 +295,7 @@ void Waypoint::setHoldTime(int holdTime)
void Waypoint::setHoldTime(double holdTime)
{
if (this->param1 != holdTime)
{
if (this->param1 != holdTime) {
this->param1 = holdTime;
emit changed(this);
}
......@@ -328,8 +303,7 @@ void Waypoint::setHoldTime(double holdTime)
void Waypoint::setTurns(int turns)
{
if (this->param1 != turns)
{
if (this->param1 != turns) {
this->param1 = turns;
emit changed(this);
}
......
......@@ -47,30 +47,78 @@ public:
bool autocontinue = true, bool current = false, MAV_FRAME frame=MAV_FRAME_GLOBAL, MAV_CMD action=MAV_CMD_NAV_WAYPOINT);
~Waypoint();
quint16 getId() const { return id; }
double getX() const { return x; }
double getY() const { return y; }
double getZ() const { return z; }
double getLatitude() const { return x; }
double getLongitude() const { return y; }
double getAltitude() const { return z; }
double getYaw() const { return yaw; }
bool getAutoContinue() const { return autocontinue; }
bool getCurrent() const { return current; }
double getLoiterOrbit() const { return orbit; }
double getAcceptanceRadius() const { return param2; }
double getHoldTime() const { return param1; }
double getParam1() const { return param1; }
double getParam2() const { return param2; }
double getParam3() const { return orbit; }
double getParam4() const { return yaw; }
double getParam5() const { return x; }
double getParam6() const { return y; }
double getParam7() const { return z; }
int getTurns() const { return param1; }
MAV_FRAME getFrame() const { return frame; }
MAV_CMD getAction() const { return action; }
const QString& getName() const { return name; }
quint16 getId() const {
return id;
}
double getX() const {
return x;
}
double getY() const {
return y;
}
double getZ() const {
return z;
}
double getLatitude() const {
return x;
}
double getLongitude() const {
return y;
}
double getAltitude() const {
return z;
}
double getYaw() const {
return yaw;
}
bool getAutoContinue() const {
return autocontinue;
}
bool getCurrent() const {
return current;
}
double getLoiterOrbit() const {
return orbit;
}
double getAcceptanceRadius() const {
return param2;
}
double getHoldTime() const {
return param1;
}
double getParam1() const {
return param1;
}
double getParam2() const {
return param2;
}
double getParam3() const {
return orbit;
}
double getParam4() const {
return yaw;
}
double getParam5() const {
return x;
}
double getParam6() const {
return y;
}
double getParam7() const {
return z;
}
int getTurns() const {
return param1;
}
MAV_FRAME getFrame() const {
return frame;
}
MAV_CMD getAction() const {
return action;
}
const QString& getName() const {
return name;
}
/** @brief Returns true if x, y, z contain reasonable navigation data */
bool isNavigationType();
......
......@@ -20,7 +20,7 @@ This file is part of the QGROUNDCONTROL project
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
/**
* @file
* @brief Brief Description
......@@ -54,26 +54,26 @@ AS4Protocol::AS4Protocol()
// heartbeatTimer = new QTimer(this);
// connect(heartbeatTimer, SIGNAL(timeout()), this, SLOT());
// heartbeatTimer->start(1000/heartbeatRate);
/*
// Start the node manager
configData = new FileLoader("nodeManager.conf");
handler = new MyHandler();
try
{
nodeManager = new NodeManager(configData, handler);
qDebug() << "SAE AS-4 NODE MANAGER constructed";
}
catch(char *exceptionString)
{
printf("%s", exceptionString);
printf("Terminating Program...\n");
}
catch(...)
{
printf("Node Manager Construction Failed. Terminating Program...\n");
}
*/
/*
// Start the node manager
configData = new FileLoader("nodeManager.conf");
handler = new MyHandler();
try
{
nodeManager = new NodeManager(configData, handler);
qDebug() << "SAE AS-4 NODE MANAGER constructed";
}
catch(char *exceptionString)
{
printf("%s", exceptionString);
printf("Terminating Program...\n");
}
catch(...)
{
printf("Node Manager Construction Failed. Terminating Program...\n");
}
*/
}
......@@ -86,8 +86,7 @@ AS4Protocol::~AS4Protocol()
void AS4Protocol::run()
{
forever
{
forever {
QGC::SLEEP::msleep(5000);
}
}
......@@ -126,8 +125,7 @@ void AS4Protocol::receiveBytes(LinkInterface* link)
// qDebug() << __FILE__ << __LINE__ << ": buffer size:" << maxlen << "bytes:" << bytesToRead;
//
for (int position = 0; position < bytesToRead; position++)
{
for (int position = 0; position < bytesToRead; position++) {
}
// receiveMutex.unlock();
......
/*=====================================================================
PIXHAWK Micro Air Vehicle Flying Robotics Toolkit
(c) 2009 PIXHAWK PROJECT <http://pixhawk.ethz.ch>
This file is part of the PIXHAWK project
PIXHAWK 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.
PIXHAWK 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 PIXHAWK. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
/**
* @file
* @brief Brief Description
......@@ -109,7 +109,8 @@ public:
* SAE AS-4 Nodemanager
*
**/
class AS4Protocol : public ProtocolInterface {
class AS4Protocol : public ProtocolInterface
{
Q_OBJECT
public:
......
......@@ -39,7 +39,8 @@ along with PIXHAWK. If not, see <http://www.gnu.org/licenses/>.
* with the groundstation application.
*
**/
class LinkInterface : public QThread {
class LinkInterface : public QThread
{
Q_OBJECT
public:
LinkInterface(QObject* parent = 0) : QThread(parent) {}
......@@ -232,21 +233,20 @@ signals:
void communicationError(const QString& linkname, const QString& error);
protected:
static int getNextLinkId()
{
static int getNextLinkId() {
static int nextId = 0;
return nextId++;
}
protected slots:
/**
* @brief Read a number of bytes from the interface.
*
* @param bytes The pointer to write the bytes to
* @param maxLength The maximum length which can be written
**/
virtual void readBytes() = 0;
/**
* @brief Read a number of bytes from the interface.
*
* @param bytes The pointer to write the bytes to
* @param maxLength The maximum length which can be written
**/
virtual void readBytes() = 0;
};
......
......@@ -20,7 +20,7 @@ This file is part of the QGROUNDCONTROL project
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
/**
* @file
* @brief Brief Description
......@@ -36,27 +36,28 @@ This file is part of the QGROUNDCONTROL project
#include <QDebug>
LinkManager* LinkManager::instance() {
static LinkManager* _instance = 0;
if(_instance == 0) {
_instance = new LinkManager();
/* Set the application as parent to ensure that this object
* will be destroyed when the main application exits */
_instance->setParent(qApp);
}
return _instance;
LinkManager* LinkManager::instance()
{
static LinkManager* _instance = 0;
if(_instance == 0) {
_instance = new LinkManager();
/* Set the application as parent to ensure that this object
* will be destroyed when the main application exits */
_instance->setParent(qApp);
}
return _instance;
}
/**
* @brief Private singleton constructor
*
*
* This class implements the singleton design pattern and has therefore only a private constructor.
**/
LinkManager::LinkManager()
{
links = QList<LinkInterface*>();
protocolLinks = QMap<ProtocolInterface*, LinkInterface*>();
links = QList<LinkInterface*>();
protocolLinks = QMap<ProtocolInterface*, LinkInterface*>();
}
LinkManager::~LinkManager()
......@@ -66,8 +67,7 @@ LinkManager::~LinkManager()
void LinkManager::add(LinkInterface* link)
{
if (!links.contains(link))
{
if (!links.contains(link)) {
if(!link) return;
connect(link, SIGNAL(destroyed(QObject*)), this, SLOT(removeLink(QObject*)));
links.append(link);
......@@ -85,8 +85,7 @@ void LinkManager::addProtocol(LinkInterface* link, ProtocolInterface* protocol)
// If protocol has not been added before (list length == 0)
// OR if link has not been added to protocol, add
if ((linkList.length() > 0 && !linkList.contains(link)) || linkList.length() == 0)
{
if ((linkList.length() > 0 && !linkList.contains(link)) || linkList.length() == 0) {
// Protocol is new, add
connect(link, SIGNAL(bytesReceived(LinkInterface*, QByteArray)), protocol, SLOT(receiveBytes(LinkInterface*, QByteArray)));
// Store the connection information in the protocol links map
......@@ -103,72 +102,65 @@ QList<LinkInterface*> LinkManager::getLinksForProtocol(ProtocolInterface* protoc
bool LinkManager::connectAll()
{
bool allConnected = true;
foreach (LinkInterface* link, links)
{
if(!link) {}
else if(!link->connect()) allConnected = false;
}
return allConnected;
bool allConnected = true;
foreach (LinkInterface* link, links) {
if(!link) {}
else if(!link->connect()) allConnected = false;
}
return allConnected;
}
bool LinkManager::disconnectAll()
{
bool allDisconnected = true;
foreach (LinkInterface* link, links)
{
//static int i=0;
if(!link){}
else if(!link->disconnect()) allDisconnected = false;
}
return allDisconnected;
bool allDisconnected = true;
foreach (LinkInterface* link, links) {
//static int i=0;
if(!link) {}
else if(!link->disconnect()) allDisconnected = false;
}
return allDisconnected;
}
bool LinkManager::connectLink(LinkInterface* link)
{
if(!link) return false;
return link->connect();
if(!link) return false;
return link->connect();
}
bool LinkManager::disconnectLink(LinkInterface* link)
{
if(!link) return false;
return link->disconnect();
if(!link) return false;
return link->disconnect();
}
void LinkManager::removeLink(QObject* link)
{
LinkInterface* linkInterface = dynamic_cast<LinkInterface*>(link);
if (linkInterface)
{
if (linkInterface) {
removeLink(linkInterface);
}
}
bool LinkManager::removeLink(LinkInterface* link)
{
if(link)
{
for (int i=0; i < QList<LinkInterface*>(links).size(); i++)
{
if(link==links.at(i))
{
links.removeAt(i); //remove from link list
}
if(link) {
for (int i=0; i < QList<LinkInterface*>(links).size(); i++) {
if(link==links.at(i)) {
links.removeAt(i); //remove from link list
}
// Remove link from protocol map
QList<ProtocolInterface* > protocols = protocolLinks.keys(link);
foreach (ProtocolInterface* proto, protocols)
{
protocolLinks.remove(proto, link);
}
return true;
}
return false;
// Remove link from protocol map
QList<ProtocolInterface* > protocols = protocolLinks.keys(link);
foreach (ProtocolInterface* proto, protocols) {
protocolLinks.remove(proto, link);
}
return true;
}
return false;
}
/**
......@@ -179,8 +171,7 @@ bool LinkManager::removeLink(LinkInterface* link)
*/
LinkInterface* LinkManager::getLinkForId(int id)
{
foreach (LinkInterface* link, links)
{
foreach (LinkInterface* link, links) {
if (link->getId() == id) return link;
}
return NULL;
......
/*=====================================================================
PIXHAWK Micro Air Vehicle Flying Robotics Toolkit
(c) 2009, 2010 PIXHAWK PROJECT <http://pixhawk.ethz.ch>
This file is part of the PIXHAWK project
PIXHAWK 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.
PIXHAWK 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 PIXHAWK. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
/**
* @file
* @brief Manage communication links
......@@ -63,7 +63,9 @@ public:
const QList<LinkInterface*> getLinks();
/** @brief Get a list of all protocols */
const QList<ProtocolInterface*> getProtocols() { return protocolLinks.uniqueKeys(); }
const QList<ProtocolInterface*> getProtocols() {
return protocolLinks.uniqueKeys();
}
public slots:
......
This diff is collapsed.
......@@ -49,7 +49,8 @@ This file is part of the QGROUNDCONTROL project
* for more information, please see the official website.
* @ref http://pixhawk.ethz.ch/software/mavlink/
**/
class MAVLinkProtocol : public ProtocolInterface {
class MAVLinkProtocol : public ProtocolInterface
{
Q_OBJECT
public:
......@@ -66,31 +67,55 @@ public:
/** @brief The auto heartbeat emission rate in Hertz */
int getHeartbeatRate();
/** @brief Get heartbeat state */
bool heartbeatsEnabled() const { return m_heartbeatsEnabled; }
bool heartbeatsEnabled() const {
return m_heartbeatsEnabled;
}
/** @brief Get logging state */
bool loggingEnabled() const { return m_loggingEnabled; }
bool loggingEnabled() const {
return m_loggingEnabled;
}
/** @brief Get protocol version check state */
bool versionCheckEnabled() const { return m_enable_version_check; }
bool versionCheckEnabled() const {
return m_enable_version_check;
}
/** @brief Get the multiplexing state */
bool multiplexingEnabled() const { return m_multiplexingEnabled; }
bool multiplexingEnabled() const {
return m_multiplexingEnabled;
}
/** @brief Get the authentication state */
bool getAuthEnabled() { return m_authEnabled; }
bool getAuthEnabled() {
return m_authEnabled;
}
/** @brief Get the protocol version */
int getVersion() { return MAVLINK_VERSION; }
int getVersion() {
return MAVLINK_VERSION;
}
/** @brief Get the auth key */
QString getAuthKey() { return m_authKey; }
QString getAuthKey() {
return m_authKey;
}
/** @brief Get the name of the packet log file */
QString getLogfileName();
/** @brief Get state of parameter retransmission */
bool paramGuardEnabled() { return m_paramGuardEnabled; }
bool paramGuardEnabled() {
return m_paramGuardEnabled;
}
/** @brief Get parameter read timeout */
int getParamRetransmissionTimeout() { return m_paramRetransmissionTimeout; }
int getParamRetransmissionTimeout() {
return m_paramRetransmissionTimeout;
}
/** @brief Get parameter write timeout */
int getParamRewriteTimeout() { return m_paramRewriteTimeout; }
int getParamRewriteTimeout() {
return m_paramRewriteTimeout;
}
/** @brief Get state of action retransmission */
bool actionGuardEnabled() { return m_actionGuardEnabled; }
bool actionGuardEnabled() {
return m_actionGuardEnabled;
}
/** @brief Get parameter read timeout */
int getActionRetransmissionTimeout() { return m_actionRetransmissionTimeout; }
int getActionRetransmissionTimeout() {
return m_actionRetransmissionTimeout;
}
public slots:
/** @brief Receive bytes from a communication interface */
......@@ -138,7 +163,9 @@ public slots:
void enableAuth(bool enable);
/** @brief Set authentication token */
void setAuthKey(QString key) { m_authKey = key;}
void setAuthKey(QString key) {
m_authKey = key;
}
/** @brief Send an extra heartbeat to all connected units */
void sendHeartbeat();
......
This diff is collapsed.
......@@ -5,37 +5,37 @@
#include "MAVLinkSimulationMAV.h"
MAVLinkSimulationMAV::MAVLinkSimulationMAV(MAVLinkSimulationLink *parent, int systemid, double lat, double lon, int version) :
QObject(parent),
link(parent),
planner(parent, systemid),
systemid(systemid),
timer25Hz(0),
timer10Hz(0),
timer1Hz(0),
latitude(lat),
longitude(lon),
altitude(0.0),
x(lat),
y(lon),
z(550),
roll(0.0),
pitch(0.0),
yaw(0.0),
globalNavigation(true),
firstWP(false),
previousSPX(8.548056),
previousSPY(47.376389),
previousSPZ(550),
previousSPYaw(0.0),
nextSPX(8.548056),
nextSPY(47.376389),
nextSPZ(550),
nextSPYaw(0.0),
sys_mode(MAV_MODE_READY),
sys_state(MAV_STATE_STANDBY),
nav_mode(MAV_NAV_GROUNDED),
flying(false),
mavlink_version(version)
QObject(parent),
link(parent),
planner(parent, systemid),
systemid(systemid),
timer25Hz(0),
timer10Hz(0),
timer1Hz(0),
latitude(lat),
longitude(lon),
altitude(0.0),
x(lat),
y(lon),
z(550),
roll(0.0),
pitch(0.0),
yaw(0.0),
globalNavigation(true),
firstWP(false),
previousSPX(8.548056),
previousSPY(47.376389),
previousSPZ(550),
previousSPYaw(0.0),
nextSPX(8.548056),
nextSPY(47.376389),
nextSPZ(550),
nextSPYaw(0.0),
sys_mode(MAV_MODE_READY),
sys_state(MAV_STATE_STANDBY),
nav_mode(MAV_NAV_GROUNDED),
flying(false),
mavlink_version(version)
{
// Please note: The waypoint planner is running
connect(&mainloopTimer, SIGNAL(timeout()), this, SLOT(mainloop()));
......@@ -52,16 +52,14 @@ void MAVLinkSimulationMAV::mainloop()
// double xNew = // (nextSPX - previousSPX)
if (flying)
{
if (flying) {
sys_state = MAV_STATE_ACTIVE;
sys_mode = MAV_MODE_AUTO;
nav_mode = MAV_NAV_WAYPOINT;
}
// 1 Hz execution
if (timer1Hz <= 0)
{
if (timer1Hz <= 0) {
mavlink_message_t msg;
mavlink_msg_heartbeat_pack_version_free(systemid, MAV_COMP_ID_IMU, &msg, MAV_FIXED_WING, MAV_AUTOPILOT_PIXHAWK, mavlink_version);
link->sendMAVLinkMessage(&msg);
......@@ -83,8 +81,7 @@ void MAVLinkSimulationMAV::mainloop()
}
// 10 Hz execution
if (timer10Hz <= 0)
{
if (timer10Hz <= 0) {
double radPer100ms = 0.00006;
double altPer100ms = 0.4;
double xm = (nextSPX - x);
......@@ -93,35 +90,28 @@ void MAVLinkSimulationMAV::mainloop()
float zsign = (zm < 0) ? -1.0f : 1.0f;
if (!firstWP)
{
if (!firstWP) {
//float trueyaw = atan2f(xm, ym);
float newYaw = atan2f(ym, xm);
if (fabs(yaw - newYaw) < 90)
{
if (fabs(yaw - newYaw) < 90) {
yaw = yaw*0.7 + 0.3*newYaw;
}
else
{
} else {
yaw = newYaw;
}
//qDebug() << "SIMULATION MAV: x:" << xm << "y:" << ym << "z:" << zm << "yaw:" << yaw;
//if (sqrt(xm*xm+ym*ym) > 0.0000001)
if (flying)
{
if (flying) {
x += cos(yaw)*radPer100ms;
y += sin(yaw)*radPer100ms;
z += altPer100ms*zsign;
}
//if (xm < 0.001) xm
}
else
{
} else {
x = nextSPX;
y = nextSPY;
z = nextSPZ;
......@@ -205,12 +195,11 @@ void MAVLinkSimulationMAV::mainloop()
}
// 25 Hz execution
if (timer25Hz <= 0)
{
if (timer25Hz <= 0) {
// The message container to be used for sending
mavlink_message_t ret;
#ifdef MAVLINK_ENABLED_PIXHAWK
#ifdef MAVLINK_ENABLED_PIXHAWK
// Send which controllers are active
mavlink_control_status_t control_status;
control_status.control_att = 1;
......@@ -223,7 +212,7 @@ void MAVLinkSimulationMAV::mainloop()
control_status.ahrs_health = 230;
mavlink_msg_control_status_encode(systemid, MAV_COMP_ID_IMU, &ret, &control_status);
link->sendMAVLinkMessage(&ret);
#endif //MAVLINK_ENABLED_PIXHAWK
#endif //MAVLINK_ENABLED_PIXHAWK
// Send actual controller outputs
// This message just shows the direction
......@@ -301,70 +290,62 @@ void MAVLinkSimulationMAV::handleMessage(const mavlink_message_t& msg)
{
//qDebug() << "MAV:" << systemid << "RECEIVED MESSAGE FROM" << msg.sysid << "COMP" << msg.compid;
switch(msg.msgid)
{
switch(msg.msgid) {
case MAVLINK_MSG_ID_ATTITUDE:
break;
case MAVLINK_MSG_ID_SET_MODE:
{
mavlink_set_mode_t mode;
mavlink_msg_set_mode_decode(&msg, &mode);
if (systemid == mode.target) sys_mode = mode.mode;
}
break;
case MAVLINK_MSG_ID_ACTION:
{
mavlink_action_t action;
mavlink_msg_action_decode(&msg, &action);
if (systemid == action.target && (action.target_component == 0 || action.target_component == MAV_COMP_ID_IMU))
{
mavlink_action_ack_t ack;
ack.action = action.action;
switch (action.action)
{
case MAV_ACTION_TAKEOFF:
flying = true;
nav_mode = MAV_NAV_LIFTOFF;
ack.result = 1;
break;
default:
{
ack.result = 0;
}
break;
}
// Give feedback about action
mavlink_message_t r_msg;
mavlink_msg_action_ack_encode(systemid, MAV_COMP_ID_IMU, &r_msg, &ack);
link->sendMAVLinkMessage(&r_msg);
case MAVLINK_MSG_ID_SET_MODE: {
mavlink_set_mode_t mode;
mavlink_msg_set_mode_decode(&msg, &mode);
if (systemid == mode.target) sys_mode = mode.mode;
}
break;
case MAVLINK_MSG_ID_ACTION: {
mavlink_action_t action;
mavlink_msg_action_decode(&msg, &action);
if (systemid == action.target && (action.target_component == 0 || action.target_component == MAV_COMP_ID_IMU)) {
mavlink_action_ack_t ack;
ack.action = action.action;
switch (action.action) {
case MAV_ACTION_TAKEOFF:
flying = true;
nav_mode = MAV_NAV_LIFTOFF;
ack.result = 1;
break;
default: {
ack.result = 0;
}
}
break;
case MAVLINK_MSG_ID_LOCAL_POSITION_SETPOINT_SET:
{
mavlink_local_position_setpoint_set_t sp;
mavlink_msg_local_position_setpoint_set_decode(&msg, &sp);
if (sp.target_system == this->systemid)
{
nav_mode = MAV_NAV_WAYPOINT;
previousSPX = nextSPX;
previousSPY = nextSPY;
previousSPZ = nextSPZ;
nextSPX = sp.x;
nextSPY = sp.y;
nextSPZ = sp.z;
// Rotary wing
//nextSPYaw = sp.yaw;
// Airplane
//yaw = atan2(previousSPX-nextSPX, previousSPY-nextSPY);
//if (!firstWP) firstWP = true;
break;
}
//qDebug() << "UPDATED SP:" << "X" << nextSPX << "Y" << nextSPY << "Z" << nextSPZ;
// Give feedback about action
mavlink_message_t r_msg;
mavlink_msg_action_ack_encode(systemid, MAV_COMP_ID_IMU, &r_msg, &ack);
link->sendMAVLinkMessage(&r_msg);
}
break;
}
break;
case MAVLINK_MSG_ID_LOCAL_POSITION_SETPOINT_SET: {
mavlink_local_position_setpoint_set_t sp;
mavlink_msg_local_position_setpoint_set_decode(&msg, &sp);
if (sp.target_system == this->systemid) {
nav_mode = MAV_NAV_WAYPOINT;
previousSPX = nextSPX;
previousSPY = nextSPY;
previousSPZ = nextSPZ;
nextSPX = sp.x;
nextSPY = sp.y;
nextSPZ = sp.z;
// Rotary wing
//nextSPYaw = sp.yaw;
// Airplane
//yaw = atan2(previousSPX-nextSPX, previousSPY-nextSPY);
//if (!firstWP) firstWP = true;
}
//qDebug() << "UPDATED SP:" << "X" << nextSPX << "Y" << nextSPY << "Z" << nextSPZ;
}
break;
}
}
......@@ -55,16 +55,15 @@ protected:
bool flying;
int mavlink_version;
static inline uint16_t mavlink_msg_heartbeat_pack_version_free(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, uint8_t type, uint8_t autopilot, uint8_t version)
{
uint16_t i = 0;
msg->msgid = MAVLINK_MSG_ID_HEARTBEAT;
static inline uint16_t mavlink_msg_heartbeat_pack_version_free(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, uint8_t type, uint8_t autopilot, uint8_t version) {
uint16_t i = 0;
msg->msgid = MAVLINK_MSG_ID_HEARTBEAT;
i += put_uint8_t_by_index(type, i, msg->payload); // Type of the MAV (quadrotor, helicopter, etc., up to 15 types, defined in MAV_TYPE ENUM)
i += put_uint8_t_by_index(autopilot, i, msg->payload); // Type of the Autopilot: 0: Generic, 1: PIXHAWK, 2: SLUGS, 3: Ardupilot (up to 15 types), defined in MAV_AUTOPILOT_TYPE ENUM
i += put_uint8_t_by_index(version, i, msg->payload); // MAVLink version
i += put_uint8_t_by_index(type, i, msg->payload); // Type of the MAV (quadrotor, helicopter, etc., up to 15 types, defined in MAV_TYPE ENUM)
i += put_uint8_t_by_index(autopilot, i, msg->payload); // Type of the Autopilot: 0: Generic, 1: PIXHAWK, 2: SLUGS, 3: Ardupilot (up to 15 types), defined in MAV_AUTOPILOT_TYPE ENUM
i += put_uint8_t_by_index(version, i, msg->payload); // MAVLink version
return mavlink_finalize_message(msg, system_id, component_id, i);
return mavlink_finalize_message(msg, system_id, component_id, i);
}
};
......
......@@ -7,8 +7,7 @@
#include "MAVLinkSimulationLink.h"
#include "QGCMAVLink.h"
enum PX_WAYPOINTPLANNER_STATES
{
enum PX_WAYPOINTPLANNER_STATES {
PX_WPP_IDLE = 0,
PX_WPP_SENDLIST,
PX_WPP_SENDLIST_SENDWPS,
......
......@@ -30,17 +30,17 @@ MAVLinkSyntaxHighlighter::MAVLinkSyntaxHighlighter(QObject *parent) :
void MAVLinkSyntaxHighlighter::highlightBlock(const QString &text)
{
QTextCharFormat myClassFormat;
myClassFormat.setFontWeight(QFont::Bold);
myClassFormat.setForeground(Qt::darkMagenta);
QString pattern = "\"[A-Za-z0-9]+\"";
QRegExp expression(pattern);
int index = text.indexOf(expression);
while (index >= 0) {
int length = expression.matchedLength();
setFormat(index, length, myClassFormat);
index = text.indexOf(expression, index + length);
}
}
{
QTextCharFormat myClassFormat;
myClassFormat.setFontWeight(QFont::Bold);
myClassFormat.setForeground(Qt::darkMagenta);
QString pattern = "\"[A-Za-z0-9]+\"";
QRegExp expression(pattern);
int index = text.indexOf(expression);
while (index >= 0) {
int length = expression.matchedLength();
setFormat(index, length, myClassFormat);
index = text.indexOf(expression, index + length);
}
}
......@@ -5,7 +5,7 @@
class MAVLinkSyntaxHighlighter : public QSyntaxHighlighter
{
Q_OBJECT
Q_OBJECT
public:
explicit MAVLinkSyntaxHighlighter(QObject *parent = 0);
......
This diff is collapsed.
This diff is collapsed.
......@@ -96,7 +96,9 @@ public:
void run();
int getOpalInstID() {return static_cast<int>(opalInstID);}
int getOpalInstID() {
return static_cast<int>(opalInstID);
}
public slots:
......@@ -108,7 +110,9 @@ public slots:
void getSignals();
void setOpalInstID(int instID) {opalInstID = static_cast<unsigned short>(instID);}
void setOpalInstID(int instID) {
opalInstID = static_cast<unsigned short>(instID);
}
protected slots:
......
......@@ -2,25 +2,25 @@
namespace OpalRT
{
// lastErrorMsg = QString();
void OpalErrorMsg::displayLastErrorMsg()
{
static QString lastErrorMsg;
setLastErrorMsg();
QMessageBox msgBox;
msgBox.setIcon(QMessageBox::Critical);
msgBox.setText(lastErrorMsg);
msgBox.exec();
}
// lastErrorMsg = QString();
void OpalErrorMsg::displayLastErrorMsg()
{
static QString lastErrorMsg;
setLastErrorMsg();
QMessageBox msgBox;
msgBox.setIcon(QMessageBox::Critical);
msgBox.setText(lastErrorMsg);
msgBox.exec();
}
void OpalErrorMsg::setLastErrorMsg()
{
char* buf = new char[512];
unsigned short len;
static QString lastErrorMsg;
OpalGetLastErrMsg(buf, sizeof(buf), &len);
lastErrorMsg.clear();
lastErrorMsg.append(buf);
delete buf;
}
void OpalErrorMsg::setLastErrorMsg()
{
char* buf = new char[512];
unsigned short len;
static QString lastErrorMsg;
OpalGetLastErrMsg(buf, sizeof(buf), &len);
lastErrorMsg.clear();
lastErrorMsg.append(buf);
delete buf;
}
}
This diff is collapsed.
......@@ -41,17 +41,17 @@ using namespace OpalRT;
//}
Parameter::Parameter(QString simulinkPath, QString simulinkName, uint8_t componentID,
QGCParamID paramID, unsigned short opalID)
: simulinkPath(new QString(simulinkPath)),
simulinkName(new QString(simulinkName)),
componentID(componentID),
paramID(new QGCParamID(paramID)),
opalID(opalID)
: simulinkPath(new QString(simulinkPath)),
simulinkName(new QString(simulinkName)),
componentID(componentID),
paramID(new QGCParamID(paramID)),
opalID(opalID)
{
}
Parameter::Parameter(const Parameter &other)
: componentID(other.componentID),
opalID(other.opalID)
opalID(other.opalID)
{
simulinkPath = new QString(*other.simulinkPath);
simulinkName = new QString(*other.simulinkName);
......@@ -68,11 +68,11 @@ Parameter::~Parameter()
bool Parameter::operator ==(const Parameter& other) const
{
return
(*simulinkPath) == *(other.simulinkPath)
&& *simulinkName == *(other.simulinkName)
&& componentID == other.componentID
&& *paramID == *(other.paramID)
&& opalID == other.opalID;
(*simulinkPath) == *(other.simulinkPath)
&& *simulinkName == *(other.simulinkName)
&& componentID == other.componentID
&& *paramID == *(other.paramID)
&& opalID == other.opalID;
}
......@@ -87,8 +87,7 @@ float Parameter::getValue()
int returnVal = OpalGetParameters(allocatedParams, &numParams, &opalID,
numValues, &returnedNumValues, &value);
if (returnVal != EOK)
{
if (returnVal != EOK) {
OpalRT::OpalErrorMsg::displayLastErrorMsg();
return FLT_MAX;
}
......@@ -106,8 +105,7 @@ void Parameter::setValue(float val)
int returnVal = OpalSetParameters(allocatedParams, &numParams, &opalID,
numValues, &returnedNumValues, &value);
if (returnVal != EOK)
{
if (returnVal != EOK) {
//qDebug() << __FILE__ << ":" << __LINE__ << ": Error numer: " << QString::number(returnVal);
OpalErrorMsg::displayLastErrorMsg();
}
......@@ -116,5 +114,5 @@ void Parameter::setValue(float val)
Parameter::operator QString() const
{
return *simulinkPath + *simulinkName + " " + QString::number(componentID)
+ " " + *paramID + " " + QString::number(opalID);
+ " " + *paramID + " " + QString::number(opalID);
}
......@@ -43,40 +43,50 @@ This file is part of the QGROUNDCONTROL project
namespace OpalRT
{
class Parameter
{
public:
class Parameter
{
public:
// Parameter(char *simulinkPath = "",
// char *simulinkName = "",
// uint8_t componentID = 0,
// QGCParamID paramID = QGCParamID(),
// unsigned short opalID = 0);
Parameter(QString simulinkPath = QString(),
QString simulinkName = QString(),
uint8_t componentID = 0,
QGCParamID paramID = QGCParamID(),
unsigned short opalID = 0);
Parameter(const Parameter& other);
~Parameter();
const QGCParamID& getParamID() const {return *paramID;}
void setOpalID(unsigned short opalID) {this->opalID = opalID;}
const QString& getSimulinkPath() const {return *simulinkPath;}
const QString& getSimulinkName() const {return *simulinkName;}
uint8_t getComponentID() const {return componentID;}
float getValue();
void setValue(float value);
bool operator==(const Parameter& other) const;
operator QString() const;
protected:
QString *simulinkPath;
QString *simulinkName;
uint8_t componentID;
QGCParamID *paramID;
unsigned short opalID;
};
Parameter(QString simulinkPath = QString(),
QString simulinkName = QString(),
uint8_t componentID = 0,
QGCParamID paramID = QGCParamID(),
unsigned short opalID = 0);
Parameter(const Parameter& other);
~Parameter();
const QGCParamID& getParamID() const {
return *paramID;
}
void setOpalID(unsigned short opalID) {
this->opalID = opalID;
}
const QString& getSimulinkPath() const {
return *simulinkPath;
}
const QString& getSimulinkName() const {
return *simulinkName;
}
uint8_t getComponentID() const {
return componentID;
}
float getValue();
void setValue(float value);
bool operator==(const Parameter& other) const;
operator QString() const;
protected:
QString *simulinkPath;
QString *simulinkName;
uint8_t componentID;
QGCParamID *paramID;
unsigned short opalID;
};
}
#endif // PARAMETER_H
This diff is collapsed.
This diff is collapsed.
......@@ -42,9 +42,9 @@ This file is part of the PIXHAWK project
*
* This class defines the interface for
* communication packets transported by the LinkManager.
*
*
* @see LinkManager.
*
*
**/
class ProtocolInterface : public QThread
{
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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