Strength int to bar conversion

Carsten Haitzler (The Rasterman) raster at rasterman.com
Mon Jan 5 23:16:17 CET 2009


On Mon, 05 Jan 2009 15:31:21 +0100 Michele Renda <michele.renda at gmail.com>
babbled:

> Hello to all...
> 
> Here for you another question:
> 
>  From fso-framework, I receive the signal strenght as a int 0 <= i <= 100.
> If I want to present this value as well know "vertical green bar" (4 
> bar) how according you is better to transform i to bar?
> 
> I am currently using this:
> 
>          if strength >=90:
>              bar = 4
>          elif strength >=80:
>              bar = 3
>          elif strength >=50:
>              bar = 2
>          elif strength >=10:
>              bar = 1
>          else:
>              bar = 0
> 
> But I am not sure if the values I choose were good. There is a standard?

why take something with high accuracy and make it nice an inaccurate by
reducing its resolution to basically 5 levels? other than being able to say "i
only get 2 bars here!" just display it with all the pixels you have available.
add something for those who must get a numeric quantifier when you click on it
or something (for full signal/network etc. info).

-- 
------------- Codito, ergo sum - "I code, therefore I am" --------------
The Rasterman (Carsten Haitzler)    raster at rasterman.com





More information about the community mailing list