summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRandom Hacker <random_hacker@xapek.org>2010-09-01 00:40:33 +0200
committerRandom Hacker <random_hacker@xapek.org>2010-09-01 00:40:33 +0200
commitcfa235d91344cc6c8338d04f0e43dfeadedc1c72 (patch)
treef33a56a0953b39f9654e19df66b1f6fd4ccec11e
parent228431a46a863c104b5603a498665b012e9ea6c5 (diff)
downloadebus-alt-cfa235d91344cc6c8338d04f0e43dfeadedc1c72.tar.gz
ebus-alt-cfa235d91344cc6c8338d04f0e43dfeadedc1c72.zip
played around with solar pump and rectangle
-rwxr-xr-xtest.r16
1 files changed, 13 insertions, 3 deletions
diff --git a/test.r b/test.r
index 303a71f..58716e9 100755
--- a/test.r
+++ b/test.r
@@ -53,8 +53,6 @@ for (i in seq(1,nrow(solarEngine))) {
}
solarEngine <- solarEngineNew
-print(solarEngine)
-
# Numerische Sensoren Lesen
readNumericSensorDay <- function (sensorName) {
d <- dbGetQuery(con,
@@ -116,8 +114,20 @@ for (i in c(1:nrow(brenner))) {
}
# quick and dirty add solarEngine to plot
+
+rect_start <- 0
+rect_color <- rgb(255, 255, 0, alpha=40, maxColorValue=255)
+
for (i in c(1:nrow(solarEngine))) {
- text(as.numeric(solarEngine$time[i]), max(data[2:length(data)],na.rm=TRUE)/2, paste("Solar Pumpe", solarEngine$value_int[i]), srt=90)
+ if (solarEngine$value_int[i] == 1) {
+ rect_start <- solarEngine$time[i];
+ } else if (rect_start != 0) {
+ end <- solarEngine$time[i];
+ # plot
+ rect(rect_start, 0, solarEngine$time[i], 100, col=rect_color,border=F)
+ beginn <- 0
+ }
+ #text(as.numeric(solarEngine$time[i]), max(data[2:length(data)],na.rm=TRUE)/2, paste("Solar Pumpe", solarEngine$value_int[i]), srt=90)
}
rangeX <- as.POSIXct(range(data$time))