diff --git a/qgroundcontrol.pro b/qgroundcontrol.pro index 6d60e122171fefcbd1310f2e7fcc876aa36f2228..13b3284f67e48601b731247d7fb4ab90cce1eebf 100644 --- a/qgroundcontrol.pro +++ b/qgroundcontrol.pro @@ -206,11 +206,6 @@ FORMS += \ src/ui/MainWindow.ui \ src/QGCQmlWidgetHolder.ui \ -!iOSBuild { -FORMS += \ - src/ui/SerialSettings.ui \ -} - !MobileBuild { FORMS += \ src/ui/uas/QGCUnconnectedInfoWidget.ui \ @@ -309,7 +304,6 @@ contains(DEFINES, QGC_ENABLE_BLUETOOTH) { HEADERS += \ src/comm/QGCSerialPortInfo.h \ src/comm/SerialLink.h \ - src/ui/SerialConfigurationWindow.h \ } !MobileBuild { @@ -420,7 +414,6 @@ SOURCES += \ SOURCES += \ src/comm/QGCSerialPortInfo.cc \ src/comm/SerialLink.cc \ - src/ui/SerialConfigurationWindow.cc \ } contains(DEFINES, QGC_ENABLE_BLUETOOTH) { diff --git a/src/QtLocationPlugin/qgeocodingmanagerengineqgc.cpp b/src/QtLocationPlugin/qgeocodingmanagerengineqgc.cpp index 4ed1b840b997bcfcfb81c278a7b2956d3966de0e..567c329902723841d6d0173329bb071a358d52cc 100644 --- a/src/QtLocationPlugin/qgeocodingmanagerengineqgc.cpp +++ b/src/QtLocationPlugin/qgeocodingmanagerengineqgc.cpp @@ -119,7 +119,7 @@ QGeoCodeReply *QGeoCodingManagerEngineQGC::geocode(const QString &address, int l url.setQuery(query); request.setUrl(url); - qDebug() << url; + //qDebug() << url; QNetworkReply *reply = m_networkManager->get(request); reply->setParent(0); @@ -150,7 +150,7 @@ QGeoCodeReply *QGeoCodingManagerEngineQGC::reverseGeocode(const QGeoCoordinate & url.setQuery(query); request.setUrl(url); - qDebug() << url; + //qDebug() << url; QNetworkReply *reply = m_networkManager->get(request); reply->setParent(0); diff --git a/src/VehicleSetup/FirmwareImage.cc b/src/VehicleSetup/FirmwareImage.cc index b782326ecbefb012d0d7c75ef2b495da17a76588..1beac431d64a2b4f4659245be01471a2f538c36a 100644 --- a/src/VehicleSetup/FirmwareImage.cc +++ b/src/VehicleSetup/FirmwareImage.cc @@ -271,7 +271,7 @@ bool FirmwareImage::_px4Load(const QString& imageFilename) QSettings settings; QDir airframeDir = QFileInfo(settings.fileName()).dir(); QString airframeFilename = airframeDir.filePath("PX4AirframeFactMetaData.xml"); - qDebug() << airframeFilename; + //qDebug() << airframeFilename; QFile airframeFile(airframeFilename); if (airframeFile.open(QIODevice::WriteOnly | QIODevice::Truncate)) { diff --git a/src/comm/TCPLink.cc b/src/comm/TCPLink.cc index 9b72c7d229887d2eec7d733fddcb570ebb774d02..19935e7b268e671cb256a8368fa0889f211392ce 100644 --- a/src/comm/TCPLink.cc +++ b/src/comm/TCPLink.cc @@ -46,7 +46,7 @@ TCPLink::TCPLink(TCPConfiguration *config) // We're doing it wrong - because the Qt folks got the API wrong: // http://blog.qt.digia.com/blog/2010/06/17/youre-doing-it-wrong/ moveToThread(this); - qDebug() << "TCP Created " << _config->name(); + //qDebug() << "TCP Created " << _config->name(); } TCPLink::~TCPLink() diff --git a/src/uas/UAS.cc b/src/uas/UAS.cc index a428d7bf98d00b4b6406745627b8b6d80eadd738..824e025dc1d758765286fd66c693186451df0549 100644 --- a/src/uas/UAS.cc +++ b/src/uas/UAS.cc @@ -2146,7 +2146,7 @@ void UAS::sendMapRCToParam(QString param_id, float scale, float value0, quint8 p valueMin, valueMax); _vehicle->sendMessage(message); - qDebug() << "Mavlink message sent"; + //qDebug() << "Mavlink message sent"; } void UAS::unsetRCToParameterMap() diff --git a/src/ui/QGCMAVLinkLogPlayer.cc b/src/ui/QGCMAVLinkLogPlayer.cc index b6a7bd48c63adf300f55627d162308375bae623a..8d39dce1cee5cc0663e94714bc6f9ca97d1334c8 100644 --- a/src/ui/QGCMAVLinkLogPlayer.cc +++ b/src/ui/QGCMAVLinkLogPlayer.cc @@ -161,7 +161,7 @@ void QGCMAVLinkLogPlayer::_enablePlaybackControls(bool enabled) void QGCMAVLinkLogPlayer::_setAccelerationFromSlider(int value) { - qDebug() << value; + //qDebug() << value; if (_replayLink) { _replayLink->setAccelerationFactor(value); } diff --git a/src/ui/SerialConfigurationWindow.cc b/src/ui/SerialConfigurationWindow.cc deleted file mode 100644 index e6e3e27fd56ede46b1d2462e3a7b8e0c6d3a802d..0000000000000000000000000000000000000000 --- a/src/ui/SerialConfigurationWindow.cc +++ /dev/null @@ -1,244 +0,0 @@ -/*===================================================================== - -QGroundControl Open Source Ground Control Station - -(c) 2009, 2010 QGROUNDCONTROL PROJECT - -This file is part of the QGROUNDCONTROL project - - QGROUNDCONTROL is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - QGROUNDCONTROL is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with QGROUNDCONTROL. If not, see . - -======================================================================*/ - -/** - * @file - * @brief Implementation of SerialConfigurationWindow - * @author Lorenz Meier - * - */ - -#include -#include -#include -#include - -#ifdef __android__ -#include "qserialportinfo.h" -#else -#include -#endif - -#include -#include - -#ifndef USE_ANCIENT_RATES -#define USE_ANCIENT_RATES 0 -#endif - -SerialConfigurationWindow::SerialConfigurationWindow(SerialConfiguration *config, QWidget *parent, Qt::WindowFlags flags) - : QWidget(parent, flags) -{ - _ui.setupUi(this); - Q_ASSERT(config != NULL); - _config = config; - - // Scan for serial ports. Let the user know if none were found for debugging purposes - if (!setupPortList()) { - qDebug() << "No serial ports found."; - } - - // Set up baud rates - _ui.baudRate->clear(); - - // Keep track of all desired baud rates by OS. These are iterated through - // later and added to _ui.baudRate. - QStringList supportedBaudRates = SerialConfiguration::supportedBaudRates(); - - // Now actually add all of our supported baud rates to the ui. - for (int i = 0; i < supportedBaudRates.size(); ++i) { - _ui.baudRate->addItem(supportedBaudRates.at(i), supportedBaudRates.at(i).toInt()); - } - - // Connect the individual user interface inputs - connect(_ui.portName, static_cast(&QComboBox::currentIndexChanged), - this, &SerialConfigurationWindow::setPortName); - connect(_ui.baudRate, static_cast(&QComboBox::activated), - this, &SerialConfigurationWindow::setBaudRate); - connect(_ui.dataBitsSpinBox, static_cast(&QSpinBox::valueChanged), - this, &SerialConfigurationWindow::setDataBits); - connect(_ui.stopBitsSpinBox, static_cast(&QSpinBox::valueChanged), - this, &SerialConfigurationWindow::setStopBits); - - connect(_ui.flowControlCheckBox,&QCheckBox::toggled, this, &SerialConfigurationWindow::enableFlowControl); - connect(_ui.parNone, &QRadioButton::toggled, this, &SerialConfigurationWindow::setParityNone); - connect(_ui.parOdd, &QRadioButton::toggled, this, &SerialConfigurationWindow::setParityOdd); - connect(_ui.parEven, &QRadioButton::toggled, this, &SerialConfigurationWindow::setParityEven); - connect(_ui.advCheckBox, &QCheckBox::clicked, _ui.advGroupBox, &QWidget::setVisible); - - _ui.advCheckBox->setCheckable(true); - _ui.advCheckBox->setChecked(false); - _ui.advGroupBox->setVisible(false); - - switch(_config->parity()) { - case QSerialPort::NoParity: - _ui.parNone->setChecked(true); - break; - case QSerialPort::OddParity: - _ui.parOdd->setChecked(true); - break; - case QSerialPort::EvenParity: - _ui.parEven->setChecked(true); - break; - default: - // Enforce default: no parity in link - setParityNone(true); - _ui.parNone->setChecked(true); - break; - } - - int idx = 0; - _ui.flowControlCheckBox->setChecked(_config->flowControl() == QSerialPort::HardwareControl); - idx = _ui.baudRate->findText(QString("%1").arg(_config->baud())); - if(idx < 0) idx = _ui.baudRate->findText("57600"); - if(idx < 0) idx = 0; - _ui.baudRate->setCurrentIndex(idx); - _ui.dataBitsSpinBox->setValue(_config->dataBits()); - _ui.stopBitsSpinBox->setValue(_config->stopBits()); - _portCheckTimer = new QTimer(this); - _portCheckTimer->setInterval(1000); - connect(_portCheckTimer, &QTimer::timeout, this, &SerialConfigurationWindow::setupPortList); - - // Display the widget - setWindowTitle(tr("Serial Communication Settings")); -} - -SerialConfigurationWindow::~SerialConfigurationWindow() -{ - -} - -void SerialConfigurationWindow::showEvent(QShowEvent* event) -{ - Q_UNUSED(event); - _portCheckTimer->start(); -} - -void SerialConfigurationWindow::hideEvent(QHideEvent* event) -{ - Q_UNUSED(event); - _portCheckTimer->stop(); -} - -bool SerialConfigurationWindow::setupPortList() -{ - bool changed = false; - // Iterate found ports - QList portList = QSerialPortInfo::availablePorts(); - foreach (const QSerialPortInfo &info, portList) - { - QString name = info.portName(); - // Append newly found port to the list - if (_ui.portName->findText(name) < 0) - { - // We show the user the "short name" but store the full port name - _ui.portName->addItem(name, QVariant(info.systemLocation())); - changed = true; - } - } - // See if configured port (if any) is present - if(changed) { - int idx = _ui.portName->count() - 1; - if(!_config->portName().isEmpty()) { - idx = _ui.portName->findData(QVariant(_config->portName())); - if(idx < 0) { - idx = 0; - } - } - _ui.portName->setCurrentIndex(idx); - if(_ui.portName->count() > 0) { - _ui.portName->setEditText(_ui.portName->itemText(idx)); - } - if(_config->portName().isEmpty()) { - setPortName(idx); - } - } - return (_ui.portName->count() > 0); -} - -void SerialConfigurationWindow::enableFlowControl(bool flow) -{ - _config->setFlowControl(flow ? QSerialPort::HardwareControl : QSerialPort::NoFlowControl); - //-- If this was dynamic, it's now edited and persistent - _config->setDynamic(false); -} - -void SerialConfigurationWindow::setParityNone(bool accept) -{ - if (accept) { - _config->setParity(QSerialPort::NoParity); - //-- If this was dynamic, it's now edited and persistent - _config->setDynamic(false); - } -} - -void SerialConfigurationWindow::setParityOdd(bool accept) -{ - if (accept) { - _config->setParity(QSerialPort::OddParity); - //-- If this was dynamic, it's now edited and persistent - _config->setDynamic(false); - } -} - -void SerialConfigurationWindow::setParityEven(bool accept) -{ - if (accept) { - _config->setParity(QSerialPort::EvenParity); - //-- If this was dynamic, it's now edited and persistent - _config->setDynamic(false); - } -} - -void SerialConfigurationWindow::setPortName(int index) -{ - // Get the full port name and store it in the config - QString pname = _ui.portName->itemData(index).toString(); - if (_config->portName() != pname) { - _config->setPortName(pname); - //-- If this was dynamic, it's now edited and persistent - _config->setDynamic(false); - } -} - -void SerialConfigurationWindow::setBaudRate(int index) -{ - int baud = _ui.baudRate->itemData(index).toInt(); - _config->setBaud(baud); - //-- If this was dynamic, it's now edited and persistent - _config->setDynamic(false); -} - -void SerialConfigurationWindow::setDataBits(int bits) -{ - _config->setDataBits(bits); - //-- If this was dynamic, it's now edited and persistent - _config->setDynamic(false); -} - -void SerialConfigurationWindow::setStopBits(int bits) -{ - _config->setStopBits(bits); - //-- If this was dynamic, it's now edited and persistent - _config->setDynamic(false); -} diff --git a/src/ui/SerialConfigurationWindow.h b/src/ui/SerialConfigurationWindow.h deleted file mode 100644 index ba21793c85ad15f28587efa6793469afaf8caf2e..0000000000000000000000000000000000000000 --- a/src/ui/SerialConfigurationWindow.h +++ /dev/null @@ -1,82 +0,0 @@ -/*===================================================================== - -QGroundControl Open Source Ground Control Station - -(c) 2009, 2010 QGROUNDCONTROL PROJECT - -This file is part of the QGROUNDCONTROL project - - QGROUNDCONTROL is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - QGROUNDCONTROL is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with QGROUNDCONTROL. If not, see . - -======================================================================*/ - -/** - * @file - * @brief Definition of configuration window for serial links - * - * @author Lorenz Meier - * - */ - -#ifndef _SERIALCONFIGURATIONWINDOW_H_ -#define _SERIALCONFIGURATIONWINDOW_H_ - -#include -#include -#include -#include -#include -#include "SerialLink.h" -#include "ui_SerialSettings.h" - -class SerialConfigurationWindow : public QWidget -{ - Q_OBJECT - -public: - SerialConfigurationWindow(SerialConfiguration* config, QWidget *parent = 0, Qt::WindowFlags flags = Qt::Sheet); - ~SerialConfigurationWindow(); - -public slots: - void enableFlowControl(bool flow); - void setParityNone(bool accept); - void setParityOdd(bool accept); - void setParityEven(bool accept); - void setPortName(int index); - void setBaudRate(int index); - void setDataBits(int bits); - void setStopBits(int bits); - - /** - * @brief setupPortList Populates the dropdown with the list of available serial ports. - * This function is called at 1s intervals to check that the serial port still exists and to see if - * any new ones have been attached. - * @return True if any ports were found, false otherwise. - */ - bool setupPortList(); - -protected: - void showEvent(QShowEvent* event); - void hideEvent(QHideEvent* event); - bool userConfigured; ///< Switch to detect if current values are user-selected and shouldn't be overriden - -private: - Ui::serialSettings _ui; - SerialConfiguration* _config; - QTimer* _portCheckTimer; - -}; - - -#endif // _SERIALCONFIGURATIONWINDOW_H_ diff --git a/src/ui/SerialSettings.ui b/src/ui/SerialSettings.ui deleted file mode 100644 index 4025803fa507841a68b43af39908f3ae1db95df7..0000000000000000000000000000000000000000 --- a/src/ui/SerialSettings.ui +++ /dev/null @@ -1,531 +0,0 @@ - - - serialSettings - - - - 0 - 0 - 325 - 347 - - - - Form - - - - - - - - Serial Port: - - - - - - - - 100 - 0 - - - - The serial port to which the system is connected. - - - The serial port to which the system is connected. - - - The serial port to which the system is connected. - - - false - - - 100 - - - QComboBox::AdjustToContents - - - - - - - - - - - - - - - - Baud Rate: - - - - - - - - 100 - 0 - - - - The data transmission rate. If unsure 57600 and 115200 are very common rates. - - - The data transmission rate. If unsure 57600 and 115200 are very common rates. - - - The data transmission rate. If unsure 57600 and 115200 are very common rates. - - - false - - - QComboBox::AdjustToContents - - - - 50 - - - - - 75 - - - - - 110 - - - - - 134 - - - - - 150 - - - - - 200 - - - - - 300 - - - - - 600 - - - - - 1200 - - - - - 1800 - - - - - 2400 - - - - - 4800 - - - - - 9600 - - - - - 14400 - - - - - 19200 - - - - - 38400 - - - - - 56000 - - - - - 57600 - - - - - 76800 - - - - - 115200 - - - - - 128000 - - - - - 230400 - - - - - 256000 - - - - - 460800 - - - - - 921600 - - - - - - - - - - Show Advanced Port Settings - - - - - - - - - Advanced - - - - 20 - - - 12 - - - 20 - - - - - - - Flow Control: - - - - - - - Activate / deactivate hardware flow control. Commonly deactivated - - - Activate / deactivate hardware flow control. Commonly deactivated - - - Activate / deactivate hardware flow control. Commonly deactivated - - - Active - - - - - - - - - - - Parity: - - - - - - - - - Set the parity. In most cases no parity (None) is used. - - - Set the parity. In most cases no parity (None) is used. - - - Set the parity. In most cases no parity (None) is used. - - - None - - - true - - - - - - - Set the parity. In most cases no parity (None) is used. - - - Set the parity. In most cases no parity (None) is used. - - - Set the parity. In most cases no parity (None) is used. - - - Odd - - - - - - - Set the parity. In most cases no parity (None) is used. - - - Set the parity. In most cases no parity (None) is used. - - - Set the parity. In most cases no parity (None) is used. - - - Even - - - - - - - - - - - - - Data Bits: - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - - 60 - 16777215 - - - - Number of data bits per symbol. This is almost always 8. - - - Number of data bits per symbol. This is almost always 8. - - - Number of data bits per symbol. This is almost always 8. - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - 5 - - - 8 - - - 8 - - - - - - - - - - - Stop Bits: - - - - - - - - 0 - 0 - - - - - 60 - 16777215 - - - - Number of stop bits per symbol. This is almost always 2. - - - Number of stop bits per symbol. This is almost always 2. - - - Number of stop bits per symbol. This is almost always 2. - - - true - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - false - - - QAbstractSpinBox::UpDownArrows - - - 1 - - - 2 - - - 2 - - - - - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - Delete - - - Delete this link - - - Delete this link - - - Link delete button - - - - - Connect - - - Connect this link - - - Connect this link - - - Connect this link - - - - - Close - - - Close the configuration window - - - Close the configuration window - - - Close the configuration window - - - - - - - actionClose - triggered() - serialSettings - close() - - - -1 - -1 - - - 224 - 195 - - - - -