mirror of
https://github.com/EdgeTX/edgetx.git
synced 2025-07-24 00:35:14 +03:00
[Companion] Compilation fix
This commit is contained in:
parent
57aafeb062
commit
de49d155c6
39 changed files with 461 additions and 452 deletions
|
@ -21,77 +21,79 @@
|
|||
#include "boards.h"
|
||||
#include "macros.h"
|
||||
|
||||
int getEEpromSize(BoardEnum board)
|
||||
using namespace Board;
|
||||
|
||||
int getEEpromSize(Board::Type board)
|
||||
{
|
||||
switch (board) {
|
||||
case BOARD_STOCK:
|
||||
case Board::BOARD_STOCK:
|
||||
return EESIZE_STOCK;
|
||||
case BOARD_M128:
|
||||
case Board::BOARD_M128:
|
||||
return EESIZE_M128;
|
||||
case BOARD_MEGA2560:
|
||||
case BOARD_GRUVIN9X:
|
||||
case Board::BOARD_MEGA2560:
|
||||
case Board::BOARD_GRUVIN9X:
|
||||
return EESIZE_GRUVIN9X;
|
||||
case BOARD_SKY9X:
|
||||
case Board::BOARD_SKY9X:
|
||||
return EESIZE_SKY9X;
|
||||
case BOARD_9XRPRO:
|
||||
case BOARD_AR9X:
|
||||
case Board::BOARD_9XRPRO:
|
||||
case Board::BOARD_AR9X:
|
||||
return EESIZE_9XRPRO;
|
||||
case BOARD_TARANIS_X7:
|
||||
case BOARD_TARANIS_X9D:
|
||||
case BOARD_TARANIS_X9DP:
|
||||
case BOARD_TARANIS_X9E:
|
||||
case BOARD_FLAMENCO:
|
||||
case Board::BOARD_TARANIS_X7:
|
||||
case Board::BOARD_TARANIS_X9D:
|
||||
case Board::BOARD_TARANIS_X9DP:
|
||||
case Board::BOARD_TARANIS_X9E:
|
||||
case Board::BOARD_FLAMENCO:
|
||||
return EESIZE_TARANIS;
|
||||
default:
|
||||
return 0; // unlimited
|
||||
}
|
||||
}
|
||||
|
||||
SwitchInfo getSwitchInfo(BoardEnum board, unsigned index)
|
||||
Board::SwitchInfo getSwitchInfo(Board::Type board, unsigned index)
|
||||
{
|
||||
if (IS_TARANIS_X7(board)) {
|
||||
const SwitchInfo switches[] = {{SWITCH_3POS, "SA"},
|
||||
{SWITCH_3POS, "SB"},
|
||||
{SWITCH_3POS, "SC"},
|
||||
{SWITCH_3POS, "SD"},
|
||||
{SWITCH_2POS, "SF"},
|
||||
{SWITCH_TOGGLE, "SH"}};
|
||||
const Board::SwitchInfo switches[] = {{Board::SWITCH_3POS, "SA"},
|
||||
{Board::SWITCH_3POS, "SB"},
|
||||
{Board::SWITCH_3POS, "SC"},
|
||||
{Board::SWITCH_3POS, "SD"},
|
||||
{Board::SWITCH_2POS, "SF"},
|
||||
{Board::SWITCH_TOGGLE, "SH"}};
|
||||
if (index < DIM(switches))
|
||||
return switches[index];
|
||||
}
|
||||
else if (IS_HORUS_OR_TARANIS(board)) {
|
||||
const SwitchInfo switches[] = {{SWITCH_3POS, "SA"},
|
||||
{SWITCH_3POS, "SB"},
|
||||
{SWITCH_3POS, "SC"},
|
||||
{SWITCH_3POS, "SD"},
|
||||
{SWITCH_3POS, "SE"},
|
||||
{SWITCH_2POS, "SF"},
|
||||
{SWITCH_3POS, "SG"},
|
||||
{SWITCH_TOGGLE, "SH"},
|
||||
{SWITCH_3POS, "SI"},
|
||||
{SWITCH_3POS, "SJ"},
|
||||
{SWITCH_3POS, "SK"},
|
||||
{SWITCH_3POS, "SL"},
|
||||
{SWITCH_3POS, "SM"},
|
||||
{SWITCH_3POS, "SN"},
|
||||
{SWITCH_3POS, "SO"},
|
||||
{SWITCH_3POS, "SP"},
|
||||
{SWITCH_3POS, "SQ"},
|
||||
{SWITCH_3POS, "SR"}};
|
||||
const Board::SwitchInfo switches[] = {{Board::SWITCH_3POS, "SA"},
|
||||
{Board::SWITCH_3POS, "SB"},
|
||||
{Board::SWITCH_3POS, "SC"},
|
||||
{Board::SWITCH_3POS, "SD"},
|
||||
{Board::SWITCH_3POS, "SE"},
|
||||
{Board::SWITCH_2POS, "SF"},
|
||||
{Board::SWITCH_3POS, "SG"},
|
||||
{Board::SWITCH_TOGGLE, "SH"},
|
||||
{Board::SWITCH_3POS, "SI"},
|
||||
{Board::SWITCH_3POS, "SJ"},
|
||||
{Board::SWITCH_3POS, "SK"},
|
||||
{Board::SWITCH_3POS, "SL"},
|
||||
{Board::SWITCH_3POS, "SM"},
|
||||
{Board::SWITCH_3POS, "SN"},
|
||||
{Board::SWITCH_3POS, "SO"},
|
||||
{Board::SWITCH_3POS, "SP"},
|
||||
{Board::SWITCH_3POS, "SQ"},
|
||||
{Board::SWITCH_3POS, "SR"}};
|
||||
if (index < DIM(switches))
|
||||
return switches[index];
|
||||
}
|
||||
else {
|
||||
const SwitchInfo switches[] = {{SWITCH_2POS, "THR"},
|
||||
{SWITCH_2POS, "RUD"},
|
||||
{SWITCH_2POS, "ELE"},
|
||||
{SWITCH_3POS, "3POS"},
|
||||
{SWITCH_2POS, "AIL"},
|
||||
{SWITCH_2POS, "GEA"},
|
||||
{SWITCH_TOGGLE, "TRN"}};
|
||||
const Board::SwitchInfo switches[] = {{Board::SWITCH_2POS, "THR"},
|
||||
{Board::SWITCH_2POS, "RUD"},
|
||||
{Board::SWITCH_2POS, "ELE"},
|
||||
{Board::SWITCH_3POS, "3POS"},
|
||||
{Board::SWITCH_2POS, "AIL"},
|
||||
{Board::SWITCH_2POS, "GEA"},
|
||||
{Board::SWITCH_TOGGLE, "TRN"}};
|
||||
if (index < DIM(switches))
|
||||
return switches[index];
|
||||
}
|
||||
|
||||
return {SWITCH_NOT_AVAILABLE, "???"};
|
||||
return {Board::SWITCH_NOT_AVAILABLE, "???"};
|
||||
}
|
|
@ -23,7 +23,10 @@
|
|||
|
||||
// TODO create a Board class with all these functions
|
||||
|
||||
enum BoardEnum {
|
||||
namespace Board {
|
||||
|
||||
enum Type
|
||||
{
|
||||
BOARD_STOCK,
|
||||
BOARD_M128,
|
||||
BOARD_MEGA2560,
|
||||
|
@ -38,31 +41,46 @@ enum BoardEnum {
|
|||
BOARD_FLAMENCO,
|
||||
BOARD_HORUS,
|
||||
BOARD_UNKNOWN = -1
|
||||
};
|
||||
};
|
||||
|
||||
enum PotConfig {
|
||||
enum PotType
|
||||
{
|
||||
POT_NONE,
|
||||
POT_WITH_DETENT,
|
||||
POT_MULTIPOS_SWITCH,
|
||||
POT_WITHOUT_DETENT
|
||||
};
|
||||
};
|
||||
|
||||
enum SliderConfig {
|
||||
enum SliderType
|
||||
{
|
||||
SLIDER_NONE,
|
||||
SLIDER_WITH_DETENT
|
||||
};
|
||||
};
|
||||
|
||||
enum SwitchConfig {
|
||||
enum SwitchType
|
||||
{
|
||||
SWITCH_NOT_AVAILABLE,
|
||||
SWITCH_TOGGLE,
|
||||
SWITCH_2POS,
|
||||
SWITCH_3POS
|
||||
};
|
||||
};
|
||||
|
||||
struct SwitchInfo {
|
||||
SwitchConfig config;
|
||||
struct SwitchInfo
|
||||
{
|
||||
SwitchType config;
|
||||
const char * name;
|
||||
};
|
||||
};
|
||||
|
||||
struct SwitchPosition {
|
||||
SwitchPosition(unsigned int index, unsigned int position):
|
||||
index(index),
|
||||
position(position)
|
||||
{
|
||||
}
|
||||
unsigned int index;
|
||||
unsigned int position;
|
||||
};
|
||||
}
|
||||
|
||||
// TODO remove all those constants
|
||||
#define EESIZE_STOCK 2048
|
||||
|
@ -83,22 +101,22 @@ struct SwitchInfo {
|
|||
#define FSIZE_HORUS (2048*1024)
|
||||
#define FSIZE_MAX FSIZE_HORUS
|
||||
|
||||
int getEEpromSize(BoardEnum board);
|
||||
SwitchInfo getSwitchInfo(BoardEnum board, unsigned index);
|
||||
int getEEpromSize(Board::Type board);
|
||||
Board::SwitchInfo getSwitchInfo(Board::Type board, unsigned index);
|
||||
|
||||
#define IS_9X(board) (board==BOARD_STOCK || board==BOARD_M128)
|
||||
#define IS_STOCK(board) (board==BOARD_STOCK)
|
||||
#define IS_2560(board) (board==BOARD_GRUVIN9X || board==BOARD_MEGA2560)
|
||||
#define IS_SKY9X(board) (board==BOARD_SKY9X || board==BOARD_9XRPRO || board==BOARD_AR9X)
|
||||
#define IS_9XRPRO(board) (board==BOARD_9XRPRO)
|
||||
#define IS_TARANIS_X7(board) (board==BOARD_TARANIS_X7)
|
||||
#define IS_TARANIS_X9(board) (board==BOARD_TARANIS_X9D || board==BOARD_TARANIS_X9DP || board==BOARD_TARANIS_X9E)
|
||||
#define IS_TARANIS_PLUS(board) (board==BOARD_TARANIS_X9DP || board==BOARD_TARANIS_X9E)
|
||||
#define IS_TARANIS_X9E(board) (board==BOARD_TARANIS_X9E)
|
||||
#define IS_9X(board) (board==Board::BOARD_STOCK || board==Board::BOARD_M128)
|
||||
#define IS_STOCK(board) (board==Board::BOARD_STOCK)
|
||||
#define IS_2560(board) (board==Board::BOARD_GRUVIN9X || board==Board::BOARD_MEGA2560)
|
||||
#define IS_SKY9X(board) (board==Board::BOARD_SKY9X || board==Board::BOARD_9XRPRO || board==Board::BOARD_AR9X)
|
||||
#define IS_9XRPRO(board) (board==Board::BOARD_9XRPRO)
|
||||
#define IS_TARANIS_X7(board) (board==Board::BOARD_TARANIS_X7)
|
||||
#define IS_TARANIS_X9(board) (board==Board::BOARD_TARANIS_X9D || board==Board::BOARD_TARANIS_X9DP || board==Board::BOARD_TARANIS_X9E)
|
||||
#define IS_TARANIS_PLUS(board) (board==Board::BOARD_TARANIS_X9DP || board==Board::BOARD_TARANIS_X9E)
|
||||
#define IS_TARANIS_X9E(board) (board==Board::BOARD_TARANIS_X9E)
|
||||
#define IS_TARANIS(board) (IS_TARANIS_X9(board) || IS_TARANIS_X7(board))
|
||||
#define IS_HORUS(board) (board==BOARD_HORUS)
|
||||
#define IS_HORUS(board) (board==Board::BOARD_HORUS)
|
||||
#define IS_HORUS_OR_TARANIS(board) (IS_HORUS(board) || IS_TARANIS(board))
|
||||
#define IS_FLAMENCO(board) (board==BOARD_FLAMENCO)
|
||||
#define IS_FLAMENCO(board) (board==Board::BOARD_FLAMENCO)
|
||||
#define IS_STM32(board) (IS_TARANIS(board) || IS_HORUS(board) || IS_FLAMENCO(board))
|
||||
#define IS_ARM(board) (IS_STM32(board) || IS_SKY9X(board))
|
||||
#define HAS_LARGE_LCD(board) (IS_HORUS(board) || (IS_TARANIS(board) && !IS_TARANIS_X7(board)))
|
||||
|
|
|
@ -40,7 +40,7 @@ burnConfigDialog::burnConfigDialog(QWidget *parent) :
|
|||
|
||||
getSettings();
|
||||
populateProgrammers();
|
||||
BoardEnum board = getCurrentBoard();
|
||||
Board::Type board = getCurrentBoard();
|
||||
if (IS_STM32(board)) {
|
||||
setWindowTitle(tr("DFU-UTIL Configuration"));
|
||||
ui->avrArgs->hide();
|
||||
|
@ -328,7 +328,7 @@ void burnConfigDialog::on_pushButton_4_clicked()
|
|||
|
||||
void burnConfigDialog::on_advCtrChkB_toggled(bool checked)
|
||||
{
|
||||
BoardEnum board = getCurrentBoard();
|
||||
Board::Type board = getCurrentBoard();
|
||||
if (checked) {
|
||||
if (IS_STM32(board)) {
|
||||
ui->label_dfu2->show();
|
||||
|
|
|
@ -592,9 +592,9 @@ bool RawSource::isSlider() const
|
|||
index < CPN_MAX_STICKS+getCurrentFirmware()->getCapability(Pots)+getCurrentFirmware()->getCapability(Sliders));
|
||||
}
|
||||
|
||||
QString RawSwitch::toString(BoardEnum board) const
|
||||
QString RawSwitch::toString(Board::Type board) const
|
||||
{
|
||||
if (board == BOARD_UNKNOWN) {
|
||||
if (board == Board::BOARD_UNKNOWN) {
|
||||
board = getCurrentBoard();
|
||||
}
|
||||
|
||||
|
@ -638,7 +638,7 @@ QString RawSwitch::toString(BoardEnum board) const
|
|||
case SWITCH_TYPE_SWITCH:
|
||||
if (IS_HORUS_OR_TARANIS(board)) {
|
||||
div_t qr = div(index-1, 3);
|
||||
SwitchInfo switchInfo = getSwitchInfo(board, qr.quot);
|
||||
Board::SwitchInfo switchInfo = getSwitchInfo(board, qr.quot);
|
||||
const char * positions[] = { ARROW_UP, "-", ARROW_DOWN };
|
||||
return QString(switchInfo.name) + QString(positions[qr.rem]);
|
||||
}
|
||||
|
@ -843,7 +843,7 @@ void CustomFunctionData::populateResetParams(const ModelData * model, QComboBox
|
|||
{
|
||||
int val = 0;
|
||||
Firmware * firmware = getCurrentFirmware();
|
||||
BoardEnum board = firmware->getBoard();
|
||||
Board::Type board = firmware->getBoard();
|
||||
|
||||
b->addItem(QObject::tr("Timer1"), val++);
|
||||
b->addItem(QObject::tr("Timer2"), val++);
|
||||
|
@ -1023,39 +1023,36 @@ void LimitData::clear()
|
|||
max = +1000;
|
||||
}
|
||||
|
||||
GeneralSettings::SwitchInfo GeneralSettings::switchInfoFromSwitchPositionTaranis(unsigned int index)
|
||||
{
|
||||
return SwitchInfo((index-1)/3, (index-1)%3);
|
||||
}
|
||||
|
||||
bool GeneralSettings::switchPositionAllowedTaranis(int index) const
|
||||
{
|
||||
if (index == 0)
|
||||
return true;
|
||||
SwitchInfo info = switchInfoFromSwitchPositionTaranis(abs(index));
|
||||
if (index < 0 && switchConfig[info.index] != SWITCH_3POS)
|
||||
|
||||
div_t qr = div(index-1, 3);
|
||||
|
||||
if (index < 0 && switchConfig[qr.quot] != Board::SWITCH_3POS)
|
||||
return false;
|
||||
else if (info.position == 1)
|
||||
return switchConfig[info.index] == SWITCH_3POS;
|
||||
else if (qr.rem == 1)
|
||||
return switchConfig[qr.quot] == Board::SWITCH_3POS;
|
||||
else
|
||||
return switchConfig[info.index] != SWITCH_NONE;
|
||||
return switchConfig[qr.quot] != Board::SWITCH_NOT_AVAILABLE;
|
||||
}
|
||||
|
||||
bool GeneralSettings::switchSourceAllowedTaranis(int index) const
|
||||
{
|
||||
return switchConfig[index] != SWITCH_NONE;
|
||||
return switchConfig[index] != Board::SWITCH_NOT_AVAILABLE;
|
||||
}
|
||||
|
||||
bool GeneralSettings::isPotAvailable(int index) const
|
||||
{
|
||||
if (index<0 || index>getCurrentFirmware()->getCapability(Pots)) return false;
|
||||
return potConfig[index] != POT_NONE;
|
||||
return potConfig[index] != Board::POT_NONE;
|
||||
}
|
||||
|
||||
bool GeneralSettings::isSliderAvailable(int index) const
|
||||
{
|
||||
if (index<0 || index>getCurrentFirmware()->getCapability(Sliders)) return false;
|
||||
return sliderConfig[index] != SLIDER_NONE;
|
||||
return sliderConfig[index] != Board::SLIDER_NONE;
|
||||
}
|
||||
|
||||
GeneralSettings::GeneralSettings()
|
||||
|
@ -1072,40 +1069,40 @@ GeneralSettings::GeneralSettings()
|
|||
}
|
||||
|
||||
Firmware * firmware = getCurrentFirmware();
|
||||
BoardEnum board = firmware->getBoard();
|
||||
Board::Type board = firmware->getBoard();
|
||||
|
||||
for (int i=0; i<firmware->getCapability(FactoryInstalledSwitches); i++) {
|
||||
switchConfig[i] = getSwitchInfo(board, i).config;
|
||||
}
|
||||
|
||||
if (IS_HORUS(board)) {
|
||||
potConfig[0] = POT_WITH_DETENT;
|
||||
potConfig[1] = POT_MULTIPOS_SWITCH;
|
||||
potConfig[2] = POT_WITH_DETENT;
|
||||
potConfig[0] = Board::POT_WITH_DETENT;
|
||||
potConfig[1] = Board::POT_MULTIPOS_SWITCH;
|
||||
potConfig[2] = Board::POT_WITH_DETENT;
|
||||
}
|
||||
else if (IS_TARANIS_X7(board)) {
|
||||
potConfig[0] = POT_WITHOUT_DETENT;
|
||||
potConfig[1] = POT_WITH_DETENT;
|
||||
potConfig[0] = Board::POT_WITHOUT_DETENT;
|
||||
potConfig[1] = Board::POT_WITH_DETENT;
|
||||
}
|
||||
else if (IS_TARANIS(board)) {
|
||||
potConfig[0] = POT_WITH_DETENT;
|
||||
potConfig[1] = POT_WITH_DETENT;
|
||||
potConfig[0] = Board::POT_WITH_DETENT;
|
||||
potConfig[1] = Board::POT_WITH_DETENT;
|
||||
}
|
||||
else {
|
||||
potConfig[0] = POT_WITHOUT_DETENT;
|
||||
potConfig[1] = POT_WITHOUT_DETENT;
|
||||
potConfig[2] = POT_WITHOUT_DETENT;
|
||||
potConfig[0] = Board::POT_WITHOUT_DETENT;
|
||||
potConfig[1] = Board::POT_WITHOUT_DETENT;
|
||||
potConfig[2] = Board::POT_WITHOUT_DETENT;
|
||||
}
|
||||
|
||||
if (IS_HORUS(board) || IS_TARANIS_X9E(board)) {
|
||||
sliderConfig[0] = SLIDER_WITH_DETENT;
|
||||
sliderConfig[1] = SLIDER_WITH_DETENT;
|
||||
sliderConfig[2] = SLIDER_WITH_DETENT;
|
||||
sliderConfig[3] = SLIDER_WITH_DETENT;
|
||||
sliderConfig[0] = Board::SLIDER_WITH_DETENT;
|
||||
sliderConfig[1] = Board::SLIDER_WITH_DETENT;
|
||||
sliderConfig[2] = Board::SLIDER_WITH_DETENT;
|
||||
sliderConfig[3] = Board::SLIDER_WITH_DETENT;
|
||||
}
|
||||
else if (IS_TARANIS(board) && !IS_TARANIS_X7(board)) {
|
||||
sliderConfig[0] = SLIDER_WITH_DETENT;
|
||||
sliderConfig[1] = SLIDER_WITH_DETENT;
|
||||
sliderConfig[0] = Board::SLIDER_WITH_DETENT;
|
||||
sliderConfig[1] = Board::SLIDER_WITH_DETENT;
|
||||
}
|
||||
|
||||
if (IS_ARM(board)) {
|
||||
|
@ -1506,7 +1503,7 @@ QString removeAccents(const QString & str)
|
|||
|
||||
void ModelData::setDefaultInputs(const GeneralSettings & settings)
|
||||
{
|
||||
BoardEnum board = getCurrentBoard();
|
||||
Board::Type board = getCurrentBoard();
|
||||
if (IS_ARM(board)) {
|
||||
for (int i=0; i<CPN_MAX_STICKS; i++) {
|
||||
ExpoData * expo = &expoData[i];
|
||||
|
@ -1521,7 +1518,7 @@ void ModelData::setDefaultInputs(const GeneralSettings & settings)
|
|||
|
||||
void ModelData::setDefaultMixes(const GeneralSettings & settings)
|
||||
{
|
||||
BoardEnum board = getCurrentBoard();
|
||||
Board::Type board = getCurrentBoard();
|
||||
if (IS_ARM(board)) {
|
||||
setDefaultInputs(settings);
|
||||
}
|
||||
|
@ -1716,32 +1713,32 @@ void ShowEepromWarnings(QWidget *parent, const QString &title, unsigned long err
|
|||
msgBox.exec();
|
||||
}
|
||||
|
||||
QString getBoardName(BoardEnum board)
|
||||
QString getBoardName(Board::Type board)
|
||||
{
|
||||
switch (board) {
|
||||
case BOARD_STOCK:
|
||||
case Board::BOARD_STOCK:
|
||||
return "9X";
|
||||
case BOARD_M128:
|
||||
case Board::BOARD_M128:
|
||||
return "9X128";
|
||||
case BOARD_GRUVIN9X:
|
||||
case Board::BOARD_GRUVIN9X:
|
||||
return "Gruvin9x";
|
||||
case BOARD_MEGA2560:
|
||||
case Board::BOARD_MEGA2560:
|
||||
return "MEGA2560";
|
||||
case BOARD_TARANIS_X7:
|
||||
case Board::BOARD_TARANIS_X7:
|
||||
return "Taranis X7";
|
||||
case BOARD_TARANIS_X9D:
|
||||
case Board::BOARD_TARANIS_X9D:
|
||||
return "Taranis X9D";
|
||||
case BOARD_TARANIS_X9DP:
|
||||
case Board::BOARD_TARANIS_X9DP:
|
||||
return "Taranis X9D+";
|
||||
case BOARD_TARANIS_X9E:
|
||||
case Board::BOARD_TARANIS_X9E:
|
||||
return "Taranis X9E";
|
||||
case BOARD_SKY9X:
|
||||
case Board::BOARD_SKY9X:
|
||||
return "Sky9x";
|
||||
case BOARD_9XRPRO:
|
||||
case Board::BOARD_9XRPRO:
|
||||
return "9XR-PRO";
|
||||
case BOARD_AR9X:
|
||||
case Board::BOARD_AR9X:
|
||||
return "AR9X";
|
||||
case BOARD_HORUS:
|
||||
case Board::BOARD_HORUS:
|
||||
return "Horus";
|
||||
default:
|
||||
return "Unknown";
|
||||
|
@ -1751,24 +1748,24 @@ QString getBoardName(BoardEnum board)
|
|||
const int Firmware::getFlashSize()
|
||||
{
|
||||
switch (board) {
|
||||
case BOARD_STOCK:
|
||||
case Board::BOARD_STOCK:
|
||||
return FSIZE_STOCK;
|
||||
case BOARD_M128:
|
||||
case Board::BOARD_M128:
|
||||
return FSIZE_M128;
|
||||
case BOARD_MEGA2560:
|
||||
case BOARD_GRUVIN9X:
|
||||
case Board::BOARD_MEGA2560:
|
||||
case Board::BOARD_GRUVIN9X:
|
||||
return FSIZE_GRUVIN9X;
|
||||
case BOARD_SKY9X:
|
||||
case Board::BOARD_SKY9X:
|
||||
return FSIZE_SKY9X;
|
||||
case BOARD_9XRPRO:
|
||||
case BOARD_AR9X:
|
||||
case Board::BOARD_9XRPRO:
|
||||
case Board::BOARD_AR9X:
|
||||
return FSIZE_9XRPRO;
|
||||
case BOARD_TARANIS_X9D:
|
||||
case BOARD_TARANIS_X9DP:
|
||||
case BOARD_TARANIS_X9E:
|
||||
case BOARD_FLAMENCO:
|
||||
case Board::BOARD_TARANIS_X9D:
|
||||
case Board::BOARD_TARANIS_X9DP:
|
||||
case Board::BOARD_TARANIS_X9E:
|
||||
case Board::BOARD_FLAMENCO:
|
||||
return FSIZE_TARANIS;
|
||||
case BOARD_HORUS:
|
||||
case Board::BOARD_HORUS:
|
||||
return FSIZE_HORUS;
|
||||
default:
|
||||
return 0;
|
||||
|
|
|
@ -154,14 +154,14 @@ class EEPROMInterface
|
|||
{
|
||||
public:
|
||||
|
||||
EEPROMInterface(BoardEnum board):
|
||||
EEPROMInterface(Board::Type board):
|
||||
board(board)
|
||||
{
|
||||
}
|
||||
|
||||
virtual ~EEPROMInterface() {}
|
||||
|
||||
inline BoardEnum getBoard() { return board; }
|
||||
inline Board::Type getBoard() { return board; }
|
||||
|
||||
virtual unsigned long load(RadioData &radioData, const uint8_t * eeprom, int size) = 0;
|
||||
|
||||
|
@ -175,7 +175,7 @@ class EEPROMInterface
|
|||
|
||||
protected:
|
||||
|
||||
BoardEnum board;
|
||||
Board::Type board;
|
||||
|
||||
private:
|
||||
|
||||
|
@ -254,7 +254,7 @@ struct Option {
|
|||
class Firmware {
|
||||
|
||||
public:
|
||||
Firmware(const QString & id, const QString & name, BoardEnum board):
|
||||
Firmware(const QString & id, const QString & name, Board::Type board):
|
||||
id(id),
|
||||
name(name),
|
||||
board(board),
|
||||
|
@ -264,7 +264,7 @@ class Firmware {
|
|||
{
|
||||
}
|
||||
|
||||
Firmware(Firmware * base, const QString & id, const QString & name, BoardEnum board):
|
||||
Firmware(Firmware * base, const QString & id, const QString & name, Board::Type board):
|
||||
id(id),
|
||||
name(name),
|
||||
board(board),
|
||||
|
@ -301,7 +301,7 @@ class Firmware {
|
|||
|
||||
virtual QString getFirmwareUrl() = 0;
|
||||
|
||||
BoardEnum getBoard() const
|
||||
Board::Type getBoard() const
|
||||
{
|
||||
return board;
|
||||
}
|
||||
|
@ -344,7 +344,7 @@ class Firmware {
|
|||
protected:
|
||||
QString id;
|
||||
QString name;
|
||||
BoardEnum board;
|
||||
Board::Type board;
|
||||
unsigned int variantBase;
|
||||
Firmware * base;
|
||||
EEPROMInterface * eepromInterface;
|
||||
|
@ -372,7 +372,7 @@ inline EEPROMInterface * getCurrentEEpromInterface()
|
|||
return getCurrentFirmware()->getEEpromInterface();
|
||||
}
|
||||
|
||||
inline BoardEnum getCurrentBoard()
|
||||
inline Board::Type getCurrentBoard()
|
||||
{
|
||||
return getCurrentFirmware()->getBoard();
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
#define FILE_MODEL(n) (1+n)
|
||||
|
||||
Er9xInterface::Er9xInterface():
|
||||
EEPROMInterface(BOARD_STOCK),
|
||||
EEPROMInterface(Board::BOARD_STOCK),
|
||||
efile(new RleFile())
|
||||
{
|
||||
}
|
||||
|
@ -116,13 +116,13 @@ unsigned long Er9xInterface::load(RadioData &radioData, const uint8_t *eeprom, i
|
|||
|
||||
std::bitset<NUM_ERRORS> errors;
|
||||
|
||||
if (size != getEEpromSize(BOARD_STOCK)) {
|
||||
if (size != getEEpromSize(Board::BOARD_STOCK)) {
|
||||
std::cout << "wrong size\n";
|
||||
errors.set(WRONG_SIZE);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
if (!efile->EeFsOpen((uint8_t *)eeprom, size, BOARD_STOCK)) {
|
||||
if (!efile->EeFsOpen((uint8_t *)eeprom, size, Board::BOARD_STOCK)) {
|
||||
std::cout << "wrong file system\n";
|
||||
errors.set(WRONG_FILE_SYSTEM);
|
||||
return errors.to_ulong();
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
#define FILE_TMP (1+16)
|
||||
|
||||
Ersky9xInterface::Ersky9xInterface():
|
||||
EEPROMInterface(BOARD_SKY9X),
|
||||
EEPROMInterface(Board::BOARD_SKY9X),
|
||||
efile(new RleFile())
|
||||
{
|
||||
}
|
||||
|
@ -164,7 +164,7 @@ unsigned long Ersky9xInterface::load(RadioData &radioData, const uint8_t *eeprom
|
|||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
if (!efile->EeFsOpen((uint8_t *)eeprom, size, BOARD_SKY9X)) {
|
||||
if (!efile->EeFsOpen((uint8_t *)eeprom, size, Board::BOARD_SKY9X)) {
|
||||
std::cout << "wrong file system\n";
|
||||
errors.set(WRONG_FILE_SYSTEM);
|
||||
return errors.to_ulong();
|
||||
|
|
|
@ -24,6 +24,8 @@
|
|||
#include <stdlib.h>
|
||||
#include <algorithm>
|
||||
|
||||
using namespace Board;
|
||||
|
||||
#define IS_DBLEEPROM(board, version) ((IS_2560(board) || board==BOARD_M128) && version >= 213)
|
||||
// Macro used for Gruvin9x board and M128 board between versions 213 and 214 (when there were stack overflows!)
|
||||
#define IS_DBLRAM(board, version) ((IS_2560(board) && version >= 213) || (board==BOARD_M128 && version >= 213 && version <= 214))
|
||||
|
@ -56,7 +58,7 @@
|
|||
#define IS_AFTER_RELEASE_21_MARCH_2013(board, version) (version >= 214 || (!IS_ARM(board) && version >= 213))
|
||||
#define IS_AFTER_RELEASE_23_MARCH_2013(board, version) (version >= 214 || (board==BOARD_STOCK && version >= 213))
|
||||
|
||||
inline int switchIndex(int i, BoardEnum board, unsigned int version)
|
||||
inline int switchIndex(int i, Board::Type board, unsigned int version)
|
||||
{
|
||||
bool afterrelease21March2013 = IS_AFTER_RELEASE_21_MARCH_2013(board, version);
|
||||
if (!IS_HORUS_OR_TARANIS(board) && afterrelease21March2013)
|
||||
|
@ -68,7 +70,7 @@ inline int switchIndex(int i, BoardEnum board, unsigned int version)
|
|||
class SwitchesConversionTable: public ConversionTable {
|
||||
|
||||
public:
|
||||
SwitchesConversionTable(BoardEnum board, unsigned int version, bool timer=false)
|
||||
SwitchesConversionTable(Board::Type board, unsigned int version, bool timer=false)
|
||||
{
|
||||
int val=0;
|
||||
int offset=0;
|
||||
|
@ -177,14 +179,14 @@ class SwitchesConversionTable: public ConversionTable {
|
|||
|
||||
class Cache {
|
||||
public:
|
||||
Cache(BoardEnum board, unsigned int version, unsigned long flags, SwitchesConversionTable * table):
|
||||
Cache(Board::Type board, unsigned int version, unsigned long flags, SwitchesConversionTable * table):
|
||||
board(board),
|
||||
version(version),
|
||||
flags(flags),
|
||||
table(table)
|
||||
{
|
||||
}
|
||||
BoardEnum board;
|
||||
Board::Type board;
|
||||
unsigned int version;
|
||||
unsigned long flags;
|
||||
SwitchesConversionTable * table;
|
||||
|
@ -194,7 +196,7 @@ class SwitchesConversionTable: public ConversionTable {
|
|||
|
||||
public:
|
||||
|
||||
static SwitchesConversionTable * getInstance(BoardEnum board, unsigned int version, unsigned long flags=0)
|
||||
static SwitchesConversionTable * getInstance(Board::Type board, unsigned int version, unsigned long flags=0)
|
||||
{
|
||||
for (std::list<Cache>::iterator it=internalCache.begin(); it!=internalCache.end(); it++) {
|
||||
Cache element = *it;
|
||||
|
@ -225,7 +227,7 @@ std::list<SwitchesConversionTable::Cache> SwitchesConversionTable::internalCache
|
|||
class SourcesConversionTable: public ConversionTable {
|
||||
|
||||
public:
|
||||
SourcesConversionTable(BoardEnum board, unsigned int version, unsigned int variant, unsigned long flags=0)
|
||||
SourcesConversionTable(Board::Type board, unsigned int version, unsigned int variant, unsigned long flags=0)
|
||||
{
|
||||
bool afterrelease21March2013 = IS_AFTER_RELEASE_21_MARCH_2013(board, version);
|
||||
|
||||
|
@ -363,7 +365,7 @@ class SourcesConversionTable: public ConversionTable {
|
|||
|
||||
class Cache {
|
||||
public:
|
||||
Cache(BoardEnum board, unsigned int version, unsigned int variant, unsigned long flags, SourcesConversionTable * table):
|
||||
Cache(Board::Type board, unsigned int version, unsigned int variant, unsigned long flags, SourcesConversionTable * table):
|
||||
board(board),
|
||||
version(version),
|
||||
variant(variant),
|
||||
|
@ -371,7 +373,7 @@ class SourcesConversionTable: public ConversionTable {
|
|||
table(table)
|
||||
{
|
||||
}
|
||||
BoardEnum board;
|
||||
Board::Type board;
|
||||
unsigned int version;
|
||||
unsigned int variant;
|
||||
unsigned long flags;
|
||||
|
@ -381,7 +383,7 @@ class SourcesConversionTable: public ConversionTable {
|
|||
|
||||
public:
|
||||
|
||||
static SourcesConversionTable * getInstance(BoardEnum board, unsigned int version, unsigned int variant, unsigned long flags=0)
|
||||
static SourcesConversionTable * getInstance(Board::Type board, unsigned int version, unsigned int variant, unsigned long flags=0)
|
||||
{
|
||||
for (std::list<Cache>::iterator it=internalCache.begin(); it!=internalCache.end(); it++) {
|
||||
Cache element = *it;
|
||||
|
@ -414,7 +416,7 @@ void OpenTxEepromCleanup(void)
|
|||
template <int N>
|
||||
class SwitchField: public ConversionField< SignedField<N> > {
|
||||
public:
|
||||
SwitchField(RawSwitch & sw, BoardEnum board, unsigned int version, unsigned long flags=0):
|
||||
SwitchField(RawSwitch & sw, Board::Type board, unsigned int version, unsigned long flags=0):
|
||||
ConversionField< SignedField<N> >(_switch, SwitchesConversionTable::getInstance(board, version, flags), QObject::tr("Switch").toLatin1(),
|
||||
QObject::tr("Switch ").toLatin1()+ sw.toString(board) + QObject::tr(" cannot be exported on this board!").toLatin1()),
|
||||
sw(sw),
|
||||
|
@ -443,13 +445,13 @@ class SwitchField: public ConversionField< SignedField<N> > {
|
|||
protected:
|
||||
RawSwitch & sw;
|
||||
int _switch;
|
||||
BoardEnum board;
|
||||
Board::Type board;
|
||||
};
|
||||
|
||||
class TelemetrySourcesConversionTable: public ConversionTable {
|
||||
|
||||
public:
|
||||
TelemetrySourcesConversionTable(BoardEnum board, unsigned int version)
|
||||
TelemetrySourcesConversionTable(Board::Type board, unsigned int version)
|
||||
{
|
||||
int val = 0;
|
||||
|
||||
|
@ -539,7 +541,7 @@ class TelemetrySourcesConversionTable: public ConversionTable {
|
|||
template <int N>
|
||||
class TelemetrySourceField: public ConversionField< UnsignedField<N> > {
|
||||
public:
|
||||
TelemetrySourceField(RawSource & source, BoardEnum board, unsigned int version):
|
||||
TelemetrySourceField(RawSource & source, Board::Type board, unsigned int version):
|
||||
ConversionField< UnsignedField<N> >(_source, &conversionTable, "Telemetry source"),
|
||||
conversionTable(board, version),
|
||||
source(source),
|
||||
|
@ -569,7 +571,7 @@ class TelemetrySourceField: public ConversionField< UnsignedField<N> > {
|
|||
protected:
|
||||
TelemetrySourcesConversionTable conversionTable;
|
||||
RawSource & source;
|
||||
BoardEnum board;
|
||||
Board::Type board;
|
||||
unsigned int version;
|
||||
unsigned int _source;
|
||||
};
|
||||
|
@ -577,7 +579,7 @@ class TelemetrySourceField: public ConversionField< UnsignedField<N> > {
|
|||
template <int N>
|
||||
class SourceField: public ConversionField< UnsignedField<N> > {
|
||||
public:
|
||||
SourceField(RawSource & source, BoardEnum board, unsigned int version, unsigned int variant, unsigned long flags=0):
|
||||
SourceField(RawSource & source, Board::Type board, unsigned int version, unsigned int variant, unsigned long flags=0):
|
||||
ConversionField< UnsignedField<N> >(_source, SourcesConversionTable::getInstance(board, version, variant, flags),
|
||||
"Source", QObject::tr("Source %1 cannot be exported on this board!").arg(source.toString())),
|
||||
source(source),
|
||||
|
@ -630,7 +632,7 @@ int smallGvarToC9x(int gvar)
|
|||
return gvar;
|
||||
}
|
||||
|
||||
void splitGvarParam(const int gvar, int & _gvar, unsigned int & _gvarParam, const BoardEnum board, const int version)
|
||||
void splitGvarParam(const int gvar, int & _gvar, unsigned int & _gvarParam, const Board::Type board, const int version)
|
||||
{
|
||||
if (version >= 214 || (!IS_ARM(board) && version >= 213)) {
|
||||
if (gvar < -10000) {
|
||||
|
@ -663,7 +665,7 @@ void splitGvarParam(const int gvar, int & _gvar, unsigned int & _gvarParam, cons
|
|||
}
|
||||
}
|
||||
|
||||
void concatGvarParam(int & gvar, const int _gvar, const unsigned int _gvarParam, const BoardEnum board, const int version)
|
||||
void concatGvarParam(int & gvar, const int _gvar, const unsigned int _gvarParam, const Board::Type board, const int version)
|
||||
{
|
||||
if (version >= 214 || (!IS_ARM(board) && version >= 213)) {
|
||||
gvar = _gvar;
|
||||
|
@ -731,7 +733,7 @@ void importGvarParam(int & gvar, const int _gvar, int version)
|
|||
|
||||
class CurveReferenceField: public TransformedField {
|
||||
public:
|
||||
CurveReferenceField(CurveReference & curve, BoardEnum board, unsigned int version):
|
||||
CurveReferenceField(CurveReference & curve, Board::Type board, unsigned int version):
|
||||
TransformedField(internalField),
|
||||
curve(curve),
|
||||
_curve_type(0),
|
||||
|
@ -777,7 +779,7 @@ static int importHeliInversionWeight(int source) {
|
|||
|
||||
class HeliField: public StructField {
|
||||
public:
|
||||
HeliField(SwashRingData & heli, BoardEnum board, unsigned int version, unsigned int variant)
|
||||
HeliField(SwashRingData & heli, Board::Type board, unsigned int version, unsigned int variant)
|
||||
{
|
||||
if ((IS_ARM(board) && version >= 218) || (IS_STM32(board) && version >= 217)) {
|
||||
Append(new UnsignedField<8>(heli.type));
|
||||
|
@ -803,7 +805,7 @@ class HeliField: public StructField {
|
|||
|
||||
class FlightModeField: public TransformedField {
|
||||
public:
|
||||
FlightModeField(FlightModeData & phase, int index, BoardEnum board, unsigned int version):
|
||||
FlightModeField(FlightModeData & phase, int index, Board::Type board, unsigned int version):
|
||||
TransformedField(internalField),
|
||||
internalField("FlightMode"),
|
||||
phase(phase),
|
||||
|
@ -945,7 +947,7 @@ class FlightModeField: public TransformedField {
|
|||
StructField internalField;
|
||||
FlightModeData & phase;
|
||||
int index;
|
||||
BoardEnum board;
|
||||
Board::Type board;
|
||||
unsigned int version;
|
||||
int rotencCount;
|
||||
int trimBase[CPN_MAX_STICKS+CPN_MAX_AUX_TRIMS];
|
||||
|
@ -955,7 +957,7 @@ class FlightModeField: public TransformedField {
|
|||
|
||||
class MixField: public TransformedField {
|
||||
public:
|
||||
MixField(MixData & mix, BoardEnum board, unsigned int version, ModelData * model):
|
||||
MixField(MixData & mix, Board::Type board, unsigned int version, ModelData * model):
|
||||
TransformedField(internalField),
|
||||
internalField("Mix"),
|
||||
mix(mix),
|
||||
|
@ -1233,7 +1235,7 @@ class MixField: public TransformedField {
|
|||
protected:
|
||||
StructField internalField;
|
||||
MixData & mix;
|
||||
BoardEnum board;
|
||||
Board::Type board;
|
||||
unsigned int version;
|
||||
ModelData * model;
|
||||
unsigned int _destCh;
|
||||
|
@ -1247,7 +1249,7 @@ class MixField: public TransformedField {
|
|||
|
||||
class InputField: public TransformedField {
|
||||
public:
|
||||
InputField(ExpoData & expo, BoardEnum board, unsigned int version):
|
||||
InputField(ExpoData & expo, Board::Type board, unsigned int version):
|
||||
TransformedField(internalField),
|
||||
internalField("Input"),
|
||||
expo(expo),
|
||||
|
@ -1414,7 +1416,7 @@ class InputField: public TransformedField {
|
|||
protected:
|
||||
StructField internalField;
|
||||
ExpoData & expo;
|
||||
BoardEnum board;
|
||||
Board::Type board;
|
||||
unsigned int version;
|
||||
bool _curveMode;
|
||||
int _weight;
|
||||
|
@ -1454,7 +1456,7 @@ class LimitField: public StructField {
|
|||
return value - shift;
|
||||
}
|
||||
|
||||
LimitField(LimitData & limit, BoardEnum board, unsigned int version):
|
||||
LimitField(LimitData & limit, Board::Type board, unsigned int version):
|
||||
StructField("Limit")
|
||||
{
|
||||
if (IS_ARM(board) && version >= 218) {
|
||||
|
@ -1509,7 +1511,7 @@ class LimitField: public StructField {
|
|||
|
||||
class CurvesField: public TransformedField {
|
||||
public:
|
||||
CurvesField(CurveData * curves, BoardEnum board, unsigned int version):
|
||||
CurvesField(CurveData * curves, Board::Type board, unsigned int version):
|
||||
TransformedField(internalField),
|
||||
internalField("Curves"),
|
||||
curves(curves),
|
||||
|
@ -1629,7 +1631,7 @@ class CurvesField: public TransformedField {
|
|||
protected:
|
||||
StructField internalField;
|
||||
CurveData * curves;
|
||||
BoardEnum board;
|
||||
Board::Type board;
|
||||
unsigned int version;
|
||||
int maxCurves;
|
||||
int maxPoints;
|
||||
|
@ -1640,7 +1642,7 @@ class CurvesField: public TransformedField {
|
|||
class LogicalSwitchesFunctionsTable: public ConversionTable {
|
||||
|
||||
public:
|
||||
LogicalSwitchesFunctionsTable(BoardEnum board, unsigned int version)
|
||||
LogicalSwitchesFunctionsTable(Board::Type board, unsigned int version)
|
||||
{
|
||||
int val=0;
|
||||
bool afterrelease21March2013 = IS_AFTER_RELEASE_21_MARCH_2013(board, version);
|
||||
|
@ -1678,7 +1680,7 @@ class LogicalSwitchesFunctionsTable: public ConversionTable {
|
|||
class AndSwitchesConversionTable: public ConversionTable {
|
||||
|
||||
public:
|
||||
AndSwitchesConversionTable(BoardEnum board, unsigned int version)
|
||||
AndSwitchesConversionTable(Board::Type board, unsigned int version)
|
||||
{
|
||||
int val=0;
|
||||
addConversion(RawSwitch(SWITCH_TYPE_NONE), val++);
|
||||
|
@ -1723,7 +1725,7 @@ class AndSwitchesConversionTable: public ConversionTable {
|
|||
}
|
||||
}
|
||||
|
||||
static ConversionTable * getInstance(BoardEnum board, unsigned int version)
|
||||
static ConversionTable * getInstance(Board::Type board, unsigned int version)
|
||||
{
|
||||
if (IS_ARM(board) && version >= 216)
|
||||
return new SwitchesConversionTable(board, version);
|
||||
|
@ -1756,7 +1758,7 @@ class AndSwitchesConversionTable: public ConversionTable {
|
|||
|
||||
class LogicalSwitchField: public TransformedField {
|
||||
public:
|
||||
LogicalSwitchField(LogicalSwitchData & csw, BoardEnum board, unsigned int version, unsigned int variant, ModelData * model=NULL):
|
||||
LogicalSwitchField(LogicalSwitchData & csw, Board::Type board, unsigned int version, unsigned int variant, ModelData * model=NULL):
|
||||
TransformedField(internalField),
|
||||
internalField("LogicalSwitch"),
|
||||
csw(csw),
|
||||
|
@ -1957,7 +1959,7 @@ class LogicalSwitchField: public TransformedField {
|
|||
protected:
|
||||
StructField internalField;
|
||||
LogicalSwitchData & csw;
|
||||
BoardEnum board;
|
||||
Board::Type board;
|
||||
unsigned int version;
|
||||
unsigned int variant;
|
||||
ModelData * model;
|
||||
|
@ -1973,7 +1975,7 @@ class LogicalSwitchField: public TransformedField {
|
|||
class CustomFunctionsConversionTable: public ConversionTable {
|
||||
|
||||
public:
|
||||
CustomFunctionsConversionTable(BoardEnum board, unsigned int version)
|
||||
CustomFunctionsConversionTable(Board::Type board, unsigned int version)
|
||||
{
|
||||
int val=0;
|
||||
|
||||
|
@ -2085,7 +2087,7 @@ class CustomFunctionsConversionTable: public ConversionTable {
|
|||
template <int N>
|
||||
class SwitchesWarningField: public TransformedField {
|
||||
public:
|
||||
SwitchesWarningField(uint64_t & sw, BoardEnum board, unsigned int version):
|
||||
SwitchesWarningField(uint64_t & sw, Board::Type board, unsigned int version):
|
||||
TransformedField(internalField),
|
||||
internalField(_sw, "SwitchesWarning"),
|
||||
sw(sw),
|
||||
|
@ -2118,13 +2120,13 @@ class SwitchesWarningField: public TransformedField {
|
|||
BaseUnsignedField<uint64_t, N> internalField;
|
||||
uint64_t & sw;
|
||||
uint64_t _sw;
|
||||
BoardEnum board;
|
||||
Board::Type board;
|
||||
unsigned int version;
|
||||
};
|
||||
|
||||
class ArmCustomFunctionField: public TransformedField {
|
||||
public:
|
||||
ArmCustomFunctionField(CustomFunctionData & fn, BoardEnum board, unsigned int version, unsigned int variant):
|
||||
ArmCustomFunctionField(CustomFunctionData & fn, Board::Type board, unsigned int version, unsigned int variant):
|
||||
TransformedField(internalField),
|
||||
internalField("CustomFunction"),
|
||||
fn(fn),
|
||||
|
@ -2352,7 +2354,7 @@ class ArmCustomFunctionField: public TransformedField {
|
|||
protected:
|
||||
StructField internalField;
|
||||
CustomFunctionData & fn;
|
||||
BoardEnum board;
|
||||
Board::Type board;
|
||||
unsigned int version;
|
||||
unsigned int variant;
|
||||
CustomFunctionsConversionTable functionsConversionTable;
|
||||
|
@ -2365,7 +2367,7 @@ class ArmCustomFunctionField: public TransformedField {
|
|||
|
||||
class AvrCustomFunctionField: public TransformedField {
|
||||
public:
|
||||
AvrCustomFunctionField(CustomFunctionData & fn, BoardEnum board, unsigned int version, unsigned int variant):
|
||||
AvrCustomFunctionField(CustomFunctionData & fn, Board::Type board, unsigned int version, unsigned int variant):
|
||||
TransformedField(internalField),
|
||||
internalField("CustomFunction"),
|
||||
fn(fn),
|
||||
|
@ -2541,7 +2543,7 @@ class AvrCustomFunctionField: public TransformedField {
|
|||
protected:
|
||||
StructField internalField;
|
||||
CustomFunctionData & fn;
|
||||
BoardEnum board;
|
||||
Board::Type board;
|
||||
unsigned int version;
|
||||
unsigned int variant;
|
||||
CustomFunctionsConversionTable functionsConversionTable;
|
||||
|
@ -2554,7 +2556,7 @@ class AvrCustomFunctionField: public TransformedField {
|
|||
|
||||
class FrskyScreenField: public DataField {
|
||||
public:
|
||||
FrskyScreenField(FrSkyScreenData & screen, BoardEnum board, unsigned int version, unsigned int variant):
|
||||
FrskyScreenField(FrSkyScreenData & screen, Board::Type board, unsigned int version, unsigned int variant):
|
||||
DataField("Frsky Screen"),
|
||||
screen(screen),
|
||||
board(board),
|
||||
|
@ -2670,7 +2672,7 @@ class FrskyScreenField: public DataField {
|
|||
|
||||
protected:
|
||||
FrSkyScreenData & screen;
|
||||
BoardEnum board;
|
||||
Board::Type board;
|
||||
unsigned int version;
|
||||
StructField none;
|
||||
StructField bars;
|
||||
|
@ -2697,7 +2699,7 @@ class RSSIConversionTable: public ConversionTable
|
|||
class TelemetryVarioSourceConversionTable: public ConversionTable
|
||||
{
|
||||
public:
|
||||
TelemetryVarioSourceConversionTable(BoardEnum board, unsigned int version)
|
||||
TelemetryVarioSourceConversionTable(Board::Type board, unsigned int version)
|
||||
{
|
||||
int val = 0;
|
||||
if (!IS_TARANIS(board)) {
|
||||
|
@ -2716,7 +2718,7 @@ class TelemetryVarioSourceConversionTable: public ConversionTable
|
|||
class TelemetryVoltsSourceConversionTable: public ConversionTable
|
||||
{
|
||||
public:
|
||||
TelemetryVoltsSourceConversionTable(BoardEnum board, unsigned int version)
|
||||
TelemetryVoltsSourceConversionTable(Board::Type board, unsigned int version)
|
||||
{
|
||||
int val = 0;
|
||||
addConversion(TELEMETRY_VOLTS_SOURCE_A1, val++);
|
||||
|
@ -2733,7 +2735,7 @@ class TelemetryVoltsSourceConversionTable: public ConversionTable
|
|||
class ScreenTypesConversionTable: public ConversionTable
|
||||
{
|
||||
public:
|
||||
ScreenTypesConversionTable(BoardEnum board, unsigned int version)
|
||||
ScreenTypesConversionTable(Board::Type board, unsigned int version)
|
||||
{
|
||||
int val = 0;
|
||||
if (IS_ARM(board)) {
|
||||
|
@ -2747,7 +2749,7 @@ class ScreenTypesConversionTable: public ConversionTable
|
|||
class TelemetryCurrentSourceConversionTable: public ConversionTable
|
||||
{
|
||||
public:
|
||||
TelemetryCurrentSourceConversionTable(BoardEnum board, unsigned int version)
|
||||
TelemetryCurrentSourceConversionTable(Board::Type board, unsigned int version)
|
||||
{
|
||||
int val = 0;
|
||||
addConversion(TELEMETRY_CURRENT_SOURCE_NONE, val++);
|
||||
|
@ -2763,7 +2765,7 @@ class TelemetryCurrentSourceConversionTable: public ConversionTable
|
|||
|
||||
class FrskyField: public StructField {
|
||||
public:
|
||||
FrskyField(FrSkyData & frsky, BoardEnum board, unsigned int version, unsigned int variant):
|
||||
FrskyField(FrSkyData & frsky, Board::Type board, unsigned int version, unsigned int variant):
|
||||
StructField("FrSky"),
|
||||
telemetryVarioSourceConversionTable(board, version),
|
||||
screenTypesConversionTable(board, version),
|
||||
|
@ -2893,7 +2895,7 @@ class FrskyField: public StructField {
|
|||
|
||||
class MavlinkField: public StructField {
|
||||
public:
|
||||
MavlinkField(MavlinkData & mavlink, BoardEnum board, unsigned int version):
|
||||
MavlinkField(MavlinkData & mavlink, Board::Type board, unsigned int version):
|
||||
StructField("MavLink")
|
||||
{
|
||||
Append(new UnsignedField<4>(mavlink.rc_rssi_scale, "Rc_rssi_scale"));
|
||||
|
@ -2924,7 +2926,7 @@ class CustomScreenField: public StructField {
|
|||
|
||||
class SensorField: public TransformedField {
|
||||
public:
|
||||
SensorField(SensorData & sensor, BoardEnum board, unsigned int version):
|
||||
SensorField(SensorData & sensor, Board::Type board, unsigned int version):
|
||||
TransformedField(internalField),
|
||||
internalField("Sensor"),
|
||||
sensor(sensor),
|
||||
|
@ -3022,7 +3024,7 @@ class SensorField: public TransformedField {
|
|||
int exportPpmDelay(int delay) { return (delay - 300) / 50; }
|
||||
int importPpmDelay(int delay) { return 300 + 50 * delay; }
|
||||
|
||||
OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigned int version, unsigned int variant):
|
||||
OpenTxModelData::OpenTxModelData(ModelData & modelData, Board::Type board, unsigned int version, unsigned int variant):
|
||||
TransformedField(internalField),
|
||||
internalField("ModelData"),
|
||||
modelData(modelData),
|
||||
|
@ -3500,7 +3502,7 @@ void OpenTxModelData::afterImport()
|
|||
}
|
||||
}
|
||||
|
||||
OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, BoardEnum board, unsigned int version, unsigned int variant):
|
||||
OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, Board::Type board, unsigned int version, unsigned int variant):
|
||||
TransformedField(internalField),
|
||||
internalField("General Settings"),
|
||||
generalData(generalData),
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
|
||||
class OpenTxGeneralData: public TransformedField {
|
||||
public:
|
||||
OpenTxGeneralData(GeneralSettings & generalData, BoardEnum board, unsigned int version, unsigned int variant=0);
|
||||
OpenTxGeneralData(GeneralSettings & generalData, Board::Type board, unsigned int version, unsigned int variant=0);
|
||||
|
||||
protected:
|
||||
virtual void beforeExport();
|
||||
|
@ -46,7 +46,7 @@ class OpenTxGeneralData: public TransformedField {
|
|||
|
||||
StructField internalField;
|
||||
GeneralSettings & generalData;
|
||||
BoardEnum board;
|
||||
Board::Type board;
|
||||
unsigned int version;
|
||||
int inputsCount;
|
||||
unsigned int chkSum;
|
||||
|
@ -56,7 +56,7 @@ class OpenTxGeneralData: public TransformedField {
|
|||
class ProtocolsConversionTable: public ConversionTable
|
||||
{
|
||||
public:
|
||||
ProtocolsConversionTable(BoardEnum board)
|
||||
ProtocolsConversionTable(Board::Type board)
|
||||
{
|
||||
int val = 0;
|
||||
if (IS_ARM(board)) {
|
||||
|
@ -105,7 +105,7 @@ class ChannelsConversionTable: public ConversionTable
|
|||
|
||||
class OpenTxModelData: public TransformedField {
|
||||
public:
|
||||
OpenTxModelData(ModelData & modelData, BoardEnum board, unsigned int version, unsigned int variant);
|
||||
OpenTxModelData(ModelData & modelData, Board::Type board, unsigned int version, unsigned int variant);
|
||||
|
||||
const char * getName() { return name; }
|
||||
|
||||
|
@ -115,7 +115,7 @@ class OpenTxModelData: public TransformedField {
|
|||
|
||||
StructField internalField;
|
||||
ModelData & modelData;
|
||||
BoardEnum board;
|
||||
Board::Type board;
|
||||
unsigned int version;
|
||||
unsigned int variant;
|
||||
|
||||
|
|
|
@ -27,6 +27,8 @@
|
|||
#include <QTime>
|
||||
#include <QUrl>
|
||||
|
||||
using namespace Board;
|
||||
|
||||
#define OPENTX_FIRMWARE_DOWNLOADS "http://downloads-22.open-tx.org/firmware"
|
||||
#define OPENTX_NIGHT_FIRMWARE_DOWNLOADS "http://downloads-22.open-tx.org/nightly/firmware"
|
||||
|
||||
|
@ -195,7 +197,7 @@ bool OpenTxEepromInterface::loadFromByteArray(T & dest, const QByteArray & data)
|
|||
|
||||
template<class T>
|
||||
bool
|
||||
OpenTxEepromInterface::saveRadioSettings(GeneralSettings &settings, BoardEnum board, uint8_t version, uint32_t variant)
|
||||
OpenTxEepromInterface::saveRadioSettings(GeneralSettings &settings, Board::Type board, uint8_t version, uint32_t variant)
|
||||
{
|
||||
T open9xSettings(settings, board, version, variant);
|
||||
// open9xSettings.Dump();
|
||||
|
@ -302,7 +304,7 @@ unsigned long OpenTxEepromInterface::load(RadioData &radioData, const uint8_t *
|
|||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
uint8_t OpenTxEepromInterface::getLastDataVersion(BoardEnum board)
|
||||
uint8_t OpenTxEepromInterface::getLastDataVersion(Board::Type board)
|
||||
{
|
||||
switch (board) {
|
||||
case BOARD_STOCK:
|
||||
|
@ -1055,7 +1057,7 @@ unsigned long OpenTxEepromInterface::loadBackup(RadioData &radioData, const uint
|
|||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
BoardEnum backupBoard = (BoardEnum) -1;
|
||||
Type backupBoard = (Type) -1;
|
||||
switch (eeprom[3]) {
|
||||
case 0x33:
|
||||
backupBoard = BOARD_TARANIS_X9D;
|
||||
|
@ -1532,7 +1534,7 @@ OpenTxEepromInterface * loadFromByteArray(T & dest, const QByteArray & data)
|
|||
template <class T, class M>
|
||||
bool saveToByteArray(const T & dest, QByteArray & data)
|
||||
{
|
||||
BoardEnum board = getCurrentBoard();
|
||||
Board::Type board = getCurrentBoard();
|
||||
foreach(OpenTxEepromInterface * eepromInterface, opentxEEpromInterfaces) {
|
||||
if (eepromInterface->getBoard() == board) {
|
||||
return eepromInterface->saveToByteArray<T, M>(dest, data);
|
||||
|
|
|
@ -72,9 +72,9 @@ class OpenTxEepromInterface : public EEPROMInterface
|
|||
bool saveModel(unsigned int index, ModelData & model, uint8_t version, uint32_t variant);
|
||||
|
||||
template <class T>
|
||||
bool saveRadioSettings(GeneralSettings & settings, BoardEnum board, uint8_t version, uint32_t variant);
|
||||
bool saveRadioSettings(GeneralSettings & settings, Board::Type board, uint8_t version, uint32_t variant);
|
||||
|
||||
uint8_t getLastDataVersion(BoardEnum board);
|
||||
uint8_t getLastDataVersion(Board::Type board);
|
||||
|
||||
uint32_t getFourCC();
|
||||
|
||||
|
@ -93,7 +93,7 @@ class OpenTxFirmware: public Firmware
|
|||
setEEpromInterface(parent->getEEpromInterface());
|
||||
}
|
||||
|
||||
OpenTxFirmware(const QString & id, const QString & name, const BoardEnum board):
|
||||
OpenTxFirmware(const QString & id, const QString & name, const Board::Type board):
|
||||
Firmware(id, name, board)
|
||||
{
|
||||
addLanguage("en");
|
||||
|
|
|
@ -21,14 +21,14 @@
|
|||
#include "hardware.h"
|
||||
#include "ui_hardware.h"
|
||||
|
||||
void HardwarePanel::setupSwitchConfig(int index, QLabel *label, AutoLineEdit *name, AutoComboBox *type, bool threePos = true)
|
||||
void HardwarePanel::setupSwitchType(int index, QLabel *label, AutoLineEdit *name, AutoComboBox *type, bool threePos = true)
|
||||
{
|
||||
if (IS_STM32(firmware->getBoard()) && index < firmware->getCapability(Switches)) {
|
||||
type->addItem(tr("None"), SWITCH_NONE);
|
||||
type->addItem(tr("2 Positions Toggle"), SWITCH_TOGGLE);
|
||||
type->addItem(tr("2 Positions"), SWITCH_2POS);
|
||||
type->addItem(tr("None"), Board::SWITCH_NOT_AVAILABLE);
|
||||
type->addItem(tr("2 Positions Toggle"), Board::SWITCH_TOGGLE);
|
||||
type->addItem(tr("2 Positions"), Board::SWITCH_2POS);
|
||||
if (threePos) {
|
||||
type->addItem(tr("3 Positions"), SWITCH_3POS);
|
||||
type->addItem(tr("3 Positions"), Board::SWITCH_3POS);
|
||||
}
|
||||
name->setField(generalSettings.switchName[index], 3, this);
|
||||
type->setField(generalSettings.switchConfig[index], this);
|
||||
|
@ -40,14 +40,14 @@ void HardwarePanel::setupSwitchConfig(int index, QLabel *label, AutoLineEdit *na
|
|||
}
|
||||
}
|
||||
|
||||
void HardwarePanel::setupPotConfig(int index, QLabel *label, AutoLineEdit *name, AutoComboBox *type)
|
||||
void HardwarePanel::setupPotType(int index, QLabel *label, AutoLineEdit *name, AutoComboBox *type)
|
||||
{
|
||||
if (IS_STM32(firmware->getBoard()) && index < firmware->getCapability(Pots)) {
|
||||
label->setText(RawSource(SOURCE_TYPE_STICK, CPN_MAX_STICKS+index).toString());
|
||||
type->addItem(tr("None"), POT_NONE);
|
||||
type->addItem(tr("Pot with detent"), POT_WITH_DETENT);
|
||||
type->addItem(tr("Multipos switch"), POT_MULTIPOS_SWITCH);
|
||||
type->addItem(tr("Pot without detent"), POT_WITHOUT_DETENT);
|
||||
type->addItem(tr("None"), Board::POT_NONE);
|
||||
type->addItem(tr("Pot with detent"), Board::POT_WITH_DETENT);
|
||||
type->addItem(tr("Multipos switch"), Board::POT_MULTIPOS_SWITCH);
|
||||
type->addItem(tr("Pot without detent"), Board::POT_WITHOUT_DETENT);
|
||||
name->setField(generalSettings.potName[index], 3, this);
|
||||
type->setField(generalSettings.potConfig[index], this);
|
||||
}
|
||||
|
@ -58,12 +58,12 @@ void HardwarePanel::setupPotConfig(int index, QLabel *label, AutoLineEdit *name,
|
|||
}
|
||||
}
|
||||
|
||||
void HardwarePanel::setupSliderConfig(int index, QLabel *label, AutoLineEdit *name, AutoComboBox *type)
|
||||
void HardwarePanel::setupSliderType(int index, QLabel *label, AutoLineEdit *name, AutoComboBox *type)
|
||||
{
|
||||
if (IS_STM32(firmware->getBoard()) && index < firmware->getCapability(Sliders)) {
|
||||
label->setText(RawSource(SOURCE_TYPE_STICK, CPN_MAX_STICKS+firmware->getCapability(Pots)+index).toString());
|
||||
type->addItem(tr("None"), SLIDER_NONE);
|
||||
type->addItem(tr("Slider with detent"), SLIDER_WITH_DETENT);
|
||||
type->addItem(tr("None"), Board::SLIDER_NONE);
|
||||
type->addItem(tr("Slider with detent"), Board::SLIDER_WITH_DETENT);
|
||||
name->setField(generalSettings.sliderName[index], 3, this);
|
||||
type->setField(generalSettings.sliderConfig[index], this);
|
||||
}
|
||||
|
@ -80,7 +80,7 @@ HardwarePanel::HardwarePanel(QWidget * parent, GeneralSettings & generalSettings
|
|||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
BoardEnum board = firmware->getBoard();
|
||||
Board::Type board = firmware->getBoard();
|
||||
|
||||
if (IS_STM32(board)) {
|
||||
ui->rudName->setField(generalSettings.stickName[0], 3, this);
|
||||
|
@ -99,34 +99,34 @@ HardwarePanel::HardwarePanel(QWidget * parent, GeneralSettings & generalSettings
|
|||
ui->ailName->hide();
|
||||
}
|
||||
|
||||
setupPotConfig(0, ui->pot1Label, ui->pot1Name, ui->pot1Type);
|
||||
setupPotConfig(1, ui->pot2Label, ui->pot2Name, ui->pot2Type);
|
||||
setupPotConfig(2, ui->pot3Label, ui->pot3Name, ui->pot3Type);
|
||||
setupPotConfig(3, ui->pot4Label, ui->pot4Name, ui->pot4Type);
|
||||
setupPotType(0, ui->pot1Label, ui->pot1Name, ui->pot1Type);
|
||||
setupPotType(1, ui->pot2Label, ui->pot2Name, ui->pot2Type);
|
||||
setupPotType(2, ui->pot3Label, ui->pot3Name, ui->pot3Type);
|
||||
setupPotType(3, ui->pot4Label, ui->pot4Name, ui->pot4Type);
|
||||
|
||||
setupSliderConfig(0, ui->lsLabel, ui->lsName, ui->lsType);
|
||||
setupSliderConfig(1, ui->rsLabel, ui->rsName, ui->rsType);
|
||||
setupSliderConfig(2, ui->ls2Label, ui->ls2Name, ui->ls2Type);
|
||||
setupSliderConfig(3, ui->rs2Label, ui->rs2Name, ui->rs2Type);
|
||||
setupSliderType(0, ui->lsLabel, ui->lsName, ui->lsType);
|
||||
setupSliderType(1, ui->rsLabel, ui->rsName, ui->rsType);
|
||||
setupSliderType(2, ui->ls2Label, ui->ls2Name, ui->ls2Type);
|
||||
setupSliderType(3, ui->rs2Label, ui->rs2Name, ui->rs2Type);
|
||||
|
||||
setupSwitchConfig(0, ui->saLabel, ui->saName, ui->saType);
|
||||
setupSwitchConfig(1, ui->sbLabel, ui->sbName, ui->sbType);
|
||||
setupSwitchConfig(2, ui->scLabel, ui->scName, ui->scType);
|
||||
setupSwitchConfig(3, ui->sdLabel, ui->sdName, ui->sdType);
|
||||
setupSwitchConfig(4, ui->seLabel, ui->seName, ui->seType);
|
||||
setupSwitchConfig(5, ui->sfLabel, ui->sfName, ui->sfType, false); //switch does not support 3POS
|
||||
setupSwitchConfig(6, ui->sgLabel, ui->sgName, ui->sgType);
|
||||
setupSwitchConfig(7, ui->shLabel, ui->shName, ui->shType, false); //switch does not support 3POS
|
||||
setupSwitchConfig(8, ui->siLabel, ui->siName, ui->siType);
|
||||
setupSwitchConfig(9, ui->sjLabel, ui->sjName, ui->sjType);
|
||||
setupSwitchConfig(10, ui->skLabel, ui->skName, ui->skType);
|
||||
setupSwitchConfig(11, ui->slLabel, ui->slName, ui->slType);
|
||||
setupSwitchConfig(12, ui->smLabel, ui->smName, ui->smType);
|
||||
setupSwitchConfig(13, ui->snLabel, ui->snName, ui->snType);
|
||||
setupSwitchConfig(14, ui->soLabel, ui->soName, ui->soType);
|
||||
setupSwitchConfig(15, ui->spLabel, ui->spName, ui->spType);
|
||||
setupSwitchConfig(16, ui->sqLabel, ui->sqName, ui->sqType);
|
||||
setupSwitchConfig(17, ui->srLabel, ui->srName, ui->srType);
|
||||
setupSwitchType(0, ui->saLabel, ui->saName, ui->saType);
|
||||
setupSwitchType(1, ui->sbLabel, ui->sbName, ui->sbType);
|
||||
setupSwitchType(2, ui->scLabel, ui->scName, ui->scType);
|
||||
setupSwitchType(3, ui->sdLabel, ui->sdName, ui->sdType);
|
||||
setupSwitchType(4, ui->seLabel, ui->seName, ui->seType);
|
||||
setupSwitchType(5, ui->sfLabel, ui->sfName, ui->sfType, false); //switch does not support 3POS
|
||||
setupSwitchType(6, ui->sgLabel, ui->sgName, ui->sgType);
|
||||
setupSwitchType(7, ui->shLabel, ui->shName, ui->shType, false); //switch does not support 3POS
|
||||
setupSwitchType(8, ui->siLabel, ui->siName, ui->siType);
|
||||
setupSwitchType(9, ui->sjLabel, ui->sjName, ui->sjType);
|
||||
setupSwitchType(10, ui->skLabel, ui->skName, ui->skType);
|
||||
setupSwitchType(11, ui->slLabel, ui->slName, ui->slType);
|
||||
setupSwitchType(12, ui->smLabel, ui->smName, ui->smType);
|
||||
setupSwitchType(13, ui->snLabel, ui->snName, ui->snType);
|
||||
setupSwitchType(14, ui->soLabel, ui->soName, ui->soType);
|
||||
setupSwitchType(15, ui->spLabel, ui->spName, ui->spType);
|
||||
setupSwitchType(16, ui->sqLabel, ui->sqName, ui->sqType);
|
||||
setupSwitchType(17, ui->srLabel, ui->srName, ui->srType);
|
||||
|
||||
if (IS_HORUS_OR_TARANIS(board) && !IS_TARANIS_X7(board)) {
|
||||
ui->serialPortMode->setCurrentIndex(generalSettings.hw_uartMode);
|
||||
|
|
|
@ -36,7 +36,7 @@ class HardwarePanel : public GeneralPanel
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
HardwarePanel(QWidget *parent, GeneralSettings & generalSettings, Firmware * firmware);
|
||||
HardwarePanel(QWidget * parent, GeneralSettings & generalSettings, Firmware * firmware);
|
||||
virtual ~HardwarePanel();
|
||||
|
||||
private slots:
|
||||
|
@ -54,9 +54,9 @@ class HardwarePanel : public GeneralPanel
|
|||
void on_serialPortMode_currentIndexChanged(int index);
|
||||
|
||||
protected:
|
||||
void setupPotConfig(int index, QLabel *label, AutoLineEdit *name, AutoComboBox *type);
|
||||
void setupSliderConfig(int index, QLabel *label, AutoLineEdit *name, AutoComboBox *type);
|
||||
void setupSwitchConfig(int index, QLabel *label, AutoLineEdit *name, AutoComboBox *type, bool threePos);
|
||||
void setupPotType(int index, QLabel * label, AutoLineEdit * name, AutoComboBox * type);
|
||||
void setupSliderType(int index, QLabel * label, AutoLineEdit * name, AutoComboBox * type);
|
||||
void setupSwitchType(int index, QLabel * label, AutoLineEdit * name, AutoComboBox * type, bool threePos);
|
||||
|
||||
private:
|
||||
Ui::Hardware *ui;
|
||||
|
|
|
@ -376,7 +376,7 @@ void populateGvarUseCB(QComboBox *b, unsigned int phase)
|
|||
|
||||
void populateSwitchCB(QComboBox *b, const RawSwitch & value, const GeneralSettings & generalSettings, SwitchContext context)
|
||||
{
|
||||
BoardEnum board = getCurrentBoard();
|
||||
Board::Type board = getCurrentBoard();
|
||||
RawSwitch item;
|
||||
|
||||
b->clear();
|
||||
|
@ -413,7 +413,7 @@ void populateSwitchCB(QComboBox *b, const RawSwitch & value, const GeneralSettin
|
|||
}
|
||||
|
||||
for (int i=getCurrentFirmware()->getCapability(MultiposPots)-1; i>=0; i--) {
|
||||
if (generalSettings.potConfig[i] == POT_MULTIPOS_SWITCH) {
|
||||
if (generalSettings.potConfig[i] == Board::POT_MULTIPOS_SWITCH) {
|
||||
for (int j=-getCurrentFirmware()->getCapability(MultiposPotsPositions); j<0; j++) {
|
||||
item = RawSwitch(SWITCH_TYPE_MULTIPOS_POT, -i*getCurrentFirmware()->getCapability(MultiposPotsPositions)+j);
|
||||
b->addItem(item.toString(), item.toValue());
|
||||
|
@ -454,7 +454,7 @@ void populateSwitchCB(QComboBox *b, const RawSwitch & value, const GeneralSettin
|
|||
}
|
||||
|
||||
for (int i=0; i<getCurrentFirmware()->getCapability(MultiposPots); i++) {
|
||||
if (generalSettings.potConfig[i] == POT_MULTIPOS_SWITCH) {
|
||||
if (generalSettings.potConfig[i] == Board::POT_MULTIPOS_SWITCH) {
|
||||
for (int j=1; j<=getCurrentFirmware()->getCapability(MultiposPotsPositions); j++) {
|
||||
item = RawSwitch(SWITCH_TYPE_MULTIPOS_POT, i*getCurrentFirmware()->getCapability(MultiposPotsPositions)+j);
|
||||
b->addItem(item.toString(), item.toValue());
|
||||
|
@ -546,7 +546,7 @@ void populateGVCB(QComboBox & b, int value, const ModelData & model)
|
|||
|
||||
void populateSourceCB(QComboBox *b, const RawSource & source, const GeneralSettings generalSettings, const ModelData * model, unsigned int flags)
|
||||
{
|
||||
BoardEnum board = getCurrentBoard();
|
||||
Board::Type board = getCurrentBoard();
|
||||
RawSource item;
|
||||
|
||||
b->clear();
|
||||
|
@ -824,7 +824,7 @@ void startSimulation(QWidget * parent, RadioData & radioData, int modelIdx)
|
|||
#endif
|
||||
Firmware * firmware = getCurrentFirmware();
|
||||
RadioData * simuData = new RadioData(radioData);
|
||||
BoardEnum board = getCurrentBoard();
|
||||
Board::Type board = getCurrentBoard();
|
||||
QByteArray eeprom = QByteArray();
|
||||
QString sdPath = g.profile[g.id()].sdPath();
|
||||
QString settingsPath = "";
|
||||
|
|
|
@ -727,7 +727,7 @@ void MainWindow::loadBackup()
|
|||
|
||||
void MainWindow::readEeprom()
|
||||
{
|
||||
BoardEnum board = getCurrentBoard();
|
||||
Board::Type board = getCurrentBoard();
|
||||
QString tempFile;
|
||||
if (IS_HORUS(board))
|
||||
tempFile = generateProcessUniqueTempFileName("temp.otx");
|
||||
|
|
|
@ -166,7 +166,7 @@ void MdiChild::onFirmwareChanged()
|
|||
convertStorage(previous->getBoard(), firmware->getBoard());
|
||||
}
|
||||
|
||||
void MdiChild::convertStorage(BoardEnum from, BoardEnum to)
|
||||
void MdiChild::convertStorage(Board::Type from, Board::Type to)
|
||||
{
|
||||
QMessageBox::warning(this, "Companion", tr("Models and settings will be automatically converted.\nIf that is not what you intended, please close the file\nand choose the correct radio type/profile before reopening it."), QMessageBox::Ok);
|
||||
radioData.convert(from, to);
|
||||
|
@ -179,7 +179,7 @@ void MdiChild::convertStorage(BoardEnum from, BoardEnum to)
|
|||
|
||||
void MdiChild::initModelsList()
|
||||
{
|
||||
BoardEnum board = firmware->getBoard();
|
||||
Board::Type board = firmware->getBoard();
|
||||
|
||||
delete modelsListModel;
|
||||
modelsListModel = new TreeModel(&radioData, this);
|
||||
|
@ -625,8 +625,8 @@ void MdiChild::setCurrentFile(const QString & fileName)
|
|||
|
||||
void MdiChild::writeEeprom() // write to Tx
|
||||
{
|
||||
BoardEnum board = getCurrentBoard();
|
||||
if (board == BOARD_HORUS) {
|
||||
Board::Type board = getCurrentBoard();
|
||||
if (board == Board::BOARD_HORUS) {
|
||||
QString radioPath = findMassstoragePath("RADIO", true);
|
||||
qDebug() << "Searching for SD card, found" << radioPath;
|
||||
if (radioPath.isEmpty()) {
|
||||
|
|
|
@ -59,7 +59,7 @@ class MdiChild : public QWidget
|
|||
void copyAvailable(bool val);
|
||||
|
||||
protected:
|
||||
void convertStorage(BoardEnum from, BoardEnum to);
|
||||
void convertStorage(Board::Type from, Board::Type to);
|
||||
void forceNewFilename(const QString & suffix, const QString & ext);
|
||||
void closeEvent(QCloseEvent * event);
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ LimitsGroup::LimitsGroup(Firmware * firmware, TableLayout * tableLayout, int row
|
|||
value(value),
|
||||
displayStep(0.1)
|
||||
{
|
||||
BoardEnum board = firmware->getBoard();
|
||||
Board::Type board = firmware->getBoard();
|
||||
bool allowGVars = IS_HORUS_OR_TARANIS(board);
|
||||
int internalStep = 1;
|
||||
|
||||
|
|
|
@ -87,7 +87,7 @@ FlightModePanel::FlightModePanel(QWidget * parent, ModelData & model, int phaseI
|
|||
trimsValue << ui->trim1Value << ui->trim2Value << ui->trim3Value << ui->trim4Value;
|
||||
trimsSlider << ui->trim1Slider << ui->trim2Slider << ui->trim3Slider << ui->trim4Slider;
|
||||
|
||||
BoardEnum board = firmware->getBoard();
|
||||
Board::Type board = firmware->getBoard();
|
||||
|
||||
for (int i=0; i<4; i++) {
|
||||
trimsLabel[i]->setText(labels[CONVERT_MODE(i+1)-1]);
|
||||
|
@ -305,7 +305,7 @@ void FlightModePanel::trimUpdate(unsigned int trim)
|
|||
trimsSlider[trim]->setEnabled(false);
|
||||
}
|
||||
else {
|
||||
BoardEnum board = firmware->getBoard();
|
||||
Board::Type board = firmware->getBoard();
|
||||
if (IS_HORUS_OR_TARANIS(board))
|
||||
trimsUse[trim]->setCurrentIndex(1 + 2*phase.trimRef[chn] + phase.trimMode[chn] - (phase.trimRef[chn] > phaseIdx ? 1 : 0));
|
||||
else
|
||||
|
@ -410,7 +410,7 @@ void FlightModePanel::phaseTrimUse_currentIndexChanged(int index)
|
|||
phase.trim[chn] = 0;
|
||||
}
|
||||
else {
|
||||
BoardEnum board = firmware->getBoard();
|
||||
Board::Type board = firmware->getBoard();
|
||||
if (IS_HORUS_OR_TARANIS(board)) {
|
||||
phase.trimMode[chn] = data % 2;
|
||||
phase.trimRef[chn] = data / 2;
|
||||
|
|
|
@ -523,8 +523,8 @@ void LogicalSwitchesPanel::csw_customContextMenuRequested(QPoint pos)
|
|||
|
||||
QPoint globalPos = label->mapToGlobal(pos);
|
||||
|
||||
const QClipboard *clipboard = QApplication::clipboard();
|
||||
const QMimeData *mimeData = clipboard->mimeData();
|
||||
const QClipboard * clipboard = QApplication::clipboard();
|
||||
const QMimeData * mimeData = clipboard->mimeData();
|
||||
bool hasData = mimeData->hasFormat("application/x-companion-csw");
|
||||
|
||||
QMenu contextMenu;
|
||||
|
|
|
@ -31,7 +31,7 @@ TimerPanel::TimerPanel(QWidget *parent, ModelData & model, TimerData & timer, Ge
|
|||
timer(timer),
|
||||
ui(new Ui::Timer)
|
||||
{
|
||||
BoardEnum board = firmware->getBoard();
|
||||
Board::Type board = firmware->getBoard();
|
||||
|
||||
ui->setupUi(this);
|
||||
|
||||
|
@ -569,7 +569,7 @@ SetupPanel::SetupPanel(QWidget * parent, ModelData & model, GeneralSettings & ge
|
|||
ModelPanel(parent, model, generalSettings, firmware),
|
||||
ui(new Ui::Setup)
|
||||
{
|
||||
BoardEnum board = firmware->getBoard();
|
||||
Board::Type board = firmware->getBoard();
|
||||
|
||||
lock = true;
|
||||
|
||||
|
@ -709,11 +709,11 @@ SetupPanel::SetupPanel(QWidget * parent, ModelData & model, GeneralSettings & ge
|
|||
|
||||
// Startup switches warnings
|
||||
for (int i=0; i<firmware->getCapability(Switches); i++) {
|
||||
SwitchInfo switchInfo = getSwitchInfo(board, i);
|
||||
Board::SwitchInfo switchInfo = getSwitchInfo(board, i);
|
||||
if (IS_HORUS_OR_TARANIS(board)) {
|
||||
switchInfo.config = SwitchConfig(generalSettings.switchConfig[i]);
|
||||
switchInfo.config = Board::SwitchType(generalSettings.switchConfig[i]);
|
||||
}
|
||||
if (switchInfo.config == SWITCH_NOT_AVAILABLE || switchInfo.config == SWITCH_TOGGLE) {
|
||||
if (switchInfo.config == Board::SWITCH_NOT_AVAILABLE || switchInfo.config == Board::SWITCH_TOGGLE) {
|
||||
continue;
|
||||
}
|
||||
QLabel * label = new QLabel(this);
|
||||
|
@ -730,7 +730,7 @@ SetupPanel::SetupPanel(QWidget * parent, ModelData & model, GeneralSettings & ge
|
|||
slider->setPageStep(1);
|
||||
slider->setTickInterval(1);
|
||||
label->setText(switchInfo.name);
|
||||
slider->setMaximum(switchInfo.config == SWITCH_3POS ? 2 : 1);
|
||||
slider->setMaximum(switchInfo.config == Board::SWITCH_3POS ? 2 : 1);
|
||||
cb->setProperty("index", i);
|
||||
ui->switchesStartupLayout->addWidget(label, 0, i+1);
|
||||
ui->switchesStartupLayout->setAlignment(label, Qt::AlignCenter);
|
||||
|
@ -855,7 +855,7 @@ void SetupPanel::on_name_editingFinished()
|
|||
void SetupPanel::on_image_currentIndexChanged(int index)
|
||||
{
|
||||
if (!lock) {
|
||||
BoardEnum board = firmware->getBoard();
|
||||
Board::Type board = firmware->getBoard();
|
||||
strncpy(model->bitmap, ui->image->currentText().toLatin1(), 10);
|
||||
QString path = g.profile[g.id()].sdPath();
|
||||
path.append("/IMAGES/");
|
||||
|
@ -960,7 +960,7 @@ void SetupPanel::updateStartupSwitches()
|
|||
bool enabled = !(model->switchWarningEnable & (1 << index));
|
||||
if (IS_HORUS_OR_TARANIS(firmware->getBoard())) {
|
||||
value = (switchStates >> 2*index) & 0x03;
|
||||
if (generalSettings.switchConfig[index] != SWITCH_3POS && value == 2) {
|
||||
if (generalSettings.switchConfig[index] != Board::SWITCH_3POS && value == 2) {
|
||||
value = 1;
|
||||
}
|
||||
}
|
||||
|
@ -999,7 +999,7 @@ void SetupPanel::startupSwitchEdited(int value)
|
|||
|
||||
model->switchWarningStates &= ~mask;
|
||||
|
||||
if (IS_HORUS_OR_TARANIS(firmware->getBoard()) && generalSettings.switchConfig[index] != SWITCH_3POS) {
|
||||
if (IS_HORUS_OR_TARANIS(firmware->getBoard()) && generalSettings.switchConfig[index] != Board::SWITCH_3POS) {
|
||||
if (value == 1) {
|
||||
value = 2;
|
||||
}
|
||||
|
|
|
@ -242,8 +242,8 @@ void Templates::applyNumericTemplate(uint64_t tpl)
|
|||
}
|
||||
}
|
||||
if (flaps>0) {
|
||||
md=setDest(11); md->srcRaw=RawSource(SOURCE_TYPE_MAX); md->weight=-100; md->swtch=RawSwitch(SWITCH_TYPE_SWITCH,-SWITCH_AIL);strncpy(md->name, tr("FLAPS").toAscii().data(),6); md->speedUp=4; md->speedDown=4;
|
||||
md=setDest(11); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 5); md->weight=100; md->swtch=RawSwitch(SWITCH_TYPE_SWITCH,SWITCH_AIL);strncpy(md->name, tr("FLAPS").toAscii().data(),6); md->speedUp=4; md->speedDown=4;
|
||||
md=setDest(11); md->srcRaw=RawSource(SOURCE_TYPE_MAX); md->weight=-100; md->swtch=RawSwitch(Board::SWITCH_TYPE_SWITCH,-Board::SWITCH_AIL);strncpy(md->name, tr("FLAPS").toAscii().data(),6); md->speedUp=4; md->speedDown=4;
|
||||
md=setDest(11); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 5); md->weight=100; md->swtch=RawSwitch(Board::SWITCH_TYPE_SWITCH,Board::SWITCH_AIL);strncpy(md->name, tr("FLAPS").toAscii().data(),6); md->speedUp=4; md->speedDown=4;
|
||||
}
|
||||
sign=-1;
|
||||
for (uint8_t i=0; i< flaps; i++) {
|
||||
|
@ -304,18 +304,18 @@ void Templates::applyNumericTemplate(uint64_t tpl)
|
|||
md=setDest(3); md->srcRaw=RawSource(SOURCE_TYPE_CH, 10); md->weight= 100; md->swtch=RawSwitch();strncpy(md->name, tr("PITCH").toAscii().data(),6);
|
||||
}
|
||||
md=setDest(4); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 0); md->weight=100; md->swtch=RawSwitch();strncpy(md->name, tr("RUD").toAscii().data(),6);
|
||||
md=setDest(5); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 2); md->weight= 100; md->swtch=RawSwitch(SWITCH_TYPE_SWITCH,SWITCH_ID0); md->curve=CV(1); md->carryTrim=TRIM_OFF;
|
||||
md=setDest(5); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 2); md->weight= 100; md->swtch=RawSwitch(SWITCH_TYPE_SWITCH,SWITCH_ID1); md->curve=CV(2); md->carryTrim=TRIM_OFF;
|
||||
md=setDest(5); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 2); md->weight= 100; md->swtch=RawSwitch(SWITCH_TYPE_SWITCH,SWITCH_ID2); md->curve=CV(3); md->carryTrim=TRIM_OFF;
|
||||
md=setDest(5); md->srcRaw=RawSource(SOURCE_TYPE_MAX); md->weight=-100; md->swtch=RawSwitch(SWITCH_TYPE_SWITCH,thrsw); md->mltpx=MLTPX_REP;
|
||||
md=setDest(5); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 2); md->weight= 100; md->swtch=RawSwitch(Board::SWITCH_TYPE_SWITCH,Board::SWITCH_ID0); md->curve=CV(1); md->carryTrim=TRIM_OFF;
|
||||
md=setDest(5); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 2); md->weight= 100; md->swtch=RawSwitch(Board::SWITCH_TYPE_SWITCH,Board::SWITCH_ID1); md->curve=CV(2); md->carryTrim=TRIM_OFF;
|
||||
md=setDest(5); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 2); md->weight= 100; md->swtch=RawSwitch(Board::SWITCH_TYPE_SWITCH,Board::SWITCH_ID2); md->curve=CV(3); md->carryTrim=TRIM_OFF;
|
||||
md=setDest(5); md->srcRaw=RawSource(SOURCE_TYPE_MAX); md->weight=-100; md->swtch=RawSwitch(Board::SWITCH_TYPE_SWITCH,thrsw); md->mltpx=MLTPX_REP;
|
||||
switch (gyro) {
|
||||
case 1:
|
||||
md=setDest(6); md->srcRaw=RawSource(SOURCE_TYPE_MAX); md->weight=30; md->swtch=RawSwitch(SWITCH_TYPE_SWITCH,-SWITCH_GEA);strncpy(md->name, tr("GYRO").toAscii().data(),6);
|
||||
md=setDest(6); md->srcRaw=RawSource(SOURCE_TYPE_MAX); md->weight=-30; md->swtch=RawSwitch(SWITCH_TYPE_SWITCH,SWITCH_GEA);strncpy(md->name, tr("GYRO").toAscii().data(),6);
|
||||
md=setDest(6); md->srcRaw=RawSource(SOURCE_TYPE_MAX); md->weight=30; md->swtch=RawSwitch(Board::SWITCH_TYPE_SWITCH,-Board::SWITCH_GEA);strncpy(md->name, tr("GYRO").toAscii().data(),6);
|
||||
md=setDest(6); md->srcRaw=RawSource(SOURCE_TYPE_MAX); md->weight=-30; md->swtch=RawSwitch(Board::SWITCH_TYPE_SWITCH,Board::SWITCH_GEA);strncpy(md->name, tr("GYRO").toAscii().data(),6);
|
||||
break;
|
||||
case 2:
|
||||
md=setDest(6); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 5); md->weight= 50; md->swtch=RawSwitch(SWITCH_TYPE_SWITCH,-SWITCH_GEA); md->sOffset=100;strncpy(md->name, tr("GYRO").toAscii().data(),6);
|
||||
md=setDest(6); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 5); md->weight=-50; md->swtch=RawSwitch(SWITCH_TYPE_SWITCH,SWITCH_GEA); md->sOffset=100;strncpy(md->name, tr("GYRO").toAscii().data(),6);
|
||||
md=setDest(6); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 5); md->weight= 50; md->swtch=RawSwitch(Board::SWITCH_TYPE_SWITCH,-Board::SWITCH_GEA); md->sOffset=100;strncpy(md->name, tr("GYRO").toAscii().data(),6);
|
||||
md=setDest(6); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 5); md->weight=-50; md->swtch=RawSwitch(Board::SWITCH_TYPE_SWITCH,Board::SWITCH_GEA); md->sOffset=100;strncpy(md->name, tr("GYRO").toAscii().data(),6);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
|
@ -329,25 +329,25 @@ void Templates::applyNumericTemplate(uint64_t tpl)
|
|||
md=setDest(6); md->srcRaw=RawSource(SOURCE_TYPE_CH, 10); md->weight= 100; md->swtch=RawSwitch();strncpy(md->name, tr("PITCH").toAscii().data(),6);
|
||||
}
|
||||
md=setDest(4); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 0); md->weight=100; md->swtch=RawSwitch();strncpy(md->name, tr("RUD").toAscii().data(),6);
|
||||
md=setDest(3); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 2); md->weight= 100; md->swtch=RawSwitch(SWITCH_TYPE_SWITCH,SWITCH_ID0); md->curve=CV(1); md->carryTrim=TRIM_OFF;
|
||||
md=setDest(3); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 2); md->weight= 100; md->swtch=RawSwitch(SWITCH_TYPE_SWITCH,SWITCH_ID1); md->curve=CV(2); md->carryTrim=TRIM_OFF;
|
||||
md=setDest(3); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 2); md->weight= 100; md->swtch=RawSwitch(SWITCH_TYPE_SWITCH,SWITCH_ID2); md->curve=CV(3); md->carryTrim=TRIM_OFF;
|
||||
md=setDest(3); md->srcRaw=RawSource(SOURCE_TYPE_MAX); md->weight=-100; md->swtch=RawSwitch(SWITCH_TYPE_SWITCH,thrsw); md->mltpx=MLTPX_REP;
|
||||
md=setDest(3); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 2); md->weight= 100; md->swtch=RawSwitch(Board::SWITCH_TYPE_SWITCH,Board::SWITCH_ID0); md->curve=CV(1); md->carryTrim=TRIM_OFF;
|
||||
md=setDest(3); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 2); md->weight= 100; md->swtch=RawSwitch(Board::SWITCH_TYPE_SWITCH,Board::SWITCH_ID1); md->curve=CV(2); md->carryTrim=TRIM_OFF;
|
||||
md=setDest(3); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 2); md->weight= 100; md->swtch=RawSwitch(Board::SWITCH_TYPE_SWITCH,Board::SWITCH_ID2); md->curve=CV(3); md->carryTrim=TRIM_OFF;
|
||||
md=setDest(3); md->srcRaw=RawSource(SOURCE_TYPE_MAX); md->weight=-100; md->swtch=RawSwitch(Board::SWITCH_TYPE_SWITCH,thrsw); md->mltpx=MLTPX_REP;
|
||||
switch (gyro) {
|
||||
case 1:
|
||||
md=setDest(5); md->srcRaw=RawSource(SOURCE_TYPE_MAX); md->weight=30; md->swtch=RawSwitch(SWITCH_TYPE_SWITCH,-SWITCH_GEA);strncpy(md->name, tr("GYRO").toAscii().data(),6);
|
||||
md=setDest(5); md->srcRaw=RawSource(SOURCE_TYPE_MAX); md->weight=-30; md->swtch=RawSwitch(SWITCH_TYPE_SWITCH,SWITCH_GEA);strncpy(md->name, tr("GYRO").toAscii().data(),6);
|
||||
md=setDest(5); md->srcRaw=RawSource(SOURCE_TYPE_MAX); md->weight=30; md->swtch=RawSwitch(Board::SWITCH_TYPE_SWITCH,-Board::SWITCH_GEA);strncpy(md->name, tr("GYRO").toAscii().data(),6);
|
||||
md=setDest(5); md->srcRaw=RawSource(SOURCE_TYPE_MAX); md->weight=-30; md->swtch=RawSwitch(Board::SWITCH_TYPE_SWITCH,Board::SWITCH_GEA);strncpy(md->name, tr("GYRO").toAscii().data(),6);
|
||||
break;
|
||||
case 2:
|
||||
md=setDest(5); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 5); md->weight= 50; md->swtch=RawSwitch(SWITCH_TYPE_SWITCH,-SWITCH_GEA); md->sOffset=100;strncpy(md->name, tr("GYRO").toAscii().data(),6);
|
||||
md=setDest(5); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 5); md->weight=-50; md->swtch=RawSwitch(SWITCH_TYPE_SWITCH,SWITCH_GEA); md->sOffset=100;strncpy(md->name, tr("GYRO").toAscii().data(),6);
|
||||
md=setDest(5); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 5); md->weight= 50; md->swtch=RawSwitch(Board::SWITCH_TYPE_SWITCH,-Board::SWITCH_GEA); md->sOffset=100;strncpy(md->name, tr("GYRO").toAscii().data(),6);
|
||||
md=setDest(5); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 5); md->weight=-50; md->swtch=RawSwitch(Board::SWITCH_TYPE_SWITCH,Board::SWITCH_GEA); md->sOffset=100;strncpy(md->name, tr("GYRO").toAscii().data(),6);
|
||||
break;
|
||||
}
|
||||
}
|
||||
// collective
|
||||
md=setDest(11); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 2); md->weight=100; md->swtch=RawSwitch(SWITCH_TYPE_SWITCH,SWITCH_ID0); md->curve=CV(4); md->carryTrim=TRIM_OFF;
|
||||
md=setDest(11); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 2); md->weight=100; md->swtch=RawSwitch(SWITCH_TYPE_SWITCH,SWITCH_ID1); md->curve=CV(5); md->carryTrim=TRIM_OFF;
|
||||
md=setDest(11); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 2); md->weight=100; md->swtch=RawSwitch(SWITCH_TYPE_SWITCH,SWITCH_ID2); md->curve=CV(6); md->carryTrim=TRIM_OFF;
|
||||
md=setDest(11); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 2); md->weight=100; md->swtch=RawSwitch(Board::SWITCH_TYPE_SWITCH,Board::SWITCH_ID0); md->curve=CV(4); md->carryTrim=TRIM_OFF;
|
||||
md=setDest(11); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 2); md->weight=100; md->swtch=RawSwitch(Board::SWITCH_TYPE_SWITCH,Board::SWITCH_ID1); md->curve=CV(5); md->carryTrim=TRIM_OFF;
|
||||
md=setDest(11); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 2); md->weight=100; md->swtch=RawSwitch(Board::SWITCH_TYPE_SWITCH,Board::SWITCH_ID2); md->curve=CV(6); md->carryTrim=TRIM_OFF;
|
||||
break;
|
||||
case 2:
|
||||
ailerons=ailerontype;
|
||||
|
@ -433,8 +433,8 @@ void Templates::applyNumericTemplate(uint64_t tpl)
|
|||
}
|
||||
}
|
||||
if (flaps>0) {
|
||||
md=setDest(11); md->srcRaw=RawSource(SOURCE_TYPE_MAX); md->weight=-100; md->swtch=RawSwitch(SWITCH_TYPE_SWITCH,-SWITCH_AIL);strncpy(md->name, tr("FLAPS").toAscii().data(),6);md->speedUp=4; md->speedDown=4;
|
||||
md=setDest(11); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 5); md->weight=100; md->swtch=RawSwitch(SWITCH_TYPE_SWITCH,SWITCH_AIL);strncpy(md->name, tr("FLAPS").toAscii().data(),6);md->speedUp=4; md->speedDown=4;
|
||||
md=setDest(11); md->srcRaw=RawSource(SOURCE_TYPE_MAX); md->weight=-100; md->swtch=RawSwitch(Board::SWITCH_TYPE_SWITCH,-Board::SWITCH_AIL);strncpy(md->name, tr("FLAPS").toAscii().data(),6);md->speedUp=4; md->speedDown=4;
|
||||
md=setDest(11); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 5); md->weight=100; md->swtch=RawSwitch(Board::SWITCH_TYPE_SWITCH,Board::SWITCH_AIL);strncpy(md->name, tr("FLAPS").toAscii().data(),6);md->speedUp=4; md->speedDown=4;
|
||||
}
|
||||
sign=-1;
|
||||
for (uint8_t i=0; i< flaps; i++) {
|
||||
|
@ -458,8 +458,8 @@ void Templates::applyNumericTemplate(uint64_t tpl)
|
|||
}
|
||||
}
|
||||
if (spoilers>0) {
|
||||
md=setDest(12); md->srcRaw=RawSource(SOURCE_TYPE_MAX); md->weight=-100; md->swtch=RawSwitch(SWITCH_TYPE_SWITCH,-SWITCH_GEA);strncpy(md->name, tr("SPOIL").toAscii().data(),6); md->speedUp=4;;md->speedDown=4;
|
||||
md=setDest(12); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 5); md->weight=100; md->swtch=RawSwitch(SWITCH_TYPE_SWITCH,SWITCH_GEA);strncpy(md->name, tr("SPOIL").toAscii().data(),6);md->speedUp=4;md->speedDown=4;
|
||||
md=setDest(12); md->srcRaw=RawSource(SOURCE_TYPE_MAX); md->weight=-100; md->swtch=RawSwitch(Board::SWITCH_TYPE_SWITCH,-Board::SWITCH_GEA);strncpy(md->name, tr("SPOIL").toAscii().data(),6); md->speedUp=4;;md->speedDown=4;
|
||||
md=setDest(12); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 5); md->weight=100; md->swtch=RawSwitch(Board::SWITCH_TYPE_SWITCH,Board::SWITCH_GEA);strncpy(md->name, tr("SPOIL").toAscii().data(),6);md->speedUp=4;md->speedDown=4;
|
||||
}
|
||||
sign=-1;
|
||||
for (uint8_t i=0; i< spoilers; i++) {
|
||||
|
@ -528,8 +528,8 @@ void Templates::applyNumericTemplate(uint64_t tpl)
|
|||
}
|
||||
}
|
||||
if (flaps>0) {
|
||||
md=setDest(11); md->srcRaw=RawSource(SOURCE_TYPE_MAX); md->weight=-100; md->swtch=RawSwitch(SWITCH_TYPE_SWITCH,-SWITCH_AIL);strncpy(md->name, tr("FLAPS").toAscii().data(),6); md->sOffset=0; md->speedUp=4;
|
||||
md=setDest(11); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 5); md->weight=100; md->swtch=RawSwitch(SWITCH_TYPE_SWITCH,SWITCH_AIL);strncpy(md->name, tr("FLAPS").toAscii().data(),6); md->sOffset=0; md->speedUp=4;
|
||||
md=setDest(11); md->srcRaw=RawSource(SOURCE_TYPE_MAX); md->weight=-100; md->swtch=RawSwitch(Board::SWITCH_TYPE_SWITCH,-Board::SWITCH_AIL);strncpy(md->name, tr("FLAPS").toAscii().data(),6); md->sOffset=0; md->speedUp=4;
|
||||
md=setDest(11); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 5); md->weight=100; md->swtch=RawSwitch(Board::SWITCH_TYPE_SWITCH,Board::SWITCH_AIL);strncpy(md->name, tr("FLAPS").toAscii().data(),6); md->sOffset=0; md->speedUp=4;
|
||||
}
|
||||
sign=-1;
|
||||
for (uint8_t i=0; i< flaps; i++) {
|
||||
|
@ -597,15 +597,15 @@ void Templates::applyTemplate(uint8_t idx)
|
|||
|
||||
//T-Cut
|
||||
if(idx==j++) {
|
||||
md=setDest(ICC(STK_THR)); md->srcRaw=RawSource(SOURCE_TYPE_MAX); md->weight=-100; md->swtch=RawSwitch(SWITCH_TYPE_SWITCH,thrsw); md->mltpx=MLTPX_REP;
|
||||
md=setDest(ICC(STK_THR)); md->srcRaw=RawSource(SOURCE_TYPE_MAX); md->weight=-100; md->swtch=RawSwitch(Board::SWITCH_TYPE_SWITCH,thrsw); md->mltpx=MLTPX_REP;
|
||||
}
|
||||
|
||||
//sticky t-cut
|
||||
if(idx==j++) {
|
||||
md=setDest(ICC(STK_THR)); md->srcRaw=RawSource(SOURCE_TYPE_MAX); md->weight=-100; md->swtch=RawSwitch(SWITCH_TYPE_VIRTUAL, 12); md->mltpx=MLTPX_REP;
|
||||
md=setDest(ICC(STK_THR)); md->srcRaw=RawSource(SOURCE_TYPE_MAX); md->weight=-100; md->swtch=RawSwitch(Board::SWITCH_TYPE_VIRTUAL, 12); md->mltpx=MLTPX_REP;
|
||||
md=setDest(14); md->srcRaw=RawSource(SOURCE_TYPE_CH, 13); md->weight= 100; md->swtch=RawSwitch();
|
||||
md=setDest(14); md->srcRaw=RawSource(SOURCE_TYPE_MAX); md->weight=-100; md->swtch=RawSwitch(SWITCH_TYPE_VIRTUAL, 11); md->mltpx=MLTPX_REP;
|
||||
md=setDest(14); md->srcRaw=RawSource(SOURCE_TYPE_MAX); md->weight= 100; md->swtch=RawSwitch(SWITCH_TYPE_SWITCH,thrsw); md->mltpx=MLTPX_REP;
|
||||
md=setDest(14); md->srcRaw=RawSource(SOURCE_TYPE_MAX); md->weight=-100; md->swtch=RawSwitch(Board::SWITCH_TYPE_VIRTUAL, 11); md->mltpx=MLTPX_REP;
|
||||
md=setDest(14); md->srcRaw=RawSource(SOURCE_TYPE_MAX); md->weight= 100; md->swtch=RawSwitch(Board::SWITCH_TYPE_SWITCH,thrsw); md->mltpx=MLTPX_REP;
|
||||
setSwitch(0xB, LS_FN_VNEG, RawSource(SOURCE_TYPE_STICK, 2).toValue(), -99);
|
||||
setSwitch(0xC, LS_FN_VPOS, RawSource(SOURCE_TYPE_CH, 13).toValue(), 0);
|
||||
updateSwitchesTab();
|
||||
|
@ -648,19 +648,19 @@ void Templates::applyTemplate(uint8_t idx)
|
|||
md=setDest(4); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 0); md->weight=100; md->swtch=RawSwitch();
|
||||
|
||||
// throttle
|
||||
md=setDest(5); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 2); md->weight= 100; md->swtch=RawSwitch(SWITCH_TYPE_SWITCH,SWITCH_ID0); md->curve=CV(1); md->carryTrim=TRIM_OFF;
|
||||
md=setDest(5); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 2); md->weight= 100; md->swtch=RawSwitch(SWITCH_TYPE_SWITCH,SWITCH_ID1); md->curve=CV(2); md->carryTrim=TRIM_OFF;
|
||||
md=setDest(5); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 2); md->weight= 100; md->swtch=RawSwitch(SWITCH_TYPE_SWITCH,SWITCH_ID2); md->curve=CV(3); md->carryTrim=TRIM_OFF;
|
||||
md=setDest(5); md->srcRaw=RawSource(SOURCE_TYPE_MAX); md->weight=-100; md->swtch=RawSwitch(SWITCH_TYPE_SWITCH,thrsw); md->mltpx=MLTPX_REP;
|
||||
md=setDest(5); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 2); md->weight= 100; md->swtch=RawSwitch(Board::SWITCH_TYPE_SWITCH,Board::SWITCH_ID0); md->curve=CV(1); md->carryTrim=TRIM_OFF;
|
||||
md=setDest(5); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 2); md->weight= 100; md->swtch=RawSwitch(Board::SWITCH_TYPE_SWITCH,Board::SWITCH_ID1); md->curve=CV(2); md->carryTrim=TRIM_OFF;
|
||||
md=setDest(5); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 2); md->weight= 100; md->swtch=RawSwitch(Board::SWITCH_TYPE_SWITCH,Board::SWITCH_ID2); md->curve=CV(3); md->carryTrim=TRIM_OFF;
|
||||
md=setDest(5); md->srcRaw=RawSource(SOURCE_TYPE_MAX); md->weight=-100; md->swtch=RawSwitch(Board::SWITCH_TYPE_SWITCH,thrsw); md->mltpx=MLTPX_REP;
|
||||
|
||||
// gyro gain
|
||||
md=setDest(6); md->srcRaw=RawSource(SOURCE_TYPE_MAX); md->weight=30; md->swtch=RawSwitch(SWITCH_TYPE_SWITCH,-SWITCH_GEA);
|
||||
md=setDest(6); md->srcRaw=RawSource(SOURCE_TYPE_MAX); md->weight=-30; md->swtch=RawSwitch(SWITCH_TYPE_SWITCH,SWITCH_GEA);
|
||||
md=setDest(6); md->srcRaw=RawSource(SOURCE_TYPE_MAX); md->weight=30; md->swtch=RawSwitch(Board::SWITCH_TYPE_SWITCH,-Board::SWITCH_GEA);
|
||||
md=setDest(6); md->srcRaw=RawSource(SOURCE_TYPE_MAX); md->weight=-30; md->swtch=RawSwitch(Board::SWITCH_TYPE_SWITCH,Board::SWITCH_GEA);
|
||||
|
||||
// collective
|
||||
md=setDest(11); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 2); md->weight=100; md->swtch=RawSwitch(SWITCH_TYPE_SWITCH,SWITCH_ID0); md->curve=CV(4); md->carryTrim=TRIM_OFF;
|
||||
md=setDest(11); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 2); md->weight=100; md->swtch=RawSwitch(SWITCH_TYPE_SWITCH,SWITCH_ID1); md->curve=CV(5); md->carryTrim=TRIM_OFF;
|
||||
md=setDest(11); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 2); md->weight=100; md->swtch=RawSwitch(SWITCH_TYPE_SWITCH,SWITCH_ID2); md->curve=CV(6); md->carryTrim=TRIM_OFF;
|
||||
md=setDest(11); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 2); md->weight=100; md->swtch=RawSwitch(Board::SWITCH_TYPE_SWITCH,Board::SWITCH_ID0); md->curve=CV(4); md->carryTrim=TRIM_OFF;
|
||||
md=setDest(11); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 2); md->weight=100; md->swtch=RawSwitch(Board::SWITCH_TYPE_SWITCH,Board::SWITCH_ID1); md->curve=CV(5); md->carryTrim=TRIM_OFF;
|
||||
md=setDest(11); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 2); md->weight=100; md->swtch=RawSwitch(Board::SWITCH_TYPE_SWITCH,Board::SWITCH_ID2); md->curve=CV(6); md->carryTrim=TRIM_OFF;
|
||||
|
||||
model.swashRingData.type = HELI_SWASH_TYPE_120;
|
||||
model.swashRingData.collectiveSource = RawSource(SOURCE_TYPE_CH, 10);
|
||||
|
@ -694,19 +694,19 @@ void Templates::applyTemplate(uint8_t idx)
|
|||
md=setDest(4); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 0); md->weight=100; md->swtch=RawSwitch();
|
||||
|
||||
// throttle
|
||||
md=setDest(5); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 2); md->weight= 100; md->swtch=RawSwitch(SWITCH_TYPE_SWITCH,SWITCH_ID0); md->curve=CV(1); md->carryTrim=TRIM_OFF;
|
||||
md=setDest(5); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 2); md->weight= 100; md->swtch=RawSwitch(SWITCH_TYPE_SWITCH,SWITCH_ID1); md->curve=CV(2); md->carryTrim=TRIM_OFF;
|
||||
md=setDest(5); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 2); md->weight= 100; md->swtch=RawSwitch(SWITCH_TYPE_SWITCH,SWITCH_ID2); md->curve=CV(3); md->carryTrim=TRIM_OFF;
|
||||
md=setDest(5); md->srcRaw=RawSource(SOURCE_TYPE_MAX); md->weight=-100; md->swtch=RawSwitch(SWITCH_TYPE_SWITCH,thrsw); md->mltpx=MLTPX_REP;
|
||||
md=setDest(5); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 2); md->weight= 100; md->swtch=RawSwitch(Board::SWITCH_TYPE_SWITCH,Board::SWITCH_ID0); md->curve=CV(1); md->carryTrim=TRIM_OFF;
|
||||
md=setDest(5); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 2); md->weight= 100; md->swtch=RawSwitch(Board::SWITCH_TYPE_SWITCH,Board::SWITCH_ID1); md->curve=CV(2); md->carryTrim=TRIM_OFF;
|
||||
md=setDest(5); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 2); md->weight= 100; md->swtch=RawSwitch(Board::SWITCH_TYPE_SWITCH,Board::SWITCH_ID2); md->curve=CV(3); md->carryTrim=TRIM_OFF;
|
||||
md=setDest(5); md->srcRaw=RawSource(SOURCE_TYPE_MAX); md->weight=-100; md->swtch=RawSwitch(Board::SWITCH_TYPE_SWITCH,thrsw); md->mltpx=MLTPX_REP;
|
||||
|
||||
// gyro gain
|
||||
md=setDest(6); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 5); md->weight= 50; md->swtch=RawSwitch(SWITCH_TYPE_SWITCH,-SWITCH_GEA); md->sOffset=100;
|
||||
md=setDest(6); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 5); md->weight=-50; md->swtch=RawSwitch(SWITCH_TYPE_SWITCH,SWITCH_GEA); md->sOffset=100;
|
||||
md=setDest(6); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 5); md->weight= 50; md->swtch=RawSwitch(Board::SWITCH_TYPE_SWITCH,-Board::SWITCH_GEA); md->sOffset=100;
|
||||
md=setDest(6); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 5); md->weight=-50; md->swtch=RawSwitch(Board::SWITCH_TYPE_SWITCH,Board::SWITCH_GEA); md->sOffset=100;
|
||||
|
||||
// collective
|
||||
md=setDest(11); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 2); md->weight=100; md->swtch=RawSwitch(SWITCH_TYPE_SWITCH,SWITCH_ID0); md->curve=CV(4); md->carryTrim=TRIM_OFF;
|
||||
md=setDest(11); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 2); md->weight=100; md->swtch=RawSwitch(SWITCH_TYPE_SWITCH,SWITCH_ID1); md->curve=CV(5); md->carryTrim=TRIM_OFF;
|
||||
md=setDest(11); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 2); md->weight=100; md->swtch=RawSwitch(SWITCH_TYPE_SWITCH,SWITCH_ID2); md->curve=CV(6); md->carryTrim=TRIM_OFF;
|
||||
md=setDest(11); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 2); md->weight=100; md->swtch=RawSwitch(Board::SWITCH_TYPE_SWITCH,Board::SWITCH_ID0); md->curve=CV(4); md->carryTrim=TRIM_OFF;
|
||||
md=setDest(11); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 2); md->weight=100; md->swtch=RawSwitch(Board::SWITCH_TYPE_SWITCH,Board::SWITCH_ID1); md->curve=CV(5); md->carryTrim=TRIM_OFF;
|
||||
md=setDest(11); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 2); md->weight=100; md->swtch=RawSwitch(Board::SWITCH_TYPE_SWITCH,Board::SWITCH_ID2); md->curve=CV(6); md->carryTrim=TRIM_OFF;
|
||||
|
||||
model.swashRingData.type = HELI_SWASH_TYPE_120;
|
||||
model.swashRingData.collectiveSource = RawSource(SOURCE_TYPE_CH, 10);
|
||||
|
@ -741,8 +741,8 @@ void Templates::applyTemplate(uint8_t idx)
|
|||
}
|
||||
}
|
||||
}
|
||||
md=setDest(6); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 5); md->weight= 50; md->swtch=RawSwitch(SWITCH_TYPE_SWITCH,-SWITCH_GEA); md->sOffset=100;
|
||||
md=setDest(6); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 5); md->weight=-50; md->swtch=RawSwitch(SWITCH_TYPE_SWITCH,SWITCH_GEA); md->sOffset=100;
|
||||
md=setDest(6); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 5); md->weight= 50; md->swtch=RawSwitch(Board::SWITCH_TYPE_SWITCH,-Board::SWITCH_GEA); md->sOffset=100;
|
||||
md=setDest(6); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 5); md->weight=-50; md->swtch=RawSwitch(Board::SWITCH_TYPE_SWITCH,Board::SWITCH_GEA); md->sOffset=100;
|
||||
}
|
||||
|
||||
//Heli Setup futaba style
|
||||
|
@ -760,19 +760,19 @@ void Templates::applyTemplate(uint8_t idx)
|
|||
md=setDest(4); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 0); md->weight=100; md->swtch=RawSwitch();
|
||||
|
||||
// throttle
|
||||
md=setDest(3); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 2); md->weight= 100; md->swtch=RawSwitch(SWITCH_TYPE_SWITCH,SWITCH_ID0); md->curve=CV(1); md->carryTrim=TRIM_OFF;
|
||||
md=setDest(3); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 2); md->weight= 100; md->swtch=RawSwitch(SWITCH_TYPE_SWITCH,SWITCH_ID1); md->curve=CV(2); md->carryTrim=TRIM_OFF;
|
||||
md=setDest(3); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 2); md->weight= 100; md->swtch=RawSwitch(SWITCH_TYPE_SWITCH,SWITCH_ID2); md->curve=CV(3); md->carryTrim=TRIM_OFF;
|
||||
md=setDest(3); md->srcRaw=RawSource(SOURCE_TYPE_MAX); md->weight=-100; md->swtch=RawSwitch(SWITCH_TYPE_SWITCH,thrsw); md->mltpx=MLTPX_REP;
|
||||
md=setDest(3); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 2); md->weight= 100; md->swtch=RawSwitch(Board::SWITCH_TYPE_SWITCH,Board::SWITCH_ID0); md->curve=CV(1); md->carryTrim=TRIM_OFF;
|
||||
md=setDest(3); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 2); md->weight= 100; md->swtch=RawSwitch(Board::SWITCH_TYPE_SWITCH,Board::SWITCH_ID1); md->curve=CV(2); md->carryTrim=TRIM_OFF;
|
||||
md=setDest(3); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 2); md->weight= 100; md->swtch=RawSwitch(Board::SWITCH_TYPE_SWITCH,Board::SWITCH_ID2); md->curve=CV(3); md->carryTrim=TRIM_OFF;
|
||||
md=setDest(3); md->srcRaw=RawSource(SOURCE_TYPE_MAX); md->weight=-100; md->swtch=RawSwitch(Board::SWITCH_TYPE_SWITCH,thrsw); md->mltpx=MLTPX_REP;
|
||||
|
||||
// gyro gain
|
||||
md=setDest(5); md->srcRaw=RawSource(SOURCE_TYPE_MAX); md->weight=30; md->swtch=RawSwitch(SWITCH_TYPE_SWITCH,-SWITCH_GEA);
|
||||
md=setDest(5); md->srcRaw=RawSource(SOURCE_TYPE_MAX); md->weight=-30; md->swtch=RawSwitch(SWITCH_TYPE_SWITCH,SWITCH_GEA);
|
||||
md=setDest(5); md->srcRaw=RawSource(SOURCE_TYPE_MAX); md->weight=30; md->swtch=RawSwitch(Board::SWITCH_TYPE_SWITCH,-Board::SWITCH_GEA);
|
||||
md=setDest(5); md->srcRaw=RawSource(SOURCE_TYPE_MAX); md->weight=-30; md->swtch=RawSwitch(Board::SWITCH_TYPE_SWITCH,Board::SWITCH_GEA);
|
||||
|
||||
// collective
|
||||
md=setDest(11); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 2); md->weight=100; md->swtch=RawSwitch(SWITCH_TYPE_SWITCH,SWITCH_ID0); md->curve=CV(4); md->carryTrim=TRIM_OFF;
|
||||
md=setDest(11); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 2); md->weight=100; md->swtch=RawSwitch(SWITCH_TYPE_SWITCH,SWITCH_ID1); md->curve=CV(5); md->carryTrim=TRIM_OFF;
|
||||
md=setDest(11); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 2); md->weight=100; md->swtch=RawSwitch(SWITCH_TYPE_SWITCH,SWITCH_ID2); md->curve=CV(6); md->carryTrim=TRIM_OFF;
|
||||
md=setDest(11); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 2); md->weight=100; md->swtch=RawSwitch(Board::SWITCH_TYPE_SWITCH,Board::SWITCH_ID0); md->curve=CV(4); md->carryTrim=TRIM_OFF;
|
||||
md=setDest(11); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 2); md->weight=100; md->swtch=RawSwitch(Board::SWITCH_TYPE_SWITCH,Board::SWITCH_ID1); md->curve=CV(5); md->carryTrim=TRIM_OFF;
|
||||
md=setDest(11); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 2); md->weight=100; md->swtch=RawSwitch(Board::SWITCH_TYPE_SWITCH,Board::SWITCH_ID2); md->curve=CV(6); md->carryTrim=TRIM_OFF;
|
||||
|
||||
model.swashRingData.type = HELI_SWASH_TYPE_120;
|
||||
model.swashRingData.collectiveSource = RawSource(SOURCE_TYPE_CH, 10);
|
||||
|
@ -806,19 +806,19 @@ void Templates::applyTemplate(uint8_t idx)
|
|||
md=setDest(4); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 0); md->weight=100; md->swtch=RawSwitch();
|
||||
|
||||
// throttle
|
||||
md=setDest(3); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 2); md->weight= 100; md->swtch=RawSwitch(SWITCH_TYPE_SWITCH,SWITCH_ID0); md->curve=CV(1); md->carryTrim=TRIM_OFF;
|
||||
md=setDest(3); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 2); md->weight= 100; md->swtch=RawSwitch(SWITCH_TYPE_SWITCH,SWITCH_ID1); md->curve=CV(2); md->carryTrim=TRIM_OFF;
|
||||
md=setDest(3); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 2); md->weight= 100; md->swtch=RawSwitch(SWITCH_TYPE_SWITCH,SWITCH_ID2); md->curve=CV(3); md->carryTrim=TRIM_OFF;
|
||||
md=setDest(3); md->srcRaw=RawSource(SOURCE_TYPE_MAX); md->weight=-100; md->swtch=RawSwitch(SWITCH_TYPE_SWITCH,thrsw); md->mltpx=MLTPX_REP;
|
||||
md=setDest(3); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 2); md->weight= 100; md->swtch=RawSwitch(Board::SWITCH_TYPE_SWITCH,Board::SWITCH_ID0); md->curve=CV(1); md->carryTrim=TRIM_OFF;
|
||||
md=setDest(3); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 2); md->weight= 100; md->swtch=RawSwitch(Board::SWITCH_TYPE_SWITCH,Board::SWITCH_ID1); md->curve=CV(2); md->carryTrim=TRIM_OFF;
|
||||
md=setDest(3); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 2); md->weight= 100; md->swtch=RawSwitch(Board::SWITCH_TYPE_SWITCH,Board::SWITCH_ID2); md->curve=CV(3); md->carryTrim=TRIM_OFF;
|
||||
md=setDest(3); md->srcRaw=RawSource(SOURCE_TYPE_MAX); md->weight=-100; md->swtch=RawSwitch(Board::SWITCH_TYPE_SWITCH,thrsw); md->mltpx=MLTPX_REP;
|
||||
|
||||
// gyro gain
|
||||
md=setDest(5); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 5); md->weight= 50; md->swtch=RawSwitch(SWITCH_TYPE_SWITCH,-SWITCH_GEA); md->sOffset=100;
|
||||
md=setDest(5); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 5); md->weight=-50; md->swtch=RawSwitch(SWITCH_TYPE_SWITCH,SWITCH_GEA); md->sOffset=100;
|
||||
md=setDest(5); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 5); md->weight= 50; md->swtch=RawSwitch(Board::SWITCH_TYPE_SWITCH,-Board::SWITCH_GEA); md->sOffset=100;
|
||||
md=setDest(5); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 5); md->weight=-50; md->swtch=RawSwitch(Board::SWITCH_TYPE_SWITCH,Board::SWITCH_GEA); md->sOffset=100;
|
||||
|
||||
// collective
|
||||
md=setDest(11); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 2); md->weight=100; md->swtch=RawSwitch(SWITCH_TYPE_SWITCH,SWITCH_ID0); md->curve=CV(4); md->carryTrim=TRIM_OFF;
|
||||
md=setDest(11); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 2); md->weight=100; md->swtch=RawSwitch(SWITCH_TYPE_SWITCH,SWITCH_ID1); md->curve=CV(5); md->carryTrim=TRIM_OFF;
|
||||
md=setDest(11); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 2); md->weight=100; md->swtch=RawSwitch(SWITCH_TYPE_SWITCH,SWITCH_ID2); md->curve=CV(6); md->carryTrim=TRIM_OFF;
|
||||
md=setDest(11); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 2); md->weight=100; md->swtch=RawSwitch(Board::SWITCH_TYPE_SWITCH,Board::SWITCH_ID0); md->curve=CV(4); md->carryTrim=TRIM_OFF;
|
||||
md=setDest(11); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 2); md->weight=100; md->swtch=RawSwitch(Board::SWITCH_TYPE_SWITCH,Board::SWITCH_ID1); md->curve=CV(5); md->carryTrim=TRIM_OFF;
|
||||
md=setDest(11); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 2); md->weight=100; md->swtch=RawSwitch(Board::SWITCH_TYPE_SWITCH,Board::SWITCH_ID2); md->curve=CV(6); md->carryTrim=TRIM_OFF;
|
||||
|
||||
model.swashRingData.type = HELI_SWASH_TYPE_120;
|
||||
model.swashRingData.collectiveSource = RawSource(SOURCE_TYPE_CH, 10);
|
||||
|
@ -853,16 +853,16 @@ void Templates::applyTemplate(uint8_t idx)
|
|||
}
|
||||
}
|
||||
}
|
||||
md=setDest(5); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 5); md->weight= 50; md->swtch=RawSwitch(SWITCH_TYPE_SWITCH,-SWITCH_GEA); md->sOffset=100;
|
||||
md=setDest(5); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 5); md->weight=-50; md->swtch=RawSwitch(SWITCH_TYPE_SWITCH,SWITCH_GEA); md->sOffset=100;
|
||||
md=setDest(5); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 5); md->weight= 50; md->swtch=RawSwitch(Board::SWITCH_TYPE_SWITCH,-Board::SWITCH_GEA); md->sOffset=100;
|
||||
md=setDest(5); md->srcRaw=RawSource(SOURCE_TYPE_STICK, 5); md->weight=-50; md->swtch=RawSwitch(Board::SWITCH_TYPE_SWITCH,Board::SWITCH_GEA); md->sOffset=100;
|
||||
}
|
||||
|
||||
//Servo Test
|
||||
if(idx==j++) {
|
||||
md=setDest(15); md->srcRaw=RawSource(SOURCE_TYPE_CH, 15); md->weight= 100; md->speedUp = 8; md->speedDown = 8; md->swtch=RawSwitch();
|
||||
md=setDest(16); md->srcRaw=RawSource(SOURCE_TYPE_CUSTOM_SWITCH, 0); md->weight= 110; md->swtch=RawSwitch();
|
||||
md=setDest(16); md->srcRaw=RawSource(SOURCE_TYPE_MAX); md->weight=-110; md->swtch=RawSwitch(SWITCH_TYPE_VIRTUAL, 2); md->mltpx=MLTPX_REP;
|
||||
md=setDest(16); md->srcRaw=RawSource(SOURCE_TYPE_MAX); md->weight= 110; md->swtch=RawSwitch(SWITCH_TYPE_VIRTUAL, 3); md->mltpx=MLTPX_REP;
|
||||
md=setDest(16); md->srcRaw=RawSource(SOURCE_TYPE_MAX); md->weight=-110; md->swtch=RawSwitch(Board::SWITCH_TYPE_VIRTUAL, 2); md->mltpx=MLTPX_REP;
|
||||
md=setDest(16); md->srcRaw=RawSource(SOURCE_TYPE_MAX); md->weight= 110; md->swtch=RawSwitch(Board::SWITCH_TYPE_VIRTUAL, 3); md->mltpx=MLTPX_REP;
|
||||
setSwitch(1, LS_FN_LESS, RawSource(SOURCE_TYPE_CH, 14).toValue(), RawSource(SOURCE_TYPE_CH, 15).toValue());
|
||||
setSwitch(2, LS_FN_VPOS, RawSource(SOURCE_TYPE_CH, 14).toValue(), 105);
|
||||
setSwitch(3, LS_FN_VNEG, RawSource(SOURCE_TYPE_CH, 14).toValue(), -105);
|
||||
|
|
|
@ -106,7 +106,7 @@ TreeModel::TreeModel(RadioData * radioData, QObject * parent):
|
|||
radioData(radioData),
|
||||
availableEEpromSize(-1)
|
||||
{
|
||||
BoardEnum board = getCurrentBoard();
|
||||
Board::Type board = getCurrentBoard();
|
||||
QVector<QVariant> labels;
|
||||
if (!IS_HORUS(board))
|
||||
labels << tr("Index");
|
||||
|
@ -244,7 +244,7 @@ bool TreeModel::setData(const QModelIndex & index, const QVariant & value, int r
|
|||
void TreeModel::refresh()
|
||||
{
|
||||
EEPROMInterface * eepromInterface = getCurrentEEpromInterface();
|
||||
BoardEnum board = eepromInterface->getBoard();
|
||||
Board::Type board = eepromInterface->getBoard();
|
||||
|
||||
if (!IS_SKY9X(board) && !IS_HORUS(board)) {
|
||||
availableEEpromSize = getEEpromSize(board) - 64; // let's consider fat
|
||||
|
|
|
@ -23,12 +23,12 @@
|
|||
|
||||
// TODO here we will move a lot of functions from eeprominterface.cpp when no merge risk
|
||||
|
||||
void ModelData::convert(BoardEnum before, BoardEnum after)
|
||||
void ModelData::convert(Board::Type before, Board::Type after)
|
||||
{
|
||||
// Here we can add explicit conversions when moving from one board to another
|
||||
}
|
||||
|
||||
void GeneralSettings::convert(BoardEnum before, BoardEnum after)
|
||||
void GeneralSettings::convert(Board::Type before, Board::Type after)
|
||||
{
|
||||
// Here we can add explicit conversions when moving from one board to another
|
||||
}
|
||||
|
@ -88,7 +88,7 @@ QString RadioData::getNextModelFilename()
|
|||
return filename;
|
||||
}
|
||||
|
||||
void RadioData::convert(BoardEnum before, BoardEnum after)
|
||||
void RadioData::convert(Board::Type before, Board::Type after)
|
||||
{
|
||||
generalSettings.convert(before, after);
|
||||
for (unsigned i=0; i<models.size(); i++) {
|
||||
|
@ -102,7 +102,7 @@ void RadioData::convert(BoardEnum before, BoardEnum after)
|
|||
}
|
||||
}
|
||||
|
||||
if (after == BOARD_HORUS) {
|
||||
if (after == Board::BOARD_HORUS) {
|
||||
fixModelFilenames();
|
||||
}
|
||||
}
|
|
@ -49,7 +49,6 @@ enum Switches {
|
|||
SWITCH_SJ2,
|
||||
SWITCH_SK0,
|
||||
SWITCH_SK2,
|
||||
|
||||
};
|
||||
|
||||
enum TimerModes {
|
||||
|
@ -290,7 +289,7 @@ class RawSwitch {
|
|||
return index >= 0 ? (type * 256 + index) : -(type * 256 - index);
|
||||
}
|
||||
|
||||
QString toString(BoardEnum board = BOARD_UNKNOWN) const;
|
||||
QString toString(Board::Type board = Board::BOARD_UNKNOWN) const;
|
||||
|
||||
bool operator== ( const RawSwitch& other) {
|
||||
return (this->type == other.type) && (this->index == other.index);
|
||||
|
@ -1008,7 +1007,7 @@ class ModelData {
|
|||
ModelData(const ModelData & src);
|
||||
ModelData & operator = (const ModelData & src);
|
||||
|
||||
void convert(BoardEnum before, BoardEnum after);
|
||||
void convert(Board::Type before, Board::Type after);
|
||||
|
||||
ExpoData * insertInput(const int idx);
|
||||
void removeInput(const int idx);
|
||||
|
@ -1130,7 +1129,7 @@ class GeneralSettings {
|
|||
};
|
||||
|
||||
GeneralSettings();
|
||||
void convert(BoardEnum before, BoardEnum after);
|
||||
void convert(Board::Type before, Board::Type after);
|
||||
|
||||
int getDefaultStick(unsigned int channel) const;
|
||||
RawSource getDefaultSource(unsigned int channel) const;
|
||||
|
@ -1224,17 +1223,6 @@ class GeneralSettings {
|
|||
typedef uint8_t ThemeOptionData[8+1];
|
||||
ThemeOptionData themeOptionValue[5];
|
||||
|
||||
struct SwitchInfo {
|
||||
SwitchInfo(unsigned int index, unsigned int position):
|
||||
index(index),
|
||||
position(position)
|
||||
{
|
||||
}
|
||||
unsigned int index;
|
||||
unsigned int position;
|
||||
};
|
||||
|
||||
static SwitchInfo switchInfoFromSwitchPositionTaranis(unsigned int index);
|
||||
bool switchPositionAllowedTaranis(int index) const;
|
||||
bool switchSourceAllowedTaranis(int index) const;
|
||||
bool isPotAvailable(int index) const;
|
||||
|
@ -1257,7 +1245,7 @@ class RadioData {
|
|||
std::vector<CategoryData> categories;
|
||||
std::vector<ModelData> models;
|
||||
|
||||
void convert(BoardEnum before, BoardEnum after);
|
||||
void convert(Board::Type before, Board::Type after);
|
||||
|
||||
void setCurrentModel(unsigned int index);
|
||||
void fixModelFilenames();
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
QString getRadioInterfaceCmd()
|
||||
{
|
||||
burnConfigDialog bcd;
|
||||
BoardEnum board = getCurrentBoard();
|
||||
Board::Type board = getCurrentBoard();
|
||||
if (IS_STM32(board)) {
|
||||
return bcd.getDFU();
|
||||
}
|
||||
|
@ -54,12 +54,12 @@ QStringList getAvrdudeArgs(const QString & cmd, const QString & filename)
|
|||
burnConfigDialog bcd;
|
||||
QString programmer = bcd.getProgrammer();
|
||||
QString mcu = bcd.getMCU();
|
||||
BoardEnum board = getCurrentBoard();
|
||||
Board::Type board = getCurrentBoard();
|
||||
|
||||
args << "-c" << programmer << "-p";
|
||||
if (IS_2560(board))
|
||||
args << "m2560";
|
||||
else if (board == BOARD_M128)
|
||||
else if (board == Board::BOARD_M128)
|
||||
args << "m128";
|
||||
else
|
||||
args << mcu;
|
||||
|
@ -137,7 +137,7 @@ QStringList getReadEEpromCmd(const QString & filename)
|
|||
|
||||
QStringList getWriteEEpromCmd(const QString & filename)
|
||||
{
|
||||
BoardEnum board = getCurrentBoard();
|
||||
Board::Type board = getCurrentBoard();
|
||||
if (IS_STM32(board)) {
|
||||
// impossible
|
||||
return QStringList();
|
||||
|
@ -152,14 +152,14 @@ QStringList getWriteEEpromCmd(const QString & filename)
|
|||
|
||||
QStringList getWriteFirmwareArgs(const QString & filename)
|
||||
{
|
||||
BoardEnum board = getCurrentBoard();
|
||||
Board::Type board = getCurrentBoard();
|
||||
if (IS_STM32(board)) {
|
||||
return getDfuArgs("-D", filename);
|
||||
}
|
||||
else if (board == BOARD_SKY9X) {
|
||||
else if (board == Board::BOARD_SKY9X) {
|
||||
return getSambaArgs(QString("send_file {Flash} \"") + filename + "\" 0x400000 0\n" + "FLASH::ScriptGPNMV 2\n");
|
||||
}
|
||||
else if (board == BOARD_9XRPRO || board == BOARD_AR9X) {
|
||||
else if (board == Board::BOARD_9XRPRO || board == Board::BOARD_AR9X) {
|
||||
return getSambaArgs(QString("send_file {Flash} \"") + filename + "\" 0x400000 0\n" + "FLASH::ScriptGPNMV 2\n");
|
||||
}
|
||||
else {
|
||||
|
@ -169,14 +169,14 @@ QStringList getWriteFirmwareArgs(const QString & filename)
|
|||
|
||||
QStringList getReadFirmwareArgs(const QString & filename)
|
||||
{
|
||||
BoardEnum board = getCurrentBoard();
|
||||
Board::Type board = getCurrentBoard();
|
||||
if (IS_STM32(board)) {
|
||||
return getDfuArgs("-U", filename);
|
||||
}
|
||||
else if (board == BOARD_SKY9X) {
|
||||
else if (board == Board::BOARD_SKY9X) {
|
||||
return getSambaArgs(QString("receive_file {Flash} \"") + filename + "\" 0x400000 0x40000 0\n");
|
||||
}
|
||||
else if (board == BOARD_9XRPRO) {
|
||||
else if (board == Board::BOARD_9XRPRO) {
|
||||
return getSambaArgs(QString("receive_file {Flash} \"") + filename + "\" 0x400000 0x80000 0\n");
|
||||
}
|
||||
else {
|
||||
|
@ -309,7 +309,7 @@ bool writeFirmware(const QString & filename, ProgressWidget * progress)
|
|||
|
||||
bool readEeprom(const QString & filename, ProgressWidget * progress)
|
||||
{
|
||||
BoardEnum board = getCurrentBoard();
|
||||
Board::Type board = getCurrentBoard();
|
||||
|
||||
QFile file(filename);
|
||||
if (file.exists() && !file.remove()) {
|
||||
|
@ -373,7 +373,7 @@ bool readEeprom(const QString & filename, ProgressWidget * progress)
|
|||
|
||||
bool writeEeprom(const QString & filename, ProgressWidget * progress)
|
||||
{
|
||||
BoardEnum board = getCurrentBoard();
|
||||
Board::Type board = getCurrentBoard();
|
||||
|
||||
if (IS_ARM(board)) {
|
||||
QString path = findMassstoragePath("EEPROM.BIN");
|
||||
|
|
|
@ -84,7 +84,7 @@ class SimulatedUIWidget : public QWidget
|
|||
RadioUiAction * m_scrollDnAction;
|
||||
RadioUiAction * m_rotEncClickAction;
|
||||
RadioUiAction * m_screenshotAction;
|
||||
BoardEnum m_board;
|
||||
Board::Type m_board;
|
||||
unsigned int m_backLight;
|
||||
bool m_lightOn;
|
||||
int m_beepShow;
|
||||
|
|
|
@ -204,15 +204,15 @@ void SimulatorDialog::setupUi()
|
|||
setWindowTitle(windowName);
|
||||
|
||||
switch(m_board) {
|
||||
case BOARD_TARANIS_X7 :
|
||||
case Board::BOARD_TARANIS_X7 :
|
||||
radioUiWidget = new SimulatedUIWidgetX7(simulator, this);
|
||||
break;
|
||||
case BOARD_TARANIS_X9D :
|
||||
case BOARD_TARANIS_X9DP :
|
||||
case BOARD_TARANIS_X9E :
|
||||
case Board::BOARD_TARANIS_X9D :
|
||||
case Board::BOARD_TARANIS_X9DP :
|
||||
case Board::BOARD_TARANIS_X9E :
|
||||
radioUiWidget = new SimulatedUIWidgetX9(simulator, this);
|
||||
break;
|
||||
case BOARD_HORUS :
|
||||
case Board::BOARD_HORUS :
|
||||
radioUiWidget = new SimulatedUIWidgetX12(simulator, this);
|
||||
break;
|
||||
default:
|
||||
|
@ -312,7 +312,7 @@ void SimulatorDialog::setupRadioWidgets()
|
|||
{
|
||||
int i, midpos, aIdx;
|
||||
QString wname;
|
||||
BoardEnum board = firmware->getBoard();
|
||||
Board::Type board = firmware->getBoard();
|
||||
|
||||
// First clear out any existing widgets.
|
||||
if (switches.size()) {
|
||||
|
@ -334,17 +334,17 @@ void SimulatorDialog::setupRadioWidgets()
|
|||
// Now set up new widgets.
|
||||
|
||||
// switches
|
||||
SwitchInfo switchInfo;
|
||||
Board::SwitchInfo switchInfo;
|
||||
// FIXME : CPN_MAX_SWITCHES == 32 but GeneralSettings::switchConfig[18] !!
|
||||
for (i = 0; i < firmware->getCapability(Capability(Switches)) && i < 18 /*CPN_MAX_SWITCHES*/; ++i) {
|
||||
if (radioSettings.switchConfig[i] == SWITCH_NONE)
|
||||
if (radioSettings.switchConfig[i] == Board::SWITCH_NOT_AVAILABLE)
|
||||
continue;
|
||||
|
||||
if ((wname = QString(radioSettings.switchName[i])).isEmpty()) {
|
||||
switchInfo = getSwitchInfo(board, i);
|
||||
wname = QString(switchInfo.name);
|
||||
}
|
||||
RadioSwitchWidget * sw = new RadioSwitchWidget(SwitchConfig(radioSettings.switchConfig[i]), wname, 0, ui->radioWidgetsHT);
|
||||
RadioSwitchWidget * sw = new RadioSwitchWidget(Board::SwitchType(radioSettings.switchConfig[i]), wname, 0, ui->radioWidgetsHT);
|
||||
sw->setIndex(i);
|
||||
ui->radioWidgetsHTLayout->addWidget(sw);
|
||||
switches.append(sw);
|
||||
|
@ -361,7 +361,7 @@ void SimulatorDialog::setupRadioWidgets()
|
|||
if ((wname = QString(radioSettings.potName[i])).isEmpty())
|
||||
wname = firmware->getAnalogInputName(4 + aIdx + i);
|
||||
|
||||
RadioKnobWidget * pot = new RadioKnobWidget(PotConfig(radioSettings.potConfig[i]), wname, 0, ui->radioWidgetsHT);
|
||||
RadioKnobWidget * pot = new RadioKnobWidget(Board::PotType(radioSettings.potConfig[i]), wname, 0, ui->radioWidgetsHT);
|
||||
pot->setIndex(aIdx + i);
|
||||
// FIXME : total hack here -- this needs to follow the exception in radio/src/mixer.cpp:evalInputs()
|
||||
if (i == 0 && IS_TARANIS(board) && !IS_TARANIS_X7(board))
|
||||
|
|
|
@ -126,7 +126,7 @@ class SimulatorDialog : public QDialog
|
|||
QString sdCardPath;
|
||||
QString radioDataPath;
|
||||
QByteArray eepromData;
|
||||
BoardEnum m_board;
|
||||
Board::Type m_board;
|
||||
quint8 flags;
|
||||
int radioProfileId;
|
||||
int lastPhase;
|
||||
|
|
|
@ -115,7 +115,7 @@ class SimulatorFactory {
|
|||
|
||||
virtual QString name() = 0;
|
||||
|
||||
virtual BoardEnum type() = 0;
|
||||
virtual Board::Type type() = 0;
|
||||
|
||||
virtual SimulatorInterface *create() = 0;
|
||||
};
|
||||
|
|
|
@ -35,13 +35,13 @@ class RadioKnobWidget : public RadioWidget
|
|||
|
||||
public:
|
||||
|
||||
explicit RadioKnobWidget(PotConfig type = POT_WITH_DETENT, QWidget *parent = Q_NULLPTR, Qt::WindowFlags f = Qt::WindowFlags()) :
|
||||
explicit RadioKnobWidget(Board::PotType type = Board::POT_WITH_DETENT, QWidget * parent = Q_NULLPTR, Qt::WindowFlags f = Qt::WindowFlags()) :
|
||||
RadioWidget(parent, f),
|
||||
m_potType(type)
|
||||
{
|
||||
init();
|
||||
}
|
||||
explicit RadioKnobWidget(PotConfig type, const QString &labelText, int value = 0, QWidget *parent = Q_NULLPTR, Qt::WindowFlags f = Qt::WindowFlags()) :
|
||||
explicit RadioKnobWidget(Board::PotType type, const QString & labelText, int value = 0, QWidget * parent = Q_NULLPTR, Qt::WindowFlags f = Qt::WindowFlags()) :
|
||||
RadioWidget(labelText, value, parent, f),
|
||||
m_potType(type)
|
||||
{
|
||||
|
@ -63,7 +63,7 @@ class RadioKnobWidget : public RadioWidget
|
|||
|
||||
private:
|
||||
|
||||
PotConfig m_potType;
|
||||
Board::PotType m_potType;
|
||||
|
||||
|
||||
class KnobWidget : public QDial
|
||||
|
@ -72,10 +72,10 @@ class RadioKnobWidget : public RadioWidget
|
|||
|
||||
public:
|
||||
|
||||
explicit KnobWidget(PotConfig type, QWidget * parent = 0):
|
||||
explicit KnobWidget(Board::PotType type, QWidget * parent = 0):
|
||||
QDial(parent),
|
||||
m_type(type),
|
||||
m_positions(type == POT_MULTIPOS_SWITCH ? 5 : 0)
|
||||
m_positions(type == Board::POT_MULTIPOS_SWITCH ? 5 : 0)
|
||||
{
|
||||
setToolTip(tr("Right-double-click to reset to center."));
|
||||
setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
|
||||
|
@ -114,7 +114,7 @@ class RadioKnobWidget : public RadioWidget
|
|||
QDial::mousePressEvent(event);
|
||||
}
|
||||
|
||||
PotConfig m_type;
|
||||
Board::PotType m_type;
|
||||
quint8 m_positions;
|
||||
};
|
||||
|
||||
|
|
|
@ -33,13 +33,13 @@ class RadioSwitchWidget : public RadioWidget
|
|||
|
||||
public:
|
||||
|
||||
explicit RadioSwitchWidget(SwitchConfig type = SWITCH_3POS, QWidget *parent = Q_NULLPTR, Qt::WindowFlags f = Qt::WindowFlags()) :
|
||||
explicit RadioSwitchWidget(Board::SwitchType type = Board::SWITCH_3POS, QWidget *parent = Q_NULLPTR, Qt::WindowFlags f = Qt::WindowFlags()) :
|
||||
RadioWidget(parent, f),
|
||||
switchConfig(type)
|
||||
{
|
||||
init();
|
||||
}
|
||||
explicit RadioSwitchWidget(SwitchConfig type, const QString &labelText, int value = 0, QWidget *parent = Q_NULLPTR, Qt::WindowFlags f = Qt::WindowFlags()) :
|
||||
explicit RadioSwitchWidget(Board::SwitchType type, const QString &labelText, int value = 0, QWidget *parent = Q_NULLPTR, Qt::WindowFlags f = Qt::WindowFlags()) :
|
||||
RadioWidget(labelText, value, parent, f),
|
||||
switchConfig(type)
|
||||
{
|
||||
|
@ -58,7 +58,7 @@ class RadioSwitchWidget : public RadioWidget
|
|||
sl->setInvertedControls(true);
|
||||
sl->setTickPosition(QSlider::TicksBothSides);
|
||||
sl->setPageStep(1);
|
||||
sl->setMinimum((switchConfig == SWITCH_3POS ? -1 : 0));
|
||||
sl->setMinimum((switchConfig == Board::SWITCH_3POS ? -1 : 0));
|
||||
sl->setMaximum(1);
|
||||
sl->setTickInterval(1);
|
||||
sl->setValue(m_value);
|
||||
|
@ -70,7 +70,7 @@ class RadioSwitchWidget : public RadioWidget
|
|||
}
|
||||
|
||||
private:
|
||||
SwitchConfig switchConfig;
|
||||
Board::SwitchType switchConfig;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ eepromFatHeader(NULL)
|
|||
#define EEPROM_MAX_FILES (EEPROM_MAX_ZONES - 1)
|
||||
#define FIRST_FILE_AVAILABLE (1+MAX_MODELS)
|
||||
|
||||
void RleFile::EeFsCreate(uint8_t *eeprom, int size, BoardEnum board, unsigned int version)
|
||||
void RleFile::EeFsCreate(uint8_t *eeprom, int size, Board::Type board, unsigned int version)
|
||||
{
|
||||
this->eeprom = eeprom;
|
||||
this->eeprom_size = size;
|
||||
|
@ -86,7 +86,7 @@ void RleFile::EeFsCreate(uint8_t *eeprom, int size, BoardEnum board, unsigned in
|
|||
}
|
||||
else {
|
||||
eeFs = (EeFs *)eeprom;
|
||||
eeFsVersion = (IS_2560(board) || board==BOARD_M128) ? 5 : 4;
|
||||
eeFsVersion = (IS_2560(board) || board==Board::BOARD_M128) ? 5 : 4;
|
||||
eeFsBlockSize = 16;
|
||||
eeFsLinkSize = 1;
|
||||
|
||||
|
@ -136,7 +136,7 @@ bool RleFile::searchFat()
|
|||
return (eepromFatHeader != NULL);
|
||||
}
|
||||
|
||||
bool RleFile::EeFsOpen(uint8_t *eeprom, int size, BoardEnum board)
|
||||
bool RleFile::EeFsOpen(uint8_t *eeprom, int size, Board::Type board)
|
||||
{
|
||||
this->eeprom = eeprom;
|
||||
this->eeprom_size = size;
|
||||
|
|
|
@ -90,7 +90,7 @@ class RleFile
|
|||
unsigned int m_err; //error reasons
|
||||
uint16_t m_size;
|
||||
|
||||
BoardEnum board;
|
||||
Board::Type board;
|
||||
unsigned int version;
|
||||
uint8_t *eeprom;
|
||||
unsigned int eeprom_size;
|
||||
|
@ -125,9 +125,9 @@ public:
|
|||
|
||||
RleFile();
|
||||
|
||||
void EeFsCreate(uint8_t *eeprom, int size, BoardEnum board, unsigned int version);
|
||||
void EeFsCreate(uint8_t *eeprom, int size, Board::Type board, unsigned int version);
|
||||
|
||||
bool EeFsOpen(uint8_t *eeprom, int size, BoardEnum board);
|
||||
bool EeFsOpen(uint8_t *eeprom, int size, Board::Type board);
|
||||
|
||||
///open file for reading, no close necessary
|
||||
///for writing use writeRlc() or create()
|
||||
|
|
|
@ -45,7 +45,7 @@ class StorageFormat
|
|||
StorageFormat(const QString & filename, uint8_t version=0):
|
||||
filename(filename),
|
||||
version(version),
|
||||
board(BOARD_UNKNOWN)
|
||||
board(Board::BOARD_UNKNOWN)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -62,7 +62,7 @@ class StorageFormat
|
|||
|
||||
virtual QString name() = 0;
|
||||
|
||||
virtual BoardEnum getBoard() {
|
||||
virtual Board::Type getBoard() {
|
||||
return board;
|
||||
}
|
||||
|
||||
|
@ -83,7 +83,7 @@ class StorageFormat
|
|||
uint8_t version;
|
||||
QString _error;
|
||||
QString _warning;
|
||||
BoardEnum board;
|
||||
Board::Type board;
|
||||
};
|
||||
|
||||
class StorageFactory
|
||||
|
|
|
@ -157,7 +157,7 @@ void saveModel(ModelData & m, model & xm)
|
|||
phases::phase_sequence & phases_sequence (xphases.phase());
|
||||
for (int i=0; i<CPN_MAX_FLIGHT_MODES; i++) {
|
||||
FlightModeData & p = m.flightModeData[i];
|
||||
if (i == 0 || p.swtch.type!=SWITCH_TYPE_NONE) {
|
||||
if (i == 0 || p.swtch.type!=Board::SWITCH_TYPE_NONE) {
|
||||
TrimType xtrim[4];
|
||||
for (int j=0; j<4; j++) {
|
||||
if (m.flightModeData[i].trimRef[j] >= 0)
|
||||
|
|
|
@ -254,18 +254,18 @@ class OpenTxSimulatorFactory: public SimulatorFactory
|
|||
return QString(SIMULATOR_FLAVOUR);
|
||||
}
|
||||
|
||||
virtual BoardEnum type()
|
||||
virtual Board::Type type()
|
||||
{
|
||||
#if defined(PCBHORUS)
|
||||
return BOARD_HORUS;
|
||||
return Board::BOARD_HORUS;
|
||||
#elif defined(PCBFLAMENCO)
|
||||
return BOARD_FLAMENCO;
|
||||
return Board::BOARD_FLAMENCO;
|
||||
#elif defined(PCBX7)
|
||||
return BOARD_TARANIS_X7;
|
||||
return Board::BOARD_TARANIS_X7;
|
||||
#elif defined(PCBTARANIS)
|
||||
return BOARD_TARANIS_X9D;
|
||||
return Board::BOARD_TARANIS_X9D;
|
||||
#else
|
||||
return BOARD_STOCK;
|
||||
return Board::BOARD_STOCK;
|
||||
#endif
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue