[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdebase/workspace/ksysguard/gui
From:       John Tapsell <john.tapsell () kdemail ! net>
Date:       2009-07-21 19:40:52
Message-ID: 1248205252.382867.28520.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1000688 by johnflux:

Reverted previous commit - it needs a bit of thinking through.  This seems to stop \
the Memory graph from working.  Reverting just the changes to SystemLoad2.sgrd don't \
fix the problem either.

CCBUG:181150


 M  +7 -4      SensorDisplayLib/FancyPlotter.cc  
 M  +5 -0      SensorDisplayLib/FancyPlotter.h  
 M  +2 -2      SystemLoad2.sgrd  


--- trunk/KDE/kdebase/workspace/ksysguard/gui/SensorDisplayLib/FancyPlotter.cc \
#1000687:1000688 @@ -89,6 +89,7 @@
   mBeams = 0;
   mNumAccountedFor = 0;
   mSettingsDialog = 0;
+  mSensorReportedMax = mSensorReportedMin = 0;
 
   //The unicode character 0x25CF is a big filled in circle.  We would prefer to use \
this in the tooltip.  //However it's maybe possible that the font used to draw the \
tooltip won't have it.  So we fall back to a  @@ -557,11 +558,13 @@
         mUnit = "KiB/s";
 
 
-    /*
-     * here we do nothing with the min and max since if the autorange is false then \
                we don't overwrite the user
-     * min and max, and if we are in autorange mode then the scale will be adjusted \
                automatically with new value by the plotter
-     */
+    mSensorReportedMax = qMax(mSensorReportedMax, info.max());
+    mSensorReportedMin = qMin(mSensorReportedMin, info.min());
+    if(mSensorReportedMax == 0 && mSensorReportedMin)
+      mPlotter->setUseAutoRange(true); // If any of the sensors are using autorange, \
then the whole graph must use auto range  
+    if ( !mPlotter->useAutoRange())
+      mPlotter->changeRange( mSensorReportedMin, mSensorReportedMax );
     plotterAxisScaleChanged(); //This sets up the axis scales and sets the unit.  It \
relies on mUnit already being set  
     FPSensorProperties *sensor = static_cast<FPSensorProperties *>(sensors().at(id - \
                100));
--- trunk/KDE/kdebase/workspace/ksysguard/gui/SensorDisplayLib/FancyPlotter.h \
#1000687:1000688 @@ -105,6 +105,11 @@
     /** Number of beams we've received an answer from since asking last */
     uint mNumAccountedFor;
 
+    /** When we talk to the sensor, it tells us a range.  Record the max here.  \
equals 0 until we have an answer from it */ +    double mSensorReportedMax;
+    /** When we talk to the sensor, it tells us a range.  Record the min here.  \
equals 0 until we have an answer from it */ +    double mSensorReportedMin;
+
     /** The widget that actually draws the beams */
     KSignalPlotter* mPlotter;
 
--- trunk/KDE/kdebase/workspace/ksysguard/gui/SystemLoad2.sgrd #1000687:1000688
@@ -2,10 +2,10 @@
 <!DOCTYPE KSysGuardWorkSheet>
 <WorkSheet title="System Load" interval="0.5" locked="1" rows="3" columns="1" >
  <host port="-1" command="ksysguardd" shell="" name="localhost" />
- <display title="CPU History" svgBackground="widgets/plot-background" autoRange="0" \
min="0" max="100" class="FancyPlotter" column="0" row="0" version="1"> + <display \
title="CPU History" svgBackground="widgets/plot-background" autoRange="0" \
class="FancyPlotter" column="0" row="0" version="1">  <beam sensorType="float" \
hostName="localhost" regexpSensorName="cpu/cpu.*/TotalLoad" \
color="0xffff8000,0xffe20800" />  </display>
- <display title="Memory and Swap History" svgBackground="widgets/plot-background" \
autoRange="1" class="FancyPlotter" column="0" row="1" version="1" > + <display \
title="Memory and Swap History" svgBackground="widgets/plot-background" autoRange="0" \
class="FancyPlotter" column="0" row="1" version="1" >  <beam summationName="Memory" \
sensorName="mem/physical/application" sensorType="integer" hostName="localhost" \
color="0xffc000c0" />  <beam summationName="Swap" sensorName="mem/swap/used" \
sensorType="integer" hostName="localhost" color="0xff00c000" />  </display>


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic