Exemple #1
0
void NeoBattery::updateDumbStatus()
{
    qLog(PowerManagement) << __PRETTY_FUNCTION__;
    int min = -1; // Remaining battery (minutes)

    // apm on freerunner is borked.

    bool isFull = batteryIsFull();

    battery->setCharge( percentCharge);

    qLog(PowerManagement) << __PRETTY_FUNCTION__ << cableEnabled << percentCharge;

    battery->setCharging( cableEnabled && !isFull);
    battery->setTimeRemaining(min);
}
void Ficgta01Battery::updateFicStatus()
{

    int min = -1; // Remaining battery (minutes)

    // apm on freerunner is borked.

    batteryIsFull();

    if(cableEnabled) {
        ac->setAvailability(QPowerSource::Available);
    } else {
        ac->setAvailability(QPowerSource::NotAvailable);
    }

    battery->setCharge( percentCharge);

    qLog(PowerManagement) << __PRETTY_FUNCTION__ << cableEnabled << percentCharge;

    battery->setCharging( cableEnabled);
    battery->setTimeRemaining(min);
}