From kde-hardware-devel Sun Jul 13 11:01:24 2014 From: "Christoph Feck" Date: Sun, 13 Jul 2014 11:01:24 +0000 To: kde-hardware-devel Subject: Re: [Kde-hardware-devel] Review Request 118801: Consider additional batteries for power management ( Message-Id: <20140713110124.3846.33105 () probe ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-hardware-devel&m=140524930704296 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--===============6649746655640780404==" --===============6649746655640780404== Content-Type: multipart/alternative; boundary="===============7665940878992940530==" --===============7665940878992940530== MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit > On June 23, 2014, 4:47 p.m., Commit Hook wrote: > > This review has been submitted with commit 775a99e8bc1e9c5e277ff17a84a406227a5a32fb by Emmanuel Pescosta to branch KDE/4.11. > > Emmanuel Pescosta wrote: > I'll create a patch for kde:powerdevil when I have some time again, maybe this weekend or in the end of next week. If you are done, please close bug 337414 - Christoph ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://git.reviewboard.kde.org/r/118801/#review60821 ----------------------------------------------------------- On June 23, 2014, 4:47 p.m., Emmanuel Pescosta wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://git.reviewboard.kde.org/r/118801/ > ----------------------------------------------------------- > > (Updated June 23, 2014, 4:47 p.m.) > > > Review request for Solid. > > > Bugs: 325707 and 329537 > http://bugs.kde.org/show_bug.cgi?id=325707 > http://bugs.kde.org/show_bug.cgi?id=329537 > > > Repository: kde-workspace > > > Description > ------- > > After resuming from suspend, all batteries are added > to powerdevil. When a battery, with charge lower or > equal than the critical charge percentage is added, the > critical battery timer will be started. > > In the current version the critical battery timeout can > only be interrupted by plugging in AC. > > But if the system has more than one battery, the global > charge percentage can be greater than the critical charge > percentage and so the system shouldn't suspend. To achive > this behaviour, we calculate the global charge percentage > whenever a new battery was added and if the critical > battery timer is running and the global charge is high > enough, we stop the timer. > > Also we use the already calculated global charge percentage > for the battery charge percentage notification instead of > the charge of each individual battery. > > With this patch, the user can not only interrupt the critical > timer by plugging in the AC but also by plugging in a new or > additional battery (if the battery has enough charge). > > > Note: > The patch for kde:powerdevil will move the calculation of > the global charge percentage into a new function to avoid > the code duplication, but for the KDE/4.11 version I have > avoided this to keep the number of changes as small as > possible. > > The 30 sec timeout message will still popup. Any ideas > how to avoid this? Showing an additional message is not > a solution in this case because of the message freeze. > > > Diffs > ----- > > powerdevil/daemon/powerdevilcore.cpp 76e1b82 > > Diff: https://git.reviewboard.kde.org/r/118801/diff/ > > > Testing > ------- > > Testing was done by Philipp Paris on his Thinkpad T440s (two > batteries). > > Two batteries above critical section: > Resume after suspend works without the 30 sec timeout. (as current version) > > One battery in critical section and the other above: > Resume after suspend works without the 30 sec timeout. (changed behaviour) > > Both in critical section: > Resume after suspend without plugged in AC will go sleeping > in 30 sec. (as current version) > > > Thanks, > > Emmanuel Pescosta > > --===============7665940878992940530== MIME-Version: 1.0 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: 7bit
This is an automatically generated e-mail. To reply, visit: https://git.reviewboard.kde.org/r/118801/

On June 23rd, 2014, 4:47 p.m. UTC, Commit Hook wrote:

This review has been submitted with commit 775a99e8bc1e9c5e277ff17a84a406227a5a32fb by Emmanuel Pescosta to branch KDE/4.11.

On June 23rd, 2014, 4:50 p.m. UTC, Emmanuel Pescosta wrote:

I'll create a patch for kde:powerdevil when I have some time again, maybe this weekend or in the end of next week.

If you are done, please close bug 337414


- Christoph


On June 23rd, 2014, 4:47 p.m. UTC, Emmanuel Pescosta wrote:

Review request for Solid.
By Emmanuel Pescosta.

Updated June 23, 2014, 4:47 p.m.

Bugs: 325707, 329537
Repository: kde-workspace

Description

After resuming from suspend, all batteries are added
to powerdevil. When a battery, with charge lower or
equal than the critical charge percentage is added, the
critical battery timer will be started.

In the current version the critical battery timeout can
only be interrupted by plugging in AC.

But if the system has more than one battery, the global
charge percentage can be greater than the critical charge
percentage and so the system shouldn't suspend. To achive
this behaviour, we calculate the global charge percentage
whenever a new battery was added and if the critical
battery timer is running and the global charge is high
enough, we stop the timer.

Also we use the already calculated global charge percentage
for the battery charge percentage notification instead of
the charge of each individual battery.

With this patch, the user can not only interrupt the critical
timer by plugging in the AC but also by plugging in a new or
additional battery (if the battery has enough charge).


Note:
The patch for kde:powerdevil will move the calculation of
the global charge percentage into a new function to avoid
the code duplication, but for the KDE/4.11 version I have
avoided this to keep the number of changes as small as 
possible.

The 30 sec timeout message will still popup. Any ideas
how to avoid this? Showing an additional message is not
a solution in this case because of the message freeze.

Testing

Testing was done by Philipp Paris on his Thinkpad T440s (two
batteries).

Two batteries above critical section:
Resume after suspend works without the 30 sec timeout. (as current version)

One battery in critical section and the other above:
Resume after suspend works without the 30 sec timeout. (changed behaviour)

Both in critical section:
Resume after suspend without plugged in AC will go sleeping
in 30 sec. (as current version)

Diffs

  • powerdevil/daemon/powerdevilcore.cpp (76e1b82)

View Diff

--===============7665940878992940530==-- --===============6649746655640780404== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Kde-hardware-devel mailing list Kde-hardware-devel@kde.org https://mail.kde.org/mailman/listinfo/kde-hardware-devel --===============6649746655640780404==--