[Companion] Implement print functions for the hell setup screen (fixes 3430) (#3554)
Fixes #3430: added print functions for the hell setup screen
This commit is contained in:
committed by
Damjan Adamic
parent
2cccb99e28
commit
81733b10cc
@@ -202,6 +202,25 @@ QString ModelPrinter::printTrainerMode()
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString ModelPrinter::printHeliSwashType ()
|
||||||
|
{
|
||||||
|
switch (model.swashRingData.type) {
|
||||||
|
case HELI_SWASH_TYPE_90:
|
||||||
|
return tr("90");
|
||||||
|
case HELI_SWASH_TYPE_120:
|
||||||
|
return tr("120");
|
||||||
|
case HELI_SWASH_TYPE_120X:
|
||||||
|
return tr("120X");
|
||||||
|
case HELI_SWASH_TYPE_140:
|
||||||
|
return tr("140");
|
||||||
|
case HELI_SWASH_TYPE_NONE:
|
||||||
|
return tr("Off");
|
||||||
|
default:
|
||||||
|
return "???";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
QString ModelPrinter::printCenterBeep()
|
QString ModelPrinter::printCenterBeep()
|
||||||
{
|
{
|
||||||
QStringList strl;
|
QStringList strl;
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ class ModelPrinter: public QObject
|
|||||||
QString printModule(int idx);
|
QString printModule(int idx);
|
||||||
QString printTrainerMode();
|
QString printTrainerMode();
|
||||||
QString printCenterBeep();
|
QString printCenterBeep();
|
||||||
|
QString printHeliSwashType();
|
||||||
QString printTrim(int flightModeIndex, int stickIndex);
|
QString printTrim(int flightModeIndex, int stickIndex);
|
||||||
QString printGlobalVar(int flightModeIndex, int gvarIndex);
|
QString printGlobalVar(int flightModeIndex, int gvarIndex);
|
||||||
QString printRotaryEncoder(int flightModeIndex, int reIndex);
|
QString printRotaryEncoder(int flightModeIndex, int reIndex);
|
||||||
|
|||||||
@@ -128,6 +128,8 @@ QString MultiModelPrinter::print(QTextDocument * document)
|
|||||||
|
|
||||||
QString str = "<table border='1' cellspacing='0' cellpadding='3' width='100%' style='font-family: monospace;'>";
|
QString str = "<table border='1' cellspacing='0' cellpadding='3' width='100%' style='font-family: monospace;'>";
|
||||||
str += printSetup();
|
str += printSetup();
|
||||||
|
if (firmware->getCapability(Heli))
|
||||||
|
str += printHeliSetup();
|
||||||
if (firmware->getCapability(FlightModes))
|
if (firmware->getCapability(FlightModes))
|
||||||
str += printFlightModes();
|
str += printFlightModes();
|
||||||
str += printInputs();
|
str += printInputs();
|
||||||
@@ -181,6 +183,57 @@ QString MultiModelPrinter::printSetup()
|
|||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QString MultiModelPrinter::printHeliSetup()
|
||||||
|
{
|
||||||
|
bool heliEnabled = false;
|
||||||
|
for (int k=0; k<models.size(); k++) {
|
||||||
|
heliEnabled = heliEnabled || models[k]->swashRingData.type != HELI_SWASH_TYPE_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!heliEnabled)
|
||||||
|
return "";
|
||||||
|
|
||||||
|
QString str = printTitle(tr("Helicopter Setup"));
|
||||||
|
MultiColumns columns(models.size());
|
||||||
|
columns.appendTitle (tr("Swash Type:"));
|
||||||
|
COMPARE(modelPrinter->printHeliSwashType());
|
||||||
|
columns.append ("<br/>");
|
||||||
|
|
||||||
|
columns.appendTitle (tr("Swash Ring:"));
|
||||||
|
COMPARE(model->swashRingData.value);
|
||||||
|
|
||||||
|
columns.append ("<table cellspacing='0' cellpadding='1' width='100%' border='0' style='border-collapse:collapse'>");
|
||||||
|
columns.append("<tr>");
|
||||||
|
columns.append("<td></td><td><b>" + tr("Input") + "</b></td><td><b>" + tr("Weight") + "</b></td>");
|
||||||
|
columns.append("</tr>");
|
||||||
|
|
||||||
|
columns.append("<tr><td><b>" + tr("Long. cyc") + "</b></td><td>");
|
||||||
|
COMPARE(model->swashRingData.elevatorSource.toString(model));
|
||||||
|
columns.append("</td><td>");
|
||||||
|
COMPARE(model->swashRingData.elevatorWeight)
|
||||||
|
columns.append("</td></tr>");
|
||||||
|
|
||||||
|
columns.append("<tr><td><b>" + tr("Lateral cyc") + "</b></td><td>");
|
||||||
|
COMPARE(model->swashRingData.aileronSource.toString(model));
|
||||||
|
columns.append("</td><td>");
|
||||||
|
COMPARE(model->swashRingData.aileronWeight)
|
||||||
|
columns.append("</td></tr>");
|
||||||
|
|
||||||
|
|
||||||
|
columns.append("<tr><td><b>" + tr("Collective") + "</b></td><td>");
|
||||||
|
COMPARE(model->swashRingData.collectiveSource.toString(model));
|
||||||
|
columns.append("</td><td>");
|
||||||
|
COMPARE(model->swashRingData.collectiveWeight)
|
||||||
|
columns.append("</td></tr>");
|
||||||
|
columns.append("</table>");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
str.append(columns.print());
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
|
||||||
QString MultiModelPrinter::printFlightModes()
|
QString MultiModelPrinter::printFlightModes()
|
||||||
{
|
{
|
||||||
QString str = printTitle(tr("Flight modes"));
|
QString str = printTitle(tr("Flight modes"));
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ class MultiModelPrinter: public QObject
|
|||||||
|
|
||||||
QString printTitle(const QString & label);
|
QString printTitle(const QString & label);
|
||||||
QString printSetup();
|
QString printSetup();
|
||||||
|
QString printHeliSetup();
|
||||||
QString printFlightModes();
|
QString printFlightModes();
|
||||||
QString printLimits();
|
QString printLimits();
|
||||||
QString printInputs();
|
QString printInputs();
|
||||||
|
|||||||
Reference in New Issue
Block a user