|
|
|
@ -1084,6 +1084,9 @@ void MissionController::_updateBatteryInfo(int waypointIndex)
@@ -1084,6 +1084,9 @@ void MissionController::_updateBatteryInfo(int waypointIndex)
|
|
|
|
|
_missionFlightStatus.hoverAmpsTotal = (_missionFlightStatus.hoverTime / 60.0) * _missionFlightStatus.hoverAmps; |
|
|
|
|
_missionFlightStatus.cruiseAmpsTotal = (_missionFlightStatus.cruiseTime / 60.0) * _missionFlightStatus.cruiseAmps; |
|
|
|
|
_missionFlightStatus.batteriesRequired = ceil((_missionFlightStatus.hoverAmpsTotal + _missionFlightStatus.cruiseAmpsTotal) / _missionFlightStatus.ampMinutesAvailable); |
|
|
|
|
// FIXME: Battery change point code pretty much doesn't work. The reason is that is treats complex items as a black box. It needs to be able to look
|
|
|
|
|
// inside complex items in order to determine a swap point that is interior to a complex item. Current the swap point display in PlanToolbar is
|
|
|
|
|
// disabled to do this problem.
|
|
|
|
|
if (waypointIndex != -1 && _missionFlightStatus.batteriesRequired == 2 && _missionFlightStatus.batteryChangePoint == -1) { |
|
|
|
|
_missionFlightStatus.batteryChangePoint = waypointIndex - 1; |
|
|
|
|
} |
|
|
|
|