Skip to content

Commit 50657fd

Browse files
author
philmoz
committed
Testing for 320x240
1 parent d41d4a7 commit 50657fd

File tree

320 files changed

+103211
-952
lines changed

Some content is hidden

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

320 files changed

+103211
-952
lines changed

companion/src/companion.qrc

+11
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,17 @@
289289
<file>images/simulator/TX16S/left_tele.png</file>
290290
<file>images/simulator/TX16S/right_ent.png</file>
291291
<file>images/simulator/TX16S/right_mdl.png</file>
292+
<file>images/simulator/320x240/left.png</file>
293+
<file>images/simulator/320x240/right.png</file>
294+
<file>images/simulator/320x240/top.png</file>
295+
<file>images/simulator/320x240/bottom.png</file>
296+
<file>images/simulator/320x240/left_page.png</file>
297+
<file>images/simulator/320x240/left_page2.png</file>
298+
<file>images/simulator/320x240/left_rtn.png</file>
299+
<file>images/simulator/320x240/left_sys.png</file>
300+
<file>images/simulator/320x240/left_tele.png</file>
301+
<file>images/simulator/320x240/right_ent.png</file>
302+
<file>images/simulator/320x240/right_mdl.png</file>
292303
<file>images/simulator/NV14/left.png</file>
293304
<file>images/simulator/NV14/right.png</file>
294305
<file>images/simulator/NV14/top.png</file>

companion/src/firmwares/boards.cpp

+6
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
}
@@ -255,6 +257,7 @@ int Boards::getFlashSize(Type board)
255257
case BOARD_FLYSKY_NV14:
256258
case BOARD_FLYSKY_EL18:
257259
case BOARD_FLYSKY_PL18:
260+
case BOARD_SMALL_LCD:
258261
return FSIZE_HORUS;
259262
case BOARD_UNKNOWN:
260263
return FSIZE_MAX;
@@ -554,6 +557,8 @@ QString Boards::getBoardName(Board::Type board)
554557
return "BETAFPV LR3PRO";
555558
case BOARD_IFLIGHT_COMMANDO8:
556559
return "iFlight Commando 8";
560+
case BOARD_SMALL_LCD:
561+
return "320x240 Test";
557562
default:
558563
return CPN_STR_UNKNOWN_ITEM;
559564
}
@@ -649,6 +654,7 @@ int Boards::getDefaultInternalModules(Board::Type board)
649654
case BOARD_JUMPER_TPRO:
650655
case BOARD_JUMPER_TPROV2:
651656
case BOARD_FLYSKY_PL18:
657+
case BOARD_SMALL_LCD:
652658
return (int)MODULE_TYPE_MULTIMODULE;
653659

654660
case BOARD_BETAFPV_LR3PRO:

companion/src/firmwares/boards.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ namespace Board {
8080
BOARD_FLYSKY_EL18,
8181
BOARD_JUMPER_TPROV2,
8282
BOARD_RADIOMASTER_POCKET,
83+
BOARD_SMALL_LCD,
8384
BOARD_TYPE_COUNT,
8485
BOARD_TYPE_MAX = BOARD_TYPE_COUNT - 1
8586
};
@@ -482,7 +483,7 @@ inline bool IS_RADIOMASTER_T8(Board::Type board)
482483

483484
inline bool IS_FAMILY_T16(Board::Type board)
484485
{
485-
return board == Board::BOARD_JUMPER_T16 || board == Board::BOARD_RADIOMASTER_TX16S || board == Board::BOARD_JUMPER_T18;
486+
return board == Board::BOARD_JUMPER_T16 || board == Board::BOARD_RADIOMASTER_TX16S || board == Board::BOARD_JUMPER_T18 || board == Board::BOARD_SMALL_LCD;
486487
}
487488

488489
inline bool IS_FAMILY_T12(Board::Type board)

companion/src/firmwares/opentx/opentxinterface.cpp

