Bug 73595 - ksysguard kicker applet does not display floating point values
Summary: ksysguard kicker applet does not display floating point values
Status: RESOLVED FIXED
Alias: None
Product: ksysguard
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: KSysGuard Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-01-27 13:06 UTC by Jan De Luyck
Modified: 2007-09-23 01:41 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan De Luyck 2004-01-27 13:06:25 UTC
Version:           1.2.0 (using KDE 3.1.5)
Installed from:     (testing/unstable)
Compiler:          gcc version 3.3.3 20031229 (prerelease) (Debian)
OS:          Linux (i686) release 2.6.1

I'm trying to get the kicker ksysguard applet to display the current CPU speed as a multimeter. Unfortunately, this always displays "0".

Every sensor that is a floating point as type displays 0 in multimeter mode on the kicker applet.
Comment 1 Jan De Luyck 2004-02-24 12:00:48 UTC
Still present in KDE 3.2.
Comment 2 Jan De Luyck 2004-05-11 07:10:17 UTC
Still present in KDE 3.2.2.
Comment 3 Jan De Luyck 2004-10-14 10:24:41 UTC
Still present in KDE 3.3
Comment 4 Thomas Müller 2004-11-22 16:27:32 UTC
Actually, it displays it, but it trunactes before displaying. Temperatures are displayed, but only as integers. 34.5°C gets 34°C. 0.75 Load will get 0, as most other numbers between 0 and 1.
Comment 5 Jan De Luyck 2004-11-22 16:37:17 UTC
Problem is, while my frequency should list e.g. 599.9, it shows 0 instead.
Comment 6 Thomas Müller 2004-11-29 10:20:17 UTC
I did some more testing in source-code. It only shows 2 digits, and floats. The output looks like:

50 -> 50
23.53 > 24
150 > 0

So, if it has more than 3 digits it displays only 0, if it is floating-point it rounds. I looked at every file of the code, but i didnt find a reason for it. If you give more horizontal space to the lcd-Display it still does the same.
Comment 7 Thomas Müller 2004-11-29 10:47:50 UTC
Argh. i looked at the code again and i cant believe how blind i was to miss it.
Multimeter.cc, line 108 says:
if (noFrame()) lcd->setNumDigits(2);

noFrame is true, if its in the kicker, then it only gets 2 Digits. I changed it to 5 digits, but then it will only fit if at 120% size. Lets see if i can find a solution for that, for a dirty workaround just set it to 5 for now.
Comment 8 Tobias Koenig 2004-11-29 15:16:46 UTC
On Mon, Nov 29, 2004 at 09:47:51AM -0000, Thomas Müller wrote:
Hi,

> Argh. i looked at the code again and i cant believe how blind i was to miss it.
> Multimeter.cc, line 108 says:
> if (noFrame()) lcd->setNumDigits(2);
QLCDLabel doesn't support drawing numbers when the width is quite small.
For this reason I set the number of digits to show to 2. I know that's
more a hacky workaround than a real fix, but we can't change it atm.

Ciao,
Tobias
Comment 9 Thomas Müller 2004-11-29 16:50:23 UTC
I could think of some workarounds for this, i.e. calculate the number of digits based on the Size Ratio-Variable. For 120% 3 digits are working fine.

I could try to write something like this, but im not good at coding and have no clue about the kde-developing-process, so i would need some help from you. Mail me if you want (kde@elfstone.de)
Comment 10 Greg Martyn 2007-09-23 01:36:35 UTC
Nitpick: It's a QLCDNumber
Comment 11 Greg Martyn 2007-09-23 01:41:50 UTC
SVN commit 715704 by martyn:

BUG: 73595
The digital display now displays floats with 2 digits after the decimal. Also, a bug when showing values < 1 was fixed.


 M  +19 -2     MultiMeter.cc  
 M  +2 -0      MultiMeter.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=715704