1
0
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:
Fredrik Arvidsson 2012-09-30 13:35:35 +02:00
parent fdec9ce149
commit 19875fb70b
3 changed files with 13 additions and 7 deletions

View File

@ -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();
}

View File

@ -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);

View File

@ -39,8 +39,6 @@ p, li { white-space: pre-wrap; }
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:10pt;&quot;&gt;This part of the setup procedure is now complete and you are one step away from completing the setup of your OpenPilot controller.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-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;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:10pt;&quot;&gt;To complete the setup please click the Radio Setup Wizard button below to close this wizard and go directly to the Radio Setup Wizard.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-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;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:10pt;&quot;&gt;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. &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-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;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="alignment">