chore(cpn): move global variables from flight/drive modes tab to own tab (#6624)
This commit is contained in:
@@ -1182,7 +1182,7 @@ bool Boards::isSwitchFunc(int index, Board::Type board)
|
||||
return getBoardJson(board)->isSwitchFunc(index);
|
||||
}
|
||||
|
||||
QString Boards::getRadioTypeString(Board::Type board)
|
||||
QString Boards::getRadioModeString(Board::Type board)
|
||||
{
|
||||
return getCapability(board == Board::BOARD_UNKNOWN ? getCurrentBoard() : board, Board::Air) ? tr("Flight") : tr("Drive");
|
||||
}
|
||||
|
||||
@@ -465,7 +465,7 @@ class Boards
|
||||
static AbstractStaticItemModel * flexTypeItemModel();
|
||||
|
||||
static std::string getLegacyAnalogMappedInputTag(const char * legacytag, Board::Type board = Board::BOARD_UNKNOWN);
|
||||
static QString getRadioTypeString(Board::Type board = Board::BOARD_UNKNOWN);
|
||||
static QString getRadioModeString(Board::Type board = Board::BOARD_UNKNOWN);
|
||||
static bool isAir(Board::Type board = Board::BOARD_UNKNOWN);
|
||||
static bool isSurface(Board::Type board = Board::BOARD_UNKNOWN);
|
||||
|
||||
|
||||
@@ -69,7 +69,6 @@ enum Capability {
|
||||
CustomAndSwitches,
|
||||
HasNegAndSwitches,
|
||||
LogicalSwitchesExt,
|
||||
RotaryEncoders,
|
||||
Outputs,
|
||||
ChannelsName,
|
||||
ExtraInputs,
|
||||
|
||||
@@ -22,6 +22,8 @@
|
||||
#include "flightmodedata.h"
|
||||
#include "radiodata.h"
|
||||
#include "radiodataconversionstate.h"
|
||||
#include "compounditemmodels.h"
|
||||
#include "eeprominterface.h"
|
||||
|
||||
void FlightModeData::convert(RadioDataConversionState & cstate)
|
||||
{
|
||||
@@ -33,35 +35,44 @@ void FlightModeData::convert(RadioDataConversionState & cstate)
|
||||
void FlightModeData::clear(const int phaseIdx)
|
||||
{
|
||||
memset(reinterpret_cast<void *>(this), 0, sizeof(FlightModeData));
|
||||
|
||||
for (int i = 0; i < CPN_MAX_GVARS; i++) {
|
||||
gvars[i] = linkedGVarFlightModeZero(phaseIdx);
|
||||
}
|
||||
for (int i = 0; i < CPN_MAX_ENCODERS; i++) {
|
||||
rotaryEncoders[i] = linkedREncFlightModeZero(phaseIdx);
|
||||
}
|
||||
}
|
||||
|
||||
QString FlightModeData::nameToString(int phaseIdx) const
|
||||
{
|
||||
return RadioData::getElementName(Boards::isAir() ? tr("FM") : tr("DM"), phaseIdx, name); // names are zero-based, FM0, FM1, etc
|
||||
return RadioData::getElementName(tr("%1M").arg(modeAbbrev()), phaseIdx, name); // names are zero-based, FM0, FM1, etc
|
||||
}
|
||||
|
||||
// static
|
||||
QString FlightModeData::modeAbbrev()
|
||||
{
|
||||
return Boards::isAir() ? tr("F") : tr("D");
|
||||
}
|
||||
|
||||
// static
|
||||
QString FlightModeData::modeName()
|
||||
{
|
||||
return Boards::isAir() ? tr("Flight") : tr("Drive");
|
||||
}
|
||||
|
||||
bool FlightModeData::isEmpty(int phaseIdx) const
|
||||
{
|
||||
if (name[0] != '\0' || swtch.isSet() || fadeIn != 0 || fadeOut != 0)
|
||||
return false;
|
||||
|
||||
for (int i = 0; i < CPN_MAX_TRIMS; i++) {
|
||||
if (trim[i] != 0 || trimRef[i] != 0 || trimMode[i] != 0)
|
||||
return false;
|
||||
}
|
||||
|
||||
for (int i = 0; i < CPN_MAX_GVARS; i++) {
|
||||
if (!isGVarEmpty(phaseIdx, i))
|
||||
return false;
|
||||
}
|
||||
for (int i = 0; i < CPN_MAX_ENCODERS; i++) {
|
||||
if (!isREncEmpty(phaseIdx, i))
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -69,13 +80,7 @@ bool FlightModeData::isGVarEmpty(int phaseIdx, int gvIdx) const
|
||||
{
|
||||
if ((phaseIdx == 0 && gvars[gvIdx] == 0) || (phaseIdx != 0 && gvars[gvIdx] == linkedGVarFlightModeZero(phaseIdx)))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool FlightModeData::isREncEmpty(int phaseIdx, int reIdx) const
|
||||
{
|
||||
if ((phaseIdx == 0 && rotaryEncoders[reIdx] == 0) || (phaseIdx != 0 && rotaryEncoders[reIdx] == linkedREncFlightModeZero(phaseIdx)))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -83,6 +88,7 @@ int FlightModeData::linkedFlightModeZero(int phaseIdx, int maxOwnValue) const
|
||||
{
|
||||
if (phaseIdx == 0)
|
||||
return 0;
|
||||
|
||||
return maxOwnValue + 1;
|
||||
}
|
||||
|
||||
@@ -91,7 +97,19 @@ int FlightModeData::linkedGVarFlightModeZero(int phaseIdx) const
|
||||
return linkedFlightModeZero(phaseIdx, GVAR_MAX_VALUE);
|
||||
}
|
||||
|
||||
int FlightModeData::linkedREncFlightModeZero(int phaseIdx) const
|
||||
// static
|
||||
AbstractStaticItemModel * FlightModeData::gvarModesItemModel(int excludeMode)
|
||||
{
|
||||
return linkedFlightModeZero(phaseIdx, RENC_MAX_VALUE);
|
||||
AbstractStaticItemModel * mdl = new AbstractStaticItemModel();
|
||||
mdl->setName(AIM_FLIGHTMODEDATA_GVARFM);
|
||||
int modes = getCurrentFirmware()->getCapability(FlightModes);
|
||||
|
||||
for (int i = 0; i < modes; i++) {
|
||||
if (i != excludeMode)
|
||||
mdl->appendToItemList(tr("%1M%2").arg(modeAbbrev()).arg(i),
|
||||
GVAR_MAX_VALUE + 1 + i - (i > excludeMode ? 1 : 0));
|
||||
}
|
||||
|
||||
mdl->loadItemList();
|
||||
return mdl;
|
||||
}
|
||||
|
||||
@@ -25,12 +25,15 @@
|
||||
#include "rawswitch.h"
|
||||
|
||||
#include <QtCore>
|
||||
#include <QComboBox>
|
||||
|
||||
class RadioDataConversionState;
|
||||
class AbstractStaticItemModel;
|
||||
class Firmware;
|
||||
|
||||
#define FLIGHTMODE_NAME_LEN 10
|
||||
#define RENC_MAX_VALUE 1024
|
||||
#define RENC_MIN_VALUE -RENC_MAX_VALUE
|
||||
|
||||
constexpr char AIM_FLIGHTMODEDATA_GVARFM[] {"flightmodedata.gvarfm"};
|
||||
|
||||
class FlightModeData {
|
||||
Q_DECLARE_TR_FUNCTIONS(FlightModeData)
|
||||
@@ -45,7 +48,6 @@ class FlightModeData {
|
||||
char name[FLIGHTMODE_NAME_LEN + 1];
|
||||
unsigned int fadeIn;
|
||||
unsigned int fadeOut;
|
||||
int rotaryEncoders[CPN_MAX_ENCODERS];
|
||||
int gvars[CPN_MAX_GVARS];
|
||||
|
||||
void convert(RadioDataConversionState & cstate);
|
||||
@@ -53,8 +55,9 @@ class FlightModeData {
|
||||
bool isEmpty(int phaseIdx) const;
|
||||
QString nameToString(int phaseIdx) const;
|
||||
bool isGVarEmpty(int phaseIdx, int gvIdx) const;
|
||||
bool isREncEmpty(int phaseIdx, int reIdx) const;
|
||||
int linkedFlightModeZero(int phaseIdx, int maxOwnValue) const;
|
||||
int linkedGVarFlightModeZero(int phaseIdx) const;
|
||||
int linkedREncFlightModeZero(int phaseIdx) const;
|
||||
static AbstractStaticItemModel * gvarModesItemModel(int excludeMode);
|
||||
static QString modeAbbrev();
|
||||
static QString modeName();
|
||||
};
|
||||
|
||||
@@ -20,12 +20,17 @@
|
||||
*/
|
||||
|
||||
#include "gvardata.h"
|
||||
|
||||
#include "radiodata.h"
|
||||
#include "compounditemmodels.h"
|
||||
|
||||
QString GVarData::unitToString() const
|
||||
{
|
||||
switch (unit) {
|
||||
return unitToString(unit);
|
||||
}
|
||||
|
||||
QString GVarData::unitToString(int val)
|
||||
{
|
||||
switch (val) {
|
||||
case GVAR_UNIT_NUMBER:
|
||||
return tr("");
|
||||
case GVAR_UNIT_PERCENT:
|
||||
@@ -37,7 +42,12 @@ QString GVarData::unitToString() const
|
||||
|
||||
QString GVarData::precToString() const
|
||||
{
|
||||
switch (prec) {
|
||||
return precToString(prec);
|
||||
}
|
||||
|
||||
QString GVarData::precToString(int val)
|
||||
{
|
||||
switch (val) {
|
||||
case GVAR_PREC_MUL10:
|
||||
return tr("0._");
|
||||
case GVAR_PREC_MUL1:
|
||||
@@ -96,3 +106,44 @@ bool GVarData::isEmpty() const
|
||||
{
|
||||
return (name[0] == '\0' && min == 0 && max == 0 && (!popup) && prec == 0 && unit == 0);
|
||||
}
|
||||
|
||||
AbstractStaticItemModel * GVarData::precItemModel()
|
||||
{
|
||||
AbstractStaticItemModel * mdl = new AbstractStaticItemModel();
|
||||
mdl->setName(AIM_GVARDATA_UNIT);
|
||||
|
||||
for (int i = 0; i < GVAR_PREC_COUNT; i++) {
|
||||
mdl->appendToItemList(precToString(i), i);
|
||||
}
|
||||
|
||||
mdl->loadItemList();
|
||||
return mdl;
|
||||
}
|
||||
|
||||
AbstractStaticItemModel * GVarData::unitItemModel()
|
||||
{
|
||||
AbstractStaticItemModel * mdl = new AbstractStaticItemModel();
|
||||
mdl->setName(AIM_GVARDATA_UNIT);
|
||||
|
||||
for (int i = 0; i < GVAR_UNIT_COUNT; i++) {
|
||||
mdl->appendToItemList(unitToString(i), i);
|
||||
}
|
||||
|
||||
mdl->loadItemList();
|
||||
return mdl;
|
||||
}
|
||||
|
||||
QDataStream &operator<<(QDataStream &out, const GVarData &data) {
|
||||
QByteArray name(data.name);
|
||||
name.resize(sizeof(data.name));
|
||||
out << name << data.min << data.max << data.prec << data.unit;
|
||||
return out;
|
||||
}
|
||||
|
||||
QDataStream &operator>>(QDataStream &in, GVarData &data) {
|
||||
QByteArray name;
|
||||
name.resize(sizeof(data.name));
|
||||
in >> name >> data.min >> data.max >> data.prec >> data.unit;
|
||||
memcpy(data.name, name.constData(), sizeof(data.name));
|
||||
return in;
|
||||
}
|
||||
|
||||
@@ -19,15 +19,19 @@
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#ifndef GVARDATA_H
|
||||
#define GVARDATA_H
|
||||
#pragma once
|
||||
|
||||
#include <QtCore>
|
||||
|
||||
constexpr char AIM_GVARDATA_PREC[] {"gvardata.prec"};
|
||||
constexpr char AIM_GVARDATA_UNIT[] {"gvardata.unit"};
|
||||
|
||||
#define GVAR_NAME_LEN 3
|
||||
#define GVAR_MAX_VALUE 1024
|
||||
#define GVAR_MIN_VALUE -GVAR_MAX_VALUE
|
||||
|
||||
class AbstractStaticItemModel;
|
||||
|
||||
class GVarData {
|
||||
Q_DECLARE_TR_FUNCTIONS(GVarData)
|
||||
|
||||
@@ -36,12 +40,14 @@ class GVarData {
|
||||
|
||||
enum {
|
||||
GVAR_UNIT_NUMBER,
|
||||
GVAR_UNIT_PERCENT
|
||||
GVAR_UNIT_PERCENT,
|
||||
GVAR_UNIT_COUNT
|
||||
};
|
||||
|
||||
enum {
|
||||
GVAR_PREC_MUL10,
|
||||
GVAR_PREC_MUL1
|
||||
GVAR_PREC_MUL1,
|
||||
GVAR_PREC_COUNT
|
||||
};
|
||||
|
||||
char name[GVAR_NAME_LEN + 1];
|
||||
@@ -53,7 +59,9 @@ class GVarData {
|
||||
|
||||
void clear() {memset(this, 0, sizeof(GVarData)); }
|
||||
QString unitToString() const;
|
||||
static QString unitToString(int val);
|
||||
QString precToString() const;
|
||||
static QString precToString(int val);
|
||||
QString nameToString(int index) const;
|
||||
int multiplierSet();
|
||||
float multiplierGet() const;
|
||||
@@ -64,7 +72,9 @@ class GVarData {
|
||||
float getMinPrec() const;
|
||||
float getMaxPrec() const;
|
||||
bool isEmpty() const;
|
||||
static AbstractStaticItemModel * unitItemModel();
|
||||
static AbstractStaticItemModel * precItemModel();
|
||||
};
|
||||
|
||||
|
||||
#endif // GVARDATA_H
|
||||
QDataStream &operator<<(QDataStream &out, const GVarData &obj);
|
||||
QDataStream &operator>>(QDataStream &in, GVarData &obj);
|
||||
|
||||
@@ -304,39 +304,6 @@ int ModelData::getGVarValue(int phaseIdx, int gvarIdx)
|
||||
return flightModeData[0].gvars[gvarIdx]; // circular linked so return FM0 value
|
||||
}
|
||||
|
||||
bool ModelData::isREncLinked(int phaseIdx, int reIdx)
|
||||
{
|
||||
return flightModeData[phaseIdx].rotaryEncoders[reIdx] > RENC_MAX_VALUE;
|
||||
}
|
||||
|
||||
bool ModelData::isREncLinkedCircular(int phaseIdx, int reIdx)
|
||||
{
|
||||
for (int i = 0; i < CPN_MAX_FLIGHT_MODES; i++) {
|
||||
int val = flightModeData[phaseIdx].rotaryEncoders[reIdx];
|
||||
if (phaseIdx == 0 || val <= RENC_MAX_VALUE)
|
||||
return false;
|
||||
int nextPhase = val - (RENC_MAX_VALUE + 1);
|
||||
if (nextPhase >= phaseIdx)
|
||||
nextPhase += 1;
|
||||
phaseIdx = nextPhase;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
int ModelData::getREncValue(int phaseIdx, int reIdx)
|
||||
{
|
||||
for (int i = 0; i < CPN_MAX_FLIGHT_MODES; i++) {
|
||||
int val = flightModeData[phaseIdx].rotaryEncoders[reIdx];
|
||||
if (phaseIdx == 0 || val <= RENC_MAX_VALUE)
|
||||
return val;
|
||||
int nextPhase = val - (RENC_MAX_VALUE + 1);
|
||||
if (nextPhase >= phaseIdx)
|
||||
nextPhase += 1;
|
||||
phaseIdx = nextPhase;
|
||||
}
|
||||
return flightModeData[0].rotaryEncoders[reIdx]; // circular linked so return FM0 value
|
||||
}
|
||||
|
||||
void ModelData::setTrimValue(int phaseIdx, int trimIdx, int value)
|
||||
{
|
||||
for (uint8_t i = 0; i < CPN_MAX_FLIGHT_MODES; i++) {
|
||||
@@ -1346,18 +1313,6 @@ void ModelData::setGVarFlightModeIndexToValue(const int phaseIdx, const int gvar
|
||||
flightModeData[phaseIdx].gvars[gvarIdx] = linkedFlightModeIndexToValue(phaseIdx, useFmIdx, GVAR_MAX_VALUE);
|
||||
}
|
||||
|
||||
int ModelData::getREncFlightModeIndex(const int phaseIdx, const int reIdx)
|
||||
{
|
||||
if (!isREncLinked(phaseIdx, reIdx))
|
||||
return -1;
|
||||
return (linkedFlightModeValueToIndex(phaseIdx, flightModeData[phaseIdx].rotaryEncoders[reIdx], RENC_MAX_VALUE));
|
||||
}
|
||||
|
||||
void ModelData::setREncFlightModeIndexToValue(const int phaseIdx, const int reIdx, const int useFmIdx)
|
||||
{
|
||||
flightModeData[phaseIdx].rotaryEncoders[reIdx] = linkedFlightModeIndexToValue(phaseIdx, useFmIdx, RENC_MAX_VALUE);
|
||||
}
|
||||
|
||||
bool ModelData::isExpoParent(const int index)
|
||||
{
|
||||
const ExpoData &ed = expoData[index];
|
||||
@@ -1494,7 +1449,7 @@ void ModelData::updateResetParam(CustomFunctionData * cfd)
|
||||
idxAdj = -2; // reverse earlier offset required for rawsource
|
||||
break;
|
||||
case REF_UPD_TYPE_SENSOR:
|
||||
idxAdj = 5/*3 Timers + Flight + Telemetery*/ + firmware->getCapability(RotaryEncoders);
|
||||
idxAdj = 5/*3 Timers + Flight + Telemetery*/;
|
||||
if (cfd->param < idxAdj || cfd->param > (idxAdj + firmware->getCapability(Sensors)))
|
||||
return;
|
||||
break;
|
||||
@@ -2051,3 +2006,123 @@ QString ModelData::getChecklistFilename() const
|
||||
{
|
||||
return QString(name).replace(" ", "_").append(".txt").toLower();
|
||||
}
|
||||
|
||||
void ModelData::gvarClear(const int index, bool updateRefs)
|
||||
{
|
||||
gvarData[index].clear();
|
||||
|
||||
for (int i = 0; i < CPN_MAX_FLIGHT_MODES; i++) {
|
||||
FlightModeData &fm = flightModeData[i];
|
||||
fm.gvars[index] = fm.linkedGVarFlightModeZero(i);
|
||||
}
|
||||
|
||||
if (updateRefs) {
|
||||
updateAllReferences(ModelData::REF_UPD_TYPE_GLOBAL_VARIABLE,
|
||||
ModelData::REF_UPD_ACT_CLEAR, index);
|
||||
}
|
||||
}
|
||||
|
||||
void ModelData::gvarSetMax(const int index, const float value)
|
||||
{
|
||||
gvarData[index].setMax(value);
|
||||
|
||||
for (int i = 0; i < CPN_MAX_FLIGHT_MODES; i++) {
|
||||
if (!isGVarLinked(i, index)) {
|
||||
if (flightModeData[i].gvars[index] > gvarData[index].getMax()) {
|
||||
flightModeData[i].gvars[index] = gvarData[index].getMax();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ModelData::gvarSetMin(const int index, const float value)
|
||||
{
|
||||
gvarData[index].setMin(value);
|
||||
|
||||
for (int i = 0; i < CPN_MAX_FLIGHT_MODES; i++) {
|
||||
if (!isGVarLinked(i, index)) {
|
||||
if (flightModeData[i].gvars[index] < gvarData[index].getMin()) {
|
||||
flightModeData[i].gvars[index] = gvarData[index].getMin();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ModelData::gvarSwap(const int index1, const int index2)
|
||||
{
|
||||
if (index1 != index2) {
|
||||
GVarData gvtmp = gvarData[index2];
|
||||
GVarData *gv1 = &gvarData[index1];
|
||||
GVarData *gv2 = &gvarData[index2];
|
||||
memcpy(gv2, gv1, sizeof(GVarData));
|
||||
memcpy(gv1, &gvtmp, sizeof(GVarData));
|
||||
|
||||
for (int i = 0; i < CPN_MAX_FLIGHT_MODES; i++) {
|
||||
FlightModeData &fm = flightModeData[i];
|
||||
int gvar = fm.gvars[index2];
|
||||
fm.gvars[index2] = fm.gvars[index1];
|
||||
fm.gvars[index1] = gvar;
|
||||
}
|
||||
|
||||
updateAllReferences(ModelData::REF_UPD_TYPE_GLOBAL_VARIABLE,
|
||||
ModelData::REF_UPD_ACT_SWAP, index1, index2);
|
||||
}
|
||||
}
|
||||
|
||||
void ModelData::gvarDelete(const int index)
|
||||
{
|
||||
memmove(&gvarData[index], &gvarData[index + 1],
|
||||
(CPN_MAX_GVARS - (index + 1)) * sizeof(GVarData));
|
||||
gvarData[CPN_MAX_GVARS - 1].clear();
|
||||
|
||||
for (int j = 0; j < CPN_MAX_FLIGHT_MODES; j++) {
|
||||
for (int i = index; i < (CPN_MAX_GVARS - 1); i++) {
|
||||
flightModeData[j].gvars[i] = flightModeData[j].gvars[i + 1];
|
||||
}
|
||||
}
|
||||
|
||||
for (int j = 0; j < CPN_MAX_FLIGHT_MODES; j++) {
|
||||
flightModeData[j].gvars[CPN_MAX_GVARS - 1] = flightModeData[j].linkedGVarFlightModeZero(j);
|
||||
}
|
||||
|
||||
updateAllReferences(ModelData::REF_UPD_TYPE_GLOBAL_VARIABLE,
|
||||
ModelData::REF_UPD_ACT_SHIFT, index, 0, -1);
|
||||
}
|
||||
|
||||
void ModelData::gvarInsert(const int index)
|
||||
{
|
||||
memmove(&gvarData[index + 1], &gvarData[index],
|
||||
(CPN_MAX_GVARS - (index + 1)) * sizeof(GVarData));
|
||||
gvarData[index].clear();
|
||||
|
||||
for (int j = 0; j < CPN_MAX_FLIGHT_MODES; j++) {
|
||||
for (int i = (CPN_MAX_GVARS - 1); i > index; i--) {
|
||||
flightModeData[j].gvars[i] = flightModeData[j].gvars[i - 1];
|
||||
}
|
||||
}
|
||||
|
||||
for (int j = 0; j < CPN_MAX_FLIGHT_MODES; j++) {
|
||||
flightModeData[j].gvars[index] = flightModeData[j].linkedGVarFlightModeZero(j);
|
||||
}
|
||||
|
||||
updateAllReferences(ModelData::REF_UPD_TYPE_GLOBAL_VARIABLE,
|
||||
ModelData::REF_UPD_ACT_SHIFT, index, 0, 1);
|
||||
}
|
||||
|
||||
bool ModelData::gvarInsertAllowed(const int index)
|
||||
{
|
||||
bool ret = true;
|
||||
int gvars = getCurrentFirmware()->getCapability(Gvars);
|
||||
|
||||
if (index == (gvars - 1) || !gvarData[gvars - 1].isEmpty())
|
||||
ret = false;
|
||||
|
||||
for (int i = 0; i < CPN_MAX_FLIGHT_MODES; i++) {
|
||||
if (flightModeData[i].gvars[gvars - 1] !=
|
||||
flightModeData[i].linkedGVarFlightModeZero(i))
|
||||
ret = false;
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
||||
}
|
||||
|
||||
@@ -262,12 +262,13 @@ class ModelData {
|
||||
float getGVarValuePrec(int phaseIdx, int gvarIdx);
|
||||
int getGVarFlightModeIndex(const int phaseIdx, const int gvarIdx);
|
||||
void setGVarFlightModeIndexToValue(const int phaseIdx, const int gvarIdx, const int useFmIdx);
|
||||
|
||||
bool isREncLinked(int phaseIdx, int reIdx);
|
||||
bool isREncLinkedCircular(int phaseIdx, int reIdx);
|
||||
int getREncValue(int phaseIdx, int reIdx);
|
||||
int getREncFlightModeIndex(const int phaseIdx, const int reIdx);
|
||||
void setREncFlightModeIndexToValue(const int phaseIdx, const int reIdx, const int useFmIdx);
|
||||
void gvarClear(const int index, bool updateRefs = true);
|
||||
void gvarSetMax(const int index, const float value);
|
||||
void gvarSetMin(const int index, const float value);
|
||||
void gvarSwap(const int index1, const int index2);
|
||||
void gvarDelete(const int index);
|
||||
void gvarInsert(const int index);
|
||||
bool gvarInsertAllowed(const int index);
|
||||
|
||||
ModelData removeGlobalVars();
|
||||
|
||||
|
||||
@@ -138,8 +138,6 @@ int OpenTxFirmware::getCapability(::Capability capability)
|
||||
return getCapability(LogicalSwitches);
|
||||
case LogicalSwitchesExt:
|
||||
return true;
|
||||
case RotaryEncoders:
|
||||
return 0;
|
||||
case Outputs:
|
||||
return 32;
|
||||
case NumCurvePoints:
|
||||
|
||||
@@ -188,9 +188,6 @@ QString RawSource::toString(const ModelData * model, const GeneralSettings * con
|
||||
(Boards::isAir(board) ? CHECK_IN_ARRAY(trimsAir, index) :
|
||||
CHECK_IN_ARRAY(trimsSurface, index)));
|
||||
|
||||
case SOURCE_TYPE_ROTARY_ENCODER:
|
||||
return CHECK_IN_ARRAY(rotary, index);
|
||||
|
||||
case SOURCE_TYPE_MIN:
|
||||
return tr("MIN");
|
||||
|
||||
|
||||
@@ -167,7 +167,6 @@ enum RawSourceType {
|
||||
SOURCE_TYPE_VIRTUAL_INPUT,
|
||||
SOURCE_TYPE_LUA_OUTPUT,
|
||||
SOURCE_TYPE_INPUT,
|
||||
SOURCE_TYPE_ROTARY_ENCODER,
|
||||
SOURCE_TYPE_TRIM,
|
||||
SOURCE_TYPE_MIN,
|
||||
SOURCE_TYPE_MAX,
|
||||
|
||||
Reference in New Issue
Block a user