mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-17 02:52:12 +01:00
OP-39 Added new button graphix.
Implemented servo min/max/neutral calibration. Added check for Actuator module alarm before running calibrarion.
This commit is contained in:
parent
0871cd3db2
commit
3a38cb2cc1
@ -29,6 +29,7 @@
|
||||
#include "actuatorcommand.h"
|
||||
#include "extensionsystem/pluginmanager.h"
|
||||
#include "vehicleconfigurationhelper.h"
|
||||
#include "manualcontrolsettings.h"
|
||||
|
||||
const quint16 OutputCalibrationUtil::UPDATE_CHANNEL_MAPPING[10] = {0, 0, 0, 1, 2, 3, 2, 2, 3, 3};
|
||||
|
||||
@ -50,19 +51,37 @@ void OutputCalibrationUtil::setupOutputRates(const QList<quint16> &outputRates)
|
||||
//Set actuator settings for channels
|
||||
ActuatorSettings *actuatorSettings = ActuatorSettings::GetInstance(m_uavObjectManager);
|
||||
Q_ASSERT(actuatorSettings);
|
||||
ActuatorSettings::DataFields data = actuatorSettings->getData();
|
||||
ActuatorSettings::DataFields aData = actuatorSettings->getData();
|
||||
|
||||
for(int i = 0; i < outputRates.size(); i++) {
|
||||
data.ChannelType[i] = ActuatorSettings::CHANNELTYPE_PWM;
|
||||
data.ChannelAddr[i] = i;
|
||||
data.ChannelMin[i] = 1000;
|
||||
data.ChannelNeutral[i] = 1000;
|
||||
data.ChannelMax[i] = 2000;
|
||||
data.ChannelUpdateFreq[UPDATE_CHANNEL_MAPPING[i]] = outputRates[i];
|
||||
aData.ChannelType[i] = ActuatorSettings::CHANNELTYPE_PWM;
|
||||
aData.ChannelAddr[i] = i;
|
||||
aData.ChannelMin[i] = 1000;
|
||||
aData.ChannelNeutral[i] = 1000;
|
||||
aData.ChannelMax[i] = 2000;
|
||||
aData.ChannelUpdateFreq[UPDATE_CHANNEL_MAPPING[i]] = outputRates[i];
|
||||
}
|
||||
|
||||
actuatorSettings->setData(data);
|
||||
actuatorSettings->setData(aData);
|
||||
actuatorSettings->updated();
|
||||
|
||||
ManualControlSettings *manualControlSettings = ManualControlSettings::GetInstance(m_uavObjectManager);
|
||||
Q_ASSERT(manualControlSettings);
|
||||
ManualControlSettings::DataFields cData = manualControlSettings->getData();
|
||||
cData.ChannelGroups[ManualControlSettings::CHANNELGROUPS_THROTTLE] = ManualControlSettings::CHANNELGROUPS_PWM;
|
||||
cData.ChannelGroups[ManualControlSettings::CHANNELGROUPS_ROLL] = ManualControlSettings::CHANNELGROUPS_PWM;
|
||||
cData.ChannelGroups[ManualControlSettings::CHANNELGROUPS_YAW] = ManualControlSettings::CHANNELGROUPS_PWM;
|
||||
cData.ChannelGroups[ManualControlSettings::CHANNELGROUPS_PITCH] = ManualControlSettings::CHANNELGROUPS_PWM;
|
||||
cData.ChannelGroups[ManualControlSettings::CHANNELGROUPS_FLIGHTMODE] = ManualControlSettings::CHANNELGROUPS_PWM;
|
||||
|
||||
cData.ChannelNumber[ManualControlSettings::CHANNELGROUPS_THROTTLE] = 1;
|
||||
cData.ChannelNumber[ManualControlSettings::CHANNELGROUPS_ROLL] = 2;
|
||||
cData.ChannelNumber[ManualControlSettings::CHANNELGROUPS_YAW] = 3;
|
||||
cData.ChannelNumber[ManualControlSettings::CHANNELGROUPS_PITCH] = 4;
|
||||
cData.ChannelNumber[ManualControlSettings::CHANNELGROUPS_FLIGHTMODE] = 5;
|
||||
|
||||
manualControlSettings->setData(cData);
|
||||
manualControlSettings->updated();
|
||||
}
|
||||
|
||||
void OutputCalibrationUtil::startChannelOutput(quint16 channel, quint16 safeValue)
|
||||
|
@ -54,7 +54,6 @@ public slots:
|
||||
|
||||
private:
|
||||
static const quint16 UPDATE_CHANNEL_MAPPING[10];
|
||||
VehicleConfigurationSource *m_configSource;
|
||||
actuatorSettings *m_actuatorSettings;
|
||||
qint16 m_outputChannel;
|
||||
quint16 m_safeValue;
|
||||
|
@ -19,7 +19,7 @@
|
||||
<x>20</x>
|
||||
<y>20</y>
|
||||
<width>550</width>
|
||||
<height>201</height>
|
||||
<height>261</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
@ -31,7 +31,10 @@ p, li { white-space: pre-wrap; }
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">To continue the wizard needs to know what kind of OpenPilot controller you want to create a configuration for. The wizard will try to automatically detect what type of board you have when connected.</span></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10pt;"><br /></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">Please connect the board to a free usb port on your computer, or if a serial modem like BlueTooth, PipX or other is used, power up the board and select the device to connect with from the list below. Then press 'Connect'. If the board already is connected and succesfully detected the board type will already be displayed. You can disconnect and select another device if you need to detect another board.</span></p></body></html></string>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">Please connect the board to a free usb port on your computer, or if a serial modem like BlueTooth, PipX or other is used, power up the board and select the device to connect with from the list below. Then press 'Connect'. If the board already is connected and succesfully detected the board type will already be displayed. You can disconnect and select another device if you need to detect another board.</span></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10pt;"><br /></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">Important:</span></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">If you need to power your controller with an external power source if not using USB, please disconnect all components like ESC and servos connected to the output ports of the controller.</span></p></body></html></string>
|
||||
</property>
|
||||
<property name="textFormat">
|
||||
<enum>Qt::AutoText</enum>
|
||||
|
@ -46,9 +46,9 @@ p, li { white-space: pre-wrap; }
|
||||
<widget class="QToolButton" name="saveButton">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>200</x>
|
||||
<x>225</x>
|
||||
<y>250</y>
|
||||
<width>200</width>
|
||||
<width>150</width>
|
||||
<height>70</height>
|
||||
</rect>
|
||||
</property>
|
||||
@ -61,6 +61,11 @@ p, li { white-space: pre-wrap; }
|
||||
<property name="text">
|
||||
<string>Save</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../wizardResources.qrc">
|
||||
<normaloff>:/setupwizard/resources/bttn-save-up.png</normaloff>
|
||||
<normalon>:/setupwizard/resources/bttn-save-down.png</normalon>:/setupwizard/resources/bttn-save-up.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>200</width>
|
||||
@ -118,6 +123,8 @@ QProgressBar::chunk {
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<resources>
|
||||
<include location="../wizardResources.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
@ -58,6 +58,14 @@ bool LevellingPage::isComplete() const
|
||||
ui->levelButton->isEnabled();
|
||||
}
|
||||
|
||||
void LevellingPage::enableButtons(bool enable)
|
||||
{
|
||||
ui->levelButton->setEnabled(enable);
|
||||
getWizard()->button(QWizard::NextButton)->setEnabled(enable);
|
||||
getWizard()->button(QWizard::CancelButton)->setEnabled(enable);
|
||||
getWizard()->button(QWizard::BackButton)->setEnabled(enable);
|
||||
}
|
||||
|
||||
void LevellingPage::performLevelling()
|
||||
{
|
||||
if(!getWizard()->getConnectionManager()->isConnected()) {
|
||||
@ -70,11 +78,7 @@ void LevellingPage::performLevelling()
|
||||
return;
|
||||
}
|
||||
|
||||
getWizard()->button(QWizard::BackButton)->setEnabled(false);
|
||||
getWizard()->button(QWizard::NextButton)->setEnabled(false);
|
||||
getWizard()->button(QWizard::CancelButton)->setEnabled(false);
|
||||
|
||||
ui->levelButton->setEnabled(false);
|
||||
enableButtons(false);
|
||||
|
||||
if(!m_levellingUtil)
|
||||
{
|
||||
@ -124,9 +128,6 @@ void LevellingPage::stopLevelling()
|
||||
disconnect(m_levellingUtil, SIGNAL(progress(long,long)), this, SLOT(levellingProgress(long,long)));
|
||||
disconnect(m_levellingUtil, SIGNAL(done(accelGyroBias)), this, SLOT(levellingDone(accelGyroBias)));
|
||||
disconnect(m_levellingUtil, SIGNAL(timeout(QString)), this, SLOT(levellingTimeout(QString)));
|
||||
getWizard()->button(QWizard::BackButton)->setEnabled(true);
|
||||
getWizard()->button(QWizard::NextButton)->setEnabled(true);
|
||||
getWizard()->button(QWizard::CancelButton)->setEnabled(true);
|
||||
ui->levelButton->setEnabled(true);
|
||||
enableButtons(true);
|
||||
}
|
||||
}
|
||||
|
@ -59,6 +59,7 @@ private:
|
||||
LevellingUtil *m_levellingUtil;
|
||||
|
||||
void stopLevelling();
|
||||
void enableButtons(bool enable);
|
||||
};
|
||||
|
||||
#endif // LEVELLINGPAGE_H
|
||||
|
@ -27,6 +27,8 @@
|
||||
|
||||
#include "outputcalibrationpage.h"
|
||||
#include "ui_outputcalibrationpage.h"
|
||||
#include "systemalarms.h"
|
||||
#include "uavobjectmanager.h"
|
||||
|
||||
OutputCalibrationPage::OutputCalibrationPage(SetupWizard *wizard, QWidget *parent) :
|
||||
AbstractWizardPage(wizard, parent), ui(new Ui::OutputCalibrationPage), m_vehicleBoundsItem(0),
|
||||
@ -60,6 +62,7 @@ void OutputCalibrationPage::setupVehicle()
|
||||
m_vehicleHighlightElementIndexes.clear();
|
||||
m_currentWizardIndex = 0;
|
||||
m_vehicleScene->clear();
|
||||
m_channelUpdateRates.clear();
|
||||
quint16 escUpdateRate = getEscUpdateRate();
|
||||
quint16 servoUpdateRate = getServoUpdateRate();
|
||||
switch(getWizard()->getVehicleSubType())
|
||||
@ -69,6 +72,8 @@ void OutputCalibrationPage::setupVehicle()
|
||||
m_vehicleElementIds << "tri" << "tri-frame" << "tri-m1" << "tri-m2" << "tri-m3" << "tri-s1";
|
||||
m_vehicleHighlightElementIndexes << 0 << 1 << 1 << 2 << 2 << 3 << 3 << 4 << 4;
|
||||
m_channelUpdateRates << escUpdateRate << escUpdateRate << escUpdateRate << servoUpdateRate;
|
||||
m_actuatorSettings.channels[4].channelMin = 1500;
|
||||
m_actuatorSettings.channels[4].channelMax = 1500;
|
||||
break;
|
||||
case SetupWizard::MULTI_ROTOR_QUAD_X:
|
||||
m_wizardIndexes << 0 << 1 << 2 << 1 << 2 << 1 << 2 << 1 << 2;
|
||||
@ -91,8 +96,8 @@ void OutputCalibrationPage::setupVehicle()
|
||||
break;
|
||||
case SetupWizard::MULTI_ROTOR_HEXA_COAX_Y:
|
||||
m_wizardIndexes << 0 << 1 << 2 << 1 << 2 << 1 << 2 << 1 << 2 << 1 << 2 << 1 << 2;
|
||||
m_vehicleElementIds << "hexa-y6" << "hexa-y6-frame" << "hexa-y6-m1" << "hexa-y6-m2" << "hexa-y6-m3" << "hexa-y6-m4"
|
||||
<< "hexa-y6-m5" << "hexa-y6-m6";
|
||||
m_vehicleElementIds << "hexa-y6" << "hexa-y6-frame" << "hexa-y6-m2" << "hexa-y6-m1" << "hexa-y6-m4" << "hexa-y6-m3"
|
||||
<< "hexa-y6-m6" << "hexa-y6-m5";
|
||||
m_vehicleHighlightElementIndexes << 0 << 1 << 1 << 2 << 2 << 3 << 3 << 4 << 4 << 5 << 5 << 6 << 6;
|
||||
m_channelUpdateRates << escUpdateRate << escUpdateRate << escUpdateRate << escUpdateRate << escUpdateRate << escUpdateRate;
|
||||
break;
|
||||
@ -107,6 +112,9 @@ void OutputCalibrationPage::setupVehicle()
|
||||
break;
|
||||
}
|
||||
|
||||
VehicleConfigurationHelper helper(getWizard());
|
||||
helper.setupVehicle(false);
|
||||
|
||||
if(m_calibrationUtil) {
|
||||
delete m_calibrationUtil;
|
||||
m_calibrationUtil = 0;
|
||||
@ -136,6 +144,7 @@ void OutputCalibrationPage::setupVehicleItems()
|
||||
item->setElementId(m_vehicleElementIds[i]);
|
||||
item->setZValue(i);
|
||||
item->setOpacity(1.0);
|
||||
|
||||
QRectF itemBounds = m_vehicleRenderer->boundsOnElement(m_vehicleElementIds[i]);
|
||||
item->setPos(itemBounds.x() - parentBounds.x(), itemBounds.y() - parentBounds.y());
|
||||
|
||||
@ -234,27 +243,57 @@ void OutputCalibrationPage::on_motorNeutralButton_toggled(bool checked)
|
||||
{
|
||||
ui->motorNeutralButton->setText(checked ? tr("Stop") : tr("Start"));
|
||||
quint16 channel = getCurrentChannel();
|
||||
onStartButtonToggle(checked, channel, m_actuatorSettings.channels[channel].channelNeutral, 1000,ui->motorNeutralSlider);
|
||||
onStartButtonToggle(ui->motorNeutralButton, channel, m_actuatorSettings.channels[channel].channelNeutral, 1000, ui->motorNeutralSlider);
|
||||
}
|
||||
|
||||
void OutputCalibrationPage::onStartButtonToggle(bool checked, quint16 channel, quint16 &value, quint16 safeValue, QSlider *slider) {
|
||||
if(checked) {
|
||||
enableButtons(false);
|
||||
m_calibrationUtil->startChannelOutput(channel, safeValue);
|
||||
slider->setValue(value);
|
||||
m_calibrationUtil->setChannelOutputValue(slider->value());
|
||||
void OutputCalibrationPage::onStartButtonToggle(QAbstractButton *button, quint16 channel, quint16 value, quint16 safeValue, QSlider *slider) {
|
||||
if(button->isChecked()) {
|
||||
if(checkAlarms()) {
|
||||
enableButtons(false);
|
||||
m_calibrationUtil->startChannelOutput(channel, safeValue);
|
||||
slider->setValue(value);
|
||||
//m_calibrationUtil->setChannelOutputValue(value);
|
||||
}
|
||||
else {
|
||||
button->setChecked(false);
|
||||
}
|
||||
}
|
||||
else {
|
||||
value = slider->value();
|
||||
m_calibrationUtil->stopChannelOutput();
|
||||
enableButtons(true);
|
||||
}
|
||||
}
|
||||
|
||||
bool OutputCalibrationPage::checkAlarms()
|
||||
{
|
||||
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
|
||||
UAVObjectManager *uavObjectManager = pm->getObject<UAVObjectManager>();
|
||||
Q_ASSERT(uavObjectManager);
|
||||
SystemAlarms * systemAlarmsObj = SystemAlarms::GetInstance(uavObjectManager);
|
||||
SystemAlarms::DataFields systemAlarms = systemAlarmsObj->getData();
|
||||
|
||||
if(systemAlarms.Alarm[SystemAlarms::ALARM_ACTUATOR] != SystemAlarms::ALARM_OK) {
|
||||
QMessageBox mbox;
|
||||
mbox.setText(QString(tr("The actuator module is in an error state.\n\n"
|
||||
"This error can be caused by not having the board correctly connected or\n"
|
||||
"if the board is not sufficiently powered by an external power source like\n"
|
||||
"a battery. To use only USB as power source is not enough when the USB can't\n"
|
||||
"power external components like ESCs and servos.\n\n"
|
||||
"Please fix the error before continuing calibration.")));
|
||||
mbox.setStandardButtons(QMessageBox::Ok);
|
||||
mbox.setIcon(QMessageBox::Critical);
|
||||
mbox.exec();
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void OutputCalibrationPage::on_motorNeutralSlider_valueChanged(int value)
|
||||
{
|
||||
if(ui->motorNeutralButton->isChecked()) {
|
||||
m_calibrationUtil->setChannelOutputValue(ui->motorNeutralSlider->value());
|
||||
quint16 value = ui->motorNeutralSlider->value();
|
||||
m_calibrationUtil->setChannelOutputValue(value);
|
||||
m_actuatorSettings.channels[getCurrentChannel()].channelNeutral = value;
|
||||
}
|
||||
}
|
||||
|
||||
@ -262,42 +301,73 @@ void OutputCalibrationPage::on_motorMaxButton_toggled(bool checked)
|
||||
{
|
||||
ui->motorNeutralButton->setText(checked ? tr("Stop") : tr("Start"));
|
||||
quint16 channel = getCurrentChannel();
|
||||
onStartButtonToggle(checked, channel, m_actuatorSettings.channels[channel].channelMax, 1000, ui->motorMaxSlider);
|
||||
onStartButtonToggle(ui->motorMaxButton, channel, m_actuatorSettings.channels[channel].channelMax, 1000, ui->motorMaxSlider);
|
||||
}
|
||||
|
||||
void OutputCalibrationPage::on_motorMaxSlider_valueChanged(int position)
|
||||
{
|
||||
if(ui->motorMaxButton->isChecked()) {
|
||||
m_calibrationUtil->setChannelOutputValue(ui->motorMaxSlider->value());
|
||||
quint16 value = ui->motorMaxSlider->value();
|
||||
m_calibrationUtil->setChannelOutputValue(value);
|
||||
m_actuatorSettings.channels[getCurrentChannel()].channelMax = value;
|
||||
}
|
||||
}
|
||||
|
||||
void OutputCalibrationPage::on_servoCenterButton_toggled(bool checked)
|
||||
{
|
||||
ui->motorNeutralButton->setText(checked ? tr("Stop") : tr("Start"));
|
||||
ui->servoCenterButton->setText(checked ? tr("Stop") : tr("Start"));
|
||||
quint16 channel = getCurrentChannel();
|
||||
m_actuatorSettings.channels[channel].channelNeutral = 1500;
|
||||
onStartButtonToggle(checked, channel, m_actuatorSettings.channels[channel].channelNeutral, 1500, ui->servoCenterSlider);
|
||||
onStartButtonToggle(ui->servoCenterButton, channel, m_actuatorSettings.channels[channel].channelNeutral, 1500, ui->servoCenterSlider);
|
||||
}
|
||||
|
||||
void OutputCalibrationPage::on_servoCenterSlider_valueChanged(int position)
|
||||
{
|
||||
if(ui->servoCenterButton->isChecked()) {
|
||||
m_calibrationUtil->setChannelOutputValue(ui->servoCenterSlider->value());
|
||||
quint16 value = ui->servoCenterSlider->value();
|
||||
m_calibrationUtil->setChannelOutputValue(value);
|
||||
m_actuatorSettings.channels[getCurrentChannel()].channelNeutral = value;
|
||||
}
|
||||
}
|
||||
|
||||
void OutputCalibrationPage::on_servoAngleButton_toggled(bool checked)
|
||||
{
|
||||
|
||||
ui->servoAngleButton->setText(checked ? tr("Stop") : tr("Start"));
|
||||
quint16 channel = getCurrentChannel();
|
||||
ui->servoMinAngleSlider->setValue(m_actuatorSettings.channels[channel].channelMax);
|
||||
onStartButtonToggle(ui->servoAngleButton, channel, m_actuatorSettings.channels[channel].channelMin, 1500, ui->servoMinAngleSlider);
|
||||
}
|
||||
|
||||
void OutputCalibrationPage::on_servoMaxAngleSlider_valueChanged(int position)
|
||||
{
|
||||
|
||||
if(ui->servoAngleButton->isChecked()) {
|
||||
quint16 value = ui->servoMaxAngleSlider->value();
|
||||
m_calibrationUtil->setChannelOutputValue(value);
|
||||
m_actuatorSettings.channels[getCurrentChannel()].channelMax = value;
|
||||
}
|
||||
}
|
||||
|
||||
void OutputCalibrationPage::on_servoMinAngleSlider_valueChanged(int position)
|
||||
{
|
||||
|
||||
if(ui->servoAngleButton->isChecked()) {
|
||||
quint16 value = ui->servoMinAngleSlider->value();
|
||||
m_calibrationUtil->setChannelOutputValue(value);
|
||||
m_actuatorSettings.channels[getCurrentChannel()].channelMin = value;
|
||||
}
|
||||
}
|
||||
|
||||
void OutputCalibrationPage::on_servoMaxAngleSliderRB_toggled(bool checked)
|
||||
{
|
||||
if(ui->servoAngleButton->isChecked() && ui->servoMaxAngleSliderRB->isChecked())
|
||||
{
|
||||
m_calibrationUtil->setChannelOutputValue(ui->servoMaxAngleSlider->value());
|
||||
}
|
||||
}
|
||||
|
||||
void OutputCalibrationPage::on_servoMinAngleSliderRB_toggled(bool checked)
|
||||
{
|
||||
if(ui->servoAngleButton->isChecked() && ui->servoMinAngleSliderRB->isChecked())
|
||||
{
|
||||
m_calibrationUtil->setChannelOutputValue(ui->servoMinAngleSlider->value());
|
||||
}
|
||||
}
|
||||
|
@ -67,6 +67,10 @@ private slots:
|
||||
void on_servoMaxAngleSlider_valueChanged(int position);
|
||||
void on_servoMinAngleSlider_valueChanged(int position);
|
||||
|
||||
void on_servoMaxAngleSliderRB_toggled(bool checked);
|
||||
|
||||
void on_servoMinAngleSliderRB_toggled(bool checked);
|
||||
|
||||
private:
|
||||
void setupVehicle();
|
||||
void startWizard();
|
||||
@ -74,7 +78,8 @@ private:
|
||||
void setupVehicleHighlightedPart();
|
||||
void setWizardPage();
|
||||
void enableButtons(bool enable);
|
||||
void onStartButtonToggle(bool checked, quint16 channel, quint16 &value, quint16 safeValue, QSlider *slider);
|
||||
void onStartButtonToggle(QAbstractButton *button, quint16 channel, quint16 value, quint16 safeValue, QSlider *slider);
|
||||
bool checkAlarms();
|
||||
quint16 getCurrentChannel();
|
||||
|
||||
quint16 getEscUpdateRate(){ return getWizard()->getESCType() == VehicleConfigurationSource::ESC_RAPID ?
|
||||
|
@ -36,7 +36,7 @@
|
||||
</rect>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
<number>1</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="intro">
|
||||
<widget class="QLabel" name="label_3">
|
||||
@ -49,7 +49,7 @@
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string><html><head/><body><p><span style=" font-size:10pt;">It is now time to calibrate the output levels for the signal controlling your vehichle. </span></p><p><span style=" font-size:10pt;">Depending on what vehichle you have selected, both motors controlled by ESC and servos controlled directly by the OpenPilot controller may have to be calibrated. <br/>The following steps will guide you safely through this process.<br/></span></p><p align="center"><span style=" font-size:14pt; font-weight:600; color:#ff0000;">VERY IMPORTANT!</span></p><p align="center"><br/><span style=" font-size:12pt; font-weight:600; color:#ff0000;">REMOVE ALL PROPELLERS FROM THE VEHICHLE BEFORE PROCEEDING!</span></p></body></html></string>
|
||||
<string><html><head/><body><p><span style=" font-size:10pt;">It is now time to calibrate the output levels for the signals controlling your vehichle. </span></p><p align="center"><span style=" font-size:10pt; font-weight:600; color:#ff0000;">VERY IMPORTANT!</span><span style=" font-size:10pt;"><br/></span><span style=" font-size:10pt; font-weight:600; color:#ff0000;">REMOVE ALL PROPELLERS FROM THE VEHICHLE BEFORE PROCEEDING!</span></p><p><span style=" font-size:10pt; color:#000000;">Connect all components according to the illustration on the previous page and provide power using an external power supply like a battery to continue.</span></p><p><span style=" font-size:10pt;">Depending on what vehichle you have selected, both motors controlled by ESC and servos controlled directly by the OpenPilot controller may have to be calibrated. <br/>The following steps will guide you safely through this process.</span></p></body></html></string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
||||
|
@ -43,7 +43,7 @@ p, li { white-space: pre-wrap; }
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="illustrationButton">
|
||||
<widget class="QToolButton" name="illustrationButton">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>460</x>
|
||||
@ -55,10 +55,22 @@ p, li { white-space: pre-wrap; }
|
||||
<property name="toolTip">
|
||||
<string>Show connection diagram for configuration</string>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QToolButton { border: none }</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Hardware
|
||||
Configuration
|
||||
Illustration</string>
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../wizardResources.qrc">
|
||||
<normaloff>:/setupwizard/resources/bttn-illustration-up.png</normaloff>
|
||||
<normalon>:/setupwizard/resources/bttn-illustration-down.png</normalon>:/setupwizard/resources/bttn-illustration-up.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<height>100</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>false</bool>
|
||||
@ -69,8 +81,8 @@ Illustration</string>
|
||||
<property name="autoExclusive">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="flat">
|
||||
<bool>false</bool>
|
||||
<property name="toolButtonStyle">
|
||||
<enum>Qt::ToolButtonIconOnly</enum>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QTextEdit" name="configurationSummary">
|
||||
@ -98,6 +110,8 @@ Illustration</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<resources>
|
||||
<include location="../wizardResources.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
@ -41,6 +41,9 @@ p, li { white-space: pre-wrap; }
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QToolButton" name="surfaceButton">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>430</x>
|
||||
@ -141,6 +144,9 @@ p, li { white-space: pre-wrap; }
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QToolButton" name="fixedwingButton">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>190</x>
|
||||
@ -191,6 +197,9 @@ p, li { white-space: pre-wrap; }
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QToolButton" name="heliButton">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>310</x>
|
||||
|
Binary file not shown.
After Width: | Height: | Size: 6.5 KiB |
Binary file not shown.
After Width: | Height: | Size: 8.2 KiB |
Binary file not shown.
After Width: | Height: | Size: 4.3 KiB |
Binary file not shown.
After Width: | Height: | Size: 6.4 KiB |
File diff suppressed because one or more lines are too long
Before Width: | Height: | Size: 408 KiB After Width: | Height: | Size: 431 KiB |
@ -49,15 +49,17 @@ VehicleConfigurationHelper::VehicleConfigurationHelper(VehicleConfigurationSourc
|
||||
Q_ASSERT(m_uavoManager);
|
||||
}
|
||||
|
||||
bool VehicleConfigurationHelper::setupVehicle()
|
||||
bool VehicleConfigurationHelper::setupVehicle(bool save)
|
||||
{
|
||||
m_progress = 0;
|
||||
clearModifiedObjects();
|
||||
resetVehicleConfig();
|
||||
resetGUIData();
|
||||
if(!saveChangesToController())
|
||||
{
|
||||
return false;
|
||||
if(save) {
|
||||
clearModifiedObjects();
|
||||
resetVehicleConfig();
|
||||
resetGUIData();
|
||||
if(!saveChangesToController())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
applyHardwareConfiguration();
|
||||
@ -67,14 +69,17 @@ bool VehicleConfigurationHelper::setupVehicle()
|
||||
applyLevellingConfiguration();
|
||||
applyStabilizationConfiguration();
|
||||
|
||||
bool result = saveChangesToController();
|
||||
if(result) {
|
||||
emit saveProgress(PROGRESS_STEPS, ++m_progress, tr("Done!"));
|
||||
if(save) {
|
||||
bool result = saveChangesToController();
|
||||
if(result) {
|
||||
emit saveProgress(PROGRESS_STEPS, ++m_progress, tr("Done!"));
|
||||
}
|
||||
else {
|
||||
emit saveProgress(PROGRESS_STEPS, ++m_progress, tr("Failed!"));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
else {
|
||||
emit saveProgress(PROGRESS_STEPS, ++m_progress, tr("Failed!"));
|
||||
}
|
||||
return result;
|
||||
return true;
|
||||
}
|
||||
|
||||
void VehicleConfigurationHelper::addModifiedObject(UAVDataObject *object, QString description)
|
||||
|
@ -60,7 +60,7 @@ class VehicleConfigurationHelper : public QObject
|
||||
|
||||
public:
|
||||
VehicleConfigurationHelper(VehicleConfigurationSource* configSource);
|
||||
bool setupVehicle();
|
||||
bool setupVehicle(bool save = true);
|
||||
static const qint16 LEGACY_ESC_FREQUENCE;
|
||||
static const qint16 RAPID_ESC_FREQUENCE;
|
||||
|
||||
|
@ -30,5 +30,9 @@
|
||||
<file>resources/bttn-turbo-down.png</file>
|
||||
<file>resources/bttn-turbo-up.png</file>
|
||||
<file>resources/multirotor-shapes.svg</file>
|
||||
<file>resources/bttn-illustration-down.png</file>
|
||||
<file>resources/bttn-illustration-up.png</file>
|
||||
<file>resources/bttn-save-down.png</file>
|
||||
<file>resources/bttn-save-up.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
Loading…
x
Reference in New Issue
Block a user