1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-18 03:52:11 +01:00

Merge remote-tracking branch 'origin/thread/OP-1556_ESC_Range' into rel-14.10

This commit is contained in:
Fredrik Larsson 2014-10-28 04:09:03 +11:00
commit 269fa51c44
7 changed files with 457 additions and 366 deletions

View File

@ -46,9 +46,10 @@ EscCalibrationPage::EscCalibrationPage(SetupWizard *wizard, QWidget *parent) :
ui->outputHigh->setEnabled(false);
ui->outputLow->setEnabled(true);
ui->outputLevel->setEnabled(true);
ui->outputLevel->setText(QString(tr("%1 µs")).arg(0));
ui->outputLevel->setText(QString(tr("%1 µs")).arg(OFF_PWM_OUTPUT_PULSE_LENGTH_MICROSECONDS));
connect(ui->startStopButton, SIGNAL(clicked()), this, SLOT(startStopButtonClicked()));
connect(ui->startButton, SIGNAL(clicked()), this, SLOT(startButtonClicked()));
connect(ui->stopButton, SIGNAL(clicked()), this, SLOT(stopButtonClicked()));
connect(ui->securityCheckBox1, SIGNAL(toggled(bool)), this, SLOT(securityCheckBoxesToggled()));
connect(ui->securityCheckBox2, SIGNAL(toggled(bool)), this, SLOT(securityCheckBoxesToggled()));
@ -84,14 +85,16 @@ void EscCalibrationPage::resetAllSecurityCheckboxes()
ui->securityCheckBox3->setChecked(false);
}
void EscCalibrationPage::startStopButtonClicked()
void EscCalibrationPage::startButtonClicked()
{
if (!m_isCalibrating) {
m_isCalibrating = true;
ui->startStopButton->setEnabled(false);
ui->startButton->setEnabled(false);
enableButtons(false);
ui->outputHigh->setEnabled(true);
ui->outputLow->setEnabled(false);
ui->nonconnectedLabel->setEnabled(false);
ui->connectedLabel->setEnabled(true);
ui->outputLevel->setText(QString(tr("%1 µs")).arg(HIGH_PWM_OUTPUT_PULSE_LENGTH_MICROSECONDS));
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
UAVObjectManager *uavoManager = pm->getObject<UAVObjectManager>();
@ -104,43 +107,59 @@ void EscCalibrationPage::startStopButtonClicked()
Q_ASSERT(field);
if (field->getValue().toString() == field->getOptions().at(VehicleConfigurationHelper::MIXER_TYPE_MOTOR)) {
OutputCalibrationUtil *output = new OutputCalibrationUtil();
output->startChannelOutput(i, 0);
output->startChannelOutput(i, OFF_PWM_OUTPUT_PULSE_LENGTH_MICROSECONDS);
output->setChannelOutputValue(HIGH_PWM_OUTPUT_PULSE_LENGTH_MICROSECONDS);
m_outputs << output;
}
}
ui->startStopButton->setText(tr("Stop"));
ui->startStopButton->setEnabled(true);
} else {
m_isCalibrating = false;
ui->startStopButton->setEnabled(false);
ui->stopButton->setEnabled(true);
}
}
void EscCalibrationPage::stopButtonClicked()
{
if (m_isCalibrating) {
ui->stopButton->setEnabled(false);
ui->outputHigh->setEnabled(false);
// Set to low pwm out
foreach(OutputCalibrationUtil * output, m_outputs) {
output->setChannelOutputValue(LOW_PWM_OUTPUT_PULSE_LENGTH_MICROSECONDS);
}
ui->outputLevel->setText(QString(tr("%1 µs")).arg(LOW_PWM_OUTPUT_PULSE_LENGTH_MICROSECONDS));
QApplication::processEvents();
QThread::msleep(2000);
qApp->processEvents(QEventLoop::AllEvents);
QThread::msleep(1000);
// Ramp down to off pwm out
for (int i = LOW_PWM_OUTPUT_PULSE_LENGTH_MICROSECONDS; i >= OFF_PWM_OUTPUT_PULSE_LENGTH_MICROSECONDS; i -= 10) {
foreach(OutputCalibrationUtil * output, m_outputs) {
output->setChannelOutputValue(i);
}
ui->outputLevel->setText(QString(tr("%1 µs")).arg(i));
QApplication::processEvents();
QThread::msleep(200);
}
// Stop output
foreach(OutputCalibrationUtil * output, m_outputs) {
output->stopChannelOutput();
delete output;
}
ui->outputLevel->setText(QString(tr("%1 µs")).arg(0));
ui->outputLevel->setText(QString(tr("%1 µs")).arg(OFF_PWM_OUTPUT_PULSE_LENGTH_MICROSECONDS));
ui->outputHigh->setEnabled(false);
ui->outputLow->setEnabled(true);
ui->nonconnectedLabel->setEnabled(true);
ui->connectedLabel->setEnabled(false);
m_outputs.clear();
m_isCalibrating = false;
resetAllSecurityCheckboxes();
ui->startStopButton->setText(tr("Start"));
enableButtons(true);
}
}
void EscCalibrationPage::securityCheckBoxesToggled()
{
ui->startStopButton->setEnabled(ui->securityCheckBox1->isChecked() &&
ui->startButton->setEnabled(ui->securityCheckBox1->isChecked() &&
ui->securityCheckBox2->isChecked() &&
ui->securityCheckBox3->isChecked());
}

View File

@ -46,13 +46,15 @@ public:
void initializePage();
private slots:
void startStopButtonClicked();
void startButtonClicked();
void stopButtonClicked();
void securityCheckBoxesToggled();
void enableButtons(bool enable);
void resetAllSecurityCheckboxes();
private:
static const int LOW_PWM_OUTPUT_PULSE_LENGTH_MICROSECONDS = 1000;
static const int LOW_PWM_OUTPUT_PULSE_LENGTH_MICROSECONDS = 1050;
static const int OFF_PWM_OUTPUT_PULSE_LENGTH_MICROSECONDS = 900;
static const int HIGH_PWM_OUTPUT_PULSE_LENGTH_MICROSECONDS = 1900;
Ui::EscCalibrationPage *ui;
bool m_isCalibrating;

View File

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>600</width>
<height>507</height>
<height>585</height>
</rect>
</property>
<property name="windowTitle">
@ -16,6 +16,12 @@
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="label">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-size:12pt; font-weight:600;&quot;&gt;OpenPilot ESC Calibration Procedure&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot; font-size:10pt;&quot;&gt;As you have selected to use a MultiRotor and Fast / Flashed ESCs, we need to calibrate the endpoints of these ESCs so they can see the full throttle range sent from the flight controller. &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot; font-size:10pt;&quot;&gt;This part of the wizard will tell you to connect the battery to your aircraft, before doing so you absolutely &lt;/span&gt;&lt;span style=&quot; font-size:10pt; font-weight:600; color:#f30f1d;&quot;&gt;must remove the propellers from all motors&lt;/span&gt;&lt;span style=&quot; font-size:10pt;&quot;&gt;. &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot; font-size:10pt;&quot;&gt;The steps to perform this calibration are as follows:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot; font-size:10pt;&quot;&gt;1. Confirm all safety questions&lt;br/&gt;2. Press the Start button when it becomes enabled&lt;br/&gt;3. Connect the battery to your airframe&lt;br/&gt;4. Wait for ESC calibration beep(s)&lt;br/&gt;5. Press the Stop button&lt;br/&gt;6. Wait for ESC confirmation beep(s)&lt;br/&gt;7. Disconnect battery&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
@ -65,354 +71,403 @@
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>ESC Output Level</string>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<property name="topMargin">
<number>0</number>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="leftMargin">
<number>9</number>
</property>
<property name="rightMargin">
<number>9</number>
</property>
<property name="bottomMargin">
<number>9</number>
</property>
<item>
<widget class="QPushButton" name="outputLow">
<property name="enabled">
<bool>false</bool>
</property>
<property name="minimumSize">
<size>
<width>100</width>
<height>22</height>
</size>
</property>
<property name="palette">
<palette>
<active>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Button">
<brush brushstyle="LinearGradientPattern">
<gradient startx="0.507000000000000" starty="0.000000000000000" endx="0.507000000000000" endy="0.772000000000000" type="LinearGradient" spread="ReflectSpread" coordinatemode="ObjectBoundingMode">
<gradientstop position="0.208955000000000">
<color alpha="255">
<red>34</red>
<green>34</green>
<blue>200</blue>
</color>
</gradientstop>
<gradientstop position="0.786070000000000">
<color alpha="255">
<red>6</red>
<green>6</green>
<blue>150</blue>
</color>
</gradientstop>
</gradient>
</brush>
</colorrole>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base">
<brush brushstyle="LinearGradientPattern">
<gradient startx="0.507000000000000" starty="0.000000000000000" endx="0.507000000000000" endy="0.772000000000000" type="LinearGradient" spread="ReflectSpread" coordinatemode="ObjectBoundingMode">
<gradientstop position="0.208955000000000">
<color alpha="255">
<red>34</red>
<green>34</green>
<blue>200</blue>
</color>
</gradientstop>
<gradientstop position="0.786070000000000">
<color alpha="255">
<red>6</red>
<green>6</green>
<blue>150</blue>
</color>
</gradientstop>
</gradient>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="LinearGradientPattern">
<gradient startx="0.507000000000000" starty="0.000000000000000" endx="0.507000000000000" endy="0.772000000000000" type="LinearGradient" spread="ReflectSpread" coordinatemode="ObjectBoundingMode">
<gradientstop position="0.208955000000000">
<color alpha="255">
<red>34</red>
<green>34</green>
<blue>200</blue>
</color>
</gradientstop>
<gradientstop position="0.786070000000000">
<color alpha="255">
<red>6</red>
<green>6</green>
<blue>150</blue>
</color>
</gradientstop>
</gradient>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Button">
<brush brushstyle="LinearGradientPattern">
<gradient startx="0.507000000000000" starty="0.000000000000000" endx="0.507000000000000" endy="0.772000000000000" type="LinearGradient" spread="ReflectSpread" coordinatemode="ObjectBoundingMode">
<gradientstop position="0.208955000000000">
<color alpha="255">
<red>34</red>
<green>34</green>
<blue>200</blue>
</color>
</gradientstop>
<gradientstop position="0.786070000000000">
<color alpha="255">
<red>6</red>
<green>6</green>
<blue>150</blue>
</color>
</gradientstop>
</gradient>
</brush>
</colorrole>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base">
<brush brushstyle="LinearGradientPattern">
<gradient startx="0.507000000000000" starty="0.000000000000000" endx="0.507000000000000" endy="0.772000000000000" type="LinearGradient" spread="ReflectSpread" coordinatemode="ObjectBoundingMode">
<gradientstop position="0.208955000000000">
<color alpha="255">
<red>34</red>
<green>34</green>
<blue>200</blue>
</color>
</gradientstop>
<gradientstop position="0.786070000000000">
<color alpha="255">
<red>6</red>
<green>6</green>
<blue>150</blue>
</color>
</gradientstop>
</gradient>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="LinearGradientPattern">
<gradient startx="0.507000000000000" starty="0.000000000000000" endx="0.507000000000000" endy="0.772000000000000" type="LinearGradient" spread="ReflectSpread" coordinatemode="ObjectBoundingMode">
<gradientstop position="0.208955000000000">
<color alpha="255">
<red>34</red>
<green>34</green>
<blue>200</blue>
</color>
</gradientstop>
<gradientstop position="0.786070000000000">
<color alpha="255">
<red>6</red>
<green>6</green>
<blue>150</blue>
</color>
</gradientstop>
</gradient>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>159</red>
<green>158</green>
<blue>158</blue>
</color>
</brush>
</colorrole>
<colorrole role="Button">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>100</red>
<green>150</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>159</red>
<green>158</green>
<blue>158</blue>
</color>
</brush>
</colorrole>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>159</red>
<green>158</green>
<blue>158</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>242</red>
<green>241</green>
<blue>240</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="styleSheet">
<string notr="true">QPushButton:enabled {
<item>
<widget class="QLabel" name="nonconnectedLabel">
<property name="minimumSize">
<size>
<width>155</width>
<height>70</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>155</width>
<height>70</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="../wizardResources.qrc">:/setupwizard/resources/not-connected.png</pixmap>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="connectedLabel">
<property name="enabled">
<bool>false</bool>
</property>
<property name="minimumSize">
<size>
<width>155</width>
<height>70</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>155</width>
<height>70</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="../wizardResources.qrc">:/setupwizard/resources/connected.png</pixmap>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<property name="topMargin">
<number>0</number>
</property>
<item>
<widget class="QPushButton" name="outputLow">
<property name="enabled">
<bool>false</bool>
</property>
<property name="minimumSize">
<size>
<width>100</width>
<height>22</height>
</size>
</property>
<property name="palette">
<palette>
<active>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Button">
<brush brushstyle="LinearGradientPattern">
<gradient startx="0.507000000000000" starty="0.000000000000000" endx="0.507000000000000" endy="0.772000000000000" type="LinearGradient" spread="ReflectSpread" coordinatemode="ObjectBoundingMode">
<gradientstop position="0.208955000000000">
<color alpha="255">
<red>34</red>
<green>34</green>
<blue>200</blue>
</color>
</gradientstop>
<gradientstop position="0.786070000000000">
<color alpha="255">
<red>6</red>
<green>6</green>
<blue>150</blue>
</color>
</gradientstop>
</gradient>
</brush>
</colorrole>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base">
<brush brushstyle="LinearGradientPattern">
<gradient startx="0.507000000000000" starty="0.000000000000000" endx="0.507000000000000" endy="0.772000000000000" type="LinearGradient" spread="ReflectSpread" coordinatemode="ObjectBoundingMode">
<gradientstop position="0.208955000000000">
<color alpha="255">
<red>34</red>
<green>34</green>
<blue>200</blue>
</color>
</gradientstop>
<gradientstop position="0.786070000000000">
<color alpha="255">
<red>6</red>
<green>6</green>
<blue>150</blue>
</color>
</gradientstop>
</gradient>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="LinearGradientPattern">
<gradient startx="0.507000000000000" starty="0.000000000000000" endx="0.507000000000000" endy="0.772000000000000" type="LinearGradient" spread="ReflectSpread" coordinatemode="ObjectBoundingMode">
<gradientstop position="0.208955000000000">
<color alpha="255">
<red>34</red>
<green>34</green>
<blue>200</blue>
</color>
</gradientstop>
<gradientstop position="0.786070000000000">
<color alpha="255">
<red>6</red>
<green>6</green>
<blue>150</blue>
</color>
</gradientstop>
</gradient>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Button">
<brush brushstyle="LinearGradientPattern">
<gradient startx="0.507000000000000" starty="0.000000000000000" endx="0.507000000000000" endy="0.772000000000000" type="LinearGradient" spread="ReflectSpread" coordinatemode="ObjectBoundingMode">
<gradientstop position="0.208955000000000">
<color alpha="255">
<red>34</red>
<green>34</green>
<blue>200</blue>
</color>
</gradientstop>
<gradientstop position="0.786070000000000">
<color alpha="255">
<red>6</red>
<green>6</green>
<blue>150</blue>
</color>
</gradientstop>
</gradient>
</brush>
</colorrole>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base">
<brush brushstyle="LinearGradientPattern">
<gradient startx="0.507000000000000" starty="0.000000000000000" endx="0.507000000000000" endy="0.772000000000000" type="LinearGradient" spread="ReflectSpread" coordinatemode="ObjectBoundingMode">
<gradientstop position="0.208955000000000">
<color alpha="255">
<red>34</red>
<green>34</green>
<blue>200</blue>
</color>
</gradientstop>
<gradientstop position="0.786070000000000">
<color alpha="255">
<red>6</red>
<green>6</green>
<blue>150</blue>
</color>
</gradientstop>
</gradient>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="LinearGradientPattern">
<gradient startx="0.507000000000000" starty="0.000000000000000" endx="0.507000000000000" endy="0.772000000000000" type="LinearGradient" spread="ReflectSpread" coordinatemode="ObjectBoundingMode">
<gradientstop position="0.208955000000000">
<color alpha="255">
<red>34</red>
<green>34</green>
<blue>200</blue>
</color>
</gradientstop>
<gradientstop position="0.786070000000000">
<color alpha="255">
<red>6</red>
<green>6</green>
<blue>150</blue>
</color>
</gradientstop>
</gradient>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>159</red>
<green>158</green>
<blue>158</blue>
</color>
</brush>
</colorrole>
<colorrole role="Button">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>100</red>
<green>150</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>159</red>
<green>158</green>
<blue>158</blue>
</color>
</brush>
</colorrole>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>159</red>
<green>158</green>
<blue>158</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>242</red>
<green>241</green>
<blue>240</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="styleSheet">
<string notr="true">QPushButton:enabled {
background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(34, 34, 200, 255), stop:0.78607 rgba(6, 6, 150, 255));
color: rgb(255, 255, 255);
border-radius: 5;
}</string>
</property>
<property name="text">
<string>Low/Off</string>
</property>
<property name="flat">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="Line" name="line">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="frameShadow">
<enum>QFrame::Sunken</enum>
</property>
<property name="lineWidth">
<number>1</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="outputLevel">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>N/A</string>
</property>
</widget>
</item>
<item>
<widget class="Line" name="line_2">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="outputHigh">
<property name="enabled">
<bool>false</bool>
</property>
<property name="minimumSize">
<size>
<width>100</width>
<height>22</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">QPushButton:enabled {
</property>
<property name="text">
<string>Low/Off</string>
</property>
<property name="flat">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="Line" name="line">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="frameShadow">
<enum>QFrame::Sunken</enum>
</property>
<property name="lineWidth">
<number>1</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="outputLevel">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>N/A</string>
</property>
</widget>
</item>
<item>
<widget class="Line" name="line_2">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="outputHigh">
<property name="enabled">
<bool>false</bool>
</property>
<property name="minimumSize">
<size>
<width>100</width>
<height>22</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">QPushButton:enabled {
background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(200, 14, 14, 255), stop:0.78607 rgba(160, 6, 6, 255));
color: rgb(255, 255, 255);
border-radius: 5;
}</string>
</property>
<property name="text">
<string>High</string>
</property>
<property name="flat">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</property>
<property name="text">
<string>High</string>
</property>
<property name="flat">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
@ -433,7 +488,7 @@
</spacer>
</item>
<item>
<widget class="QPushButton" name="startStopButton">
<widget class="QPushButton" name="startButton">
<property name="enabled">
<bool>false</bool>
</property>
@ -448,6 +503,22 @@
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="stopButton">
<property name="enabled">
<bool>false</bool>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Stop</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
@ -482,8 +553,10 @@
<tabstop>securityCheckBox1</tabstop>
<tabstop>securityCheckBox2</tabstop>
<tabstop>securityCheckBox3</tabstop>
<tabstop>startStopButton</tabstop>
<tabstop>startButton</tabstop>
</tabstops>
<resources/>
<resources>
<include location="../wizardResources.qrc"/>
</resources>
<connections/>
</ui>

View File

@ -376,12 +376,7 @@ void OutputCalibrationPage::on_motorNeutralButton_toggled(bool checked)
ui->motorNeutralButton->setText(checked ? tr("Stop") : tr("Start"));
ui->motorNeutralSlider->setEnabled(checked);
quint16 channel = getCurrentChannel();
quint16 safeValue = 0;
if (!checked) {
// Set pwm output to 1000/low for 500ms before turning it to 0
m_calibrationUtil->setChannelOutputValue(1000);
QThread::msleep(500);
}
quint16 safeValue = m_actuatorSettings[channel].channelMin;
onStartButtonToggle(ui->motorNeutralButton, channel, m_actuatorSettings[channel].channelNeutral, safeValue, ui->motorNeutralSlider);
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

View File

@ -48,5 +48,7 @@
<file>resources/bttn-flash-up.png</file>
<file>resources/bttn-upgrade-down.png</file>
<file>resources/bttn-upgrade-up.png</file>
<file>resources/not-connected.png</file>
<file>resources/connected.png</file>
</qresource>
</RCC>