Input and mix source list use filter to remove none entry
This commit is contained in:
@@ -38,9 +38,9 @@ ExpoDialog::ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expoData, G
|
|||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
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 };
|
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 };
|
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 };
|
||||||
for (int i=0; i<CPN_MAX_FLIGHT_MODES; i++) {
|
for (int i = 0; i < CPN_MAX_FLIGHT_MODES; i++) {
|
||||||
cb_fp[i] = tmp[i];
|
cb_fp[i] = tmp[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -57,11 +57,11 @@ ExpoDialog::ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expoData, G
|
|||||||
ui->switchesCB->setModel(rawSwitchModel);
|
ui->switchesCB->setModel(rawSwitchModel);
|
||||||
ui->switchesCB->setCurrentIndex(ui->switchesCB->findData(ed->swtch.toValue()));
|
ui->switchesCB->setCurrentIndex(ui->switchesCB->findData(ed->swtch.toValue()));
|
||||||
|
|
||||||
ui->sideCB->setCurrentIndex(ed->mode-1);
|
ui->sideCB->setCurrentIndex(ed->mode - 1);
|
||||||
|
|
||||||
if (!firmware->getCapability(FlightModes)) {
|
if (!firmware->getCapability(FlightModes)) {
|
||||||
ui->label_phases->hide();
|
ui->label_phases->hide();
|
||||||
for (int i=0; i<CPN_MAX_FLIGHT_MODES; i++) {
|
for (int i = 0; i < CPN_MAX_FLIGHT_MODES; i++) {
|
||||||
lb_fp[i]->hide();
|
lb_fp[i]->hide();
|
||||||
cb_fp[i]->hide();
|
cb_fp[i]->hide();
|
||||||
}
|
}
|
||||||
@@ -71,13 +71,13 @@ ExpoDialog::ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expoData, G
|
|||||||
ui->label_phases->setContextMenuPolicy(Qt::CustomContextMenu);
|
ui->label_phases->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||||
connect(ui->label_phases, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(label_phases_customContextMenuRequested(const QPoint &)));
|
connect(ui->label_phases, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(label_phases_customContextMenuRequested(const QPoint &)));
|
||||||
int mask = 1;
|
int mask = 1;
|
||||||
for (int i=0; i<CPN_MAX_FLIGHT_MODES; i++) {
|
for (int i = 0; i < CPN_MAX_FLIGHT_MODES; i++) {
|
||||||
if ((ed->flightModes & mask) == 0) {
|
if ((ed->flightModes & mask) == 0) {
|
||||||
cb_fp[i]->setChecked(true);
|
cb_fp[i]->setChecked(true);
|
||||||
}
|
}
|
||||||
mask <<= 1;
|
mask <<= 1;
|
||||||
}
|
}
|
||||||
for (int i=firmware->getCapability(FlightModes); i<CPN_MAX_FLIGHT_MODES; i++) {
|
for (int i = firmware->getCapability(FlightModes); i < CPN_MAX_FLIGHT_MODES; i++) {
|
||||||
lb_fp[i]->hide();
|
lb_fp[i]->hide();
|
||||||
cb_fp[i]->hide();
|
cb_fp[i]->hide();
|
||||||
}
|
}
|
||||||
@@ -87,7 +87,6 @@ ExpoDialog::ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expoData, G
|
|||||||
ui->inputName->setMaxLength(firmware->getCapability(InputsLength));
|
ui->inputName->setMaxLength(firmware->getCapability(InputsLength));
|
||||||
ui->sourceCB->setModel(rawSourceModel);
|
ui->sourceCB->setModel(rawSourceModel);
|
||||||
ui->sourceCB->setCurrentIndex(ui->sourceCB->findData(ed->srcRaw.toValue()));
|
ui->sourceCB->setCurrentIndex(ui->sourceCB->findData(ed->srcRaw.toValue()));
|
||||||
ui->sourceCB->removeItem(0);
|
|
||||||
ui->inputName->setValidator(new QRegExpValidator(rx, this));
|
ui->inputName->setValidator(new QRegExpValidator(rx, this));
|
||||||
ui->inputName->setText(inputName);
|
ui->inputName->setText(inputName);
|
||||||
}
|
}
|
||||||
@@ -100,8 +99,8 @@ ExpoDialog::ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expoData, G
|
|||||||
ui->trimCB->hide();
|
ui->trimCB->hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
for(int i=0; i < getBoardCapability(getCurrentBoard(), Board::NumTrims); i++) {
|
for(int i = 0; i < getBoardCapability(getCurrentBoard(), Board::NumTrims); i++) {
|
||||||
ui->trimCB->addItem(RawSource(SOURCE_TYPE_TRIM, i).toString(), i+1);
|
ui->trimCB->addItem(RawSource(SOURCE_TYPE_TRIM, i).toString(), i + 1);
|
||||||
}
|
}
|
||||||
ui->trimCB->setCurrentIndex(1 - ed->carryTrim);
|
ui->trimCB->setCurrentIndex(1 - ed->carryTrim);
|
||||||
|
|
||||||
@@ -126,7 +125,7 @@ ExpoDialog::ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expoData, G
|
|||||||
connect(ui->trimCB, SIGNAL(currentIndexChanged(int)), this, SLOT(valuesChanged()));
|
connect(ui->trimCB, SIGNAL(currentIndexChanged(int)), this, SLOT(valuesChanged()));
|
||||||
connect(ui->switchesCB, SIGNAL(currentIndexChanged(int)), this, SLOT(valuesChanged()));
|
connect(ui->switchesCB, SIGNAL(currentIndexChanged(int)), this, SLOT(valuesChanged()));
|
||||||
connect(ui->sideCB, SIGNAL(currentIndexChanged(int)), this, SLOT(valuesChanged()));
|
connect(ui->sideCB, SIGNAL(currentIndexChanged(int)), this, SLOT(valuesChanged()));
|
||||||
for (int i=0; i<CPN_MAX_FLIGHT_MODES; i++) {
|
for (int i = 0; i < CPN_MAX_FLIGHT_MODES; i++) {
|
||||||
connect(cb_fp[i], SIGNAL(toggled(bool)), this, SLOT(valuesChanged()));
|
connect(cb_fp[i], SIGNAL(toggled(bool)), this, SLOT(valuesChanged()));
|
||||||
}
|
}
|
||||||
if (firmware->getCapability(VirtualInputs)) {
|
if (firmware->getCapability(VirtualInputs)) {
|
||||||
@@ -183,7 +182,7 @@ void ExpoDialog::valuesChanged()
|
|||||||
}
|
}
|
||||||
|
|
||||||
ed->flightModes = 0;
|
ed->flightModes = 0;
|
||||||
for (int i=CPN_MAX_FLIGHT_MODES-1; i>=0 ; i--) {
|
for (int i = CPN_MAX_FLIGHT_MODES - 1; i >= 0 ; i--) {
|
||||||
if (!cb_fp[i]->checkState()) {
|
if (!cb_fp[i]->checkState()) {
|
||||||
ed->flightModes++;
|
ed->flightModes++;
|
||||||
}
|
}
|
||||||
@@ -214,7 +213,7 @@ void ExpoDialog::label_phases_customContextMenuRequested(const QPoint & pos)
|
|||||||
void ExpoDialog::fmClearAll()
|
void ExpoDialog::fmClearAll()
|
||||||
{
|
{
|
||||||
lock = true;
|
lock = true;
|
||||||
for (int i=0; i<CPN_MAX_FLIGHT_MODES; i++) {
|
for (int i = 0; i < CPN_MAX_FLIGHT_MODES; i++) {
|
||||||
cb_fp[i]->setChecked(false);
|
cb_fp[i]->setChecked(false);
|
||||||
}
|
}
|
||||||
lock = false;
|
lock = false;
|
||||||
@@ -224,7 +223,7 @@ void ExpoDialog::fmClearAll()
|
|||||||
void ExpoDialog::fmSetAll()
|
void ExpoDialog::fmSetAll()
|
||||||
{
|
{
|
||||||
lock = true;
|
lock = true;
|
||||||
for (int i=0; i<CPN_MAX_FLIGHT_MODES; i++) {
|
for (int i = 0; i < CPN_MAX_FLIGHT_MODES; i++) {
|
||||||
cb_fp[i]->setChecked(true);
|
cb_fp[i]->setChecked(true);
|
||||||
}
|
}
|
||||||
lock = false;
|
lock = false;
|
||||||
@@ -234,7 +233,7 @@ void ExpoDialog::fmSetAll()
|
|||||||
void ExpoDialog::fmInvertAll()
|
void ExpoDialog::fmInvertAll()
|
||||||
{
|
{
|
||||||
lock = true;
|
lock = true;
|
||||||
for (int i=0; i<CPN_MAX_FLIGHT_MODES; i++) {
|
for (int i = 0; i < CPN_MAX_FLIGHT_MODES; i++) {
|
||||||
cb_fp[i]->setChecked(!cb_fp[i]->isChecked());
|
cb_fp[i]->setChecked(!cb_fp[i]->isChecked());
|
||||||
}
|
}
|
||||||
lock = false;
|
lock = false;
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ InputsPanel::InputsPanel(QWidget *parent, ModelData & model, GeneralSettings & g
|
|||||||
expoInserted(false),
|
expoInserted(false),
|
||||||
modelPrinter(firmware, generalSettings, model)
|
modelPrinter(firmware, generalSettings, model)
|
||||||
{
|
{
|
||||||
rawSourceModel = new RawItemFilteredModel(rawSourceItemModel, (RawSource::InputSourceGroups & ~RawSource::InputsGroup), this);
|
rawSourceModel = new RawItemFilteredModel(rawSourceItemModel, (RawSource::InputSourceGroups & ~ RawSource::NoneGroup & ~RawSource::InputsGroup), this);
|
||||||
connect(rawSourceModel, &RawItemFilteredModel::dataAboutToBeUpdated, this, &InputsPanel::onModelDataAboutToBeUpdated);
|
connect(rawSourceModel, &RawItemFilteredModel::dataAboutToBeUpdated, this, &InputsPanel::onModelDataAboutToBeUpdated);
|
||||||
connect(rawSourceModel, &RawItemFilteredModel::dataUpdateComplete, this, &InputsPanel::onModelDataUpdateComplete);
|
connect(rawSourceModel, &RawItemFilteredModel::dataUpdateComplete, this, &InputsPanel::onModelDataUpdateComplete);
|
||||||
|
|
||||||
|
|||||||
@@ -47,7 +47,6 @@ MixerDialog::MixerDialog(QWidget *parent, ModelData & model, MixData * mixdata,
|
|||||||
|
|
||||||
ui->sourceCB->setModel(rawSourceModel);
|
ui->sourceCB->setModel(rawSourceModel);
|
||||||
ui->sourceCB->setCurrentIndex(ui->sourceCB->findData(md->srcRaw.toValue()));
|
ui->sourceCB->setCurrentIndex(ui->sourceCB->findData(md->srcRaw.toValue()));
|
||||||
ui->sourceCB->removeItem(0);
|
|
||||||
|
|
||||||
int limit = firmware->getCapability(OffsetWeight);
|
int limit = firmware->getCapability(OffsetWeight);
|
||||||
|
|
||||||
@@ -191,7 +190,7 @@ void MixerDialog::valuesChanged()
|
|||||||
strcpy(md->name, ui->mixerName->text().toLatin1());
|
strcpy(md->name, ui->mixerName->text().toLatin1());
|
||||||
|
|
||||||
md->flightModes = 0;
|
md->flightModes = 0;
|
||||||
for (int i = CPN_MAX_FLIGHT_MODES-1; i >= 0 ; i--) {
|
for (int i = CPN_MAX_FLIGHT_MODES - 1; i >= 0 ; i--) {
|
||||||
if (!cb_fp[i]->checkState()) {
|
if (!cb_fp[i]->checkState()) {
|
||||||
md->flightModes++;
|
md->flightModes++;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ MixesPanel::MixesPanel(QWidget *parent, ModelData & model, GeneralSettings & gen
|
|||||||
highlightedSource(0),
|
highlightedSource(0),
|
||||||
modelPrinter(firmware, generalSettings, model)
|
modelPrinter(firmware, generalSettings, model)
|
||||||
{
|
{
|
||||||
rawSourceModel = new RawItemFilteredModel(rawSourceItemModel, RawSource::InputSourceGroups | RawSource::ScriptsGroup, this);
|
rawSourceModel = new RawItemFilteredModel(rawSourceItemModel, ((RawSource::InputSourceGroups | RawSource::ScriptsGroup) & ~ RawSource::NoneGroup), this);
|
||||||
connect(rawSourceModel, &RawItemFilteredModel::dataAboutToBeUpdated, this, &MixesPanel::onModelDataAboutToBeUpdated);
|
connect(rawSourceModel, &RawItemFilteredModel::dataAboutToBeUpdated, this, &MixesPanel::onModelDataAboutToBeUpdated);
|
||||||
connect(rawSourceModel, &RawItemFilteredModel::dataUpdateComplete, this, &MixesPanel::onModelDataUpdateComplete);
|
connect(rawSourceModel, &RawItemFilteredModel::dataUpdateComplete, this, &MixesPanel::onModelDataUpdateComplete);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user