コード例 #1
0
ファイル: alias.class.php プロジェクト: bwssytems/domuslink
 /**
  * Constructor
  *
  * @args[0] represents label and house/unit code and mod types
  */
 function __construct()
 {
     $args = func_get_args();
     if (!empty($args)) {
         parent::__construct($args[0]);
         if (strtolower(trim($this->getType())) == ALIAS_D) {
             $this->parseAliasLine($this->getElementLine());
             $this->rebuildElementLine();
         } else {
             throw new Exception("This is not an alias line!");
         }
     } else {
         parent::__construct();
         $this->setType(ALIAS_D);
         $this->label = 'light';
         $this->houseCode = 'A';
         $this->devices = '0';
         $this->moduleType = 'STDLM';
         $this->moduleOptions = '';
         $this->aliasMapElement = new AliasMapElement();
         $this->aliasMapElement->setAliasLabel($this->label);
         $this->aliasMapElement->rebuildElementLine();
         $this->enabled = true;
         $this->rebuildElementLine();
     }
 }
コード例 #2
0
ファイル: scene.class.php プロジェクト: bwssytems/domuslink
 /**
  * Constructor
  *
  * @args[0] represents label and commands
  */
 function __construct()
 {
     $args = func_get_args();
     if (!empty($args)) {
         parent::__construct($args[0]);
         if (strtolower(trim($this->getType())) == SCENE_D) {
             $this->parseSceneLine($this->getElementLine());
             $this->rebuildElementLine();
         } else {
             throw new Exception("This is not a scene line!");
         }
     } else {
         parent::__construct();
         $this->setType(SCENE_D);
         $this->label = 'sceneX';
         $this->commands = 'on a1';
         $this->aliasMapElement = new AliasMapElement();
         $this->aliasMapElement->setAliasLabel($this->label);
         $this->aliasMapElement->rebuildElementLine();
         $this->enabled = true;
         $this->rebuildElementLine();
     }
 }