feat: use any source for expo/weight/offset (#5220)
Co-authored-by: philmoz <phil.a.mitchell@gmail.com> Co-authored-by: 3djc <3djc@gh.com> Co-authored-by: elecpower <elecpower@users.noreply.github.com>
This commit is contained in:
co-authored by
philmoz
3djc
elecpower
parent
326c58a7fd
commit
4b917b762c
@@ -93,7 +93,7 @@
|
||||
#define CPN_STR_SW_INDICATOR_NEUT QCoreApplication::translate("RawSwitch", "-") // Switch neutral (middle) position indicator.
|
||||
#define CPN_STR_SW_INDICATOR_REV QCoreApplication::translate("RawSwitch", "!") // Switch reversed logic (NOT) indicator.
|
||||
|
||||
#define CPN_STR_SRC_INDICATOR_INVERT QCoreApplication::translate("RawSource", "!") // Source inverted logic indicator.
|
||||
#define CPN_STR_SRC_INDICATOR_NEG QCoreApplication::translate("RawSource", "-") // Source negative value indicator.
|
||||
|
||||
#define EDGETX_HOME_PAGE_URL "https://edgetx.org"
|
||||
|
||||
|
||||
@@ -222,8 +222,6 @@ CurveRefFilteredFactory::CurveRefFilteredFactory(CompoundItemModelFactory * shar
|
||||
|
||||
registerItemModel(new FilteredItemModel(sharedItemModels->getItemModel(AbstractItemModel::IMID_Curve), curveFlags),
|
||||
fidToString(CRFIM_CURVE), CRFIM_CURVE);
|
||||
registerItemModel(new FilteredItemModel(sharedItemModels->getItemModel(AbstractItemModel::IMID_GVarRef), gvarRefFlags),
|
||||
fidToString(CRFIM_GVARREF), CRFIM_GVARREF);
|
||||
registerItemModel(new FilteredItemModel(sharedItemModels->getItemModel(AbstractItemModel::IMID_CurveRefType)),
|
||||
fidToString(CRFIM_TYPE), CRFIM_TYPE);
|
||||
registerItemModel(new FilteredItemModel(sharedItemModels->getItemModel(AbstractItemModel::IMID_CurveRefFunc)),
|
||||
|
||||
@@ -28,6 +28,7 @@ set(${PROJECT_NAME}_NAMES
|
||||
rawsource
|
||||
rawswitch
|
||||
sensordata
|
||||
sourcenumref
|
||||
telem_data
|
||||
timerdata
|
||||
ersky9x/ersky9xeeprom
|
||||
|
||||
@@ -19,14 +19,16 @@
|
||||
*/
|
||||
|
||||
#include "curvereference.h"
|
||||
#include "adjustmentreference.h"
|
||||
#include "helpers.h"
|
||||
#include "modeldata.h"
|
||||
#include "generalsettings.h"
|
||||
#include "filtereditemmodels.h"
|
||||
#include "curveimagewidget.h"
|
||||
#include "curvedialog.h"
|
||||
#include "sourcenumref.h"
|
||||
|
||||
const QString CurveReference::toString(const ModelData * model, bool verbose) const
|
||||
const QString CurveReference::toString(const ModelData * model, bool verbose, const GeneralSettings * const generalSettings,
|
||||
Board::Type board, bool prefixCustomName) const
|
||||
{
|
||||
if (value == 0)
|
||||
return CPN_STR_NONE_ITEM;
|
||||
@@ -37,7 +39,7 @@ const QString CurveReference::toString(const ModelData * model, bool verbose) co
|
||||
switch(type) {
|
||||
case CURVE_REF_DIFF:
|
||||
case CURVE_REF_EXPO:
|
||||
ret = AdjustmentReference(value).toString(model);
|
||||
ret = SourceNumRef(value).toString(model, generalSettings, board, prefixCustomName);
|
||||
break;
|
||||
case CURVE_REF_FUNC:
|
||||
ret = functionToString(value);
|
||||
@@ -48,7 +50,7 @@ const QString CurveReference::toString(const ModelData * model, bool verbose) co
|
||||
else
|
||||
ret = CurveData().nameToString(idx);
|
||||
if (value < 0)
|
||||
ret.prepend(CPN_STR_SW_INDICATOR_REV);
|
||||
ret.prepend(CPN_STR_SRC_INDICATOR_NEG);
|
||||
break;
|
||||
default:
|
||||
return CPN_STR_UNKNOWN_ITEM;
|
||||
@@ -62,7 +64,7 @@ const QString CurveReference::toString(const ModelData * model, bool verbose) co
|
||||
|
||||
const bool CurveReference::isValueNumber() const
|
||||
{
|
||||
return (type == CURVE_REF_DIFF || type == CURVE_REF_EXPO) && AdjustmentReference(value).type == AdjustmentReference::ADJUST_REF_VALUE;
|
||||
return (type == CURVE_REF_DIFF || type == CURVE_REF_EXPO) && SourceNumRef(value).isNumber();
|
||||
}
|
||||
|
||||
const bool CurveReference::isAvailable() const
|
||||
@@ -74,7 +76,7 @@ const bool CurveReference::isAvailable() const
|
||||
int CurveReference::getDefaultValue(const CurveRefType type, const bool isGVar)
|
||||
{
|
||||
if (isGVar && (type == CURVE_REF_DIFF || type == CURVE_REF_EXPO))
|
||||
return AdjustmentReference(AdjustmentReference::ADJUST_REF_GVAR, 1).toValue();
|
||||
return SourceNumRef(SOURCE_TYPE_GVAR, 1).toValue();
|
||||
else if (type == CURVE_REF_FUNC)
|
||||
return 1;
|
||||
else
|
||||
@@ -146,54 +148,50 @@ int CurveReference::functionCount()
|
||||
* CurveReferenceUIManager
|
||||
*/
|
||||
|
||||
CurveReferenceUIManager::CurveReferenceUIManager(QComboBox * curveTypeCB, QCheckBox * curveGVarCB, QSpinBox * curveValueSB,
|
||||
QComboBox * curveValueCB, QLabel * curveLabelImage,
|
||||
CurveReferenceUIManager::CurveReferenceUIManager(QComboBox * cboType, QCheckBox * chkUseSource, QSpinBox * sbxValue,
|
||||
QComboBox * cboSource, QComboBox * cboCurveFunc, CurveImageWidget * curveImage,
|
||||
CurveReference & curveRef, ModelData & model, CompoundItemModelFactory * sharedItemModels,
|
||||
CurveRefFilteredFactory * curveRefFilteredFactory, QObject * parent) :
|
||||
CurveRefFilteredFactory * curveRefFilteredFactory, FilteredItemModel * sourceItemModel,
|
||||
QObject * parent) :
|
||||
QObject(parent),
|
||||
curveTypeCB(curveTypeCB),
|
||||
curveGVarCB(curveGVarCB),
|
||||
curveValueSB(curveValueSB),
|
||||
curveValueCB(curveValueCB),
|
||||
cboType(cboType),
|
||||
chkUseSource(chkUseSource),
|
||||
sbxValue(sbxValue),
|
||||
cboSource(cboSource),
|
||||
cboCurveFunc(cboCurveFunc),
|
||||
curveImage(curveImage),
|
||||
curveRef(curveRef),
|
||||
model(model),
|
||||
sharedItemModels(sharedItemModels),
|
||||
filteredModelFactory(curveRefFilteredFactory),
|
||||
lock(false),
|
||||
curveImageWidget(nullptr)
|
||||
srcNumRefEditor(nullptr)
|
||||
{
|
||||
connectItemModelEvents(filteredModelFactory->getItemModel(CurveRefFilteredFactory::CRFIM_CURVE));
|
||||
|
||||
hasCapabilityGvars = getCurrentFirmware()->getCapability(Gvars);
|
||||
if (chkUseSource || sbxValue || cboSource)
|
||||
srcNumRefEditor = new SourceNumRefEditor(curveRef.value, chkUseSource, sbxValue, cboSource, 0, -100, 100, 1, model, sourceItemModel);
|
||||
|
||||
if (curveTypeCB) {
|
||||
curveTypeCB->setModel(filteredModelFactory->getItemModel(CurveRefFilteredFactory::CRFIM_TYPE));
|
||||
curveTypeCB->setCurrentIndex(curveTypeCB->findData((int)curveRef.type));
|
||||
connect(curveTypeCB, SIGNAL(currentIndexChanged(int)), this, SLOT(typeChanged(int)));
|
||||
if (cboType) {
|
||||
cboType->setSizeAdjustPolicy(QComboBox::AdjustToContents);
|
||||
cboType->setModel(filteredModelFactory->getItemModel(CurveRefFilteredFactory::CRFIM_TYPE));
|
||||
cboType->setCurrentIndex(cboType->findData((int)curveRef.type));
|
||||
connect(cboType, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &CurveReferenceUIManager::cboTypeChanged);
|
||||
}
|
||||
|
||||
if (curveGVarCB)
|
||||
connect(curveGVarCB, SIGNAL(stateChanged(int)), this, SLOT(gvarCBChanged(int)));
|
||||
|
||||
if (curveValueSB) {
|
||||
curveValueSB->setMinimum(-100);
|
||||
curveValueSB->setMaximum(100);
|
||||
connect(curveValueSB, SIGNAL(editingFinished()), this, SLOT(valueSBChanged()));
|
||||
}
|
||||
|
||||
if (curveValueCB) {
|
||||
curveValueCB->setSizeAdjustPolicy(QComboBox::AdjustToContents);
|
||||
curveValueCB->setMaxVisibleItems(10);
|
||||
connect(curveValueCB, SIGNAL(currentIndexChanged(int)), this, SLOT(valueCBChanged()));
|
||||
|
||||
if (curveLabelImage) {
|
||||
curveImageWidget = qobject_cast<CurveImageWidget *>(curveLabelImage);
|
||||
if (curveImageWidget) {
|
||||
curveImageWidget->set(&model, getCurrentFirmware(), sharedItemModels, abs(curveRef.value) - 1, Qt::black, 3);
|
||||
curveImageWidget->setGrid(Qt::gray, 2);
|
||||
connect(curveImageWidget, &CurveImageWidget::doubleClicked, this, &CurveReferenceUIManager::curveImageDoubleClicked);
|
||||
}
|
||||
if (cboCurveFunc) {
|
||||
if (!cboType) {
|
||||
cboCurveFunc->setModel(filteredModelFactory->getItemModel(CurveRefFilteredFactory::CRFIM_CURVE));
|
||||
cboCurveFunc->setCurrentIndex(cboCurveFunc->findData(curveRef.value));
|
||||
}
|
||||
cboCurveFunc->setSizeAdjustPolicy(QComboBox::AdjustToContents);
|
||||
cboCurveFunc->setMaxVisibleItems(10);
|
||||
connect(cboCurveFunc, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &CurveReferenceUIManager::cboCurveFuncChanged);
|
||||
}
|
||||
|
||||
if (curveImage) {
|
||||
curveImage->set(&model, getCurrentFirmware(), sharedItemModels, curveRef.value, Qt::black, 3);
|
||||
curveImage->setGrid(Qt::gray, 2);
|
||||
connect(curveImage, &CurveImageWidget::doubleClicked, this, &CurveReferenceUIManager::curveImageDoubleClicked);
|
||||
}
|
||||
|
||||
update();
|
||||
@@ -201,10 +199,10 @@ CurveReferenceUIManager::CurveReferenceUIManager(QComboBox * curveTypeCB, QCheck
|
||||
|
||||
CurveReferenceUIManager::~CurveReferenceUIManager()
|
||||
{
|
||||
|
||||
delete srcNumRefEditor;
|
||||
}
|
||||
|
||||
#define CURVE_REF_UI_GVAR_SHOW (1 << 0)
|
||||
#define CURVE_REF_UI_SRC_SHOW (1 << 0)
|
||||
#define CURVE_REF_UI_VALUE_SHOW (1 << 1)
|
||||
#define CURVE_REF_UI_REF_SHOW (1 << 2)
|
||||
#define CURVE_REF_UI_CURVE_SHOW (1 << 3)
|
||||
@@ -212,89 +210,72 @@ CurveReferenceUIManager::~CurveReferenceUIManager()
|
||||
void CurveReferenceUIManager::update()
|
||||
{
|
||||
lock = true;
|
||||
|
||||
if (srcNumRefEditor)
|
||||
srcNumRefEditor->setLock(true);
|
||||
|
||||
int widgetsMask = 0;
|
||||
|
||||
if (curveRef.type == CurveReference::CURVE_REF_DIFF || curveRef.type == CurveReference::CURVE_REF_EXPO) {
|
||||
if (hasCapabilityGvars)
|
||||
widgetsMask |= CURVE_REF_UI_GVAR_SHOW;
|
||||
if (curveRef.isValueNumber()) {
|
||||
curveGVarCB->setChecked(false);
|
||||
curveValueSB->setValue(curveRef.value);
|
||||
widgetsMask |= CURVE_REF_UI_VALUE_SHOW;
|
||||
if (srcNumRefEditor) {
|
||||
if (curveRef.type == CurveReference::CURVE_REF_DIFF || curveRef.type == CurveReference::CURVE_REF_EXPO) {
|
||||
srcNumRefEditor->setVisible(true);
|
||||
srcNumRefEditor->update();
|
||||
}
|
||||
else {
|
||||
curveGVarCB->setChecked(true);
|
||||
srcNumRefEditor->setVisible(false);
|
||||
widgetsMask |= CURVE_REF_UI_REF_SHOW;
|
||||
}
|
||||
}
|
||||
else {
|
||||
else
|
||||
widgetsMask |= CURVE_REF_UI_REF_SHOW;
|
||||
}
|
||||
|
||||
if (curveRef.type == CurveReference::CURVE_REF_CUSTOM)
|
||||
if (curveRef.type == CurveReference::CURVE_REF_CUSTOM && curveRef.value != 0)
|
||||
widgetsMask |= CURVE_REF_UI_CURVE_SHOW;
|
||||
|
||||
if (cboType)
|
||||
cboType->setCurrentIndex(cboType->findData(curveRef.type));
|
||||
|
||||
if (curveTypeCB) {
|
||||
curveTypeCB->setCurrentIndex(curveTypeCB->findData(curveRef.type));
|
||||
curveTypeCB->show();
|
||||
}
|
||||
|
||||
if (curveGVarCB)
|
||||
curveGVarCB->setVisible(widgetsMask & CURVE_REF_UI_GVAR_SHOW);
|
||||
|
||||
if (curveValueSB)
|
||||
curveValueSB->setVisible(widgetsMask & CURVE_REF_UI_VALUE_SHOW);
|
||||
|
||||
if (curveValueCB) {
|
||||
if (cboCurveFunc) {
|
||||
if (curveRef.isValueReference())
|
||||
populateValueCB(curveValueCB);
|
||||
curveValueCB->setVisible(widgetsMask & CURVE_REF_UI_REF_SHOW);
|
||||
populateValueCB(cboCurveFunc);
|
||||
cboCurveFunc->setVisible(widgetsMask & CURVE_REF_UI_REF_SHOW);
|
||||
}
|
||||
|
||||
if (curveValueCB && curveImageWidget) {
|
||||
curveImageWidget->draw();
|
||||
curveImageWidget->setVisible(widgetsMask & CURVE_REF_UI_CURVE_SHOW);
|
||||
if (curveImage) {
|
||||
if (widgetsMask & CURVE_REF_UI_CURVE_SHOW) {
|
||||
curveImage->setIndex(curveRef.value);
|
||||
if (abs(curveRef.value) > 0 && abs(curveRef.value) <= CPN_MAX_CURVES)
|
||||
curveImage->setPen(colors[abs(curveRef.value) - 1], 3);
|
||||
else
|
||||
curveImage->setPen(Qt::black, 3);
|
||||
}
|
||||
curveImage->draw();
|
||||
curveImage->setVisible(widgetsMask & CURVE_REF_UI_CURVE_SHOW);
|
||||
}
|
||||
|
||||
emit resized();
|
||||
|
||||
if (srcNumRefEditor)
|
||||
srcNumRefEditor->setLock(false);
|
||||
|
||||
lock = false;
|
||||
}
|
||||
|
||||
void CurveReferenceUIManager::gvarCBChanged(int state)
|
||||
void CurveReferenceUIManager::cboTypeChanged(int index)
|
||||
{
|
||||
if (!lock) {
|
||||
curveRef.value = CurveReference::getDefaultValue(curveRef.type, state);
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
void CurveReferenceUIManager::typeChanged(int value)
|
||||
{
|
||||
if (!lock) {
|
||||
CurveReference::CurveRefType type = (CurveReference::CurveRefType)curveTypeCB->itemData(curveTypeCB->currentIndex()).toInt();
|
||||
CurveReference::CurveRefType type = (CurveReference::CurveRefType)cboType->itemData(index).toInt();
|
||||
curveRef = CurveReference(type, CurveReference::getDefaultValue(type));
|
||||
if (curveImageWidget && curveRef.type == CurveReference::CURVE_REF_CUSTOM)
|
||||
curveImageWidget->setIndex(abs(curveRef.value) - 1);
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
void CurveReferenceUIManager::valueSBChanged()
|
||||
void CurveReferenceUIManager::cboCurveFuncChanged(int index)
|
||||
{
|
||||
if (!lock) {
|
||||
curveRef.value = curveValueSB->value();
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
void CurveReferenceUIManager::valueCBChanged()
|
||||
{
|
||||
if (!lock) {
|
||||
curveRef.value = curveValueCB->itemData(curveValueCB->currentIndex()).toInt();
|
||||
if (curveImageWidget && curveRef.type == CurveReference::CURVE_REF_CUSTOM)
|
||||
curveImageWidget->setIndex(abs(curveRef.value) - 1);
|
||||
if (!cboType)
|
||||
curveRef.type = CurveReference::CURVE_REF_CUSTOM;
|
||||
curveRef.value = cboCurveFunc->itemData(index).toInt();
|
||||
update();
|
||||
}
|
||||
}
|
||||
@@ -303,10 +284,6 @@ void CurveReferenceUIManager::populateValueCB(QComboBox * cb)
|
||||
{
|
||||
if (cb) {
|
||||
switch (curveRef.type) {
|
||||
case CurveReference::CURVE_REF_DIFF:
|
||||
case CurveReference::CURVE_REF_EXPO:
|
||||
cb->setModel(filteredModelFactory->getItemModel(CurveRefFilteredFactory::CRFIM_GVARREF));
|
||||
break;
|
||||
case CurveReference::CURVE_REF_FUNC:
|
||||
cb->setModel(filteredModelFactory->getItemModel(CurveRefFilteredFactory::CRFIM_FUNC));
|
||||
break;
|
||||
@@ -324,7 +301,7 @@ void CurveReferenceUIManager::populateValueCB(QComboBox * cb)
|
||||
void CurveReferenceUIManager::curveImageDoubleClicked()
|
||||
{
|
||||
if (curveRef.type == CurveReference::CURVE_REF_CUSTOM && abs(curveRef.value) > 0)
|
||||
curveImageWidget->edit();
|
||||
curveImage->edit();
|
||||
}
|
||||
|
||||
void CurveReferenceUIManager::connectItemModelEvents(const FilteredItemModel * itemModel)
|
||||
|
||||
@@ -20,6 +20,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "rawsource.h"
|
||||
|
||||
#include <QtCore>
|
||||
#include <QComboBox>
|
||||
#include <QCheckBox>
|
||||
@@ -27,11 +29,13 @@
|
||||
#include <QSpinBox>
|
||||
#include <QStandardItemModel>
|
||||
|
||||
class GeneralSettings;
|
||||
class ModelData;
|
||||
class CurveRefFilteredFactory;
|
||||
class CompoundItemModelFactory;
|
||||
class FilteredItemModel;
|
||||
class CurveImageWidget;
|
||||
class SourceNumRefEditor;
|
||||
|
||||
class CurveReference {
|
||||
|
||||
@@ -64,7 +68,8 @@ class CurveReference {
|
||||
const bool isSet() const { return !isEmpty(); }
|
||||
const bool isValueNumber() const;
|
||||
const bool isValueReference() const { return !isValueNumber(); }
|
||||
const QString toString(const ModelData * model = nullptr, bool verbose = true) const;
|
||||
const QString toString(const ModelData * model = nullptr, bool verbose = true, const GeneralSettings * const generalSettings = nullptr,
|
||||
Board::Type board = Board::BOARD_UNKNOWN, bool prefixCustomName = true) const;
|
||||
const bool isAvailable() const;
|
||||
|
||||
CurveRefType type;
|
||||
@@ -91,13 +96,17 @@ class CurveReferenceUIManager : public QObject {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit CurveReferenceUIManager(QComboBox *curveTypeCB, QCheckBox *curveGVarCB, QSpinBox *curveValueSB, QComboBox *curveValueCB,
|
||||
QLabel *curveImage, CurveReference & curve, ModelData & model, CompoundItemModelFactory * sharedItemModels,
|
||||
CurveRefFilteredFactory * curveRefFilteredFactory, QObject * parent = nullptr);
|
||||
explicit CurveReferenceUIManager(QComboBox * cboType, QCheckBox * chkUseSource, QSpinBox * sbxValue, QComboBox * cboSource,
|
||||
QComboBox * cboCurveFunc, CurveImageWidget * curveImage, CurveReference & curveRef,
|
||||
ModelData & model, CompoundItemModelFactory * sharedItemModels,
|
||||
CurveRefFilteredFactory * curveRefFilteredFactory, FilteredItemModel * sourceItemModel,
|
||||
QObject * parent = nullptr);
|
||||
|
||||
explicit CurveReferenceUIManager(QComboBox *curveValueCB, CurveReference & curve, ModelData & model, CompoundItemModelFactory * sharedItemModels,
|
||||
CurveRefFilteredFactory * curveRefFilteredFactory, QObject * parent = nullptr) :
|
||||
CurveReferenceUIManager(nullptr, nullptr, nullptr, curveValueCB, nullptr, curve, model, sharedItemModels, curveRefFilteredFactory, parent) {}
|
||||
explicit CurveReferenceUIManager(QComboBox *cboCurveFunc, CurveImageWidget * curveImage, CurveReference & curveRef, ModelData & model,
|
||||
CompoundItemModelFactory * sharedItemModels, CurveRefFilteredFactory * curveRefFilteredFactory,
|
||||
QObject * parent = nullptr) :
|
||||
CurveReferenceUIManager(nullptr, nullptr, nullptr, nullptr, cboCurveFunc, curveImage, curveRef, model, sharedItemModels,
|
||||
curveRefFilteredFactory, nullptr, parent) {}
|
||||
|
||||
virtual ~CurveReferenceUIManager();
|
||||
|
||||
@@ -105,28 +114,25 @@ class CurveReferenceUIManager : public QObject {
|
||||
void resized();
|
||||
|
||||
protected slots:
|
||||
void gvarCBChanged(int);
|
||||
void typeChanged(int);
|
||||
void valueSBChanged();
|
||||
void valueCBChanged();
|
||||
void cboTypeChanged(int);
|
||||
void cboCurveFuncChanged(int);
|
||||
void update();
|
||||
void curveImageDoubleClicked();
|
||||
void onItemModelAboutToBeUpdated();
|
||||
void onItemModelUpdateComplete();
|
||||
|
||||
private:
|
||||
QComboBox *curveTypeCB;
|
||||
QCheckBox *curveGVarCB;
|
||||
QSpinBox *curveValueSB;
|
||||
QComboBox *curveValueCB;
|
||||
CurveReference & curveRef;
|
||||
ModelData & model;
|
||||
CompoundItemModelFactory *sharedItemModels;
|
||||
QComboBox *cboType;
|
||||
QCheckBox *chkUseSource;
|
||||
QSpinBox *sbxValue;
|
||||
QComboBox *cboSource;
|
||||
QComboBox *cboCurveFunc;
|
||||
CurveImageWidget *curveImage;
|
||||
CurveReference &curveRef;
|
||||
ModelData &model;
|
||||
CurveRefFilteredFactory *filteredModelFactory;
|
||||
bool lock;
|
||||
CurveImageWidget *curveImageWidget = nullptr;
|
||||
|
||||
bool hasCapabilityGvars;
|
||||
SourceNumRefEditor *srcNumRefEditor;
|
||||
|
||||
void connectItemModelEvents(const FilteredItemModel * itemModel);
|
||||
void populateValueCB(QComboBox * cb);
|
||||
|
||||
@@ -35,8 +35,8 @@ Node convert<ExpoData>::encode(const ExpoData& rhs)
|
||||
node["chn"] = rhs.chn;
|
||||
node["swtch"] = rhs.swtch;
|
||||
node["flightModes"] = YamlWriteFlightModes(rhs.flightModes);
|
||||
node["weight"] = YamlWriteMixWeight(rhs.weight);
|
||||
node["offset"] = YamlWriteMixWeight(rhs.offset);
|
||||
node["weight"] = YamlSourceNumRefEncode(rhs.weight);
|
||||
node["offset"] = YamlSourceNumRefEncode(rhs.offset);
|
||||
node["curve"] = rhs.curve;
|
||||
node["trimSource"] = rhs.carryTrim; // temporary for 2.8.1, trimSource in 2.9
|
||||
node["name"] = rhs.name;
|
||||
@@ -54,10 +54,10 @@ bool convert<ExpoData>::decode(const Node& node, ExpoData& rhs)
|
||||
rhs.flightModes = YamlReadFlightModes(node["flightModes"]);
|
||||
}
|
||||
if (node["weight"]) {
|
||||
rhs.weight = YamlReadMixWeight(node["weight"]);
|
||||
rhs.weight = YamlSourceNumRefDecode(node["weight"]);
|
||||
}
|
||||
if (node["offset"]) {
|
||||
rhs.offset = YamlReadMixWeight(node["offset"]);
|
||||
rhs.offset = YamlSourceNumRefDecode(node["offset"]);
|
||||
}
|
||||
node["curve"] >> rhs.curve;
|
||||
if (node["carryTrim"]) { // 2.9 - change bugged carryTrim to trimSource
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include "yaml_rawswitch.h"
|
||||
#include "yaml_rawsource.h"
|
||||
#include "curvereference.h"
|
||||
#include "sourcenumref.h"
|
||||
|
||||
static const YamlLookupTable mixMultiplexLut = {
|
||||
{ MLTPX_ADD, "ADD" },
|
||||
@@ -32,46 +33,55 @@ static const YamlLookupTable mixMultiplexLut = {
|
||||
#define GVAR_SMALL 128
|
||||
#define CPN_GV1 1024
|
||||
|
||||
int32_t YamlReadMixWeight(const YAML::Node& node)
|
||||
int32_t YamlSourceNumRefDecode(const YAML::Node& node)
|
||||
{
|
||||
std::string val = node.as<std::string>();
|
||||
if ((val.size() >= 4)
|
||||
|
||||
if (modelSettingsVersion < SemanticVersion(QString("2.11.0"))) {
|
||||
if ((val.size() >= 4)
|
||||
&& (val[0] == '-')
|
||||
&& (val[1] == 'G')
|
||||
&& (val[2] == 'V')
|
||||
&& (val[3] >= '1')
|
||||
&& (val[3] <= '9')) {
|
||||
|
||||
return -10000 - std::stoi(val.substr(3));
|
||||
}
|
||||
std::stringstream src(val.substr(3));
|
||||
int gv = 0;
|
||||
src >> gv;
|
||||
return RawSource(SOURCE_TYPE_GVAR, gv).toValue() * -1;
|
||||
}
|
||||
|
||||
if ((val.size() >= 3)
|
||||
if ((val.size() >= 3)
|
||||
&& (val[0] == 'G')
|
||||
&& (val[1] == 'V')
|
||||
&& (val[2] >= '1')
|
||||
&& (val[2] <= '9')) {
|
||||
|
||||
return 10000 + std::stoi(val.substr(2));
|
||||
std::stringstream src(val.substr(2));
|
||||
int gv = 0;
|
||||
src >> gv;
|
||||
return RawSource(SOURCE_TYPE_GVAR, gv).toValue();
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
return std::stoi(val);
|
||||
} catch(...) {
|
||||
throw YAML::TypedBadConversion<int>(node.Mark());
|
||||
}
|
||||
int i = val[0] == '-' ? 1 : 0;
|
||||
|
||||
if (val[i] >= '0' && val[i] <= '9')
|
||||
try {
|
||||
return std::stoi(val);
|
||||
} catch(...) {
|
||||
throw YAML::TypedBadConversion<int>(node.Mark());
|
||||
}
|
||||
else
|
||||
return YamlRawSourceDecode(val).toValue();
|
||||
}
|
||||
|
||||
std::string YamlWriteMixWeight(int32_t sval)
|
||||
std::string YamlSourceNumRefEncode(int32_t sval)
|
||||
{
|
||||
if (sval < -10000) {
|
||||
int n = -sval - 10000;
|
||||
return std::string("-GV") + std::to_string(n);
|
||||
} else if (sval > 10000) {
|
||||
int n = sval - 10000;
|
||||
return std::string("GV") + std::to_string(n);
|
||||
}
|
||||
|
||||
return std::to_string(sval);
|
||||
if (SourceNumRef(sval).isNumber())
|
||||
return std::to_string(sval);
|
||||
else
|
||||
return YamlRawSourceEncode(RawSource(sval));
|
||||
}
|
||||
|
||||
uint32_t YamlReadFlightModes(const YAML::Node& node)
|
||||
@@ -108,7 +118,7 @@ Node convert<CurveReference>::encode(const CurveReference& rhs)
|
||||
{
|
||||
Node node;
|
||||
node["type"] = (int)rhs.type;
|
||||
node["value"] = YamlWriteMixWeight(rhs.value);
|
||||
node["value"] = YamlSourceNumRefEncode(rhs.value);
|
||||
return node;
|
||||
}
|
||||
|
||||
@@ -119,7 +129,7 @@ bool convert<CurveReference>::decode(const Node& node, CurveReference& rhs)
|
||||
node["type"] >> type;
|
||||
rhs.type = (CurveReference::CurveRefType)type;
|
||||
if (node["value"]) {
|
||||
rhs.value = YamlReadMixWeight(node["value"]);
|
||||
rhs.value = YamlSourceNumRefDecode(node["value"]);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -129,7 +139,7 @@ Node convert<MixData>::encode(const MixData& rhs)
|
||||
Node node;
|
||||
node["destCh"] = rhs.destCh - 1;
|
||||
node["srcRaw"] = rhs.srcRaw;
|
||||
node["weight"] = YamlWriteMixWeight(rhs.weight);
|
||||
node["weight"] = YamlSourceNumRefEncode(rhs.weight);
|
||||
node["swtch"] = rhs.swtch;
|
||||
node["curve"] = rhs.curve;
|
||||
node["delayUp"] = rhs.delayUp;
|
||||
@@ -141,7 +151,7 @@ Node convert<MixData>::encode(const MixData& rhs)
|
||||
node["mltpx"] = rhs.mltpx;
|
||||
node["mixWarn"] = rhs.mixWarn;
|
||||
node["flightModes"] = YamlWriteFlightModes(rhs.flightModes);
|
||||
node["offset"] = YamlWriteMixWeight(rhs.sOffset);
|
||||
node["offset"] = YamlSourceNumRefEncode(rhs.sOffset);
|
||||
node["name"] = rhs.name;
|
||||
return node;
|
||||
}
|
||||
@@ -151,7 +161,7 @@ bool convert<MixData>::decode(const Node& node, MixData& rhs)
|
||||
node["destCh"] >> ioffset_int((int&)rhs.destCh, -1);
|
||||
node["srcRaw"] >> rhs.srcRaw;
|
||||
if (node["weight"]) {
|
||||
rhs.weight = YamlReadMixWeight(node["weight"]);
|
||||
rhs.weight = YamlSourceNumRefDecode(node["weight"]);
|
||||
}
|
||||
node["swtch"] >> rhs.swtch;
|
||||
node["curve"] >> rhs.curve;
|
||||
@@ -167,7 +177,7 @@ bool convert<MixData>::decode(const Node& node, MixData& rhs)
|
||||
rhs.flightModes = YamlReadFlightModes(node["flightModes"]);
|
||||
}
|
||||
if (node["offset"]) {
|
||||
rhs.sOffset = YamlReadMixWeight(node["offset"]);
|
||||
rhs.sOffset = YamlSourceNumRefDecode(node["offset"]);
|
||||
}
|
||||
node["name"] >> rhs.name;
|
||||
return true;
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
#include "yaml_ops.h"
|
||||
#include "mixdata.h"
|
||||
|
||||
int32_t YamlReadMixWeight(const YAML::Node& node);
|
||||
std::string YamlWriteMixWeight(int32_t sval);
|
||||
int32_t YamlSourceNumRefDecode(const YAML::Node& node);
|
||||
std::string YamlSourceNumRefEncode(int32_t sval);
|
||||
|
||||
uint32_t YamlReadFlightModes(const YAML::Node& node);
|
||||
std::string YamlWriteFlightModes(uint32_t val);
|
||||
|
||||
@@ -546,6 +546,7 @@ struct convert<LimitData> {
|
||||
node["symetrical"] = (int)rhs.symetrical;
|
||||
node["name"] = rhs.name;
|
||||
node["curve"] = rhs.curve.value;
|
||||
// rhs.curve.type is not encoded
|
||||
return node;
|
||||
}
|
||||
|
||||
@@ -565,6 +566,7 @@ struct convert<LimitData> {
|
||||
node["symetrical"] >> rhs.symetrical;
|
||||
node["name"] >> rhs.name;
|
||||
node["curve"] >> rhs.curve.value;
|
||||
rhs.curve.type = CurveReference::CURVE_REF_CUSTOM; // this is not encoded but needed internally so force type
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -25,6 +25,8 @@
|
||||
#include "opentxeeprom.h"
|
||||
#include "customdebug.h"
|
||||
#include "opentxinterface.h"
|
||||
#include "sourcenumref.h"
|
||||
#include "adjustmentreference.h"
|
||||
|
||||
using namespace Board;
|
||||
|
||||
@@ -805,6 +807,11 @@ class CurveReferenceField: public TransformedField {
|
||||
{
|
||||
curve.type = (CurveReference::CurveRefType)_curve_type;
|
||||
curve.value = smallGvarExport(_curve_value);
|
||||
// 2,11 num or gvar changed to SourceNumRef
|
||||
if ((curve.type == CurveReference::CURVE_REF_DIFF || curve.type == CurveReference::CURVE_REF_EXPO) &&
|
||||
AdjustmentReference(curve.value).type == AdjustmentReference::ADJUST_REF_GVAR)
|
||||
curve.value = RawSource(SOURCE_TYPE_GVAR, AdjustmentReference(curve.value).value).toValue();
|
||||
|
||||
qCDebug(eepromImport) << QString("imported CurveReference(%1)").arg(curve.toString());
|
||||
}
|
||||
|
||||
@@ -1114,8 +1121,20 @@ class MixField: public TransformedField {
|
||||
}
|
||||
}
|
||||
|
||||
// 2.11
|
||||
if ((mix.curve.type == CurveReference::CURVE_REF_DIFF || mix.curve.type == CurveReference::CURVE_REF_EXPO) &&
|
||||
AdjustmentReference(mix.curve.value).type == AdjustmentReference::ADJUST_REF_GVAR)
|
||||
mix.curve.value = RawSource(SOURCE_TYPE_GVAR, AdjustmentReference(mix.curve.value).value).toValue();
|
||||
|
||||
importGvarParam(mix.weight, _weight, version);
|
||||
// 2.11
|
||||
if (AdjustmentReference(mix.weight).type == AdjustmentReference::ADJUST_REF_GVAR)
|
||||
mix.weight = RawSource(SOURCE_TYPE_GVAR, AdjustmentReference(mix.weight).value).toValue();
|
||||
|
||||
importGvarParam(mix.sOffset, _offset, version);
|
||||
// 2.11
|
||||
if (AdjustmentReference(mix.sOffset).type == AdjustmentReference::ADJUST_REF_GVAR)
|
||||
mix.sOffset = RawSource(SOURCE_TYPE_GVAR, AdjustmentReference(mix.sOffset).value).toValue();
|
||||
|
||||
qCDebug(eepromImport) << QString("imported %1: ch %2, name '%3'").arg(internalField.getName()).arg(mix.destCh).arg(mix.name);
|
||||
}
|
||||
@@ -1222,9 +1241,15 @@ class InputField: public TransformedField {
|
||||
}
|
||||
|
||||
expo.weight = smallGvarExport(_weight);
|
||||
// 2.11
|
||||
if (AdjustmentReference(expo.weight).type == AdjustmentReference::ADJUST_REF_GVAR)
|
||||
expo.weight = RawSource(SOURCE_TYPE_GVAR, AdjustmentReference(expo.weight).value).toValue();
|
||||
|
||||
if (IS_STM32(board) || version >= 218) {
|
||||
expo.offset = smallGvarExport(_offset);
|
||||
// 2.11
|
||||
if (AdjustmentReference(expo.offset).type == AdjustmentReference::ADJUST_REF_GVAR)
|
||||
expo.offset = RawSource(SOURCE_TYPE_GVAR, AdjustmentReference(expo.offset).value).toValue();
|
||||
}
|
||||
|
||||
if (!IS_TARANIS(board) && version < 218) {
|
||||
@@ -1235,6 +1260,13 @@ class InputField: public TransformedField {
|
||||
else
|
||||
expo.curve = CurveReference(CurveReference::CURVE_REF_FUNC, _curveParam);
|
||||
}
|
||||
|
||||
// 2.11
|
||||
if ((expo.curve.type == CurveReference::CURVE_REF_DIFF || expo.curve.type == CurveReference::CURVE_REF_EXPO) &&
|
||||
AdjustmentReference(expo.curve.value).type == AdjustmentReference::ADJUST_REF_GVAR)
|
||||
expo.curve.value = RawSource(SOURCE_TYPE_GVAR, AdjustmentReference(expo.curve.value).value).toValue();
|
||||
|
||||
|
||||
qCDebug(eepromImport) << QString("imported %1: ch %2 name '%3'").arg(internalField.getName()).arg(expo.chn).arg(expo.name);
|
||||
}
|
||||
|
||||
|
||||
@@ -131,7 +131,7 @@ RawSourceRange RawSource::getRange(const ModelData * model, const GeneralSetting
|
||||
QString RawSource::toString(const ModelData * model, const GeneralSettings * const generalSettings, Board::Type board, bool prefixCustomName) const
|
||||
{
|
||||
if (index < 0)
|
||||
return CPN_STR_SRC_INDICATOR_INVERT % RawSource(type, -index).toString(model, generalSettings, board, prefixCustomName);
|
||||
return CPN_STR_SRC_INDICATOR_NEG % RawSource(type, -index).toString(model, generalSettings, board, prefixCustomName);
|
||||
|
||||
if (board == Board::BOARD_UNKNOWN)
|
||||
board = getCurrentBoard();
|
||||
|
||||
@@ -0,0 +1,156 @@
|
||||
/*
|
||||
* Copyright (C) EdgeTX
|
||||
*
|
||||
* Based on code named
|
||||
* opentx - https://github.com/opentx/opentx
|
||||
* th9x - http://code.google.com/p/th9x
|
||||
* er9x - http://code.google.com/p/er9x
|
||||
* gruvin9x - http://code.google.com/p/gruvin9x
|
||||
*
|
||||
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#include "sourcenumref.h"
|
||||
#include "filtereditemmodels.h"
|
||||
#include "helpers.h"
|
||||
|
||||
QString SourceNumRef::toString(const ModelData * model, const GeneralSettings * const generalSettings,
|
||||
Board::Type board, bool prefixCustomName) const
|
||||
{
|
||||
if (srcNum.type == SOURCE_TYPE_NONE)
|
||||
return QString::number(srcNum.index);
|
||||
else
|
||||
return srcNum.toString(model, generalSettings, board, prefixCustomName);
|
||||
}
|
||||
|
||||
// static
|
||||
int SourceNumRef::getDefault(int useSource, int dflt)
|
||||
{
|
||||
if (useSource)
|
||||
return 0;
|
||||
else
|
||||
return dflt;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* SourceNumRefEditor
|
||||
*/
|
||||
|
||||
SourceNumRefEditor::SourceNumRefEditor(int & srcNumValue, QCheckBox * chkUseSource, QSpinBox * sbxValue, QComboBox * cboValue,
|
||||
int defValue, int minValue, int maxValue, int step,
|
||||
ModelData & model, FilteredItemModel * sourceItemModel, QObject * parent) :
|
||||
QObject(parent),
|
||||
srcNumValue(srcNumValue),
|
||||
chkUseSource(chkUseSource),
|
||||
sbxValue(sbxValue),
|
||||
cboValue(cboValue),
|
||||
defValue(defValue),
|
||||
model(model),
|
||||
lock(false)
|
||||
{
|
||||
if (chkUseSource) {
|
||||
connect(chkUseSource, &QCheckBox::stateChanged, this, &SourceNumRefEditor::chkUseSourceChanged);
|
||||
}
|
||||
|
||||
if (sbxValue) {
|
||||
sbxValue->setMinimum(minValue);
|
||||
sbxValue->setMaximum(maxValue);
|
||||
sbxValue->setSingleStep(step);
|
||||
sbxValue->setValue(defValue);
|
||||
connect(sbxValue, &QSpinBox::editingFinished, this, &SourceNumRefEditor::sbxValueChanged);
|
||||
}
|
||||
|
||||
if (cboValue) {
|
||||
cboValue->setModel(sourceItemModel);
|
||||
cboValue->setSizeAdjustPolicy(QComboBox::AdjustToContents);
|
||||
cboValue->setMaxVisibleItems(10);
|
||||
cboValue->setCurrentIndex(Helpers::getFirstPosValueIndex(cboValue));
|
||||
connect(cboValue, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &SourceNumRefEditor::cboValueChanged);
|
||||
}
|
||||
|
||||
update();
|
||||
}
|
||||
|
||||
void SourceNumRefEditor::chkUseSourceChanged(int state)
|
||||
{
|
||||
if (!lock) {
|
||||
srcNumValue = SourceNumRef::getDefault(state, defValue);
|
||||
|
||||
if (state == Qt::Checked) {
|
||||
cboValue->setCurrentIndex(cboValue->findData(srcNumValue));
|
||||
if (cboValue->currentIndex() < 0)
|
||||
cboValue->setCurrentIndex(Helpers::getFirstPosValueIndex(cboValue));
|
||||
}
|
||||
else
|
||||
sbxValue->setValue(srcNumValue);
|
||||
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
void SourceNumRefEditor::sbxValueChanged()
|
||||
{
|
||||
if (!lock) {
|
||||
srcNumValue = sbxValue->value();
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
void SourceNumRefEditor::cboValueChanged(int index)
|
||||
{
|
||||
if (!lock) {
|
||||
srcNumValue = cboValue->itemData(index).toInt();
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
void SourceNumRefEditor::setVisible(bool state)
|
||||
{
|
||||
chkUseSource->setVisible(state);
|
||||
cboValue->setVisible(state);
|
||||
sbxValue->setVisible(state);
|
||||
}
|
||||
|
||||
void SourceNumRefEditor::update()
|
||||
{
|
||||
lock = true;
|
||||
|
||||
if (SourceNumRef(srcNumValue).isNumber()) {
|
||||
if (chkUseSource)
|
||||
chkUseSource->setChecked(false);
|
||||
|
||||
if (sbxValue) {
|
||||
sbxValue->setValue(srcNumValue);
|
||||
sbxValue->setVisible(true);
|
||||
}
|
||||
|
||||
if (cboValue)
|
||||
cboValue->setVisible(false);
|
||||
}
|
||||
else {
|
||||
if (chkUseSource)
|
||||
chkUseSource->setChecked(true);
|
||||
|
||||
if (sbxValue)
|
||||
sbxValue->setVisible(false);
|
||||
|
||||
if (cboValue) {
|
||||
cboValue->setCurrentIndex(cboValue->findData(srcNumValue));
|
||||
cboValue->setVisible(true);
|
||||
}
|
||||
}
|
||||
|
||||
emit resized();
|
||||
|
||||
lock = false;
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
/*
|
||||
* Copyright (C) EdgeTX
|
||||
*
|
||||
* Based on code named
|
||||
* opentx - https://github.com/opentx/opentx
|
||||
* th9x - http://code.google.com/p/th9x
|
||||
* er9x - http://code.google.com/p/er9x
|
||||
* gruvin9x - http://code.google.com/p/gruvin9x
|
||||
*
|
||||
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "rawsource.h"
|
||||
|
||||
#include <QtCore>
|
||||
#include <QCheckBox>
|
||||
#include <QComboBox>
|
||||
#include <QSpinBox>
|
||||
|
||||
class FilteredItemModel;
|
||||
|
||||
/*
|
||||
This class takes advantage of RawSource's assumption that small values must be SOURCE_TYPE_NONE ie zero
|
||||
albeit anything other than value zero is unexpected. However there is no setter validation to stop unknown values.
|
||||
|
||||
Also SOURCE_TYPE_NONE must be excluded from selection lists.
|
||||
It would not make sense anyway as it equates to value 0 and thus ambiguous.
|
||||
*/
|
||||
|
||||
class SourceNumRef {
|
||||
|
||||
Q_DECLARE_TR_FUNCTIONS(SourceNumRef)
|
||||
|
||||
public:
|
||||
SourceNumRef() : srcNum(RawSource()) {}
|
||||
explicit SourceNumRef(int value) : srcNum(RawSource(value)) {}
|
||||
SourceNumRef(RawSourceType type, int index = 0) : srcNum(RawSource(type, index)) {}
|
||||
|
||||
virtual ~SourceNumRef() {}
|
||||
|
||||
int toValue() { return srcNum.toValue(); }
|
||||
|
||||
QString toString(const ModelData * model = nullptr, const GeneralSettings * const generalSettings = nullptr,
|
||||
Board::Type board = Board::BOARD_UNKNOWN, bool prefixCustomName = true) const;
|
||||
|
||||
const bool isNumber() const { return srcNum.type == SOURCE_TYPE_NONE; }
|
||||
const bool isSource() const { return srcNum.type != SOURCE_TYPE_NONE; }
|
||||
static int getDefault(int useSource, int dflt);
|
||||
|
||||
private:
|
||||
RawSource srcNum;
|
||||
};
|
||||
|
||||
class SourceNumRefEditor : public QObject {
|
||||
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit SourceNumRefEditor(int & srcNumValue, QCheckBox * chkUseSource, QSpinBox * sbxValue, QComboBox * cboValue,
|
||||
int defValue, int minValue, int maxValue, int step,
|
||||
ModelData & model, FilteredItemModel * sourceItemModel, QObject * parent = nullptr);
|
||||
|
||||
virtual ~SourceNumRefEditor() {}
|
||||
|
||||
void setLock(bool state) { lock = state; }
|
||||
void setVisible(bool state);
|
||||
void update();
|
||||
|
||||
signals:
|
||||
void resized();
|
||||
|
||||
protected slots:
|
||||
void chkUseSourceChanged(int state);
|
||||
void sbxValueChanged();
|
||||
void cboValueChanged(int index);
|
||||
|
||||
protected:
|
||||
int &srcNumValue;
|
||||
QCheckBox *chkUseSource;
|
||||
QSpinBox *sbxValue;
|
||||
QComboBox *cboValue;
|
||||
int defValue;
|
||||
ModelData &model;
|
||||
bool lock;
|
||||
};
|
||||
@@ -324,6 +324,37 @@ void Helpers::setBitmappedValue(unsigned int & field, unsigned int value, unsign
|
||||
field = (field & ~fieldmask) | (value << (numbits * index + offset));
|
||||
}
|
||||
|
||||
// return index of 'none' ie zero or first positive data entry in potentially an asymetrical list
|
||||
int Helpers::getFirstPosValueIndex(QComboBox * cbo)
|
||||
{
|
||||
const int cnt = cbo->count();
|
||||
if (cnt == 0)
|
||||
return -1;
|
||||
|
||||
const int idx = cnt / 2;
|
||||
const int val = cbo->itemData(idx).toInt();
|
||||
|
||||
if (val == 0)
|
||||
return idx;
|
||||
|
||||
const int step = val > 0 ? -1 : 1;
|
||||
|
||||
for (int i = idx + step; i >= 0 && i < cbo->count(); i += step) {
|
||||
if (cbo->findData(i) == 0)
|
||||
return i;
|
||||
else if (step < 0 && cbo->itemData(i).toInt() < 0) {
|
||||
if (i++ < cbo->count())
|
||||
return i++;
|
||||
else
|
||||
return -1;
|
||||
}
|
||||
else if (step > 0 && cbo->itemData(i).toInt() > 0)
|
||||
return i;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
#ifdef __APPLE__
|
||||
// Flag when simulator is running
|
||||
static bool simulatorRunning = false;
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include <QElapsedTimer>
|
||||
#include <QStandardItemModel>
|
||||
#include <QDialog>
|
||||
#include <QComboBox>
|
||||
|
||||
extern const QColor colors[CPN_MAX_CURVES];
|
||||
|
||||
@@ -117,6 +118,7 @@ namespace Helpers
|
||||
QString removeAccents(const QString & str);
|
||||
unsigned int getBitmappedValue(const unsigned int & field, const unsigned int index = 0, const unsigned int numbits = 1, const unsigned int offset = 0);
|
||||
void setBitmappedValue(unsigned int & field, unsigned int value, unsigned int index = 0, unsigned int numbits = 1, unsigned int offset = 0);
|
||||
int getFirstPosValueIndex(QComboBox * cbo);
|
||||
|
||||
} // namespace Helpers
|
||||
|
||||
|
||||
@@ -104,6 +104,9 @@ ChannelsPanel::ChannelsPanel(QWidget * parent, ModelData & model, GeneralSetting
|
||||
|
||||
int gvid = dialogFilteredItemModels->registerItemModel(new FilteredItemModel(sharedItemModels->getItemModel(AbstractItemModel::IMID_GVarRef)), "GVarRef");
|
||||
|
||||
curveRefFilteredItemModels = new CurveRefFilteredFactory(sharedItemModels,
|
||||
firmware->getCapability(HasMixerExpo) ? 0 : FilteredItemModel::PositiveFilter);
|
||||
|
||||
QStringList headerLabels;
|
||||
headerLabels << "#";
|
||||
if (channelNameMaxLen > 0) {
|
||||
@@ -162,20 +165,15 @@ ChannelsPanel::ChannelsPanel(QWidget * parent, ModelData & model, GeneralSetting
|
||||
if (IS_HORUS_OR_TARANIS(firmware->getBoard())) {
|
||||
curveCB[i] = new QComboBox(this);
|
||||
curveCB[i]->setProperty("index", i);
|
||||
curveCB[i]->setSizeAdjustPolicy(QComboBox::AdjustToContents);
|
||||
curveCB[i]->setModel(dialogFilteredItemModels->getItemModel(crvid));
|
||||
connect(curveCB[i], SIGNAL(currentIndexChanged(int)), this, SLOT(curveEdited()));
|
||||
tableLayout->addWidget(i, col++, curveCB[i]);
|
||||
|
||||
curveImage[i] = new CurveImageWidget(this);
|
||||
int crvidx = model.limitData[i].curve.value - 1;
|
||||
QColor pencolor = colors[crvidx >= 0 ? crvidx : Qt::black];
|
||||
curveImage[i]->set(&model, firmware, sharedItemModels, crvidx, pencolor, 3);
|
||||
curveImage[i]->setGrid(Qt::gray, 2);
|
||||
curveImage[i]->setProperty("index", i);
|
||||
curveImage[i]->setFixedSize(QSize(100, 100));
|
||||
connect(curveImage[i], &CurveImageWidget::doubleClicked, this, &ChannelsPanel::on_curveImageDoubleClicked);
|
||||
tableLayout->addWidget(i, col++, curveImage[i]);
|
||||
|
||||
curveGroup[i] = new CurveReferenceUIManager(curveCB[i], curveImage[i], model.limitData[i].curve, model, sharedItemModels,
|
||||
curveRefFilteredItemModels, this);
|
||||
}
|
||||
|
||||
// PPM center
|
||||
@@ -201,6 +199,7 @@ ChannelsPanel::ChannelsPanel(QWidget * parent, ModelData & model, GeneralSetting
|
||||
tableLayout->addWidget(i, col++, symlimitsChk[i]);
|
||||
}
|
||||
}
|
||||
|
||||
update();
|
||||
|
||||
disableMouseScrolling();
|
||||
@@ -222,8 +221,10 @@ ChannelsPanel::~ChannelsPanel()
|
||||
delete curveCB[i];
|
||||
delete centerSB[i];
|
||||
delete symlimitsChk[i];
|
||||
delete curveGroup[i];
|
||||
}
|
||||
delete dialogFilteredItemModels;
|
||||
delete curveRefFilteredItemModels;
|
||||
}
|
||||
|
||||
void ChannelsPanel::symlimitsEdited()
|
||||
@@ -270,24 +271,6 @@ void ChannelsPanel::invEdited()
|
||||
}
|
||||
}
|
||||
|
||||
void ChannelsPanel::curveEdited()
|
||||
{
|
||||
if (!lock) {
|
||||
QComboBox *cb = qobject_cast<QComboBox*>(sender());
|
||||
int index = cb->property("index").toInt();
|
||||
// ignore unnecessary updates that could be triggered by updates to the data model
|
||||
LimitData &ld = model->limitData[index];
|
||||
if (ld.curve != CurveReference(CurveReference::CURVE_REF_CUSTOM, cb->itemData(cb->currentIndex()).toInt())) {
|
||||
ld.curve = CurveReference(CurveReference::CURVE_REF_CUSTOM, cb->itemData(cb->currentIndex()).toInt());
|
||||
curveImage[index]->setIndex(abs(ld.curve.value) - 1);
|
||||
if (abs(ld.curve.value) > 0)
|
||||
curveImage[index]->setPen(colors[abs(ld.curve.value) - 1], 3);
|
||||
updateLine(index);
|
||||
emit modified();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ChannelsPanel::ppmcenterEdited()
|
||||
{
|
||||
if (!lock) {
|
||||
@@ -317,16 +300,6 @@ void ChannelsPanel::updateLine(int i)
|
||||
chnMin[i]->setValue(chn.min);
|
||||
chnMax[i]->setValue(chn.max);
|
||||
invCB[i]->setCurrentIndex((chn.revert) ? 1 : 0);
|
||||
if (IS_HORUS_OR_TARANIS(firmware->getBoard())) {
|
||||
curveCB[i]->setCurrentIndex(curveCB[i]->findData(chn.curve.value));
|
||||
if (chn.curve.value == 0) {
|
||||
curveImage[i]->setVisible(false);
|
||||
}
|
||||
else {
|
||||
curveImage[i]->setVisible(true);
|
||||
curveImage[i]->draw();
|
||||
}
|
||||
}
|
||||
if (firmware->getCapability(PPMCenter)) {
|
||||
centerSB[i]->setValue(chn.ppmCenter + 1500);
|
||||
}
|
||||
@@ -496,14 +469,3 @@ void ChannelsPanel::updateItemModels()
|
||||
sharedItemModels->update(AbstractItemModel::IMUE_Channels);
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void ChannelsPanel::on_curveImageDoubleClicked()
|
||||
{
|
||||
bool ok = false;
|
||||
int index = sender()->property("index").toInt(&ok);
|
||||
|
||||
if (ok && curveImage[abs(index)]->edit()) {
|
||||
updateLine(index);
|
||||
emit modified();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,7 +70,6 @@ class ChannelsPanel : public ModelPanel
|
||||
void symlimitsEdited();
|
||||
void nameEdited();
|
||||
void invEdited();
|
||||
void curveEdited();
|
||||
void ppmcenterEdited();
|
||||
void update();
|
||||
void updateLine(int index);
|
||||
@@ -86,7 +85,6 @@ class ChannelsPanel : public ModelPanel
|
||||
void onCustomContextMenuRequested(QPoint pos);
|
||||
void onItemModelAboutToBeUpdated();
|
||||
void onItemModelUpdateComplete();
|
||||
void on_curveImageDoubleClicked();
|
||||
|
||||
private:
|
||||
QLineEdit *name[CPN_MAX_CHNOUT];
|
||||
@@ -102,6 +100,8 @@ class ChannelsPanel : public ModelPanel
|
||||
int chnCapability;
|
||||
CompoundItemModelFactory *sharedItemModels;
|
||||
FilteredItemModelFactory *dialogFilteredItemModels;
|
||||
CurveRefFilteredFactory *curveRefFilteredItemModels;
|
||||
CurveReferenceUIManager *curveGroup[CPN_MAX_CHNOUT];
|
||||
|
||||
bool hasClipboardData(QByteArray * data = nullptr) const;
|
||||
bool insertAllowed() const;
|
||||
|
||||
@@ -55,7 +55,7 @@ CurvesPanel::CurvesPanel(QWidget * parent, ModelData & model, GeneralSettings &
|
||||
tableLayout->addWidget(i, col++, label);
|
||||
|
||||
image[i] = new CurveImageWidget(this);
|
||||
image[i]->set(&model, firmware, sharedItemModels, i, colors[i], 3);
|
||||
image[i]->set(&model, firmware, sharedItemModels, i + 1, colors[i], 3);
|
||||
image[i]->setGrid(Qt::gray, 2);
|
||||
image[i]->setProperty("index", i);
|
||||
image[i]->setFixedSize(QSize(100, 100));
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
/*
|
||||
* Copyright (C) OpenTX
|
||||
* Copyright (C) EdgeTX
|
||||
*
|
||||
* Based on code named
|
||||
* opentx - https://github.com/opentx/opentx
|
||||
* th9x - http://code.google.com/p/th9x
|
||||
* er9x - http://code.google.com/p/er9x
|
||||
* gruvin9x - http://code.google.com/p/gruvin9x
|
||||
@@ -23,6 +24,7 @@
|
||||
#include "filtereditemmodels.h"
|
||||
#include "helpers.h"
|
||||
#include "namevalidator.h"
|
||||
#include "sourcenumref.h"
|
||||
|
||||
ExpoDialog::ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expoData, GeneralSettings & generalSettings,
|
||||
Firmware * firmware, QString & inputName, CompoundItemModelFactory * sharedItemModels) :
|
||||
@@ -33,14 +35,12 @@ ExpoDialog::ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expoData, G
|
||||
firmware(firmware),
|
||||
ed(expoData),
|
||||
inputName(inputName),
|
||||
modelPrinter(firmware, generalSettings, model),
|
||||
lock(false)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
Board::Type board = firmware->getBoard();
|
||||
dialogFilteredItemModels = new FilteredItemModelFactory();
|
||||
int id;
|
||||
|
||||
QLabel * lb_fp[CPN_MAX_FLIGHT_MODES] = {ui->lb_FP0, ui->lb_FP1, ui->lb_FP2, ui->lb_FP3, ui->lb_FP4, ui->lb_FP5, ui->lb_FP6, ui->lb_FP7, ui->lb_FP8 };
|
||||
QCheckBox * tmp[CPN_MAX_FLIGHT_MODES] = {ui->cb_FP0, ui->cb_FP1, ui->cb_FP2, ui->cb_FP3, ui->cb_FP4, ui->cb_FP5, ui->cb_FP6, ui->cb_FP7, ui->cb_FP8 };
|
||||
@@ -51,28 +51,35 @@ ExpoDialog::ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expoData, G
|
||||
RawSourceType srcType = (firmware->getCapability(VirtualInputs) ? SOURCE_TYPE_VIRTUAL_INPUT : SOURCE_TYPE_INPUT);
|
||||
setWindowTitle(tr("Edit %1").arg(RawSource(srcType, ed->chn).toString(&model, &generalSettings)));
|
||||
|
||||
id = dialogFilteredItemModels->registerItemModel(new FilteredItemModel(sharedItemModels->getItemModel(AbstractItemModel::IMID_GVarRef)), "GVarRef");
|
||||
gvWeightGroup = new GVarGroup(ui->weightGV, ui->weightSB, ui->weightCB, ed->weight, model, 100, -100, 100, 1.0,
|
||||
dialogFilteredItemModels->getItemModel(id));
|
||||
int imId = dialogFilteredItemModels->registerItemModel(new FilteredItemModel(sharedItemModels->getItemModel(AbstractItemModel::IMID_RawSource),
|
||||
(RawSource::AllSourceGroups & ~RawSource::NoneGroup & ~RawSource::ScriptsGroup & ~RawSource::InputsGroup)),
|
||||
"EditorSource");
|
||||
|
||||
gvOffsetGroup = new GVarGroup(ui->offsetGV, ui->offsetSB, ui->offsetCB, ed->offset, model, 0, -100, 100, 1.0,
|
||||
dialogFilteredItemModels->getItemModel(id));
|
||||
FilteredItemModel *esMdl = dialogFilteredItemModels->getItemModel(imId);
|
||||
|
||||
weightEditor = new SourceNumRefEditor(ed->weight, ui->chkWeightUseSource, ui->sbWeightValue, ui->cboWeightSource, 100, -100, 100, 1.0,
|
||||
model, esMdl);
|
||||
|
||||
connect(weightEditor, &SourceNumRefEditor::resized, this, [=] () { shrink(); });
|
||||
|
||||
offsetEditor = new SourceNumRefEditor(ed->offset, ui->chkOffsetUseSource, ui->sbOffsetValue, ui->cboOffsetSource, 0, -100, 100, 1.0,
|
||||
model, esMdl);
|
||||
|
||||
connect(offsetEditor, &SourceNumRefEditor::resized, this, [=] () { shrink(); });
|
||||
|
||||
curveRefFilteredItemModels = new CurveRefFilteredFactory(sharedItemModels,
|
||||
firmware->getCapability(HasInputDiff) ? 0 : FilteredItemModel::PositiveFilter);
|
||||
|
||||
curveGroup = new CurveReferenceUIManager(ui->curveTypeCB, ui->curveGVarCB, ui->curveValueSB, ui->curveValueCB, ui->curveImage, ed->curve, model,
|
||||
sharedItemModels, curveRefFilteredItemModels, this);
|
||||
curveGroup = new CurveReferenceUIManager(ui->cboCurveType, ui->chkCurveUseSource, ui->sbCurveValue, ui->cboCurveSource, ui->cboCurveFunc,
|
||||
ui->imgCurve, ed->curve, model, sharedItemModels, curveRefFilteredItemModels, esMdl, this);
|
||||
|
||||
|
||||
connect(curveGroup, &CurveReferenceUIManager::resized, this, [=] () {
|
||||
this->adjustSize();
|
||||
this->adjustSize(); // second call seems to be required when hidden fields otherwise not all padding removed
|
||||
});
|
||||
connect(curveGroup, &CurveReferenceUIManager::resized, this, [=] () { shrink(); });
|
||||
|
||||
id = dialogFilteredItemModels->registerItemModel(new FilteredItemModel(sharedItemModels->getItemModel(AbstractItemModel::IMID_RawSwitch),
|
||||
imId = dialogFilteredItemModels->registerItemModel(new FilteredItemModel(sharedItemModels->getItemModel(AbstractItemModel::IMID_RawSwitch),
|
||||
RawSwitch::MixesContext), "RawSwitch");
|
||||
ui->switchesCB->setModel(dialogFilteredItemModels->getItemModel(id));
|
||||
ui->switchesCB->setSizeAdjustPolicy(QComboBox::AdjustToContents);
|
||||
ui->switchesCB->setModel(dialogFilteredItemModels->getItemModel(imId));
|
||||
ui->switchesCB->setCurrentIndex(ui->switchesCB->findData(ed->swtch.toValue()));
|
||||
|
||||
ui->sideCB->setCurrentIndex(ed->mode - 1);
|
||||
@@ -105,12 +112,13 @@ ExpoDialog::ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expoData, G
|
||||
ui->inputName->setMaxLength(firmware->getCapability(InputsLength));
|
||||
int flags = RawSource::InputSourceGroups & ~RawSource::NoneGroup & ~RawSource::InputsGroup;
|
||||
flags |= RawSource::GVarsGroup | RawSource::TelemGroup;
|
||||
id = dialogFilteredItemModels->registerItemModel(new FilteredItemModel(sharedItemModels->getItemModel(AbstractItemModel::IMID_RawSource),
|
||||
imId = dialogFilteredItemModels->registerItemModel(new FilteredItemModel(sharedItemModels->getItemModel(AbstractItemModel::IMID_RawSource),
|
||||
flags), "RawSource");
|
||||
ui->sourceCB->setModel(dialogFilteredItemModels->getItemModel(id));
|
||||
ui->sourceCB->setSizeAdjustPolicy(QComboBox::AdjustToContents);
|
||||
ui->sourceCB->setModel(dialogFilteredItemModels->getItemModel(imId));
|
||||
ui->sourceCB->setCurrentIndex(ui->sourceCB->findData(ed->srcRaw.toValue()));
|
||||
if (ui->sourceCB->currentIndex() < 0 && ed->srcRaw.toValue() == 0)
|
||||
ui->sourceCB->setCurrentIndex(ui->sourceCB->count() / 2); // '----' not in list so set to first positive entry
|
||||
ui->sourceCB->setCurrentIndex(Helpers::getFirstPosValueIndex(ui->sourceCB));
|
||||
ui->inputName->setValidator(new NameValidator(board, this));
|
||||
ui->inputName->setText(inputName);
|
||||
}
|
||||
@@ -164,15 +172,16 @@ ExpoDialog::ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expoData, G
|
||||
connect(ui->inputName, SIGNAL(editingFinished()), this, SLOT(valuesChanged()));
|
||||
}
|
||||
|
||||
adjustSize();
|
||||
shrink();
|
||||
}
|
||||
|
||||
ExpoDialog::~ExpoDialog()
|
||||
{
|
||||
delete ui;
|
||||
delete gvWeightGroup;
|
||||
delete gvOffsetGroup;
|
||||
delete weightEditor;
|
||||
delete offsetEditor;
|
||||
delete dialogFilteredItemModels;
|
||||
delete curveRefFilteredItemModels;
|
||||
}
|
||||
|
||||
void ExpoDialog::updateScale()
|
||||
@@ -278,3 +287,9 @@ void ExpoDialog::fmInvertAll()
|
||||
lock = false;
|
||||
valuesChanged();
|
||||
}
|
||||
|
||||
void ExpoDialog::shrink()
|
||||
{
|
||||
this->adjustSize();
|
||||
this->resize(0, 0);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
/*
|
||||
* Copyright (C) OpenTX
|
||||
* Copyright (C) EdgeTX
|
||||
*
|
||||
* Based on code named
|
||||
* opentx - https://github.com/opentx/opentx
|
||||
* th9x - http://code.google.com/p/th9x
|
||||
* er9x - http://code.google.com/p/er9x
|
||||
* gruvin9x - http://code.google.com/p/gruvin9x
|
||||
@@ -20,15 +21,15 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QtWidgets>
|
||||
#include "eeprominterface.h"
|
||||
#include "modelprinter.h"
|
||||
|
||||
class GVarGroup;
|
||||
#include <QtWidgets>
|
||||
|
||||
class CompoundItemModelFactory;
|
||||
class FilteredItemModelFactory;
|
||||
class CurveRefFilteredFactory;
|
||||
class CurveReferenceUIManager;
|
||||
class SourceNumRefEditor;
|
||||
|
||||
namespace Ui {
|
||||
class ExpoDialog;
|
||||
@@ -58,13 +59,14 @@ class ExpoDialog : public QDialog {
|
||||
Firmware * firmware;
|
||||
ExpoData * ed;
|
||||
QString & inputName;
|
||||
GVarGroup * gvWeightGroup;
|
||||
GVarGroup * gvOffsetGroup;
|
||||
SourceNumRefEditor * weightEditor;
|
||||
SourceNumRefEditor * offsetEditor;
|
||||
CurveReferenceUIManager * curveGroup;
|
||||
ModelPrinter modelPrinter;
|
||||
bool lock;
|
||||
QCheckBox * cb_fp[CPN_MAX_FLIGHT_MODES];
|
||||
FilteredItemModelFactory *dialogFilteredItemModels;
|
||||
CurveRefFilteredFactory *curveRefFilteredItemModels;
|
||||
int carryTrimFilterFlags = 0;
|
||||
|
||||
void shrink();
|
||||
};
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>442</width>
|
||||
<height>411</height>
|
||||
<width>671</width>
|
||||
<height>490</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
@@ -29,61 +29,502 @@
|
||||
<iconset resource="../companion.qrc">
|
||||
<normaloff>:/icon.png</normaloff>:/icon.png</iconset>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="13" column="1">
|
||||
<widget class="QComboBox" name="sideCB">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>NEG</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>POS</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>ALL</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="1">
|
||||
<layout class="QHBoxLayout" name="offsetLayout" stretch="0,0,1,0">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="offsetGV">
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<item row="0" column="0">
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="sourceLabel">
|
||||
<property name="text">
|
||||
<string>GV</string>
|
||||
<string>Source</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="offsetSB"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="offsetCB">
|
||||
<property name="whatsThis">
|
||||
<string>The source for the mixer</string>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Weight</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="offsetSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="trimLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
<property name="text">
|
||||
<string>Include Trim</string>
|
||||
</property>
|
||||
</spacer>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="lblScale">
|
||||
<property name="text">
|
||||
<string>Scale</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="lineNameLabel">
|
||||
<property name="text">
|
||||
<string>Line name</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="inputNameLabel">
|
||||
<property name="text">
|
||||
<string>Input name</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="0">
|
||||
<widget class="QLabel" name="label_phases">
|
||||
<property name="text">
|
||||
<string>Flight modes</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="0">
|
||||
<widget class="QLabel" name="sideLabel">
|
||||
<property name="text">
|
||||
<string>Stick Side</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="0">
|
||||
<widget class="QLabel" name="label_curves">
|
||||
<property name="text">
|
||||
<string>Curve</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="offsetLabel">
|
||||
<property name="text">
|
||||
<string>Offset</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Switch</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1" colspan="2">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QDoubleSpinBox" name="dsbScale">
|
||||
<property name="whatsThis">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="decimals">
|
||||
<number>1</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="lblScaleUnit">
|
||||
<property name="text">
|
||||
<string>unit</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="5" column="1" colspan="3">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="chkWeightUseSource">
|
||||
<property name="text">
|
||||
<string>Source</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="sbWeightValue"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="cboWeightSource">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="8" column="1" colspan="4">
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="0" column="1">
|
||||
<widget class="QLabel" name="lb_FP1">
|
||||
<property name="text">
|
||||
<string notr="true">1</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="6">
|
||||
<widget class="QLabel" name="lb_FP6">
|
||||
<property name="text">
|
||||
<string notr="true">6</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QCheckBox" name="cb_FP1">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="7">
|
||||
<widget class="QLabel" name="lb_FP7">
|
||||
<property name="text">
|
||||
<string notr="true">7</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="lb_FP0">
|
||||
<property name="text">
|
||||
<string notr="true">0</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="3">
|
||||
<widget class="QCheckBox" name="cb_FP3">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QCheckBox" name="cb_FP0">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="8">
|
||||
<widget class="QCheckBox" name="cb_FP8">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="6">
|
||||
<widget class="QCheckBox" name="cb_FP6">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="4">
|
||||
<widget class="QCheckBox" name="cb_FP4">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="8">
|
||||
<widget class="QLabel" name="lb_FP8">
|
||||
<property name="text">
|
||||
<string notr="true">8</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QCheckBox" name="cb_FP2">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QLabel" name="lb_FP2">
|
||||
<property name="text">
|
||||
<string notr="true">2</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="4">
|
||||
<widget class="QLabel" name="lb_FP4">
|
||||
<property name="text">
|
||||
<string notr="true">4</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="5">
|
||||
<widget class="QLabel" name="lb_FP5">
|
||||
<property name="text">
|
||||
<string notr="true">5</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="5">
|
||||
<widget class="QCheckBox" name="cb_FP5">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="7">
|
||||
<widget class="QCheckBox" name="cb_FP7">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
<widget class="QLabel" name="lb_FP3">
|
||||
<property name="text">
|
||||
<string notr="true">3</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="9">
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="7" column="1" colspan="4">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<item>
|
||||
<widget class="QComboBox" name="cboCurveType">
|
||||
<property name="toolTip">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>Curve applied to the source.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="chkCurveUseSource">
|
||||
<property name="text">
|
||||
<string>Source</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="sbCurveValue"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="cboCurveFunc"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="cboCurveSource">
|
||||
<property name="whatsThis">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="CurveImageWidget" name="imgCurve">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<height>100</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<height>100</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>image</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_5">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="6" column="1" colspan="3">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="chkOffsetUseSource">
|
||||
<property name="text">
|
||||
<string>Source</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="sbOffsetValue"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="cboOffsetSource">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>The source for the mixer</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_4">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="inputName">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="lineName">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QComboBox" name="trimCB">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="1">
|
||||
<widget class="QComboBox" name="switchesCB"/>
|
||||
</item>
|
||||
<item row="10" column="1">
|
||||
<widget class="QComboBox" name="sideCB">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>NEG</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>POS</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>ALL</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QComboBox" name="sourceCB"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="14" column="0" colspan="2">
|
||||
<item row="1" column="0">
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
@@ -98,394 +539,7 @@
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
<property name="centerButtons">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<widget class="QComboBox" name="trimCB"/>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="lineName">
|
||||
<property name="maxLength">
|
||||
<number>6</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="0">
|
||||
<widget class="QLabel" name="label_curves">
|
||||
<property name="text">
|
||||
<string>Curve</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="11" column="0">
|
||||
<widget class="QLabel" name="label_7">
|
||||
<property name="text">
|
||||
<string>Switch</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="0">
|
||||
<widget class="QLabel" name="label_phases">
|
||||
<property name="text">
|
||||
<string>Flight modes</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="13" column="0">
|
||||
<widget class="QLabel" name="sideLabel">
|
||||
<property name="text">
|
||||
<string>Stick Side</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Weight</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2" stretch="0,0,1,0">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="weightGV">
|
||||
<property name="text">
|
||||
<string>GV</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="weightSB"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="weightCB">
|
||||
<property name="whatsThis">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="11" column="1">
|
||||
<widget class="QComboBox" name="switchesCB">
|
||||
<property name="whatsThis">
|
||||
<string>Switch used to enable the line.
|
||||
If blank then the input is considered to be "ON" all the time.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="0">
|
||||
<widget class="QLabel" name="offsetLabel">
|
||||
<property name="text">
|
||||
<string>Offset</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="sourceLabel">
|
||||
<property name="text">
|
||||
<string>Source</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="inputNameLabel">
|
||||
<property name="text">
|
||||
<string>Input name</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QComboBox" name="sourceCB">
|
||||
<property name="whatsThis">
|
||||
<string>Source for the mixer.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="inputName">
|
||||
<property name="maxLength">
|
||||
<number>6</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="QDoubleSpinBox" name="dsbScale">
|
||||
<property name="whatsThis">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="decimals">
|
||||
<number>1</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="lblScaleUnit">
|
||||
<property name="text">
|
||||
<string>unit</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="10" column="1">
|
||||
<layout class="QGridLayout" name="gridLayout_4">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="lb_FP0">
|
||||
<property name="text">
|
||||
<string notr="true">0</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLabel" name="lb_FP1">
|
||||
<property name="text">
|
||||
<string notr="true">1</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QLabel" name="lb_FP2">
|
||||
<property name="text">
|
||||
<string notr="true">2</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
<widget class="QLabel" name="lb_FP3">
|
||||
<property name="text">
|
||||
<string notr="true">3</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="4">
|
||||
<widget class="QLabel" name="lb_FP4">
|
||||
<property name="text">
|
||||
<string notr="true">4</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="5">
|
||||
<widget class="QLabel" name="lb_FP5">
|
||||
<property name="text">
|
||||
<string notr="true">5</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="6">
|
||||
<widget class="QLabel" name="lb_FP6">
|
||||
<property name="text">
|
||||
<string notr="true">6</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="7">
|
||||
<widget class="QLabel" name="lb_FP7">
|
||||
<property name="text">
|
||||
<string notr="true">7</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="8">
|
||||
<widget class="QLabel" name="lb_FP8">
|
||||
<property name="text">
|
||||
<string notr="true">8</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QCheckBox" name="cb_FP0">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QCheckBox" name="cb_FP1">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QCheckBox" name="cb_FP2">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="3">
|
||||
<widget class="QCheckBox" name="cb_FP3">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="4">
|
||||
<widget class="QCheckBox" name="cb_FP4">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="5">
|
||||
<widget class="QCheckBox" name="cb_FP5">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="6">
|
||||
<widget class="QCheckBox" name="cb_FP6">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="7">
|
||||
<widget class="QCheckBox" name="cb_FP7">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="8">
|
||||
<widget class="QCheckBox" name="cb_FP8">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="lblScale">
|
||||
<property name="text">
|
||||
<string>Scale</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout" stretch="1,0,1,0,0">
|
||||
<item>
|
||||
<widget class="QComboBox" name="curveTypeCB">
|
||||
<property name="toolTip">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>Curve applied to the source.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="curveGVarCB">
|
||||
<property name="text">
|
||||
<string>GV</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="curveValueCB">
|
||||
<property name="whatsThis">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="curveValueSB"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="CurveImageWidget" name="curveImage">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<height>100</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<height>100</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>image</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="trimLabel">
|
||||
<property name="text">
|
||||
<string>Include Trim</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="lineNameLabel">
|
||||
<property name="text">
|
||||
<string>Line name</string>
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -499,21 +553,6 @@ If blank then the input is considered to be "ON" all the time.</string
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<tabstops>
|
||||
<tabstop>inputName</tabstop>
|
||||
<tabstop>lineName</tabstop>
|
||||
<tabstop>sourceCB</tabstop>
|
||||
<tabstop>dsbScale</tabstop>
|
||||
<tabstop>trimCB</tabstop>
|
||||
<tabstop>weightGV</tabstop>
|
||||
<tabstop>weightSB</tabstop>
|
||||
<tabstop>weightCB</tabstop>
|
||||
<tabstop>offsetGV</tabstop>
|
||||
<tabstop>offsetSB</tabstop>
|
||||
<tabstop>offsetCB</tabstop>
|
||||
<tabstop>curveTypeCB</tabstop>
|
||||
<tabstop>curveGVarCB</tabstop>
|
||||
<tabstop>curveValueCB</tabstop>
|
||||
<tabstop>curveValueSB</tabstop>
|
||||
<tabstop>cb_FP0</tabstop>
|
||||
<tabstop>cb_FP1</tabstop>
|
||||
<tabstop>cb_FP2</tabstop>
|
||||
@@ -522,9 +561,6 @@ If blank then the input is considered to be "ON" all the time.</string
|
||||
<tabstop>cb_FP5</tabstop>
|
||||
<tabstop>cb_FP6</tabstop>
|
||||
<tabstop>cb_FP7</tabstop>
|
||||
<tabstop>cb_FP8</tabstop>
|
||||
<tabstop>switchesCB</tabstop>
|
||||
<tabstop>sideCB</tabstop>
|
||||
<tabstop>buttonBox</tabstop>
|
||||
</tabstops>
|
||||
<resources>
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
/*
|
||||
* Copyright (C) OpenTX
|
||||
* Copyright (C) EdgeTX
|
||||
*
|
||||
* Based on code named
|
||||
* opentx - https://github.com/opentx/opentx
|
||||
* th9x - http://code.google.com/p/th9x
|
||||
* er9x - http://code.google.com/p/er9x
|
||||
* gruvin9x - http://code.google.com/p/gruvin9x
|
||||
@@ -24,6 +25,7 @@
|
||||
#include "filtereditemmodels.h"
|
||||
#include "helpers.h"
|
||||
#include "namevalidator.h"
|
||||
#include "sourcenumref.h"
|
||||
|
||||
MixerDialog::MixerDialog(QWidget *parent, ModelData & model, MixData * mixdata, GeneralSettings & generalSettings, Firmware * firmware,
|
||||
CompoundItemModelFactory * sharedItemModels) :
|
||||
@@ -40,7 +42,6 @@ MixerDialog::MixerDialog(QWidget *parent, ModelData & model, MixData * mixdata,
|
||||
Board::Type board = firmware->getBoard();
|
||||
|
||||
dialogFilteredItemModels = new FilteredItemModelFactory();
|
||||
int id;
|
||||
|
||||
QLabel * lb_fp[CPN_MAX_FLIGHT_MODES] = {ui->lb_FP0, ui->lb_FP1, ui->lb_FP2, ui->lb_FP3, ui->lb_FP4, ui->lb_FP5, ui->lb_FP6, ui->lb_FP7, ui->lb_FP8 };
|
||||
QCheckBox * tmp[CPN_MAX_FLIGHT_MODES] = {ui->cb_FP0, ui->cb_FP1, ui->cb_FP2, ui->cb_FP3, ui->cb_FP4, ui->cb_FP5, ui->cb_FP6, ui->cb_FP7, ui->cb_FP8 };
|
||||
@@ -50,34 +51,41 @@ MixerDialog::MixerDialog(QWidget *parent, ModelData & model, MixData * mixdata,
|
||||
|
||||
this->setWindowTitle(tr("DEST -> %1").arg(RawSource(SOURCE_TYPE_CH, md->destCh - 1).toString(&model, &generalSettings)));
|
||||
|
||||
id = dialogFilteredItemModels->registerItemModel(new FilteredItemModel(sharedItemModels->getItemModel(AbstractItemModel::IMID_RawSource),
|
||||
(RawSource::InputSourceGroups & ~RawSource::NoneGroup) | RawSource::ScriptsGroup),
|
||||
"RawSource");
|
||||
ui->sourceCB->setModel(dialogFilteredItemModels->getItemModel(id));
|
||||
int imId = dialogFilteredItemModels->registerItemModel(new FilteredItemModel(sharedItemModels->getItemModel(AbstractItemModel::IMID_RawSource),
|
||||
(RawSource::InputSourceGroups & ~RawSource::NoneGroup) | RawSource::ScriptsGroup),
|
||||
"RawSource");
|
||||
|
||||
ui->sourceCB->setSizeAdjustPolicy(QComboBox::AdjustToContents);
|
||||
ui->sourceCB->setModel(dialogFilteredItemModels->getItemModel(imId));
|
||||
ui->sourceCB->setCurrentIndex(ui->sourceCB->findData(md->srcRaw.toValue()));
|
||||
if (ui->sourceCB->currentIndex() < 0 && md->srcRaw.toValue() == 0)
|
||||
ui->sourceCB->setCurrentIndex(ui->sourceCB->count() / 2); // '----' not in list so set to first positive entry
|
||||
ui->sourceCB->setCurrentIndex(Helpers::getFirstPosValueIndex(ui->sourceCB));
|
||||
|
||||
int limit = firmware->getCapability(OffsetWeight);
|
||||
|
||||
id = dialogFilteredItemModels->registerItemModel(new FilteredItemModel(sharedItemModels->getItemModel(AbstractItemModel::IMID_GVarRef)), "GVarRef");
|
||||
imId = dialogFilteredItemModels->registerItemModel(new FilteredItemModel(sharedItemModels->getItemModel(AbstractItemModel::IMID_RawSource),
|
||||
(RawSource::AllSourceGroups & ~RawSource::NoneGroup & ~RawSource::ScriptsGroup)),
|
||||
"EditorSource");
|
||||
|
||||
gvWeightGroup = new GVarGroup(ui->weightGV, ui->weightSB, ui->weightCB, md->weight, model, 100, -limit, limit, 1.0,
|
||||
dialogFilteredItemModels->getItemModel(id));
|
||||
FilteredItemModel *esMdl = dialogFilteredItemModels->getItemModel(imId);
|
||||
|
||||
gvOffsetGroup = new GVarGroup(ui->offsetGV, ui->offsetSB, ui->offsetCB, md->sOffset, model, 0, -limit, limit, 1.0,
|
||||
dialogFilteredItemModels->getItemModel(id));
|
||||
weightEditor = new SourceNumRefEditor(md->weight, ui->chkWeightUseSource, ui->sbWeightValue, ui->cboWeightSource, 100, -limit, limit, 1,
|
||||
model, esMdl, this);
|
||||
|
||||
connect(weightEditor, &SourceNumRefEditor::resized, this, [=] () { shrink(); });
|
||||
|
||||
offsetEditor = new SourceNumRefEditor(md->sOffset, ui->chkOffsetUseSource, ui->sbOffsetValue, ui->cboOffsetSource, 0, -limit, limit, 1,
|
||||
model, esMdl, this);
|
||||
|
||||
connect(offsetEditor, &SourceNumRefEditor::resized, this, [=] () { shrink(); });
|
||||
|
||||
curveRefFilteredItemModels = new CurveRefFilteredFactory(sharedItemModels,
|
||||
firmware->getCapability(HasMixerExpo) ? 0 : FilteredItemModel::PositiveFilter);
|
||||
|
||||
curveGroup = new CurveReferenceUIManager(ui->curveTypeCB, ui->curveGVarCB, ui->curveValueSB, ui->curveValueCB, ui->curveImage, md->curve,
|
||||
model, sharedItemModels, curveRefFilteredItemModels, this);
|
||||
curveGroup = new CurveReferenceUIManager(ui->cboCurveType, ui->chkCurveUseSource, ui->sbCurveValue, ui->cboCurveSource, ui->cboCurveFunc,
|
||||
ui->imgCurve, md->curve, model, sharedItemModels, curveRefFilteredItemModels, esMdl, this);
|
||||
|
||||
connect(curveGroup, &CurveReferenceUIManager::resized, this, [=] () {
|
||||
this->adjustSize();
|
||||
this->adjustSize(); // second call seems to be required when hidden fields otherwise not all padding removed
|
||||
});
|
||||
connect(curveGroup, &CurveReferenceUIManager::resized, this, [=] () { shrink(); });
|
||||
|
||||
ui->MixDR_CB->setChecked(md->noExpo == 0);
|
||||
|
||||
@@ -129,9 +137,11 @@ MixerDialog::MixerDialog(QWidget *parent, ModelData & model, MixData * mixdata,
|
||||
}
|
||||
}
|
||||
|
||||
id = dialogFilteredItemModels->registerItemModel(new FilteredItemModel(sharedItemModels->getItemModel(AbstractItemModel::IMID_RawSwitch),
|
||||
RawSwitch::MixesContext), "RawSwitch");
|
||||
ui->switchesCB->setModel(dialogFilteredItemModels->getItemModel(id));
|
||||
imId = dialogFilteredItemModels->registerItemModel(new FilteredItemModel(sharedItemModels->getItemModel(AbstractItemModel::IMID_RawSwitch),
|
||||
RawSwitch::MixesContext),
|
||||
"RawSwitch");
|
||||
ui->switchesCB->setSizeAdjustPolicy(QComboBox::AdjustToContents);
|
||||
ui->switchesCB->setModel(dialogFilteredItemModels->getItemModel(imId));
|
||||
ui->switchesCB->setCurrentIndex(ui->switchesCB->findData(md->swtch.toValue()));
|
||||
ui->warningCB->setCurrentIndex(md->mixWarn);
|
||||
ui->mltpxCB->setCurrentIndex(md->mltpx);
|
||||
@@ -161,32 +171,33 @@ MixerDialog::MixerDialog(QWidget *parent, ModelData & model, MixData * mixdata,
|
||||
|
||||
valuesChanged();
|
||||
|
||||
connect(ui->mixerName,SIGNAL(editingFinished()),this,SLOT(valuesChanged()));
|
||||
connect(ui->sourceCB,SIGNAL(currentIndexChanged(int)),this,SLOT(valuesChanged()));
|
||||
connect(ui->trimCB,SIGNAL(currentIndexChanged(int)),this,SLOT(valuesChanged()));
|
||||
connect(ui->MixDR_CB,SIGNAL(toggled(bool)),this,SLOT(valuesChanged()));
|
||||
connect(ui->switchesCB,SIGNAL(currentIndexChanged(int)),this,SLOT(valuesChanged()));
|
||||
connect(ui->warningCB,SIGNAL(currentIndexChanged(int)),this,SLOT(valuesChanged()));
|
||||
connect(ui->mltpxCB,SIGNAL(currentIndexChanged(int)),this,SLOT(valuesChanged()));
|
||||
connect(ui->delayDownSB,SIGNAL(editingFinished()),this,SLOT(valuesChanged()));
|
||||
connect(ui->delayUpSB,SIGNAL(editingFinished()),this,SLOT(valuesChanged()));
|
||||
connect(ui->speedPrecCB,SIGNAL(currentIndexChanged(int)),this,SLOT(valuesChanged()));
|
||||
connect(ui->slowDownSB,SIGNAL(editingFinished()),this,SLOT(valuesChanged()));
|
||||
connect(ui->slowUpSB,SIGNAL(editingFinished()),this,SLOT(valuesChanged()));
|
||||
connect(ui->mixerName, SIGNAL(editingFinished()), this, SLOT(valuesChanged()));
|
||||
connect(ui->sourceCB, SIGNAL(currentIndexChanged(int)), this, SLOT(valuesChanged()));
|
||||
connect(ui->trimCB, SIGNAL(currentIndexChanged(int)), this, SLOT(valuesChanged()));
|
||||
connect(ui->MixDR_CB, SIGNAL(toggled(bool)), this, SLOT(valuesChanged()));
|
||||
connect(ui->switchesCB, SIGNAL(currentIndexChanged(int)), this, SLOT(valuesChanged()));
|
||||
connect(ui->warningCB, SIGNAL(currentIndexChanged(int)), this, SLOT(valuesChanged()));
|
||||
connect(ui->mltpxCB, SIGNAL(currentIndexChanged(int)), this, SLOT(valuesChanged()));
|
||||
connect(ui->delayDownSB, SIGNAL(editingFinished()), this, SLOT(valuesChanged()));
|
||||
connect(ui->delayUpSB, SIGNAL(editingFinished()), this, SLOT(valuesChanged()));
|
||||
connect(ui->speedPrecCB, SIGNAL(currentIndexChanged(int)), this, SLOT(valuesChanged()));
|
||||
connect(ui->slowDownSB, SIGNAL(editingFinished()), this, SLOT(valuesChanged()));
|
||||
connect(ui->slowUpSB, SIGNAL(editingFinished()), this, SLOT(valuesChanged()));
|
||||
|
||||
for (int i=0; i<CPN_MAX_FLIGHT_MODES; i++) {
|
||||
connect(cb_fp[i],SIGNAL(toggled(bool)),this,SLOT(valuesChanged()));
|
||||
for (int i = 0; i < CPN_MAX_FLIGHT_MODES; i++) {
|
||||
connect(cb_fp[i], SIGNAL(toggled(bool)), this, SLOT(valuesChanged()));
|
||||
}
|
||||
|
||||
adjustSize();
|
||||
shrink();
|
||||
}
|
||||
|
||||
MixerDialog::~MixerDialog()
|
||||
{
|
||||
delete ui;
|
||||
delete gvWeightGroup;
|
||||
delete gvOffsetGroup;
|
||||
delete weightEditor;
|
||||
delete offsetEditor;
|
||||
delete dialogFilteredItemModels;
|
||||
delete curveRefFilteredItemModels;
|
||||
}
|
||||
|
||||
void MixerDialog::changeEvent(QEvent *e)
|
||||
@@ -296,3 +307,9 @@ void MixerDialog::fmInvertAll()
|
||||
lock = false;
|
||||
valuesChanged();
|
||||
}
|
||||
|
||||
void MixerDialog::shrink()
|
||||
{
|
||||
this->adjustSize();
|
||||
this->resize(0, 0);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
/*
|
||||
* Copyright (C) OpenTX
|
||||
* Copyright (C) EdgeTX
|
||||
*
|
||||
* Based on code named
|
||||
* opentx - https://github.com/opentx/opentx
|
||||
* th9x - http://code.google.com/p/th9x
|
||||
* er9x - http://code.google.com/p/er9x
|
||||
* gruvin9x - http://code.google.com/p/gruvin9x
|
||||
@@ -23,11 +24,11 @@
|
||||
#include <QtWidgets>
|
||||
#include "eeprominterface.h"
|
||||
|
||||
class GVarGroup;
|
||||
class CompoundItemModelFactory;
|
||||
class FilteredItemModelFactory;
|
||||
class CurveRefFilteredFactory;
|
||||
class CurveReferenceUIManager;
|
||||
class SourceNumRefEditor;
|
||||
|
||||
namespace Ui {
|
||||
class MixerDialog;
|
||||
@@ -57,10 +58,12 @@ class MixerDialog : public QDialog {
|
||||
Firmware * firmware;
|
||||
MixData *md;
|
||||
bool lock;
|
||||
GVarGroup * gvWeightGroup;
|
||||
GVarGroup * gvOffsetGroup;
|
||||
SourceNumRefEditor * weightEditor;
|
||||
SourceNumRefEditor * offsetEditor;
|
||||
CurveReferenceUIManager * curveGroup;
|
||||
QCheckBox * cb_fp[CPN_MAX_FLIGHT_MODES];
|
||||
FilteredItemModelFactory *dialogFilteredItemModels;
|
||||
CurveRefFilteredFactory *curveRefFilteredItemModels;
|
||||
|
||||
void shrink();
|
||||
};
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>556</width>
|
||||
<width>752</width>
|
||||
<height>623</height>
|
||||
</rect>
|
||||
</property>
|
||||
@@ -29,46 +29,24 @@
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<layout class="QGridLayout" name="gridLayout_2" columnstretch="0,0,0">
|
||||
<item row="8" column="1" colspan="2">
|
||||
<widget class="QComboBox" name="switchesCB">
|
||||
<property name="whatsThis">
|
||||
<string>Switch used by the mix.
|
||||
If blank then the mix is considered to be "ON" all the time.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1" colspan="2">
|
||||
<widget class="QComboBox" name="sourceCB">
|
||||
<property name="whatsThis">
|
||||
<string>The source for the mixer</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label_curve">
|
||||
<property name="text">
|
||||
<string>Curve</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1" colspan="2">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout" stretch="0,0,0,1">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="weightGV">
|
||||
<widget class="QCheckBox" name="chkWeightUseSource">
|
||||
<property name="text">
|
||||
<string>GV</string>
|
||||
<string>Source</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="weightCB">
|
||||
<widget class="QComboBox" name="cboWeightSource">
|
||||
<property name="whatsThis">
|
||||
<string>The source for the mixer</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="weightSB"/>
|
||||
<widget class="QSpinBox" name="sbWeightValue"/>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_2">
|
||||
@@ -85,17 +63,97 @@ If blank then the mix is considered to be "ON" all the time.</string>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="10" column="1" colspan="2">
|
||||
<widget class="QComboBox" name="mltpxCB">
|
||||
<property name="whatsThis">
|
||||
<string>Multiplexer
|
||||
|
||||
This determines how mixer values are added.
|
||||
|
||||
"+" means the value of the current mix is added to the previous mixes in the same channel.
|
||||
"*" means the value of the current mix is amultiplied with the previous mixes in the same channel.
|
||||
"R" means the value replaces the previous values. If the switch is off the value will be ignored.</string>
|
||||
<item row="11" column="0">
|
||||
<widget class="QLabel" name="label_15">
|
||||
<property name="text">
|
||||
<string>Slow up/dn prec</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QComboBox" name="sourceCB"/>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="trimLabel">
|
||||
<property name="text">
|
||||
<string>Include Trim</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="11" column="1">
|
||||
<widget class="QComboBox" name="speedPrecCB">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>0.0</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>0.00</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="1">
|
||||
<widget class="QComboBox" name="switchesCB"/>
|
||||
</item>
|
||||
<item row="3" column="1" colspan="2">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2" stretch="0,0,0,1">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="chkOffsetUseSource">
|
||||
<property name="text">
|
||||
<string>Source</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="cboOffsetSource">
|
||||
<property name="whatsThis">
|
||||
<string>The source for the mixer</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="sbOffsetValue"/>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="9" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Warning</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Weight</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="0">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>Switch</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="1">
|
||||
<widget class="QComboBox" name="mltpxCB">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>ADD</string>
|
||||
@@ -113,39 +171,36 @@ This determines how mixer values are added.
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1" colspan="2">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2" stretch="0,0,0,1">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="offsetGV">
|
||||
<property name="text">
|
||||
<string>GV</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="offsetCB">
|
||||
<property name="whatsThis">
|
||||
<string>The source for the mixer</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="offsetSB"/>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="label_MixDR">
|
||||
<property name="text">
|
||||
<string>Include DR/Expo</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_10">
|
||||
<property name="text">
|
||||
<string>Source</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="0">
|
||||
<widget class="QLabel" name="label_7">
|
||||
<property name="text">
|
||||
<string>Multiplex</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label_curve">
|
||||
<property name="text">
|
||||
<string>Curve</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="mixerName"/>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="QComboBox" name="trimCB">
|
||||
@@ -161,32 +216,11 @@ This determines how mixer values are added.
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="1" colspan="2">
|
||||
<widget class="QComboBox" name="warningCB">
|
||||
<item row="4" column="1">
|
||||
<widget class="QComboBox" name="cboCurveType">
|
||||
<property name="whatsThis">
|
||||
<string>Mixer warning.
|
||||
Setting this value will cause a beep to be emmitted when this value is active.</string>
|
||||
<string>The curve used by the mix</string>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>OFF</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>1 Beep</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>2 Beep</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>3 Beep</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
@@ -196,55 +230,6 @@ Setting this value will cause a beep to be emmitted when this value is active.</
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="0">
|
||||
<widget class="QLabel" name="label_7">
|
||||
<property name="text">
|
||||
<string>Switch</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="0">
|
||||
<widget class="QLabel" name="label_phases">
|
||||
<property name="text">
|
||||
<string>Flight modes</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="label_MixDR">
|
||||
<property name="text">
|
||||
<string>Include DR/Expo</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="0">
|
||||
<widget class="QLabel" name="label_8">
|
||||
<property name="text">
|
||||
<string>Warning</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QComboBox" name="curveTypeCB">
|
||||
<property name="whatsThis">
|
||||
<string>The curve used by the mix</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="0">
|
||||
<widget class="QLabel" name="label_9">
|
||||
<property name="text">
|
||||
<string>Multiplex</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Source</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_name">
|
||||
<property name="text">
|
||||
@@ -252,212 +237,30 @@ Setting this value will cause a beep to be emmitted when this value is active.</
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="1" colspan="2">
|
||||
<layout class="QGridLayout" name="gridLayout_4">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="lb_FP0">
|
||||
<property name="text">
|
||||
<string notr="true">0</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLabel" name="lb_FP1">
|
||||
<property name="text">
|
||||
<string notr="true">1</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QLabel" name="lb_FP2">
|
||||
<property name="text">
|
||||
<string notr="true">2</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
<widget class="QLabel" name="lb_FP3">
|
||||
<property name="text">
|
||||
<string notr="true">3</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="4">
|
||||
<widget class="QLabel" name="lb_FP4">
|
||||
<property name="text">
|
||||
<string notr="true">4</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="5">
|
||||
<widget class="QLabel" name="lb_FP5">
|
||||
<property name="text">
|
||||
<string notr="true">5</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="6">
|
||||
<widget class="QLabel" name="lb_FP6">
|
||||
<property name="text">
|
||||
<string notr="true">6</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="7">
|
||||
<widget class="QLabel" name="lb_FP7">
|
||||
<property name="text">
|
||||
<string notr="true">7</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="8">
|
||||
<widget class="QLabel" name="lb_FP8">
|
||||
<property name="text">
|
||||
<string notr="true">8</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QCheckBox" name="cb_FP0">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QCheckBox" name="cb_FP1">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QCheckBox" name="cb_FP2">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="3">
|
||||
<widget class="QCheckBox" name="cb_FP3">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="4">
|
||||
<widget class="QCheckBox" name="cb_FP4">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="5">
|
||||
<widget class="QCheckBox" name="cb_FP5">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="6">
|
||||
<widget class="QCheckBox" name="cb_FP6">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="7">
|
||||
<widget class="QCheckBox" name="cb_FP7">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="8">
|
||||
<widget class="QCheckBox" name="cb_FP8">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Weight</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>Offset</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="trimLabel">
|
||||
<property name="text">
|
||||
<string>Include Trim</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1" colspan="2">
|
||||
<widget class="QLineEdit" name="mixerName">
|
||||
<property name="maxLength">
|
||||
<number>6</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="2">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3" stretch="0,0,0,0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3" stretch="0,0,0,0,0,0">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="curveGVarCB">
|
||||
<widget class="QCheckBox" name="chkCurveUseSource">
|
||||
<property name="text">
|
||||
<string>GV</string>
|
||||
<string>Source</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="curveValueCB">
|
||||
<widget class="QComboBox" name="cboCurveSource">
|
||||
<property name="whatsThis">
|
||||
<string>The source for the mixer</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="curveValueSB"/>
|
||||
<widget class="QSpinBox" name="sbCurveValue"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="CurveImageWidget" name="curveImage">
|
||||
<widget class="QComboBox" name="cboCurveFunc"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="CurveImageWidget" name="imgCurve">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
@@ -475,27 +278,227 @@ Setting this value will cause a beep to be emmitted when this value is active.</
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="11" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<item row="7" column="0">
|
||||
<widget class="QLabel" name="label_phases">
|
||||
<property name="text">
|
||||
<string>Slow up/dn prec</string>
|
||||
<string>Flight modes</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="11" column="1" colspan="2">
|
||||
<widget class="QComboBox" name="speedPrecCB">
|
||||
<item row="9" column="1">
|
||||
<widget class="QComboBox" name="warningCB">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>0.0</string>
|
||||
<string>OFF</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>0.00</string>
|
||||
<string>1 Beep</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>2 Beeps</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>3 Beeps</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="1" colspan="2">
|
||||
<layout class="QGridLayout" name="gridLayout_4">
|
||||
<item row="0" column="4">
|
||||
<widget class="QLabel" name="lb_FP4">
|
||||
<property name="text">
|
||||
<string notr="true">4</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
<widget class="QLabel" name="lb_FP3">
|
||||
<property name="text">
|
||||
<string notr="true">3</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="7">
|
||||
<widget class="QLabel" name="lb_FP7">
|
||||
<property name="text">
|
||||
<string notr="true">7</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QCheckBox" name="cb_FP0">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QLabel" name="lb_FP2">
|
||||
<property name="text">
|
||||
<string notr="true">2</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="6">
|
||||
<widget class="QCheckBox" name="cb_FP6">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="8">
|
||||
<widget class="QCheckBox" name="cb_FP8">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="8">
|
||||
<widget class="QLabel" name="lb_FP8">
|
||||
<property name="text">
|
||||
<string notr="true">8</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="7">
|
||||
<widget class="QCheckBox" name="cb_FP7">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QCheckBox" name="cb_FP1">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="5">
|
||||
<widget class="QCheckBox" name="cb_FP5">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLabel" name="lb_FP1">
|
||||
<property name="text">
|
||||
<string notr="true">1</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="lb_FP0">
|
||||
<property name="text">
|
||||
<string notr="true">0</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="6">
|
||||
<widget class="QLabel" name="lb_FP6">
|
||||
<property name="text">
|
||||
<string notr="true">6</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QCheckBox" name="cb_FP2">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="5">
|
||||
<widget class="QLabel" name="lb_FP5">
|
||||
<property name="text">
|
||||
<string notr="true">5</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="4">
|
||||
<widget class="QCheckBox" name="cb_FP4">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="3">
|
||||
<widget class="QCheckBox" name="cb_FP3">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="9">
|
||||
<spacer name="horizontalSpacer_4">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>Offset</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
@@ -517,41 +520,7 @@ Setting this value will cause a beep to be emmitted when this value is active.</
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<layout class="QGridLayout" name="gridLayout" columnstretch="0,0,0">
|
||||
<item row="0" column="1">
|
||||
<widget class="QLabel" name="label_13">
|
||||
<property name="text">
|
||||
<string>Delay</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QLabel" name="label_14">
|
||||
<property name="text">
|
||||
<string>Slow</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_12">
|
||||
<property name="text">
|
||||
<string>Up</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_11">
|
||||
<property name="text">
|
||||
<string>Down</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<layout class="QGridLayout" name="gridLayout" columnstretch="0,0,0,0">
|
||||
<item row="1" column="2">
|
||||
<widget class="QDoubleSpinBox" name="slowUpSB">
|
||||
<property name="whatsThis">
|
||||
@@ -565,35 +534,6 @@ p, li { white-space: pre-wrap; }
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">If Delay is not zero the actuation of the mix will be delayed by the specified amount of seconds.</p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">If Slow is not zero then the speed of the mix will be set by the value specified -&gt; the value states the number of seconds it takes to transit from -100 to 100.</p></body></html></string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="decimals">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>7.500000000000000</double>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>0.500000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<widget class="QDoubleSpinBox" name="slowDownSB">
|
||||
<property name="whatsThis">
|
||||
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
p, li { white-space: pre-wrap; }
|
||||
</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600; text-decoration: underline;">Delay ans Slow</span></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-weight:600; text-decoration: underline;"></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">These values control the speed and delay of the output of the mix. </p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">If Delay is not zero the actuation of the mix will be delayed by the specified amount of seconds.</p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">If Slow is not zero then the speed of the mix will be set by the value specified -&gt; the value states the number of seconds it takes to transit from -100 to 100.</p></body></html></string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
@@ -633,6 +573,76 @@ p, li { white-space: pre-wrap; }
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<widget class="QDoubleSpinBox" name="slowDownSB">
|
||||
<property name="whatsThis">
|
||||
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
p, li { white-space: pre-wrap; }
|
||||
</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600; text-decoration: underline;">Delay ans Slow</span></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-weight:600; text-decoration: underline;"></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">These values control the speed and delay of the output of the mix. </p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">If Delay is not zero the actuation of the mix will be delayed by the specified amount of seconds.</p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">If Slow is not zero then the speed of the mix will be set by the value specified -&gt; the value states the number of seconds it takes to transit from -100 to 100.</p></body></html></string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="decimals">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>7.500000000000000</double>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>0.500000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_11">
|
||||
<property name="text">
|
||||
<string>Down</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_12">
|
||||
<property name="text">
|
||||
<string>Up</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLabel" name="label_13">
|
||||
<property name="text">
|
||||
<string>Delay</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QLabel" name="label_14">
|
||||
<property name="text">
|
||||
<string>Slow</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QDoubleSpinBox" name="delayDownSB">
|
||||
<property name="whatsThis">
|
||||
@@ -668,18 +678,16 @@ p, li { white-space: pre-wrap; }
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<tabstops>
|
||||
<tabstop>mixerName</tabstop>
|
||||
<tabstop>sourceCB</tabstop>
|
||||
<tabstop>weightGV</tabstop>
|
||||
<tabstop>weightCB</tabstop>
|
||||
<tabstop>weightSB</tabstop>
|
||||
<tabstop>offsetGV</tabstop>
|
||||
<tabstop>offsetCB</tabstop>
|
||||
<tabstop>offsetSB</tabstop>
|
||||
<tabstop>curveTypeCB</tabstop>
|
||||
<tabstop>curveGVarCB</tabstop>
|
||||
<tabstop>curveValueCB</tabstop>
|
||||
<tabstop>curveValueSB</tabstop>
|
||||
<tabstop>chkWeightUseSource</tabstop>
|
||||
<tabstop>cboWeightSource</tabstop>
|
||||
<tabstop>sbWeightValue</tabstop>
|
||||
<tabstop>chkOffsetUseSource</tabstop>
|
||||
<tabstop>cboOffsetSource</tabstop>
|
||||
<tabstop>sbOffsetValue</tabstop>
|
||||
<tabstop>cboCurveType</tabstop>
|
||||
<tabstop>chkCurveUseSource</tabstop>
|
||||
<tabstop>cboCurveSource</tabstop>
|
||||
<tabstop>sbCurveValue</tabstop>
|
||||
<tabstop>trimCB</tabstop>
|
||||
<tabstop>MixDR_CB</tabstop>
|
||||
<tabstop>cb_FP0</tabstop>
|
||||
@@ -691,9 +699,6 @@ p, li { white-space: pre-wrap; }
|
||||
<tabstop>cb_FP6</tabstop>
|
||||
<tabstop>cb_FP7</tabstop>
|
||||
<tabstop>cb_FP8</tabstop>
|
||||
<tabstop>switchesCB</tabstop>
|
||||
<tabstop>warningCB</tabstop>
|
||||
<tabstop>mltpxCB</tabstop>
|
||||
<tabstop>delayUpSB</tabstop>
|
||||
<tabstop>delayDownSB</tabstop>
|
||||
<tabstop>slowUpSB</tabstop>
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#include "appdata.h"
|
||||
#include "adjustmentreference.h"
|
||||
#include "curveimage.h"
|
||||
#include "sourcenumref.h"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QPainter>
|
||||
@@ -366,9 +367,9 @@ QString ModelPrinter::printInputLine(const ExpoData & input)
|
||||
str += " " + tr("Scale(%1)").arg(input.scale * range.step).toHtmlEscaped();
|
||||
}
|
||||
|
||||
str += " " + tr("Weight(%1)").arg(AdjustmentReference(input.weight).toString(&model, true)).toHtmlEscaped();
|
||||
str += " " + tr("Weight(%1)").arg(SourceNumRef(input.weight).toString(&model, &generalSettings)).toHtmlEscaped();
|
||||
if (input.curve.value)
|
||||
str += " " + input.curve.toString(&model).toHtmlEscaped();
|
||||
str += " " + input.curve.toString(&model, true, &generalSettings).toHtmlEscaped();
|
||||
|
||||
QString flightModesStr = printFlightModes(input.flightModes);
|
||||
if (!flightModesStr.isEmpty())
|
||||
@@ -386,7 +387,7 @@ QString ModelPrinter::printInputLine(const ExpoData & input)
|
||||
}
|
||||
|
||||
if (input.offset)
|
||||
str += " " + tr("Offset(%1)").arg(AdjustmentReference(input.offset).toString(&model)).toHtmlEscaped();
|
||||
str += " " + tr("Offset(%1)").arg(SourceNumRef(input.offset).toString(&model, &generalSettings)).toHtmlEscaped();
|
||||
if (firmware->getCapability(HasExpoNames) && input.name[0])
|
||||
str += QString(" [%1]").arg(input.name).toHtmlEscaped();
|
||||
|
||||
@@ -417,7 +418,7 @@ QString ModelPrinter::printMixerLine(const MixData & mix, bool showMultiplex, in
|
||||
if (mix.mltpx == MLTPX_MUL && !showMultiplex)
|
||||
str += " " + tr("MULT!").toHtmlEscaped();
|
||||
else
|
||||
str += " " + tr("Weight(%1)").arg(AdjustmentReference(mix.weight).toString(&model, true)).toHtmlEscaped();
|
||||
str += " " + tr("Weight(%1)").arg(SourceNumRef(mix.weight).toString(&model, &generalSettings)).toHtmlEscaped();
|
||||
|
||||
QString flightModesStr = printFlightModes(mix.flightModes);
|
||||
if (!flightModesStr.isEmpty())
|
||||
@@ -434,9 +435,9 @@ QString ModelPrinter::printMixerLine(const MixData & mix, bool showMultiplex, in
|
||||
if (firmware->getCapability(HasNoExpo) && mix.noExpo)
|
||||
str += " " + tr("No DR/Expo").toHtmlEscaped();
|
||||
if (mix.sOffset)
|
||||
str += " " + tr("Offset(%1)").arg(AdjustmentReference(mix.sOffset).toString(&model)).toHtmlEscaped();
|
||||
str += " " + tr("Offset(%1)").arg(SourceNumRef(mix.sOffset).toString(&model, &generalSettings)).toHtmlEscaped();
|
||||
if (mix.curve.value)
|
||||
str += " " + mix.curve.toString(&model).toHtmlEscaped();
|
||||
str += " " + mix.curve.toString(&model, true, &generalSettings).toHtmlEscaped();
|
||||
int scale = firmware->getCapability(SlowScale);
|
||||
if (scale == 0)
|
||||
scale = 1;
|
||||
|
||||
@@ -44,7 +44,7 @@ void CurveImageWidget::set(ModelData * model, Firmware * firmware, CompoundItemM
|
||||
|
||||
void CurveImageWidget::setIndex(int index)
|
||||
{
|
||||
this->index = (index >= 0 && index < CPN_MAX_CURVES) ? index : -1;
|
||||
this->index = index;
|
||||
}
|
||||
|
||||
void CurveImageWidget::setGrid(QColor color, qreal width)
|
||||
@@ -63,8 +63,8 @@ int CurveImageWidget::edit()
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
if (index >= 0 && index < CPN_MAX_CURVES) {
|
||||
CurveDialog *dlg = new CurveDialog(this, *model, index, firmware, sharedItemModels);
|
||||
if (abs(index) > 0 && abs(index) <= CPN_MAX_CURVES) {
|
||||
CurveDialog *dlg = new CurveDialog(this, *model, abs(index) - 1, firmware, sharedItemModels);
|
||||
ret = dlg->exec();
|
||||
delete dlg;
|
||||
}
|
||||
@@ -74,11 +74,13 @@ int CurveImageWidget::edit()
|
||||
|
||||
void CurveImageWidget::draw()
|
||||
{
|
||||
if (index >= 0 && index < CPN_MAX_CURVES) {
|
||||
if (abs(index) > 0 && abs(index) <= CPN_MAX_CURVES) {
|
||||
CurveImage *curveImage = new CurveImage(gridColor, gridWidth);
|
||||
curveImage->drawCurve(model->curves[index], penColor, penWidth);
|
||||
curveImage->drawCurve(model->curves[abs(index) - 1], penColor, penWidth);
|
||||
|
||||
QImage image = curveImage->get();
|
||||
if (index < 0)
|
||||
image = image.mirrored(true, false);
|
||||
setPixmap(QPixmap::fromImage(image.scaled(height(), width())));
|
||||
|
||||
delete curveImage;
|
||||
|
||||
@@ -34,7 +34,8 @@ class CurveImageWidget : public QLabel
|
||||
CurveImageWidget(QWidget * parent);
|
||||
virtual ~CurveImageWidget() {}
|
||||
|
||||
void set(ModelData * model, Firmware * firmware, CompoundItemModelFactory * sharedItemModels, int index, QColor penColor = Qt::black, qreal penWidth = 2);
|
||||
void set(ModelData * model, Firmware * firmware, CompoundItemModelFactory * sharedItemModels, int index, QColor penColor = Qt::black,
|
||||
qreal penWidth = 2);
|
||||
void setIndex(int index);
|
||||
void setGrid(QColor color = Qt::darkGray, qreal width = 1);
|
||||
void setPen(QColor color = Qt::black, qreal width = 2);
|
||||
|
||||
Reference in New Issue
Block a user