當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。