mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-03-15 07:29:15 +01:00
Hooked the autoupdate on CC Attitude widget on autopilot connect.
This commit is contained in:
parent
7e418866be
commit
b0baee3d17
@ -40,6 +40,10 @@ ConfigCCAttitudeWidget::ConfigCCAttitudeWidget(QWidget *parent) :
|
||||
connect(ui->saveButton,SIGNAL(clicked()),this,SLOT(saveAttitudeSettings()));
|
||||
connect(ui->applyButton,SIGNAL(clicked()),this,SLOT(applyAttitudeSettings()));
|
||||
connect(ui->getCurrentButton,SIGNAL(clicked()),this,SLOT(getCurrentAttitudeSettings()));
|
||||
|
||||
// Make it smart:
|
||||
connect(parent, SIGNAL(autopilotConnected()),this, SLOT(getCurrentAttitudeSettings()));
|
||||
getCurrentAttitudeSettings(); // The 1st time this panel is instanciated, the autopilot is already connected.
|
||||
}
|
||||
|
||||
ConfigCCAttitudeWidget::~ConfigCCAttitudeWidget()
|
||||
@ -109,6 +113,7 @@ void ConfigCCAttitudeWidget::applyAttitudeSettings() {
|
||||
|
||||
void ConfigCCAttitudeWidget::getCurrentAttitudeSettings() {
|
||||
UAVDataObject * settings = dynamic_cast<UAVDataObject*>(getObjectManager()->getObject(QString("AttitudeSettings")));
|
||||
settings->requestUpdate();
|
||||
UAVObjectField * field = settings->getField("BoardRotation");
|
||||
ui->rollBias->setValue(field->getDouble(0));
|
||||
ui->pitchBias->setValue(field->getDouble(1));
|
||||
|
Loading…
x
Reference in New Issue
Block a user