[Simulator] Add X9E radio skin.

This commit is contained in:
Max Paperno
2017-02-06 22:16:48 -05:00
parent b28bd82515
commit 5309b527a5
7 changed files with 276 additions and 3 deletions
+9
View File
@@ -101,6 +101,15 @@
<file>images/simulator/X7/right.png</file>
<file>images/simulator/X7/right_ent.png</file>
<file>images/simulator/X7/top.png</file>
<file>images/simulator/X9E/bottom.png</file>
<file>images/simulator/X9E/left.png</file>
<file>images/simulator/X9E/left_exit.png</file>
<file>images/simulator/X9E/left_menu.png</file>
<file>images/simulator/X9E/left_page.png</file>
<file>images/simulator/X9E/left_scrnshot.png</file>
<file>images/simulator/X9E/right.png</file>
<file>images/simulator/X9E/right_enter.png</file>
<file>images/simulator/X9E/top.png</file>
<file>images/wizard/ailerons.png</file>
<file>images/wizard/airbrakes.png</file>
<file>images/wizard/elevons.png</file>

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 32 KiB

+2
View File
@@ -6,6 +6,7 @@ set(simulation_SRCS
simulateduiwidget9X.cpp
simulateduiwidgetX7.cpp
simulateduiwidgetX9.cpp
simulateduiwidgetX9E.cpp
simulateduiwidgetX12.cpp
simulatorinterface.cpp
simulatormainwindow.cpp
@@ -23,6 +24,7 @@ set(simulation_UIS
simulateduiwidget9X.ui
simulateduiwidgetX7.ui
simulateduiwidgetX9.ui
simulateduiwidgetX9E.ui
simulateduiwidgetX12.ui
simulatormainwindow.ui
simulatorstartupdialog.ui
@@ -100,6 +100,7 @@ namespace Ui {
class SimulatedUIWidget9X;
class SimulatedUIWidgetX7;
class SimulatedUIWidgetX9;
class SimulatedUIWidgetX9E;
class SimulatedUIWidgetX12;
}
@@ -149,6 +150,20 @@ class SimulatedUIWidgetX9: public SimulatedUIWidget
Ui::SimulatedUIWidgetX9 * ui;
};
class SimulatedUIWidgetX9E: public SimulatedUIWidget
{
Q_OBJECT
public:
explicit SimulatedUIWidgetX9E(SimulatorInterface * simulator, SimulatorDialog * simuDialog = NULL, QWidget * parent = NULL);
virtual ~SimulatedUIWidgetX9E();
protected:
private:
Ui::SimulatedUIWidgetX9E * ui;
};
class SimulatedUIWidgetX12: public SimulatedUIWidget
{
Q_OBJECT
@@ -0,0 +1,79 @@
/*
* Copyright (C) OpenTX
*
* Based on code named
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#include "simulateduiwidget.h"
#include "ui_simulateduiwidgetX9E.h"
SimulatedUIWidgetX9E::SimulatedUIWidgetX9E(SimulatorInterface *simulator, SimulatorDialog * simuDialog, QWidget * parent):
SimulatedUIWidget(simulator, simuDialog, parent),
ui(new Ui::SimulatedUIWidgetX9E)
{
RadioUiAction * act;
QPolygon polygon;
ui->setupUi(this);
// add actions in order of appearance on the help menu
QPoint ctr(70, 100);
polygon << polyArc(ctr.x(), ctr.y(), 60, -90, 0) << ctr;
act = addRadioUiAction(0, QList<int>() << Qt::Key_PageUp, tr("PG-UP"), tr("[ MENU ]"));
ui->leftbuttons->addArea(polygon, "X9E/left_menu.png", act);
polygon.clear();
polygon << polyArc(ctr.x(), ctr.y(), 45, 0, 180);
act = addRadioUiAction(3, QList<int>() << Qt::Key_PageDown, tr("PG-DN"), tr("[ PAGE ]"));
ui->leftbuttons->addArea(polygon, "X9E/left_page.png", act);
polygon.clear();
polygon << polyArc(ctr.x(), ctr.y(), 60, 180, 270) << ctr;
act = addRadioUiAction(1, QList<int>() << Qt::Key_Delete << Qt::Key_Escape << Qt::Key_Backspace, tr("DEL/BKSP/ESC"), tr("[ EXIT ]"));
ui->leftbuttons->addArea(polygon, "X9E/left_exit.png", act);
m_keymapHelp.append(keymapHelp_t(tr("WHEEL/PAD SCRL"), tr("Rotary Selector")));
m_scrollUpAction = addRadioUiAction(-1, QList<int>() << Qt::Key_Minus << Qt::Key_Equal << Qt::Key_Up, tr("-/UP"), tr("Rotary UP"));
m_scrollDnAction = addRadioUiAction(-1, QList<int>() << Qt::Key_Plus << Qt::Key_Down, tr("+/DN"), tr("Rotary DOWN"));
connectScrollActions();
act = addRadioUiAction(2, QList<int>() << Qt::Key_Enter << Qt::Key_Return, tr("ENTER/MOUSE-MID"), tr("Selector Press"));
ui->rightbuttons->addArea(polyArc(90, 100, 50), "X9E/right_enter.png", act);
ui->leftbuttons->addArea(10, 170, 40, 200, "X9E/left_scrnshot.png", m_screenshotAction);
m_backlightColors << QColor(47, 123, 227); // Taranis Blue
m_backlightColors << QColor(166,247,159);
m_backlightColors << QColor(247,159,166);
m_backlightColors << QColor(255,195,151);
m_backlightColors << QColor(247,242,159);
setLcd(ui->lcd);
m_simuDialog->setUiAreaStyle("background-color: qlineargradient(spread:pad, x1:1, y1:0.9, x2:0, y2:0, "
"stop:0 rgba(255, 255, 255, 255), "
"stop:0.35 rgba(250, 250, 250, 255), stop:0.5 rgba(242, 241, 241, 255), "
"stop:0.61 rgba(241, 241, 241, 255), stop:1.0 rgba(251, 251, 251, 255));");
}
SimulatedUIWidgetX9E::~SimulatedUIWidgetX9E()
{
delete ui;
}
@@ -0,0 +1,166 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>SimulatedUIWidgetX9E</class>
<widget class="QWidget" name="SimulatedUIWidgetX9E">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>724</width>
<height>210</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>724</width>
<height>210</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>724</width>
<height>210</height>
</size>
</property>
<layout class="QGridLayout" name="gridLayout">
<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>
<property name="spacing">
<number>0</number>
</property>
<item row="0" column="0" rowspan="3">
<widget class="ButtonsWidget" name="leftbuttons" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>150</width>
<height>208</height>
</size>
</property>
<property name="mouseTracking">
<bool>true</bool>
</property>
<property name="styleSheet">
<string notr="true">background:url(:/images/simulator/X9E/left.png);</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QWidget" name="top" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>424</width>
<height>40</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background:url(:/images/simulator/X9E/top.png)</string>
</property>
</widget>
</item>
<item row="0" column="2" rowspan="3">
<widget class="ButtonsWidget" name="rightbuttons" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>150</width>
<height>208</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background:url(:/images/simulator/X9E/right.png)</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="LcdWidget" name="lcd" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>424</width>
<height>128</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>424</width>
<height>128</height>
</size>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QWidget" name="bottom" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>424</width>
<height>40</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background:url(:/images/simulator/X9E/bottom.png)</string>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>LcdWidget</class>
<extends>QWidget</extends>
<header>lcdwidget.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>ButtonsWidget</class>
<extends>QWidget</extends>
<header>buttonswidget.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>
+5 -3
View File
@@ -81,11 +81,13 @@ SimulatorDialog::SimulatorDialog(QWidget * parent, SimulatorInterface *simulator
break;
case Board::BOARD_TARANIS_X9D :
case Board::BOARD_TARANIS_X9DP :
case Board::BOARD_TARANIS_X9E :
radioUiWidget = new SimulatedUIWidgetX9(simulator, this);
break;
case Board::BOARD_X12S:
case Board::BOARD_X10:
case Board::BOARD_TARANIS_X9E :
radioUiWidget = new SimulatedUIWidgetX9E(simulator, this);
break;
case Board::BOARD_X12S :
case Board::BOARD_X10 :
radioUiWidget = new SimulatedUIWidgetX12(simulator, this);
break;
default: