Author Topic: Sandwich's Rainmeter Skin (previously: "Math equation question")  (Read 2945 times)

0 Members and 1 Guest are viewing this topic.

Offline Sandwich

  • Got Screen?
  • 213
    • Skype
    • Steam
    • Twitter
    • Brainzipper
Sandwich's Rainmeter Skin (previously: "Math equation question")
I'm working on a Rainmeter skin with some meters for my drive usage levels (how full they are). Each drive has it's own meter, scaled proportionately. I have 3 drives: 250gb, 750gb, and 1500gb. Proportionately, I sized their meters at a 5:1 ratio, so the 250gb drive's meter was 50 pixels long, the 750gb was 150px, and the 1500gb was 300px - pretty reasonable sizing. Layered over each drive is a numeric value representing how many gb's of free space remain on each drive.

Recently, I got an SSD, and so now I need to toss a 40gb drive (partition, actually - irrelevant) into the mix. At the aforementioned ratio, it would be sized at 8px - large enough to glean approximately how much free space remains graphically, but not large enough to place the numeric value over the meter.

So what I'd like to do is to change the sizing of the meters from a direct 5:1 ratio to something more complex. I'm not sure which mathematical term I'm looking for - logarithmic, exponential, whatever - but basically I want every ten-fold increase in drive size to result in a doubling of the meter's width. If fed convenient values, it would result in something like this, the final values of which I can multiply to get the scale correct:

10 = 1
100 = 2
1,000 = 4
10,000 = 8

Can anyone point me in the right direction, preferably using the functions available here?
« Last Edit: March 04, 2012, 07:55:54 am by Sandwich »
SERIOUSLY...! | {The Sandvich Bar} - Rhino-FS2 Tutorial | CapShip Turret Upgrade | The Complete FS2 Ship List | System Background Package

"...The quintessential quality of our age is that of dreams coming true. Just think of it. For centuries we have dreamt of flying; recently we made that come true: we have always hankered for speed; now we have speeds greater than we can stand: we wanted to speak to far parts of the Earth; we can: we wanted to explore the sea bottom; we have: and so  on, and so on: and, too, we wanted the power to smash our enemies utterly; we have it. If we had truly wanted peace, we should have had that as well. But true peace has never been one of the genuine dreams - we have got little further than preaching against war in order to appease our consciences. The truly wishful dreams, the many-minded dreams are now irresistible - they become facts." - 'The Outward Urge' by John Wyndham

"The very essence of tolerance rests on the fact that we have to be intolerant of intolerance. Stretching right back to Kant, through the Frankfurt School and up to today, liberalism means that we can do anything we like as long as we don't hurt others. This means that if we are tolerant of others' intolerance - especially when that intolerance is a call for genocide - then all we are doing is allowing that intolerance to flourish, and allowing the violence that will spring from that intolerance to continue unabated." - Bren Carlill

 

Offline Locutus of Borg

  • 28
  • Who counted those posts?????????????
Re: Math equation question
I believe you want

2^(log(x) - 1)

where the log has a base of ten

« Last Edit: December 19, 2011, 02:19:42 pm by Locutus of Borg »
We are the Borg
We will add your biological and technological distinctiveness to our own

Resistance is FUTILE

 

Offline MP-Ryan

  • Makes General Discussion Make Sense.
  • Global Moderator
  • 210
  • Keyboard > Pen > Sword
Re: Math equation question
I believe you want

2^(log(x) - 1)

where the log has a base of ten

Which translates to (for example):

10 = 1 px
100 = 2 px
1000 = 4 px
10000 = 8 px

So it's probably a bad idea to use 10 GB as your base value going in, since your range will be quite restrictive on the graph.

EDIT:  Locutus, your math is correct.
log 10 = 1, log 100 = 2, log 1000 = 3, etc.
2^0 = 1, 2^1 = 2, 2^2 = 4, 2^3 = 8, etc.

Unless I missed something.
"In the beginning, the Universe was created.  This made a lot of people very angry and has widely been regarded as a bad move."  [Douglas Adams]

 

Offline Locutus of Borg

  • 28
  • Who counted those posts?????????????
Re: Math equation question
I believe you want

2^(log(x) - 1)

where the log has a base of ten

Which translates to (for example):

10 = 1 px
100 = 2 px
1000 = 4 px
10000 = 8 px

So it's probably a bad idea to use 10 GB as your base value going in, since your range will be quite restrictive on the graph.

EDIT:  Locutus, your math is correct.
log 10 = 1, log 100 = 2, log 1000 = 3, etc.
2^0 = 1, 2^1 = 2, 2^2 = 4, 2^3 = 8, etc.

Unless I missed something.

10 = 1

2^(log(x) - 1) = 2^(1-1) = 2^0 = 1

100 = 2

2^(log(x) - 1) = 2^(2-1) = 2


1,000 = 4

2^(log(x) - 1) = 2^(3 - 1) = 4


10,000 = 8

2^(log(x) - 1) = 2^(4 - 1) = 8
We are the Borg
We will add your biological and technological distinctiveness to our own

Resistance is FUTILE

 

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
Re: Math equation question
yeah, so like they said you want a logarithmic scale.
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together

 

Offline Spicious

  • Master Chief John-158
  • 210
Re: Math equation question
It's not actually logarithmic as it's exponentiated again. It's clearer if you simplify it to x ^ (log 2) / 2 where the log is base 10.

 

Offline Sandwich

  • Got Screen?
  • 213
    • Skype
    • Steam
    • Twitter
    • Brainzipper
Re: Math equation question
I believe you want

2^(log(x) - 1)

where the log has a base of ten

I'll try to convert that into Rainmeter-speak, thanks. :)

So it's probably a bad idea to use 10 GB as your base value going in, since your range will be quite restrictive on the graph.

Indeed... the scale will start with 80Gb at 40 pixels, which should max out with 1.5Tb at something like 500px or so (80 = 40px, 800 = 400px, 800x2 ~ 1.5Tb, so something above 400px)?
SERIOUSLY...! | {The Sandvich Bar} - Rhino-FS2 Tutorial | CapShip Turret Upgrade | The Complete FS2 Ship List | System Background Package

"...The quintessential quality of our age is that of dreams coming true. Just think of it. For centuries we have dreamt of flying; recently we made that come true: we have always hankered for speed; now we have speeds greater than we can stand: we wanted to speak to far parts of the Earth; we can: we wanted to explore the sea bottom; we have: and so  on, and so on: and, too, we wanted the power to smash our enemies utterly; we have it. If we had truly wanted peace, we should have had that as well. But true peace has never been one of the genuine dreams - we have got little further than preaching against war in order to appease our consciences. The truly wishful dreams, the many-minded dreams are now irresistible - they become facts." - 'The Outward Urge' by John Wyndham

"The very essence of tolerance rests on the fact that we have to be intolerant of intolerance. Stretching right back to Kant, through the Frankfurt School and up to today, liberalism means that we can do anything we like as long as we don't hurt others. This means that if we are tolerant of others' intolerance - especially when that intolerance is a call for genocide - then all we are doing is allowing that intolerance to flourish, and allowing the violence that will spring from that intolerance to continue unabated." - Bren Carlill

  

Offline Sandwich

  • Got Screen?
  • 213
    • Skype
    • Steam
    • Twitter
    • Brainzipper
Re: Math equation question
Finally finished the entire meter; link is below if anyone is interested in it. It has histograms for CPU usage, used/free RAM, upload/download speeds, and drive read/write activity, as well as logarithmically-scaled bars for drive used/free capacities. It's sized to fit within the titlebar space of typical Windows apps (24 pixels high). The intention is that it be a set of always-visible meters rather than something that just sits on the desktop.



Download here: http://staff.hard-light.net/sandwich/rainmeter/sandwich-rainmeter.zip

Suggestions and requests welcome. :)
SERIOUSLY...! | {The Sandvich Bar} - Rhino-FS2 Tutorial | CapShip Turret Upgrade | The Complete FS2 Ship List | System Background Package

"...The quintessential quality of our age is that of dreams coming true. Just think of it. For centuries we have dreamt of flying; recently we made that come true: we have always hankered for speed; now we have speeds greater than we can stand: we wanted to speak to far parts of the Earth; we can: we wanted to explore the sea bottom; we have: and so  on, and so on: and, too, we wanted the power to smash our enemies utterly; we have it. If we had truly wanted peace, we should have had that as well. But true peace has never been one of the genuine dreams - we have got little further than preaching against war in order to appease our consciences. The truly wishful dreams, the many-minded dreams are now irresistible - they become facts." - 'The Outward Urge' by John Wyndham

"The very essence of tolerance rests on the fact that we have to be intolerant of intolerance. Stretching right back to Kant, through the Frankfurt School and up to today, liberalism means that we can do anything we like as long as we don't hurt others. This means that if we are tolerant of others' intolerance - especially when that intolerance is a call for genocide - then all we are doing is allowing that intolerance to flourish, and allowing the violence that will spring from that intolerance to continue unabated." - Bren Carlill