Skip to content

Commit 2540741

Browse files
author
philmoz
committed
Testing for 320x240
1 parent adf24e7 commit 2540741

File tree

324 files changed

+129078
-540
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

324 files changed

+129078
-540
lines changed

companion/src/companion.qrc

+11
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,17 @@
332332
<file>images/simulator/TX16S/left_tele.png</file>
333333
<file>images/simulator/TX16S/right_ent.png</file>
334334
<file>images/simulator/TX16S/right_mdl.png</file>
335+
<file>images/simulator/320x240/left.png</file>
336+
<file>images/simulator/320x240/right.png</file>
337+
<file>images/simulator/320x240/top.png</file>
338+
<file>images/simulator/320x240/bottom.png</file>
339+
<file>images/simulator/320x240/left_page.png</file>
340+
<file>images/simulator/320x240/left_page2.png</file>
341+
<file>images/simulator/320x240/left_rtn.png</file>
342+
<file>images/simulator/320x240/left_sys.png</file>
343+
<file>images/simulator/320x240/left_tele.png</file>
344+
<file>images/simulator/320x240/right_ent.png</file>
345+
<file>images/simulator/320x240/right_mdl.png</file>
335346
<file>images/simulator/NV14/top.png</file>
336347
<file>images/simulator/NV14/bottom.png</file>
337348
<file>images/simulator/NV14/lhs.png</file>

companion/src/firmwares/boards.cpp

+10
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,8 @@ uint32_t Boards::getFourCC(Type board)
158158
return 0x3A78746F;
159159
case BOARD_FLYSKY_PL18:
160160
return 0x4878746F;
161+
case BOARD_SMALL_LCD:
162+
return 0x3878746F;
161163
default:
162164
return 0;
163165
}
@@ -273,6 +275,7 @@ int Boards::getFlashSize(Type board)
273275
case BOARD_FLYSKY_PL18:
274276
case BOARD_FATFISH_F16:
275277
case BOARD_HELLORADIOSKY_V16:
278+
case BOARD_SMALL_LCD:
276279
return FSIZE_HORUS;
277280
case BOARD_UNKNOWN:
278281
return FSIZE_MAX;
@@ -360,6 +363,8 @@ int Boards::getCapability(Board::Type board, Board::Capability capability)
360363
case LcdHeight:
361364
if (IS_FLYSKY_NV14(board) || IS_FLYSKY_EL18(board))
362365
return 480;
366+
else if (board == BOARD_SMALL_LCD)
367+
return 240;
363368
else if (IS_FLYSKY_PL18(board) || IS_JUMPER_T15(board))
364369
return 320;
365370
else if (IS_FAMILY_HORUS_OR_T16(board))
@@ -370,6 +375,8 @@ int Boards::getCapability(Board::Type board, Board::Capability capability)
370375
case LcdWidth:
371376
if (IS_FLYSKY_NV14(board) || IS_FLYSKY_EL18(board))
372377
return 320;
378+
else if (board == BOARD_SMALL_LCD)
379+
return 320;
373380
else if (IS_FLYSKY_PL18(board))
374381
return 480;
375382
else if (IS_FAMILY_HORUS_OR_T16(board))
@@ -633,6 +640,8 @@ QString Boards::getBoardName(Board::Type board)
633640
return "Fatfish F16";
634641
case BOARD_HELLORADIOSKY_V16:
635642
return "HelloRadioSky V16";
643+
case BOARD_SMALL_LCD:
644+
return "320x240 Test";
636645
default:
637646
return CPN_STR_UNKNOWN_ITEM;
638647
}
@@ -736,6 +745,7 @@ int Boards::getDefaultInternalModules(Board::Type board)
736745
case BOARD_JUMPER_TPRO:
737746
case BOARD_JUMPER_TPROV2:
738747
case BOARD_FLYSKY_PL18:
748+
case BOARD_SMALL_LCD:
739749
return (int)MODULE_TYPE_MULTIMODULE;
740750

741751
case BOARD_BETAFPV_LR3PRO:

companion/src/firmwares/boards.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ namespace Board {
9090
BOARD_FATFISH_F16,
9191
BOARD_HELLORADIOSKY_V16,
9292
BOARD_RADIOMASTER_MT12,
93+
BOARD_SMALL_LCD,
9394
BOARD_TYPE_COUNT,
9495
BOARD_TYPE_MAX = BOARD_TYPE_COUNT - 1
9596
};
@@ -607,7 +608,7 @@ inline bool IS_HELLORADIOSKY_V16(Board::Type board)
607608

