本文整理汇总了PHP中Av_sensor::get_nfsen_channel_name方法的典型用法代码示例。如果您正苦于以下问题:PHP Av_sensor::get_nfsen_channel_name方法的具体用法?PHP Av_sensor::get_nfsen_channel_name怎么用?PHP Av_sensor::get_nfsen_channel_name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Av_sensor
的用法示例。
在下文中一共展示了Av_sensor::get_nfsen_channel_name方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: set_include_path
*
* Otherwise you can read it here: http://www.gnu.org/licenses/gpl-2.0.txt
*
*/
/*******************************************************************************/
/* */
/* This script is called from nfsen packages to translate sensors uuid to name */
/* */
/*******************************************************************************/
set_include_path('/usr/share/ossim/include');
error_reporting(0);
ini_set("display_errors", "0");
//This is used to avoid an error when there is not connection to mysql
if (!isset($GLOBALS["CONF"])) {
$GLOBALS["CONF"] = array();
require_once 'ossim_db.inc';
$db = new ossim_db();
unset($GLOBALS["CONF"]);
} else {
require_once 'ossim_db.inc';
$db = new ossim_db();
}
$uuid = $argv[1];
if (@$db->test_connect()) {
$conn = $db->connect();
$name = Av_sensor::get_nfsen_channel_name($conn, $uuid);
$db->close();
} else {
$name = empty($uuid) ? 'Unknown' : $uuid;
}
echo $name;
示例2: DisplayDetails
function DisplayDetails()
{
global $self;
global $DisplayOrder;
global $TypeOrder;
global $WinSizeLabels;
global $RRDoffset;
global $GMToffset;
global $TZname;
require_once 'av_init.php';
$db_aux = new ossim_db();
$conn_aux = $db_aux->connect();
?>
<script language="Javascript" src="js/detail.js" type="text/javascript">
</script>
<?php
$tright = UNIX2DISPLAY($_SESSION['tright']);
$tleft = UNIX2DISPLAY($_SESSION['tleft']);
$profile = $_SESSION['profile'];
$profilegroup = $_SESSION['profilegroup'];
$detail_opts = $_SESSION['detail_opts'];
$is_shadow = ($_SESSION['profileinfo']['type'] & 4) > 0;
print "<h3>Profile: " . Util::htmlentities($profile) . "</h3>\n";
if ($detail_opts['channellist'] != '') {
$_tmp = explode('!', $detail_opts['channellist']);
} else {
$_tmp = array();
}
if (count($_tmp) == 0) {
$graph_channels = '@EMPTY';
} else {
$graph_channels = '';
foreach ($_tmp as $_t) {
$graph_channels .= $_t . ';' . Av_sensor::get_nfsen_channel_name($conn_aux, $_t) . ':';
}
$graph_channels = preg_replace('/:$/', '', $graph_channels);
}
?>
<table style='font-size:14px;font-weight:bold;width:100%' class='transparent'>
<tr>
<?php
for ($i = 1; $i < count($DisplayOrder); $i++) {
$label = $DisplayOrder[$i];
if ($label == $detail_opts['proto']) {
$label = 'any';
}
print "<td>";
print $label;
print "</td>\n";
}
print "<td style='font-size:14px;font-weight:bold'>" . gettext("Profile info:") . "</td>\n";
// Empty right element
print "</tr><tr>\n";
for ($i = 1; $i < count($DisplayOrder); $i++) {
$label = $DisplayOrder[$i];
if ($label == $detail_opts['proto']) {
$label = 'any';
}
print "<td>\n";
if ($graph_channels != '@EMPTY') {
$arg = implode(" ", array($graph_channels, $label, $detail_opts['type'], $_SESSION['profileinfo']['tstart'], $_SESSION['tstart'], $_SESSION['tend'], $_SESSION['tleft'], $_SESSION['tright'], 288, 100, 1, $detail_opts['logscale'], $detail_opts['linegraph']));
$arg = urlencode($arg);
} else {
$arg = '';
}
print "<a href='{$self}&proto={$label}'> " . "<img src=rrdgraph.php?cmd=get-detailsgraph&profile=" . Util::htmlentities($_SESSION['profileswitch']) . "&arg={$arg} border='0' width='165' height='81' alt='{$label}'></a>\n";
print "</td>\n";
}
print "<td style='vertical-align: bottom;'>\n";
$str = strftime("%b %d %Y - %H:%M", $_SESSION['profileinfo']['tstart']);
$expire = $_SESSION['profileinfo']['expire'];
if ($expire == 0) {
$expire = 'never';
} else {
$d = (int) ($expire / 24);
$h = $expire % 24;
$d_ext = $d == 1 ? '' : 's';
$h_ext = $h == 1 ? '' : 's';
if ($d) {
$expire = "{$d} day{$d_ext} {$h} hour{$h_ext}";
} else {
$expire = "{$h} hour{$h_ext}";
}
}
$maxsize = ScaleBytes($_SESSION['profileinfo']['maxsize'], 1, 1024.0);
if ($maxsize == 0) {
$maxsize = 'unlimited';
}
print "<table style='font-size:12px;font-weight:bold;border:none;width:100%'>\n";
switch ($_SESSION['profileinfo']['type'] & 3) {
case 0:
$type = 'live';
break;
case 1:
$type = 'history';
break;
case 2:
$type = 'continuous';
break;
default:
//.........这里部分代码省略.........
示例3: die
$type = 'other';
break;
default:
die(_('Wrong type'));
}
$limit = $limit < 1 || $limit > 7 ? 1 : $limit;
$end = time();
$begind = $end - $limit * 86400;
//86400 belongs to 24 hours in seconds --> 24*60*60
$nfsen_sensors = get_nfsen_sensors();
$sensor_list = '';
foreach ($nfsen_sensors as $flow_id => $sdata) {
if (!Av_sensor::is_channel_allowed($conn, $flow_id)) {
continue;
}
$sname = Av_sensor::get_nfsen_channel_name($conn, $flow_id);
$sensor_list .= "{$flow_id};{$sname}:";
}
$sensor_list = preg_replace('/:$/i', '', $sensor_list);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<?php
//If the refresh is enabled, we set it up in the meta.
if (isset($winfo['refresh']) && $winfo['refresh'] != 0) {
echo '<meta http-equiv="refresh" content="' . $winfo['refresh'] . '">';
}
?>
<title><?php
示例4: ReadProfile
function ReadProfile($profileswitch)
{
$opts['profile'] = $profileswitch;
$profileinfo = nfsend_query("get-profile", $opts, 0);
if (!is_array($profileinfo)) {
return false;
}
if (!array_key_exists('description', $profileinfo)) {
$profileinfo['description'] = array();
}
$channels = array();
// in case it's a new profile with no channels associated yet
if (!array_key_exists('channel', $profileinfo)) {
$profileinfo['channel'] = $channels;
}
$profileinfo['all_channels'] = array();
require_once 'ossim_db.inc';
$db = new ossim_db();
$conn = $db->connect();
// Decode channel information
foreach ($profileinfo['channel'] as $channel) {
list($id, $sign, $colour, $order, $sourcelist) = explode(":", $channel);
$profileinfo['all_channels'][$id] = $id;
if (!Av_sensor::is_channel_allowed($conn, $id)) {
continue;
}
$_tmp = array();
$_tmp['id'] = $id;
$_tmp['name'] = Av_sensor::get_nfsen_channel_name($conn, $id);
$_tmp['sign'] = $sign;
$_tmp['colour'] = $colour;
$_tmp['order'] = $order;
$_tmp['sourcelist'] = $sourcelist;
$channels[$id] = $_tmp;
}
$db->close();
$profileinfo['channel'] = $channels;
return $profileinfo;
}