+12
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,8 @@ const char * OpenTxEepromInterface::getName()
130130
return "EdgeTx for BETAFPV LR3PRO";
131131
case BOARD_IFLIGHT_COMMANDO8:
132132
return "EdgeTX for iFlight Commando 8";
133+
case BOARD_SMALL_LCD:
134+
return "EdgeTX test for 320x240";
133135
default:
134136
return "Board is unknown to EdgeTX";
135137
}
@@ -666,6 +668,8 @@ int OpenTxFirmware::getCapability(::Capability capability)
666668
case LcdWidth:
667669
if (IS_FLYSKY_NV14(board) || IS_FLYSKY_EL18(board))
668670
return 320;
671+
else if (board == BOARD_SMALL_LCD)
672+
return 320;
669673
else if (IS_FLYSKY_PL18(board))
670674
return 480;
671675
else if (IS_FAMILY_HORUS_OR_T16(board))
@@ -679,6 +683,8 @@ int OpenTxFirmware::getCapability(::Capability capability)
679683
case LcdHeight:
680684
if (IS_FLYSKY_NV14(board) || IS_FLYSKY_EL18(board))
681685
return 480;
686+
else if (board == BOARD_SMALL_LCD)
687+
return 240;
682688
else if (IS_FLYSKY_PL18(board))
683689
return 320;
684690
else if (IS_FAMILY_HORUS_OR_T16(board))
@@ -1485,6 +1491,12 @@ void registerOpenTxFirmwares()
14851491
firmware->addOption("flyskygimbals", Firmware::tr("Support hardware mod: FlySky Paladin EV Gimbals"));
14861492
registerOpenTxFirmware(firmware);
14871493

1494+
/* Test 320x240 */
1495+
firmware = new OpenTxFirmware(FIRMWAREID("smallLCD"), Firmware::tr("Test 320x240 LCD"), BOARD_SMALL_LCD);
1496+
addOpenTxFrskyOptions(firmware);
1497+
addOpenTxRfOptions(firmware, FLEX);
1498+
registerOpenTxFirmware(firmware);
1499+
14881500
/* Radiomaster Zorro board */
14891501
firmware = new OpenTxFirmware(FIRMWAREID("zorro"), QCoreApplication::translate("Firmware", "Radiomaster Zorro"), Board::BOARD_RADIOMASTER_ZORRO);
14901502
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
@@ -53,6 +53,7 @@ set(${PROJECT_NAME}_SRCS
5353
simulateduiwidgetX9LITE.cpp
5454
simulateduiwidgetXLITE.cpp
5555
simulateduiwidgetZorro.cpp
56+
simulateduiwidget320x240.cpp
5657
)
5758

5859
set(${PROJECT_NAME}_HDRS

companion/src/simulation/simulateduiwidget.h

+13
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ namespace Ui {
126126
class SimulatedUIWidgetNV14;
127127
class SimulatedUIWidgetEL18;
128128
class SimulatedUIWidgetPL18;
129+
class SimulatedUIWidget320x240;
129130
}
130131

131132
class SimulatedUIWidget9X: public SimulatedUIWidget
@@ -420,4 +421,16 @@ class SimulatedUIWidgetPL18: public SimulatedUIWidget
420421
Ui::SimulatedUIWidgetPL18 * ui;
421422
};
422423

424+
class SimulatedUIWidget320x240: public SimulatedUIWidget
425+
{
426+
Q_OBJECT
427+
428+
public:
429+
explicit SimulatedUIWidget320x240(SimulatorInterface * simulator, QWidget * parent = nullptr);
430+
virtual ~SimulatedUIWidget320x240();
431+
432+
private:
433+
Ui::SimulatedUIWidget320x240 * ui;
434+
};
435+
423436
#endif // SIMULATEDUIWIDGET_H
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(12, 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(2, 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(14, 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(13, 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(5, 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(4, 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(1, 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)