From 470f2cf92c60803d45c7ce5e17e76f7356026742 Mon Sep 17 00:00:00 2001 From: jan Date: Tue, 27 Nov 2007 19:05:22 +0000 Subject: [PATCH] xml output added git-svn-id: file:///home/jan/tmp/wetterstation/trunk@233 dd492736-c11a-0410-ad51-8c26713eaf7f --- .../content/module_sets/set_xml_full.html | 16 +++++++ .../frontend/content/modules/mod_xmlhum.html | 45 ++++++++++++++++++ .../content/modules/mod_xmlpress.html | 46 +++++++++++++++++++ .../frontend/content/modules/mod_xmlrain.html | 43 +++++++++++++++++ .../frontend/content/modules/mod_xmltemp.html | 45 ++++++++++++++++++ .../frontend/content/modules/mod_xmlwind.html | 42 +++++++++++++++++ webstuff/frontend/frontend.conf | 3 ++ webstuff/frontend/index.php | 12 ++++- webstuff/frontend/php_inc/chart.inc.php | 9 ++++ webstuff/frontend/php_inc/config.inc.php | 5 ++ webstuff/frontend/php_inc/module.inc.php | 12 +++-- webstuff/frontend/php_inc/module_set.inc.php | 4 ++ 12 files changed, 277 insertions(+), 5 deletions(-) create mode 100644 webstuff/frontend/content/module_sets/set_xml_full.html create mode 100644 webstuff/frontend/content/modules/mod_xmlhum.html create mode 100644 webstuff/frontend/content/modules/mod_xmlpress.html create mode 100644 webstuff/frontend/content/modules/mod_xmlrain.html create mode 100644 webstuff/frontend/content/modules/mod_xmltemp.html create mode 100644 webstuff/frontend/content/modules/mod_xmlwind.html diff --git a/webstuff/frontend/content/module_sets/set_xml_full.html b/webstuff/frontend/content/module_sets/set_xml_full.html new file mode 100644 index 0000000..250a285 --- /dev/null +++ b/webstuff/frontend/content/module_sets/set_xml_full.html @@ -0,0 +1,16 @@ + + +{content:addModule:xmltemp_1} +{content:addModule:xmlhum_1} +{content:addModule:xmlpress_1} + + +{content:addModule:xmltemp_4} +{content:addModule:xmlhum_4} + + +{content:addModule:xmlwind_2} + + +{content:addModule:xmlrain_3} + diff --git a/webstuff/frontend/content/modules/mod_xmlhum.html b/webstuff/frontend/content/modules/mod_xmlhum.html new file mode 100644 index 0000000..84eec5d --- /dev/null +++ b/webstuff/frontend/content/modules/mod_xmlhum.html @@ -0,0 +1,45 @@ + + {content:fill:sens_id} + {content:fill:sens_location} + {content:fill:sens_description} + + {content:fill:hum_now_val} + {content:fill:hum_now_date} + + + {content:fill:hum_av_value} + {content:fill:hum_av_interval} + + + {content:fill:hum_changing} + + + {content:fill:hum_max_val} + {content:fill:hum_max_date} + + + {content:fill:hum_min_val} + {content:fill:hum_min_date} + + + + hum + Luftfeuchtediagramm Sensor {content:fill:sens_id} - 30 Tage + 10 + {content:addChartImgLink:hum_10} + + + hum + Luftfeuchtediagramm Sensor {content:fill:sens_id} - 30 Tage + 30 + {content:addChartImgLink:hum_30} + + + hum + Luftfeuchtediagramm Sensor {content:fill:sens_id} - 365 Tage + 365 + {content:addChartImgLink:hum_365} + + + + diff --git a/webstuff/frontend/content/modules/mod_xmlpress.html b/webstuff/frontend/content/modules/mod_xmlpress.html new file mode 100644 index 0000000..47858c7 --- /dev/null +++ b/webstuff/frontend/content/modules/mod_xmlpress.html @@ -0,0 +1,46 @@ + + {content:fill:sens_id} + {content:fill:sens_location} + {content:fill:sens_description} + + {content:fill:press_now_val} + {content:fill:press_now_date} + + + {content:fill:press_av_value} + {content:fill:press_av_interval} + + + {content:fill:press_changing} + + + {content:fill:press_max_val} + {content:fill:press_max_date} + + + {content:fill:press_min_val} + {content:fill:press_min_date} + + + + press + Luftdruckdiagramm Sensor {content:fill:sens_id} - 30 Tage + 10 + {content:addChartImgLink:press_10} + + + press + Luftdruckdiagramm Sensor {content:fill:sens_id} - 30 Tage + 30 + {content:addChartImgLink:press_30} + + + press + Luftdruckdiagramm Sensor {content:fill:sens_id} - 365 Tage + 365 + {content:addChartImgLink:press_365} + + + + + diff --git a/webstuff/frontend/content/modules/mod_xmlrain.html b/webstuff/frontend/content/modules/mod_xmlrain.html new file mode 100644 index 0000000..5f1d52f --- /dev/null +++ b/webstuff/frontend/content/modules/mod_xmlrain.html @@ -0,0 +1,43 @@ + + {content:fill:sens_id} + {content:fill:sens_location} + {content:fill:sens_description} + {content:fill:rain_now_hour} + {content:fill:rain_now_day} + {content:fill:rain_now_month} + + + {content:fill:rain_max_hour_date} + {content:fill:rain_max_hour_val} + + + {content:fill:rain_max_day_date} + {content:fill:rain_max_day_val} + + + {content:fill:rain_max_month_date} + {content:fill:rain_max_month_val} + + + + + rain + Regendiagramm Sensor {content:fill:sens_id} - 30 Tage + 10 + {content:addChartImgLink:rain_10} + + + rain + Regendiagramm Sensor {content:fill:sens_id} - 30 Tage + 30 + {content:addChartImgLink:rain_30} + + + rain + Regendiagramm Sensor {content:fill:sens_id} - 365 Tage + 365 + {content:addChartImgLink:rain_365} + + + + diff --git a/webstuff/frontend/content/modules/mod_xmltemp.html b/webstuff/frontend/content/modules/mod_xmltemp.html new file mode 100644 index 0000000..0eafc12 --- /dev/null +++ b/webstuff/frontend/content/modules/mod_xmltemp.html @@ -0,0 +1,45 @@ + + {content:fill:sens_id} + {content:fill:sens_location} + {content:fill:sens_description} + + {content:fill:temp_now_val} + {content:fill:temp_now_date} + + + {content:fill:temp_av_value} + {content:fill:temp_av_interval} + + + {content:fill:temp_changing} + + + {content:fill:temp_max_val} + {content:fill:temp_max_date} + + + {content:fill:temp_min_val} + {content:fill:temp_min_date} + + + + temp + Temparaturdiagramm Sensor {content:fill:sens_id} - 30 Tage + 10 + {content:addChartImgLink:temp_10} + + + temp + Temparaturdiagramm Sensor {content:fill:sens_id} - 30 Tage + 30 + {content:addChartImgLink:temp_30} + + + temp + Temparaturdiagramm Sensor {content:fill:sens_id} - 365 Tage + 365 + {content:addChartImgLink:temp_365} + + + + diff --git a/webstuff/frontend/content/modules/mod_xmlwind.html b/webstuff/frontend/content/modules/mod_xmlwind.html new file mode 100644 index 0000000..ec93ccf --- /dev/null +++ b/webstuff/frontend/content/modules/mod_xmlwind.html @@ -0,0 +1,42 @@ + + {content:fill:sens_id} + {content:fill:sens_location} + {content:fill:sens_description} + + {content:fill:wind_now_val} + {content:fill:wind_now_date} + + + {content:fill:wind_av_value} + {content:fill:wind_av_interval} + + + {content:fill:wind_changing} + + + {content:fill:wind_max_val} + {content:fill:wind_max_date} + + + + wind + Winddiagramm Sensor {content:fill:sens_id} - 30 Tage + 10 + {content:addChartImgLink:wind_10} + + + wind + Winddiagramm Sensor {content:fill:sens_id} - 30 Tage + 30 + {content:addChartImgLink:wind_30} + + + wind + Winddiagramm Sensor {content:fill:sens_id} - 365 Tage + 365 + {content:addChartImgLink:wind_365} + + + + + diff --git a/webstuff/frontend/frontend.conf b/webstuff/frontend/frontend.conf index c23531d..4e75ea6 100644 --- a/webstuff/frontend/frontend.conf +++ b/webstuff/frontend/frontend.conf @@ -80,4 +80,7 @@ $report = array( 'hum_365_4' =>array( "Daten - Report", "Listet Stündliche Luftfeuchtigkeits - Werte der Letzten 10 Tage", 4, "hum", "day", "1 years", "Luftfeuchtigkeit", 1, "%", "hum", true, "DD.MM.YYYY ", "report") ); +/* Nicht-Standard-Sets */ +$notStandard = array("xml_full"); + ?> diff --git a/webstuff/frontend/index.php b/webstuff/frontend/index.php index 191d5cf..ce728fb 100644 --- a/webstuff/frontend/index.php +++ b/webstuff/frontend/index.php @@ -7,6 +7,8 @@ $path = "./"; include_once($path."php_inc/module_set.inc.php"); + + if (ModuleSet::isStandardPage($_REQUEST['setType'])) { ?> @@ -17,8 +19,14 @@

- - + + diff --git a/webstuff/frontend/php_inc/chart.inc.php b/webstuff/frontend/php_inc/chart.inc.php index d04ca94..c4e291f 100644 --- a/webstuff/frontend/php_inc/chart.inc.php +++ b/webstuff/frontend/php_inc/chart.inc.php @@ -72,6 +72,15 @@ class Chart{ return Chart::_getChartImgTag($chartName); } + function insertChartLink($chartName){ + if($chartName == "auto"){ + $chartName = $_REQUEST['chartName']; + } + $chartArray = Config::getChartArray($chartName); + + return Chart::_getChartImgLink($chartArray[0]); + } + } ?> diff --git a/webstuff/frontend/php_inc/config.inc.php b/webstuff/frontend/php_inc/config.inc.php index d1b97ca..f92a1d5 100644 --- a/webstuff/frontend/php_inc/config.inc.php +++ b/webstuff/frontend/php_inc/config.inc.php @@ -53,5 +53,10 @@ class Config{ global $average_interval; return $average_interval; } + + function getNotStandardPages(){ + global $notStandard; + return $notStandard; + } } ?> diff --git a/webstuff/frontend/php_inc/module.inc.php b/webstuff/frontend/php_inc/module.inc.php index 320826f..7465254 100644 --- a/webstuff/frontend/php_inc/module.inc.php +++ b/webstuff/frontend/php_inc/module.inc.php @@ -42,9 +42,11 @@ class Module{ $this->parserInstance = &$parser; $this->table = $this->_getTableName(); - $parser->parseContent($this->_getModuleFilename("frame"), & $this, "top"); /* Oberen Modulrahmen parsen */ + if (ModuleSet::isStandardPage($_REQUEST['setType'])) + $parser->parseContent($this->_getModuleFilename("frame"), & $this, "top"); /* Oberen Modulrahmen parsen */ $parser->parseContent($this->_getModuleFilename($modName), & $this, NULL); /* Modul Parsen */ - $parser->parseContent($this->_getModuleFilename("frame"), & $this, "bottom"); /* unteren Modulrahmen Parsen */ + if (ModuleSet::isStandardPage($_REQUEST['setType'])) + $parser->parseContent($this->_getModuleFilename("frame"), & $this, "bottom"); /* unteren Modulrahmen Parsen */ } function _getTableName(){ @@ -126,7 +128,11 @@ class Module{ } function addChart($chartName){ - Chart::insertChart($chartName); + return Chart::insertChart($chartName); + } + + function addChartImgLink($chartName){ + return Chart::insertChartLink($chartName.'_'.$this->sensId); } function addSetLink($setName){ diff --git a/webstuff/frontend/php_inc/module_set.inc.php b/webstuff/frontend/php_inc/module_set.inc.php index b41df2a..336cc8f 100644 --- a/webstuff/frontend/php_inc/module_set.inc.php +++ b/webstuff/frontend/php_inc/module_set.inc.php @@ -109,5 +109,9 @@ class ModuleSet{ return $buff; } + + function isStandardPage($set_type){ + return !in_array($set_type, Config::getNotStandardPages()); + } } ?>