当前位置: 首页>>代码示例>>PHP>>正文


PHP Device::GetDevicePicture方法代码示例

本文整理汇总了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;
开发者ID:mnibbelink,项目名称:openDCIM,代码行数:31,代码来源:index.php

示例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>
开发者ID:paragm,项目名称:openDCIM,代码行数:30,代码来源:workorder.php


注:本文中的Device::GetDevicePicture方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。