It is currently April 26th, 2024, 3:10 pm

RecycleManager

Get help with creating, editing & fixing problems with skins
User avatar
smurfier
Moderator
Posts: 1931
Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN

RecycleManager

Post by smurfier »

So, I want to make a recycle bin that shows half empty when the content is below 100mb, two thirds full below 1gb, and completely full above 1gb. The problem is that the plugin exports the size already scaled. I get really confused when I put it in a string meter without autoscale and get it in bytes. Anyone out there with suggestions?
GitHub | DeviantArt | Tumblr
This is the song that never ends. It just goes on and on my friends. Some people started singing it not knowing what it was, and they'll continue singing it forever just because . . .
User avatar
JpsCrazy
Posts: 667
Joined: April 18th, 2010, 2:16 pm
Location: NY, USA

Re: RecycleManager

Post by JpsCrazy »

Well. You can put it through a calc (I think)
(RetrievedValue)/1048576 = How many Mbs (1024 is a Gb)

So...
[MeasureCalcMb]
Measure=Calc
Formula=#RetrievedValue#/1048576

[MeasureCalcSpace]
Measure=Calc
Formula=[MeasureCalcMb] > 1024 ? 2 : (Value > 100 ? 1 : 0)
IfBelowValue=1
IfBelowAction=!Execute [!RainmeterShowMeter ImageHalfEmpty][!RainmeterHideMeter ImageTwoThirds][!RainmeterHideMeter ImageFull]
IfEqualValue=1
IfEqualAction=!Execute [!RainmeterShowMeter ImageTwoThirds][!RainmeterHideMeter ImageHalfEmpty][!RainmeterHideMeter ImageFull]
IfAboveValue=1
IfAboveAction=!Execute [!RainmeterShowMeter ImageFull][!RainmeterHideMeter ImageHalfEmpty][!RainmeterHideMeter ImageTwoThirds]

[Edit] You can't use dynamic variables with plugins though... have to find a way around that I'd suppose. >.>
User avatar
smurfier
Moderator
Posts: 1931
Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN

Re: RecycleManager

Post by smurfier »

Well...one wouldn't have to use dynamic variables with your method. Problem is, when you put something that is 24mb in the recycle bin, the measure reads 24.0 M. If it read in bytes, things would be very simple.
GitHub | DeviantArt | Tumblr
This is the song that never ends. It just goes on and on my friends. Some people started singing it not knowing what it was, and they'll continue singing it forever just because . . .
poiru
Developer
Posts: 2872
Joined: April 17th, 2009, 12:18 pm

Re: RecycleManager

Post by poiru »

Isn't the M for million (so value is actually 24 million, but it's 24.0 M to make it easier to read)?

24 megabytes = 25 165 824 bytes
User avatar
smurfier
Moderator
Posts: 1931
Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN

Re: RecycleManager

Post by smurfier »

with that I would just be able to divide by 100,000, which gives me a completely incorrect number.
GitHub | DeviantArt | Tumblr
This is the song that never ends. It just goes on and on my friends. Some people started singing it not knowing what it was, and they'll continue singing it forever just because . . .
User avatar
smurfier
Moderator
Posts: 1931
Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN

Re: RecycleManager

Post by smurfier »

Turns out I was unwittingly doing the wrong math. Now that I'm doing things right, it's working beautifully.
GitHub | DeviantArt | Tumblr
This is the song that never ends. It just goes on and on my friends. Some people started singing it not knowing what it was, and they'll continue singing it forever just because . . .
User avatar
Alex2539
Rainmeter Sage
Posts: 642
Joined: July 19th, 2009, 5:59 am
Location: Montreal, QC, Canada

Re: RecycleManager

Post by Alex2539 »

poiru wrote:Isn't the M for million (so value is actually 24 million, but it's 24.0 M to make it easier to read)?

24 megabytes = 25 165 824 bytes
No, the "M" is for "Mega". It's just a shorthand for MB. "Mega" just so happens to be the SI prefix for "one million". However, when dealing with data, they don't use the real values of the SI prefixes. Instead they just sort of stole them and made them correspond to similar values in terms of powers of 2. Normally, "Kilo" would be 103 which is 1000, but for data, it's 210 which is 1024. It's close enough to 1000, but not quite, which is why you often see discrepancies. The rest of the common prefixes going up are "Mega", "Giga", "Tera" and in extreme cases, "Peta" which are 220, 230, 240 and 250 respectively.
ImageImageImageImage
User avatar
jsmorley
Developer
Posts: 22630
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: RecycleManager

Post by jsmorley »

sizes.jpg
sizes2.jpg
You do not have the required permissions to view the files attached to this post.
User avatar
smurfier
Moderator
Posts: 1931
Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN

Re: RecycleManager

Post by smurfier »

Well, that explains a lot. I got my numbers from here.
GitHub | DeviantArt | Tumblr
This is the song that never ends. It just goes on and on my friends. Some people started singing it not knowing what it was, and they'll continue singing it forever just because . . .