1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-19 04:52:12 +01:00

OP-1685 Adding new artwork for oneshot esc. Adding more configuration logic.

This commit is contained in:
m_thread 2015-02-17 01:08:23 +01:00
parent a17553ce30
commit 821573144a
11 changed files with 38 additions and 11 deletions

View File

@ -44,8 +44,8 @@ EscPage::~EscPage()
bool EscPage::validatePage()
{
if (ui->synchedESCButton->isChecked()) {
getWizard()->setEscType(SetupWizard::ESC_SYNCHED);
if (ui->oneshotESCButton->isChecked()) {
getWizard()->setEscType(SetupWizard::ESC_ONESHOT);
}else if (ui->rapidESCButton->isChecked()) {
getWizard()->setEscType(SetupWizard::ESC_RAPID);
} else if (ui->defaultESCButton->isChecked()){
@ -54,3 +54,13 @@ bool EscPage::validatePage()
return true;
}
void EscPage::initializePage()
{
ui->oneshotESCButton->setEnabled(getWizard()->getInputType() != SetupWizard::INPUT_PWM);
if (ui->oneshotESCButton->isChecked() && getWizard()->getInputType() == SetupWizard::INPUT_PWM) {
ui->oneshotESCButton->setChecked(false);
ui->rapidESCButton->setChecked(true);
}
}

View File

@ -41,9 +41,11 @@ public:
explicit EscPage(SetupWizard *wizard, QWidget *parent = 0);
~EscPage();
bool validatePage();
void initializePage();
private:
Ui::EscPage *ui;
};
#endif // ESCPAGE_H

View File

@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>600</width>
<width>641</width>
<height>400</height>
</rect>
</property>
@ -140,7 +140,10 @@ p, li { white-space: pre-wrap; }
</widget>
</item>
<item>
<widget class="QToolButton" name="synchedESCButton">
<widget class="QToolButton" name="oneshotESCButton">
<property name="enabled">
<bool>false</bool>
</property>
<property name="font">
<font>
<pointsize>10</pointsize>
@ -153,12 +156,12 @@ p, li { white-space: pre-wrap; }
<string notr="true">QToolButton { border: none }</string>
</property>
<property name="text">
<string>Synched ESC</string>
<string>OneShot ESC</string>
</property>
<property name="icon">
<iconset resource="../wizardResources.qrc">
<normaloff>:/setupwizard/resources/bttn-rapid-up.png</normaloff>
<normalon>:/setupwizard/resources/bttn-rapid-dwn.png</normalon>:/setupwizard/resources/bttn-rapid-up.png</iconset>
<normaloff>:/setupwizard/resources/bttn-oneshot-up.png</normaloff>
<normalon>:/setupwizard/resources/bttn-oneshot-dwn.png</normalon>:/setupwizard/resources/bttn-oneshot-up.png</iconset>
</property>
<property name="iconSize">
<size>

View File

@ -74,6 +74,9 @@ void SavePage::writeToController()
disconnect(&helper, SIGNAL(saveProgress(int, int, QString)), this, SLOT(saveProgress(int, int, QString)));
ui->saveProgressLabel->setText(QString("<font color='%1'>%2</font>").arg(m_successfulWrite ? "green" : "red", ui->saveProgressLabel->text()));
if (m_successfulWrite) {
getWizard()->reboot();
}
enableButtons(true);
emit completeChanged();

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

View File

@ -385,6 +385,9 @@ QString SetupWizard::getSummaryText()
case ESC_RAPID:
summary.append(tr("Rapid ESC (%1 Hz)").arg(VehicleConfigurationHelper::RAPID_ESC_FREQUENCY));
break;
case ESC_ONESHOT:
summary.append(tr("Oneshot ESC"));
break;
default:
summary.append(tr("Unknown"));
}

View File

@ -179,6 +179,7 @@ public:
}
return m_connectionManager;
}
void reboot() const;
private slots:
void customBackClicked();
@ -192,7 +193,6 @@ private:
void createPages();
bool saveHardwareSettings() const;
bool canAutoUpdate() const;
void reboot() const;
CONTROLLER_TYPE m_controllerType;
VEHICLE_TYPE m_vehicleType;

View File

@ -373,9 +373,13 @@ void VehicleConfigurationHelper::applyActuatorConfiguration()
break;
case VehicleConfigurationSource::ESC_RAPID:
escFrequence = RAPID_ESC_FREQUENCY;
if (m_configSource->getInputType() != VehicleConfigurationSource::INPUT_PWM) {
bankMode = ActuatorSettings::BANKMODE_ONESHOT;
} else {
bankMode = ActuatorSettings::BANKMODE_PWM;
}
break;
case VehicleConfigurationSource::ESC_SYNCHED:
case VehicleConfigurationSource::ESC_ONESHOT:
escFrequence = RAPID_ESC_FREQUENCY;
bankMode = ActuatorSettings::BANKMODE_ONESHOT125;
break;

View File

@ -63,7 +63,7 @@ public:
MULTI_ROTOR_OCTO_X, MULTI_ROTOR_OCTO_V, MULTI_ROTOR_OCTO_COAX_X, MULTI_ROTOR_OCTO_COAX_PLUS,
FIXED_WING_DUAL_AILERON, FIXED_WING_AILERON, FIXED_WING_ELEVON, FIXED_WING_VTAIL, HELI_CCPM,
GROUNDVEHICLE_MOTORCYCLE, GROUNDVEHICLE_CAR, GROUNDVEHICLE_DIFFERENTIAL };
enum ESC_TYPE { ESC_SYNCHED, ESC_RAPID, ESC_STANDARD, ESC_UNKNOWN };
enum ESC_TYPE { ESC_ONESHOT, ESC_RAPID, ESC_STANDARD, ESC_UNKNOWN };
enum SERVO_TYPE { SERVO_ANALOG, SERVO_DIGITAL, SERVO_UNKNOWN };
enum INPUT_TYPE { INPUT_PWM, INPUT_PPM, INPUT_SBUS, INPUT_DSM, INPUT_UNKNOWN };
enum AIRSPEED_TYPE { AIRSPEED_ESTIMATE, AIRSPEED_EAGLETREE, AIRSPEED_MS4525, AIRSPEED_DISABLED };

View File

@ -52,5 +52,7 @@
<file>resources/bttn-upgrade-up.png</file>
<file>resources/not-connected.png</file>
<file>resources/connected.png</file>
<file>resources/bttn-oneshot-dwn.png</file>
<file>resources/bttn-oneshot-up.png</file>
</qresource>
</RCC>