Skip to content

Commit

Permalink
Testing for 320x240
Browse files Browse the repository at this point in the history
  • Loading branch information
philmoz committed Oct 9, 2024
1 parent fcc75bd commit e4b17ce
Show file tree
Hide file tree
Showing 324 changed files with 129,078 additions and 540 deletions.
11 changes: 11 additions & 0 deletions companion/src/companion.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,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
10 changes: 10 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 @@ -271,6 +273,7 @@ int Boards::getFlashSize(Type board)
case BOARD_FLYSKY_PL18:
case BOARD_FATFISH_F16:
case BOARD_HELLORADIOSKY_V16:
case BOARD_SMALL_LCD:
return FSIZE_HORUS;
case BOARD_UNKNOWN:
return FSIZE_MAX;
Expand Down Expand Up @@ -358,6 +361,8 @@ int Boards::getCapability(Board::Type board, Board::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) || IS_JUMPER_T15(board))
return 320;
else if (IS_FAMILY_HORUS_OR_T16(board))
Expand All @@ -368,6 +373,8 @@ int Boards::getCapability(Board::Type board, Board::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 Down Expand Up @@ -629,6 +636,8 @@ QString Boards::getBoardName(Board::Type board)
return "Fatfish F16";
case BOARD_HELLORADIOSKY_V16:
return "HelloRadioSky V16";
case BOARD_SMALL_LCD:
return "320x240 Test";
default:
return CPN_STR_UNKNOWN_ITEM;
}
Expand Down Expand Up @@ -732,6 +741,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 @@ -89,6 +89,7 @@ namespace Board {
BOARD_FATFISH_F16,
BOARD_HELLORADIOSKY_V16,
BOARD_RADIOMASTER_MT12,
BOARD_SMALL_LCD,
BOARD_TYPE_COUNT,
BOARD_TYPE_MAX = BOARD_TYPE_COUNT - 1
};
Expand Down Expand Up @@ -601,7 +602,7 @@ inline bool IS_HELLORADIOSKY_V16(Board::Type board)

inline bool IS_FAMILY_T16(Board::Type board)
{
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;
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;
}

inline bool IS_FAMILY_T12(Board::Type board)
Expand Down
8 changes: 8 additions & 0 deletions companion/src/firmwares/opentx/opentxinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ const char * OpenTxEepromInterface::getName()
return "EdgeTX for Fatfish F16";
case BOARD_HELLORADIOSKY_V16:
return "EdgeTX for HelloRadioSky V16";
case BOARD_SMALL_LCD:
return "EdgeTX test for 320x240";
default:
return "Board is unknown to EdgeTX";
}
Expand Down Expand Up @@ -1552,6 +1554,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 @@ -66,6 +66,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 @@ -191,6 +191,7 @@ namespace Ui {
class SimulatedUIWidgetEL18;
class SimulatedUIWidgetPL18;
class SimulatedUIWidgetV16;
class SimulatedUIWidget320x240;
}

class SimulatedUIWidgetGeneric: public SimulatedUIWidget
Expand Down Expand Up @@ -602,3 +603,15 @@ class SimulatedUIWidgetV16: public SimulatedUIWidget
private:
Ui::SimulatedUIWidgetV16 * ui;
};

class SimulatedUIWidget320x240: public SimulatedUIWidget
{
Q_OBJECT

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

private:
Ui::SimulatedUIWidget320x240 * ui;
};
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(KEY_MODEL, 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(KEY_ENTER, 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(KEY_SYS, 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(KEY_TELE, 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(KEY_PAGEDN, 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(KEY_PAGEUP, 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(KEY_EXIT, 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 e4b17ce

Please sign in to comment.