Skip to content

Commit

Permalink
Testing for 320x240
Browse files Browse the repository at this point in the history
  • Loading branch information
philmoz committed Feb 12, 2024
1 parent d41d4a7 commit 50657fd
Show file tree
Hide file tree
Showing 320 changed files with 103,211 additions and 952 deletions.
11 changes: 11 additions & 0 deletions companion/src/companion.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,17 @@
<file>images/simulator/TX16S/left_tele.png</file>
<file>images/simulator/TX16S/right_ent.png</file>
<file>images/simulator/TX16S/right_mdl.png</file>
<file>images/simulator/320x240/left.png</file>
<file>images/simulator/320x240/right.png</file>
<file>images/simulator/320x240/top.png</file>
<file>images/simulator/320x240/bottom.png</file>
<file>images/simulator/320x240/left_page.png</file>
<file>images/simulator/320x240/left_page2.png</file>
<file>images/simulator/320x240/left_rtn.png</file>
<file>images/simulator/320x240/left_sys.png</file>
<file>images/simulator/320x240/left_tele.png</file>
<file>images/simulator/320x240/right_ent.png</file>
<file>images/simulator/320x240/right_mdl.png</file>
<file>images/simulator/NV14/left.png</file>
<file>images/simulator/NV14/right.png</file>
<file>images/simulator/NV14/top.png</file>
Expand Down
6 changes: 6 additions & 0 deletions companion/src/firmwares/boards.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ uint32_t Boards::getFourCC(Type board)
return 0x3A78746F;
case BOARD_FLYSKY_PL18:
return 0x4878746F;
case BOARD_SMALL_LCD:
return 0x3878746F;
default:
return 0;
}
Expand Down Expand Up @@ -255,6 +257,7 @@ int Boards::getFlashSize(Type board)
case BOARD_FLYSKY_NV14:
case BOARD_FLYSKY_EL18:
case BOARD_FLYSKY_PL18:
case BOARD_SMALL_LCD:
return FSIZE_HORUS;
case BOARD_UNKNOWN:
return FSIZE_MAX;
Expand Down Expand Up @@ -554,6 +557,8 @@ QString Boards::getBoardName(Board::Type board)
return "BETAFPV LR3PRO";
case BOARD_IFLIGHT_COMMANDO8:
return "iFlight Commando 8";
case BOARD_SMALL_LCD:
return "320x240 Test";
default:
return CPN_STR_UNKNOWN_ITEM;
}
Expand Down Expand Up @@ -649,6 +654,7 @@ int Boards::getDefaultInternalModules(Board::Type board)
case BOARD_JUMPER_TPRO:
case BOARD_JUMPER_TPROV2:
case BOARD_FLYSKY_PL18:
case BOARD_SMALL_LCD:
return (int)MODULE_TYPE_MULTIMODULE;

case BOARD_BETAFPV_LR3PRO:
Expand Down
3 changes: 2 additions & 1 deletion companion/src/firmwares/boards.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ namespace Board {
BOARD_FLYSKY_EL18,
BOARD_JUMPER_TPROV2,
BOARD_RADIOMASTER_POCKET,
BOARD_SMALL_LCD,
BOARD_TYPE_COUNT,
BOARD_TYPE_MAX = BOARD_TYPE_COUNT - 1
};
Expand Down Expand Up @@ -482,7 +483,7 @@ inline bool IS_RADIOMASTER_T8(Board::Type board)

inline bool IS_FAMILY_T16(Board::Type board)
{
return board == Board::BOARD_JUMPER_T16 || board == Board::BOARD_RADIOMASTER_TX16S || board == Board::BOARD_JUMPER_T18;
return board == Board::BOARD_JUMPER_T16 || board == Board::BOARD_RADIOMASTER_TX16S || board == Board::BOARD_JUMPER_T18 || board == Board::BOARD_SMALL_LCD;
}

inline bool IS_FAMILY_T12(Board::Type board)
Expand Down
12 changes: 12 additions & 0 deletions companion/src/firmwares/opentx/opentxinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ const char * OpenTxEepromInterface::getName()
return "EdgeTx for BETAFPV LR3PRO";
case BOARD_IFLIGHT_COMMANDO8:
return "EdgeTX for iFlight Commando 8";
case BOARD_SMALL_LCD:
return "EdgeTX test for 320x240";
default:
return "Board is unknown to EdgeTX";
}
Expand Down Expand Up @@ -666,6 +668,8 @@ int OpenTxFirmware::getCapability(::Capability capability)
case LcdWidth:
if (IS_FLYSKY_NV14(board) || IS_FLYSKY_EL18(board))
return 320;
else if (board == BOARD_SMALL_LCD)
return 320;
else if (IS_FLYSKY_PL18(board))
return 480;
else if (IS_FAMILY_HORUS_OR_T16(board))
Expand All @@ -679,6 +683,8 @@ int OpenTxFirmware::getCapability(::Capability capability)
case LcdHeight:
if (IS_FLYSKY_NV14(board) || IS_FLYSKY_EL18(board))
return 480;
else if (board == BOARD_SMALL_LCD)
return 240;
else if (IS_FLYSKY_PL18(board))
return 320;
else if (IS_FAMILY_HORUS_OR_T16(board))
Expand Down Expand Up @@ -1485,6 +1491,12 @@ void registerOpenTxFirmwares()
firmware->addOption("flyskygimbals", Firmware::tr("Support hardware mod: FlySky Paladin EV Gimbals"));
registerOpenTxFirmware(firmware);

