1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-03-15 07:29:15 +01:00

Fixes the zero while arming checkbox and and OP-575

This commit is contained in:
zedamota 2011-10-12 16:43:14 +01:00
parent e37a53ba0e
commit 032fa759ac
3 changed files with 21 additions and 2 deletions

View File

@ -197,6 +197,10 @@ void ConfigTaskWidget::populateWidgets()
{
cb->setValue(ow->field->getValue(ow->index).toInt()/ow->scale);
}
else if(QCheckBox * cb=qobject_cast<QCheckBox *>(ow->widget))
{
cb->setChecked(ow->field->getValue(ow->index).toBool());
}
}
setDirty(dirtyBack);
}
@ -226,6 +230,10 @@ void ConfigTaskWidget::refreshWidgetsValues()
{
cb->setValue(ow->field->getValue(ow->index).toInt()/ow->scale);
}
else if(QCheckBox * cb=qobject_cast<QCheckBox *>(ow->widget))
{
cb->setChecked(ow->field->getValue(ow->index).toBool());
}
}
setDirty(dirtyBack);
}
@ -254,6 +262,10 @@ void ConfigTaskWidget::updateObjectsFromWidgets()
{
ow->field->setValue(cb->value()* ow->scale,ow->index);
}
else if(QCheckBox * cb=qobject_cast<QCheckBox *>(ow->widget))
{
ow->field->setValue((cb->isChecked()?"TRUE":"FALSE"),ow->index);
}
}
}

View File

@ -48,7 +48,8 @@ UploaderGadgetWidget::UploaderGadgetWidget(QWidget *parent) : QWidget(parent)
connect(m_config->resetButton, SIGNAL(clicked()), this, SLOT(systemReset()));
connect(m_config->bootButton, SIGNAL(clicked()), this, SLOT(systemBoot()));
connect(m_config->rescueButton, SIGNAL(clicked()), this, SLOT(systemRescue()));
Core::ConnectionManager *cm = Core::ICore::instance()->connectionManager();
connect(cm,SIGNAL(deviceConnected(QIODevice*)),this,SLOT(onPhisicalHWConnect()));
getSerialPorts();
QIcon rbi;
@ -105,7 +106,12 @@ QString UploaderGadgetWidget::getPortDevice(const QString &friendName)
}
return "";
}
void UploaderGadgetWidget::onPhisicalHWConnect()
{
m_config->bootButton->setEnabled(false);
m_config->rescueButton->setEnabled(false);
m_config->telemetryLink->setEnabled(false);
}
/**
Enables widget buttons if autopilot connected

View File

@ -85,6 +85,7 @@ private:
QLineEdit* openFileNameLE;
QEventLoop m_eventloop;
private slots:
void onPhisicalHWConnect();
void error(QString errorString,int errorNumber);
void info(QString infoString,int infoNumber);
void goToBootloader(UAVObject* = NULL, bool = false);