608609
inline bool IS_FAMILY_T16(Board::Type board)
609610
{
610-
return board == Board::BOARD_JUMPER_T15 || board == Board::BOARD_JUMPER_T16 || board == Board::BOARD_RADIOMASTER_TX16S || board == Board::BOARD_JUMPER_T18 || board == Board::BOARD_FATFISH_F16 || board == Board::BOARD_HELLORADIOSKY_V16;
611+
return board == Board::BOARD_JUMPER_T15 || board == Board::BOARD_JUMPER_T16 || board == Board::BOARD_RADIOMASTER_TX16S || board == Board::BOARD_JUMPER_T18 || board == Board::BOARD_FATFISH_F16 || board == Board::BOARD_HELLORADIOSKY_V16 || board == Board::BOARD_SMALL_LCD;
611612
}
612613

613614
inline bool IS_FAMILY_T12(Board::Type board)

companion/src/firmwares/opentx/opentxinterface.cpp

+8
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,8 @@ const char * OpenTxEepromInterface::getName()
147147
return "EdgeTX for Fatfish F16";
148148
case BOARD_HELLORADIOSKY_V16:
149149
return "EdgeTX for HelloRadioSky V16";
150+
case BOARD_SMALL_LCD:
151+
return "EdgeTX test for 320x240";
150152
default:
151153
return "Board is unknown to EdgeTX";
152154
}
@@ -1564,6 +1566,12 @@ void registerOpenTxFirmwares()
15641566
firmware->addOption("flyskygimbals", Firmware::tr("Support hardware mod: FlySky Paladin EV Gimbals"));
15651567
registerOpenTxFirmware(firmware);
15661568

1569+
/* Test 320x240 */
1570+
firmware = new OpenTxFirmware(FIRMWAREID("smallLCD"), Firmware::tr("Test 320x240 LCD"), BOARD_SMALL_LCD);
1571+
addOpenTxFrskyOptions(firmware);
1572+
addOpenTxRfOptions(firmware, FLEX);
1573+
registerOpenTxFirmware(firmware);
1574+
15671575
/* Radiomaster Zorro board */
15681576
firmware = new OpenTxFirmware(FIRMWAREID("zorro"), QCoreApplication::translate("Firmware", "Radiomaster Zorro"), Board::BOARD_RADIOMASTER_ZORRO);
15691577
addOpenTxCommonOptions(firmware);
250 Bytes
Loading
31.4 KB
Loading
Loading
Loading
Loading
Loading
Loading
39.4 KB
Loading
Loading
Loading
439 Bytes
Loading

companion/src/simulation/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ set(${PROJECT_NAME}_SRCS
6767
simulateduiwidgetX9LITE.cpp
6868
simulateduiwidgetXLITE.cpp
6969
simulateduiwidgetZorro.cpp
70+
simulateduiwidget320x240.cpp
7071
)
7172

