mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-06 21:54:15 +01:00
OP-1685 Adding new artwork for oneshot esc. Adding more configuration logic.
This commit is contained in:
parent
a17553ce30
commit
821573144a
@ -44,8 +44,8 @@ EscPage::~EscPage()
|
|||||||
|
|
||||||
bool EscPage::validatePage()
|
bool EscPage::validatePage()
|
||||||
{
|
{
|
||||||
if (ui->synchedESCButton->isChecked()) {
|
if (ui->oneshotESCButton->isChecked()) {
|
||||||
getWizard()->setEscType(SetupWizard::ESC_SYNCHED);
|
getWizard()->setEscType(SetupWizard::ESC_ONESHOT);
|
||||||
}else if (ui->rapidESCButton->isChecked()) {
|
}else if (ui->rapidESCButton->isChecked()) {
|
||||||
getWizard()->setEscType(SetupWizard::ESC_RAPID);
|
getWizard()->setEscType(SetupWizard::ESC_RAPID);
|
||||||
} else if (ui->defaultESCButton->isChecked()){
|
} else if (ui->defaultESCButton->isChecked()){
|
||||||
@ -54,3 +54,13 @@ bool EscPage::validatePage()
|
|||||||
|
|
||||||
return true;
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -41,9 +41,11 @@ public:
|
|||||||
explicit EscPage(SetupWizard *wizard, QWidget *parent = 0);
|
explicit EscPage(SetupWizard *wizard, QWidget *parent = 0);
|
||||||
~EscPage();
|
~EscPage();
|
||||||
bool validatePage();
|
bool validatePage();
|
||||||
|
void initializePage();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::EscPage *ui;
|
Ui::EscPage *ui;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // ESCPAGE_H
|
#endif // ESCPAGE_H
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>600</width>
|
<width>641</width>
|
||||||
<height>400</height>
|
<height>400</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
@ -140,7 +140,10 @@ p, li { white-space: pre-wrap; }
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QToolButton" name="synchedESCButton">
|
<widget class="QToolButton" name="oneshotESCButton">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
<property name="font">
|
<property name="font">
|
||||||
<font>
|
<font>
|
||||||
<pointsize>10</pointsize>
|
<pointsize>10</pointsize>
|
||||||
@ -153,12 +156,12 @@ p, li { white-space: pre-wrap; }
|
|||||||
<string notr="true">QToolButton { border: none }</string>
|
<string notr="true">QToolButton { border: none }</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Synched ESC</string>
|
<string>OneShot ESC</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../wizardResources.qrc">
|
<iconset resource="../wizardResources.qrc">
|
||||||
<normaloff>:/setupwizard/resources/bttn-rapid-up.png</normaloff>
|
<normaloff>:/setupwizard/resources/bttn-oneshot-up.png</normaloff>
|
||||||
<normalon>:/setupwizard/resources/bttn-rapid-dwn.png</normalon>:/setupwizard/resources/bttn-rapid-up.png</iconset>
|
<normalon>:/setupwizard/resources/bttn-oneshot-dwn.png</normalon>:/setupwizard/resources/bttn-oneshot-up.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="iconSize">
|
<property name="iconSize">
|
||||||
<size>
|
<size>
|
||||||
|
@ -74,6 +74,9 @@ void SavePage::writeToController()
|
|||||||
|
|
||||||
disconnect(&helper, SIGNAL(saveProgress(int, int, QString)), this, SLOT(saveProgress(int, int, QString)));
|
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()));
|
ui->saveProgressLabel->setText(QString("<font color='%1'>%2</font>").arg(m_successfulWrite ? "green" : "red", ui->saveProgressLabel->text()));
|
||||||
|
if (m_successfulWrite) {
|
||||||
|
getWizard()->reboot();
|
||||||
|
}
|
||||||
enableButtons(true);
|
enableButtons(true);
|
||||||
|
|
||||||
emit completeChanged();
|
emit completeChanged();
|
||||||
|
Binary file not shown.
After Width: | Height: | Size: 5.5 KiB |
Binary file not shown.
After Width: | Height: | Size: 6.3 KiB |
@ -385,6 +385,9 @@ QString SetupWizard::getSummaryText()
|
|||||||
case ESC_RAPID:
|
case ESC_RAPID:
|
||||||
summary.append(tr("Rapid ESC (%1 Hz)").arg(VehicleConfigurationHelper::RAPID_ESC_FREQUENCY));
|
summary.append(tr("Rapid ESC (%1 Hz)").arg(VehicleConfigurationHelper::RAPID_ESC_FREQUENCY));
|
||||||
break;
|
break;
|
||||||
|
case ESC_ONESHOT:
|
||||||
|
summary.append(tr("Oneshot ESC"));
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
summary.append(tr("Unknown"));
|
summary.append(tr("Unknown"));
|
||||||
}
|
}
|
||||||
|
@ -179,6 +179,7 @@ public:
|
|||||||
}
|
}
|
||||||
return m_connectionManager;
|
return m_connectionManager;
|
||||||
}
|
}
|
||||||
|
void reboot() const;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void customBackClicked();
|
void customBackClicked();
|
||||||
@ -192,7 +193,6 @@ private:
|
|||||||
void createPages();
|
void createPages();
|
||||||
bool saveHardwareSettings() const;
|
bool saveHardwareSettings() const;
|
||||||
bool canAutoUpdate() const;
|
bool canAutoUpdate() const;
|
||||||
void reboot() const;
|
|
||||||
|
|
||||||
CONTROLLER_TYPE m_controllerType;
|
CONTROLLER_TYPE m_controllerType;
|
||||||
VEHICLE_TYPE m_vehicleType;
|
VEHICLE_TYPE m_vehicleType;
|
||||||
|
@ -373,9 +373,13 @@ void VehicleConfigurationHelper::applyActuatorConfiguration()
|
|||||||
break;
|
break;
|
||||||
case VehicleConfigurationSource::ESC_RAPID:
|
case VehicleConfigurationSource::ESC_RAPID:
|
||||||
escFrequence = RAPID_ESC_FREQUENCY;
|
escFrequence = RAPID_ESC_FREQUENCY;
|
||||||
bankMode = ActuatorSettings::BANKMODE_ONESHOT;
|
if (m_configSource->getInputType() != VehicleConfigurationSource::INPUT_PWM) {
|
||||||
|
bankMode = ActuatorSettings::BANKMODE_ONESHOT;
|
||||||
|
} else {
|
||||||
|
bankMode = ActuatorSettings::BANKMODE_PWM;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case VehicleConfigurationSource::ESC_SYNCHED:
|
case VehicleConfigurationSource::ESC_ONESHOT:
|
||||||
escFrequence = RAPID_ESC_FREQUENCY;
|
escFrequence = RAPID_ESC_FREQUENCY;
|
||||||
bankMode = ActuatorSettings::BANKMODE_ONESHOT125;
|
bankMode = ActuatorSettings::BANKMODE_ONESHOT125;
|
||||||
break;
|
break;
|
||||||
|
@ -63,7 +63,7 @@ public:
|
|||||||
MULTI_ROTOR_OCTO_X, MULTI_ROTOR_OCTO_V, MULTI_ROTOR_OCTO_COAX_X, MULTI_ROTOR_OCTO_COAX_PLUS,
|
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,
|
FIXED_WING_DUAL_AILERON, FIXED_WING_AILERON, FIXED_WING_ELEVON, FIXED_WING_VTAIL, HELI_CCPM,
|
||||||
GROUNDVEHICLE_MOTORCYCLE, GROUNDVEHICLE_CAR, GROUNDVEHICLE_DIFFERENTIAL };
|
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 SERVO_TYPE { SERVO_ANALOG, SERVO_DIGITAL, SERVO_UNKNOWN };
|
||||||
enum INPUT_TYPE { INPUT_PWM, INPUT_PPM, INPUT_SBUS, INPUT_DSM, INPUT_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 };
|
enum AIRSPEED_TYPE { AIRSPEED_ESTIMATE, AIRSPEED_EAGLETREE, AIRSPEED_MS4525, AIRSPEED_DISABLED };
|
||||||
|
@ -52,5 +52,7 @@
|
|||||||
<file>resources/bttn-upgrade-up.png</file>
|
<file>resources/bttn-upgrade-up.png</file>
|
||||||
<file>resources/not-connected.png</file>
|
<file>resources/not-connected.png</file>
|
||||||
<file>resources/connected.png</file>
|
<file>resources/connected.png</file>
|
||||||
|
<file>resources/bttn-oneshot-dwn.png</file>
|
||||||
|
<file>resources/bttn-oneshot-up.png</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user