Skip to content

Commit

Permalink
feat: support for HelloRadioSky V16 (#5317)
Browse files Browse the repository at this point in the history
Co-authored-by: Peter Feerick <[email protected]>
  • Loading branch information
richardclli and pfeerick authored Sep 1, 2024
1 parent 4426f56 commit 17bf9dc
Show file tree
Hide file tree
Showing 45 changed files with 1,062 additions and 46 deletions.
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ body:
- FrSky X10 Express / X10S Express (ACCESS)
- FrSky X12
- FrSky X-Lite / S / Pro
- HelloRadioSky V16
- Jumper T12
- Jumper T14
- Jumper T16
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ jobs:
- tx12;tx12mk2;boxer
- tx16s
- f16
- v16
- x10;x10express
- x12s
- x7;x7access
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
- tx12;tx12mk2;boxer
- tx16s
- f16
- v16
- x10;x10express
- x12s
- x7;x7access
Expand Down
2 changes: 2 additions & 0 deletions companion/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,8 @@ elseif(PCB STREQUAL X10 AND PCBREV STREQUAL TX16S)
set(FLAVOUR tx16s)
elseif(PCB STREQUAL X10 AND PCBREV STREQUAL F16)
set(FLAVOUR f16)
elseif(PCB STREQUAL X10 AND PCBREV STREQUAL V16)
set(FLAVOUR v16)
elseif(PCB STREQUAL X7 AND PCBREV STREQUAL T14)
set(FLAVOUR t14)
elseif(PCB STREQUAL X10 AND PCBREV STREQUAL T15)
Expand Down
9 changes: 9 additions & 0 deletions companion/src/companion.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,15 @@
<file>images/simulator/Pocket/right.png</file>
<file>images/simulator/Pocket/top.png</file>
<file>images/simulator/Pocket/bottom.png</file>
<file>images/simulator/V16/left.png</file>
<file>images/simulator/V16/left_pagedn.png</file>
<file>images/simulator/V16/left_pageup.png</file>
<file>images/simulator/V16/left_rtn.png</file>
<file>images/simulator/V16/left_sys.png</file>
<file>images/simulator/V16/left_tele.png</file>
<file>images/simulator/V16/right.png</file>
<file>images/simulator/V16/right_ent.png</file>
<file>images/simulator/V16/right_mdl.png</file>
<file>images/wizard/ailerons.png</file>
<file>images/wizard/airbrakes.png</file>
<file>images/wizard/elevons.png</file>
Expand Down
5 changes: 5 additions & 0 deletions companion/src/firmwares/boards.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ int Boards::getEEpromSize(Board::Type board)
case BOARD_FLYSKY_EL18:
case BOARD_FLYSKY_PL18:
case BOARD_FATFISH_F16:
case BOARD_HELLORADIOSKY_V16:
return 0;
default:
return 0;
Expand Down Expand Up @@ -267,6 +268,7 @@ int Boards::getFlashSize(Type board)
case BOARD_FLYSKY_EL18:
case BOARD_FLYSKY_PL18:
case BOARD_FATFISH_F16:
case BOARD_HELLORADIOSKY_V16:
return FSIZE_HORUS;
case BOARD_UNKNOWN:
return FSIZE_MAX;
Expand Down Expand Up @@ -581,6 +583,8 @@ QString Boards::getBoardName(Board::Type board)
return "iFlight Commando 8";
case BOARD_FATFISH_F16:
return "Fatfish F16";
case BOARD_HELLORADIOSKY_V16:
return "HelloRadioSky V16";
default:
return CPN_STR_UNKNOWN_ITEM;
}
Expand Down Expand Up @@ -694,6 +698,7 @@ int Boards::getDefaultInternalModules(Board::Type board)
case BOARD_JUMPER_T20V2:
case BOARD_JUMPER_TPROS:
case BOARD_FATFISH_F16:
case BOARD_HELLORADIOSKY_V16:
return (int)MODULE_TYPE_CROSSFIRE;

