Post Reply 
My analysis of the battery icon is done....results
07-01-2017, 07:09 PM (This post was last modified: 07-01-2017 10:06 PM by webmasterpdx.)
Post: #1
My analysis of the battery icon is done....results
Here is the table of results. I've changed the output of the routine to output what the HP guys say is the output of the hardware. Note that when it reaches zero, it'll work for a while before popping up a critical low battery message (there are 2 different messages depending on what you are doing, but they are in english and are self explanatary). Note that the color is the color of the on pixels indicating charge level. When empty (zero), the color is white, and that is what is indicated in the table. The Y values are the highest pixel vertically on. Pixels are the number of pixels on for that status.

Code:
V   Y  Pixels  HP   C
100 04 11     100 #008400h Bright Green
 75 07 08      75 #008400h Bright Green
 50 09 06      50 #008400h Bright Green
 25 12 03      25 #EFCE29h Yellow
 00 15 00      00 #D6DEDE White

Here is the new utility to read the icon and return the percentage battery full. Note that I'm using <> for the not equal symbol (isn't on my laptop keyboard).

Code:
// Battery test
EXPORT BATVAL()
BEGIN
 LOCAL x:=315,y:=14,c,d;
 d:=GETPIX_P(x,y);
 IF d==#D6DEDEh THEN RETURN 0; END;
 FOR y FROM 13 DOWNTO 3 STEP 1 DO
  c:=GETPIX_P(x,y);
  IF c<>d THEN // color change
   CASE
    IF y==3 THEN RETURN 100; END;                                                                                                                                                                                                                                        
    IF y==6 THEN RETURN 75; END;
    IF y==8 THEN RETURN 50; END;
    DEFAULT RETURN 25;
   END; // CASE...
  END; // IF c<>d...
  d:=c;
 END; // FOR y.....
END; // BEGIN....
Find all posts by this user
Quote this message in a reply
07-03-2017, 05:32 AM (This post was last modified: 07-03-2017 05:37 AM by webmasterpdx.)
Post: #2
RE: My analysis of the battery icon is done....results
I optimized the code.....

Code:
EXPORT BATVAL() // Battery test
BEGIN
LOCAL x:=315,d:=#D6DEDEh;
CASE
IF GETPIX_P(x,14)==d THEN RETURN 0; END;
IF GETPIX_P(x,11)==d THEN RETURN 25; END;
IF GETPIX_P(x,8)==d THEN RETURN 50; END;
IF GETPIX_P(x,6)==d THEN RETURN 75; END;
DEFAULT RETURN 100;
END; // CASE...
END; // BEGIN...
Find all posts by this user
Quote this message in a reply
07-03-2017, 10:44 AM (This post was last modified: 07-03-2017 01:53 PM by DrD.)
Post: #3
RE: My analysis of the battery icon is done....results
Tap (or click) near the battery icon and a pop up provides more detail, including percent level. Mode info is also provided, which can be changed there.

-Dale-
Find all posts by this user
Quote this message in a reply
07-03-2017, 05:33 PM
Post: #4
RE: My analysis of the battery icon is done....results
the idea is to determine battery level from a program....
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)