1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-16 04:45:17 +03:00

Trainermode in printdialog

This commit is contained in:
Romolo Manfredini 2015-04-22 23:10:06 +02:00 committed by Romolo Manfredini
parent c0e9b196f9
commit 6a1f3d5d96
3 changed files with 34 additions and 6 deletions

View file

@ -802,11 +802,34 @@ QString getProtocol(ModuleData & module)
QString str = getProtocolStr(module.protocol);
if (module.protocol == PPM)
str.append(QObject::tr(": %1 Channels, %2usec Delay, Pulse polarity %3").arg(module.channelsCount).arg(module.ppmDelay).arg(module.polarityToString()));
str.append(QObject::tr(": Channel start: %1, %2 Channels, %3usec Delay, Pulse polarity %4").arg(module.channelsStart+1).arg(module.channelsCount).arg(module.ppmDelay).arg(module.polarityToString()));
else
str.append(QObject::tr(": Channel start: %1, %2 Channels").arg(module.channelsStart+1).arg(module.channelsCount));
return str;
}
QString getTrainerMode(const int trainermode, ModuleData & module)
{
QString result;
switch (trainermode) {
case 1:
result=QObject::tr("Slave/Jack")+QObject::tr(": Channel start: %1, %2 Channels, %3usec Delay, Pulse polarity %4").arg(module.channelsStart+1).arg(module.channelsCount).arg(module.ppmDelay).arg(module.polarityToString());
break;
case 2:
result=QObject::tr("Master/SBUS Module");
break;
case 3:
result=QObject::tr("Master/CPPM Module");
break;
case 4:
result=QObject::tr("Master/SBUS in battery compartment");
break;
default:
result=QObject::tr("Master/Jack");
}
return result;
}
QString getPhasesStr(unsigned int phases, ModelData * model)
{
int numphases = GetCurrentFirmware()->getCapability(FlightModes);

View file

@ -124,6 +124,7 @@ int findmult(float value, float base);
QString getTrimInc(ModelData * g_model);
QString getTimerStr(TimerData & timer);
QString getProtocol(ModuleData & module);
QString getTrainerMode(const int trainermode, ModuleData & module);
QString getCenterBeepStr(ModelData * g_model);
/* FrSky helpers */

View file

@ -85,13 +85,17 @@ void PrintDialog::printSetup()
str.append(fv(tr("EEprom Size"), QString("%1").arg(firmware->getEepromInterface()->getSize(*g_model))));
str.append(fv(tr("Timer1"), getTimerStr(g_model->timers[0]))); //value, mode, count up/down
str.append(fv(tr("Timer2"), getTimerStr(g_model->timers[1]))); //value, mode, count up/down
if (firmware->getCapability(NumModules)>1) {
str.append("<b>"+tr("Internal module")+"</b><br>"); //proto, numch, delay,
str.append("<b>"+(IS_TARANIS(firmware->getBoard()) ? tr("Internal Radio System") : tr("Radio System") )+"</b><br>&nbsp;&nbsp;"); //proto, numch, delay,
}
str.append(fv(tr("Protocol"), getProtocol(g_model->moduleData[0]))); //proto, numch, delay,
str.append(fv(tr("Protocol"), getProtocol(g_model->moduleData[0])));
if (firmware->getCapability(NumModules)>1) {
str.append("<b>"+tr("External module")+"</b><br>"); //proto, numch, delay,
str.append(fv(tr("Protocol"), getProtocol(g_model->moduleData[1]))); //proto, numch, delay,
str.append("<b>"+(IS_TARANIS(firmware->getBoard()) ? tr("External Radio Module") : tr("Extra Radio System"))+"</b><br>&nbsp;&nbsp;"); //proto, numch, delay,
str.append(fv(tr("Protocol"), getProtocol(g_model->moduleData[1])));
}
if (IS_TARANIS(firmware->getBoard())){
str.append(fv(tr("Trainer port mode"), getTrainerMode(g_model->trainerMode, g_model->moduleData[2])));
}
str.append(fv(tr("Throttle Trim"), g_model->thrTrim ? tr("Enabled") : tr("Disabled")));
str.append(fv(tr("Trim Increment"), getTrimInc(g_model)));