case BOARD_FLYSKY_NV14:
Expand Down
8 changes: 7 additions & 1 deletion companion/src/firmwares/boards.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ namespace Board {
BOARD_RADIOMASTER_POCKET,
BOARD_JUMPER_T20V2,
BOARD_FATFISH_F16,
BOARD_HELLORADIOSKY_V16,
BOARD_TYPE_COUNT,
BOARD_TYPE_MAX = BOARD_TYPE_COUNT - 1
};
Expand Down Expand Up @@ -514,9 +515,14 @@ inline bool IS_FATFISH_F16(Board::Type board)
return board == Board::BOARD_FATFISH_F16;
}

inline bool IS_HELLORADIOSKY_V16(Board::Type board)
{
return board == Board::BOARD_HELLORADIOSKY_V16;
}

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;
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;
}

inline bool IS_FAMILY_T12(Board::Type board)
Expand Down
9 changes: 9 additions & 0 deletions companion/src/firmwares/opentx/opentxinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ const char * OpenTxEepromInterface::getName()
return "EdgeTX for iFlight Commando 8";
case BOARD_FATFISH_F16:
return "EdgeTX for Fatfish F16";
case BOARD_HELLORADIOSKY_V16:
return "EdgeTX for HelloRadioSky V16";
default:
return "Board is unknown to EdgeTX";
}
Expand Down Expand Up @@ -1390,6 +1392,13 @@ void registerOpenTxFirmwares()
registerOpenTxFirmware(firmware);
addOpenTxRfOptions(firmware, EU + FLEX);

/* HelloRadioSky V16 board */
firmware = new OpenTxFirmware(FIRMWAREID("v16"), Firmware::tr("HelloRadioSky V16"), BOARD_HELLORADIOSKY_V16);
addOpenTxFrskyOptions(firmware);
addOpenTxRfOptions(firmware, FLEX);
firmware->addOptionsGroup({opt_bt, opt_internal_gps});
registerOpenTxFirmware(firmware);

/* iFlight Commando8 board */
firmware = new OpenTxFirmware(FIRMWAREID("commando8"), QCoreApplication::translate("Firmware", "iFlight Commando8"), BOARD_IFLIGHT_COMMANDO8);
addOpenTxCommonOptions(firmware);
Expand Down
Binary file added companion/src/images/simulator/V16/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.
Binary file added companion/src/images/simulator/V16/left_rtn.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/V16/left_sys.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/V16/left_tele.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/V16/right.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/V16/right_ent.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/V16/right_mdl.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 @@ -55,6 +55,7 @@ set(${PROJECT_NAME}_SRCS
simulateduiwidgetT8.cpp
simulateduiwidgetTX12.cpp
simulateduiwidgetTX16S.cpp
simulateduiwidgetV16.cpp
simulateduiwidgetX10.cpp
simulateduiwidgetX12.cpp
simulateduiwidgetX7.cpp
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 @@ -162,6 +162,7 @@ namespace Ui {
class SimulatedUIWidgetNV14;
class SimulatedUIWidgetEL18;
class SimulatedUIWidgetPL18;
class SimulatedUIWidgetV16;
}

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

class SimulatedUIWidgetV16: public SimulatedUIWidget
{
Q_OBJECT

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

private:
Ui::SimulatedUIWidgetV16 * ui;
};

#endif // SIMULATEDUIWIDGET_H
69 changes: 69 additions & 0 deletions companion/src/simulation/simulateduiwidgetV16.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
/*
* Copyright (C) EdgeTX
*
* Based on code named
* opentx - https://github.com/opentx/opentx
* 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.
*/

#include "simulateduiwidget.h"
#include "ui_simulateduiwidgetV16.h"

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

ui->setupUi(this);

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

act = new RadioUiAction(KEY_SYS, QList<int>() << Qt::Key_Left, SIMU_STR_HLP_KEY_LFT, SIMU_STR_HLP_ACT_SYS);
addRadioWidget(ui->left->addArea(QRect(60, 10, 81, 51), "V16/left_sys.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->left->addArea(QRect(75, 105, 60, 30), "V16/left_rtn.png", act));

act = new RadioUiAction(KEY_PAGEDN, QList<int>() << Qt::Key_PageDown, SIMU_STR_HLP_KEY_PGDN, SIMU_STR_HLP_ACT_PGDN);
addRadioWidget(ui->left->addArea(QRect(75, 160, 60, 30), "V16/left_pagedn.png", act));

act = new RadioUiAction(KEY_PAGEUP, QList<int>() << Qt::Key_PageUp, SIMU_STR_HLP_KEY_PGUP, SIMU_STR_HLP_ACT_PGUP);
addRadioWidget(ui->left->addArea(QRect(75, 220, 60, 30), "V16/left_pageup.png", act));

act = new RadioUiAction(KEY_TELE, QList<int>() << Qt::Key_Right, SIMU_STR_HLP_KEY_RGT, SIMU_STR_HLP_ACT_TELE);
addRadioWidget(ui->left->addArea(QRect(75, 280, 80, 35), "V16/left_tele.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->right->addArea(QRect(40, 130, 51, 131), "V16/right_ent.png", m_mouseMidClickAction));

act = new RadioUiAction(KEY_MODEL, QList<int>() << Qt::Key_Up, SIMU_STR_HLP_KEY_UP, SIMU_STR_HLP_ACT_MDL);
addRadioWidget(ui->right->addArea(QRect(30, 10, 81, 51), "V16/right_mdl.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();

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

setLcd(ui->lcd);
}

SimulatedUIWidgetV16::~SimulatedUIWidgetV16()
{
delete ui;
}
151 changes: 151 additions & 0 deletions companion/src/simulation/simulateduiwidgetV16.ui
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>SimulatedUIWidgetV16</class>
<widget class="QWidget" name="SimulatedUIWidgetV16">
<property name="enabled">
<bool>true</bool>
</property>
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>829</width>
<height>320</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>829</width>
<height>320</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>829</width>
<height>355</height>
</size>
</property>
<widget class="ButtonsWidget" name="right" native="true">
<property name="geometry">
<rect>
<x>658</x>
<y>0</y>
<width>167</width>
<height>320</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>167</width>
<height>320</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>167</width>
<height>320</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background:url(:/images/simulator/V16/right.png)</string>
</property>
</widget>
<widget class="ButtonsWidget" name="left" native="true">
<property name="geometry">
<rect>
<x>1</x>
<y>0</y>
<width>175</width>
<height>320</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>175</width>
<height>320</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>175</width>
<height>320</height>
</size>
</property>
<property name="mouseTracking">
<bool>true</bool>
</property>
<property name="styleSheet">
<string notr="true">background:url(:/images/simulator/V16/left.png);</string>
</property>
</widget>
<widget class="LcdWidget" name="lcd" native="true">
<property name="geometry">
<rect>
<x>177</x>
<y>24</y>
<width>480</width>
<height>272</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>480</width>
<height>272</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>480</width>
<height>272</height>
</size>
</property>
<property name="font">
<font>
<pointsize>5</pointsize>
</font>
</property>
</widget>
</widget>
<customwidgets>
<customwidget>
<class>LcdWidget</class>
<extends>QWidget</extends>
<header>lcdwidget.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>ButtonsWidget</class>
<extends>QWidget</extends>
<header>buttonswidget.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources>
<include location="../companion.qrc"/>
</resources>
<connections/>
</ui>
3 changes: 3 additions & 0 deletions companion/src/simulation/simulatorwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,9 @@ SimulatorWidget::SimulatorWidget(QWidget * parent, SimulatorInterface * simulato
case Board::BOARD_FLYSKY_PL18:
radioUiWidget = new SimulatedUIWidgetPL18(simulator, this);
break;
case Board::BOARD_HELLORADIOSKY_V16:
radioUiWidget = new SimulatedUIWidgetV16(simulator, this);
break;
default:
radioUiWidget = new SimulatedUIWidget9X(simulator, this);
break;
Expand Down
Loading

0 comments on commit 17bf9dc

Please sign in to comment.