2.4 continued (#8092)
Quite a bit of work on 2.4 Co-authored-by: 3djc <Th1sisfmyofmyo>
|
@ -33,9 +33,9 @@ env:
|
||||||
- FLAVOR=COLORLCD
|
- FLAVOR=COLORLCD
|
||||||
|
|
||||||
before_install:
|
before_install:
|
||||||
- wget --quiet https://launchpad.net/gcc-arm-embedded/4.7/4.7-2013-q3-update/+download/gcc-arm-none-eabi-${GCC_ARM_VERSION}-20130916-linux.tar.bz2
|
- wget --quiet https://developer.arm.com/-/media/Files/downloads/gnu-rm/6-2017q2/gcc-arm-none-eabi-6-2017-q2-update-linux.tar.bz2
|
||||||
- tar xjf gcc-arm-none-eabi-${GCC_ARM_VERSION}-20130916-linux.tar.bz2
|
- tar xjf gcc-arm-none-eabi-6-2017-q2-update-linux.tar.bz2
|
||||||
- sudo mv gcc-arm-none-eabi-${GCC_ARM_VERSION} /opt/gcc-arm-none-eabi
|
- sudo mv gcc-arm-none-eabi-6-2017-q2-update /opt/gcc-arm-none-eabi
|
||||||
- sudo ln -s /opt/gcc-arm-none-eabi/bin/arm-none-eabi-gcc /usr/bin/arm-none-eabi-gcc
|
- sudo ln -s /opt/gcc-arm-none-eabi/bin/arm-none-eabi-gcc /usr/bin/arm-none-eabi-gcc
|
||||||
- sudo ln -s /opt/gcc-arm-none-eabi/bin/arm-none-eabi-g++ /usr/bin/arm-none-eabi-g++
|
- sudo ln -s /opt/gcc-arm-none-eabi/bin/arm-none-eabi-g++ /usr/bin/arm-none-eabi-g++
|
||||||
- sudo ln -s /opt/gcc-arm-none-eabi/bin/arm-none-eabi-as /usr/bin/arm-none-eabi-as
|
- sudo ln -s /opt/gcc-arm-none-eabi/bin/arm-none-eabi-as /usr/bin/arm-none-eabi-as
|
||||||
|
@ -44,6 +44,8 @@ before_install:
|
||||||
- sudo ln -s /opt/gcc-arm-none-eabi/bin/arm-none-eabi-size /usr/bin/arm-none-eabi-size
|
- sudo ln -s /opt/gcc-arm-none-eabi/bin/arm-none-eabi-size /usr/bin/arm-none-eabi-size
|
||||||
- sudo apt-get install --yes --force-yes -qq qt${QT_BASE}base qt${QT_BASE}multimedia qt${QT_BASE}svg qt${QT_BASE}tools; source /opt/qt${QT_BASE}/bin/qt${QT_BASE}-env.sh
|
- sudo apt-get install --yes --force-yes -qq qt${QT_BASE}base qt${QT_BASE}multimedia qt${QT_BASE}svg qt${QT_BASE}tools; source /opt/qt${QT_BASE}/bin/qt${QT_BASE}-env.sh
|
||||||
- sudo ln -sf /usr/bin/python3 /usr/bin/python
|
- sudo ln -sf /usr/bin/python3 /usr/bin/python
|
||||||
|
- python3 -m pip install --upgrade pip
|
||||||
|
- sudo apt-get install python3-setuptools
|
||||||
- python3 -m pip install pillow clang
|
- python3 -m pip install pillow clang
|
||||||
|
|
||||||
script:
|
script:
|
||||||
|
|
|
@ -512,6 +512,8 @@ IF(APPLE)
|
||||||
set_target_properties(${COMPANION_NAME} PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${PROJECT_SOURCE_DIR}/companion/targets/mac/MacOSXBundleInfo.plist.in)
|
set_target_properties(${COMPANION_NAME} PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${PROJECT_SOURCE_DIR}/companion/targets/mac/MacOSXBundleInfo.plist.in)
|
||||||
set_target_properties(${SIMULATOR_NAME} PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${PROJECT_SOURCE_DIR}/companion/targets/mac/MacOSXBundleInfo.plist.in)
|
set_target_properties(${SIMULATOR_NAME} PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${PROJECT_SOURCE_DIR}/companion/targets/mac/MacOSXBundleInfo.plist.in)
|
||||||
|
|
||||||
|
set(MACOSX_BUNDLE_GUI_IDENTIFIER "org.opentx.companion")
|
||||||
|
|
||||||
INSTALL(TARGETS ${COMPANION_NAME}
|
INSTALL(TARGETS ${COMPANION_NAME}
|
||||||
BUNDLE DESTINATION . COMPONENT Runtime
|
BUNDLE DESTINATION . COMPONENT Runtime
|
||||||
RUNTIME DESTINATION bin COMPONENT Runtime
|
RUNTIME DESTINATION bin COMPONENT Runtime
|
||||||
|
|
|
@ -151,6 +151,7 @@ enum Capability {
|
||||||
DangerousFunctions,
|
DangerousFunctions,
|
||||||
HasModelCategories,
|
HasModelCategories,
|
||||||
HasSwitchableJack,
|
HasSwitchableJack,
|
||||||
|
HasSportConnector,
|
||||||
PwrButtonPress,
|
PwrButtonPress,
|
||||||
Sensors
|
Sensors
|
||||||
};
|
};
|
||||||
|
|
|
@ -103,6 +103,7 @@ class GeneralSettings {
|
||||||
bool disableRssiPoweroffAlarm;
|
bool disableRssiPoweroffAlarm;
|
||||||
unsigned int usbMode;
|
unsigned int usbMode;
|
||||||
unsigned int jackMode;
|
unsigned int jackMode;
|
||||||
|
bool sportPower;
|
||||||
BeeperMode hapticMode;
|
BeeperMode hapticMode;
|
||||||
unsigned int stickMode; // TODO enum
|
unsigned int stickMode; // TODO enum
|
||||||
int timezone;
|
int timezone;
|
||||||
|
|
|
@ -1544,7 +1544,7 @@ class ArmCustomFunctionField: public TransformedField {
|
||||||
value = fn.param;
|
value = fn.param;
|
||||||
*((uint16_t *)_param) = value;
|
*((uint16_t *)_param) = value;
|
||||||
}
|
}
|
||||||
else if (fn.func == FuncPlayValue || fn.func == FuncVolume) {
|
else if (fn.func == FuncPlayValue || fn.func == FuncVolume || fn.func == FuncBacklight) {
|
||||||
unsigned int value;
|
unsigned int value;
|
||||||
sourcesConversionTable->exportValue(fn.param, (int &)value);
|
sourcesConversionTable->exportValue(fn.param, (int &)value);
|
||||||
*((uint16_t *)_param) = value;
|
*((uint16_t *)_param) = value;
|
||||||
|
@ -1587,7 +1587,7 @@ class ArmCustomFunctionField: public TransformedField {
|
||||||
else if (fn.func == FuncPlayPrompt || fn.func == FuncBackgroundMusic || fn.func == FuncPlayScript) {
|
else if (fn.func == FuncPlayPrompt || fn.func == FuncBackgroundMusic || fn.func == FuncPlayScript) {
|
||||||
memcpy(fn.paramarm, _param, sizeof(fn.paramarm));
|
memcpy(fn.paramarm, _param, sizeof(fn.paramarm));
|
||||||
}
|
}
|
||||||
else if (fn.func == FuncVolume) {
|
else if (fn.func == FuncVolume || fn.func == FuncBacklight) {
|
||||||
sourcesConversionTable->importValue(value, (int &)fn.param);
|
sourcesConversionTable->importValue(value, (int &)fn.param);
|
||||||
}
|
}
|
||||||
else if (fn.func >= FuncAdjustGV1 && fn.func <= FuncAdjustGVLast) {
|
else if (fn.func >= FuncAdjustGV1 && fn.func <= FuncAdjustGVLast) {
|
||||||
|
@ -2720,7 +2720,7 @@ OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, Board::Type
|
||||||
internalField.Append(new BoolField<1>(this, generalData.disableRssiPoweroffAlarm));
|
internalField.Append(new BoolField<1>(this, generalData.disableRssiPoweroffAlarm));
|
||||||
internalField.Append(new UnsignedField<2>(this, generalData.usbMode));
|
internalField.Append(new UnsignedField<2>(this, generalData.usbMode));
|
||||||
internalField.Append(new UnsignedField<2>(this, generalData.jackMode));
|
internalField.Append(new UnsignedField<2>(this, generalData.jackMode));
|
||||||
internalField.Append(new SpareBitsField<1>(this));
|
internalField.Append(new BoolField<1>(this, generalData.sportPower));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
internalField.Append(new SpareBitsField<7>(this));
|
internalField.Append(new SpareBitsField<7>(this));
|
||||||
|
|
|
@ -696,6 +696,8 @@ int OpenTxFirmware::getCapability(::Capability capability)
|
||||||
return IS_FAMILY_HORUS_OR_T16(board);
|
return IS_FAMILY_HORUS_OR_T16(board);
|
||||||
case HasSwitchableJack:
|
case HasSwitchableJack:
|
||||||
return IS_TARANIS_XLITES(board);
|
return IS_TARANIS_XLITES(board);
|
||||||
|
case HasSportConnector:
|
||||||
|
return IS_ACCESS_RADIO(board, id) || IS_TARANIS_X7(board) || IS_HORUS_X10(board) || IS_TARANIS_XLITE(board);
|
||||||
case PwrButtonPress:
|
case PwrButtonPress:
|
||||||
return IS_HORUS_OR_TARANIS(board) && (board!=Board::BOARD_TARANIS_X9D) && (board!=Board::BOARD_TARANIS_X9DP);
|
return IS_HORUS_OR_TARANIS(board) && (board!=Board::BOARD_TARANIS_X9D) && (board!=Board::BOARD_TARANIS_X9DP);
|
||||||
case Sensors:
|
case Sensors:
|
||||||
|
@ -763,7 +765,7 @@ bool OpenTxFirmware::isAvailable(PulsesProtocol proto, int port)
|
||||||
case PULSES_GHOST:
|
case PULSES_GHOST:
|
||||||
return true;
|
return true;
|
||||||
case PULSES_ACCESS_R9M:
|
case PULSES_ACCESS_R9M:
|
||||||
return IS_ACCESS_RADIO(board, id);
|
return IS_ACCESS_RADIO(board, id) || (IS_FAMILY_HORUS_OR_T16(board) && id.contains("externalaccessmod"));
|
||||||
case PULSES_PXX_R9M_LITE:
|
case PULSES_PXX_R9M_LITE:
|
||||||
case PULSES_ACCESS_R9M_LITE:
|
case PULSES_ACCESS_R9M_LITE:
|
||||||
case PULSES_ACCESS_R9M_LITE_PRO:
|
case PULSES_ACCESS_R9M_LITE_PRO:
|
||||||
|
@ -1232,6 +1234,7 @@ void registerOpenTxFirmwares()
|
||||||
firmware = new OpenTxFirmware("opentx-x10", Firmware::tr("FrSky Horus X10 / X10S"), BOARD_X10);
|
firmware = new OpenTxFirmware("opentx-x10", Firmware::tr("FrSky Horus X10 / X10S"), BOARD_X10);
|
||||||
addOpenTxFrskyOptions(firmware);
|
addOpenTxFrskyOptions(firmware);
|
||||||
firmware->addOption("internalaccess", Firmware::tr("Support for ACCESS internal module replacement"));
|
firmware->addOption("internalaccess", Firmware::tr("Support for ACCESS internal module replacement"));
|
||||||
|
firmware->addOption("externalaccessmod", Firmware::tr("Support hardware mod: R9M ACCESS"));
|
||||||
registerOpenTxFirmware(firmware);
|
registerOpenTxFirmware(firmware);
|
||||||
addOpenTxRfOptions(firmware, EU + FLEX);
|
addOpenTxRfOptions(firmware, EU + FLEX);
|
||||||
|
|
||||||
|
@ -1245,6 +1248,7 @@ void registerOpenTxFirmwares()
|
||||||
firmware = new OpenTxFirmware("opentx-x12s", Firmware::tr("FrSky Horus X12S"), BOARD_HORUS_X12S);
|
firmware = new OpenTxFirmware("opentx-x12s", Firmware::tr("FrSky Horus X12S"), BOARD_HORUS_X12S);
|
||||||
addOpenTxFrskyOptions(firmware);
|
addOpenTxFrskyOptions(firmware);
|
||||||
firmware->addOption("internalaccess", Firmware::tr("Support for ACCESS internal module replacement"));
|
firmware->addOption("internalaccess", Firmware::tr("Support for ACCESS internal module replacement"));
|
||||||
|
firmware->addOption("externalaccessmod", Firmware::tr("Support hardware mod: R9M ACCESS"));
|
||||||
firmware->addOption("pcbdev", Firmware::tr("Use ONLY with first DEV pcb version"));
|
firmware->addOption("pcbdev", Firmware::tr("Use ONLY with first DEV pcb version"));
|
||||||
registerOpenTxFirmware(firmware);
|
registerOpenTxFirmware(firmware);
|
||||||
addOpenTxRfOptions(firmware, EU + FLEX);
|
addOpenTxRfOptions(firmware, EU + FLEX);
|
||||||
|
@ -1265,6 +1269,7 @@ void registerOpenTxFirmwares()
|
||||||
addOpenTxFrskyOptions(firmware);
|
addOpenTxFrskyOptions(firmware);
|
||||||
firmware->addOption("internalmulti", Firmware::tr("Support for MULTI internal module"));
|
firmware->addOption("internalmulti", Firmware::tr("Support for MULTI internal module"));
|
||||||
firmware->addOption("bluetooth", Firmware::tr("Support for bluetooth module"));
|
firmware->addOption("bluetooth", Firmware::tr("Support for bluetooth module"));
|
||||||
|
firmware->addOption("externalaccessmod", Firmware::tr("Support hardware mod: R9M ACCESS"));
|
||||||
addOpenTxRfOptions(firmware, FLEX);
|
addOpenTxRfOptions(firmware, FLEX);
|
||||||
registerOpenTxFirmware(firmware);
|
registerOpenTxFirmware(firmware);
|
||||||
|
|
||||||
|
@ -1275,12 +1280,14 @@ void registerOpenTxFirmwares()
|
||||||
static const Firmware::Option opt_bt("bluetooth", Firmware::tr("Support for bluetooth module"));
|
static const Firmware::Option opt_bt("bluetooth", Firmware::tr("Support for bluetooth module"));
|
||||||
static const Firmware::Option opt_internal_gps("internalgps", Firmware::tr("Support internal GPS"));
|
static const Firmware::Option opt_internal_gps("internalgps", Firmware::tr("Support internal GPS"));
|
||||||
firmware->addOptionsGroup({opt_bt, opt_internal_gps});
|
firmware->addOptionsGroup({opt_bt, opt_internal_gps});
|
||||||
|
firmware->addOption("externalaccessmod", Firmware::tr("Support hardware mod: R9M ACCESS"));
|
||||||
registerOpenTxFirmware(firmware);
|
registerOpenTxFirmware(firmware);
|
||||||
|
|
||||||
/* Jumper T18 board */
|
/* Jumper T18 board */
|
||||||
firmware = new OpenTxFirmware("opentx-t18", Firmware::tr("Jumper T18"), BOARD_JUMPER_T18);
|
firmware = new OpenTxFirmware("opentx-t18", Firmware::tr("Jumper T18"), BOARD_JUMPER_T18);
|
||||||
addOpenTxFrskyOptions(firmware);
|
addOpenTxFrskyOptions(firmware);
|
||||||
firmware->addOption("bluetooth", Firmware::tr("Support for bluetooth module"));
|
firmware->addOption("bluetooth", Firmware::tr("Support for bluetooth module"));
|
||||||
|
firmware->addOption("externalaccessmod", Firmware::tr("Support hardware mod: R9M ACCESS"));
|
||||||
registerOpenTxFirmware(firmware);
|
registerOpenTxFirmware(firmware);
|
||||||
addOpenTxRfOptions(firmware, FLEX);
|
addOpenTxRfOptions(firmware, FLEX);
|
||||||
|
|
||||||
|
|
|
@ -128,6 +128,14 @@ HardwarePanel::HardwarePanel(QWidget * parent, GeneralSettings & generalSettings
|
||||||
ui->potsTypeSeparator_2->hide();
|
ui->potsTypeSeparator_2->hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (firmware->getCapability(HasSportConnector)) {
|
||||||
|
ui->sportPower->setChecked(generalSettings.sportPower);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
ui->sportPower->hide();
|
||||||
|
ui->sportPowerLabel->hide();
|
||||||
|
}
|
||||||
|
|
||||||
setupPotType(0, ui->pot1Label, ui->pot1Name, ui->pot1Type);
|
setupPotType(0, ui->pot1Label, ui->pot1Name, ui->pot1Type);
|
||||||
setupPotType(1, ui->pot2Label, ui->pot2Name, ui->pot2Type);
|
setupPotType(1, ui->pot2Label, ui->pot2Name, ui->pot2Type);
|
||||||
setupPotType(2, ui->pot3Label, ui->pot3Name, ui->pot3Type);
|
setupPotType(2, ui->pot3Label, ui->pot3Name, ui->pot3Type);
|
||||||
|
@ -232,6 +240,11 @@ void HardwarePanel::on_filterEnable_stateChanged()
|
||||||
generalSettings.jitterFilter = !ui->filterEnable->isChecked();
|
generalSettings.jitterFilter = !ui->filterEnable->isChecked();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void HardwarePanel::on_sportPower_stateChanged()
|
||||||
|
{
|
||||||
|
generalSettings.sportPower = ui->sportPower->isChecked();
|
||||||
|
}
|
||||||
|
|
||||||
void HardwarePanel::on_rtcCheckDisable_stateChanged()
|
void HardwarePanel::on_rtcCheckDisable_stateChanged()
|
||||||
{
|
{
|
||||||
generalSettings.rtcCheckDisable = !ui->rtcCheckDisable->isChecked();
|
generalSettings.rtcCheckDisable = !ui->rtcCheckDisable->isChecked();
|
||||||
|
|
|
@ -50,6 +50,7 @@ class HardwarePanel : public GeneralPanel
|
||||||
void on_txVoltageCalibration_editingFinished();
|
void on_txVoltageCalibration_editingFinished();
|
||||||
void on_filterEnable_stateChanged();
|
void on_filterEnable_stateChanged();
|
||||||
void on_rtcCheckDisable_stateChanged();
|
void on_rtcCheckDisable_stateChanged();
|
||||||
|
void on_sportPower_stateChanged();
|
||||||
|
|
||||||
void on_serialPortMode_currentIndexChanged(int index);
|
void on_serialPortMode_currentIndexChanged(int index);
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,6 @@
|
||||||
#include "multiprotocols.h"
|
#include "multiprotocols.h"
|
||||||
#include "boards.h"
|
#include "boards.h"
|
||||||
#include "helpers_html.h"
|
#include "helpers_html.h"
|
||||||
#include "multiprotocols.h"
|
|
||||||
#include "appdata.h"
|
#include "appdata.h"
|
||||||
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
|
@ -1214,108 +1213,6 @@ QString ModelPrinter::printSensorTypeCond(unsigned int idx)
|
||||||
return printSensorType(model.sensorData[idx].type);
|
return printSensorType(model.sensorData[idx].type);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString ModelPrinter::printSensorDetails(unsigned int idx)
|
|
||||||
{
|
|
||||||
QString str = "";
|
|
||||||
SensorData sensor = model.sensorData[idx];
|
|
||||||
|
|
||||||
if (!sensor.isAvailable())
|
|
||||||
return str;
|
|
||||||
|
|
||||||
bool isConfigurable = false;
|
|
||||||
bool gpsFieldsPrinted = false;
|
|
||||||
bool cellsFieldsPrinted = false;
|
|
||||||
bool consFieldsPrinted = false;
|
|
||||||
bool ratioFieldsPrinted = false;
|
|
||||||
bool totalizeFieldsPrinted = false;
|
|
||||||
bool sources12FieldsPrinted = false;
|
|
||||||
bool sources34FieldsPrinted = false;
|
|
||||||
|
|
||||||
str.append(doTableCell(printSensorTypeCond(idx)));
|
|
||||||
|
|
||||||
QString tc = "";
|
|
||||||
if (sensor.type == SensorData::TELEM_TYPE_CALCULATED) {
|
|
||||||
isConfigurable = (sensor.formula < SensorData::TELEM_FORMULA_CELL);
|
|
||||||
gpsFieldsPrinted = (sensor.formula == SensorData::TELEM_FORMULA_DIST);
|
|
||||||
cellsFieldsPrinted = (sensor.formula == SensorData::TELEM_FORMULA_CELL);
|
|
||||||
consFieldsPrinted = (sensor.formula == SensorData::TELEM_FORMULA_CONSUMPTION);
|
|
||||||
sources12FieldsPrinted = (sensor.formula <= SensorData::TELEM_FORMULA_MULTIPLY);
|
|
||||||
sources34FieldsPrinted = (sensor.formula < SensorData::TELEM_FORMULA_MULTIPLY);
|
|
||||||
totalizeFieldsPrinted = (sensor.formula == SensorData::TELEM_FORMULA_TOTALIZE);
|
|
||||||
|
|
||||||
tc.append(printLabelValue(tr("Formula"), printSensorFormula(sensor.formula)));
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
isConfigurable = sensor.unit < SensorData::UNIT_FIRST_VIRTUAL;
|
|
||||||
ratioFieldsPrinted = (sensor.unit < SensorData::UNIT_FIRST_VIRTUAL);
|
|
||||||
|
|
||||||
tc.append(printLabelValue(tr("Id"), QString::number(sensor.id,16).toUpper()));
|
|
||||||
tc.append(printLabelValue(tr("Instance"), QString::number(sensor.instance)));
|
|
||||||
}
|
|
||||||
if (cellsFieldsPrinted) {
|
|
||||||
tc.append(printLabelValue(tr("Sensor"), QString("%1 > %2").arg(printTelemetrySource(sensor.source), false).arg(printSensorCells(sensor.index))));
|
|
||||||
}
|
|
||||||
if (sources12FieldsPrinted) {
|
|
||||||
QStringList srcs;
|
|
||||||
for (int i=0;i<4;i++) {
|
|
||||||
if (i < 2 || sources34FieldsPrinted) {
|
|
||||||
srcs << printTelemetrySource(sensor.sources[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
tc.append(printLabelValues(tr("Sources"), srcs));
|
|
||||||
}
|
|
||||||
if (consFieldsPrinted || totalizeFieldsPrinted)
|
|
||||||
tc.append(printLabelValue(tr("Sensor"), printTelemetrySource(sensor.amps)));
|
|
||||||
if (gpsFieldsPrinted) {
|
|
||||||
tc.append(printLabelValue(tr("GPS"), printTelemetrySource(sensor.gps)));
|
|
||||||
tc.append(printLabelValue(tr("Alt."), printTelemetrySource(sensor.alt)));
|
|
||||||
}
|
|
||||||
if (ratioFieldsPrinted && sensor.unit == SensorData::UNIT_RPMS) {
|
|
||||||
tc.append(printLabelValue(tr("Blades"), QString::number(sensor.ratio)));
|
|
||||||
tc.append(printLabelValue(tr("Multi."), QString::number(sensor.offset)));
|
|
||||||
}
|
|
||||||
str.append(doTableCell(tc));
|
|
||||||
|
|
||||||
tc = sensor.unitString();
|
|
||||||
tc = tc.trimmed() == "" ? "-" : tc;
|
|
||||||
str.append(doTableCell(tc));
|
|
||||||
|
|
||||||
if (isConfigurable && sensor.unit != SensorData::UNIT_FAHRENHEIT)
|
|
||||||
tc = QString::number(sensor.prec);
|
|
||||||
else
|
|
||||||
tc = "";
|
|
||||||
str.append(doTableCell(tc));
|
|
||||||
|
|
||||||
if (!ratioFieldsPrinted) {
|
|
||||||
str.append(doTableCell(""));
|
|
||||||
str.append(doTableCell(""));
|
|
||||||
}
|
|
||||||
else if (sensor.unit != SensorData::UNIT_RPMS) {
|
|
||||||
int prec = sensor.prec == 0 ? 1 : pow(10, sensor.prec);
|
|
||||||
str.append(doTableCell(QString::number((float)sensor.ratio / prec)));
|
|
||||||
str.append(doTableCell(QString::number((float)sensor.offset / prec)));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (sensor.unit != SensorData::UNIT_RPMS && isConfigurable)
|
|
||||||
str.append(doTableCell(printBoolean(sensor.autoOffset, BOOLEAN_YN)));
|
|
||||||
else
|
|
||||||
str.append(doTableCell(""));
|
|
||||||
|
|
||||||
if (isConfigurable)
|
|
||||||
str.append(doTableCell(printBoolean(sensor.filter, BOOLEAN_YN)));
|
|
||||||
else
|
|
||||||
str.append(doTableCell(""));
|
|
||||||
|
|
||||||
if (sensor.type == SensorData::TELEM_TYPE_CALCULATED)
|
|
||||||
str.append(doTableCell(printBoolean(sensor.persistent, BOOLEAN_YN)));
|
|
||||||
else
|
|
||||||
str.append(doTableCell(""));
|
|
||||||
|
|
||||||
str.append(doTableCell(printBoolean(sensor.onlyPositive, BOOLEAN_YN)));
|
|
||||||
str.append(doTableCell(printBoolean(sensor.logs, BOOLEAN_YN), false));
|
|
||||||
return str;
|
|
||||||
}
|
|
||||||
|
|
||||||
QString ModelPrinter::printSensorParams(unsigned int idx)
|
QString ModelPrinter::printSensorParams(unsigned int idx)
|
||||||
{
|
{
|
||||||
QString str = "";
|
QString str = "";
|
||||||
|
@ -1373,12 +1270,12 @@ QString ModelPrinter::printSensorParams(unsigned int idx)
|
||||||
u = u.trimmed() == "" ? "-" : u;
|
u = u.trimmed() == "" ? "-" : u;
|
||||||
str.append(printLabelValue(tr("Unit"), u));
|
str.append(printLabelValue(tr("Unit"), u));
|
||||||
if (isConfigurable && sensor.unit != SensorData::UNIT_FAHRENHEIT)
|
if (isConfigurable && sensor.unit != SensorData::UNIT_FAHRENHEIT)
|
||||||
str.append(printLabelValue(tr("Prec"), QString::number(sensor.prec)));
|
str.append(printLabelValue(tr("Prec"), printTelemetryPrecision(sensor.prec)));
|
||||||
if (ratioFieldsPrinted) {
|
if (ratioFieldsPrinted) {
|
||||||
if (sensor.unit != SensorData::UNIT_RPMS) {
|
if (sensor.unit != SensorData::UNIT_RPMS) {
|
||||||
int prec = sensor.prec == 0 ? 1 : pow(10, sensor.prec);
|
int prec = sensor.prec == 0 ? 1 : pow(10, sensor.prec);
|
||||||
str.append(printLabelValue(tr("Ratio"), QString::number((float)sensor.ratio / prec)));
|
str.append(printLabelValue(tr("Ratio"), QString::number((float)sensor.ratio / 10)));
|
||||||
str.append(printLabelValue(tr("Offset"), QString::number((float)sensor.offset / prec)));
|
str.append(printLabelValue(tr("Offset"), QString::number((float)sensor.offset / prec, 'f', sensor.prec)));
|
||||||
}
|
}
|
||||||
else if (sensor.unit == SensorData::UNIT_RPMS) {
|
else if (sensor.unit == SensorData::UNIT_RPMS) {
|
||||||
str.append(printLabelValue(tr("Blades"), QString::number(sensor.ratio)));
|
str.append(printLabelValue(tr("Blades"), QString::number(sensor.ratio)));
|
||||||
|
@ -1386,7 +1283,7 @@ QString ModelPrinter::printSensorParams(unsigned int idx)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (sensor.unit != SensorData::UNIT_RPMS && isConfigurable)
|
if (sensor.unit != SensorData::UNIT_RPMS && isConfigurable)
|
||||||
str.append(printLabelValue(tr("A/Offset"), printBoolean(sensor.autoOffset, BOOLEAN_YN)));
|
str.append(printLabelValue(tr("Auto Offset"), printBoolean(sensor.autoOffset, BOOLEAN_YN)));
|
||||||
if (isConfigurable)
|
if (isConfigurable)
|
||||||
str.append(printLabelValue(tr("Filter"), printBoolean(sensor.filter, BOOLEAN_YN)));
|
str.append(printLabelValue(tr("Filter"), printBoolean(sensor.filter, BOOLEAN_YN)));
|
||||||
if (sensor.type == SensorData::TELEM_TYPE_CALCULATED)
|
if (sensor.type == SensorData::TELEM_TYPE_CALCULATED)
|
||||||
|
@ -1476,3 +1373,17 @@ QString ModelPrinter::printChecklist()
|
||||||
}
|
}
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString ModelPrinter::printTelemetryPrecision(unsigned int val)
|
||||||
|
{
|
||||||
|
switch (val) {
|
||||||
|
case 0:
|
||||||
|
return tr("0.");
|
||||||
|
case 1:
|
||||||
|
return tr("0.0");
|
||||||
|
case 2:
|
||||||
|
return tr("0.00");
|
||||||
|
default:
|
||||||
|
return CPN_STR_UNKNOWN_ITEM;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -128,10 +128,10 @@ class ModelPrinter: public QObject
|
||||||
QString printSensorCells(unsigned int val);
|
QString printSensorCells(unsigned int val);
|
||||||
QString printSensorTypeCond(unsigned int idx);
|
QString printSensorTypeCond(unsigned int idx);
|
||||||
QString printSensorParams(unsigned int idx);
|
QString printSensorParams(unsigned int idx);
|
||||||
QString printSensorDetails(unsigned int idx);
|
|
||||||
QString printTelemetryScreenType(unsigned int val);
|
QString printTelemetryScreenType(unsigned int val);
|
||||||
QString printTelemetryScreen(unsigned int idx, unsigned int line, unsigned int width);
|
QString printTelemetryScreen(unsigned int idx, unsigned int line, unsigned int width);
|
||||||
QString printChecklist();
|
QString printChecklist();
|
||||||
|
QString printTelemetryPrecision(unsigned int val);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Firmware * firmware;
|
Firmware * firmware;
|
||||||
|
|
Before Width: | Height: | Size: 100 KiB After Width: | Height: | Size: 100 KiB |
Before Width: | Height: | Size: 98 KiB After Width: | Height: | Size: 98 KiB |
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 43 KiB |
Before Width: | Height: | Size: 56 KiB After Width: | Height: | Size: 56 KiB |
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 43 KiB |
Before Width: | Height: | Size: 161 KiB After Width: | Height: | Size: 161 KiB |
Before Width: | Height: | Size: 335 B After Width: | Height: | Size: 335 B |
Before Width: | Height: | Size: 293 B After Width: | Height: | Size: 293 B |
Before Width: | Height: | Size: 491 B After Width: | Height: | Size: 491 B |
Before Width: | Height: | Size: 873 B After Width: | Height: | Size: 873 B |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 978 B After Width: | Height: | Size: 978 B |
Before Width: | Height: | Size: 674 B After Width: | Height: | Size: 674 B |
Before Width: | Height: | Size: 814 B After Width: | Height: | Size: 814 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 807 B After Width: | Height: | Size: 807 B |
Before Width: | Height: | Size: 671 B After Width: | Height: | Size: 671 B |
Before Width: | Height: | Size: 796 B After Width: | Height: | Size: 796 B |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 980 B After Width: | Height: | Size: 980 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1 KiB After Width: | Height: | Size: 1 KiB |
Before Width: | Height: | Size: 604 B After Width: | Height: | Size: 604 B |
Before Width: | Height: | Size: 811 B After Width: | Height: | Size: 811 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 698 B After Width: | Height: | Size: 698 B |
Before Width: | Height: | Size: 543 B After Width: | Height: | Size: 543 B |
Before Width: | Height: | Size: 530 B After Width: | Height: | Size: 530 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 954 B After Width: | Height: | Size: 954 B |
Before Width: | Height: | Size: 1,013 B After Width: | Height: | Size: 1,013 B |
Before Width: | Height: | Size: 841 B After Width: | Height: | Size: 841 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 575 B After Width: | Height: | Size: 575 B |
Before Width: | Height: | Size: 1 KiB After Width: | Height: | Size: 1 KiB |
Before Width: | Height: | Size: 686 B After Width: | Height: | Size: 686 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1 KiB After Width: | Height: | Size: 1 KiB |
Before Width: | Height: | Size: 544 B After Width: | Height: | Size: 544 B |
Before Width: | Height: | Size: 751 B After Width: | Height: | Size: 751 B |
Before Width: | Height: | Size: 791 B After Width: | Height: | Size: 791 B |
Before Width: | Height: | Size: 631 B After Width: | Height: | Size: 631 B |
Before Width: | Height: | Size: 800 B After Width: | Height: | Size: 800 B |
Before Width: | Height: | Size: 641 B After Width: | Height: | Size: 641 B |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 860 B After Width: | Height: | Size: 860 B |
Before Width: | Height: | Size: 1 KiB After Width: | Height: | Size: 1 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 536 B After Width: | Height: | Size: 536 B |
Before Width: | Height: | Size: 572 B After Width: | Height: | Size: 572 B |
Before Width: | Height: | Size: 630 B After Width: | Height: | Size: 630 B |
Before Width: | Height: | Size: 891 B After Width: | Height: | Size: 891 B |
Before Width: | Height: | Size: 755 B After Width: | Height: | Size: 755 B |
Before Width: | Height: | Size: 492 B After Width: | Height: | Size: 492 B |
Before Width: | Height: | Size: 815 B After Width: | Height: | Size: 815 B |
Before Width: | Height: | Size: 666 B After Width: | Height: | Size: 666 B |
Before Width: | Height: | Size: 545 B After Width: | Height: | Size: 545 B |
Before Width: | Height: | Size: 425 B After Width: | Height: | Size: 425 B |
Before Width: | Height: | Size: 400 B After Width: | Height: | Size: 400 B |
Before Width: | Height: | Size: 525 B After Width: | Height: | Size: 525 B |
Before Width: | Height: | Size: 597 B After Width: | Height: | Size: 597 B |
Before Width: | Height: | Size: 506 B After Width: | Height: | Size: 506 B |
Before Width: | Height: | Size: 549 B After Width: | Height: | Size: 549 B |
Before Width: | Height: | Size: 625 B After Width: | Height: | Size: 625 B |
Before Width: | Height: | Size: 486 B After Width: | Height: | Size: 486 B |
Before Width: | Height: | Size: 659 B After Width: | Height: | Size: 659 B |
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 3 KiB After Width: | Height: | Size: 3 KiB |
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 661 B After Width: | Height: | Size: 661 B |
Before Width: | Height: | Size: 773 B After Width: | Height: | Size: 773 B |
Before Width: | Height: | Size: 653 B After Width: | Height: | Size: 653 B |
Before Width: | Height: | Size: 756 B After Width: | Height: | Size: 756 B |
Before Width: | Height: | Size: 534 B After Width: | Height: | Size: 534 B |