mirror of
https://github.com/opentx/opentx.git
synced 2025-07-23 00:05:17 +03:00
Wizard data broken out into separate files.
This commit is contained in:
parent
858c9193cb
commit
b347b6f9c5
5 changed files with 597 additions and 512 deletions
67
companion/src/wizarddata.cpp
Normal file
67
companion/src/wizarddata.cpp
Normal file
|
@ -0,0 +1,67 @@
|
|||
#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();
|
||||
}
|
||||
|
||||
void Channel::clear()
|
||||
{
|
||||
sourceDlg = -1;
|
||||
input1 = NOINPUT;
|
||||
input2 = NOINPUT;
|
||||
weight1 = 0;
|
||||
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;
|
||||
}
|
||||
|
||||
QString Mix::toString()
|
||||
{
|
||||
QString str;
|
||||
str = QString(tr("Model Name: ")) + name + "\n";
|
||||
str += QString(tr("Model Type: ")) + vehicleName(vehicleType) + "\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;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue