1
0
Fork 0
mirror of https://github.com/EdgeTX/edgetx.git synced 2025-07-25 17:25:10 +03:00

We forgot to change the VARIANT on X3!

This commit is contained in:
Bertrand Songis 2019-05-09 11:13:04 +02:00
parent f6a0db16e7
commit 2784caf10d
8 changed files with 357 additions and 12 deletions

View file

@ -34,6 +34,7 @@
#define TARANIS_X7_VARIANT 0x4000
#define TARANIS_XLITE_VARIANT 0x2000
#define TARANIS_XLITES_VARIANT 0x1000
#define TARANIS_X3_VARIANT 0x0800
#define SIMU_STOCK_VARIANTS (GVARS_VARIANT|FRSKY_VARIANT)
#define SIMU_M128_VARIANTS (M128_VARIANT|SIMU_STOCK_VARIANTS)

View file

@ -314,6 +314,9 @@ int OpenTxEepromInterface::save(uint8_t * eeprom, const RadioData & radioData, u
else if (IS_TARANIS_X9E(board)) {
variant |= TARANIS_X9E_VARIANT;
}
else if (IS_TARANIS_X3(board)) {
variant |= TARANIS_X3_VARIANT;
}
else if (IS_TARANIS_X7(board)) {
variant |= TARANIS_X7_VARIANT;
}
@ -692,6 +695,8 @@ int OpenTxFirmware::getCapability(::Capability capability)
return SIMU_M128_VARIANTS;
else if (IS_TARANIS_X9E(board))
return TARANIS_X9E_VARIANT;
else if (IS_TARANIS_X3(board))
return TARANIS_X3_VARIANT;
else if (IS_TARANIS_X7(board))
return TARANIS_X7_VARIANT;
else if (IS_TARANIS_XLITES(board))

View file

@ -4,6 +4,7 @@ set(simulation_SRCS
radiooutputswidget.cpp
simulateduiwidget.cpp
simulateduiwidget9X.cpp
simulateduiwidgetX3.cpp
simulateduiwidgetX7.cpp
simulateduiwidgetX9.cpp
simulateduiwidgetXLITE.cpp
@ -24,6 +25,7 @@ set(simulation_UIS
debugoutput.ui
radiooutputswidget.ui
simulateduiwidget9X.ui
simulateduiwidgetX3.ui
simulateduiwidgetX7.ui
simulateduiwidgetX9.ui
simulateduiwidgetXLITE.ui

View file

@ -47,7 +47,7 @@ class SimulatedUIWidget : public QWidget
protected:
explicit SimulatedUIWidget(SimulatorInterface * simulator, QWidget * parent = NULL);
explicit SimulatedUIWidget(SimulatorInterface * simulator, QWidget * parent = nullptr);
public:
@ -104,6 +104,7 @@ class SimulatedUIWidget : public QWidget
// Each subclass is responsible for its own Ui
namespace Ui {
class SimulatedUIWidget9X;
class SimulatedUIWidgetX3;
class SimulatedUIWidgetX7;
class SimulatedUIWidgetX9;
class SimulatedUIWidgetXLITE;
@ -117,7 +118,7 @@ class SimulatedUIWidget9X: public SimulatedUIWidget
Q_OBJECT
public:
explicit SimulatedUIWidget9X(SimulatorInterface * simulator, QWidget * parent = NULL);
explicit SimulatedUIWidget9X(SimulatorInterface * simulator, QWidget * parent = nullptr);
virtual ~SimulatedUIWidget9X();
protected:
@ -128,12 +129,24 @@ class SimulatedUIWidget9X: public SimulatedUIWidget
};
class SimulatedUIWidgetX3: public SimulatedUIWidget
{
Q_OBJECT
public:
explicit SimulatedUIWidgetX3(SimulatorInterface * simulator, QWidget * parent = nullptr);
virtual ~SimulatedUIWidgetX3();
private:
Ui::SimulatedUIWidgetX3 * ui;
};
class SimulatedUIWidgetX7: public SimulatedUIWidget
{
Q_OBJECT
public:
explicit SimulatedUIWidgetX7(SimulatorInterface * simulator, QWidget * parent = NULL);
explicit SimulatedUIWidgetX7(SimulatorInterface * simulator, QWidget * parent = nullptr);
virtual ~SimulatedUIWidgetX7();
private:
@ -145,7 +158,7 @@ class SimulatedUIWidgetX9: public SimulatedUIWidget
Q_OBJECT
public:
explicit SimulatedUIWidgetX9(SimulatorInterface * simulator, QWidget * parent = NULL);
explicit SimulatedUIWidgetX9(SimulatorInterface * simulator, QWidget * parent = nullptr);
virtual ~SimulatedUIWidgetX9();
private:
@ -157,7 +170,7 @@ class SimulatedUIWidgetXLITE: public SimulatedUIWidget
Q_OBJECT
public:
explicit SimulatedUIWidgetXLITE(SimulatorInterface * simulator, QWidget * parent = NULL);
explicit SimulatedUIWidgetXLITE(SimulatorInterface * simulator, QWidget * parent = nullptr);
virtual ~SimulatedUIWidgetXLITE();
private:
@ -169,7 +182,7 @@ class SimulatedUIWidgetX9E: public SimulatedUIWidget
Q_OBJECT
public:
explicit SimulatedUIWidgetX9E(SimulatorInterface * simulator, QWidget * parent = NULL);
explicit SimulatedUIWidgetX9E(SimulatorInterface * simulator, QWidget * parent = nullptr);
virtual ~SimulatedUIWidgetX9E();
private:
@ -181,7 +194,7 @@ class SimulatedUIWidgetX10: public SimulatedUIWidget
Q_OBJECT
public:
explicit SimulatedUIWidgetX10(SimulatorInterface * simulator, QWidget * parent = NULL);
explicit SimulatedUIWidgetX10(SimulatorInterface * simulator, QWidget * parent = nullptr);
virtual ~SimulatedUIWidgetX10();
private:
@ -193,7 +206,7 @@ class SimulatedUIWidgetX12: public SimulatedUIWidget
Q_OBJECT
public:
explicit SimulatedUIWidgetX12(SimulatorInterface * simulator, QWidget * parent = NULL);
explicit SimulatedUIWidgetX12(SimulatorInterface * simulator, QWidget * parent = nullptr);
virtual ~SimulatedUIWidgetX12();
private:

View file

@ -0,0 +1,66 @@
#include "simulateduiwidget.h"
#include "ui_simulateduiwidgetX3.h"
// NOTE: RadioUiAction(NUMBER,...): NUMBER relates to enum EnumKeys in the specific board.h
SimulatedUIWidgetX3::SimulatedUIWidgetX3(SimulatorInterface *simulator, QWidget * parent):
SimulatedUIWidget(simulator, parent),
ui(new Ui::SimulatedUIWidgetX3)
{
RadioUiAction * act;
QPolygon polygon;
ui->setupUi(this);
// add actions in order of appearance on the help menu
QPoint ctr(70, 91);
polygon << polyArc(ctr.x(), ctr.y(), 50, -90, 90) << polyArc(ctr.x(), ctr.y(), 22, -90, 90);
act = new RadioUiAction(3, QList<int>() << Qt::Key_PageUp << Qt::Key_Up, SIMU_STR_HLP_KEYS_GO_UP, SIMU_STR_HLP_ACT_PAGE);
addRadioWidget(ui->leftbuttons->addArea(polygon, "X3/left_page.png", act));
act = new RadioUiAction(0, QList<int>() << Qt::Key_PageDown << Qt::Key_Down, SIMU_STR_HLP_KEYS_GO_DN, SIMU_STR_HLP_ACT_MENU_ICN);
addRadioWidget(ui->leftbuttons->addArea(polyArc(ctr.x(), ctr.y(), 20), "X3/left_menu.png", act));
polygon.clear();
polygon << polyArc(ctr.x(), ctr.y(), 50, 90, 270) << polyArc(ctr.x(), ctr.y(), 22, 90, 270);
act = new RadioUiAction(1, QList<int>() << Qt::Key_Delete << Qt::Key_Escape << Qt::Key_Backspace, SIMU_STR_HLP_KEYS_EXIT, SIMU_STR_HLP_ACT_EXIT);
addRadioWidget(ui->leftbuttons->addArea(polygon, "X3/left_exit.png", act));
m_scrollUpAction = new RadioUiAction(-1, QList<int>() << Qt::Key_Minus << Qt::Key_Equal << Qt::Key_Left, SIMU_STR_HLP_KEYS_GO_LFT, SIMU_STR_HLP_ACT_ROT_LFT);
m_scrollDnAction = new RadioUiAction(-1, QList<int>() << Qt::Key_Plus << Qt::Key_Right, SIMU_STR_HLP_KEYS_GO_RGT, SIMU_STR_HLP_ACT_ROT_RGT);
connectScrollActions();
m_mouseMidClickAction = new RadioUiAction(2, QList<int>() << Qt::Key_Enter << Qt::Key_Return, SIMU_STR_HLP_KEYS_ACTIVATE, SIMU_STR_HLP_ACT_ROT_DN);
addRadioWidget(ui->rightbuttons->addArea(polyArc(88, 92, 33), "X3/right_ent.png", m_mouseMidClickAction));
addRadioWidget(ui->leftbuttons->addArea(QRect(9, 154, 30, 30), "X3/left_scrnshot.png", m_screenshotAction));
m_backlightColors << QColor(215, 243, 255); // X3 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);
QString css = "#radioUiWidget {"
"background-color: qlineargradient(spread:reflect, x1:0, y1:0, x2:0, y2:1,"
"stop:0 rgba(255, 255, 255, 255),"
"stop:0.757062 rgba(241, 238, 238, 255),"
"stop:1 rgba(247, 245, 245, 255));"
"}";
QTimer * tim = new QTimer(this);
tim->setSingleShot(true);
connect(tim, &QTimer::timeout, [this, css]() {
emit customStyleRequest(css);
});
tim->start(100);
}
SimulatedUIWidgetX3::~SimulatedUIWidgetX3()
{
delete ui;
}

View file

@ -0,0 +1,258 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>SimulatedUIWidgetX3</class>
<widget class="QWidget" name="SimulatedUIWidgetX3">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>570</width>
<height>208</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>570</width>
<height>208</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>570</width>
<height>208</height>
</size>
</property>
<property name="windowTitle">
<string notr="true">Taranis X3 Simulator</string>
</property>
<property name="styleSheet">
<string notr="true">background-color: qlineargradient(spread:reflect, x1:0, y1:0, x2:0, y2:1, stop:0 rgba(255, 255, 255, 255), stop:0.757062 rgba(241, 238, 238, 255), stop:1 rgba(247, 245, 245, 255));</string>
</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="1" 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>157</width>
<height>186</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>157</width>
<height>186</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background:url(:/images/simulator/X7/left.png);</string>
</property>
</widget>
</item>
<item row="2" 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>256</width>
<height>128</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>424</width>
<height>128</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(215, 243, 255);</string>
</property>
</widget>
</item>
<item row="1" 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>157</width>
<height>186</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>157</width>
<height>186</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background:url(:/images/simulator/X7/right.png)</string>
</property>
</widget>
</item>
<item row="1" 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>256</width>
<height>48</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>256</width>
<height>48</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background:url(:/images/simulator/X7/top.png)</string>
</property>
</widget>
</item>
<item row="3" 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>256</width>
<height>10</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>256</width>
<height>10</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background:url(:/images/simulator/X7/bottom.png)</string>
</property>
</widget>
</item>
<item row="0" column="0" colspan="3">
<widget class="QLabel" name="label">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>10</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>12</height>
</size>
</property>
<property name="baseSize">
<size>
<width>0</width>
<height>12</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(255, 255, 255);</string>
</property>
<property name="text">
<string notr="true"/>
</property>
</widget>
</item>
<item row="4" column="0" colspan="3">
<widget class="QLabel" name="label_2">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>10</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>10</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(247, 245, 245);</string>
</property>
<property name="text">
<string notr="true"/>
</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>

View file

@ -69,6 +69,9 @@ SimulatorWidget::SimulatorWidget(QWidget * parent, SimulatorInterface * simulato
setWindowTitle(windowName);
switch(m_board) {
case Board::BOARD_TARANIS_X3:
radioUiWidget = new SimulatedUIWidgetX3(simulator, this);
break;
case Board::BOARD_TARANIS_X7:
radioUiWidget = new SimulatedUIWidgetX7(simulator, this);
break;
@ -80,9 +83,6 @@ SimulatorWidget::SimulatorWidget(QWidget * parent, SimulatorInterface * simulato
case Board::BOARD_TARANIS_XLITES:
radioUiWidget = new SimulatedUIWidgetXLITE(simulator, this);
break;
case Board::BOARD_TARANIS_X3:
radioUiWidget = new SimulatedUIWidgetX7(simulator, this);
break;
case Board::BOARD_TARANIS_X9E:
radioUiWidget = new SimulatedUIWidgetX9E(simulator, this);
break;

View file

@ -97,7 +97,7 @@ elseif(PCB STREQUAL X3)
set(FLAVOUR x3)
add_definitions(-DBOARD_NAME="x9lite")
add_definitions(-DPCBX3 -DSOFTWARE_VOLUME)
add_definitions(-DEEPROM_VARIANT=0x4000)
add_definitions(-DEEPROM_VARIANT=0x0800)
add_definitions(-DPWR_BUTTON_${PWR_BUTTON})
set(GUI_DIR 128x64)
set(NAVIGATION_TYPE x7)