/*
* This file is part of the IPSLibrary.
*
* The IPSLibrary is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* The IPSLibrary is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the IPSLibrary. If not, see http://www.gnu.org/licenses/gpl.txt.
*/
/**@defgroup ipscam_visualization IPSCam Visualisierung
* @ingroup ipscam
* @{
*
* Visualisierungen von IPSCam
*
* IPSCam WebFront Visualisierung:
*
*
*@}*/
/**@defgroup ipscam_install IPSCam Installation
* @ingroup ipscam
* @{
*
* Script zur kompletten Installation der IPSCam Steuerung.
*
* Vor der Installation muß das File IPSCam_Configuration.inc.php an die persönlichen
* Bedürfnisse angepasst werden.
*
* @page rquirements_IPSCam Installations Voraussetzungen
* - IPS Kernel >= 2.50
* - IPSModuleManager >= 2.50.2
* - IPSLogger >= 2.50.1
* - IPSComponent >= 2.50.1
*
* @page install_IPSCam Installations Schritte
* Folgende Schritte sind zur Installation der IPSCam Ansteuerung nötig:
* - Laden des Modules (siehe IPSModuleManager)
* - Konfiguration (Details siehe Konfiguration)
* - Installation (siehe IPSModuleManager)
*
* @file IPSCam_Installation.ips.php
* @author Andreas Brauneis
* @version
* Version 2.50.1, 09.08.2012
*
*/
if (!isset($moduleManager)) {
IPSUtils_Include ('IPSModuleManager.class.php', 'IPSLibrary::install::IPSModuleManager');
echo 'ModuleManager Variable not set --> Create "default" ModuleManager';
$moduleManager = new IPSModuleManager('IPSCam');
}
$moduleManager->VersionHandler()->CheckModuleVersion('IPS','2.50');
$moduleManager->VersionHandler()->CheckModuleVersion('IPSModuleManager','2.50.2');
$moduleManager->VersionHandler()->CheckModuleVersion('IPSLogger','2.50.2');
$moduleManager->VersionHandler()->CheckModuleVersion('IPSComponent','2.50.1');
IPSUtils_Include ("IPSInstaller.inc.php", "IPSLibrary::install::IPSInstaller");
IPSUtils_Include ("IPSCam.inc.php", "IPSLibrary::app::modules::IPSCam");
IPSUtils_Include ("IPSCam_Constants.inc.php", "IPSLibrary::app::modules::IPSCam");
IPSUtils_Include ("IPSCam_Configuration.inc.php", "IPSLibrary::config::modules::IPSCam");
$WFC10_Enabled = $moduleManager->GetConfigValue('Enabled', 'WFC10');
$WFC10_ConfigId = $moduleManager->GetConfigValueIntDef('ID', 'WFC10', GetWFCIdDefault());
$WFC10_Path = $moduleManager->GetConfigValue('Path', 'WFC10');
$WFC10_TabPaneItem = $moduleManager->GetConfigValue('TabPaneItem', 'WFC10');
$WFC10_TabPaneParent = $moduleManager->GetConfigValue('TabPaneParent', 'WFC10');
$WFC10_TabPaneName = $moduleManager->GetConfigValue('TabPaneName', 'WFC10');
$WFC10_TabPaneIcon = $moduleManager->GetConfigValue('TabPaneIcon', 'WFC10');
$WFC10_TabPaneOrder = $moduleManager->GetConfigValueInt('TabPaneOrder', 'WFC10');
$WFC10_TabItem = $moduleManager->GetConfigValue('TabItem', 'WFC10');
$WFC10_TabName = $moduleManager->GetConfigValue('TabName', 'WFC10');
$WFC10_TabIcon = $moduleManager->GetConfigValue('TabIcon', 'WFC10');
$WFC10_TabOrder = $moduleManager->GetConfigValueInt('TabOrder', 'WFC10');
$Mobile_Enabled = $moduleManager->GetConfigValue('Enabled', 'Mobile');
$Mobile_Path = $moduleManager->GetConfigValue('Path', 'Mobile');
$Mobile_PathOrder = $moduleManager->GetConfigValueInt('PathOrder', 'Mobile');
$Mobile_PathIcon = $moduleManager->GetConfigValue('PathOrder', 'Mobile');
$Mobile_Name = $moduleManager->GetConfigValue('Name', 'Mobile');
$Mobile_Order = $moduleManager->GetConfigValueInt('Order', 'Mobile');
$Mobile_Icon = $moduleManager->GetConfigValue('Icon', 'Mobile');
// ----------------------------------------------------------------------------------------------------------------------------
// Program Installation
// ----------------------------------------------------------------------------------------------------------------------------
$CategoryIdData = $moduleManager->GetModuleCategoryID('data');
$CategoryIdApp = $moduleManager->GetModuleCategoryID('app');
$categoryIdCommon = CreateCategory('Common', $CategoryIdData, 10);
$categoryIdCams = CreateCategory('Cams', $CategoryIdData, 20);
$categoryIdDisplay = CreateCategory('Display', $CategoryIdData, 30);
$categoryIdNavPanel = CreateCategory('NavigationPanel', $categoryIdDisplay,10);
$categoryIdCamPanel = CreateCategory('CameraPanel', $categoryIdDisplay,20);
// Add Scripts
$scriptIdActionScript = IPS_GetScriptIDByName('IPSCam_ActionScript', $CategoryIdApp);
$scriptIdPurgeFiles = IPS_GetScriptIDByName('IPSCam_PurgeFiles', $CategoryIdApp);
$scriptIdGenerateMovies = IPS_GetScriptIDByName('IPSCam_GenerateMovies', $CategoryIdApp);
$scriptIdNavPicPrev = IPS_GetScriptIDByName('IPSCam_NavPicPrev', $CategoryIdApp);
$scriptIdNavPicNext = IPS_GetScriptIDByName('IPSCam_NavPicNext', $CategoryIdApp);
$scriptIdNavDayPrev = IPS_GetScriptIDByName('IPSCam_NavDayPrev', $CategoryIdApp);
$scriptIdNavDayNext = IPS_GetScriptIDByName('IPSCam_NavDayNext', $CategoryIdApp);
$scriptIdPictRef = IPS_GetScriptIDByName('IPSCam_RefreshPicture', $CategoryIdApp);
$scriptIdPictStore = IPS_GetScriptIDByName('IPSCam_StorePicture', $CategoryIdApp);
IPS_SetIcon($scriptIdNavPicPrev, 'HollowArrowLeft');
IPS_SetIcon($scriptIdNavPicNext, 'HollowArrowRight');
IPS_SetIcon($scriptIdNavDayPrev, 'HollowDoubleArrowLeft');
IPS_SetIcon($scriptIdNavDayNext, 'HollowDoubleArrowRight');
IPS_SetIcon($scriptIdPictRef, 'Repeat');
IPS_SetIcon($scriptIdPictStore, 'ArrowRight');
$timerId_PurgeFiles = CreateTimer_OnceADay ('Purge', $scriptIdPurgeFiles, 0, 30) ;
$timerId_GenerateMovies = CreateTimer_OnceADay ('Generate', $scriptIdGenerateMovies, 0, 45) ;
// Profiles
$associationsMode = array(IPSCAM_MODE_LIVE => 'Live',
IPSCAM_MODE_PICTURE => 'Bild',
IPSCAM_MODE_HISTORY => 'History',
IPSCAM_MODE_SETTINGS => 'Einstellungen');
$associationsCam = array();
foreach (IPSCam_GetConfiguration() as $idx=>$data) {
$associationsCam[$idx] = $data[IPSCAM_PROPERTY_NAME];
}
$associationsSize = array(IPSCAM_SIZE_SMALL => 'S',
IPSCAM_SIZE_MIDDLE => 'M',
IPSCAM_SIZE_LARGE => 'L');
$associationsNavPict = array(IPSCAM_NAV_BACK => '<<',
IPSCAM_NAV_FORWARD => '>>');
$associationsNavDays = array(IPSCAM_DAY_BACK => '<<',
IPSCAM_DAY_FORWARD => '>>');
$associationsMotMode = array(1*60 => '1 Min',
5*60 => '5 Min',
10*60 => '10 Min',
30*60 => '30 Min',
60*60 => '1 Stunde',
60*60*24 => '1 Tag',
IPSCAM_VAL_DISABLED => 'Aus');
$associationsPictRef = array(10 => '10 Sek',
30 => '30 Sek',
60 => '1 Min',
5*60 => '5 Min',
10*60 => '10 Min',
30*60 => '30 Min',
IPSCAM_VAL_DISABLED => 'Aus');
$associationsPictStore = array(30*60 => '30 Min',
60*60 => '1 Stunde',
60*60*4 => '4 Stunden',
IPSCAM_VAL_DISABLED => 'Aus');
$associationsPictReset = array(1*60 => '1 Min',
5*60 => '5 Min',
10*60 => '10 Min',
30*60 => '30 Min',
60*60 => '1 Stunde',
IPSCAM_VAL_DISABLED => 'Aus');
CreateProfile_Associations ('IPSCam_Size', $associationsSize);
CreateProfile_Associations ('IPSCam_Cam', $associationsCam);
CreateProfile_Associations ('IPSCam_Mode', $associationsMode);
CreateProfile_Associations ('IPSCam_NavPict', $associationsNavPict);
CreateProfile_Associations ('IPSCam_NavDays', $associationsNavDays);
CreateProfile_Associations ('IPSCam_MotMode', $associationsMotMode);
CreateProfile_Count ('IPSCam_MotHist', 1, 1, 365, null, ' Tage', null);
CreateProfile_Associations ('IPSCam_PictRef', $associationsPictRef);
CreateProfile_Associations ('IPSCam_PictStore', $associationsPictStore);
CreateProfile_Associations ('IPSCam_PictReset', $associationsPictReset);
CreateProfile_Count ('IPSCam_PictHist', 1, 1, 365, null, ' Tage', null);
// ===================================================================================================
// Add Camera Devices
// ===================================================================================================
$variableIdCamSelect = CreateVariable(IPSCAM_VAR_CAMSELECT,1 /*Integer*/, $categoryIdCommon, 10, 'IPSCam_Cam', $scriptIdActionScript, 0, 'Power');
$variableIdCamHtml = CreateVariable(IPSCAM_VAR_CAMHTML, 3 /*String*/, $categoryIdCommon,100, '~HTMLBox', $scriptIdActionScript, '