Merge from 2.3
This commit is contained in:
@@ -85,6 +85,11 @@ void LimitData::clear()
|
||||
max = +1000;
|
||||
}
|
||||
|
||||
bool LimitData::isEmpty() const
|
||||
{
|
||||
return (min == -1000 && max == 1000 && !revert && !offset && !ppmCenter && !symetrical && name[0] == '\0');
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* CurveData
|
||||
|
||||
@@ -111,6 +111,7 @@ class LimitData {
|
||||
QString revertToString() const;
|
||||
QString nameToString(int index) const;
|
||||
void clear();
|
||||
bool isEmpty() const;
|
||||
};
|
||||
|
||||
class CurvePoint {
|
||||
|
||||
@@ -123,6 +123,9 @@ enum TrainerMode {
|
||||
TRAINER_MODE_MASTER_SBUS_EXTERNAL_MODULE,
|
||||
TRAINER_MODE_MASTER_CPPM_EXTERNAL_MODULE,
|
||||
TRAINER_MODE_MASTER_BATTERY_COMPARTMENT,
|
||||
TRAINER_MODE_MASTER_BLUETOOTH,
|
||||
TRAINER_MODE_SLAVE_BLUETOOTH,
|
||||
TRAINER_MODE_MULTI
|
||||
};
|
||||
|
||||
class ModelData {
|
||||
|
||||
@@ -86,7 +86,7 @@ QString ModuleData::rfProtocolToString() const
|
||||
{
|
||||
switch (protocol) {
|
||||
case PULSES_MULTIMODULE:
|
||||
return Multiprotocols::protocolToString((int)multi.rfProtocol, multi.customProto);
|
||||
return Multiprotocols::protocolToString((int)multi.rfProtocol);
|
||||
|
||||
default:
|
||||
return CPN_STR_UNKNOWN_ITEM;
|
||||
@@ -107,7 +107,7 @@ QString ModuleData::subTypeToString(int type) const
|
||||
|
||||
switch (protocol) {
|
||||
case PULSES_MULTIMODULE:
|
||||
return Multiprotocols::subTypeToString(multi.customProto ? MM_RF_CUSTOM_SELECTED : (int)multi.rfProtocol, (unsigned)type);
|
||||
return Multiprotocols::subTypeToString((int)multi.rfProtocol, (unsigned)type);
|
||||
|
||||
case PULSES_PXX_R9M:
|
||||
return CHECK_IN_ARRAY(strings, type);
|
||||
|
||||
@@ -164,9 +164,10 @@ class ModuleData {
|
||||
|
||||
struct Multi {
|
||||
unsigned int rfProtocol;
|
||||
bool disableTelemetry;
|
||||
bool disableMapping;
|
||||
bool autoBindMode;
|
||||
bool lowPowerMode;
|
||||
bool customProto;
|
||||
int optionValue;
|
||||
} multi;
|
||||
|
||||
|
||||
@@ -172,5 +172,8 @@ QString Multiprotocols::protocolToString(int protocol, bool custom)
|
||||
// static
|
||||
QString Multiprotocols::subTypeToString(int protocol, unsigned subType)
|
||||
{
|
||||
return tr(qPrintable(multiProtocols.getProtocol(protocol).subTypeStrings.value(subType, CPN_STR_UNKNOWN_ITEM)));
|
||||
if (protocol > MODULE_SUBTYPE_MULTI_LAST)
|
||||
return tr(qPrintable(QString::number(subType)));
|
||||
else
|
||||
return tr(qPrintable(multiProtocols.getProtocol(protocol).subTypeStrings.value(subType, CPN_STR_UNKNOWN_ITEM)));
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
|
||||
#include <vector>
|
||||
#include <QtCore>
|
||||
#include "moduledata.h"
|
||||
|
||||
#define MM_RF_CUSTOM_SELECTED 0xff
|
||||
|
||||
@@ -48,7 +49,7 @@ class Multiprotocols
|
||||
|
||||
unsigned int numSubTypes() const
|
||||
{
|
||||
return (unsigned int) subTypeStrings.length();
|
||||
return protocol > MODULE_SUBTYPE_MULTI_LAST ? 8 : (unsigned int) subTypeStrings.length();
|
||||
}
|
||||
|
||||
int getOptionMin() const;
|
||||
|
||||
@@ -2037,9 +2037,10 @@ class ModuleUnionField: public UnionField<unsigned int> {
|
||||
rfProtExtra(0)
|
||||
{
|
||||
ModuleData::Multi& multi = module.multi;
|
||||
internalField.Append(new UnsignedField<2>(this, rfProtExtra));
|
||||
internalField.Append(new SpareBitsField<3>(this));
|
||||
internalField.Append(new BoolField<1>(this, multi.customProto));
|
||||
internalField.Append(new UnsignedField<3>(this, rfProtExtra));
|
||||
internalField.Append(new BoolField<1>(this, multi.disableTelemetry));
|
||||
internalField.Append(new BoolField<1>(this, multi.disableMapping));
|
||||
internalField.Append(new SpareBitsField<1>(this));
|
||||
internalField.Append(new BoolField<1>(this, multi.autoBindMode));
|
||||
internalField.Append(new BoolField<1>(this, multi.lowPowerMode));
|
||||
internalField.Append(new SignedField<8>(this, multi.optionValue));
|
||||
@@ -2052,12 +2053,17 @@ class ModuleUnionField: public UnionField<unsigned int> {
|
||||
|
||||
void beforeExport() override
|
||||
{
|
||||
rfProtExtra = (module.multi.rfProtocol >> 4) & 0x03;
|
||||
if (module.multi.rfProtocol > MODULE_SUBTYPE_MULTI_LAST)
|
||||
module.multi.rfProtocol += 3;
|
||||
rfProtExtra = (module.multi.rfProtocol & 0x70) >> 4;
|
||||
module.multi.rfProtocol &= 0x0f;
|
||||
}
|
||||
|
||||
void afterImport() override
|
||||
{
|
||||
module.multi.rfProtocol = (rfProtExtra & 0x3) << 4 | (module.rfProtocol & 0xf);
|
||||
module.multi.rfProtocol = (rfProtExtra << 4) + (module.rfProtocol & 0xf);
|
||||
if (module.multi.rfProtocol > MODULE_SUBTYPE_MULTI_LAST)
|
||||
module.multi.rfProtocol -= 3;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
@@ -1222,7 +1222,6 @@ void registerOpenTxFirmwares()
|
||||
/* FrSky Taranis X9D+ 2019 board */
|
||||
firmware = new OpenTxFirmware("opentx-x9d+2019", Firmware::tr("FrSky Taranis X9D+ 2019"), BOARD_TARANIS_X9DP_2019);
|
||||
addOpenTxTaranisOptions(firmware);
|
||||
firmware->addOption("autoupdate", Firmware::tr("Support for auto update on boot"));
|
||||
registerOpenTxFirmware(firmware);
|
||||
|
||||
/* FrSky Taranis X9D board */
|
||||
@@ -1243,13 +1242,11 @@ void registerOpenTxFirmwares()
|
||||
/* FrSky X9-Lite board */
|
||||
firmware = new OpenTxFirmware("opentx-x9lite", Firmware::tr("FrSky Taranis X9-Lite"), BOARD_TARANIS_X9LITE);
|
||||
addOpenTxTaranisOptions(firmware);
|
||||
firmware->addOption("autoupdate", Firmware::tr("Support for auto update on boot"));
|
||||
registerOpenTxFirmware(firmware);
|
||||
|
||||
/* FrSky X9-LiteS board */
|
||||
firmware = new OpenTxFirmware("opentx-x9lites", Firmware::tr("FrSky Taranis X9-Lite S"), BOARD_TARANIS_X9LITES);
|
||||
addOpenTxTaranisOptions(firmware);
|
||||
firmware->addOption("autoupdate", Firmware::tr("Support for auto update on boot"));
|
||||
registerOpenTxFirmware(firmware);
|
||||
|
||||
/* FrSky X7 board */
|
||||
@@ -1260,7 +1257,6 @@ void registerOpenTxFirmwares()
|
||||
/* FrSky X-Lite S/PRO board */
|
||||
firmware = new OpenTxFirmware("opentx-xlites", Firmware::tr("FrSky Taranis X-Lite S/PRO"), BOARD_TARANIS_XLITES);
|
||||
addOpenTxTaranisOptions(firmware);
|
||||
firmware->addOption("autoupdate", Firmware::tr("Support for auto update on boot"));
|
||||
registerOpenTxFirmware(firmware);
|
||||
|
||||
/* FrSky X-Lite board */
|
||||
@@ -1276,9 +1272,8 @@ void registerOpenTxFirmwares()
|
||||
registerOpenTxFirmware(firmware);
|
||||
|
||||
/* FrSky X10 Express board */
|
||||
firmware = new OpenTxFirmware("opentx-x10express", Firmware::tr("FrSky Horus X10 / X10S Express"), BOARD_X10_EXPRESS);
|
||||
firmware = new OpenTxFirmware("opentx-x10express", Firmware::tr("FrSky Horus X10 Express / X10S Express"), BOARD_X10_EXPRESS);
|
||||
addOpenTxFrskyOptions(firmware);
|
||||
firmware->addOption("autoupdate", Firmware::tr("Support for auto update on boot"));
|
||||
registerOpenTxFirmware(firmware);
|
||||
|
||||
/* FrSky X12 (Horus) board */
|
||||
@@ -1289,17 +1284,18 @@ void registerOpenTxFirmwares()
|
||||
registerOpenTxFirmware(firmware);
|
||||
|
||||
/* Jumper T12 board */
|
||||
firmware = new OpenTxFirmware("opentx-t12", QCoreApplication::translate("Firmware", "Jumper T12"), BOARD_JUMPER_T12);
|
||||
firmware = new OpenTxFirmware("opentx-t12", QCoreApplication::translate("Firmware", "Jumper T12 / T12 Pro"), BOARD_JUMPER_T12);
|
||||
addOpenTxCommonOptions(firmware);
|
||||
firmware->addOption("noheli", Firmware::tr("Disable HELI menu and cyclic mix support"));
|
||||
firmware->addOption("nogvars", Firmware::tr("Disable Global variables"));
|
||||
firmware->addOption("lua", Firmware::tr("Enable Lua custom scripts screen"));
|
||||
firmware->addOption("flexr9m", Firmware::tr("Enable non certified R9M firmwares"));
|
||||
firmware->addOption("internalmulti", Firmware::tr("Support for MULTI internal module"));
|
||||
addOpenTxFontOptions(firmware);
|
||||
registerOpenTxFirmware(firmware);
|
||||
|
||||
/* Jumper T16 board */
|
||||
firmware = new OpenTxFirmware("opentx-t16", Firmware::tr("Jumper T16 / T16+"), BOARD_JUMPER_T16);
|
||||
firmware = new OpenTxFirmware("opentx-t16", Firmware::tr("Jumper T16 / T16+ / T16 Pro"), BOARD_JUMPER_T16);
|
||||
addOpenTxFrskyOptions(firmware);
|
||||
firmware->addOption("internalmulti", Firmware::tr("Support for MULTI internal module"));
|
||||
firmware->addOption("bluetooth", Firmware::tr("Support for bluetooth module"));
|
||||
|
||||
@@ -40,6 +40,12 @@ void HardwarePanel::setupSwitchType(int index, QLabel * label, AutoLineEdit * na
|
||||
else if (index == 5) {
|
||||
label->setText("SH");
|
||||
}
|
||||
if (index == 6) {
|
||||
label->setText("SI");
|
||||
}
|
||||
else if (index == 7) {
|
||||
label->setText("SJ");
|
||||
}
|
||||
}
|
||||
if (IS_JUMPER_T12(board)) {
|
||||
if (index == 4) {
|
||||
@@ -166,7 +172,7 @@ HardwarePanel::HardwarePanel(QWidget * parent, GeneralSettings & generalSettings
|
||||
ui->txCurrentCalibrationLabel->hide();
|
||||
}
|
||||
|
||||
if (IS_TARANIS_X7(board) || IS_TARANIS_XLITE(board)|| IS_TARANIS_X9E(board) || IS_HORUS(board) || IS_JUMPER_T12(board)) {
|
||||
if (IS_TARANIS_X7(board) || IS_TARANIS_XLITE(board)|| IS_TARANIS_X9E(board) || IS_HORUS(board)) {
|
||||
ui->bluetoothMode->addItem(tr("OFF"), 0);
|
||||
if (IS_TARANIS_X9E(board)) {
|
||||
ui->bluetoothMode->addItem(tr("Enabled"), 1);
|
||||
|
||||
@@ -701,6 +701,10 @@ void MdiChild::updateTitle()
|
||||
if (availableEEpromSize >= 0) {
|
||||
title += QString(" - %1 ").arg(availableEEpromSize) + tr("free bytes");
|
||||
}
|
||||
QFileInfo fi(curFile);
|
||||
if (!isUntitled && !fi.isWritable()) {
|
||||
title += QString(" (%1)").arg(tr("read only"));
|
||||
}
|
||||
setWindowTitle(title);
|
||||
}
|
||||
|
||||
@@ -1355,7 +1359,8 @@ bool MdiChild::loadFile(const QString & filename, bool resetCurrentFile)
|
||||
|
||||
bool MdiChild::save()
|
||||
{
|
||||
if (isUntitled) {
|
||||
QFileInfo fi(curFile);
|
||||
if (isUntitled || !fi.isWritable()) {
|
||||
return saveAs(true);
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -101,6 +101,7 @@ Channels::Channels(QWidget * parent, ModelData & model, GeneralSettings & genera
|
||||
{
|
||||
Stopwatch s1("Channels");
|
||||
|
||||
chnCapability = firmware->getCapability(Outputs);
|
||||
int channelNameMaxLen = firmware->getCapability(ChannelsName);
|
||||
|
||||
QStringList headerLabels;
|
||||
@@ -115,11 +116,11 @@ Channels::Channels(QWidget * parent, ModelData & model, GeneralSettings & genera
|
||||
headerLabels << tr("PPM Center");
|
||||
if (firmware->getCapability(SYMLimits))
|
||||
headerLabels << tr("Linear Subtrim");
|
||||
TableLayout *tableLayout = new TableLayout(this, firmware->getCapability(LogicalSwitches), headerLabels);
|
||||
TableLayout *tableLayout = new TableLayout(this, chnCapability, headerLabels);
|
||||
|
||||
s1.report("header");
|
||||
|
||||
for (int i=0; i<firmware->getCapability(Outputs); i++) {
|
||||
for (int i=0; i<chnCapability; i++) {
|
||||
int col = 0;
|
||||
|
||||
// Channel label
|
||||
@@ -196,7 +197,7 @@ Channels::Channels(QWidget * parent, ModelData & model, GeneralSettings & genera
|
||||
|
||||
disableMouseScrolling();
|
||||
tableLayout->resizeColumnsToContents();
|
||||
tableLayout->pushRowsUp(firmware->getCapability(Outputs)+1);
|
||||
tableLayout->pushRowsUp(chnCapability+1);
|
||||
s1.report("end");
|
||||
}
|
||||
|
||||
@@ -279,7 +280,7 @@ void Channels::ppmcenterEdited()
|
||||
|
||||
void Channels::update()
|
||||
{
|
||||
for (int i=0; i<firmware->getCapability(Outputs); i++) {
|
||||
for (int i=0; i<chnCapability; i++) {
|
||||
updateLine(i);
|
||||
}
|
||||
}
|
||||
@@ -315,8 +316,8 @@ void Channels::chnPaste()
|
||||
{
|
||||
const QClipboard *clipboard = QApplication::clipboard();
|
||||
const QMimeData *mimeData = clipboard->mimeData();
|
||||
if (mimeData->hasFormat("application/x-companion-chn")) {
|
||||
QByteArray chnData = mimeData->data("application/x-companion-chn");
|
||||
if (mimeData->hasFormat(MIMETYPE_CHN)) {
|
||||
QByteArray chnData = mimeData->data(MIMETYPE_CHN);
|
||||
LimitData *chn = &model->limitData[selectedChannel];
|
||||
memcpy(chn, chnData.constData(), sizeof(LimitData));
|
||||
updateLine(selectedChannel);
|
||||
@@ -326,8 +327,17 @@ void Channels::chnPaste()
|
||||
|
||||
void Channels::chnDelete()
|
||||
{
|
||||
model->limitData[selectedChannel].clear();
|
||||
updateLine(selectedChannel);
|
||||
int maxidx = chnCapability - 1;
|
||||
for (int i=selectedChannel; i<maxidx; i++) {
|
||||
if (!model->limitData[i].isEmpty() || !model->limitData[i+1].isEmpty()) {
|
||||
LimitData *chn1 = &model->limitData[i];
|
||||
LimitData *chn2 = &model->limitData[i+1];
|
||||
memcpy(chn1, chn2, sizeof(LimitData));
|
||||
updateLine(i);
|
||||
}
|
||||
}
|
||||
model->limitData[maxidx].clear();
|
||||
updateLine(maxidx);
|
||||
emit modified();
|
||||
}
|
||||
|
||||
@@ -336,32 +346,93 @@ void Channels::chnCopy()
|
||||
QByteArray chnData;
|
||||
chnData.append((char*)&model->limitData[selectedChannel],sizeof(LimitData));
|
||||
QMimeData *mimeData = new QMimeData;
|
||||
mimeData->setData("application/x-companion-chn", chnData);
|
||||
mimeData->setData(MIMETYPE_CHN, chnData);
|
||||
QApplication::clipboard()->setMimeData(mimeData,QClipboard::Clipboard);
|
||||
}
|
||||
|
||||
void Channels::chnCut()
|
||||
{
|
||||
chnCopy();
|
||||
chnDelete();
|
||||
chnClear();
|
||||
}
|
||||
|
||||
void Channels::chn_customContextMenuRequested(QPoint pos)
|
||||
{
|
||||
QLabel *label = (QLabel *)sender();
|
||||
selectedChannel = label->property("index").toInt();
|
||||
QLabel *label = (QLabel *)sender();
|
||||
selectedChannel = label->property("index").toInt();
|
||||
|
||||
QPoint globalPos = label->mapToGlobal(pos);
|
||||
QPoint globalPos = label->mapToGlobal(pos);
|
||||
|
||||
const QClipboard *clipboard = QApplication::clipboard();
|
||||
const QMimeData *mimeData = clipboard->mimeData();
|
||||
bool hasData = mimeData->hasFormat("application/x-companion-chn");
|
||||
const QClipboard *clipboard = QApplication::clipboard();
|
||||
const QMimeData *mimeData = clipboard->mimeData();
|
||||
bool hasData = mimeData->hasFormat(MIMETYPE_CHN);
|
||||
bool moveUpAllowed = (selectedChannel > 0);
|
||||
bool moveDownAllowed = (selectedChannel < (chnCapability - 1));
|
||||
bool insertAllowed = (selectedChannel < (chnCapability - 1)) && (model->limitData[chnCapability - 1].isEmpty());
|
||||
|
||||
QMenu contextMenu;
|
||||
contextMenu.addAction(CompanionIcon("copy.png"), tr("&Copy"),this,SLOT(chnCopy()));
|
||||
contextMenu.addAction(CompanionIcon("cut.png"), tr("&Cut"),this,SLOT(chnCut()));
|
||||
contextMenu.addAction(CompanionIcon("paste.png"), tr("&Paste"),this,SLOT(chnPaste()))->setEnabled(hasData);
|
||||
contextMenu.addAction(CompanionIcon("clear.png"), tr("&Delete"),this,SLOT(chnDelete()));
|
||||
QMenu contextMenu;
|
||||
contextMenu.addAction(CompanionIcon("copy.png"), tr("Copy"),this,SLOT(chnCopy()));
|
||||
contextMenu.addAction(CompanionIcon("cut.png"), tr("Cut"),this,SLOT(chnCut()));
|
||||
contextMenu.addAction(CompanionIcon("paste.png"), tr("Paste"),this,SLOT(chnPaste()))->setEnabled(hasData);
|
||||
contextMenu.addAction(CompanionIcon("clear.png"), tr("Clear"),this,SLOT(chnClear()));
|
||||
contextMenu.addSeparator();
|
||||
contextMenu.addAction(CompanionIcon("arrow-right.png"), tr("Insert"),this,SLOT(chnInsert()))->setEnabled(insertAllowed);
|
||||
contextMenu.addAction(CompanionIcon("arrow-left.png"), tr("Delete"),this,SLOT(chnDelete()));
|
||||
contextMenu.addAction(CompanionIcon("moveup.png"), tr("Move Up"),this,SLOT(chnMoveUp()))->setEnabled(moveUpAllowed);
|
||||
contextMenu.addAction(CompanionIcon("movedown.png"), tr("Move Down"),this,SLOT(chnMoveDown()))->setEnabled(moveDownAllowed);
|
||||
contextMenu.addSeparator();
|
||||
contextMenu.addAction(CompanionIcon("clear.png"), tr("Clear All"),this,SLOT(chnClearAll()));
|
||||
|
||||
contextMenu.exec(globalPos);
|
||||
contextMenu.exec(globalPos);
|
||||
}
|
||||
|
||||
void Channels::chnMoveUp()
|
||||
{
|
||||
swapChnData(selectedChannel, selectedChannel - 1);
|
||||
}
|
||||
|
||||
void Channels::chnMoveDown()
|
||||
{
|
||||
swapChnData(selectedChannel, selectedChannel + 1);
|
||||
}
|
||||
|
||||
void Channels::chnClear()
|
||||
{
|
||||
model->limitData[selectedChannel].clear();
|
||||
updateLine(selectedChannel);
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void Channels::chnClearAll()
|
||||
{
|
||||
for (int i=0; i<chnCapability; i++) {
|
||||
model->limitData[i].clear();
|
||||
updateLine(i);
|
||||
}
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void Channels::chnInsert()
|
||||
{
|
||||
for (int i=(chnCapability - 1); i>selectedChannel; i--) {
|
||||
if (!model->limitData[i].isEmpty() || !model->limitData[i-1].isEmpty()) {
|
||||
memcpy(&model->limitData[i], &model->limitData[i-1], sizeof(LimitData));
|
||||
updateLine(i);
|
||||
}
|
||||
}
|
||||
chnClear();
|
||||
}
|
||||
|
||||
void Channels::swapChnData(int idx1, int idx2)
|
||||
{
|
||||
if ((idx1 != idx2) && (!model->limitData[idx1].isEmpty() || !model->limitData[idx2].isEmpty())) {
|
||||
LimitData chntmp = model->limitData[idx2];
|
||||
LimitData *chn1 = &model->limitData[idx1];
|
||||
LimitData *chn2 = &model->limitData[idx2];
|
||||
memcpy(chn2, chn1, sizeof(LimitData));
|
||||
memcpy(chn1, &chntmp, sizeof(LimitData));
|
||||
updateLine(idx1);
|
||||
updateLine(idx2);
|
||||
emit modified();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,6 +26,8 @@
|
||||
|
||||
#include <QtCore>
|
||||
|
||||
constexpr char MIMETYPE_CHN[] = "application/x-companion-chn";
|
||||
|
||||
class GVarGroup;
|
||||
|
||||
class LimitsGroup
|
||||
@@ -70,9 +72,15 @@ class Channels : public ModelPanel
|
||||
void chnCopy();
|
||||
void chnPaste();
|
||||
void chnCut();
|
||||
void chnMoveUp();
|
||||
void chnMoveDown();
|
||||
void chnInsert();
|
||||
void chnClear();
|
||||
void chnClearAll();
|
||||
void chn_customContextMenuRequested(QPoint pos);
|
||||
|
||||
private:
|
||||
void swapChnData(int idx1, int idx2);
|
||||
QLineEdit *name[CPN_MAX_CHNOUT];
|
||||
LimitsGroup *chnOffset[CPN_MAX_CHNOUT];
|
||||
LimitsGroup *chnMin[CPN_MAX_CHNOUT];
|
||||
@@ -82,6 +90,7 @@ class Channels : public ModelPanel
|
||||
QSpinBox *centerSB[CPN_MAX_CHNOUT];
|
||||
QCheckBox *symlimitsChk[CPN_MAX_CHNOUT];
|
||||
int selectedChannel;
|
||||
int chnCapability;
|
||||
};
|
||||
|
||||
#endif // _CHANNELS_H_
|
||||
|
||||
@@ -74,7 +74,7 @@ CustomFunctionsPanel::CustomFunctionsPanel(QWidget * parent, ModelData * model,
|
||||
{
|
||||
Stopwatch s1("CustomFunctionsPanel - populate");
|
||||
lock = true;
|
||||
int num_fsw = model ? firmware->getCapability(CustomFunctions) : firmware->getCapability(GlobalFunctions);
|
||||
fswCapability = model ? firmware->getCapability(CustomFunctions) : firmware->getCapability(GlobalFunctions);
|
||||
|
||||
rawSwitchItemModel = new RawSwitchFilterItemModel(&generalSettings, model, model ? RawSwitch::SpecialFunctionsContext : RawSwitch::GlobalFunctionsContext, this);
|
||||
rawSrcAllItemModel = new RawSourceFilterItemModel(&generalSettings, model, this);
|
||||
@@ -83,7 +83,7 @@ CustomFunctionsPanel::CustomFunctionsPanel(QWidget * parent, ModelData * model,
|
||||
|
||||
if (!firmware->getCapability(VoicesAsNumbers)) {
|
||||
tracksSet = getFilesSet(getSoundsPath(generalSettings), QStringList() << "*.wav" << "*.WAV", firmware->getCapability(VoicesMaxLength));
|
||||
for (int i=0; i<num_fsw; i++) {
|
||||
for (int i=0; i<fswCapability; i++) {
|
||||
if (functions[i].func==FuncPlayPrompt || functions[i].func==FuncBackgroundMusic) {
|
||||
QString temp = functions[i].paramarm;
|
||||
if (!temp.isEmpty()) {
|
||||
@@ -97,7 +97,7 @@ CustomFunctionsPanel::CustomFunctionsPanel(QWidget * parent, ModelData * model,
|
||||
|
||||
if (IS_STM32(firmware->getBoard())) {
|
||||
scriptsSet = getFilesSet(g.profile[g.id()].sdPath() + "/SCRIPTS/FUNCTIONS", QStringList() << "*.lua", firmware->getCapability(VoicesMaxLength));
|
||||
for (int i=0; i<num_fsw; i++) {
|
||||
for (int i=0; i<fswCapability; i++) {
|
||||
if (functions[i].func==FuncPlayScript) {
|
||||
QString temp = functions[i].paramarm;
|
||||
if (!temp.isEmpty()) {
|
||||
@@ -113,9 +113,9 @@ CustomFunctionsPanel::CustomFunctionsPanel(QWidget * parent, ModelData * model,
|
||||
|
||||
QStringList headerLabels;
|
||||
headerLabels << "#" << tr("Switch") << tr("Action") << tr("Parameters") << tr("Enable");
|
||||
TableLayout * tableLayout = new TableLayout(this, num_fsw, headerLabels);
|
||||
TableLayout * tableLayout = new TableLayout(this, fswCapability, headerLabels);
|
||||
|
||||
for (int i=0; i<num_fsw; i++) {
|
||||
for (int i=0; i<fswCapability; i++) {
|
||||
// The label
|
||||
QLabel * label = new QLabel(this);
|
||||
label->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||
@@ -244,7 +244,7 @@ CustomFunctionsPanel::CustomFunctionsPanel(QWidget * parent, ModelData * model,
|
||||
tableLayout->resizeColumnsToContents();
|
||||
s1.report("resizeColumnsToContents");
|
||||
tableLayout->setColumnWidth(3, 300);
|
||||
tableLayout->pushRowsUp(num_fsw+1);
|
||||
tableLayout->pushRowsUp(fswCapability+1);
|
||||
s1.report("end");
|
||||
}
|
||||
|
||||
@@ -579,7 +579,6 @@ void CustomFunctionsPanel::refreshCustomFunction(int i, bool modified)
|
||||
widgetsMask |= CUSTOM_FUNCTION_ENABLE;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
fswtchFunc[i]->setVisible(widgetsMask & CUSTOM_FUNCTION_SHOW_FUNC);
|
||||
@@ -603,8 +602,7 @@ void CustomFunctionsPanel::update()
|
||||
{
|
||||
updateDataModels();
|
||||
lock = true;
|
||||
int num_fsw = model ? firmware->getCapability(CustomFunctions) : firmware->getCapability(GlobalFunctions);
|
||||
for (int i=0; i<num_fsw; i++) {
|
||||
for (int i=0; i<fswCapability; i++) {
|
||||
refreshCustomFunction(i);
|
||||
}
|
||||
lock = false;
|
||||
@@ -614,30 +612,28 @@ void CustomFunctionsPanel::fswPaste()
|
||||
{
|
||||
const QClipboard *clipboard = QApplication::clipboard();
|
||||
const QMimeData *mimeData = clipboard->mimeData();
|
||||
if (mimeData->hasFormat("application/x-companion-fsw")) {
|
||||
QByteArray fswData = mimeData->data("application/x-companion-fsw");
|
||||
if (mimeData->hasFormat(MIMETYPE_FSW)) {
|
||||
QByteArray fswData = mimeData->data(MIMETYPE_FSW);
|
||||
CustomFunctionData *fsw = &functions[selectedFunction];
|
||||
memcpy(fsw, fswData.constData(), sizeof(CustomFunctionData));
|
||||
lock = true;
|
||||
fswtchSwtch[selectedFunction]->setCurrentIndex(fswtchSwtch[selectedFunction]->findData(functions[selectedFunction].swtch.toValue()));
|
||||
fswtchFunc[selectedFunction]->setCurrentIndex(fswtchFunc[selectedFunction]->findData(functions[selectedFunction].func));
|
||||
populateGVmodeCB(fswtchGVmode[selectedFunction], functions[selectedFunction].adjustMode);
|
||||
populateFuncParamCB(fswtchParamT[selectedFunction], functions[selectedFunction].func, functions[selectedFunction].param, functions[selectedFunction].adjustMode);
|
||||
refreshCustomFunction(selectedFunction);
|
||||
lock = false;
|
||||
resetCBsAndRefresh(selectedFunction);
|
||||
emit modified();
|
||||
}
|
||||
}
|
||||
|
||||
void CustomFunctionsPanel::fswDelete()
|
||||
{
|
||||
functions[selectedFunction].clear();
|
||||
// TODO update switch and func
|
||||
lock = true;
|
||||
fswtchSwtch[selectedFunction]->setCurrentIndex(fswtchSwtch[selectedFunction]->findData(functions[selectedFunction].swtch.toValue()));
|
||||
fswtchFunc[selectedFunction]->setCurrentIndex(fswtchFunc[selectedFunction]->findData(functions[selectedFunction].func));
|
||||
refreshCustomFunction(selectedFunction);
|
||||
lock = false;
|
||||
int maxidx = fswCapability - 1;
|
||||
for (int i=selectedFunction; i<maxidx; i++) {
|
||||
if (!functions[i].isEmpty() || !functions[i+1].isEmpty()) {
|
||||
CustomFunctionData *fsw1 = &functions[i];
|
||||
CustomFunctionData *fsw2 = &functions[i+1];
|
||||
memcpy(fsw1, fsw2, sizeof(CustomFunctionData));
|
||||
resetCBsAndRefresh(i);
|
||||
}
|
||||
}
|
||||
functions[maxidx].clear();
|
||||
resetCBsAndRefresh(maxidx);
|
||||
emit modified();
|
||||
}
|
||||
|
||||
@@ -646,34 +642,44 @@ void CustomFunctionsPanel::fswCopy()
|
||||
QByteArray fswData;
|
||||
fswData.append((char*)&functions[selectedFunction], sizeof(CustomFunctionData));
|
||||
QMimeData *mimeData = new QMimeData;
|
||||
mimeData->setData("application/x-companion-fsw", fswData);
|
||||
mimeData->setData(MIMETYPE_FSW, fswData);
|
||||
QApplication::clipboard()->setMimeData(mimeData, QClipboard::Clipboard);
|
||||
}
|
||||
|
||||
void CustomFunctionsPanel::fswCut()
|
||||
{
|
||||
fswCopy();
|
||||
fswDelete();
|
||||
fswClear();
|
||||
}
|
||||
|
||||
void CustomFunctionsPanel::fsw_customContextMenuRequested(QPoint pos)
|
||||
{
|
||||
QLabel *label = (QLabel *)sender();
|
||||
selectedFunction = label->property("index").toInt();
|
||||
QLabel *label = (QLabel *)sender();
|
||||
selectedFunction = label->property("index").toInt();
|
||||
|
||||
QPoint globalPos = label->mapToGlobal(pos);
|
||||
QPoint globalPos = label->mapToGlobal(pos);
|
||||
|
||||
const QClipboard *clipboard = QApplication::clipboard();
|
||||
const QMimeData *mimeData = clipboard->mimeData();
|
||||
bool hasData = mimeData->hasFormat("application/x-companion-fsw");
|
||||
const QClipboard *clipboard = QApplication::clipboard();
|
||||
const QMimeData *mimeData = clipboard->mimeData();
|
||||
bool hasData = mimeData->hasFormat(MIMETYPE_FSW);
|
||||
bool moveUpAllowed = (selectedFunction > 0);
|
||||
bool moveDownAllowed = (selectedFunction < (fswCapability - 1));
|
||||
bool insertAllowed = (selectedFunction < (fswCapability - 1)) && (functions[fswCapability - 1].isEmpty());
|
||||
|
||||
QMenu contextMenu;
|
||||
contextMenu.addAction(CompanionIcon("copy.png"), tr("&Copy"),this,SLOT(fswCopy()));
|
||||
contextMenu.addAction(CompanionIcon("cut.png"), tr("&Cut"),this,SLOT(fswCut()));
|
||||
contextMenu.addAction(CompanionIcon("paste.png"), tr("&Paste"),this,SLOT(fswPaste()))->setEnabled(hasData);
|
||||
contextMenu.addAction(CompanionIcon("clear.png"), tr("&Delete"),this,SLOT(fswDelete()));
|
||||
QMenu contextMenu;
|
||||
contextMenu.addAction(CompanionIcon("copy.png"), tr("Copy"),this,SLOT(fswCopy()));
|
||||
contextMenu.addAction(CompanionIcon("cut.png"), tr("Cut"),this,SLOT(fswCut()));
|
||||
contextMenu.addAction(CompanionIcon("paste.png"), tr("Paste"),this,SLOT(fswPaste()))->setEnabled(hasData);
|
||||
contextMenu.addAction(CompanionIcon("clear.png"), tr("Clear"),this,SLOT(fswClear()));
|
||||
contextMenu.addSeparator();
|
||||
contextMenu.addAction(CompanionIcon("arrow-right.png"), tr("Insert"),this,SLOT(fswInsert()))->setEnabled(insertAllowed);
|
||||
contextMenu.addAction(CompanionIcon("arrow-left.png"), tr("Delete"),this,SLOT(fswDelete()));
|
||||
contextMenu.addAction(CompanionIcon("moveup.png"), tr("Move Up"),this,SLOT(fswMoveUp()))->setEnabled(moveUpAllowed);
|
||||
contextMenu.addAction(CompanionIcon("movedown.png"), tr("Move Down"),this,SLOT(fswMoveDown()))->setEnabled(moveDownAllowed);
|
||||
contextMenu.addSeparator();
|
||||
contextMenu.addAction(CompanionIcon("clear.png"), tr("Clear All"),this,SLOT(fswClearAll()));
|
||||
|
||||
contextMenu.exec(globalPos);
|
||||
contextMenu.exec(globalPos);
|
||||
}
|
||||
|
||||
void CustomFunctionsPanel::populateFuncCB(QComboBox *b, unsigned int value)
|
||||
@@ -755,3 +761,65 @@ void CustomFunctionsPanel::populateFuncParamCB(QComboBox *b, uint function, unsi
|
||||
b->hide();
|
||||
}
|
||||
}
|
||||
|
||||
void CustomFunctionsPanel::fswMoveUp()
|
||||
{
|
||||
swapFuncData(selectedFunction, selectedFunction - 1);
|
||||
}
|
||||
|
||||
void CustomFunctionsPanel::fswMoveDown()
|
||||
{
|
||||
swapFuncData(selectedFunction, selectedFunction + 1);
|
||||
}
|
||||
|
||||
void CustomFunctionsPanel::fswClear()
|
||||
{
|
||||
functions[selectedFunction].clear();
|
||||
resetCBsAndRefresh(selectedFunction);
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void CustomFunctionsPanel::fswClearAll()
|
||||
{
|
||||
for (int i=0; i<fswCapability; i++) {
|
||||
functions[i].clear();
|
||||
resetCBsAndRefresh(i);
|
||||
}
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void CustomFunctionsPanel::fswInsert()
|
||||
{
|
||||
for (int i=(fswCapability - 1); i>selectedFunction; i--) {
|
||||
if (!functions[i].isEmpty() || !functions[i-1].isEmpty()) {
|
||||
memcpy(&functions[i], &functions[i-1], sizeof(CustomFunctionData));
|
||||
resetCBsAndRefresh(i);
|
||||
}
|
||||
}
|
||||
fswClear();
|
||||
}
|
||||
|
||||
void CustomFunctionsPanel::swapFuncData(int idx1, int idx2)
|
||||
{
|
||||
if ((idx1 != idx2) && (!functions[idx1].isEmpty() || !functions[idx2].isEmpty())) {
|
||||
CustomFunctionData fswtmp = functions[idx2];
|
||||
CustomFunctionData *fsw1 = &functions[idx1];
|
||||
CustomFunctionData *fsw2 = &functions[idx2];
|
||||
memcpy(fsw2, fsw1, sizeof(CustomFunctionData));
|
||||
memcpy(fsw1, &fswtmp, sizeof(CustomFunctionData));
|
||||
resetCBsAndRefresh(idx1);
|
||||
resetCBsAndRefresh(idx2);
|
||||
emit modified();
|
||||
}
|
||||
}
|
||||
|
||||
void CustomFunctionsPanel::resetCBsAndRefresh(int idx)
|
||||
{
|
||||
lock = true;
|
||||
fswtchSwtch[idx]->setCurrentIndex(fswtchSwtch[idx]->findData(functions[idx].swtch.toValue()));
|
||||
fswtchFunc[idx]->setCurrentIndex(fswtchFunc[idx]->findData(functions[idx].func));
|
||||
fswtchGVmode[idx]->setCurrentIndex(functions[idx].adjustMode);
|
||||
populateFuncParamCB(fswtchParamT[idx], functions[idx].func, functions[idx].param, functions[idx].adjustMode);
|
||||
refreshCustomFunction(idx);
|
||||
lock = false;
|
||||
}
|
||||
|
||||
@@ -30,6 +30,8 @@ class RawSourceFilterItemModel;
|
||||
class RawSwitchFilterItemModel;
|
||||
class TimerEdit;
|
||||
|
||||
constexpr char MIMETYPE_FSW[] = "application/x-companion-fsw";
|
||||
|
||||
class RepeatComboBox: public QComboBox
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -53,7 +55,7 @@ class CustomFunctionsPanel : public GenericPanel
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
CustomFunctionsPanel(QWidget *parent, ModelData * mode, GeneralSettings & generalSettings, Firmware * firmware);
|
||||
CustomFunctionsPanel(QWidget *parent, ModelData * model, GeneralSettings & generalSettings, Firmware * firmware);
|
||||
~CustomFunctionsPanel();
|
||||
|
||||
virtual void update();
|
||||
@@ -77,11 +79,18 @@ class CustomFunctionsPanel : public GenericPanel
|
||||
void fswCopy();
|
||||
void fswPaste();
|
||||
void fswCut();
|
||||
void fswMoveUp();
|
||||
void fswMoveDown();
|
||||
void fswInsert();
|
||||
void fswClear();
|
||||
void fswClearAll();
|
||||
|
||||
private:
|
||||
void populateFuncCB(QComboBox *b, unsigned int value);
|
||||
void populateGVmodeCB(QComboBox *b, unsigned int value);
|
||||
void populateFuncParamCB(QComboBox *b, uint function, unsigned int value, unsigned int adjustmode=0);
|
||||
void swapFuncData(int idx1, int idx2);
|
||||
void resetCBsAndRefresh(int idx);
|
||||
RawSwitchFilterItemModel * rawSwitchItemModel;
|
||||
RawSourceFilterItemModel * rawSrcAllItemModel;
|
||||
RawSourceFilterItemModel * rawSrcInputsItemModel;
|
||||
@@ -105,6 +114,7 @@ class CustomFunctionsPanel : public GenericPanel
|
||||
QMediaPlayer * mediaPlayer;
|
||||
|
||||
int selectedFunction;
|
||||
int fswCapability;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -527,8 +527,8 @@ void LogicalSwitchesPanel::cswPaste()
|
||||
QByteArray cswData = mimeData->data("application/x-companion-csw");
|
||||
LogicalSwitchData *csw = &model->logicalSw[selectedSwitch];
|
||||
memcpy(csw, cswData.constData(), sizeof(LogicalSwitchData));
|
||||
update();
|
||||
emit modified();
|
||||
updateLine(selectedSwitch);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -195,13 +195,24 @@ ModulePanel::ModulePanel(QWidget * parent, ModelData & model, ModuleData & modul
|
||||
|
||||
ui->label_module->setText(ModuleData::indexToString(moduleIdx, firmware));
|
||||
if (moduleIdx < 0) {
|
||||
if (IS_HORUS(firmware->getBoard())) {
|
||||
if (!IS_TARANIS(firmware->getBoard())) {
|
||||
ui->trainerMode->setItemData(TRAINER_MODE_MASTER_CPPM_EXTERNAL_MODULE, 0, Qt::UserRole - 1);
|
||||
ui->trainerMode->setItemData(TRAINER_MODE_MASTER_SBUS_EXTERNAL_MODULE, 0, Qt::UserRole - 1);
|
||||
}
|
||||
if (generalSettings.auxSerialMode != UART_MODE_SBUS_TRAINER) {
|
||||
ui->trainerMode->setItemData(TRAINER_MODE_MASTER_BATTERY_COMPARTMENT, 0, Qt::UserRole - 1);
|
||||
}
|
||||
else if (generalSettings.auxSerialMode != UART_MODE_SBUS_TRAINER) {
|
||||
ui->trainerMode->setItemData(TRAINER_MODE_MASTER_BATTERY_COMPARTMENT, 0, Qt::UserRole - 1);
|
||||
}
|
||||
|
||||
if (generalSettings.bluetoothMode != 2) {
|
||||
ui->trainerMode->setItemData(TRAINER_MODE_MASTER_BLUETOOTH, 0, Qt::UserRole - 1);
|
||||
ui->trainerMode->setItemData(TRAINER_MODE_SLAVE_BLUETOOTH, 0, Qt::UserRole - 1);
|
||||
}
|
||||
|
||||
if (!IS_JUMPER_T16(firmware->getBoard())) {
|
||||
ui->trainerMode->setItemData(TRAINER_MODE_MULTI, 0, Qt::UserRole - 1);
|
||||
}
|
||||
|
||||
ui->trainerMode->setCurrentIndex(model.trainerMode);
|
||||
if (!IS_HORUS_OR_TARANIS(firmware->getBoard())) {
|
||||
ui->label_trainerMode->hide();
|
||||
@@ -227,6 +238,9 @@ ModulePanel::ModulePanel(QWidget * parent, ModelData & model, ModuleData & modul
|
||||
continue;
|
||||
ui->multiProtocol->addItem(Multiprotocols::protocolToString(i), i);
|
||||
}
|
||||
for (int i=MODULE_SUBTYPE_MULTI_LAST + 1; i <= 124; i++) {
|
||||
ui->multiProtocol->addItem(QString::number(i + 3), i);
|
||||
}
|
||||
|
||||
ui->btnGrpValueType->setId(ui->optPercent, FAILSAFE_DISPLAY_PERCENT);
|
||||
ui->btnGrpValueType->setId(ui->optUs, FAILSAFE_DISPLAY_USEC);
|
||||
@@ -269,7 +283,9 @@ bool ModulePanel::moduleHasFailsafes()
|
||||
(PulsesProtocol)module.protocol == PulsesProtocol::PULSES_ACCESS_R9M ||
|
||||
(PulsesProtocol)module.protocol == PulsesProtocol::PULSES_ACCESS_R9M_LITE ||
|
||||
(PulsesProtocol)module.protocol == PulsesProtocol::PULSES_ACCESS_R9M_LITE_PRO ||
|
||||
(PulsesProtocol)module.protocol == PulsesProtocol::PULSES_XJT_LITE_X16);
|
||||
(PulsesProtocol)module.protocol == PulsesProtocol::PULSES_XJT_LITE_X16 ||
|
||||
(PulsesProtocol)module.protocol == PulsesProtocol::PULSES_MULTIMODULE
|
||||
);
|
||||
}
|
||||
|
||||
void ModulePanel::setupFailsafes()
|
||||
@@ -469,14 +485,14 @@ void ModulePanel::update()
|
||||
break;
|
||||
case PULSES_MULTIMODULE:
|
||||
mask |= MASK_CHANNELS_RANGE | MASK_RX_NUMBER | MASK_MULTIMODULE | MASK_SUBTYPES;
|
||||
max_rx_num = 15;
|
||||
max_rx_num = 63;
|
||||
if (module.multi.rfProtocol == MODULE_SUBTYPE_MULTI_DSM2)
|
||||
mask |= MASK_CHANNELS_COUNT;
|
||||
else
|
||||
module.channelsCount = 16;
|
||||
if (pdef.optionsstr != nullptr)
|
||||
mask |= MASK_MULTIOPTION;
|
||||
if (pdef.hasFailsafe)
|
||||
if (pdef.hasFailsafe || (module.multi.rfProtocol == MODULE_SUBTYPE_MULTI_FRSKY && (module.subType == 0 || module.subType == 2 || module.subType > 3 )))
|
||||
mask |= MASK_FAILSAFES;
|
||||
break;
|
||||
case PULSES_OFF:
|
||||
@@ -565,7 +581,7 @@ void ModulePanel::update()
|
||||
unsigned i = 0;
|
||||
switch(protocol){
|
||||
case PULSES_MULTIMODULE:
|
||||
numEntries = (module.multi.customProto ? 8 : pdef.numSubTypes());
|
||||
numEntries = (module.multi.rfProtocol > MODULE_SUBTYPE_MULTI_LAST ? 8 : pdef.numSubTypes());
|
||||
break;
|
||||
case PULSES_PXX_R9M:
|
||||
if (firmware->getCapability(HasModuleR9MFlex))
|
||||
@@ -587,11 +603,19 @@ void ModulePanel::update()
|
||||
ui->multiProtocol->setVisible(mask & MASK_MULTIMODULE);
|
||||
ui->label_option->setVisible(mask & MASK_MULTIOPTION);
|
||||
ui->optionValue->setVisible(mask & MASK_MULTIOPTION);
|
||||
ui->autoBind->setVisible(mask & MASK_MULTIMODULE);
|
||||
ui->disableTelem->setVisible(mask & MASK_MULTIMODULE);
|
||||
ui->disableChMap->setVisible(mask & MASK_MULTIMODULE);
|
||||
ui->lowPower->setVisible(mask & MASK_MULTIMODULE);
|
||||
ui->autoBind->setVisible(mask & MASK_MULTIMODULE);
|
||||
if (module.multi.rfProtocol == MODULE_SUBTYPE_MULTI_DSM2)
|
||||
ui->autoBind->setText(tr("Autodetect Format"));
|
||||
else
|
||||
ui->autoBind->setText(tr("Bind on channel"));
|
||||
|
||||
if (mask & MASK_MULTIMODULE) {
|
||||
ui->multiProtocol->setCurrentIndex(ui->multiProtocol->findData(module.multi.rfProtocol));
|
||||
ui->disableTelem->setChecked(module.multi.disableTelemetry);
|
||||
ui->disableChMap->setChecked(module.multi.disableMapping);
|
||||
ui->autoBind->setChecked(module.multi.autoBindMode);
|
||||
ui->lowPower->setChecked(module.multi.lowPowerMode);
|
||||
}
|
||||
@@ -763,7 +787,7 @@ void ModulePanel::onMultiProtocolChanged(int index)
|
||||
lock=true;
|
||||
module.multi.rfProtocol = (unsigned int)rfProtocol;
|
||||
unsigned int maxSubTypes = multiProtocols.getProtocol(index).numSubTypes();
|
||||
if (module.multi.customProto)
|
||||
if (rfProtocol > MODULE_SUBTYPE_MULTI_LAST)
|
||||
maxSubTypes=8;
|
||||
module.subType = std::min(module.subType, maxSubTypes -1);
|
||||
module.channelsCount = getMaxChannelCount();
|
||||
@@ -793,10 +817,21 @@ void ModulePanel::onSubTypeChanged()
|
||||
}
|
||||
}
|
||||
|
||||
void ModulePanel::on_disableTelem_stateChanged(int state)
|
||||
{
|
||||
module.multi.disableTelemetry = (state == Qt::Checked);
|
||||
}
|
||||
|
||||
void ModulePanel::on_disableChMap_stateChanged(int state)
|
||||
{
|
||||
module.multi.disableMapping = (state == Qt::Checked);
|
||||
}
|
||||
|
||||
void ModulePanel::on_autoBind_stateChanged(int state)
|
||||
{
|
||||
module.multi.autoBindMode = (state == Qt::Checked);
|
||||
}
|
||||
|
||||
void ModulePanel::on_lowPower_stateChanged(int state)
|
||||
{
|
||||
module.multi.lowPowerMode = (state == Qt::Checked);
|
||||
|
||||
@@ -86,6 +86,8 @@ class ModulePanel : public ModelPanel
|
||||
void onMultiProtocolChanged(int index);
|
||||
void onSubTypeChanged();
|
||||
void on_autoBind_stateChanged(int state);
|
||||
void on_disableChMap_stateChanged(int state);
|
||||
void on_disableTelem_stateChanged(int state);
|
||||
void on_lowPower_stateChanged(int state);
|
||||
void on_r9mPower_currentIndexChanged(int index);
|
||||
void setChannelFailsafeValue(const int channel, const int value, quint8 updtSb = 0);
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>1075</width>
|
||||
<height>434</height>
|
||||
<height>438</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@@ -417,7 +417,6 @@
|
||||
<item>
|
||||
<widget class="QCheckBox" name="autoBind">
|
||||
<property name="text">
|
||||
<string>Bind on startup</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -935,9 +934,24 @@
|
||||
<string>Master/SBUS in battery compartment</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Master/Bluetooth</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Slave/Bluetooth</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Master/Multi</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="0" colspan="2">
|
||||
<item row="11" column="0" colspan="2">
|
||||
<spacer name="horizontalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
@@ -950,6 +964,20 @@
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="7" column="1">
|
||||
<widget class="QCheckBox" name="disableTelem">
|
||||
<property name="text">
|
||||
<string>Disable Telemetry</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="1">
|
||||
<widget class="QCheckBox" name="disableChMap">
|
||||
<property name="text">
|
||||
<string>Disable Ch. Map</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="3">
|
||||
|
||||
@@ -2417,7 +2417,7 @@ If you have a settings backup file, you may import that instead.</source>
|
||||
<message>
|
||||
<location filename="../modeledit/curves.cpp" line="156"/>
|
||||
<source>Popup menu available</source>
|
||||
<translation>Popoup-Menü verfügbar</translation>
|
||||
<translation>Popup-Menü verfügbar</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../modeledit/curves.cpp" line="209"/>
|
||||
@@ -2482,7 +2482,7 @@ If you have a settings backup file, you may import that instead.</source>
|
||||
<message>
|
||||
<location filename="../modeledit/curves.cpp" line="458"/>
|
||||
<source>Not enough free points in EEPROM to store the curve.</source>
|
||||
<translation>Es sind nicht genügend freie Stützstellen im EEPROM vorhanden, um diese Kurve zu abzuspeichern.</translation>
|
||||
<translation>Es sind nicht genügend freie Stützpunkte im EEPROM vorhanden, um diese Kurve zu abzuspeichern.</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user