mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-29 14:52:12 +01:00
OP-39 Fixed controller identification bug. Now using telemetry manager to receive notifications about connect/disconnect.
Changed text on last page in wizard.
This commit is contained in:
parent
fdec9ce149
commit
19875fb70b
@ -42,8 +42,12 @@ ControllerPage::ControllerPage(SetupWizard *wizard, QWidget *parent) :
|
||||
Q_ASSERT(m_connectionManager);
|
||||
connect(m_connectionManager, SIGNAL(availableDevicesChanged(QLinkedList<Core::DevListItem>)), this, SLOT(devicesChanged(QLinkedList<Core::DevListItem>)));
|
||||
|
||||
connect(m_connectionManager, SIGNAL(deviceConnected(QIODevice*)), this, SLOT(connectionStatusChanged()));
|
||||
connect(m_connectionManager, SIGNAL(deviceDisconnected()), this, SLOT(connectionStatusChanged()));
|
||||
ExtensionSystem::PluginManager *pluginManager = ExtensionSystem::PluginManager::instance();
|
||||
Q_ASSERT(pluginManager);
|
||||
m_telemtryManager = pluginManager->getObject<TelemetryManager>();
|
||||
Q_ASSERT(m_telemtryManager);
|
||||
connect(m_telemtryManager, SIGNAL(connected()), this, SLOT(connectionStatusChanged()));
|
||||
connect(m_telemtryManager, SIGNAL(disconnected()), this, SLOT(connectionStatusChanged()));
|
||||
|
||||
connect(ui->connectButton, SIGNAL(clicked()), this, SLOT(connectDisconnect()));
|
||||
|
||||
@ -70,7 +74,7 @@ void ControllerPage::initializePage()
|
||||
|
||||
bool ControllerPage::isComplete() const
|
||||
{
|
||||
return m_connectionManager->isConnected() && ui->boardTypeCombo->currentIndex() > 0 &&
|
||||
return m_telemtryManager->isConnected() && ui->boardTypeCombo->currentIndex() > 0 &&
|
||||
m_connectionManager->getCurrentDevice().getConName().startsWith("USB:", Qt::CaseInsensitive);
|
||||
}
|
||||
|
||||
@ -82,7 +86,7 @@ bool ControllerPage::validatePage()
|
||||
|
||||
bool ControllerPage::anyControllerConnected()
|
||||
{
|
||||
return m_connectionManager->isConnected();
|
||||
return m_telemtryManager->isConnected();
|
||||
}
|
||||
|
||||
SetupWizard::CONTROLLER_TYPE ControllerPage::getControllerType()
|
||||
@ -164,7 +168,7 @@ void ControllerPage::devicesChanged(QLinkedList<Core::DevListItem> devices)
|
||||
if(indexOfSelectedItem != -1) {
|
||||
ui->deviceCombo->setCurrentIndex(indexOfSelectedItem);
|
||||
}
|
||||
connectionStatusChanged();
|
||||
//connectionStatusChanged();
|
||||
}
|
||||
|
||||
void ControllerPage::connectionStatusChanged()
|
||||
@ -183,6 +187,7 @@ void ControllerPage::connectionStatusChanged()
|
||||
|
||||
SetupWizard::CONTROLLER_TYPE type = getControllerType();
|
||||
setControllerType(type);
|
||||
qDebug() << "Connection status changed: Connected, controller type: " << getControllerType();
|
||||
}
|
||||
else {
|
||||
ui->deviceCombo->setEnabled(true);
|
||||
@ -190,6 +195,7 @@ void ControllerPage::connectionStatusChanged()
|
||||
ui->boardTypeCombo->setEnabled(false);
|
||||
ui->boardTypeCombo->model()->setData(ui->boardTypeCombo->model()->index(0, 0), QVariant(0), Qt::UserRole - 1);
|
||||
setControllerType(SetupWizard::CONTROLLER_UNKNOWN);
|
||||
qDebug() << "Connection status changed: Disconnected";
|
||||
}
|
||||
emit completeChanged();
|
||||
}
|
||||
|
@ -31,6 +31,7 @@
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/connectionmanager.h>
|
||||
#include "setupwizard.h"
|
||||
#include "uavtalk/telemetrymanager.h"
|
||||
#include "abstractwizardpage.h"
|
||||
|
||||
namespace Ui {
|
||||
@ -56,6 +57,7 @@ private:
|
||||
void setupBoardTypes();
|
||||
void setControllerType(SetupWizard::CONTROLLER_TYPE type);
|
||||
Core::ConnectionManager *m_connectionManager;
|
||||
TelemetryManager *m_telemtryManager;
|
||||
|
||||
private slots:
|
||||
void devicesChanged(QLinkedList<Core::DevListItem> devices);
|
||||
|
@ -39,8 +39,6 @@ p, li { white-space: pre-wrap; }
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">This part of the setup procedure is now complete and you are one step away from completing the setup of your OpenPilot controller.</span></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10pt;"><br /></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">To complete the setup please click the Radio Setup Wizard button below to close this wizard and go directly to the Radio Setup Wizard.</span></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10pt;"><br /></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">Or, before trying to operate your vehicle, close this wizard, go to the Input tab in the Configuration plugin and run the Radio Setup Wizard to configure the input signals to be used. If you have already performed the Radio configuration, you can skip this step. </span></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10pt;"><br /></p></body></html></string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
|
Loading…
x
Reference in New Issue
Block a user