private function InitIPSStructure($libraryBasePath) {
			$path = 'IPSLibrary.install.IPSModuleManager.IPSVersionHandler';
			if ($libraryBasePath <> '') {
				$path = $libraryBasePath.'.'.$path;
			}
			$categoryId            = CreateCategoryPath($path);
			$this->instanceId      = CreateDummyInstance("IPSLibrary", $categoryId, 30);
			$this->libraryBasePath = $libraryBasePath;
		}
		CreateWFCItemCategory  ($WFC10_ConfigId,       $tabItem.'_TopRight'.$UId, $tabItem.'_Top',  20, '', '', $categoryId_WebFrontTopRight /*BaseId*/, 'false' /*BarBottomVisible*/);

		ReloadAllWebFronts();
	}
	// ----------------------------------------------------------------------------------------------------------------------------
	// Mobile Installation
	// ----------------------------------------------------------------------------------------------------------------------------
	if ($Mobile_Enabled) {
		$mobileId  = CreateCategoryPath($Mobile_Path, $Mobile_PathOrder, $Mobile_PathIcon);
		$mobileId  = CreateCategoryPath($Mobile_Path.'.'.$Mobile_Name, $Mobile_Order, $Mobile_Icon);
		
		$InstanceId    = CreateDummyInstance("Sonnen-Aufgang/Untergang",  $mobileId, 10);
		CreateLink('Begin/Ende',   $SunriseDisplay, $InstanceId, 10);
		CreateLink('Limits',       $SunriseLimits,  $InstanceId, 20);
		$InstanceId    = CreateDummyInstance("Zivile Dämmerung",  $mobileId, 20);
		CreateLink('Begin/Ende',   $CivilDisplay, $InstanceId, 10);
		CreateLink('Limits',       $CivilLimits,  $InstanceId, 20);
		$InstanceId    = CreateDummyInstance("Nautische Dämmerung",  $mobileId, 30);
		CreateLink('Begin/Ende',   $NauticDisplay, $InstanceId, 10);
		CreateLink('Limits',       $NauticLimits,  $InstanceId, 20);
		$InstanceId    = CreateDummyInstance("Astronomische Dämmerung",  $mobileId, 40);
		CreateLink('Begin/Ende',   $AstronomicDisplay, $InstanceId, 10);
		CreateLink('Limits',       $AstronomicLimits,  $InstanceId, 20);

		CreateLinkByDestination("Jahres Grafik",            $YearUnlimitedMediaId,   $mobileId, 100);
		CreateLinkByDestination('Tages Grafik',             $DayUnlimitedMediaId,    $mobileId, 110);
		CreateLinkByDestination("Jahres Grafik (limited)",  $YearLimitedMediaId,     $mobileId, 120);
		CreateLinkByDestination('Tages Grafik (limited)',   $DayLimitedMediaId,      $mobileId, 130);
	}
	/** @}*/
