[Simulator] Dyanamic Simulator virtual hardware generation and many other improvements (#4260)
* Move simulator widgets to subfolder (no code changes).
* [Simulator] Major Simulator re-structuring to reduce code redundancies and allow for fully dynamic simulated hardware setup:
SimulatorDialog is no longer sub-classed by individual radio UIs, instead a new class is added which handles just the "skin," LCD, and navigation controls (also makes setting up new models much quicker);
All radio switches/knobs/sliders are populated dynamically based on loaded hardware configuration data (eeprom/bin), including control types and names (in case of no hardware config data, reasonable "factory defaults" are loaded);
Starting Horus sim with alternate path for RADIO and MODEL data folders is now supported (.otx file is WIP);
6-way switch now works properly and various other inconsistencies addressed (eg. some Horus analogs were backwards).
* Add missing OpenTX headers to new files.
* [Simulator] Fix loading of Horus hardware settings from Companion simulation.
* Update Travis CI build environment to Qt 5.7.
* [Simulator] Fix 9X missing colored side LCD images, an #include fix, and some cleanup.
* [TravisCI] Set up for parallel Travis builds and use Qt5.7 (#4263)
* Fix starting Simulator with non-existing file/folder structure (now properly creates new ones as needed, including Horus directories with default radio/model); Temporarily remove option for using .otx file with Horus (until that feature is added).
* Load correct simulator skin for X7 when launching from Companion.
* X7 hardware defaults changed to match production hardware
* Fix minor compiler warning in mdichild.cpp, and some cleanup in eeprominterface.cpp.
* [Simulator] Centralize radio UI flavor determination.
* [Simulator] Updates:
Add X7 UI flavor;
Centralize LCD settings;
Simplify drawing curved UI widgets;
LCD color can be changed for any 1/4-bit display radio;
Slight change on default LCD "off" color;
Refactor LcdWidget to not use globals.
* [Companion] X7 EEPROM import fix
+ cosmetics
+ compilation error fixed on Manjaro
* [Companion] 9XR-PRO EEPROM import fix
+ cosmetics
+ compilation error fixed on Manjaro
* Navigation fix
French translations
* [X7] Main view cosmetics
* Fix switch/ana custom name import
* [Simulator] Add white border above/below X7 bezel, and use white-colored padding on sides; Adjust X7 default LCD color.
* Does this work? (#4269)
Read an Horus SD card produces a temporary .otx file now
* Bsongis/companion warning before automatic conversions (#4271)
* Does this work?
* Warning before automatic conversions
* Force different file name after conversion (#4272)
* Force different file name after conversion
* More detailed instructions
* [Companion] Files automatically named during XXX => Horus conversions
This commit is contained in:
committed by
Bertrand Songis
parent
b3f4870da7
commit
17a03e6c18
@@ -0,0 +1,57 @@
|
||||
#include "simulateduiwidget.h"
|
||||
#include "ui_simulateduiwidgetX7.h"
|
||||
|
||||
SimulatedUIWidgetX7::SimulatedUIWidgetX7(SimulatorInterface *simulator, SimulatorDialog * simuDialog, QWidget * parent):
|
||||
SimulatedUIWidget(simulator, simuDialog, parent),
|
||||
ui(new Ui::SimulatedUIWidgetX7)
|
||||
{
|
||||
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 = addRadioUiAction(3, QList<int>() << Qt::Key_PageUp, tr("PG-UP"), tr("[ PAGE ]"));
|
||||
ui->leftbuttons->addArea(polygon, "X7/left_page.png", act);
|
||||
|
||||
act = addRadioUiAction(0, QList<int>() << Qt::Key_PageDown, tr("PG-DN"), tr("[ MENU ]"));
|
||||
ui->leftbuttons->addArea(polyArc(ctr.x(), ctr.y(), 20), "X7/left_menu.png", act);
|
||||
|
||||
polygon.clear();
|
||||
polygon << polyArc(ctr.x(), ctr.y(), 50, 90, 270) << polyArc(ctr.x(), ctr.y(), 22, 90, 270);
|
||||
act = addRadioUiAction(1, QList<int>() << Qt::Key_Delete << Qt::Key_Escape << Qt::Key_Backspace, tr("DEL/BKSP/ESC"), tr("[ EXIT ]"));
|
||||
ui->leftbuttons->addArea(polygon, "X7/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(88, 92, 33), "X7/right_ent.png", act);
|
||||
|
||||
ui->leftbuttons->addArea(9, 154, 34, 177, "X7/left_scrnshot.png", m_screenshotAction);
|
||||
|
||||
m_backlightColors << QColor(215, 243, 255); // X7 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);
|
||||
connectScrollActions();
|
||||
// try to match the gradient on the white radio images.
|
||||
m_simuDialog->setUiAreaStyle("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));");
|
||||
}
|
||||
|
||||
SimulatedUIWidgetX7::~SimulatedUIWidgetX7()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user