Commit 18c7a96c authored by Don Gagne's avatar Don Gagne

Added PX4Flow identification

Also added logging category
parent 006c4528
...@@ -47,7 +47,7 @@ This file is part of the QGROUNDCONTROL project ...@@ -47,7 +47,7 @@ This file is part of the QGROUNDCONTROL project
#include "QGCApplication.h" #include "QGCApplication.h"
IMPLEMENT_QGC_SINGLETON(LinkManager, LinkManager) IMPLEMENT_QGC_SINGLETON(LinkManager, LinkManager)
QGC_LOGGING_CATEGORY(LinkManagerLog, "LinkManagerLog")
/** /**
* @brief Private singleton constructor * @brief Private singleton constructor
...@@ -459,15 +459,13 @@ void LinkManager::_updateConfigurationList(void) ...@@ -459,15 +459,13 @@ void LinkManager::_updateConfigurationList(void)
QList<QSerialPortInfo> portList = QSerialPortInfo::availablePorts(); QList<QSerialPortInfo> portList = QSerialPortInfo::availablePorts();
// Iterate Comm Ports // Iterate Comm Ports
foreach (QSerialPortInfo portInfo, portList) { foreach (QSerialPortInfo portInfo, portList) {
#if 0 qCDebug(LinkManagerLog) << "-----------------------------------------------------";
qDebug() << "-----------------------------------------------------"; qCDebug(LinkManagerLog) << "portName: " << portInfo.portName();
qDebug() << "portName: " << portInfo.portName(); qCDebug(LinkManagerLog) << "systemLocation: " << portInfo.systemLocation();
qDebug() << "systemLocation: " << portInfo.systemLocation(); qCDebug(LinkManagerLog) << "description: " << portInfo.description();
qDebug() << "description: " << portInfo.description(); qCDebug(LinkManagerLog) << "manufacturer: " << portInfo.manufacturer();
qDebug() << "manufacturer: " << portInfo.manufacturer(); qCDebug(LinkManagerLog) << "serialNumber: " << portInfo.serialNumber();
qDebug() << "serialNumber: " << portInfo.serialNumber(); qCDebug(LinkManagerLog) << "vendorIdentifier: " << portInfo.vendorIdentifier();
qDebug() << "vendorIdentifier: " << portInfo.vendorIdentifier();
#endif
// Save port name // Save port name
currentPorts << portInfo.systemLocation(); currentPorts << portInfo.systemLocation();
// Is this a PX4 and NOT in bootloader mode? // Is this a PX4 and NOT in bootloader mode?
...@@ -483,6 +481,8 @@ void LinkManager::_updateConfigurationList(void) ...@@ -483,6 +481,8 @@ void LinkManager::_updateConfigurationList(void)
// Lets create a new Serial configuration automatically // Lets create a new Serial configuration automatically
if (portInfo.description() == "AeroCore") { if (portInfo.description() == "AeroCore") {
pSerial = new SerialConfiguration(QString("AeroCore on %1").arg(portInfo.portName().trimmed())); pSerial = new SerialConfiguration(QString("AeroCore on %1").arg(portInfo.portName().trimmed()));
} else if (portInfo.description().contains("PX4Flow")) {
pSerial = new SerialConfiguration(QString("PX4Flow on %1").arg(portInfo.portName().trimmed()));
} else if (portInfo.description().contains("PX4")) { } else if (portInfo.description().contains("PX4")) {
pSerial = new SerialConfiguration(QString("Pixhawk on %1").arg(portInfo.portName().trimmed())); pSerial = new SerialConfiguration(QString("Pixhawk on %1").arg(portInfo.portName().trimmed()));
} else { } else {
......
...@@ -33,6 +33,7 @@ This file is part of the PIXHAWK project ...@@ -33,6 +33,7 @@ This file is part of the PIXHAWK project
#include "LinkConfiguration.h" #include "LinkConfiguration.h"
#include "LinkInterface.h" #include "LinkInterface.h"
#include "QGCLoggingCategory.h"
// Links // Links
#ifndef __ios__ #ifndef __ios__
...@@ -49,6 +50,8 @@ This file is part of the PIXHAWK project ...@@ -49,6 +50,8 @@ This file is part of the PIXHAWK project
#include "QGCSingleton.h" #include "QGCSingleton.h"
#include "MAVLinkProtocol.h" #include "MAVLinkProtocol.h"
Q_DECLARE_LOGGING_CATEGORY(LinkManagerLog)
class LinkManagerTest; class LinkManagerTest;
/// Manage communication links /// Manage communication links
......
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