[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [kde-workspace/plasma/sreich/qml2-system-monitors] plasma/generic/applets/system-monitor/plotter/pri
From: Shaun Reich <shaun.reich () kdemail ! net>
Date: 2012-02-17 2:06:23
Message-ID: 20120217020623.2D8C0A60BE () git ! kde ! org
[Download RAW message or body]
Git commit 156a74aefe7b69517de26848c3b009b180e008c5 by Shaun Reich.
Committed on 17/02/2012 at 00:48.
Pushed by sreich into branch 'plasma/sreich/qml2-system-monitors'.
reenable shifting left
M +1 -1 plasma/generic/applets/system-monitor/plotter/private/PlotterCanvas.qml
M +15 -11 plasma/generic/applets/system-monitor/plotter/private/plotterpainter.js
http://commits.kde.org/kde-workspace/156a74aefe7b69517de26848c3b009b180e008c5
diff --git a/plasma/generic/applets/system-monitor/plotter/private/PlotterCanvas.qml \
b/plasma/generic/applets/system-monitor/plotter/private/PlotterCanvas.qml index \
342d93b..d007bd2 100644
--- a/plasma/generic/applets/system-monitor/plotter/private/PlotterCanvas.qml
+++ b/plasma/generic/applets/system-monitor/plotter/private/PlotterCanvas.qml
@@ -24,7 +24,7 @@ Item {
height: 400
//milliseconds
- property int sampleInterval: 500
+ property int sampleInterval: 50
Canvas {
id: canvas
anchors.fill: parent
diff --git a/plasma/generic/applets/system-monitor/plotter/private/plotterpainter.js \
b/plasma/generic/applets/system-monitor/plotter/private/plotterpainter.js index \
c74b63c..734dcbd 100644
--- a/plasma/generic/applets/system-monitor/plotter/private/plotterpainter.js
+++ b/plasma/generic/applets/system-monitor/plotter/private/plotterpainter.js
@@ -71,12 +71,12 @@ function addSample(y, sampleSet, fillColor)
if (points[pointsIndex] === undefined) {
points.push(new Array());
- print("PUSHED NEW ARRAY TO POINTS");
+ // print("PUSHED NEW ARRAY TO POINTS");
points[pointsIndex].push(new Array());
// points[points.length - 1][points
}
- print("INITILA LENGTH: " + points.length);
+// print("INITILA LENGTH: " + points.length);
// adding a new sample, making a new element that contains x and y
// set x at a predefined interval (horizSpace)
// only takes into consideration current length of sampleSet
@@ -93,13 +93,13 @@ function addSample(y, sampleSet, fillColor)
// print("NEWLENGTH: " + points.length);
- print("$$$$$$POINTS INDEX IS: " + pointsIndex);
+ // print("$$$$$$POINTS INDEX IS: " + pointsIndex);
points[pointsIndex].push( { x: xValue, originalY: yValue, scaledY: yValue, \
fillColor: fillColor } );
- print("POINTS[INDEX].length " + points[pointsIndex].length);
+ // print("POINTS[INDEX].length " + points[pointsIndex].length);
//print("POINTS[INDEX][0]: " + points[pointsIndex][0]);
//print("POINTS[INDEX][1]: " + points[pointsIndex][1]);
-print("POINTS[INDEX][sampleSet]: " + points[pointsIndex][sampleSet]);
+//print("POINTS[INDEX][sampleSet]: " + points[pointsIndex][sampleSet]);
//debug("SAMPLE POINT ADDED:" + points[points.length - 1][points[points.length - \
1].length - 1].x ); // print("SAMPLE LISTS POINTS:length: " + sampleSetLength \
+ " " + points[points.length - 1][sampleSetLength - 1].x); @@ -157,7 +157,7 @@ \
function downscaleAll(y)
function debug(str)
{
- print("PlotterPainter::" + arguments.callee.caller.name.toString() + "() OUTPUT: \
" + str); + // print("PlotterPainter::" + arguments.callee.caller.name.toString() + \
"() OUTPUT: " + str); }
function shiftLeft()
@@ -165,13 +165,16 @@ function shiftLeft()
debug("");
//shift all x points left some
for (var i = 0; i < points.length; ++i) {
- for (var j = 0; j < sampleSetLength; ++j) {
+ for (var j = 0; j < points[i].length; ++j) {
if (points[i][j].x < graphPadding || (points[i][j].x - horizSpace) < \
graphPadding) {
- points.splice(i, 1);
+// points.splice(i, 1);
}
+ print("*****^^^^^** SHIFTLEFT VALUE, BEFORE: " + points[i][j].x);
points[i][j].x -= horizSpace;
+ print("*****^^^^^** SHIFTLEFT VALUE, AFTER: " + points[i][j].x);
+
if (hoverText.visible = true) {
//shift hovertext to the left actually
hoverText.x -= horizSpace;
@@ -224,9 +227,10 @@ function advancePlotter()
addSample(height - yPos, 0, "rgba(0, 0, 255, .5)");
addSample(height - yPos2, 1, "rgba(0, 0, 0, .5)");
-// if ((points[points.length - 1][sampleSetLength - 1] * horizSpace) >= width - \
graphPadding) {
-// shiftLeft();
- // }
+ var index = points.length - 1;
+ if ((points[index][points[index].length - 1].x * horizSpace) >= width - \
graphPadding) { + shiftLeft();
+ }
}
function paint(canvas, context)
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic