[MULTI] Implement option Value adjustment in Companion (#4459)

* [MULTI] Implement option Value adjustment in Companion

Also refactor ui code to use the same multi table as the radio to make updates easier and consistent

* Fix warnings with gcc 6

* Make the whole thing more C++ like

Using QVector instead of std::vector gives me strange errors.

* Fix gcc warning

* another signedness fix

* Add missing include

* Add Gw008 protocol and move subtype definitions out of the translations

* Add note about struct

* More cleanups

Integrate @mpaperno’s latest ideas about cleaning up
This commit is contained in:
Arne Schwabe
2017-03-02 18:40:31 +01:00
committed by Bertrand Songis
parent 00b2799427
commit 40dae8a8a7
27 changed files with 340 additions and 866 deletions
+1 -40
View File
@@ -28,6 +28,7 @@
#include "wizarddata.h"
#include "firmwareinterface.h"
#include "macros.h"
#include "multiprotocols.h"
#include <stdio.h>
#include <list>
#include <float.h>
@@ -1844,46 +1845,6 @@ SimulatorInterface * getCurrentSimulator()
return NULL;
}
unsigned int getNumSubtypes(MultiModuleRFProtocols type)
{
switch (type) {
case MM_RF_PROTO_HISKY:
case MM_RF_PROTO_SYMAX:
case MM_RF_PROTO_KN:
case MM_RF_PROTO_SLT:
case MM_RF_PROTO_FY326:
case MM_RF_PROTO_BAYANG:
case MM_RF_PROTO_V2X2:
return 2;
case MM_RF_PROTO_Q2X2:
case MM_RF_PROTO_CG023:
return 3;
case MM_RF_PROTO_DSM2:
case MM_RF_PROTO_MT99XX:
case MM_RF_PROTO_HONTAI:
case MM_RF_PROTO_AFHDS2A:
case MM_RF_PROTO_Q303:
return 4;
case MM_RF_PROTO_FLYSKY:
case MM_RF_PROTO_MJXQ:
case MM_RF_PROTO_YD717:
return 5;
case MM_RF_PROTO_FRSKY:
case MM_RF_PROTO_WK_2X01:
return 6;
case MM_RF_PROTO_CX10:
return 8;
default:
return 1;
}
}
void FlightModeData::clear(const int phase)
{
memset(this, 0, sizeof(FlightModeData));