1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-23 08:15:17 +03:00

New plce holder function in eeprominterface for importing wizard data. Need help from Bertrand since the format of the real mixes is mysterious.

This commit is contained in:
Kjell Kernen 2014-03-04 13:36:01 +01:00
parent 11565e05e9
commit b133a990f1
7 changed files with 121 additions and 87 deletions

View file

@ -11,32 +11,9 @@
* GNU General Public License for more details.
*
*/
#include <string.h>
#include "wizarddata.h"
QString inputName(Input input)
{
switch (input){
case THROTTLE: return "THR";
case RUDDER: return "RUD";
case ELEVATOR: return "ELE";
case AILERON: return "AIL";
case FLAP: return "FLP";
case AIRBREAK: return "AIR";
default: return "---";
}
}
QString vehicleName(Vehicle vehicle)
{
switch (vehicle){
case PLANE: return "Plane";
case MULTICOPTER: return "Multicopter";
case HELICOPTER: return "Helicopter";
default: return "---";
}
}
Channel::Channel()
{
clear();
@ -51,38 +28,11 @@ void Channel::clear()
weight2 = 0;
}
bool Channel::isEmpty()
{
return sourceDlg < 0;
}
QString Channel::toString()
{
QString str;
str = QString("[%1, %2]").arg(inputName(input1)).arg(weight1);
if ( input2 != NOINPUT )
str += QString("[%1, %2]").arg(inputName(input2)).arg(weight2);
return str;
}
Mix::Mix()
WizMix::WizMix()
{
complete = false;
name = "";
strcpy(name, " ");
vehicle = NOVEHICLE;
}
QString Mix::toString()
{
QString str;
str = QString(tr("Model Name: ")) + name + "\n";
str += QString(tr("Model Type: ")) + vehicleName(vehicle) + "\n";
for (int i=0; i<MAX_CHANNELS; i++){
if (!channel[i].isEmpty()){
str += QString(tr("Channel %1: ").arg(i+1));
str += channel[i].toString();
str += QString("\n");
}
}
return str;
}