mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-11-29 07:24:13 +01:00
OP-1545 Added GUI to visualize the ESC calibration utput level during calibration.
This commit is contained in:
parent
36c04236e4
commit
decbcb3ee7
@ -40,6 +40,12 @@ EscCalibrationPage::EscCalibrationPage(SetupWizard *wizard, QWidget *parent) :
|
||||
ui(new Ui::EscCalibrationPage), m_isCalibrating(false)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
ui->outputHigh->setEnabled(false);
|
||||
ui->outputLow->setEnabled(true);
|
||||
ui->outputLevel->setEnabled(true);
|
||||
ui->outputLevel->setText(QString(tr("%1 µs")).arg(LOW_PWM_OUTPUT_PULSE_LENGTH_MICROSECONDS));
|
||||
|
||||
connect(ui->startStopButton, SIGNAL(clicked()), this, SLOT(startStopButtonClicked()));
|
||||
|
||||
connect(ui->securityCheckBox1, SIGNAL(toggled(bool)), this, SLOT(securityCheckBoxesToggled()));
|
||||
@ -82,6 +88,9 @@ void EscCalibrationPage::startStopButtonClicked()
|
||||
m_isCalibrating = true;
|
||||
ui->startStopButton->setEnabled(false);
|
||||
enableButtons(false);
|
||||
ui->outputHigh->setEnabled(true);
|
||||
ui->outputLow->setEnabled(false);
|
||||
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>();
|
||||
Q_ASSERT(uavoManager);
|
||||
@ -107,6 +116,9 @@ void EscCalibrationPage::startStopButtonClicked()
|
||||
output->stopChannelOutput();
|
||||
delete output;
|
||||
}
|
||||
ui->outputHigh->setEnabled(false);
|
||||
ui->outputLow->setEnabled(true);
|
||||
ui->outputLevel->setText(QString(tr("%1 µs")).arg(LOW_PWM_OUTPUT_PULSE_LENGTH_MICROSECONDS));
|
||||
m_outputs.clear();
|
||||
m_isCalibrating = false;
|
||||
resetAllSecurityCheckboxes();
|
||||
|
@ -7,7 +7,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>600</width>
|
||||
<height>500</height>
|
||||
<height>507</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@ -64,6 +64,356 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>ESC Output Level</string>
|
||||
</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 {
|
||||
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 {
|
||||
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>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<property name="topMargin">
|
||||
|
Loading…
Reference in New Issue
Block a user