mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-12-02 10:24:11 +01:00
OP-1683 - fixes for GCS
This commit is contained in:
parent
73c6ae2055
commit
d0629926f0
@ -280,30 +280,30 @@ void ConfigOutputWidget::refreshWidgetsValues(UAVObject *obj)
|
|||||||
ui->spinningArmed->setChecked(actuatorSettingsData.MotorsSpinWhileArmed == ActuatorSettings::MOTORSSPINWHILEARMED_TRUE);
|
ui->spinningArmed->setChecked(actuatorSettingsData.MotorsSpinWhileArmed == ActuatorSettings::MOTORSSPINWHILEARMED_TRUE);
|
||||||
|
|
||||||
// Setup output rates for all banks
|
// Setup output rates for all banks
|
||||||
if (ui->cb_outputRate1->findText(QString::number(actuatorSettingsData.ChannelUpdateFreq[0])) == -1) {
|
if (ui->cb_outputRate1->findText(QString::number(actuatorSettingsData.BankUpdateFreq[0])) == -1) {
|
||||||
ui->cb_outputRate1->addItem(QString::number(actuatorSettingsData.ChannelUpdateFreq[0]));
|
ui->cb_outputRate1->addItem(QString::number(actuatorSettingsData.BankUpdateFreq[0]));
|
||||||
}
|
}
|
||||||
if (ui->cb_outputRate2->findText(QString::number(actuatorSettingsData.ChannelUpdateFreq[1])) == -1) {
|
if (ui->cb_outputRate2->findText(QString::number(actuatorSettingsData.BankUpdateFreq[1])) == -1) {
|
||||||
ui->cb_outputRate2->addItem(QString::number(actuatorSettingsData.ChannelUpdateFreq[1]));
|
ui->cb_outputRate2->addItem(QString::number(actuatorSettingsData.BankUpdateFreq[1]));
|
||||||
}
|
}
|
||||||
if (ui->cb_outputRate3->findText(QString::number(actuatorSettingsData.ChannelUpdateFreq[2])) == -1) {
|
if (ui->cb_outputRate3->findText(QString::number(actuatorSettingsData.BankUpdateFreq[2])) == -1) {
|
||||||
ui->cb_outputRate3->addItem(QString::number(actuatorSettingsData.ChannelUpdateFreq[2]));
|
ui->cb_outputRate3->addItem(QString::number(actuatorSettingsData.BankUpdateFreq[2]));
|
||||||
}
|
}
|
||||||
if (ui->cb_outputRate4->findText(QString::number(actuatorSettingsData.ChannelUpdateFreq[3])) == -1) {
|
if (ui->cb_outputRate4->findText(QString::number(actuatorSettingsData.BankUpdateFreq[3])) == -1) {
|
||||||
ui->cb_outputRate4->addItem(QString::number(actuatorSettingsData.ChannelUpdateFreq[3]));
|
ui->cb_outputRate4->addItem(QString::number(actuatorSettingsData.BankUpdateFreq[3]));
|
||||||
}
|
}
|
||||||
if (ui->cb_outputRate5->findText(QString::number(actuatorSettingsData.ChannelUpdateFreq[4])) == -1) {
|
if (ui->cb_outputRate5->findText(QString::number(actuatorSettingsData.BankUpdateFreq[4])) == -1) {
|
||||||
ui->cb_outputRate5->addItem(QString::number(actuatorSettingsData.ChannelUpdateFreq[4]));
|
ui->cb_outputRate5->addItem(QString::number(actuatorSettingsData.BankUpdateFreq[4]));
|
||||||
}
|
}
|
||||||
if (ui->cb_outputRate6->findText(QString::number(actuatorSettingsData.ChannelUpdateFreq[5])) == -1) {
|
if (ui->cb_outputRate6->findText(QString::number(actuatorSettingsData.BankUpdateFreq[5])) == -1) {
|
||||||
ui->cb_outputRate6->addItem(QString::number(actuatorSettingsData.ChannelUpdateFreq[5]));
|
ui->cb_outputRate6->addItem(QString::number(actuatorSettingsData.BankUpdateFreq[5]));
|
||||||
}
|
}
|
||||||
ui->cb_outputRate1->setCurrentIndex(ui->cb_outputRate1->findText(QString::number(actuatorSettingsData.ChannelUpdateFreq[0])));
|
ui->cb_outputRate1->setCurrentIndex(ui->cb_outputRate1->findText(QString::number(actuatorSettingsData.BankUpdateFreq[0])));
|
||||||
ui->cb_outputRate2->setCurrentIndex(ui->cb_outputRate2->findText(QString::number(actuatorSettingsData.ChannelUpdateFreq[1])));
|
ui->cb_outputRate2->setCurrentIndex(ui->cb_outputRate2->findText(QString::number(actuatorSettingsData.BankUpdateFreq[1])));
|
||||||
ui->cb_outputRate3->setCurrentIndex(ui->cb_outputRate3->findText(QString::number(actuatorSettingsData.ChannelUpdateFreq[2])));
|
ui->cb_outputRate3->setCurrentIndex(ui->cb_outputRate3->findText(QString::number(actuatorSettingsData.BankUpdateFreq[2])));
|
||||||
ui->cb_outputRate4->setCurrentIndex(ui->cb_outputRate4->findText(QString::number(actuatorSettingsData.ChannelUpdateFreq[3])));
|
ui->cb_outputRate4->setCurrentIndex(ui->cb_outputRate4->findText(QString::number(actuatorSettingsData.BankUpdateFreq[3])));
|
||||||
ui->cb_outputRate5->setCurrentIndex(ui->cb_outputRate5->findText(QString::number(actuatorSettingsData.ChannelUpdateFreq[4])));
|
ui->cb_outputRate5->setCurrentIndex(ui->cb_outputRate5->findText(QString::number(actuatorSettingsData.BankUpdateFreq[4])));
|
||||||
ui->cb_outputRate6->setCurrentIndex(ui->cb_outputRate6->findText(QString::number(actuatorSettingsData.ChannelUpdateFreq[5])));
|
ui->cb_outputRate6->setCurrentIndex(ui->cb_outputRate6->findText(QString::number(actuatorSettingsData.BankUpdateFreq[5])));
|
||||||
|
|
||||||
// Reset to all disabled
|
// Reset to all disabled
|
||||||
ui->chBank1->setText("-");
|
ui->chBank1->setText("-");
|
||||||
@ -391,12 +391,12 @@ void ConfigOutputWidget::updateObjectsFromWidgets()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Set update rates
|
// Set update rates
|
||||||
actuatorSettingsData.ChannelUpdateFreq[0] = ui->cb_outputRate1->currentText().toUInt();
|
actuatorSettingsData.BankUpdateFreq[0] = ui->cb_outputRate1->currentText().toUInt();
|
||||||
actuatorSettingsData.ChannelUpdateFreq[1] = ui->cb_outputRate2->currentText().toUInt();
|
actuatorSettingsData.BankUpdateFreq[1] = ui->cb_outputRate2->currentText().toUInt();
|
||||||
actuatorSettingsData.ChannelUpdateFreq[2] = ui->cb_outputRate3->currentText().toUInt();
|
actuatorSettingsData.BankUpdateFreq[2] = ui->cb_outputRate3->currentText().toUInt();
|
||||||
actuatorSettingsData.ChannelUpdateFreq[3] = ui->cb_outputRate4->currentText().toUInt();
|
actuatorSettingsData.BankUpdateFreq[3] = ui->cb_outputRate4->currentText().toUInt();
|
||||||
actuatorSettingsData.ChannelUpdateFreq[4] = ui->cb_outputRate5->currentText().toUInt();
|
actuatorSettingsData.BankUpdateFreq[4] = ui->cb_outputRate5->currentText().toUInt();
|
||||||
actuatorSettingsData.ChannelUpdateFreq[5] = ui->cb_outputRate6->currentText().toUInt();
|
actuatorSettingsData.BankUpdateFreq[5] = ui->cb_outputRate6->currentText().toUInt();
|
||||||
|
|
||||||
actuatorSettingsData.MotorsSpinWhileArmed = ui->spinningArmed->isChecked() ?
|
actuatorSettingsData.MotorsSpinWhileArmed = ui->spinningArmed->isChecked() ?
|
||||||
ActuatorSettings::MOTORSSPINWHILEARMED_TRUE :
|
ActuatorSettings::MOTORSSPINWHILEARMED_TRUE :
|
||||||
|
@ -404,32 +404,32 @@ void VehicleConfigurationHelper::applyActuatorConfiguration()
|
|||||||
|
|
||||||
data.MotorsSpinWhileArmed = ActuatorSettings::MOTORSSPINWHILEARMED_FALSE;
|
data.MotorsSpinWhileArmed = ActuatorSettings::MOTORSSPINWHILEARMED_FALSE;
|
||||||
|
|
||||||
for (quint16 i = 0; i < ActuatorSettings::CHANNELUPDATEFREQ_NUMELEM; i++) {
|
for (quint16 i = 0; i < ActuatorSettings::BANKUPDATEFREQ_NUMELEM; i++) {
|
||||||
data.ChannelUpdateFreq[i] = LEGACY_ESC_FREQUENCY;
|
data.BankUpdateFreq[i] = LEGACY_ESC_FREQUENCY;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (m_configSource->getVehicleSubType()) {
|
switch (m_configSource->getVehicleSubType()) {
|
||||||
case VehicleConfigurationSource::MULTI_ROTOR_TRI_Y:
|
case VehicleConfigurationSource::MULTI_ROTOR_TRI_Y:
|
||||||
// Servo always on channel 4
|
// Servo always on channel 4
|
||||||
data.ChannelUpdateFreq[0] = escFrequence;
|
data.BankUpdateFreq[0] = escFrequence;
|
||||||
if (m_configSource->getControllerType() == VehicleConfigurationSource::CONTROLLER_CC ||
|
if (m_configSource->getControllerType() == VehicleConfigurationSource::CONTROLLER_CC ||
|
||||||
m_configSource->getControllerType() == VehicleConfigurationSource::CONTROLLER_CC3D) {
|
m_configSource->getControllerType() == VehicleConfigurationSource::CONTROLLER_CC3D) {
|
||||||
data.ChannelUpdateFreq[1] = servoFrequence;
|
data.BankUpdateFreq[1] = servoFrequence;
|
||||||
} else if (m_configSource->getControllerType() == VehicleConfigurationSource::CONTROLLER_REVO) {
|
} else if (m_configSource->getControllerType() == VehicleConfigurationSource::CONTROLLER_REVO) {
|
||||||
data.ChannelUpdateFreq[1] = escFrequence;
|
data.BankUpdateFreq[1] = escFrequence;
|
||||||
data.ChannelUpdateFreq[2] = servoFrequence;
|
data.BankUpdateFreq[2] = servoFrequence;
|
||||||
} else if (m_configSource->getControllerType() == VehicleConfigurationSource::CONTROLLER_NANO) {
|
} else if (m_configSource->getControllerType() == VehicleConfigurationSource::CONTROLLER_NANO) {
|
||||||
data.ChannelUpdateFreq[1] = escFrequence;
|
data.BankUpdateFreq[1] = escFrequence;
|
||||||
data.ChannelUpdateFreq[2] = escFrequence;
|
data.BankUpdateFreq[2] = escFrequence;
|
||||||
data.ChannelUpdateFreq[3] = servoFrequence;
|
data.BankUpdateFreq[3] = servoFrequence;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case VehicleConfigurationSource::MULTI_ROTOR_QUAD_X:
|
case VehicleConfigurationSource::MULTI_ROTOR_QUAD_X:
|
||||||
case VehicleConfigurationSource::MULTI_ROTOR_QUAD_PLUS:
|
case VehicleConfigurationSource::MULTI_ROTOR_QUAD_PLUS:
|
||||||
data.ChannelUpdateFreq[0] = escFrequence;
|
data.BankUpdateFreq[0] = escFrequence;
|
||||||
data.ChannelUpdateFreq[1] = escFrequence;
|
data.BankUpdateFreq[1] = escFrequence;
|
||||||
if (m_configSource->getControllerType() == VehicleConfigurationSource::CONTROLLER_REVO) {
|
if (m_configSource->getControllerType() == VehicleConfigurationSource::CONTROLLER_REVO) {
|
||||||
data.ChannelUpdateFreq[2] = escFrequence;
|
data.BankUpdateFreq[2] = escFrequence;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case VehicleConfigurationSource::MULTI_ROTOR_HEXA:
|
case VehicleConfigurationSource::MULTI_ROTOR_HEXA:
|
||||||
@ -441,10 +441,10 @@ void VehicleConfigurationHelper::applyActuatorConfiguration()
|
|||||||
case VehicleConfigurationSource::MULTI_ROTOR_OCTO_COAX_X:
|
case VehicleConfigurationSource::MULTI_ROTOR_OCTO_COAX_X:
|
||||||
case VehicleConfigurationSource::MULTI_ROTOR_OCTO_COAX_PLUS:
|
case VehicleConfigurationSource::MULTI_ROTOR_OCTO_COAX_PLUS:
|
||||||
case VehicleConfigurationSource::MULTI_ROTOR_OCTO_V:
|
case VehicleConfigurationSource::MULTI_ROTOR_OCTO_V:
|
||||||
data.ChannelUpdateFreq[0] = escFrequence;
|
data.BankUpdateFreq[0] = escFrequence;
|
||||||
data.ChannelUpdateFreq[1] = escFrequence;
|
data.BankUpdateFreq[1] = escFrequence;
|
||||||
data.ChannelUpdateFreq[2] = escFrequence;
|
data.BankUpdateFreq[2] = escFrequence;
|
||||||
data.ChannelUpdateFreq[3] = escFrequence;
|
data.BankUpdateFreq[3] = escFrequence;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -467,15 +467,15 @@ void VehicleConfigurationHelper::applyActuatorConfiguration()
|
|||||||
data.ChannelMax[i] = actuatorSettings[i].channelMax;
|
data.ChannelMax[i] = actuatorSettings[i].channelMax;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (quint16 i = 0; i < ActuatorSettings::CHANNELUPDATEFREQ_NUMELEM; i++) {
|
for (quint16 i = 0; i < ActuatorSettings::BANKUPDATEFREQ_NUMELEM; i++) {
|
||||||
data.ChannelUpdateFreq[i] = servoFrequence;
|
data.BankUpdateFreq[i] = servoFrequence;
|
||||||
if (m_configSource->getControllerType() == VehicleConfigurationSource::CONTROLLER_REVO) {
|
if (m_configSource->getControllerType() == VehicleConfigurationSource::CONTROLLER_REVO) {
|
||||||
if (i == 1) {
|
if (i == 1) {
|
||||||
data.ChannelUpdateFreq[i] = escFrequence;
|
data.BankUpdateFreq[i] = escFrequence;
|
||||||
}
|
}
|
||||||
} else if (m_configSource->getControllerType() == VehicleConfigurationSource::CONTROLLER_NANO) {
|
} else if (m_configSource->getControllerType() == VehicleConfigurationSource::CONTROLLER_NANO) {
|
||||||
if (i == 2) {
|
if (i == 2) {
|
||||||
data.ChannelUpdateFreq[i] = escFrequence;
|
data.BankUpdateFreq[i] = escFrequence;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -503,15 +503,15 @@ void VehicleConfigurationHelper::applyActuatorConfiguration()
|
|||||||
data.ChannelMax[i] = actuatorSettings[i].channelMax;
|
data.ChannelMax[i] = actuatorSettings[i].channelMax;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (quint16 i = 0; i < ActuatorSettings::CHANNELUPDATEFREQ_NUMELEM; i++) {
|
for (quint16 i = 0; i < ActuatorSettings::BANKUPDATEFREQ_NUMELEM; i++) {
|
||||||
data.ChannelUpdateFreq[i] = servoFrequence;
|
data.BankUpdateFreq[i] = servoFrequence;
|
||||||
if (m_configSource->getControllerType() == VehicleConfigurationSource::CONTROLLER_REVO) {
|
if (m_configSource->getControllerType() == VehicleConfigurationSource::CONTROLLER_REVO) {
|
||||||
if (i == 1) {
|
if (i == 1) {
|
||||||
data.ChannelUpdateFreq[i] = escFrequence;
|
data.BankUpdateFreq[i] = escFrequence;
|
||||||
}
|
}
|
||||||
} else if (m_configSource->getControllerType() == VehicleConfigurationSource::CONTROLLER_NANO) {
|
} else if (m_configSource->getControllerType() == VehicleConfigurationSource::CONTROLLER_NANO) {
|
||||||
if (i == 2) {
|
if (i == 2) {
|
||||||
data.ChannelUpdateFreq[i] = escFrequence;
|
data.BankUpdateFreq[i] = escFrequence;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user