/* Test 320x240 */
firmware = new OpenTxFirmware(FIRMWAREID("smallLCD"), Firmware::tr("Test 320x240 LCD"), BOARD_SMALL_LCD);
addOpenTxFrskyOptions(firmware);
addOpenTxRfOptions(firmware, FLEX);
registerOpenTxFirmware(firmware);

/* Radiomaster Zorro board */
firmware = new OpenTxFirmware(FIRMWAREID("zorro"), QCoreApplication::translate("Firmware", "Radiomaster Zorro"), Board::BOARD_RADIOMASTER_ZORRO);
addOpenTxCommonOptions(firmware);
Expand Down
Binary file added companion/src/images/simulator/320x240/bottom.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added companion/src/images/simulator/320x240/left.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added companion/src/images/simulator/320x240/right.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added companion/src/images/simulator/320x240/top.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions companion/src/simulation/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ set(${PROJECT_NAME}_SRCS
simulateduiwidgetX9LITE.cpp
simulateduiwidgetXLITE.cpp
simulateduiwidgetZorro.cpp
simulateduiwidget320x240.cpp
)

set(${PROJECT_NAME}_HDRS
Expand Down
13 changes: 13 additions & 0 deletions companion/src/simulation/simulateduiwidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ namespace Ui {
class SimulatedUIWidgetNV14;
class SimulatedUIWidgetEL18;
class SimulatedUIWidgetPL18;
class SimulatedUIWidget320x240;
}

class SimulatedUIWidget9X: public SimulatedUIWidget
Expand Down Expand Up @@ -420,4 +421,16 @@ class SimulatedUIWidgetPL18: public SimulatedUIWidget
Ui::SimulatedUIWidgetPL18 * ui;
};

class SimulatedUIWidget320x240: public SimulatedUIWidget
{
Q_OBJECT

public:
explicit SimulatedUIWidget320x240(SimulatorInterface * simulator, QWidget * parent = nullptr);
virtual ~SimulatedUIWidget320x240();

private:
Ui::SimulatedUIWidget320x240 * ui;
};

#endif // SIMULATEDUIWIDGET_H
72 changes: 72 additions & 0 deletions companion/src/simulation/simulateduiwidget320x240.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
/*
* Copyright (C) OpenTX
*
* Based on code named
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/

// NOTE: RadioUiAction(NUMBER,...): NUMBER relates to enum EnumKeys in the specific board.h

#include "simulateduiwidget.h"
#include "ui_simulateduiwidget320x240.h"

SimulatedUIWidget320x240::SimulatedUIWidget320x240(SimulatorInterface *simulator, QWidget * parent):
SimulatedUIWidget(simulator, parent),
ui(new Ui::SimulatedUIWidget320x240)
{
RadioUiAction * act;

ui->setupUi(this);

// add actions in order of appearance on the help menu

act = new RadioUiAction(12, QList<int>() << Qt::Key_Up, SIMU_STR_HLP_KEY_UP, SIMU_STR_HLP_ACT_MDL);
addRadioWidget(ui->rightbuttons->addArea(QRect(40, 0, 110, 35), "320x240/right_mdl.png", act));

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(QRect(45, 70, 100, 160), "320x240/right_ent.png", m_mouseMidClickAction));

act = new RadioUiAction(14, QList<int>() << Qt::Key_Left, SIMU_STR_HLP_KEY_LFT, SIMU_STR_HLP_ACT_SYS);
addRadioWidget(ui->leftbuttons->addArea(QRect(32, 1, 80, 35), "320x240/left_sys.png", act));

act = new RadioUiAction(13, QList<int>() << Qt::Key_Right, SIMU_STR_HLP_KEY_RGT, SIMU_STR_HLP_ACT_TELE);
addRadioWidget(ui->leftbuttons->addArea(QRect(55, 220, 80, 35), "320x240/left_tele.png", act));

act = new RadioUiAction(5, QList<int>() << Qt::Key_PageDown, SIMU_STR_HLP_KEY_PGDN, SIMU_STR_HLP_ACT_PGDN);
addRadioWidget(ui->leftbuttons->addArea(QRect(55, 115, 80, 35), "320x240/left_page.png", act));

act = new RadioUiAction(4, QList<int>() << Qt::Key_PageUp, SIMU_STR_HLP_KEY_PGUP, SIMU_STR_HLP_ACT_PGUP);
addRadioWidget(ui->leftbuttons->addArea(QRect(55, 160, 80, 35), "320x240/left_page2.png", act));

act = new RadioUiAction(1, QList<int>() << Qt::Key_Down << Qt::Key_Delete << Qt::Key_Escape << Qt::Key_Backspace,
SIMU_STR_HLP_KEY_DN % "<br>" % SIMU_STR_HLP_KEYS_EXIT, SIMU_STR_HLP_ACT_RTN);
addRadioWidget(ui->leftbuttons->addArea(QRect(55, 55, 80, 35), "320x240/left_rtn.png", act));

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);
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);
connectScrollActions();

addRadioWidget(ui->leftbuttons->addArea(QRect(10, 245, 30, 30), "320x240/left_scrnsht.png", m_screenshotAction));

m_backlightColors << QColor(47, 123, 227);

setLcd(ui->lcd);
}

SimulatedUIWidget320x240::~SimulatedUIWidget320x240()
{
delete ui;
}
Loading

0 comments on commit 50657fd

Please sign in to comment.