1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-11-29 07:24:13 +01:00

LP-559 Update CC HW page for vector pictures

This commit is contained in:
Laurent Lalanne 2017-11-11 17:50:49 +01:00
parent 6cd8a85bbd
commit ff3a1bd630
2 changed files with 53 additions and 62 deletions

View File

@ -290,11 +290,15 @@
</item>
<item row="2" column="1">
<layout class="QGridLayout" name="gridLayout" rowstretch="0,0,0,0,0,0,0,0">
<item row="4" column="0">
<widget class="QComboBox" name="cbFlexi"/>
</item>
<item row="6" column="0">
<widget class="QComboBox" name="cbTele"/>
<item row="1" column="1" colspan="2" alignment="Qt::AlignLeft">
<widget class="QLabel" name="label_7">
<property name="text">
<string>Receiver Port</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="3" column="3">
<widget class="QLabel" name="label_8">
@ -306,10 +310,16 @@
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="label_4">
<item row="6" column="3">
<widget class="QComboBox" name="cbUsbVcp"/>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string/>
<string>Flexi Port</string>
</property>
<property name="alignment">
<set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
</property>
</widget>
</item>
@ -323,15 +333,14 @@
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QComboBox" name="cbTele"/>
</item>
<item row="2" column="1" colspan="2" alignment="Qt::AlignLeft">
<widget class="QComboBox" name="cbRcvr"/>
</item>
<item row="3" column="1" rowspan="5" colspan="2">
<widget class="QLabel" name="label_2">
<property name="text">
<string/>
</property>
<property name="scaledContents">
<bool>false</bool>
</property>
</widget>
<widget class="QSvgWidget" name="boardImg" native="true"/>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_3">
@ -343,45 +352,16 @@
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Flexi Port</string>
</property>
<property name="alignment">
<set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
</property>
</widget>
</item>
<item row="4" column="3">
<widget class="QComboBox" name="cbUsbHid"/>
</item>
<item row="4" column="4">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
<item row="4" column="0">
<widget class="QComboBox" name="cbFlexi"/>
</item>
<item row="6" column="3">
<widget class="QComboBox" name="cbUsbVcp"/>
</item>
<item row="2" column="1" colspan="2" alignment="Qt::AlignLeft">
<widget class="QComboBox" name="cbRcvr"/>
</item>
<item row="1" column="1" colspan="2" alignment="Qt::AlignLeft">
<widget class="QLabel" name="label_7">
<item row="7" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Receiver Port</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
<string/>
</property>
</widget>
</item>
@ -640,6 +620,13 @@ Beware of not locking yourself out!</string>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>QSvgWidget</class>
<extends>QWidget</extends>
<header>qsvgwidget.h</header>
</customwidget>
</customwidgets>
<resources>
<include location="../coreplugin/core.qrc"/>
</resources>

View File

@ -55,25 +55,29 @@ ConfigCCHWWidget::ConfigCCHWWidget(QWidget *parent) : ConfigTaskWidget(parent)
int id = utilMngr->getBoardModel();
switch (id) {
case 0x0101:
m_telemetry->label_2->setPixmap(QPixmap(":/uploader/images/deviceID-0101.svg"));
break;
case 0x0301:
m_telemetry->label_2->setPixmap(QPixmap(":/uploader/images/deviceID-0301.svg"));
break;
case 0x0401:
m_telemetry->label_2->setPixmap(QPixmap(":/configgadget/images/coptercontrol.svg"));
break;
case 0x0402:
m_telemetry->label_2->setPixmap(QPixmap(":/configgadget/images/cc3d_top.png"));
m_telemetry->boardImg->load(QString(":/uploader/images/deviceID-0101.svg"));
break;
case 0x0201:
m_telemetry->label_2->setPixmap(QPixmap(":/uploader/images/deviceID-0201.svg"));
m_telemetry->boardImg->load(QString(":/uploader/images/deviceID-0201.svg"));
break;
case 0x0301:
m_telemetry->boardImg->load(QString(":/uploader/images/deviceID-0301.svg"));
break;
case 0x0401:
m_telemetry->boardImg->load(QString(":/configgadget/images/coptercontrol.svg"));
break;
case 0x0402:
m_telemetry->boardImg->load(QString(":/configgadget/images/cc3d.svg"));
break;
default:
m_telemetry->label_2->setPixmap(QPixmap(":/configgadget/images/coptercontrol.svg"));
m_telemetry->boardImg->load(QString(":/configgadget/images/cc3d.svg"));
break;
}
QSize picSize = m_telemetry->boardImg->sizeHint();
picSize.scale(350, 350, Qt::KeepAspectRatio);
m_telemetry->boardImg->setFixedSize(picSize);
addWidgetBinding("HwSettings", "CC_FlexiPort", m_telemetry->cbFlexi);
addWidgetBinding("HwSettings", "CC_MainPort", m_telemetry->cbTele);
addWidgetBinding("HwSettings", "CC_RcvrPort", m_telemetry->cbRcvr);