7273
set(${PROJECT_NAME}_HDRS

companion/src/simulation/simulateduiwidget.h

+13
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ namespace Ui {
192192
class SimulatedUIWidgetEL18;
193193
class SimulatedUIWidgetPL18;
194194
class SimulatedUIWidgetV16;
195+
class SimulatedUIWidget320x240;
195196
}
196197

197198
class SimulatedUIWidgetGeneric: public SimulatedUIWidget
@@ -615,3 +616,15 @@ class SimulatedUIWidgetV16: public SimulatedUIWidget
615616
private:
616617
Ui::SimulatedUIWidgetV16 * ui;
617618
};
619+
620+
class SimulatedUIWidget320x240: public SimulatedUIWidget
621+
{
622+
Q_OBJECT
623+
624+
public:
625+
explicit SimulatedUIWidget320x240(SimulatorInterface * simulator, QWidget * parent = nullptr);
626+
virtual ~SimulatedUIWidget320x240();
627+
628+
private:
629+
Ui::SimulatedUIWidget320x240 * ui;
630+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
/*
2+
* Copyright (C) OpenTX
3+
*
4+
* Based on code named
5+
* th9x - http://code.google.com/p/th9x
6+
* er9x - http://code.google.com/p/er9x
7+
* gruvin9x - http://code.google.com/p/gruvin9x
8+
*
9+
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
10+
*
11+
* This program is free software; you can redistribute it and/or modify
12+
* it under the terms of the GNU General Public License version 2 as
13+
* published by the Free Software Foundation.
14+
*
15+
* This program is distributed in the hope that it will be useful,
16+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
17+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18+
* GNU General Public License for more details.
19+
*/
20+
21+
// NOTE: RadioUiAction(NUMBER,...): NUMBER relates to enum EnumKeys in the specific board.h
22+
23+
#include "simulateduiwidget.h"
24+
#include "ui_simulateduiwidget320x240.h"
25+
26+
SimulatedUIWidget320x240::SimulatedUIWidget320x240(SimulatorInterface *simulator, QWidget * parent):
27+
SimulatedUIWidget(simulator, parent),
28+
ui(new Ui::SimulatedUIWidget320x240)
29+
{
30+
RadioUiAction * act;
31+
32+
ui->setupUi(this);
33+
34+
// add actions in order of appearance on the help menu
35+
36+
act = new RadioUiAction(KEY_MODEL, QList<int>() << Qt::Key_Up, SIMU_STR_HLP_KEY_UP, SIMU_STR_HLP_ACT_MDL);
37+
addRadioWidget(ui->rightbuttons->addArea(QRect(40, 0, 110, 35), "320x240/right_mdl.png", act));
38+
39+
m_mouseMidClickAction = new RadioUiAction(KEY_ENTER, QList<int>() << Qt::Key_Enter << Qt::Key_Return, SIMU_STR_HLP_KEYS_ACTIVATE, SIMU_STR_HLP_ACT_ROT_DN);
40+
addRadioWidget(ui->rightbuttons->addArea(QRect(45, 70, 100, 160), "320x240/right_ent.png", m_mouseMidClickAction));
41+
42+
act = new RadioUiAction(KEY_SYS, QList<int>() << Qt::Key_Left, SIMU_STR_HLP_KEY_LFT, SIMU_STR_HLP_ACT_SYS);
43+
addRadioWidget(ui->leftbuttons->addArea(QRect(32, 1, 80, 35), "320x240/left_sys.png", act));
44+
45+
act = new RadioUiAction(KEY_TELE, QList<int>() << Qt::Key_Right, SIMU_STR_HLP_KEY_RGT, SIMU_STR_HLP_ACT_TELE);
46+
addRadioWidget(ui->leftbuttons->addArea(QRect(55, 220, 80, 35), "320x240/left_tele.png", act));
47+
48+
act = new RadioUiAction(KEY_PAGEDN, QList<int>() << Qt::Key_PageDown, SIMU_STR_HLP_KEY_PGDN, SIMU_STR_HLP_ACT_PGDN);
49+
addRadioWidget(ui->leftbuttons->addArea(QRect(55, 115, 80, 35), "320x240/left_page.png", act));
50+
51+
act = new RadioUiAction(KEY_PAGEUP, QList<int>() << Qt::Key_PageUp, SIMU_STR_HLP_KEY_PGUP, SIMU_STR_HLP_ACT_PGUP);
52+
addRadioWidget(ui->leftbuttons->addArea(QRect(55, 160, 80, 35), "320x240/left_page2.png", act));
53+
54+
act = new RadioUiAction(KEY_EXIT, QList<int>() << Qt::Key_Down << Qt::Key_Delete << Qt::Key_Escape << Qt::Key_Backspace,
55+
SIMU_STR_HLP_KEY_DN % "<br>" % SIMU_STR_HLP_KEYS_EXIT, SIMU_STR_HLP_ACT_RTN);
56+
addRadioWidget(ui->leftbuttons->addArea(QRect(55, 55, 80, 35), "320x240/left_rtn.png", act));
57+
58+
m_scrollUpAction = new RadioUiAction(-1, QList<int>() << Qt::Key_Minus, SIMU_STR_HLP_KEY_MIN % "|" % SIMU_STR_HLP_MOUSE_UP, SIMU_STR_HLP_ACT_ROT_LFT);
59+
m_scrollDnAction = new RadioUiAction(-1, QList<int>() << Qt::Key_Plus << Qt::Key_Equal, SIMU_STR_HLP_KEY_PLS % "|" % SIMU_STR_HLP_MOUSE_DN, SIMU_STR_HLP_ACT_ROT_RGT);
60+
connectScrollActions();
61+
62+
addRadioWidget(ui->leftbuttons->addArea(QRect(10, 245, 30, 30), "320x240/left_scrnsht.png", m_screenshotAction));
63+
64+
m_backlightColors << QColor(47, 123, 227);
65+
66+
setLcd(ui->lcd);
67+
}
68+
69+
SimulatedUIWidget320x240::~SimulatedUIWidget320x240()
70+
{
71+
delete ui;
72+
}

0 commit comments

Comments
 (0)