From cfa235d91344cc6c8338d04f0e43dfeadedc1c72 Mon Sep 17 00:00:00 2001 From: Random Hacker Date: Wed, 1 Sep 2010 00:40:33 +0200 Subject: played around with solar pump and rectangle --- test.r | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'test.r') 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)) -- cgit v1.2.1