mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-30 15:52:12 +01:00
OP-1222 Fixed some groups in svg.
Removed translation node in svg by regrouping childs. Fixed fit in view issue in fixedwingpage and some channel setup in outputcalibrationpage.
This commit is contained in:
parent
b119f7ee5f
commit
f494c326de
@ -45,11 +45,8 @@ FixedWingPage::FixedWingPage(SetupWizard *wizard, QWidget *parent) :
|
||||
setupFixedWingTypesCombo();
|
||||
|
||||
// Default to Aileron setup
|
||||
ui->typeCombo->setCurrentIndex(0);
|
||||
connect(ui->typeCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(updateImageAndDescription()));
|
||||
ui->typeGraphicsView->setSceneRect(m_fixedwingPic->boundingRect());
|
||||
ui->typeGraphicsView->fitInView(m_fixedwingPic, Qt::KeepAspectRatio);
|
||||
|
||||
ui->typeCombo->setCurrentIndex(0);
|
||||
}
|
||||
|
||||
FixedWingPage::~FixedWingPage()
|
||||
@ -71,15 +68,26 @@ bool FixedWingPage::validatePage()
|
||||
return true;
|
||||
}
|
||||
|
||||
void FixedWingPage::resizeEvent(QResizeEvent *event)
|
||||
void FixedWingPage::fitInView()
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
if (m_fixedwingPic) {
|
||||
ui->typeGraphicsView->setSceneRect(m_fixedwingPic->boundingRect());
|
||||
ui->typeGraphicsView->fitInView(m_fixedwingPic, Qt::KeepAspectRatio);
|
||||
}
|
||||
}
|
||||
|
||||
void FixedWingPage::resizeEvent(QResizeEvent *event)
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
fitInView();
|
||||
}
|
||||
|
||||
void FixedWingPage::showEvent(QShowEvent *event)
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
fitInView();
|
||||
}
|
||||
|
||||
void FixedWingPage::setupFixedWingTypesCombo()
|
||||
{
|
||||
ui->typeCombo->addItem(tr("Aileron Dual Servos"), SetupWizard::FIXED_WING_DUAL_AILERON);
|
||||
@ -98,8 +106,6 @@ void FixedWingPage::updateAvailableTypes()
|
||||
|
||||
void FixedWingPage::updateImageAndDescription()
|
||||
{
|
||||
|
||||
|
||||
SetupWizard::VEHICLE_SUB_TYPE type = (SetupWizard::VEHICLE_SUB_TYPE)ui->typeCombo->itemData(ui->typeCombo->currentIndex()).toInt();
|
||||
QString elementId = "";
|
||||
QString description = m_descriptions.at(ui->typeCombo->currentIndex());
|
||||
@ -125,4 +131,3 @@ void FixedWingPage::updateImageAndDescription()
|
||||
ui->typeDescription->setText(description);
|
||||
|
||||
}
|
||||
|
||||
|
@ -48,8 +48,10 @@ public:
|
||||
void initializePage();
|
||||
bool validatePage();
|
||||
|
||||
void fitInView();
|
||||
protected:
|
||||
void resizeEvent(QResizeEvent *event);
|
||||
void showEvent(QShowEvent *event);
|
||||
|
||||
private:
|
||||
Ui::FixedWingPage *ui;
|
||||
@ -60,6 +62,7 @@ private:
|
||||
|
||||
private slots:
|
||||
void updateImageAndDescription();
|
||||
|
||||
};
|
||||
|
||||
#endif // FIXEDWINGPAGE_H
|
||||
|
@ -185,12 +185,12 @@ void OutputCalibrationPage::setupVehicle()
|
||||
break;
|
||||
case SetupWizard::FIXED_WING_AILERON:
|
||||
loadSVGFile(FIXEDWING_SVG_FILE);
|
||||
m_wizardIndexes << 0 << 1 << 2 << 3 << 4 << 2 << 3 << 4 << 2 << 3 << 4 << 2 << 3 << 4;
|
||||
m_vehicleElementIds << "aileron-single" << "ail2-frame" << "ail2-motor" << "ail2-ail-left" << "ail2-ail-right" << "ail2-rudder" << "ail2-elevator";
|
||||
m_vehicleHighlightElementIndexes << 0 << 1 << 2 << 2 << 2 << 3 << 3 << 3 << 4 << 4 << 4 << 5 << 5 << 5;
|
||||
m_channelIndex << 0 << 2 << 0 << 0 << 0 << 1 << 1 << 1 << 3 << 3 << 3 << 4 << 4 << 4;
|
||||
m_wizardIndexes << 0 << 1 << 2 << 3 << 4 << 2 << 3 << 4 << 2 << 3 << 4;
|
||||
m_vehicleElementIds << "aileron-single" << "ail2-frame" << "ail2-motor" << "ail2-aileron" << "ail2-rudder" << "ail2-elevator";
|
||||
m_vehicleHighlightElementIndexes << 0 << 1 << 2 << 2 << 2 << 3 << 3 << 3 << 4 << 4 << 4;
|
||||
m_channelIndex << 0 << 2 << 0 << 0 << 0 << 4 << 4 << 4 << 1 << 1 << 1;
|
||||
|
||||
setupActuatorMinMaxAndNeutral(3, 3, 5);
|
||||
setupActuatorMinMaxAndNeutral(3, 3, 4);
|
||||
|
||||
getWizard()->setActuatorSettings(m_actuatorSettings);
|
||||
break;
|
||||
|
@ -59,6 +59,6 @@ bool VehiclePage::validatePage()
|
||||
|
||||
void VehiclePage::initializePage()
|
||||
{
|
||||
ui->fixedwingButton->setEnabled(getWizard()->getControllerType() == SetupWizard::CONTROLLER_REVO ||
|
||||
getWizard()->getControllerType() == SetupWizard::CONTROLLER_NANO);
|
||||
//ui->fixedwingButton->setEnabled(getWizard()->getControllerType() == SetupWizard::CONTROLLER_REVO ||
|
||||
// getWizard()->getControllerType() == SetupWizard::CONTROLLER_NANO);
|
||||
}
|
||||
|
File diff suppressed because one or more lines are too long
Before Width: | Height: | Size: 260 KiB After Width: | Height: | Size: 270 KiB |
Loading…
x
Reference in New Issue
Block a user