Unverified Commit f739d087 authored by Don Gagne's avatar Don Gagne Committed by GitHub

Merge pull request #6970 from Williangalvani/fixBat

Add renamed battery parameters to parameter maps
parents ab673bd9 1f6d32d3
......@@ -121,7 +121,7 @@ SetupPage {
anchors.left: parent.left
sourceComponent: _batt1FullSettings.visible ? powerSetupComponent : undefined
property Fact armVoltMin: controller.getParameterFact(-1, "r.ARMING_VOLT_MIN", false /* reportMissing */)
property Fact armVoltMin: controller.getParameterFact(-1, "r.BATT_ARM_VOLT", false /* reportMissing */)
property Fact battAmpPerVolt: controller.getParameterFact(-1, "r.BATT_AMP_PERVLT", false /* reportMissing */)
property Fact battCapacity: controller.getParameterFact(-1, "BATT_CAPACITY", false /* reportMissing */)
property Fact battCurrPin: controller.getParameterFact(-1, "BATT_CURR_PIN", false /* reportMissing */)
......@@ -205,7 +205,7 @@ SetupPage {
anchors.left: parent.left
sourceComponent: batt2FullSettings.visible ? powerSetupComponent : undefined
property Fact armVoltMin: controller.getParameterFact(-1, "r.ARMING_VOLT2_MIN", false /* reportMissing */)
property Fact armVoltMin: controller.getParameterFact(-1, "r.BATT2_ARM_VOLT", false /* reportMissing */)
property Fact battAmpPerVolt: controller.getParameterFact(-1, "r.BATT2_AMP_PERVLT", false /* reportMissing */)
property Fact battCapacity: controller.getParameterFact(-1, "BATT2_CAPACITY", false /* reportMissing */)
property Fact battCurrPin: controller.getParameterFact(-1, "BATT2_CURR_PIN", false /* reportMissing */)
......
......@@ -158,14 +158,19 @@ ArduCopterFirmwarePlugin::ArduCopterFirmwarePlugin(void)
remapV3_6["PSC_ACCZ_P"] = QStringLiteral("ACCEL_Z_P");
remapV3_6["PSC_ACCZ_I"] = QStringLiteral("ACCEL_Z_I");
FirmwarePlugin::remapParamNameMap_t& remapV3_7 = _remapParamName[3][7];
remapV3_7["BATT_ARM_VOLT"] = QStringLiteral("ARMING_VOLT_MIN");
remapV3_7["BATT2_ARM_VOLT"] = QStringLiteral("ARMING_VOLT2_MIN");
_remapParamNameIntialized = true;
}
}
int ArduCopterFirmwarePlugin::remapParamNameHigestMinorVersionNumber(int majorVersionNumber) const
{
// Remapping supports up to 3.5
return majorVersionNumber == 3 ? 5 : Vehicle::versionNotSetValue;
// Remapping supports up to 3.7
return majorVersionNumber == 3 ? 7 : Vehicle::versionNotSetValue;
}
void ArduCopterFirmwarePlugin::guidedModeLand(Vehicle* vehicle)
......
......@@ -113,12 +113,17 @@ ArduPlaneFirmwarePlugin::ArduPlaneFirmwarePlugin(void)
remapV3_8["ARMING_VOLT_MIN"] = QStringLiteral("ARMING_MIN_VOLT");
remapV3_8["ARMING_VOLT2_MIN"] = QStringLiteral("ARMING_MIN_VOLT2");
FirmwarePlugin::remapParamNameMap_t& remapV3_10 = _remapParamName[3][10];
remapV3_10["BATT_ARM_VOLT"] = QStringLiteral("ARMING_VOLT_MIN");
remapV3_10["BATT2_ARM_VOLT"] = QStringLiteral("ARMING_VOLT2_MIN");
_remapParamNameIntialized = true;
}
}
int ArduPlaneFirmwarePlugin::remapParamNameHigestMinorVersionNumber(int majorVersionNumber) const
{
// Remapping supports up to 3.8
return majorVersionNumber == 3 ? 8 : Vehicle::versionNotSetValue;
// Remapping supports up to 3.10
return majorVersionNumber == 3 ? 10 : Vehicle::versionNotSetValue;
}
......@@ -92,14 +92,19 @@ ArduRoverFirmwarePlugin::ArduRoverFirmwarePlugin(void)
remapV3_2["ARMING_VOLT_MIN"] = QStringLiteral("ARMING_MIN_VOLT");
remapV3_2["ARMING_VOLT2_MIN"] = QStringLiteral("ARMING_MIN_VOLT2");
FirmwarePlugin::remapParamNameMap_t& remapV3_5 = _remapParamName[3][5];
remapV3_5["BATT_ARM_VOLT"] = QStringLiteral("ARMING_VOLT_MIN");
remapV3_5["BATT2_ARM_VOLT"] = QStringLiteral("ARMING_VOLT2_MIN");
_remapParamNameIntialized = true;
}
}
int ArduRoverFirmwarePlugin::remapParamNameHigestMinorVersionNumber(int majorVersionNumber) const
{
// Remapping supports up to 3.2
return majorVersionNumber == 3 ? 2 : Vehicle::versionNotSetValue;
// Remapping supports up to 3.5
return majorVersionNumber == 3 ? 5 : Vehicle::versionNotSetValue;
}
void ArduRoverFirmwarePlugin::guidedModeChangeAltitude(Vehicle* vehicle, double altitudeChange)
......
......@@ -112,8 +112,8 @@ ArduSubFirmwarePlugin::ArduSubFirmwarePlugin(void):
FirmwarePlugin::remapParamNameMap_t& remapV3_6 = _remapParamName[3][6];
remapV3_6["ARMING_VOLT_MIN"] = QStringLiteral("ARMING_MIN_VOLT");
remapV3_6["ARMING_VOLT2_MIN"] = QStringLiteral("ARMING_MIN_VOLT2");
remapV3_6["BATT_ARM_VOLT"] = QStringLiteral("ARMING_MIN_VOLT");
remapV3_6["BATT2_ARM_VOLT"] = QStringLiteral("ARMING_MIN_VOLT2");
remapV3_6["BATT_AMP_PERVLT"] = QStringLiteral("BATT_AMP_PERVOLT");
remapV3_6["BATT2_AMP_PERVLT"] = QStringLiteral("BATT2_AMP_PERVOL");
remapV3_6["BATT_LOW_MAH"] = QStringLiteral("FS_BATT_MAH");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment