• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP getZmuCommand函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中getZmuCommand函数的典型用法代码示例。如果您正苦于以下问题:PHP getZmuCommand函数的具体用法?PHP getZmuCommand怎么用?PHP getZmuCommand使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了getZmuCommand函数的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: array

// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
//
if (!canEdit('Monitors')) {
    $view = "error";
    return;
}
$cameras = array();
$cameras[0] = translate('ChooseDetectedCamera');
if (ZM_HAS_V4L2) {
    // Probe Local Cameras
    //
    $command = getZmuCommand(" --query --device");
    if (!empty($_REQUEST['device'])) {
        $command .= "=" . escapeshellarg($_REQUEST['device']);
    }
    $result = exec(escapeshellcmd($command), $output, $status);
    if ($status) {
        Fatal("Unable to probe local cameras, status is '{$status}'");
    }
    $monitors = array();
    foreach (dbFetchAll("select Id, Name, Device,Channel from Monitors where Type = 'Local' order by Device, Channel") as $monitor) {
        $monitors[$monitor['Device'] . ':' . $monitor['Channel']] = $monitor;
    }
    $devices = array();
    $preferredStandards = array('PAL', 'NTSC');
    $preferredFormats = array('BGR3', 'RGB3', 'YUYV', 'UYVY', 'JPEG', 'MJPG', '422P', 'YU12', 'GREY');
    foreach ($output as $line) {
开发者ID:rodoviario,项目名称:ZoneMinder,代码行数:31,代码来源:monitorprobe.php


示例2: validInt

 }
 // Monitor control actions, require a monitor id and control view permissions for that monitor
 if (!empty($_REQUEST['mid']) && canView('Control', $_REQUEST['mid'])) {
     require_once 'control_functions.php';
     $mid = validInt($_REQUEST['mid']);
     if ($action == "control") {
         $monitor = dbFetchOne("select C.*,M.* from Monitors as M inner join Controls as C on (M.ControlId = C.Id) where M.Id = ?", NULL, array($mid));
         $ctrlCommand = buildControlCommand($monitor);
         sendControlCommand($monitor['Id'], $ctrlCommand);
     } elseif ($action == "settings") {
         $args = " -m " . escapeshellarg($mid);
         $args .= " -B" . escapeshellarg($_REQUEST['newBrightness']);
         $args .= " -C" . escapeshellarg($_REQUEST['newContrast']);
         $args .= " -H" . escapeshellarg($_REQUEST['newHue']);
         $args .= " -O" . escapeshellarg($_REQUEST['newColour']);
         $zmuCommand = getZmuCommand($args);
         $zmuOutput = exec($zmuCommand);
         list($brightness, $contrast, $hue, $colour) = explode(' ', $zmuOutput);
         dbQuery("update Monitors set Brightness = ?, Contrast = ?, Hue = ?, Colour = ? where Id = ?", array($brightness, $contrast, $hue, $colour, $mid));
     }
 }
 // Control capability actions, require control edit permissions
 if (canEdit('Control')) {
     if ($action == "controlcap") {
         if (!empty($_REQUEST['cid'])) {
             $control = dbFetchOne("select * from Controls where Id = ?", NULL, array($_REQUEST['cid']));
         } else {
             $control = array();
         }
         // Define a field type for anything that's not simple text equivalent
         $types = array();
开发者ID:ralfoide,项目名称:ZoneMinder,代码行数:31,代码来源:actions.php


示例3: collectData

function collectData()
{
    global $statusData;
    if (isset($_REQUEST['MainFrameID']) && $_REQUEST['MainFrameID'] == "1") {
        $statusData["event"]["elements"]["MainFrameID"] = array("sql" => "(select FrameID from Frames where EventId=Events.id order by Score desc,FrameId limit 1)");
        $statusData["events"]["elements"]["MainFrameID"] = array("sql" => "(select FrameID from Frames where EventId=Events.id order by Score desc,FrameId limit 1)");
    }
    $entitySpec =& $statusData[strtolower(validJsStr($_REQUEST['entity']))];
    #print_r( $entitySpec );
    if (!canView($entitySpec['permission'])) {
        ajaxError('Unrecognised action or insufficient permissions');
    }
    if (!empty($entitySpec['func'])) {
        $data = eval("return( " . $entitySpec['func'] . " );");
    } else {
        $data = array();
        $postFuncs = array();
        $fieldSql = array();
        $joinSql = array();
        $groupSql = array();
        $elements =& $entitySpec['elements'];
        $lc_elements = array_change_key_case($elements);
        $id = false;
        if (isset($_REQUEST['id'])) {
            if (!is_array($_REQUEST['id'])) {
                $id = array(validJsStr($_REQUEST['id']));
            } else {
                $id = array_values($_REQUEST['id']);
            }
        }
        if (!isset($_REQUEST['element'])) {
            $_REQUEST['element'] = array_keys($elements);
        } else {
            if (!is_array($_REQUEST['element'])) {
                $_REQUEST['element'] = array(validJsStr($_REQUEST['element']));
            }
        }
        if (isset($entitySpec['selector'])) {
            if (!is_array($entitySpec['selector'])) {
                $entitySpec['selector'] = array($entitySpec['selector']);
            }
            foreach ($entitySpec['selector'] as $selector) {
                if (is_array($selector) && isset($selector['table']) && isset($selector['join'])) {
                    $joinSql[] = "left join " . $selector['table'] . " on " . $selector['join'];
                }
            }
        }
        foreach ($_REQUEST['element'] as $element) {
            if (!($elementData = $lc_elements[strtolower($element)])) {
                ajaxError("Bad " . validJsStr($_REQUEST['entity']) . " element " . $element);
            }
            if (isset($elementData['func'])) {
                $data[$element] = eval("return( " . $elementData['func'] . " );");
            } else {
                if (isset($elementData['postFunc'])) {
                    $postFuncs[$element] = $elementData['postFunc'];
                } else {
                    if (isset($elementData['zmu'])) {
                        $data[$element] = exec(escapeshellcmd(getZmuCommand(" " . $elementData['zmu'])));
                    } else {
                        if (isset($elementData['sql'])) {
                            $fieldSql[] = $elementData['sql'] . " as " . $element;
                        } else {
                            $fieldSql[] = $element;
                        }
                        if (isset($elementData['table']) && isset($elementData['join'])) {
                            $joinSql[] = "left join " . $elementData['table'] . " on " . $elementData['join'];
                        }
                        if (isset($elementData['group'])) {
                            $groupSql[] = $elementData['group'];
                        }
                    }
                }
            }
        }
        if (count($fieldSql)) {
            $sql = "select " . join(", ", $fieldSql) . " from " . $entitySpec['table'];
            if ($joinSql) {
                $sql .= " " . join(" ", array_unique($joinSql));
            }
            if ($id && !empty($entitySpec['selector'])) {
                $index = 0;
                $where = array();
                $values = array();
                foreach ($entitySpec['selector'] as $selector) {
                    if (is_array($selector)) {
                        $where[] = $selector['selector'] . ' = ?';
                        $values[] = validInt($id[$index]);
                    } else {
                        $where[] = $selector . ' = ?';
                        $values[] = validInt($id[$index]);
                    }
                    $index++;
                }
                $sql .= " where " . join(" and ", $where);
            }
            if ($groupSql) {
                $sql .= " group by " . join(",", array_unique($groupSql));
            }
            if (!empty($_REQUEST['sort'])) {
//.........这里部分代码省略.........
开发者ID:bill-mcgonigle,项目名称:ZoneMinder,代码行数:101,代码来源:status.php


示例4: on

// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
//
if (!canView('Stream')) {
    $_REQUEST['view'] = "error";
    return;
}
$sql = 'select C.*, M.* from Monitors as M left join Controls as C on (M.ControlId = C.Id ) where M.Id = ?';
$monitor = dbFetchOne($sql, NULL, array($_REQUEST['mid']));
$showPtzControls = ZM_OPT_CONTROL && $monitor['Controllable'] && canView('Control');
$zmuCommand = getZmuCommand(" -m " . $_REQUEST['mid'] . " -s -f");
$zmuOutput = exec(escapeshellcmd($zmuCommand));
list($status, $fps) = explode(' ', $zmuOutput);
$statusString = translate('Unknown');
$fpsString = "--.--";
$class = "infoText";
if ($status <= STATE_PREALARM) {
    $statusString = translate('Idle');
} elseif ($status == STATE_ALARM) {
    $statusString = translate('Alarm');
    $class = "errorText";
} elseif ($status == STATE_ALERT) {
    $statusString = translate('Alert');
    $class = "warnText";
} elseif ($status == STATE_TAPE) {
    $statusString = translate('Record');
开发者ID:rodoviario,项目名称:ZoneMinder,代码行数:31,代码来源:watch.php


示例5: getZmuCommand

// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
//
if (!canView('System')) {
    $view = "error";
    return;
}
$zmuCommand = getZmuCommand(" --list");
$result = exec(escapeshellcmd($zmuCommand), $output);
$refresh = ZM_WEB_REFRESH_STATUS;
$url = '?view=' . $view;
noCacheHeaders();
xhtmlHeaders(__FILE__, $SLANG['Status']);
?>
<body>
  <div id="page">
    <div id="header">
      <h2><?php 
echo $SLANG['Status'];
?>
</h2>
    </div>
    <div id="content">
开发者ID:mondychan,项目名称:modern,代码行数:31,代码来源:status.php


示例6: array

        $zone = array('Name' => translate('New'), 'Id' => 0, 'MonitorId' => $monitor['Id'], 'NumCoords' => 4, 'Coords' => sprintf("%d,%d %d,%d, %d,%d %d,%d", $minX, $minY, $maxX, $minY, $maxX, $maxY, $minX, $maxY), 'Area' => $monitor['Width'] * $monitor['Height'], 'AlarmRGB' => 0xff0000, 'CheckMethod' => 'Blobs', 'MinPixelThreshold' => '', 'MaxPixelThreshold' => '', 'MinAlarmPixels' => '', 'MaxAlarmPixels' => '', 'FilterX' => '', 'FilterY' => '', 'MinFilterPixels' => '', 'MaxFilterPixels' => '', 'MinBlobPixels' => '', 'MaxBlobPixels' => '', 'MinBlobs' => '', 'MaxBlobs' => '', 'OverloadFrames' => '', 'ExtendAlarmFrames' => '');
    }
    $zone['Points'] = coordsToPoints($zone['Coords']);
    $newZone = $zone;
}
//if ( !$points )
//{
//$points = $zone['Points'];
//}
ksort($newZone['Points'], SORT_NUMERIC);
$newZone['Coords'] = pointsToCoords($newZone['Points']);
$newZone['Area'] = getPolyArea($newZone['Points']);
$selfIntersecting = isSelfIntersecting($newZone['Points']);
$wd = getcwd();
chdir(ZM_DIR_IMAGES);
$command = getZmuCommand(" -m " . $mid . " -z");
$command .= '"' . $zid . ' ' . $hicolor . ' ' . $newZone['Coords'] . '"';
$status = exec(escapeshellcmd($command));
chdir($wd);
$zoneImage = ZM_DIR_IMAGES . '/Zones' . $monitor['Id'] . '.jpg?' . time();
$focusWindow = true;
xhtmlHeaders(__FILE__, translate('Zone'));
?>
<body>
  <div id="page">
    <div id="header">
      <h2><?php 
echo translate('Monitor');
?>
 <?php 
echo $monitor['Name'];
开发者ID:rodoviario,项目名称:ZoneMinder,代码行数:31,代码来源:zone.php


示例7: validInt

// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
//
if (!canView('Monitors')) {
    $view = "error";
    return;
}
$mid = validInt($_REQUEST['mid']);
$wd = getcwd();
chdir(ZM_DIR_IMAGES);
$status = exec(escapeshellcmd(getZmuCommand(" -m " . $mid . " -z")));
chdir($wd);
$monitor = dbFetchMonitor($mid);
$sql = "select * from Zones where MonitorId = '" . $mid . "' order by Area desc";
$zones = array();
foreach (dbFetchAll($sql) as $row) {
    if ($row['Points'] = coordsToPoints($row['Coords'])) {
        $row['AreaCoords'] = preg_replace('/\\s+/', ',', $row['Coords']);
        $zones[] = $row;
    }
}
$image = 'Zones' . $monitor['Id'] . '.jpg';
xhtmlHeaders(__FILE__, $SLANG['Zones']);
?>
<body>
  <div id="page">
开发者ID:mondychan,项目名称:modern,代码行数:31,代码来源:zones.php


示例8: ajaxError

<?php

if (empty($_REQUEST['mid'])) {
    ajaxError('No monitor id supplied');
} elseif (!isset($_REQUEST['zid'])) {
    ajaxError('No zone id(s) supplied');
}
if (canView('Monitors')) {
    switch ($_REQUEST['action']) {
        case "zoneImage":
            $wd = getcwd();
            chdir(ZM_DIR_IMAGES);
            $hiColor = '0x00ff00';
            $command = getZmuCommand(" -m " . $_REQUEST['mid'] . " -z");
            if (!isset($_REQUEST['zid'])) {
                $_REQUEST['zid'] = 0;
            }
            $command .= "'" . $_REQUEST['zid'] . ' ' . $hiColor . ' ' . $_REQUEST['coords'] . "'";
            $status = exec(escapeshellcmd($command));
            chdir($wd);
            $monitor = dbFetchOne('SELECT * FROM Monitors WHERE Id = ?', NULL, array($_REQUEST['mid']));
            $points = coordsToPoints($_REQUEST['coords']);
            ajaxResponse(array('zoneImage' => ZM_DIR_IMAGES . '/Zones' . $monitor['Id'] . '.jpg?' . time(), 'selfIntersecting' => isSelfIntersecting($points), 'area' => getPolyArea($points)));
            break;
    }
}
ajaxError('Unrecognised action or insufficient permissions');
开发者ID:schrorg,项目名称:ZoneMinder,代码行数:27,代码来源:zone.php


示例9: collectData

function collectData()
{
    global $statusData;
    $entitySpec =& $statusData[strtolower(validJsStr($_REQUEST['entity']))];
    #print_r( $entitySpec );
    if (!canView($entitySpec['permission'])) {
        ajaxError('Unrecognised action or insufficient permissions');
    }
    if (!empty($entitySpec['func'])) {
        $data = eval("return( " . $entitySpec['func'] . " );");
    } else {
        $data = array();
        $postFuncs = array();
        $fieldSql = array();
        $joinSql = array();
        $groupSql = array();
        $elements =& $entitySpec['elements'];
        $lc_elements = array_change_key_case($elements);
        $id = false;
        if (isset($_REQUEST['id'])) {
            if (!is_array($_REQUEST['id'])) {
                $id = array(validJsStr($_REQUEST['id']));
            } else {
                $id = array_values($_REQUEST['id']);
            }
        }
        if (!isset($_REQUEST['element'])) {
            $_REQUEST['element'] = array_keys($elements);
        } else {
            if (!is_array($_REQUEST['element'])) {
                $_REQUEST['element'] = array(validJsStr($_REQUEST['element']));
            }
        }
        if (isset($entitySpec['selector'])) {
            if (!is_array($entitySpec['selector'])) {
                $entitySpec['selector'] = array($entitySpec['selector']);
            }
            foreach ($entitySpec['selector'] as $selector) {
                if (is_array($selector) && isset($selector['table']) && isset($selector['join'])) {
                    $joinSql[] = "left join " . $selector['table'] . " on " . $selector['join'];
                }
            }
        }
        foreach ($_REQUEST['element'] as $element) {
            if (!($elementData = $lc_elements[strtolower($element)])) {
                ajaxError("Bad " . validJsStr($_REQUEST['entity']) . " element " . $element);
            }
            if (isset($elementData['func'])) {
                $data[$element] = eval("return( " . $elementData['func'] . " );");
            } else {
                if (isset($elementData['postFunc'])) {
                    $postFuncs[$element] = $elementData['postFunc'];
                } else {
                    if (isset($elementData['zmu'])) {
                        $data[$element] = exec(escapeshellcmd(getZmuCommand(" " . $elementData['zmu'])));
                    } else {
                        if (isset($elementData['sql'])) {
                            $fieldSql[] = $elementData['sql'] . " as " . $element;
                        } else {
                            $fieldSql[] = $element;
                        }
                        if (isset($elementData['table']) && isset($elementData['join'])) {
                            $joinSql[] = "left join " . $elementData['table'] . " on " . $elementData['join'];
                        }
                        if (isset($elementData['group'])) {
                            $groupSql[] = $elementData['group'];
                        }
                    }
                }
            }
        }
        if (count($fieldSql)) {
            $sql = "select " . join(", ", $fieldSql) . " from " . $entitySpec['table'];
            if ($joinSql) {
                $sql .= " " . join(" ", array_unique($joinSql));
            }
            if ($id && !empty($entitySpec['selector'])) {
                $index = 0;
                $where = array();
                foreach ($entitySpec['selector'] as $selector) {
                    if (is_array($selector)) {
                        $where[] = $selector['selector'] . " = " . dbEscape($id[$index]);
                    } else {
                        $where[] = $selector . " = " . dbEscape($id[$index]);
                    }
                    $index++;
                }
                $sql .= " where " . join(" and ", $where);
            }
            if ($groupSql) {
                $sql .= " group by " . join(",", array_unique($groupSql));
            }
            if (!empty($_REQUEST['sort'])) {
                $sql .= " order by " . dbEscape($_REQUEST['sort']);
            }
            if (!empty($entitySpec['limit'])) {
                $limit = $entitySpec['limit'];
            } elseif (!empty($_REQUEST['count'])) {
                $limit = dbEscape($_REQUEST['count']);
            }
//.........这里部分代码省略.........
开发者ID:ardiqghenatya,项目名称:koptel2,代码行数:101,代码来源:status.php


示例10: dbFetchMonitor

//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
//
if (!canView('Control')) {
    $view = "error";
    return;
}
$monitor = dbFetchMonitor($_REQUEST['mid']);
$zmuCommand = getZmuCommand(" -m " . escapeshellarg($_REQUEST['mid']) . " -B -C -H -O");
$zmuOutput = exec($zmuCommand);
list($brightness, $contrast, $hue, $colour) = explode(' ', $zmuOutput);
$monitor['Brightness'] = $brightness;
$monitor['Contrast'] = $contrast;
$monitor['Hue'] = $hue;
$monitor['Colour'] = $colour;
$focusWindow = true;
xhtmlHeaders(__FILE__, validHtmlStr($monitor['Name']) . " - " . $SLANG['Settings']);
?>
<body>
  <div id="page">
    <div id="header">
      <h2><?php 
echo validHtmlStr($monitor['Name']);
?>
开发者ID:moeiscool,项目名称:ZoneMinder-video,代码行数:31,代码来源:settings.php


示例11: jsonEncode

                         $options[$matches[1]] = $matches[2] ? $matches[2] : 1;
                     }
                 }
                 $optionString = jsonEncode($options);
                 if (!socket_write($socket, $optionString)) {
                     Fatal("Can't write to control socket: " . socket_strerror(socket_last_error($socket)));
                 }
                 socket_close($socket);
             } else {
                 $ctrlCommand .= " --id=" . $monitor['Id'];
                 // Can't connect so use script
                 $ctrlOutput = exec(escapeshellcmd($ctrlCommand));
             }
         }
     } elseif ($action == "settings") {
         $zmuCommand = getZmuCommand(" -m " . $mid . " -B" . $_REQUEST['newBrightness'] . " -C" . $_REQUEST['newContrast'] . " -H" . $_REQUEST['newHue'] . " -O" . $_REQUEST['newColour']);
         $zmuOutput = exec(escapeshellcmd($zmuCommand));
         list($brightness, $contrast, $hue, $colour) = explode(' ', $zmuOutput);
         dbQuery("update Monitors set Brightness = '" . $brightness . "', Contrast = '" . $contrast . "', Hue = '" . $hue . "', Colour = '" . $colour . "' where Id = '" . $mid . "'");
     }
 }
 // Control capability actions, require control edit permissions
 if (canEdit('Control')) {
     if ($action == "controlcap") {
         if (!empty($_REQUEST['cid'])) {
             $control = dbFetchOne("select * from Controls where Id = '" . dbEscape($_REQUEST['cid']) . "'");
         } else {
             $control = array();
         }
         // Define a field type for anything that's not simple text equivalent
         $types = array();
开发者ID:ardiqghenatya,项目名称:koptel2,代码行数:31,代码来源:actions.php


示例12: define

<?php

define("MSG_TIMEOUT", 2.0);
define("MSG_DATA_SIZE", 4 + 256);
if (canEdit('Monitors')) {
    $zmuCommand = getZmuCommand(" -m " . validInt($_REQUEST['id']));
    switch (validJsStr($_REQUEST['command'])) {
        case "disableAlarms":
            $zmuCommand .= " -n";
            break;
        case "enableAlarms":
            $zmuCommand .= " -c";
            break;
        case "forceAlarm":
            $zmuCommand .= " -a";
            break;
        case "cancelForcedAlarm":
            $zmuCommand .= " -c";
            break;
        default:
            ajaxError("Unexpected command '" . validJsStr($_REQUEST['command']) . "'");
    }
    ajaxResponse(exec(escapeshellcmd($zmuCommand)));
}
ajaxError('Unrecognised action or insufficient permissions');
开发者ID:moeiscool,项目名称:ZoneMinder-video,代码行数:25,代码来源:alarm.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP getZonesTypes函数代码示例发布时间:2022-05-15
下一篇:
PHP getYear函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap