1
0
mirror of https://github.com/agdsn/ancient-weatherstation.git synced 2026-06-19 23:07:59 +00:00

Working on Frontend

git-svn-id: file:///home/jan/tmp/wetterstation/trunk@24 dd492736-c11a-0410-ad51-8c26713eaf7f
This commit is contained in:
losinshi
2006-08-16 10:59:36 +00:00
parent 162879454a
commit 4249404692
4 changed files with 59 additions and 17 deletions
+31 -3
View File
@@ -1,22 +1,50 @@
<?
include_once("php_inc/parser.inc.php");
include_once("php_inc/sensor.inc.php");
include_once("php_inc/temp.inc.php");
class Module{
var $sensId; /* Sensor-Id */
var $connection; /* Connection - Instanz */
var $parserInstance = NULL; /* Parser - Instanz */
var $connectionInstance = NULL; /* Connection - Instanz */
var $sensInstance = NULL; /* Sensor-Instanz */
var $tempInstance = NULL; /* Temp-Instanz */
function Module($modName, $sensId, $parser, $connection){
$parser->parseContent($this->_getModuleFilename($modName));
$this->$sensId = $sensId;
$this->$connection = $connection;
$parser->parseContent($this->_getModuleFilename("frame"), $this, "top");
$parser->parseContent($this->_getModuleFilename($modName), $this, NULL);
$parser->parseContent($this->_getModuleFilename("frame"), $this, "bottom");
}
function _getModuleFilename($modName){
return "/content/modules/mod_".$modName.".html";
return "content/modules/mod_".$modName.".html";
}
function _get_sens(){
if($sensInstance == NULL)
$this->$sensInstance = new Sensor($this->$sensId, $this->$connection);
return $this->$sensInstance;
}
function _get_temp(){
if($tempInstance == NULL)
$this->$tempInstance = new Temp($this->$sensId, $this->$connection);
return $this->$tempInstance;
}
function fill($contentId){
$content_split = explode("_", $contentId);
return $this->"get".$content_split[0]($content_split[1])
$callObject = call_user_method("_get_".$content_split[0], $this);
$funcName = "get".substr($contentId, strlen($content_split[0]), strlen($contentId)-strlen($content_split[0]));
echo "\n\naufruf: ".$funcName."()\n\n";
return $callObject->$funcName($content_split[1]);
}
}