It is currently April 27th, 2024, 5:57 am

Help with power plugin.

Get help with creating, editing & fixing problems with skins
User avatar
Mordasius
Posts: 1173
Joined: January 22nd, 2011, 4:23 pm
Location: GMT +8

Re: Help with power plugin.

Post by Mordasius »

gmvolk wrote:Thats odd, when I unplug the power the status goes to 0.
Odd indeed. When I unplug from the mains the STATUS goes to 2, 3 or 4 depending on how much charge there is in the battery.
User avatar
gmvolk
Posts: 56
Joined: September 26th, 2011, 11:02 pm

Re: Help with power plugin.

Post by gmvolk »

Since you can't have two ifabove :oops: in the same, trigger on the ACLINE powerstate.

Code: Select all

[Rainmeter]
Update=100

[PowerStatus]
Measure=PLUGIN
Plugin=PowerPlugin
PowerState=ACLINE
Substitute="0":"DC","1":"AC"
IfAboveValue=0
IfAboveAction=[!ShowMeter ImageMeter] [!EnableMeasure ImageNumberCalc]
IfBelowValue=1
IfBelowAction=[!HideMeter ImageMeter] [!DisableMeasure ImageNumberCalc]

[ImageMeter]
Meter=Image
ImageName=[ImageNumberCalc].png
DynamicVariables=1
Hidden=1

[ImageNumberCalc]
Measure=Calc
Formula=Counter % 6
Disable=1
With this, if the power is plugged in and therefore the battery is charging your image is shown. Once on DC the image is gone.
"Pub." Ah, yes: a meeting place where people attempt to achieve advanced states of mental incompetence by the repeated consumption of fermented vegetable drinks.

http://gmvolk.deviantart.com/
User avatar
gmvolk
Posts: 56
Joined: September 26th, 2011, 11:02 pm

Re: Help with power plugin.

Post by gmvolk »

I've had more problems with the powerplugin than any other plugin or skin I have written or used. I helped poiru test some beta versions of the powerplugin.dll back in Oct. Another problem, not sure if its still there was that between 33 and 65% charge the status got reported as on AC :o
"Pub." Ah, yes: a meeting place where people attempt to achieve advanced states of mental incompetence by the repeated consumption of fermented vegetable drinks.

http://gmvolk.deviantart.com/
User avatar
Mordasius
Posts: 1173
Joined: January 22nd, 2011, 4:23 pm
Location: GMT +8

Re: Help with power plugin.

Post by Mordasius »

gmvolk wrote:With this, if the power is plugged in and therefore the battery is charging your image is shown. Once on DC the image is gone.
That is certainly another approach, but what happens when you are plugged in and fully charged? I suspect this method would still show the battery as charging.


P.S. @ the yoshi

You need to change Disable=1 to Disabled=1 in [ImageNumberCalc] but that doesn't stop the images from showing when the battery is charging. Your code works as it is on my Toshiba.
the yoshi
Posts: 7
Joined: July 10th, 2012, 7:14 am

Re: Help with power plugin.

Post by the yoshi »

Well I just realized I made a huge rookie mistake and named the images 1-6 instead of 0-5. So I changed that and the log was fixed, but still nothing on the skin. Then I looked and the value of PowerStatus is at 4 constantly when its plugged in. Not knowing if I can fix this, I changed...

Code: Select all

IfEqualValue=1
IfEqualAction=[!ShowMeter ImageMeter] [!EnableMeasure ImageNumberCalc]
IfAboveValue=1
IfAboveAction=[!HideMeter ImageMeter] [!DisableMeasure ImageNumberCalc]
to...

Code: Select all

IfEqualValue=4
IfEqualAction=[!ShowMeter ImageMeter] [!EnableMeasure ImageNumberCalc]
IfbelowValue=4
IfBelowAction=[!HideMeter ImageMeter] [!DisableMeasure ImageNumberCalc]
and it still didn't work.
User avatar
Mordasius
Posts: 1173
Joined: January 22nd, 2011, 4:23 pm
Location: GMT +8

Re: Help with power plugin.

Post by Mordasius »

the yoshi wrote:Then I looked and the value of PowerStatus is at 4 constantly when its plugged in. Not knowing if I can fix this,....
Firstly go back to the skin as it was before. Then unplug your computer from the mains, turn off any power saving functions and play a nice CPU intensive game for an hour or so to drain the battery down from STATUS=4 (high charge). Now plug in to the mains again and you should see the images flashing away merrily as the battery starts charging.
:)
the yoshi
Posts: 7
Joined: July 10th, 2012, 7:14 am

Re: Help with power plugin.

Post by the yoshi »

As I was in the process of trying that, I looked at it at about 40%, and the value was 0...I then plugged it in and it was 1, but still nothing. I changed it back to the original also.
This brings up another question, why didnt it work also when I changed it and it was at 4?
User avatar
Mordasius
Posts: 1173
Joined: January 22nd, 2011, 4:23 pm
Location: GMT +8

Re: Help with power plugin.

Post by Mordasius »

Well I'm sorry this hasn't worked out for you because I have your code running on my Toshiba and it is doing exactly what I expected it to.

The only other thing I can think of is please be sure that you have the latest beta version of rainmeter installed get 2.3.3 here.
the yoshi
Posts: 7
Joined: July 10th, 2012, 7:14 am

Re: Help with power plugin.

Post by the yoshi »

That's the one I have. Thanks for all the help, but I think its just my computer if yours runs it fine. I'll test it on my friends computer tomorrow and see if other people can at least use the theme.
User avatar
Mordasius
Posts: 1173
Joined: January 22nd, 2011, 4:23 pm
Location: GMT +8

Re: Help with power plugin.

Post by Mordasius »

gmvolk wrote:Thats odd, when I unplug the power the status goes to 0.
My apologies gmvolk. You are quite right the status does sometimes go to 0 when you unplug from the mains and without an Action for STATUS=0 the 'charging images' could keep on displaying even though there is a battery which is no longer being charged. This doesn't happen all the time (see the right-hand image below) but it can happen. Apologies once again.

I have now changed the [PowerStatus] measure to the following so STATUS=0 means not charging rather than no battery:

Code: Select all

[PowerStatus]
Measure=PLUGIN
Plugin=PowerPlugin
PowerState=STATUS
IfBelowValue=1
IfBelowAction=[!HideMeter IMAGEMeter] [!DisableMeasure IMAGENumberCalc]
IfEqualValue=1
IfEqualAction=[!ShowMeter IMAGEMeter] [!EnableMeasure IMAGENumberCalc]
IfABoveValue=1
IfAboveAction=[!HideMeter IMAGEMeter] [!DisableMeasure IMAGENumberCalc]
Substitute="0":"Not Charging","1":"Charging","2":"Critical","3":"Low Charge","4":"High Charge"
UpdateDivider=#UpdateMultiplier#
@ the yoshi
Although the above would explain why the 'sparkle images' somtimes kept sparkling even if you unplugged from the mains, it doesn't explain why they were not showing in the first place. Just to be sure we are reading from the same book, would you please download the attached BatteryStatus.rmskin and install it on your computer. This version gives a bit more detail on the status of the battery which should help identify the problem you are having. Note that the kittywiggle images are in the @Resources sub-folder.
BatteryStatus.jpg
You do not have the required permissions to view the files attached to this post.