mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-18 08:54:15 +01:00
OP-1628 Uncrustify
This commit is contained in:
parent
9a5dc36826
commit
87bd6243b4
@ -35,20 +35,20 @@ OPLinkWatchdog::OPLinkWatchdog() : QObject(),
|
||||
m_isConnected(false)
|
||||
{
|
||||
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
|
||||
|
||||
Q_ASSERT(pm);
|
||||
UAVObjectManager *objManager = pm->getObject<UAVObjectManager>();
|
||||
Q_ASSERT(objManager);
|
||||
m_opLinkStatus = OPLinkStatus::GetInstance(objManager);
|
||||
Q_ASSERT(m_opLinkStatus);
|
||||
connect(m_opLinkStatus, SIGNAL(objectUpdated(UAVObject*)), this, SLOT(onOPLinkStatusUpdate()));
|
||||
m_watchdog = new QTimer(this);
|
||||
connect(m_opLinkStatus, SIGNAL(objectUpdated(UAVObject *)), this, SLOT(onOPLinkStatusUpdate()));
|
||||
m_watchdog = new QTimer(this);
|
||||
connect(m_watchdog, SIGNAL(timeout()), this, SLOT(onTimeout()));
|
||||
onOPLinkStatusUpdate();
|
||||
}
|
||||
|
||||
OPLinkWatchdog::~OPLinkWatchdog()
|
||||
{
|
||||
}
|
||||
{}
|
||||
|
||||
void OPLinkWatchdog::onOPLinkStatusUpdate()
|
||||
{
|
||||
@ -57,20 +57,20 @@ void OPLinkWatchdog::onOPLinkStatusUpdate()
|
||||
if (!m_isConnected) {
|
||||
switch (type) {
|
||||
case 3:
|
||||
m_opLinkType = OPLINK_MINI;
|
||||
m_opLinkType = OPLINK_MINI;
|
||||
m_isConnected = true;
|
||||
emit connected();
|
||||
emit opLinkMiniConnected();
|
||||
break;
|
||||
case 9:
|
||||
m_opLinkType = OPLINK_REVOLUTION;
|
||||
m_opLinkType = OPLINK_REVOLUTION;
|
||||
m_isConnected = true;
|
||||
emit connected();
|
||||
emit opLinkRevolutionConnected();
|
||||
break;
|
||||
default:
|
||||
m_isConnected = false;
|
||||
m_opLinkType = OPLINK_UNKNOWN;
|
||||
m_opLinkType = OPLINK_UNKNOWN;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -83,7 +83,7 @@ void OPLinkWatchdog::onTimeout()
|
||||
{
|
||||
if (m_isConnected) {
|
||||
m_isConnected = false;
|
||||
m_opLinkType = OPLINK_UNKNOWN;
|
||||
m_opLinkType = OPLINK_UNKNOWN;
|
||||
qDebug() << "OPLinkWatchdog - OPLink disconnected";
|
||||
emit disconnected();
|
||||
}
|
||||
|
@ -42,8 +42,14 @@ public:
|
||||
|
||||
OPLinkWatchdog();
|
||||
~OPLinkWatchdog();
|
||||
bool isConnected() const { return m_isConnected; }
|
||||
OPLinkWatchdog::OPLinkType opLinkType() const { return m_opLinkType; }
|
||||
bool isConnected() const
|
||||
{
|
||||
return m_isConnected;
|
||||
}
|
||||
OPLinkWatchdog::OPLinkType opLinkType() const
|
||||
{
|
||||
return m_opLinkType;
|
||||
}
|
||||
|
||||
signals:
|
||||
void connected();
|
||||
@ -58,7 +64,7 @@ private slots:
|
||||
private:
|
||||
bool m_isConnected;
|
||||
OPLinkType m_opLinkType;
|
||||
QTimer* m_watchdog;
|
||||
OPLinkStatus* m_opLinkStatus;
|
||||
QTimer *m_watchdog;
|
||||
OPLinkStatus *m_opLinkStatus;
|
||||
};
|
||||
#endif // OPLINKWATCHDOG_H
|
||||
|
@ -140,7 +140,7 @@ UploaderGadgetWidget::UploaderGadgetWidget(QWidget *parent) : QWidget(parent)
|
||||
m_config = new Ui_UploaderWidget();
|
||||
m_config->setupUi(this);
|
||||
m_currentIAPStep = IAP_STATE_READY;
|
||||
m_resetOnly = false;
|
||||
m_resetOnly = false;
|
||||
m_dfu = NULL;
|
||||
m_autoUpdateClosing = false;
|
||||
|
||||
@ -232,6 +232,7 @@ void UploaderGadgetWidget::connectSignalSlot(QWidget *widget)
|
||||
FlightStatus *UploaderGadgetWidget::getFlightStatus()
|
||||
{
|
||||
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
|
||||
|
||||
Q_ASSERT(pm);
|
||||
UAVObjectManager *objManager = pm->getObject<UAVObjectManager>();
|
||||
Q_ASSERT(objManager);
|
||||
@ -673,7 +674,7 @@ bool UploaderGadgetWidget::autoUpdateCapable()
|
||||
bool UploaderGadgetWidget::autoUpdate(bool erase)
|
||||
{
|
||||
if (m_oplinkwatchdog.isConnected() &&
|
||||
m_oplinkwatchdog.opLinkType() == OPLinkWatchdog::OPLINK_MINI) {
|
||||
m_oplinkwatchdog.opLinkType() == OPLinkWatchdog::OPLINK_MINI) {
|
||||
emit progressUpdate(FAILURE, QVariant(tr("To upgrade the OPLinkMini board please disconnect it from the USB port, "
|
||||
"press the Upgrade again button and follow instructions on screen.")));
|
||||
emit autoUpdateFailed();
|
||||
|
Loading…
x
Reference in New Issue
Block a user