Skip to content

Commit 7921d60

Browse files
author
philmoz
committed
Testing for 320x240
1 parent 39ccd74 commit 7921d60

File tree

323 files changed

+129077
-539
lines changed

Some content is hidden

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

323 files changed

+129077
-539
lines changed

companion/src/companion.qrc

+11
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,17 @@
324324
<file>images/simulator/TX16S/left_tele.png</file>
325325
<file>images/simulator/TX16S/right_ent.png</file>
326326
<file>images/simulator/TX16S/right_mdl.png</file>
327+
<file>images/simulator/320x240/left.png</file>
328+
<file>images/simulator/320x240/right.png</file>
329+
<file>images/simulator/320x240/top.png</file>
330+
<file>images/simulator/320x240/bottom.png</file>
331+
<file>images/simulator/320x240/left_page.png</file>
332+
<file>images/simulator/320x240/left_page2.png</file>
333+
<file>images/simulator/320x240/left_rtn.png</file>
334+
<file>images/simulator/320x240/left_sys.png</file>
335+
<file>images/simulator/320x240/left_tele.png</file>
336+
<file>images/simulator/320x240/right_ent.png</file>
337+
<file>images/simulator/320x240/right_mdl.png</file>
327338
<file>images/simulator/NV14/left.png</file>
328339
<file>images/simulator/NV14/right.png</file>
329340
<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
}
@@ -269,6 +271,7 @@ int Boards::getFlashSize(Type board)
269271
case BOARD_FLYSKY_PL18:
270272
case BOARD_FATFISH_F16:
271273
case BOARD_HELLORADIOSKY_V16:
274+
case BOARD_SMALL_LCD:
272275
return FSIZE_HORUS;
273276
case BOARD_UNKNOWN:
274277
return FSIZE_MAX;
@@ -585,6 +588,8 @@ QString Boards::getBoardName(Board::Type board)
585588
return "Fatfish F16";
586589
case BOARD_HELLORADIOSKY_V16:
587590
return "HelloRadioSky V16";
591+
case BOARD_SMALL_LCD:
592+
return "320x240 Test";
588593
default:
589594
return CPN_STR_UNKNOWN_ITEM;
590595
}
@@ -683,6 +688,7 @@ int Boards::getDefaultInternalModules(Board::Type board)
683688
case BOARD_JUMPER_TPRO:
684689
case BOARD_JUMPER_TPROV2:
685690
case BOARD_FLYSKY_PL18:
691+
case BOARD_SMALL_LCD:
686692
return (int)MODULE_TYPE_MULTIMODULE;
687693

688694
case BOARD_BETAFPV_LR3PRO:

companion/src/firmwares/boards.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ namespace Board {
8888
BOARD_JUMPER_T20V2,
8989
BOARD_FATFISH_F16,
9090
BOARD_HELLORADIOSKY_V16,
91+
BOARD_SMALL_LCD,
9192
BOARD_TYPE_COUNT,
9293
BOARD_TYPE_MAX = BOARD_TYPE_COUNT - 1
9394
};
@@ -522,7 +523,7 @@ inline bool IS_HELLORADIOSKY_V16(Board::Type board)
522523

523524
inline bool IS_FAMILY_T16(Board::Type board)
524525
{
525-
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;
526+
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;
526527
}
527528

528529
inline bool IS_FAMILY_T12(Board::Type board)

companion/src/firmwares/opentx/opentxinterface.cpp

+12
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,8 @@ const char * OpenTxEepromInterface::getName()
145145
return "EdgeTX for Fatfish F16";
146146
case BOARD_HELLORADIOSKY_V16:
147147
return "EdgeTX for HelloRadioSky V16";
148+
case BOARD_SMALL_LCD:
149+
return "EdgeTX test for 320x240";
148150
default:
149151
return "Board is unknown to EdgeTX";
150152
}
@@ -708,6 +710,8 @@ int OpenTxFirmware::getCapability(::Capability capability)
708710
case LcdWidth:
709711
if (IS_FLYSKY_NV14(board) || IS_FLYSKY_EL18(board))
710712
return 320;
713+
else if (board == BOARD_SMALL_LCD)
714+
return 320;
711715
else if (IS_FLYSKY_PL18(board))
712716
return 480;
713717
else if (IS_FAMILY_HORUS_OR_T16(board))
@@ -721,6 +725,8 @@ int OpenTxFirmware::getCapability(::Capability capability)
721725
case LcdHeight:
722726
if (IS_FLYSKY_NV14(board) || IS_FLYSKY_EL18(board))
723727
return 480;
728+
else if (board == BOARD_SMALL_LCD)
729+
return 240;
724730
else if (IS_FLYSKY_PL18(board) || IS_JUMPER_T15(board))
725731
return 320;
726732
else if (IS_FAMILY_HORUS_OR_T16(board))
@@ -1568,6 +1574,12 @@ void registerOpenTxFirmwares()
15681574
firmware->addOption("flyskygimbals", Firmware::tr("Support hardware mod: FlySky Paladin EV Gimbals"));
15691575
registerOpenTxFirmware(firmware);
15701576

1577+
/* Test 320x240 */
1578+
firmware = new OpenTxFirmware(FIRMWAREID("smallLCD"), Firmware::tr("Test 320x240 LCD"), BOARD_SMALL_LCD);
1579+
addOpenTxFrskyOptions(firmware);
1580+
addOpenTxRfOptions(firmware, FLEX);
1581+
registerOpenTxFirmware(firmware);
1582+
15711583
/* Radiomaster Zorro board */
15721584
firmware = new OpenTxFirmware(FIRMWAREID("zorro"), QCoreApplication::translate("Firmware", "Radiomaster Zorro"), Board::BOARD_RADIOMASTER_ZORRO);
15731585
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
@@ -65,6 +65,7 @@ set(${PROJECT_NAME}_SRCS
6565
simulateduiwidgetX9LITE.cpp
6666
simulateduiwidgetXLITE.cpp
6767
simulateduiwidgetZorro.cpp
68+
simulateduiwidget320x240.cpp
6869
)
6970

7071
set(${PROJECT_NAME}_HDRS

companion/src/simulation/simulateduiwidget.h

+13
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ namespace Ui {
163163
class SimulatedUIWidgetEL18;
164164
class SimulatedUIWidgetPL18;
165165
class SimulatedUIWidgetV16;
166+
class SimulatedUIWidget320x240;
166167
}
167168

168169
class SimulatedUIWidget9X: public SimulatedUIWidget
@@ -553,4 +554,16 @@ class SimulatedUIWidgetV16: public SimulatedUIWidget
553554
Ui::SimulatedUIWidgetV16 * ui;
554555
};
555556

557+
class SimulatedUIWidget320x240: public SimulatedUIWidget
558+
{
559+
Q_OBJECT
560+
561+
public:
562+
explicit SimulatedUIWidget320x240(SimulatorInterface * simulator, QWidget * parent = nullptr);
563+
virtual ~SimulatedUIWidget320x240();
564+
565+
private:
566+
Ui::SimulatedUIWidget320x240 * ui;
567+
};
568+
556569
#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(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)