1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-02-21 11:54:15 +01:00

OP-1166 Fixes the maxed out bug and beautifies some gui.

This commit is contained in:
Fredrik Arvidsson 2014-01-21 00:06:20 +01:00
parent e14acffd5c
commit 4cac7d18ac
6 changed files with 353 additions and 246 deletions

View File

@ -79,16 +79,20 @@ ConfigInputWidget::ConfigInputWidget(QWidget *parent) :
unsigned int indexRT = 0; unsigned int indexRT = 0;
foreach(QString name, manualSettingsObj->getField("ChannelNumber")->getElementNames()) { foreach(QString name, manualSettingsObj->getField("ChannelNumber")->getElementNames()) {
Q_ASSERT(index < ManualControlSettings::CHANNELGROUPS_NUMELEM); Q_ASSERT(index < ManualControlSettings::CHANNELGROUPS_NUMELEM);
inputChannelForm *inpForm = new inputChannelForm(this, index == 0); InputChannelForm *inpForm = new InputChannelForm(this, index == 0);
ui->channelSettings->layout()->addWidget(inpForm); // Add the row to the UI ui->channelSettings->layout()->addWidget(inpForm); // Add the row to the UI
inpForm->setName(name); inpForm->setName(name);
addWidgetBinding("ManualControlSettings", "ChannelGroups", inpForm->ui->channelGroup, index); addWidgetBinding("ManualControlSettings", "ChannelGroups", inpForm->ui->channelGroup, index);
addWidgetBinding("ManualControlSettings", "ChannelNumber", inpForm->ui->channelNumber, index); addWidgetBinding("ManualControlSettings", "ChannelNumber", inpForm->ui->channelNumber, index);
addWidgetBinding("ManualControlSettings", "ChannelMin", inpForm->ui->channelMin, index);
// The order of the following three binding calls is important. Since the values will be populated
// in reverse order of the binding order otherwise the 'Reversed' logic will floor the neutral value
// to the max value ( which is smaller than the neutral value when reversed )
addWidgetBinding("ManualControlSettings", "ChannelNeutral", inpForm->ui->channelNeutral, index); addWidgetBinding("ManualControlSettings", "ChannelNeutral", inpForm->ui->channelNeutral, index);
addWidgetBinding("ManualControlSettings", "ChannelMin", inpForm->ui->channelMin, index);
addWidgetBinding("ManualControlSettings", "ChannelMax", inpForm->ui->channelMax, index); addWidgetBinding("ManualControlSettings", "ChannelMax", inpForm->ui->channelMax, index);
addWidget(inpForm->ui->channelNumberDropdown); addWidget(inpForm->ui->channelNumberDropdown);
addWidget(inpForm->ui->channelRev);
addWidget(inpForm->ui->channelResponseTime); addWidget(inpForm->ui->channelResponseTime);
// Input filter response time fields supported for some channels only // Input filter response time fields supported for some channels only

View File

@ -128,8 +128,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>768</width> <width>766</width>
<height>742</height> <height>745</height>
</rect> </rect>
</property> </property>
<layout class="QGridLayout" name="gridLayout"> <layout class="QGridLayout" name="gridLayout">
@ -151,7 +151,7 @@
<item row="1" column="0"> <item row="1" column="0">
<widget class="QGroupBox" name="groupBox_5"> <widget class="QGroupBox" name="groupBox_5">
<property name="title"> <property name="title">
<string/> <string>Input Channel Configuration</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_6"> <layout class="QVBoxLayout" name="verticalLayout_6">
<property name="leftMargin"> <property name="leftMargin">
@ -277,13 +277,6 @@
</property> </property>
</spacer> </spacer>
</item> </item>
<item>
<widget class="Line" name="line_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
<widget class="QWidget" name="wizard"> <widget class="QWidget" name="wizard">
@ -388,6 +381,12 @@
</item> </item>
<item> <item>
<widget class="QPushButton" name="configurationWizard"> <widget class="QPushButton" name="configurationWizard">
<property name="minimumSize">
<size>
<width>210</width>
<height>0</height>
</size>
</property>
<property name="text"> <property name="text">
<string>Start Configuration Wizard</string> <string>Start Configuration Wizard</string>
</property> </property>
@ -559,8 +558,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>768</width> <width>766</width>
<height>742</height> <height>745</height>
</rect> </rect>
</property> </property>
<layout class="QGridLayout" name="gridLayout_7" rowstretch="1,0,0,0"> <layout class="QGridLayout" name="gridLayout_7" rowstretch="1,0,0,0">
@ -2183,8 +2182,8 @@ Setup the flight mode channel on the RC Input tab if you have not done so alread
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>504</width> <width>766</width>
<height>156</height> <height>745</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_2"> <layout class="QVBoxLayout" name="verticalLayout_2">

View File

@ -4,9 +4,9 @@
#include "manualcontrolsettings.h" #include "manualcontrolsettings.h"
#include "gcsreceiver.h" #include "gcsreceiver.h"
inputChannelForm::inputChannelForm(QWidget *parent, bool showlegend) : InputChannelForm::InputChannelForm(QWidget *parent, bool showlegend) :
ConfigTaskWidget(parent), ConfigTaskWidget(parent),
ui(new Ui::inputChannelForm) ui(new Ui::InputChannelForm)
{ {
ui->setupUi(this); ui->setupUi(this);
@ -19,6 +19,7 @@ inputChannelForm::inputChannelForm(QWidget *parent, bool showlegend) :
layout()->removeWidget(ui->legend4); layout()->removeWidget(ui->legend4);
layout()->removeWidget(ui->legend5); layout()->removeWidget(ui->legend5);
layout()->removeWidget(ui->legend6); layout()->removeWidget(ui->legend6);
layout()->removeWidget(ui->legend7);
delete ui->legend0; delete ui->legend0;
delete ui->legend1; delete ui->legend1;
delete ui->legend2; delete ui->legend2;
@ -26,6 +27,7 @@ inputChannelForm::inputChannelForm(QWidget *parent, bool showlegend) :
delete ui->legend4; delete ui->legend4;
delete ui->legend5; delete ui->legend5;
delete ui->legend6; delete ui->legend6;
delete ui->legend7;
} }
connect(ui->channelMin, SIGNAL(valueChanged(int)), this, SLOT(minMaxUpdated())); connect(ui->channelMin, SIGNAL(valueChanged(int)), this, SLOT(minMaxUpdated()));
@ -43,17 +45,17 @@ inputChannelForm::inputChannelForm(QWidget *parent, bool showlegend) :
} }
inputChannelForm::~inputChannelForm() InputChannelForm::~InputChannelForm()
{ {
delete ui; delete ui;
} }
void inputChannelForm::setName(QString &name) void InputChannelForm::setName(QString &name)
{ {
ui->channelName->setText(name); ui->channelName->setText(name);
QFontMetrics metrics(ui->channelName->font()); QFontMetrics metrics(ui->channelName->font());
int width = metrics.width(name) + 5; int width = metrics.width(name) + 5;
foreach(inputChannelForm * form, parent()->findChildren<inputChannelForm *>()) { foreach(InputChannelForm * form, parent()->findChildren<InputChannelForm *>()) {
if (form == this) { if (form == this) {
continue; continue;
} }
@ -69,7 +71,7 @@ void inputChannelForm::setName(QString &name)
/** /**
* Update the direction of the slider and boundaries * Update the direction of the slider and boundaries
*/ */
void inputChannelForm::minMaxUpdated() void InputChannelForm::minMaxUpdated()
{ {
bool reverse = ui->channelMin->value() > ui->channelMax->value(); bool reverse = ui->channelMin->value() > ui->channelMax->value();
@ -85,7 +87,7 @@ void inputChannelForm::minMaxUpdated()
ui->channelNeutral->setInvertedControls(reverse); ui->channelNeutral->setInvertedControls(reverse);
} }
void inputChannelForm::neutralUpdated(int newval) void InputChannelForm::neutralUpdated(int newval)
{ {
ui->neutral->setText(QString::number(newval)); ui->neutral->setText(QString::number(newval));
} }
@ -96,7 +98,7 @@ void inputChannelForm::neutralUpdated(int newval)
* I fully admit this is terrible practice to embed data within UI * I fully admit this is terrible practice to embed data within UI
* like this. Open to suggestions. JC 2011-09-07 * like this. Open to suggestions. JC 2011-09-07
*/ */
void inputChannelForm::groupUpdated() void InputChannelForm::groupUpdated()
{ {
ui->channelNumberDropdown->clear(); ui->channelNumberDropdown->clear();
ui->channelNumberDropdown->addItem("Disabled"); ui->channelNumberDropdown->addItem("Disabled");
@ -140,7 +142,7 @@ void inputChannelForm::groupUpdated()
/** /**
* Update the dropdown from the hidden control * Update the dropdown from the hidden control
*/ */
void inputChannelForm::channelDropdownUpdated(int newval) void InputChannelForm::channelDropdownUpdated(int newval)
{ {
ui->channelNumber->setValue(newval); ui->channelNumber->setValue(newval);
} }
@ -148,7 +150,7 @@ void inputChannelForm::channelDropdownUpdated(int newval)
/** /**
* Update the hidden control from the dropdown * Update the hidden control from the dropdown
*/ */
void inputChannelForm::channelNumberUpdated(int newval) void InputChannelForm::channelNumberUpdated(int newval)
{ {
ui->channelNumberDropdown->setCurrentIndex(newval); ui->channelNumberDropdown->setCurrentIndex(newval);
} }

View File

@ -4,15 +4,15 @@
#include <QWidget> #include <QWidget>
#include "configinputwidget.h" #include "configinputwidget.h"
namespace Ui { namespace Ui {
class inputChannelForm; class InputChannelForm;
} }
class inputChannelForm : public ConfigTaskWidget { class InputChannelForm : public ConfigTaskWidget {
Q_OBJECT Q_OBJECT
public: public:
explicit inputChannelForm(QWidget *parent = 0, bool showlegend = false); explicit InputChannelForm(QWidget *parent = 0, bool showlegend = false);
~inputChannelForm(); ~InputChannelForm();
friend class ConfigInputWidget; friend class ConfigInputWidget;
void setName(QString &name); void setName(QString &name);
private slots: private slots:
@ -23,7 +23,7 @@ private slots:
void channelNumberUpdated(int); void channelNumberUpdated(int);
private: private:
Ui::inputChannelForm *ui; Ui::InputChannelForm *ui;
}; };
#endif // INPUTCHANNELFORM_H #endif // INPUTCHANNELFORM_H

View File

@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>inputChannelForm</class> <class>InputChannelForm</class>
<widget class="QWidget" name="inputChannelForm"> <widget class="QWidget" name="InputChannelForm">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>828</width> <width>828</width>
<height>69</height> <height>93</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
@ -26,6 +26,169 @@
<property name="bottomMargin"> <property name="bottomMargin">
<number>6</number> <number>6</number>
</property> </property>
<item row="0" column="5" colspan="2">
<widget class="QLabel" name="legend4">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
<property name="font">
<font>
<weight>75</weight>
<italic>false</italic>
<bold>true</bold>
</font>
</property>
<property name="toolTip">
<string>Channel neutral</string>
</property>
<property name="styleSheet">
<string notr="true">background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(74, 74, 74, 255), stop:0.78607 rgba(36, 36, 36, 255));
color: rgb(255, 255, 255);
border-radius: 5;
margin:1px;
font:bold;</string>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="text">
<string>Neutral</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="1" column="8">
<widget class="QSpinBox" name="channelMax">
<property name="minimumSize">
<size>
<width>0</width>
<height>25</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>
<property name="buttonSymbols">
<enum>QAbstractSpinBox::UpDownArrows</enum>
</property>
<property name="maximum">
<number>9999</number>
</property>
<property name="value">
<number>1000</number>
</property>
</widget>
</item>
<item row="0" column="12">
<widget class="QLabel" name="legend7">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>30</width>
<height>20</height>
</size>
</property>
<property name="font">
<font>
<weight>75</weight>
<italic>false</italic>
<bold>true</bold>
</font>
</property>
<property name="toolTip">
<string>Response time</string>
</property>
<property name="styleSheet">
<string notr="true">background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(74, 74, 74, 255), stop:0.78607 rgba(36, 36, 36, 255));
color: rgb(255, 255, 255);
border-radius: 5;
margin:1px;
font:bold;</string>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="lineWidth">
<number>1</number>
</property>
<property name="text">
<string>RT</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="0" column="10" colspan="2">
<widget class="QLabel" name="legend6">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>75</width>
<height>20</height>
</size>
</property>
<property name="font">
<font>
<weight>75</weight>
<italic>false</italic>
<bold>true</bold>
</font>
</property>
<property name="toolTip">
<string>Channel values are inverted</string>
</property>
<property name="styleSheet">
<string notr="true">background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(74, 74, 74, 255), stop:0.78607 rgba(36, 36, 36, 255));
color: rgb(255, 255, 255);
border-radius: 5;
margin:1px;
font:bold;</string>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="lineWidth">
<number>1</number>
</property>
<property name="text">
<string>Reversed</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="legend0"> <widget class="QLabel" name="legend0">
<property name="enabled"> <property name="enabled">
@ -50,6 +213,9 @@
<bold>true</bold> <bold>true</bold>
</font> </font>
</property> </property>
<property name="toolTip">
<string>Channel function</string>
</property>
<property name="styleSheet"> <property name="styleSheet">
<string notr="true">background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(74, 74, 74, 255), stop:0.78607 rgba(36, 36, 36, 255)); <string notr="true">background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(74, 74, 74, 255), stop:0.78607 rgba(36, 36, 36, 255));
color: rgb(255, 255, 255); color: rgb(255, 255, 255);
@ -92,6 +258,9 @@ font:bold;</string>
<bold>true</bold> <bold>true</bold>
</font> </font>
</property> </property>
<property name="toolTip">
<string>Channel type</string>
</property>
<property name="styleSheet"> <property name="styleSheet">
<string notr="true">background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(74, 74, 74, 255), stop:0.78607 rgba(36, 36, 36, 255)); <string notr="true">background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(74, 74, 74, 255), stop:0.78607 rgba(36, 36, 36, 255));
color: rgb(255, 255, 255); color: rgb(255, 255, 255);
@ -134,6 +303,9 @@ font:bold;</string>
<bold>true</bold> <bold>true</bold>
</font> </font>
</property> </property>
<property name="toolTip">
<string>Channel number</string>
</property>
<property name="styleSheet"> <property name="styleSheet">
<string notr="true">background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(74, 74, 74, 255), stop:0.78607 rgba(36, 36, 36, 255)); <string notr="true">background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(74, 74, 74, 255), stop:0.78607 rgba(36, 36, 36, 255));
color: rgb(255, 255, 255); color: rgb(255, 255, 255);
@ -176,6 +348,9 @@ font:bold;</string>
<bold>true</bold> <bold>true</bold>
</font> </font>
</property> </property>
<property name="toolTip">
<string>Channel min</string>
</property>
<property name="styleSheet"> <property name="styleSheet">
<string notr="true">background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(74, 74, 74, 255), stop:0.78607 rgba(36, 36, 36, 255)); <string notr="true">background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(74, 74, 74, 255), stop:0.78607 rgba(36, 36, 36, 255));
color: rgb(255, 255, 255); color: rgb(255, 255, 255);
@ -194,48 +369,6 @@ font:bold;</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="5">
<widget class="QLabel" name="legend4">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
<property name="font">
<font>
<weight>75</weight>
<italic>false</italic>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(74, 74, 74, 255), stop:0.78607 rgba(36, 36, 36, 255));
color: rgb(255, 255, 255);
border-radius: 5;
margin:1px;
font:bold;</string>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="text">
<string>Neutral</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="1" column="0"> <item row="1" column="0">
<widget class="QLabel" name="channelName"> <widget class="QLabel" name="channelName">
<property name="sizePolicy"> <property name="sizePolicy">
@ -255,31 +388,6 @@ font:bold;</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="1">
<widget class="QComboBox" name="channelGroup">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>6</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>25</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>100</width>
<height>16777215</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>
</widget>
</item>
<item row="1" column="2"> <item row="1" column="2">
<widget class="QComboBox" name="channelNumberDropdown"> <widget class="QComboBox" name="channelNumberDropdown">
<property name="sizePolicy"> <property name="sizePolicy">
@ -308,6 +416,31 @@ font:bold;</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="1">
<widget class="QComboBox" name="channelGroup">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>6</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>25</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>100</width>
<height>16777215</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>
</widget>
</item>
<item row="1" column="3"> <item row="1" column="3">
<widget class="QSpinBox" name="channelMin"> <widget class="QSpinBox" name="channelMin">
<property name="minimumSize"> <property name="minimumSize">
@ -320,7 +453,7 @@ font:bold;</string>
<enum>Qt::StrongFocus</enum> <enum>Qt::StrongFocus</enum>
</property> </property>
<property name="buttonSymbols"> <property name="buttonSymbols">
<enum>QAbstractSpinBox::NoButtons</enum> <enum>QAbstractSpinBox::UpDownArrows</enum>
</property> </property>
<property name="maximum"> <property name="maximum">
<number>9999</number> <number>9999</number>
@ -346,6 +479,70 @@ font:bold;</string>
</property> </property>
</spacer> </spacer>
</item> </item>
<item row="0" column="8">
<widget class="QLabel" name="legend5">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
<property name="font">
<font>
<weight>75</weight>
<italic>false</italic>
<bold>true</bold>
</font>
</property>
<property name="toolTip">
<string>Channel max</string>
</property>
<property name="styleSheet">
<string notr="true">background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(74, 74, 74, 255), stop:0.78607 rgba(36, 36, 36, 255));
color: rgb(255, 255, 255);
border-radius: 5;
margin:1px;
font:bold;</string>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="lineWidth">
<number>1</number>
</property>
<property name="text">
<string>Max</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="1" column="7">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>10</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="5"> <item row="1" column="5">
<widget class="QSlider" name="channelNeutral"> <widget class="QSlider" name="channelNeutral">
<property name="sizePolicy"> <property name="sizePolicy">
@ -368,112 +565,29 @@ font:bold;</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="6"> <item row="1" column="6" alignment="Qt::AlignHCenter">
<spacer name="horizontalSpacer_2"> <widget class="QLabel" name="neutral">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>10</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="7">
<widget class="QSpinBox" name="channelMax">
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>0</width> <width>30</width>
<height>25</height> <height>0</height>
</size> </size>
</property> </property>
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>
<property name="buttonSymbols">
<enum>QAbstractSpinBox::NoButtons</enum>
</property>
<property name="maximum">
<number>9999</number>
</property>
<property name="value">
<number>1000</number>
</property>
</widget>
</item>
<item row="0" column="7">
<widget class="QLabel" name="legend5">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
<property name="font">
<font>
<weight>75</weight>
<italic>false</italic>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(74, 74, 74, 255), stop:0.78607 rgba(36, 36, 36, 255));
color: rgb(255, 255, 255);
border-radius: 5;
margin:1px;
font:bold;</string>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="lineWidth">
<number>1</number>
</property>
<property name="text"> <property name="text">
<string>Max</string> <string/>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignCenter</set> <set>Qt::AlignCenter</set>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="9"> <item row="1" column="12">
<widget class="QCheckBox" name="channelRev">
<property name="enabled">
<bool>false</bool>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
<property name="text">
<string>Rev</string>
</property>
</widget>
</item>
<item row="1" column="10">
<widget class="QSpinBox" name="channelResponseTime"> <widget class="QSpinBox" name="channelResponseTime">
<property name="enabled"> <property name="enabled">
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed"> <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
@ -501,72 +615,57 @@ even lead to crash. Use with caution.</string>
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="buttonSymbols"> <property name="buttonSymbols">
<enum>QAbstractSpinBox::NoButtons</enum> <enum>QAbstractSpinBox::UpDownArrows</enum>
</property> </property>
<property name="maximum"> <property name="maximum">
<number>999</number> <number>999</number>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="10"> <item row="1" column="10" colspan="2">
<widget class="QLabel" name="legend6"> <widget class="QFrame" name="frame">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>30</width> <width>75</width>
<height>26</height>
</size>
</property>
<property name="font">
<font>
<weight>75</weight>
<italic>false</italic>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(74, 74, 74, 255), stop:0.78607 rgba(36, 36, 36, 255));
color: rgb(255, 255, 255);
border-radius: 5;
margin:5px;
font:bold;</string>
</property>
<property name="text">
<string>RT</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="1" column="8">
<widget class="QLabel" name="neutral">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>48</width>
<height>0</height> <height>0</height>
</size> </size>
</property> </property>
<property name="maximumSize"> <property name="frameShape">
<size> <enum>QFrame::NoFrame</enum>
<width>45</width>
<height>16777215</height>
</size>
</property> </property>
<property name="text"> <property name="frameShadow">
<string/> <enum>QFrame::Raised</enum>
</property> </property>
<layout class="QGridLayout" name="gridLayout_2">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item row="0" column="0" alignment="Qt::AlignHCenter">
<widget class="QCheckBox" name="channelRev">
<property name="enabled">
<bool>false</bool>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</widget> </widget>
</item> </item>
</layout> </layout>

View File

@ -467,6 +467,8 @@ bool UAVObjectUtilManager::descriptionToStructure(QByteArray desc, deviceDescrip
struc.fwHash = desc.mid(40, 20); struc.fwHash = desc.mid(40, 20);
struc.uavoHash.clear(); struc.uavoHash.clear();
struc.uavoHash = desc.mid(60, 20); struc.uavoHash = desc.mid(60, 20);
/*
qDebug() << __FUNCTION__ << ":description from board:"; qDebug() << __FUNCTION__ << ":description from board:";
foreach(char x, desc) { foreach(char x, desc) {
qDebug() << QString::number(x, 16); qDebug() << QString::number(x, 16);
@ -477,6 +479,7 @@ bool UAVObjectUtilManager::descriptionToStructure(QByteArray desc, deviceDescrip
foreach(char x, array2) { foreach(char x, array2) {
qDebug() << QString::number(x, 16); qDebug() << QString::number(x, 16);
} }
*/
return true; return true;
} }
return false; return false;