?>
Ejemplo n.º 3
0
	/* ---------------------------------------------------------------------- */
	/* EDIP Program Installation                                              */
	/* ---------------------------------------------------------------------- */

	$CategoryIdData = CreateCategoryPath($DataPath);
	$CategoryIdApp  = CreateCategoryPath($AppPath);
	$CategoryIdHW   = CreateCategoryPath($HardwarePath);

	$id_ScriptTimer   = IPS_GetScriptIDByName('IPSEDIP_Timer',   $CategoryIdApp);
	$id_ScriptEvent   = IPS_GetScriptIDByName('IPSEDIP_Event',   $CategoryIdApp);
	$id_ScriptReceive = IPS_GetScriptIDByName('IPSEDIP_Receive', $CategoryIdApp);


	foreach (IPSEDIP_GetConfiguration() as $configItem=>$configData) {
	   if ($configData[EDIP_CONFIG_ROOT]<>"") {
			$id_Instance   = CreateDummyInstance($configItem, $CategoryIdData, 10);
			$id_Register   = CreateVariable(EDIP_VAR_REGISTER,     1 /*Integer*/, $id_Instance,  10, '', null, 0);
			$id_Root       = CreateVariable(EDIP_VAR_ROOT,         1 /*Integer*/, $id_Instance,  20, '', null, 0);
			$id_Current    = CreateVariable(EDIP_VAR_CURRENT,      1 /*Integer*/, $id_Instance,  40, '', null, 0);
			$id_Categories = CreateVariable(EDIP_VAR_OBJECTIDS,    3 /*String*/,  $id_Instance,  50, '', null, '');
			$id_Variables  = CreateVariable(EDIP_VAR_OBJECTCMDS,   3 /*String*/,  $id_Instance,  60, '', null, '');
			$id_Variables  = CreateVariable(EDIP_VAR_OBJECTVALUES, 3 /*String*/,  $id_Instance,  60, '', null, '');
			$id_value      = CreateVariable(EDIP_VAR_OBJECTEDIT,   1 /*Integer*/, $id_Instance,  70, '', null, 0);

			// Create Serial Port
         $id_IOComPort = null;
			if ($configData[EDIP_CONFIG_COMPORT] <> '') {
				$id_IOComPort = CreateSerialPort('EDIP_'.$configData[EDIP_CONFIG_NAME], $configData[EDIP_CONFIG_COMPORT], 115200, 1, 8, 'None',0, $IgnoreIOPortInstanceError);
			}
			// Create Register Variable
			$registerIdConfig = $configData[EDIP_CONFIG_REGISTER];
		CreateLink('Execute Purge',    $ID_ScriptIPSLoggerPurgeLogFiles, $ID_Output,   40);

		$ID_Output = CreateDummyInstance("Log4IPS", $ID_CategoryiPhone, 500);
		CreateLink('Output Enabled',   $ID_Log4IPSOutEnabled,            $ID_Output,   10);
		CreateLink('Logging Level',    $ID_Log4IPSOutLevel,              $ID_Output,   20);
		CreateLink('Purge Files after',$ID_Log4IPSOutDays,               $ID_Output,   30);
		CreateLink('Execute Purge',    $ID_ScriptIPSLoggerPurgeLogFiles, $ID_Output,   40);

		$ID_Output = CreateDummyInstance("EMail", $ID_CategoryiPhone, 600);
		CreateLink('Output Enabled',   $ID_EMailOutEnabled,              $ID_Output,   10);
		CreateLink('Logging Level',    $ID_EMailOutLevel,                $ID_Output,   20);
		CreateLink('Priority',         $ID_EMailOutPriority,             $ID_Output,   30);
		CreateLink('Send Delay',       $ID_EMailOutSendDelay,            $ID_Output,   40);
		CreateLink('Message List',     $ID_EMailOutMsgList,              $ID_Output,   50);

		$ID_Output = CreateDummyInstance("Prowl", $ID_CategoryiPhone, 700);
		CreateLink('Output Enabled',   $ID_ProwlOutEnabled,              $ID_Output,   10);
		CreateLink('Logging Level',    $ID_ProwlOutLevel,                $ID_Output,   20);
		CreateLink('Priority',         $ID_ProwlOutPriority,             $ID_Output,   30);
	}

	Register_PhpErrorHandler($moduleManager);

	
	// ----------------------------------------------------------------------------------------------------------------------------
	// Some Tests
	// ----------------------------------------------------------------------------------------------------------------------------
	IPSUtils_Include ("IPSLogger.inc.php", "IPSLibrary::app::core::IPSLogger");

	//  Some Test Messages
	IPSLogger_Fat(__file__, 'Test for a Fatal Error');
		   // iPhone Overview
			CreateLink($CircleName,  get_WateringControlId(c_Control_Active,     $CirclyId),  $mobileId,      $Idx);

			// Detailed CirclyData
			$WebFrontiPhoneDetailId  = CreateCategory($CircleName, $mobileId, $Idx*10);
			$iPhoneControl = CreateDummyInstance("Steuerung", $WebFrontiPhoneDetailId, 10);
			CreateLink('Status',             get_WateringControlId(c_Control_Active,     $CirclyId),  $iPhoneControl, 10);
			CreateLink('Automatik',          get_WateringControlId(c_Control_Automatic,  $CirclyId),  $iPhoneControl, 20);

			$iPhoneProgram = CreateDummyInstance("Programm", $WebFrontiPhoneDetailId, 20);
			CreateLink('Programm',           get_WateringControlId(c_Control_Program,    $CirclyId),  $iPhoneProgram, 30);
			CreateLink('Sensor',             get_WateringControlId(c_Control_Sensor,     $CirclyId),  $iPhoneProgram, 35);
			CreateLink('Beregnungs Dauer',   get_WateringControlId(c_Control_Duration,   $CirclyId),  $iPhoneProgram, 40);
			CreateLink('Start Zeit',         get_WateringControlId(c_Control_StartTime,  $CirclyId),  $iPhoneProgram, 50);

			$iPhoneInfos = CreateDummyInstance("Infos", $WebFrontiPhoneDetailId, 30);
			CreateLink('Nächste Dauer',      get_WateringControlId(c_Control_ToBeDone,   $CirclyId),  $iPhoneInfos, 60);
			CreateLink('Nächste Beregnung',  get_WateringControlId(c_Control_NextDisplay,$CirclyId),  $iPhoneInfos, 70);
			CreateLink('Nächstes Datum',     get_WateringControlId(c_Control_NextDate,   $CirclyId),  $iPhoneInfos, 80);
			CreateLink('Letztes Datum',      get_WateringControlId(c_Control_LastDate,   $CirclyId),  $iPhoneInfos, 90);
			CreateLink('Letzte Zeit',        get_WateringControlId(c_Control_LastTime,   $CirclyId),  $iPhoneInfos, 100);

			$Idx = $Idx + 10;
		}
	}


   // ------------------------------------------------------------------------------------------------
	function get_WateringCirclyId($DeviceName, $ParentId) {
		$CategoryId = IPS_GetObjectIDByIdent($DeviceName, $ParentId);
		return $CategoryId;