本文整理汇总了PHP中IPS_GetName函数的典型用法代码示例。如果您正苦于以下问题:PHP IPS_GetName函数的具体用法?PHP IPS_GetName怎么用?PHP IPS_GetName使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了IPS_GetName函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: RefreshLinks
private function RefreshLinks()
{
if ($this->ReadPropertyInteger("LinkSource") == 0) {
foreach (IPS_GetChildrenIDs($this->InstanceID) as $Child) {
if (IPS_GetObject($Child)['ObjectType'] == 6) {
IPS_DeleteLink($Child);
}
}
return;
}
$present = array();
foreach (IPS_GetChildrenIDs($this->InstanceID) as $Child) {
if (IPS_GetObject($Child)['ObjectType'] == 6) {
$present[] = IPS_GetLink($Child)['TargetID'];
}
}
$create = array_diff(IPS_GetChildrenIDs($this->ReadPropertyInteger("LinkSource")), $present);
foreach ($create as $Target) {
if (IPS_GetObject($Target)["ObjectIsHidden"]) {
continue;
}
$Link = IPS_CreateLink();
IPS_SetParent($Link, $this->InstanceID);
IPS_SetName($Link, IPS_GetName($Target));
IPS_SetLinkTargetID($Link, $Target);
}
}
示例2: Entertainment_SetRemoteControl
function Entertainment_SetRemoteControl($Id, $Value) {
$DeviceName = IPS_GetName(IPS_GetParent($Id));
if (!isDevicePoweredOnByDeviceName($DeviceName)) {
return;
}
IPSLogger_Dbg(__file__, 'Set RemoteControl for Device "'.$DeviceName.'": '.$Value);
SetValue($Id, $Value);
Entertainment_SetRoomControlByDeviceControlId($Id, $Value);
}
示例3: HandleEvent
/**
* @public
*
* Function um Events zu behandeln, diese Funktion wird vom IPSMessageHandler aufgerufen, um ein aufgetretenes Event
* an das entsprechende Module zu leiten.
*
* @param integer $variable ID der auslösenden Variable
* @param string $value Wert der Variable
* @param IPSModulePlayer $module Module Object an das das aufgetretene Event weitergeleitet werden soll
*/
public function HandleEvent($variable, $value, IPSModulePlayer $module) {
$name = IPS_GetName($variable);
switch($name) {
case 'Titel': // Sync current Titel of Player
$module->SyncTitel($value);
break;
default:
throw new IPSComponentException('Event Handling NOT supported for Variable '.$variable.'('.$name.')');
}
}
示例4: Entertainment_SetRoomPower
function Entertainment_SetRoomPower($PowerId, $Value, $PowerOnDevices=true) {
if (GetValue($PowerId) <> $Value) {
IPSLogger_Inf(__file__, 'Set Power for Room "'.IPS_GetName(IPS_GetParent($PowerId)).'" '.bool2OnOff($Value));
SetValue($PowerId, $Value);
Entertainment_SetRoomVisible($PowerId, $Value);
if ($PowerOnDevices) {
Entertainment_SetDevicePowerByRoomId(IPS_GetParent($PowerId), $Value);
}
Entertainment_SyncRoomControls(IPS_GetParent($PowerId));
}
}
示例5: Entertainment_SetDevicePowerByRoomId
function Entertainment_SetDevicePowerByRoomId($RoomId, $Value=true) {
if ($Value) {
$RoomName = IPS_GetName($RoomId);
$DeviceNames = get_DeviceNamesByRoomId($RoomId);
foreach ($DeviceNames as $DeviceName) {
Entertainment_SetDevicePowerByDeviceName($DeviceName, true);
}
} else {
Entertainment_PowerOffUnusedDevices();
}
}
示例6: Delete_Script
function Delete_Script($scriptId, $filePath) {
$scriptName = IPS_GetName($scriptId);
$object = IPS_GetScript($scriptId);
$scriptFile = $object['ScriptFile'];
echo "Remove old Script File $scriptFile\n";
if (!IPS_DeleteScript($scriptId, false)) {
echo "Error set deleting Script $scriptId, File=$scriptFile\n";
exit;
}
//if (!unlink(IPS_GetKernelDir().'\\scripts\\'.$scriptFile)) {
// echo "Error deleting old Script File '$scriptFile'\n";
// exit;
//}
}
示例7: Create
/**
* overload internal IPS_Create($id) function
*/
public function Create()
{
// Diese Zeile nicht löschen.
parent::Create();
//Hint: $this->debug will not work in this stage! must use IPS_LogMessage
//props
$this->RegisterPropertyString('Category', 'NUT Devices');
$this->RegisterPropertyInteger('ParentCategory', 0);
//parent cat is root
$this->RegisterPropertyInteger('Port', 3493);
$this->RegisterPropertyInteger('UpdateInterval', 300);
$this->RegisterPropertyInteger('NomPower', self::default_nomval);
$this->RegisterPropertyString('IDfield', 'ups.serial');
$this->RegisterPropertyString('UPSname', '');
$this->RegisterPropertyString('Host', '');
$this->RegisterPropertyString('LogFile', '');
$this->RegisterPropertyBoolean('AutoCreate', true);
$this->RegisterPropertyBoolean('Debug', false);
$this->RegisterPropertyBoolean('Active', false);
//timer
$this->RegisterTimer('Update', 0, $this->module_data["prefix"] . '_UpdateEvent($_IPS[\'TARGET\']);');
//Vars
$this->RegisterVariableString('Buffer', 'Buffer', "", -1);
IPS_SetHidden($this->GetIDForIdent('Buffer'), true);
//Connect Parent
$this->RequireParent($this->module_interfaces['ClientSocket']);
$pid = $this->GetParent();
if ($pid) {
$name = IPS_GetName($pid);
if ($name == "Client Socket") {
IPS_SetName($pid, __CLASS__ . " Socket");
}
}
if (IPS_GetKernelRunlevel() == self::KR_READY) {
if ($this->isActive() && $this->GetParent() > 0) {
$this->SetStatus(self::ST_AKTIV);
$i = $this->GetUpdateInterval();
$this->SetTimerInterval('Update', $i * 1000);
//ms
$this->debug(__FUNCTION__, "Starte Timer {$i} sec");
$this->init();
} else {
$this->SetStatus(self::ST_INACTIV);
}
}
}
示例8: AddMessageHeader
protected function AddMessageHeader() {
// Common Settings
$this->messageArray[] = 'TA'; // Terminal aus
$this->messageArray[] = 'AL,0,1'; // Touch löschen
$this->messageArray[] = 'DL'; // Display leeren
$this->messageArray[] = 'AS,0'; // Summer aus
$this->messageArray[] = 'YH,30'; // Helligkeit auf 30
// Top Line
$this->messageArray[] = "FP,19,130,130,130"; // Define Color
$this->messageArray[] = "FE,8,1,19,8,1,7"; // Button Color
if ($this->rootId <> $this->currentId) $this->messageArray[] = 'AT,1,1,75,25,1,0,C<<'; // Touch Button
$this->messageArray[] = 'ZF,5'; // Schriftart
$this->messageArray[] = 'ZZ,1,1'; // SchriftZoom
$this->messageArray[] = 'ZC,220,5,'.IPS_GetName($this->currentId); // Current Category
$this->messageArray[] = "FG,8,1,1"; // Line Color
$this->messageArray[] = 'GR,1,30,480,30'; // Line
$this->messageArray[] = 'GR,160,30,160,272'; // Line
}
示例9: Entertainment_SendDataBySourceIdx
function Entertainment_SendDataBySourceIdx($RoomId, $SourceIdx, $MessageType) {
if ($MessageType <> c_MessageType_Action) {
return;
}
$RoomName = IPS_GetName($RoomId);
$DeviceTypes = get_SourceDeviceTypes($RoomId, $SourceIdx);
$SourceConf = get_SourceConfiguration();
foreach ($DeviceTypes as $DeviceType=>$DeviceName) {
$SourceData = $SourceConf[$RoomName][$SourceIdx][$DeviceType];
if (array_key_exists(c_Property_CommSrc, $SourceData)) {
Entertainment_SendData($DeviceName, c_Control_Source, $SourceData[c_Property_CommSrc], c_Property_CommSrc);
}
}
}
示例10: get_CirclyNameByID
function get_CirclyNameByID($CircleId) {
$CircleItem = IPS_GetName($CircleId);
$WaterConfig = get_WateringConfiguration();
return $WaterConfig[$CircleItem][c_Property_Name];
}
示例11: RefreshDisplay
/**
* @public
*
* Refresh der Anzeige
*
*/
public function RefreshDisplay() {
IPSLogger_Trc(__file__, 'Refresh EDIP Display '.IPS_GetName($this->instanceId));
$this->AddObjects();
$this->OrderObjects();
$this->StoreObjectData();
$this->messageArray = array();
$this->AddMessageHeader();
$this->AddMessageCategories();
$this->AddMessageVariables();
$this->AddMessageValueEdit();
$this->sendArray($this->messageArray);
}
示例12: IPSWatering_AfterActivateWatering
function IPSWatering_AfterActivateWatering($CycleId ,$Value, $Mode) {
$CircleName = IPS_GetName($CycleId);
}
示例13: deviceInstanceExists
private function deviceInstanceExists($name)
{
//if ($isUpdate)
//{
$children = IPS_GetChildrenIDs($this->InstanceID);
foreach ($children as $child) {
if (IPS_InstanceExists($child)) {
$childInstance = @IPS_GetInstance($child);
$childInstanceID = $childInstance['InstanceID'];
$childInstanceName = @IPS_GetName($childInstanceID);
// Check if it is a Dummy Module and if it has a known device name
if ($childInstanceName == $name and $childInstance['ModuleInfo']['ModuleID'] == "{485D0419-BE97-4548-AA9C-C083EB82E61E}") {
return true;
}
}
}
return false;
//} else {
// return false;
//}
}
示例14: ApplyData
public function ApplyData($data) {
$data = (array)$data;
$state = (array)$data['state'];
/*
* Properties
*/
$dirty = false;
$modelid = utf8_decode((string)$data['modelid']);
$type = utf8_decode((string)$data['type']);
$name = utf8_decode((string)$data['name']);
if (IPS_GetProperty($this->InstanceID, 'ModelId') != $modelid) {
IPS_SetProperty($this->InstanceID, 'ModelId', $modelid);
$dirty = true;
}
if (IPS_GetProperty($this->InstanceID, 'Type') != $type) {
IPS_SetProperty($this->InstanceID, 'Type', $type);
$dirty = true;
}
if (IPS_GetName($this->InstanceID) != $name) {
IPS_SetName($this->InstanceID, $name);
$dirty = true;
}
// Setze den Modus
if (isset($state['ct']) && isset($state['hue'])) {
// HUE+CT Lamp
$lightFeature = 0;
} elseif(isset($state['hue'])) {
// HUE Lamp
$lightFeature = 1;
} elseif(isset($state['ct'])) {
// CT Lamp
$lightFeature = 2;
} else {
// Lux Lamp
$lightFeature = 3;
}
if (IPS_GetProperty($this->InstanceID, 'LightFeatures') != $lightFeature) {
IPS_SetProperty($this->InstanceID, 'LightFeatures', $lightFeature);
$dirty = true;
}
if ($dirty) IPS_ApplyChanges($this->InstanceID);
/*
* Variables
*/
$stateId = $this->RegisterVariableBoolean("STATE", "Zustand", "~Switch");
$this->EnableAction("STATE");
IPS_SetPosition($stateId, 1);
$cmId = $this->RegisterVariableInteger("COLOR_MODE", "Modus", "ColorModeSelect.Hue");
$this->EnableAction("COLOR_MODE");
IPS_SetPosition($cmId, 2);
IPS_SetIcon($cmId, 'ArrowRight');
$briId = $this->RegisterVariableInteger("BRIGHTNESS", "Helligkeit", "~Intensity.100");
$this->EnableAction("BRIGHTNESS");
IPS_SetIcon($briId, 'Sun');
IPS_SetPosition($briId, 5);
if ($lightFeature == 0 || $lightFeature == 1) {
$hueId = $this->RegisterVariableInteger("HUE", "Hue");
IPS_SetHidden($hueId, true);
} else {
$delete = @IPS_GetObjectIDByIdent("HUE", $this->InstanceID);
if ($delete !== false) IPS_DeleteVariable($delete);
}
if ($lightFeature == 0) {
IPS_SetVariableCustomProfile($cmId, 'ColorModeSelect.Hue');
IPS_SetHidden($cmId, false);
} else {
IPS_SetHidden($cmId, true);
}
if ($lightFeature == 0 || $lightFeature == 2) {
$ctId = $this->RegisterVariableInteger("COLOR_TEMPERATURE", "Farbtemperatur", "~Intensity.100");
$this->EnableAction("COLOR_TEMPERATURE");
IPS_SetIcon($ctId, 'Bulb');
IPS_SetPosition($ctId, 4);
} else {
$delete = @IPS_GetObjectIDByIdent("COLOR_TEMPERATURE", $this->InstanceID);
if ($delete !== false) IPS_DeleteVariable($delete);
}
if ($lightFeature == 0 || $lightFeature == 1) {
$colorId = $this->RegisterVariableInteger("COLOR", "Farbe", "~HexColor");
$this->EnableAction("COLOR");
IPS_SetPosition($colorId, 3);
IPS_SetIcon($colorId, 'Bulb');
$satId = $this->RegisterVariableInteger("SATURATION", utf8_decode("Sättigung"), "~Intensity.100");
$this->EnableAction("SATURATION");
IPS_SetIcon($satId, 'Intensity');
//.........这里部分代码省略.........
示例15: HandleEvent
/**
* @public
*
* Function um Events zu behandeln, diese Funktion wird vom IPSMessageHandler aufgerufen, um ein aufgetretenes Event
* an das entsprechende Module zu leiten.
*
* @param integer $variable ID der auslösenden Variable
* @param string $value Wert der Variable
* @param IPSModuleShutter $module Module Object an das das aufgetretene Event weitergeleitet werden soll
*/
public function HandleEvent($variable, $value, IPSModuleShutter $module){
$name = IPS_GetName($variable);
throw new IPSComponentException('Event Handling NOT supported for Variable '.$variable.'('.$name.')');
}