本文整理汇总了PHP中Device::GetDevicePicture方法的典型用法代码示例。如果您正苦于以下问题:PHP Device::GetDevicePicture方法的具体用法?PHP Device::GetDevicePicture怎么用?PHP Device::GetDevicePicture使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Device
的用法示例。
在下文中一共展示了Device::GetDevicePicture方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: function
//
$app->get('/device/:deviceid/getpicture', function ($deviceid) {
$dev = new Device($deviceid);
$response['error'] = true;
$response['errorcode'] = 404;
$response['message'] = __("Unknown error");
if (!$dev->GetDevice()) {
$response['message'] = __("Device not found");
} else {
// we filter out most of the details if you don't have rights in the
// GetDevicePicture function so this might lead to some probing but
// should be minimal
$response['error'] = false;
$response['errorcode'] = 200;
$response['message'] = "";
$response['picture'] = $dev->GetDevicePicture(isset($_GET['rear']));
}
echoResponse(200, $response);
});
$app->get('/device/:deviceid/getsensorreadings', function ($deviceid) {
$dev = new Device();
$dev->DeviceID = intval($deviceid);
if (!$dev->GetDevice(false)) {
$response['error'] = true;
$response['errorcode'] = 404;
$response['message'] = __("Device not found");
} else {
$reading = $dev->GetSensorReading(false);
if (!$reading) {
$response['error'] = true;
$response['errorcode'] = 404;
示例2: __
// is no chance for phantom data
$cab = new Cabinet();
if ($dev->ParentDevice > 0) {
$pdev = new Device();
$pdev->DeviceID = $dev->GetRootDeviceID();
$pdev->GetDevice();
$cab->CabinetID = $pdev->Cabinet;
} else {
$cab->CabinetID = $dev->Cabinet;
}
$cab->GetCabinet();
$devTmpl = new DeviceTemplate();
$devTmpl->TemplateID = $dev->TemplateID;
$devTmpl->GetTemplateByID();
$position = $dev->Height == 1 ? $dev->Position : $dev->Position . "-" . ($dev->Position + $dev->Height - 1);
print "<div><div>{$cab->Location}</div><div>{$position}</div><div>{$dev->Label}</div><div>" . $dev->GetDevicePicture('', '', 'nolinks') . "</div></div>\n";
}
print '</div>
<a href="export_port_connections.php?deviceid=wo"><button type="button">' . __("Export Connections") . '</button></a>';
?>
<button type="button" id="clear"><?php
print __("Clear");
?>
</button>
</div></div>
</div><!-- END div.main -->
</div><!-- END div.page -->
</body>
</html>