fix(MPM): Various UI elements for MPM opts weren't updating correctly (#2209)

* fix: Get current values for MPM options

* fix: Don't show sub-proto dropdown when empty

* Add suggested call to `update()`

* Add callback to refresh when subtype changed

* Trip `SetValueHandler` rather than setting value
Thank you to @raphaelcoeffic for the hint ;)

* fix: Saving values when changed is a good idea!

* Load option flags properly when using internal proto list

* NumberEdit fields don't implement LV_EVENT_VALUE_CHANGED, use update() instead

* Fix checkbox behaviour

* Fix autobind checkbox after switching away from DSM

* Fix more parameter needing update on MPM sub-proto changes

* fix: Also update servo rate if present

* fix: Channel mapping needs updating also

Co-authored-by: Raphael Coeffic <raphael.coeffic@frafos.com>
This commit is contained in:
Peter Feerick
2022-09-05 21:56:24 +10:00
committed by GitHub
co-authored by Raphael Coeffic
parent 07431c3432
commit b4e1ceb4f8
5 changed files with 136 additions and 40 deletions
+9
View File
@@ -400,6 +400,15 @@ void MultiRfProtocols::fillBuiltinProtos()
rfProto.flags =
(pdef->failsafe ? 0x01 : 0) | (pdef->disable_ch_mapping ? 0x02 : 0);
if (pdef->optionsstr != nullptr) {
for (uint8_t i = 0; i < getMaxMultiOptions(); i++) {
if (pdef->optionsstr == mm_options_strings::options[i]) {
rfProto.flags |= i << 4;
break;
}
}
}
if (pdef->subTypeString) {
rfProto.fillSubProtoList(pdef->subTypeString, pdef->maxSubtype + 1);
}