2008-07-14 21:54:50 +08:00
|
|
|
<?php
|
|
|
|
//
|
|
|
|
// ZoneMinder web monitor view file, $Date$, $Revision$
|
2014-05-18 04:05:57 +08:00
|
|
|
// Copyright (C) 2001-2008 Philip Coombes
|
2008-07-14 21:54:50 +08:00
|
|
|
//
|
|
|
|
// This program is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of the GNU General Public License
|
|
|
|
// as published by the Free Software Foundation; either version 2
|
|
|
|
// 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( 'Monitors' ) )
|
|
|
|
{
|
2008-09-26 17:47:20 +08:00
|
|
|
$view = "error";
|
2008-07-14 21:54:50 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
$tabs = array();
|
|
|
|
$tabs["general"] = $SLANG['General'];
|
|
|
|
$tabs["source"] = $SLANG['Source'];
|
|
|
|
$tabs["timestamp"] = $SLANG['Timestamp'];
|
|
|
|
$tabs["buffers"] = $SLANG['Buffers'];
|
|
|
|
if ( ZM_OPT_CONTROL && canView( 'Control' ) )
|
|
|
|
$tabs["control"] = $SLANG['Control'];
|
|
|
|
if ( ZM_OPT_X10 )
|
|
|
|
$tabs["x10"] = $SLANG['X10'];
|
|
|
|
$tabs["misc"] = $SLANG['Misc'];
|
|
|
|
|
2008-09-26 17:47:20 +08:00
|
|
|
if ( isset($_REQUEST['tab']) )
|
|
|
|
$tab = validHtmlStr($_REQUEST['tab']);
|
|
|
|
else
|
|
|
|
$tab = "general";
|
2008-07-14 21:54:50 +08:00
|
|
|
|
|
|
|
if ( !empty($_REQUEST['mid']) )
|
|
|
|
{
|
|
|
|
$monitor = dbFetchMonitor( $_REQUEST['mid'] );
|
|
|
|
if ( ZM_OPT_X10 )
|
2013-12-18 01:53:15 +08:00
|
|
|
$x10Monitor = dbFetchOne( 'SELECT * FROM TriggersX10 WHERE MonitorId = ?', NULL, array( $_REQUEST['mid']) );
|
2008-07-14 21:54:50 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2009-03-31 18:55:19 +08:00
|
|
|
$nextId = getTableAutoInc( 'Monitors' );
|
2008-07-16 16:40:21 +08:00
|
|
|
$monitor = array(
|
|
|
|
'Id' => 0,
|
2009-03-31 18:55:19 +08:00
|
|
|
'Name' => $SLANG['Monitor'].'-'.$nextId,
|
2008-10-28 22:25:12 +08:00
|
|
|
'Function' => "Monitor",
|
2008-07-16 16:40:21 +08:00
|
|
|
'Enabled' => true,
|
|
|
|
'LinkedMonitors' => "",
|
2011-02-16 05:59:06 +08:00
|
|
|
'Type' => "",
|
2011-05-10 18:50:54 +08:00
|
|
|
'Device' => "/dev/video0",
|
2008-07-16 16:40:21 +08:00
|
|
|
'Channel' => "0",
|
2011-05-10 18:50:54 +08:00
|
|
|
'Format' => 0x000000ff,
|
2008-07-16 16:40:21 +08:00
|
|
|
'Protocol' => "",
|
|
|
|
'Method' => "",
|
|
|
|
'Host' => "",
|
|
|
|
'Path' => "",
|
2014-05-05 19:29:12 +08:00
|
|
|
'Options' => "",
|
2008-07-16 16:40:21 +08:00
|
|
|
'Port' => "80",
|
2013-11-04 22:52:21 +08:00
|
|
|
'User' => "",
|
|
|
|
'Pass' => "",
|
2011-07-16 19:27:53 +08:00
|
|
|
'Colours' => 3,
|
2011-07-02 20:32:16 +08:00
|
|
|
'Palette' => 0,
|
2011-05-10 18:50:54 +08:00
|
|
|
'Width' => "320",
|
|
|
|
'Height' => "240",
|
2008-07-16 16:40:21 +08:00
|
|
|
'Orientation' => "0",
|
2012-01-25 22:59:56 +08:00
|
|
|
'Deinterlacing' => 0,
|
2011-05-10 18:50:54 +08:00
|
|
|
'LabelFormat' => '%N - %d/%m/%y %H:%M:%S',
|
2008-07-16 16:40:21 +08:00
|
|
|
'LabelX' => 0,
|
|
|
|
'LabelY' => 0,
|
2011-05-22 17:25:33 +08:00
|
|
|
'ImageBufferCount' => 50,
|
2008-07-16 16:40:21 +08:00
|
|
|
'WarmupCount' => 25,
|
2011-05-10 18:50:54 +08:00
|
|
|
'PreEventCount' => 25,
|
|
|
|
'PostEventCount' => 25,
|
2008-07-16 16:40:21 +08:00
|
|
|
'StreamReplayBuffer' => 1000,
|
|
|
|
'AlarmFrameCount' => 1,
|
|
|
|
'Controllable' => 0,
|
|
|
|
'ControlId' => "",
|
|
|
|
'ControlType' => 0,
|
|
|
|
'ControlDevice' => "",
|
|
|
|
'ControlAddress' => "",
|
|
|
|
'AutoStopTimeout' => "",
|
|
|
|
'TrackMotion' => 0,
|
|
|
|
'TrackDelay' => "",
|
|
|
|
'ReturnLocation' => -1,
|
|
|
|
'ReturnDelay' => "",
|
|
|
|
'SectionLength' => 600,
|
|
|
|
'FrameSkip' => 0,
|
2014-04-10 19:56:14 +08:00
|
|
|
'MotionFrameSkip' => 0,
|
2008-07-16 16:40:21 +08:00
|
|
|
'EventPrefix' => 'Event-',
|
2011-05-22 17:25:33 +08:00
|
|
|
'MaxFPS' => "",
|
|
|
|
'AlarmMaxFPS' => "",
|
2008-07-16 16:40:21 +08:00
|
|
|
'FPSReportInterval' => 1000,
|
2013-11-04 18:10:53 +08:00
|
|
|
'RefBlendPerc' => 6,
|
2014-01-05 14:59:09 +08:00
|
|
|
'AlarmRefBlendPerc' => 6,
|
2008-07-16 16:40:21 +08:00
|
|
|
'DefaultView' => 'Events',
|
|
|
|
'DefaultRate' => '100',
|
|
|
|
'DefaultScale' => '100',
|
2011-05-22 17:25:33 +08:00
|
|
|
'SignalCheckColour' => '#0000c0',
|
2008-07-16 16:40:21 +08:00
|
|
|
'WebColour' => 'red',
|
|
|
|
'Triggers' => "",
|
|
|
|
);
|
2008-07-14 21:54:50 +08:00
|
|
|
}
|
2008-07-16 16:40:21 +08:00
|
|
|
|
|
|
|
if ( ZM_OPT_X10 && empty($x10Monitor) )
|
|
|
|
{
|
|
|
|
$x10Monitor = array(
|
|
|
|
'Activation' => '',
|
|
|
|
'AlarmInput' => '',
|
|
|
|
'AlarmOutput' => '',
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2009-03-31 21:00:49 +08:00
|
|
|
function fourcc( $a, $b, $c, $d )
|
|
|
|
{
|
|
|
|
return( ord($a) | (ord($b) << 8) | (ord($c) << 16) | (ord($d) << 24) );
|
|
|
|
}
|
|
|
|
|
2008-07-16 16:40:21 +08:00
|
|
|
if ( isset( $_REQUEST['newMonitor'] ) )
|
|
|
|
{
|
|
|
|
$newMonitor = $_REQUEST['newMonitor'];
|
|
|
|
if ( ZM_OPT_X10 )
|
|
|
|
$newX10Monitor = $_REQUEST['newX10Monitor'];
|
|
|
|
}
|
|
|
|
else
|
2008-07-14 21:54:50 +08:00
|
|
|
{
|
|
|
|
$newMonitor = $monitor;
|
2010-02-16 01:11:17 +08:00
|
|
|
$newMonitor['Triggers'] = explode( ',', isset($monitor['Triggers'])?$monitor['Triggers']:"" );
|
2008-07-16 16:40:21 +08:00
|
|
|
if ( ZM_OPT_X10 )
|
|
|
|
$newX10Monitor = $x10Monitor;
|
2008-07-14 21:54:50 +08:00
|
|
|
}
|
2008-07-16 16:40:21 +08:00
|
|
|
|
2008-07-22 05:28:50 +08:00
|
|
|
if ( $newMonitor['MaxFPS'] == '0.00' )
|
|
|
|
$newMonitor['MaxFPS'] = '';
|
|
|
|
if ( $newMonitor['AlarmMaxFPS'] == '0.00' )
|
|
|
|
$newMonitor['AlarmMaxFPS'] = '';
|
|
|
|
|
2013-12-18 01:53:15 +08:00
|
|
|
if ( !empty($_REQUEST['preset']) ) {
|
|
|
|
$preset = dbFetchOne( 'SELECT Type, Device, Channel, Format, Protocol, Method, Host, Port, Path, Width, Height, Palette, MaxFPS, Controllable, ControlId, ControlDevice, ControlAddress, DefaultRate, DefaultScale FROM MonitorPresets WHERE Id = ?', NULL, array($_REQUEST['preset']) );
|
2008-07-14 21:54:50 +08:00
|
|
|
foreach ( $preset as $name=>$value )
|
|
|
|
{
|
|
|
|
if ( isset($value) )
|
|
|
|
{
|
|
|
|
$newMonitor[$name] = $value;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2009-03-31 21:00:49 +08:00
|
|
|
if ( !empty($_REQUEST['probe']) )
|
|
|
|
{
|
2011-05-22 17:25:33 +08:00
|
|
|
$probe = unserialize(base64_decode($_REQUEST['probe']));
|
2009-03-31 21:00:49 +08:00
|
|
|
foreach ( $probe as $name=>$value )
|
|
|
|
{
|
|
|
|
if ( isset($value) )
|
|
|
|
{
|
|
|
|
$newMonitor[$name] = $value;
|
|
|
|
}
|
|
|
|
}
|
2011-02-16 05:59:06 +08:00
|
|
|
if ( ZM_HAS_V4L && $newMonitor['Type'] == 'Local' )
|
2009-03-31 21:00:49 +08:00
|
|
|
{
|
|
|
|
$newMonitor['Palette'] = fourCC( substr($newMonitor['Palette'],0,1), substr($newMonitor['Palette'],1,1), substr($newMonitor['Palette'],2,1), substr($newMonitor['Palette'],3,1) );
|
|
|
|
if ( $newMonitor['Format'] == 'PAL' )
|
|
|
|
$newMonitor['Format'] = 0x000000ff;
|
|
|
|
elseif ( $newMonitor['Format'] == 'NTSC' )
|
|
|
|
$newMonitor['Format'] = 0x0000b000;
|
|
|
|
}
|
|
|
|
}
|
2008-07-14 21:54:50 +08:00
|
|
|
|
2008-07-16 16:40:21 +08:00
|
|
|
$sourceTypes = array(
|
2008-07-21 23:19:25 +08:00
|
|
|
'Local' => $SLANG['Local'],
|
|
|
|
'Remote' => $SLANG['Remote'],
|
2009-01-20 23:01:32 +08:00
|
|
|
'File' => $SLANG['File'],
|
|
|
|
'Ffmpeg' => $SLANG['Ffmpeg'],
|
2013-12-13 01:46:24 +08:00
|
|
|
'Libvlc' => $SLANG['Libvlc'],
|
2014-04-23 17:12:41 +08:00
|
|
|
'cURL' => "cURL (HTTP(S) only)"
|
2008-07-16 16:40:21 +08:00
|
|
|
);
|
2011-02-16 05:59:06 +08:00
|
|
|
if ( !ZM_HAS_V4L )
|
|
|
|
unset($sourceTypes['Local']);
|
2008-07-16 16:40:21 +08:00
|
|
|
|
2008-12-06 02:45:01 +08:00
|
|
|
$localMethods = array(
|
|
|
|
'v4l2' => "Video For Linux version 2",
|
|
|
|
'v4l1' => "Video For Linux version 1",
|
|
|
|
);
|
2011-02-16 05:59:06 +08:00
|
|
|
if ( !ZM_HAS_V4L2 )
|
2008-12-06 02:45:01 +08:00
|
|
|
unset($localMethods['v4l2']);
|
2011-02-16 05:59:06 +08:00
|
|
|
if ( !ZM_HAS_V4L1 )
|
|
|
|
unset($localMethods['v4l1']);
|
2008-10-28 22:25:12 +08:00
|
|
|
|
2008-07-16 16:40:21 +08:00
|
|
|
$remoteProtocols = array(
|
2008-07-21 23:19:25 +08:00
|
|
|
"http" => "HTTP",
|
|
|
|
"rtsp" => "RTSP"
|
2008-07-16 16:40:21 +08:00
|
|
|
);
|
|
|
|
|
|
|
|
$rtspMethods = array(
|
2008-07-21 23:19:25 +08:00
|
|
|
"rtpUni" => "RTP/Unicast",
|
|
|
|
"rtpMulti" => "RTP/Multicast",
|
|
|
|
"rtpRtsp" => "RTP/RTSP",
|
|
|
|
"rtpRtspHttp" => "RTP/RTSP/HTTP"
|
2008-07-16 16:40:21 +08:00
|
|
|
);
|
|
|
|
|
|
|
|
$httpMethods = array(
|
2008-07-21 23:19:25 +08:00
|
|
|
"simple" => "Simple",
|
|
|
|
"regexp" => "Regexp",
|
|
|
|
"jpegTags" => "JPEG Tags"
|
2008-07-16 16:40:21 +08:00
|
|
|
);
|
2008-12-06 02:45:01 +08:00
|
|
|
if ( !ZM_PCRE )
|
|
|
|
unset($httpMethods['regexp']);
|
|
|
|
// Currently unsupported
|
|
|
|
unset($httpMethods['jpegTags']);
|
2008-07-16 16:40:21 +08:00
|
|
|
|
2011-02-16 05:59:06 +08:00
|
|
|
if ( ZM_HAS_V4L1 )
|
|
|
|
{
|
|
|
|
$v4l1DeviceFormats = array(
|
|
|
|
"PAL" => 0,
|
|
|
|
"NTSC" => 1,
|
|
|
|
"SECAM" => 2,
|
|
|
|
"AUTO" => 3,
|
|
|
|
"FMT4" => 4,
|
|
|
|
"FMT5" => 5,
|
|
|
|
"FMT6" => 6,
|
|
|
|
"FMT7" => 7
|
|
|
|
);
|
2008-07-16 16:40:21 +08:00
|
|
|
|
2011-02-16 05:59:06 +08:00
|
|
|
$v4l1MaxChannels = 15;
|
|
|
|
$v4l1DeviceChannels = array();
|
|
|
|
for ( $i = 0; $i <= $v4l1MaxChannels; $i++ )
|
|
|
|
$v4l1DeviceChannels["$i"] = $i;
|
2008-07-16 16:40:21 +08:00
|
|
|
|
2011-02-16 05:59:06 +08:00
|
|
|
$v4l1LocalPalettes = array(
|
|
|
|
$SLANG['Grey'] => 1,
|
2011-05-05 17:52:00 +08:00
|
|
|
"BGR32" => 5,
|
|
|
|
"BGR24" => 4,
|
2011-07-01 23:01:24 +08:00
|
|
|
"*YUYV" => 8,
|
2011-05-05 17:52:00 +08:00
|
|
|
"*RGB565" => 3,
|
|
|
|
"*RGB555" => 6,
|
|
|
|
"*YUV422" => 7,
|
|
|
|
"*YUV422P" => 13,
|
|
|
|
"*YUV420P" => 15
|
2011-02-16 05:59:06 +08:00
|
|
|
);
|
|
|
|
}
|
2008-07-16 16:40:21 +08:00
|
|
|
|
2011-02-16 05:59:06 +08:00
|
|
|
if ( ZM_HAS_V4L2 )
|
2009-01-27 19:07:24 +08:00
|
|
|
{
|
|
|
|
$v4l2DeviceFormats = array(
|
2009-03-30 20:00:14 +08:00
|
|
|
"PAL" => 0x000000ff,
|
|
|
|
"NTSC" => 0x0000b000,
|
2009-01-27 19:07:24 +08:00
|
|
|
"PAL B" => 0x00000001,
|
|
|
|
"PAL B1" => 0x00000002,
|
|
|
|
"PAL G" => 0x00000004,
|
|
|
|
"PAL H" => 0x00000008,
|
|
|
|
"PAL I" => 0x00000010,
|
|
|
|
"PAL D" => 0x00000020,
|
|
|
|
"PAL D1" => 0x00000040,
|
|
|
|
"PAL K" => 0x00000080,
|
|
|
|
"PAL M" => 0x00000100,
|
|
|
|
"PAL N" => 0x00000200,
|
|
|
|
"PAL Nc" => 0x00000400,
|
|
|
|
"PAL 60" => 0x00000800,
|
|
|
|
"NTSC M" => 0x00001000,
|
|
|
|
"NTSC M JP" => 0x00002000,
|
|
|
|
"NTSC 443" => 0x00004000,
|
|
|
|
"NTSC M KR" => 0x00008000,
|
|
|
|
"SECAM B" => 0x00010000,
|
|
|
|
"SECAM D" => 0x00020000,
|
|
|
|
"SECAM G" => 0x00040000,
|
|
|
|
"SECAM H" => 0x00080000,
|
|
|
|
"SECAM K" => 0x00100000,
|
|
|
|
"SECAM K1" => 0x00200000,
|
|
|
|
"SECAM L" => 0x00400000,
|
|
|
|
"SECAM LC" => 0x00800000,
|
|
|
|
"ATSC 8 VSB" => 0x01000000,
|
|
|
|
"ATSC 16 VSB" => 0x02000000,
|
|
|
|
);
|
|
|
|
|
|
|
|
$v4l2MaxChannels = 31;
|
|
|
|
$v4l2DeviceChannels = array();
|
|
|
|
for ( $i = 0; $i <= $v4l2MaxChannels; $i++ )
|
|
|
|
$v4l2DeviceChannels["$i"] = $i;
|
|
|
|
|
|
|
|
$v4l2LocalPalettes = array(
|
2011-07-02 20:32:16 +08:00
|
|
|
"Auto" => 0, /* Automatic palette selection */
|
2009-01-27 19:07:24 +08:00
|
|
|
|
|
|
|
/* Pixel format FOURCC depth Description */
|
2011-05-05 17:52:00 +08:00
|
|
|
$SLANG['Grey'] => fourcc('G','R','E','Y'), /* 8 Greyscale */
|
|
|
|
"BGR32" => fourcc('B','G','R','4'), /* 32 BGR-8-8-8-8 */
|
|
|
|
"RGB32" => fourcc('R','G','B','4'), /* 32 RGB-8-8-8-8 */
|
|
|
|
"BGR24" => fourcc('B','G','R','3'), /* 24 BGR-8-8-8 */
|
|
|
|
"RGB24" => fourcc('R','G','B','3'), /* 24 RGB-8-8-8 */
|
2011-07-01 23:01:24 +08:00
|
|
|
"*YUYV" => fourcc('Y','U','Y','V'), /* 16 YUV 4:2:2 */
|
|
|
|
|
|
|
|
/* compressed formats */
|
|
|
|
"*JPEG" => fourcc('J','P','E','G'), /* JFIF JPEG */
|
|
|
|
"*MJPEG" => fourcc('M','J','P','G'), /* Motion-JPEG */
|
|
|
|
//"DV" => fourcc('d','v','s','d'), /* 1394 */
|
|
|
|
//"MPEG" => fourcc('M','P','E','G'), /* MPEG-1/2/4 */
|
|
|
|
|
2009-01-28 20:50:58 +08:00
|
|
|
//"RGB332" => fourcc('R','G','B','1'), /* 8 RGB-3-3-2 */
|
2011-05-05 17:52:00 +08:00
|
|
|
"*RGB444" => fourcc('R','4','4','4'), /* 16 xxxxrrrr ggggbbbb */
|
|
|
|
"*RGB555" => fourcc('R','G','B','O'), /* 16 RGB-5-5-5 */
|
|
|
|
"*RGB565" => fourcc('R','G','B','P'), /* 16 RGB-5-6-5 */
|
2009-01-28 20:50:58 +08:00
|
|
|
//"RGB555X" => fourcc('R','G','B','Q'), /* 16 RGB-5-5-5 BE */
|
|
|
|
//"RGB565X" => fourcc('R','G','B','R'), /* 16 RGB-5-6-5 BE */
|
|
|
|
//"Y16" => fourcc('Y','1','6',''), /* 16 Greyscale */
|
|
|
|
//"PAL8" => fourcc('P','A','L','8'), /* 8 8-bit palette */
|
|
|
|
//"YVU410" => fourcc('Y','V','U','9'), /* 9 YVU 4:1:0 */
|
|
|
|
//"YVU420" => fourcc('Y','V','1','2'), /* 12 YVU 4:2:0 */
|
2011-07-01 23:01:24 +08:00
|
|
|
|
2013-12-10 21:13:48 +08:00
|
|
|
"*UYVY" => fourcc('U','Y','V','Y'), /* 16 YUV 4:2:2 */
|
2011-05-05 17:52:00 +08:00
|
|
|
"*YUV422P" => fourcc('4','2','2','P'), /* 16 YVU422 planar */
|
|
|
|
"*YUV411P" => fourcc('4','1','1','P'), /* 16 YVU411 planar */
|
2009-01-28 20:50:58 +08:00
|
|
|
//"Y41P" => fourcc('Y','4','1','P'), /* 12 YUV 4:1:1 */
|
2011-05-05 17:52:00 +08:00
|
|
|
"*YUV444" => fourcc('Y','4','4','4'), /* 16 xxxxyyyy uuuuvvvv */
|
2009-01-28 20:50:58 +08:00
|
|
|
//"YUV555" => fourcc('Y','U','V','O'), /* 16 YUV-5-5-5 */
|
|
|
|
//"YUV565" => fourcc('Y','U','V','P'), /* 16 YUV-5-6-5 */
|
|
|
|
//"YUV32" => fourcc('Y','U','V','4'), /* 32 YUV-8-8-8-8 */
|
2009-01-27 19:07:24 +08:00
|
|
|
|
|
|
|
/* two planes -- one Y, one Cr + Cb interleaved */
|
2009-01-28 20:50:58 +08:00
|
|
|
//"NV12" => fourcc('N','V','1','2'), /* 12 Y/CbCr 4:2:0 */
|
|
|
|
//"NV21" => fourcc('N','V','2','1'), /* 12 Y/CrCb 4:2:0 */
|
2009-01-27 19:07:24 +08:00
|
|
|
|
|
|
|
/* The following formats are not defined in the V4L2 specification */
|
2011-05-05 17:52:00 +08:00
|
|
|
"*YUV410" => fourcc('Y','U','V','9'), /* 9 YUV 4:1:0 */
|
|
|
|
"*YUV420" => fourcc('Y','U','1','2'), /* 12 YUV 4:2:0 */
|
2009-01-28 20:50:58 +08:00
|
|
|
//"YYUV" => fourcc('Y','Y','U','V'), /* 16 YUV 4:2:2 */
|
|
|
|
//"HI240" => fourcc('H','I','2','4'), /* 8 8-bit color */
|
|
|
|
//"HM12" => fourcc('H','M','1','2'), /* 8 YUV 4:2:0 16x16 macroblocks */
|
2009-01-27 19:07:24 +08:00
|
|
|
|
|
|
|
/* see http://www.siliconimaging.com/RGB%20Bayer.htm */
|
2009-01-28 20:50:58 +08:00
|
|
|
//"SBGGR8" => fourcc('B','A','8','1'), /* 8 BGBG.. GRGR.. */
|
|
|
|
//"SGBRG8" => fourcc('G','B','R','G'), /* 8 GBGB.. RGRG.. */
|
|
|
|
//"SBGGR16" => fourcc('B','Y','R','2'), /* 16 BGBG.. GRGR.. */
|
2009-01-27 19:07:24 +08:00
|
|
|
|
|
|
|
/* Vendor-specific formats */
|
2009-01-28 20:50:58 +08:00
|
|
|
//"WNVA" => fourcc('W','N','V','A'), /* Winnov hw compress */
|
|
|
|
//"SN9C10X" => fourcc('S','9','1','0'), /* SN9C10x compression */
|
|
|
|
//"PWC1" => fourcc('P','W','C','1'), /* pwc older webcam */
|
|
|
|
//"PWC2" => fourcc('P','W','C','2'), /* pwc newer webcam */
|
|
|
|
//"ET61X251" => fourcc('E','6','2','5'), /* ET61X251 compression */
|
|
|
|
//"SPCA501" => fourcc('S','5','0','1'), /* YUYV per line */
|
|
|
|
//"SPCA505" => fourcc('S','5','0','5'), /* YYUV per line */
|
|
|
|
//"SPCA508" => fourcc('S','5','0','8'), /* YUVY per line */
|
|
|
|
//"SPCA561" => fourcc('S','5','6','1'), /* compressed GBRG bayer */
|
|
|
|
//"PAC207" => fourcc('P','2','0','7'), /* compressed BGGR bayer */
|
|
|
|
//"PJPG" => fourcc('P','J','P','G'), /* Pixart 73xx JPEG */
|
|
|
|
//"YVYU" => fourcc('Y','V','Y','U'), /* 16 YVU 4:2:2 */
|
2009-01-27 19:07:24 +08:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2011-05-05 17:52:00 +08:00
|
|
|
$Colours = array(
|
2008-07-21 23:19:25 +08:00
|
|
|
$SLANG['8BitGrey'] => 1,
|
2011-05-05 17:52:00 +08:00
|
|
|
$SLANG['24BitColour'] => 3,
|
2011-06-16 00:04:29 +08:00
|
|
|
$SLANG['32BitColour'] => 4
|
2008-07-16 16:40:21 +08:00
|
|
|
);
|
|
|
|
|
|
|
|
$orientations = array(
|
2008-07-21 23:19:25 +08:00
|
|
|
$SLANG['Normal'] => '0',
|
|
|
|
$SLANG['RotateRight'] => '90',
|
|
|
|
$SLANG['Inverted'] => '180',
|
|
|
|
$SLANG['RotateLeft'] => '270',
|
|
|
|
$SLANG['FlippedHori'] => 'hori',
|
|
|
|
$SLANG['FlippedVert'] => 'vert'
|
2008-07-16 16:40:21 +08:00
|
|
|
);
|
2008-07-14 21:54:50 +08:00
|
|
|
|
2012-01-25 22:59:56 +08:00
|
|
|
$deinterlaceopts = array(
|
2012-01-30 14:00:22 +08:00
|
|
|
"Disabled" => 0x00000000,
|
2012-07-15 22:30:37 +08:00
|
|
|
"Four field motion adaptive - Soft" => 0x00001E04, /* 30 change */
|
|
|
|
"Four field motion adaptive - Medium" => 0x00001404, /* 20 change */
|
|
|
|
"Four field motion adaptive - Hard" => 0x00000A04, /* 10 change */
|
2012-01-30 14:00:22 +08:00
|
|
|
"Discard" => 0x00000001,
|
|
|
|
"Linear" => 0x00000002,
|
|
|
|
"Blend" => 0x00000003,
|
|
|
|
"Blend (25%)" => 0x00000205
|
|
|
|
);
|
|
|
|
|
|
|
|
$deinterlaceopts_v4l2 = array(
|
|
|
|
"Disabled" => 0x00000000,
|
2012-07-15 22:30:37 +08:00
|
|
|
"Four field motion adaptive - Soft" => 0x00001E04, /* 30 change */
|
|
|
|
"Four field motion adaptive - Medium" => 0x00001404, /* 20 change */
|
|
|
|
"Four field motion adaptive - Hard" => 0x00000A04, /* 10 change */
|
2012-01-30 14:00:22 +08:00
|
|
|
"Discard" => 0x00000001,
|
|
|
|
"Linear" => 0x00000002,
|
|
|
|
"Blend" => 0x00000003,
|
|
|
|
"Blend (25%)" => 0x00000205,
|
2012-02-09 18:33:54 +08:00
|
|
|
"V4L2: Capture top field only" => 0x02000000,
|
|
|
|
"V4L2: Capture bottom field only" => 0x03000000,
|
|
|
|
"V4L2: Alternate fields (Bob)" => 0x07000000,
|
2012-01-30 14:00:22 +08:00
|
|
|
"V4L2: Progressive" => 0x01000000,
|
2013-11-03 16:26:04 +08:00
|
|
|
"V4L2: Interlaced" => 0x04000000
|
|
|
|
);
|
|
|
|
|
|
|
|
$fastblendopts = array(
|
|
|
|
"No blending" => 0,
|
|
|
|
"1.5625%" => 1,
|
|
|
|
"3.125%" => 3,
|
|
|
|
"6.25% (Indoor)" => 6,
|
|
|
|
"12.5% (Outdoor)" => 12,
|
|
|
|
"25%" => 25,
|
|
|
|
"50%" => 50
|
2012-01-25 22:59:56 +08:00
|
|
|
);
|
|
|
|
|
2013-11-04 18:10:53 +08:00
|
|
|
$fastblendopts_alarm = array(
|
|
|
|
"No blending (Alarm lasts forever)" => 0,
|
|
|
|
"1.5625%" => 1,
|
|
|
|
"3.125%" => 3,
|
|
|
|
"6.25%" => 6,
|
|
|
|
"12.5%" => 12,
|
|
|
|
"25%" => 25,
|
|
|
|
"50% (Alarm lasts a moment)" => 50
|
2012-01-25 22:59:56 +08:00
|
|
|
);
|
|
|
|
|
2008-09-26 17:47:20 +08:00
|
|
|
xhtmlHeaders(__FILE__, $SLANG['Monitor']." - ".validHtmlStr($monitor['Name']) );
|
2008-07-14 21:54:50 +08:00
|
|
|
?>
|
|
|
|
<body>
|
|
|
|
<div id="page">
|
|
|
|
<div id="header">
|
|
|
|
<?php
|
|
|
|
if ( canEdit( 'Monitors' ) )
|
|
|
|
{
|
|
|
|
?>
|
|
|
|
<div id="headerButtons">
|
2009-10-17 01:09:16 +08:00
|
|
|
<a href="#" onclick="createPopup( '?view=monitorprobe&mid=<?= $monitor['Id'] ?>', 'zmMonitorProbe<?= $monitor['Id'] ?>', 'monitorprobe' ); return( false );"><?= $SLANG['Probe'] ?></a>
|
|
|
|
<a href="#" onclick="createPopup( '?view=monitorpreset&mid=<?= $monitor['Id'] ?>', 'zmMonitorPreset<?= $monitor['Id'] ?>', 'monitorpreset' ); return( false );"><?= $SLANG['Presets'] ?></a>
|
2008-07-14 21:54:50 +08:00
|
|
|
</div>
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
?>
|
2008-09-26 17:47:20 +08:00
|
|
|
<h2><?= $SLANG['Monitor'] ?> - <?= validHtmlStr($monitor['Name']) ?><?php if ( !empty($monitor['Id']) ) { ?> (<?= $monitor['Id'] ?>)<?php } ?></h2>
|
2008-07-14 21:54:50 +08:00
|
|
|
</div>
|
|
|
|
<div id="content">
|
|
|
|
<ul class="tabList">
|
|
|
|
<?php
|
|
|
|
foreach ( $tabs as $name=>$value )
|
|
|
|
{
|
2008-09-26 17:47:20 +08:00
|
|
|
if ( $tab == $name )
|
2008-07-14 21:54:50 +08:00
|
|
|
{
|
|
|
|
?>
|
|
|
|
<li class="active"><?= $value ?></li>
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
?>
|
|
|
|
<li><a href="#" onclick="submitTab( '<?= $name ?>' ); return( false );"><?= $value ?></a></li>
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
</ul>
|
2008-07-18 22:53:44 +08:00
|
|
|
<div class="clear"></div>
|
2008-07-14 21:54:50 +08:00
|
|
|
<form name="contentForm" id="contentForm" method="post" action="<?= $_SERVER['PHP_SELF'] ?>" onsubmit="return validateForm( this )">
|
2008-09-26 17:47:20 +08:00
|
|
|
<input type="hidden" name="view" value="<?= $view ?>"/>
|
|
|
|
<input type="hidden" name="tab" value="<?= $tab ?>"/>
|
2008-07-14 21:54:50 +08:00
|
|
|
<input type="hidden" name="action" value="monitor"/>
|
2008-07-16 16:40:21 +08:00
|
|
|
<input type="hidden" name="mid" value="<?= $monitor['Id'] ?>"/>
|
2008-09-01 22:03:52 +08:00
|
|
|
<input type="hidden" name="newMonitor[LinkedMonitors]" value="<?= isset($newMonitor['LinkedMonitors'])?$newMonitor['LinkedMonitors']:'' ?>"/>
|
2008-09-01 22:59:02 +08:00
|
|
|
<input type="hidden" name="origMethod" value="<?= isset($newMonitor['Method'])?$newMonitor['Method']:'' ?>"/>
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php
|
2008-09-26 17:47:20 +08:00
|
|
|
if ( $tab != 'general' )
|
2008-07-14 21:54:50 +08:00
|
|
|
{
|
|
|
|
?>
|
2008-09-26 17:47:20 +08:00
|
|
|
<input type="hidden" name="newMonitor[Name]" value="<?= validHtmlStr($newMonitor['Name']) ?>"/>
|
|
|
|
<input type="hidden" name="newMonitor[Type]" value="<?= validHtmlStr($newMonitor['Type']) ?>"/>
|
|
|
|
<input type="hidden" name="newMonitor[Function]" value="<?= validHtmlStr($newMonitor['Function']) ?>"/>
|
|
|
|
<input type="hidden" name="newMonitor[Enabled]" value="<?= validHtmlStr($newMonitor['Enabled']) ?>"/>
|
|
|
|
<input type="hidden" name="newMonitor[RefBlendPerc]" value="<?= validHtmlStr($newMonitor['RefBlendPerc']) ?>"/>
|
2013-11-03 16:26:04 +08:00
|
|
|
<input type="hidden" name="newMonitor[AlarmRefBlendPerc]" value="<?= validHtmlStr($newMonitor['AlarmRefBlendPerc']) ?>"/>
|
2008-09-26 17:47:20 +08:00
|
|
|
<input type="hidden" name="newMonitor[MaxFPS]" value="<?= validHtmlStr($newMonitor['MaxFPS']) ?>"/>
|
|
|
|
<input type="hidden" name="newMonitor[AlarmMaxFPS]" value="<?= validHtmlStr($newMonitor['AlarmMaxFPS']) ?>"/>
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php
|
|
|
|
if ( isset($newMonitor['Triggers']) )
|
|
|
|
{
|
|
|
|
foreach( $newMonitor['Triggers'] as $newTrigger )
|
|
|
|
{
|
|
|
|
?>
|
2008-09-29 19:42:59 +08:00
|
|
|
<input type="hidden" name="newMonitor[Triggers][]" value="<?= validHtmlStr($newTrigger) ?>"/>
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2011-02-16 05:59:06 +08:00
|
|
|
if ( ZM_HAS_V4L && ($tab != 'source' || $newMonitor['Type'] != 'Local') )
|
2008-07-14 21:54:50 +08:00
|
|
|
{
|
|
|
|
?>
|
2008-09-26 17:47:20 +08:00
|
|
|
<input type="hidden" name="newMonitor[Device]" value="<?= validHtmlStr($newMonitor['Device']) ?>"/>
|
|
|
|
<input type="hidden" name="newMonitor[Channel]" value="<?= validHtmlStr($newMonitor['Channel']) ?>"/>
|
|
|
|
<input type="hidden" name="newMonitor[Format]" value="<?= validHtmlStr($newMonitor['Format']) ?>"/>
|
2011-05-05 17:52:00 +08:00
|
|
|
<input type="hidden" name="newMonitor[Palette]" value="<?= validHtmlStr($newMonitor['Palette']) ?>"/>
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php
|
|
|
|
}
|
2008-09-26 17:47:20 +08:00
|
|
|
if ( $tab != 'source' || $newMonitor['Type'] != 'Remote' )
|
2008-07-14 21:54:50 +08:00
|
|
|
{
|
|
|
|
?>
|
2008-10-28 22:25:12 +08:00
|
|
|
<input type="hidden" name="newMonitor[Protocol]" value="<?= validHtmlStr($newMonitor['Protocol']) ?>"/>
|
2008-09-26 17:47:20 +08:00
|
|
|
<input type="hidden" name="newMonitor[Host]" value="<?= validHtmlStr($newMonitor['Host']) ?>"/>
|
|
|
|
<input type="hidden" name="newMonitor[Port]" value="<?= validHtmlStr($newMonitor['Port']) ?>"/>
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php
|
|
|
|
}
|
2014-05-18 02:41:22 +08:00
|
|
|
if ( $tab != 'source' || ($newMonitor['Type'] != 'Local' && $newMonitor['Type'] != 'Remote' && $newMonitor['Type'] != 'Ffmpeg' && $newMonitor['Type'] != 'Libvlc') )
|
2008-07-14 21:54:50 +08:00
|
|
|
{
|
|
|
|
?>
|
2008-09-26 17:47:20 +08:00
|
|
|
<input type="hidden" name="newMonitor[Method]" value="<?= validHtmlStr($newMonitor['Method']) ?>"/>
|
2008-10-28 22:25:12 +08:00
|
|
|
<?php
|
|
|
|
}
|
2014-05-05 19:29:12 +08:00
|
|
|
if ( $tab != 'source' || ($newMonitor['Type'] != 'Ffmpeg' && $newMonitor['Type'] != 'Libvlc' ))
|
|
|
|
{
|
|
|
|
?>
|
|
|
|
<input type="hidden" name="newMonitor[Options]" value="<?= validHtmlStr($newMonitor['Options']) ?>"/>
|
|
|
|
<?php
|
|
|
|
}
|
2013-12-28 00:02:32 +08:00
|
|
|
if ( $tab != 'source' || ($newMonitor['Type'] != 'Remote' && $newMonitor['Type'] != 'File' && $newMonitor['Type'] != 'Ffmpeg' && $newMonitor['Type'] != 'Libvlc' && $newMonitor['Type'] != 'cURL') )
|
2008-10-28 22:25:12 +08:00
|
|
|
{
|
|
|
|
?>
|
2008-09-26 17:47:20 +08:00
|
|
|
<input type="hidden" name="newMonitor[Path]" value="<?= validHtmlStr($newMonitor['Path']) ?>"/>
|
2013-12-28 00:02:32 +08:00
|
|
|
<input type="hidden" name="newMonitor[User]" value="<?= validHtmlStr($newMonitor['User']) ?>"/>
|
|
|
|
<input type="hidden" name="newMonitor[Pass]" value="<?= validHtmlStr($newMonitor['Pass']) ?>"/>
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php
|
|
|
|
}
|
2008-09-26 17:47:20 +08:00
|
|
|
if ( $tab != 'source' )
|
2008-07-14 21:54:50 +08:00
|
|
|
{
|
|
|
|
?>
|
2011-05-05 17:52:00 +08:00
|
|
|
<input type="hidden" name="newMonitor[Colours]" value="<?= validHtmlStr($newMonitor['Colours']) ?>"/>
|
2008-09-26 17:47:20 +08:00
|
|
|
<input type="hidden" name="newMonitor[Width]" value="<?= validHtmlStr($newMonitor['Width']) ?>"/>
|
|
|
|
<input type="hidden" name="newMonitor[Height]" value="<?= validHtmlStr($newMonitor['Height']) ?>"/>
|
|
|
|
<input type="hidden" name="newMonitor[Orientation]" value="<?= validHtmlStr($newMonitor['Orientation']) ?>"/>
|
2012-01-25 22:59:56 +08:00
|
|
|
<input type="hidden" name="newMonitor[Deinterlacing]" value="<?= validHtmlStr($newMonitor['Deinterlacing']) ?>"/>
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php
|
|
|
|
}
|
2008-09-26 17:47:20 +08:00
|
|
|
if ( $tab != 'timestamp' )
|
2008-07-14 21:54:50 +08:00
|
|
|
{
|
|
|
|
?>
|
2008-09-26 17:47:20 +08:00
|
|
|
<input type="hidden" name="newMonitor[LabelFormat]" value="<?= validHtmlStr($newMonitor['LabelFormat']) ?>"/>
|
|
|
|
<input type="hidden" name="newMonitor[LabelX]" value="<?= validHtmlStr($newMonitor['LabelX']) ?>"/>
|
|
|
|
<input type="hidden" name="newMonitor[LabelY]" value="<?= validHtmlStr($newMonitor['LabelY']) ?>"/>
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php
|
|
|
|
}
|
2008-09-26 17:47:20 +08:00
|
|
|
if ( $tab != 'buffers' )
|
2008-07-14 21:54:50 +08:00
|
|
|
{
|
|
|
|
?>
|
2008-09-26 17:47:20 +08:00
|
|
|
<input type="hidden" name="newMonitor[ImageBufferCount]" value="<?= validHtmlStr($newMonitor['ImageBufferCount']) ?>"/>
|
|
|
|
<input type="hidden" name="newMonitor[WarmupCount]" value="<?= validHtmlStr($newMonitor['WarmupCount']) ?>"/>
|
|
|
|
<input type="hidden" name="newMonitor[PreEventCount]" value="<?= validHtmlStr($newMonitor['PreEventCount']) ?>"/>
|
|
|
|
<input type="hidden" name="newMonitor[PostEventCount]" value="<?= validHtmlStr($newMonitor['PostEventCount']) ?>"/>
|
|
|
|
<input type="hidden" name="newMonitor[StreamReplayBuffer]" value="<?= validHtmlStr($newMonitor['StreamReplayBuffer']) ?>"/>
|
|
|
|
<input type="hidden" name="newMonitor[AlarmFrameCount]" value="<?= validHtmlStr($newMonitor['AlarmFrameCount']) ?>"/>
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php
|
|
|
|
}
|
2008-09-26 17:47:20 +08:00
|
|
|
if ( ZM_OPT_CONTROL && $tab != 'control' )
|
2008-07-14 21:54:50 +08:00
|
|
|
{
|
|
|
|
?>
|
2008-09-26 17:47:20 +08:00
|
|
|
<input type="hidden" name="newMonitor[Controllable]" value="<?= validHtmlStr($newMonitor['Controllable']) ?>"/>
|
|
|
|
<input type="hidden" name="newMonitor[ControlId]" value="<?= validHtmlStr($newMonitor['ControlId']) ?>"/>
|
|
|
|
<input type="hidden" name="newMonitor[ControlDevice]" value="<?= validHtmlStr($newMonitor['ControlDevice']) ?>"/>
|
|
|
|
<input type="hidden" name="newMonitor[ControlAddress]" value="<?= validHtmlStr($newMonitor['ControlAddress']) ?>"/>
|
|
|
|
<input type="hidden" name="newMonitor[AutoStopTimeout]" value="<?= validHtmlStr($newMonitor['AutoStopTimeout']) ?>"/>
|
|
|
|
<input type="hidden" name="newMonitor[TrackMotion]" value="<?= validHtmlStr($newMonitor['TrackMotion']) ?>"/>
|
|
|
|
<input type="hidden" name="newMonitor[TrackDelay]" value="<?= validHtmlStr($newMonitor['TrackDelay']) ?>"/>
|
|
|
|
<input type="hidden" name="newMonitor[ReturnLocation]" value="<?= validHtmlStr($newMonitor['ReturnLocation']) ?>"/>
|
|
|
|
<input type="hidden" name="newMonitor[ReturnDelay]" value="<?= validHtmlStr($newMonitor['ReturnDelay']) ?>"/>
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php
|
|
|
|
}
|
2008-09-26 17:47:20 +08:00
|
|
|
if ( ZM_OPT_X10 && $tab != 'x10' )
|
2008-07-14 21:54:50 +08:00
|
|
|
{
|
|
|
|
?>
|
2008-09-26 17:47:20 +08:00
|
|
|
<input type="hidden" name="newX10Monitor[Activation]" value="<?= validHtmlStr($newX10Monitor['Activation']) ?>"/>
|
|
|
|
<input type="hidden" name="newX10Monitor[AlarmInput]" value="<?= validHtmlStr($newX10Monitor['AlarmInput']) ?>"/>
|
|
|
|
<input type="hidden" name="newX10Monitor[AlarmOutput]" value="<?= validHtmlStr($newX10Monitor['AlarmOutput']) ?>"/>
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php
|
|
|
|
}
|
2008-09-26 17:47:20 +08:00
|
|
|
if ( $tab != 'misc' )
|
2008-07-14 21:54:50 +08:00
|
|
|
{
|
|
|
|
?>
|
2008-09-26 17:47:20 +08:00
|
|
|
<input type="hidden" name="newMonitor[EventPrefix]" value="<?= validHtmlStr($newMonitor['EventPrefix']) ?>"/>
|
|
|
|
<input type="hidden" name="newMonitor[SectionLength]" value="<?= validHtmlStr($newMonitor['SectionLength']) ?>"/>
|
|
|
|
<input type="hidden" name="newMonitor[FrameSkip]" value="<?= validHtmlStr($newMonitor['FrameSkip']) ?>"/>
|
2014-04-10 19:56:14 +08:00
|
|
|
<input type="hidden" name="newMonitor[MotionFrameSkip]" value="<?= validHtmlStr($newMonitor['MotionFrameSkip']) ?>"/>
|
2008-09-26 17:47:20 +08:00
|
|
|
<input type="hidden" name="newMonitor[FPSReportInterval]" value="<?= validHtmlStr($newMonitor['FPSReportInterval']) ?>"/>
|
|
|
|
<input type="hidden" name="newMonitor[DefaultView]" value="<?= validHtmlStr($newMonitor['DefaultView']) ?>"/>
|
|
|
|
<input type="hidden" name="newMonitor[DefaultRate]" value="<?= validHtmlStr($newMonitor['DefaultRate']) ?>"/>
|
|
|
|
<input type="hidden" name="newMonitor[DefaultScale]" value="<?= validHtmlStr($newMonitor['DefaultScale']) ?>"/>
|
|
|
|
<input type="hidden" name="newMonitor[WebColour]" value="<?= validHtmlStr($newMonitor['WebColour']) ?>"/>
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php
|
|
|
|
}
|
2011-02-16 05:59:06 +08:00
|
|
|
if ( ZM_HAS_V4L && ($tab != 'misc' || $newMonitor['Type'] != 'Local') )
|
2008-07-14 21:54:50 +08:00
|
|
|
{
|
|
|
|
?>
|
2008-09-26 17:47:20 +08:00
|
|
|
<input type="hidden" name="newMonitor[SignalCheckColour]" value="<?= validHtmlStr($newMonitor['SignalCheckColour']) ?>"/>
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
<table id="contentTable" class="major" cellspacing="0">
|
|
|
|
<tbody>
|
|
|
|
<?php
|
2008-09-26 17:47:20 +08:00
|
|
|
switch ( $tab )
|
2008-07-14 21:54:50 +08:00
|
|
|
{
|
|
|
|
case 'general' :
|
|
|
|
{
|
|
|
|
?>
|
2008-09-26 17:47:20 +08:00
|
|
|
<tr><td><?= $SLANG['Name'] ?></td><td><input type="text" name="newMonitor[Name]" value="<?= validHtmlStr($newMonitor['Name']) ?>" size="16"/></td></tr>
|
2008-07-16 16:40:21 +08:00
|
|
|
<tr><td><?= $SLANG['SourceType'] ?></td><td><?= buildSelect( "newMonitor[Type]", $sourceTypes ); ?></td></tr>
|
2008-07-14 21:54:50 +08:00
|
|
|
<tr><td><?= $SLANG['Function'] ?></td><td><select name="newMonitor[Function]">
|
|
|
|
<?php
|
2008-07-16 16:40:21 +08:00
|
|
|
foreach ( getEnumValues( 'Monitors', 'Function' ) as $optFunction )
|
2008-07-14 21:54:50 +08:00
|
|
|
{
|
|
|
|
?>
|
2013-08-16 19:48:25 +08:00
|
|
|
<option value="<?= $optFunction ?>"<?php if ( $optFunction == $newMonitor['Function'] ) { ?> selected="selected"<?php } ?>><?= $SLANG['Fn'.$optFunction] ?></option>
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
</select></td></tr>
|
2008-07-16 16:40:21 +08:00
|
|
|
<tr><td><?= $SLANG['Enabled'] ?></td><td><input type="checkbox" name="newMonitor[Enabled]" value="1"<?php if ( !empty($newMonitor['Enabled']) ) { ?> checked="checked"<?php } ?>/></td></tr>
|
2008-07-14 21:54:50 +08:00
|
|
|
<tr>
|
|
|
|
<td><?= $SLANG['LinkedMonitors'] ?></td>
|
|
|
|
<td>
|
2008-09-02 00:43:34 +08:00
|
|
|
<select name="monitorIds" size="4" multiple="multiple" onchange="updateLinkedMonitors( this )">
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php
|
|
|
|
$monitors = dbFetchAll( "select Id,Name from Monitors order by Sequence asc" );
|
2008-07-16 16:40:21 +08:00
|
|
|
if ( !empty($newMonitor['LinkedMonitors']) )
|
2010-02-16 01:11:17 +08:00
|
|
|
$monitorIds = array_flip( explode( ',', $newMonitor['LinkedMonitors'] ) );
|
2008-07-16 16:40:21 +08:00
|
|
|
else
|
|
|
|
$monitorIds = array();
|
2008-07-14 21:54:50 +08:00
|
|
|
foreach ( $monitors as $monitor )
|
|
|
|
{
|
2008-09-02 00:43:34 +08:00
|
|
|
if ( (empty($newMonitor['Id']) || ($monitor['Id'] != $newMonitor['Id'])) && visibleMonitor( $monitor['Id'] ) )
|
2008-07-14 21:54:50 +08:00
|
|
|
{
|
|
|
|
?>
|
2008-09-26 17:47:20 +08:00
|
|
|
<option value="<?= $monitor['Id'] ?>"<?php if ( array_key_exists( $monitor['Id'], $monitorIds ) ) { ?> selected="selected"<?php } ?>><?= validHtmlStr($monitor['Name']) ?></option>
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php
|
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
</select>
|
|
|
|
</td>
|
|
|
|
</tr>
|
2008-09-26 17:47:20 +08:00
|
|
|
<tr><td><?= $SLANG['MaximumFPS'] ?></td><td><input type="text" name="newMonitor[MaxFPS]" value="<?= validHtmlStr($newMonitor['MaxFPS']) ?>" size="6"/></td></tr>
|
|
|
|
<tr><td><?= $SLANG['AlarmMaximumFPS'] ?></td><td><input type="text" name="newMonitor[AlarmMaxFPS]" value="<?= validHtmlStr($newMonitor['AlarmMaxFPS']) ?>" size="6"/></td></tr>
|
2013-11-03 16:26:04 +08:00
|
|
|
<?php
|
|
|
|
if ( ZM_FAST_IMAGE_BLENDS )
|
|
|
|
{
|
|
|
|
?>
|
|
|
|
<tr><td><?= $SLANG['RefImageBlendPct'] ?></td><td><select name="newMonitor[RefBlendPerc]"><?php foreach ( $fastblendopts as $name => $value ) { ?><option value="<?= $value ?>"<?php if ( $value == $newMonitor['RefBlendPerc'] ) { ?> selected="selected"<?php } ?>><?= $name ?></option><?php } ?></select></td></tr>
|
2013-11-04 18:10:53 +08:00
|
|
|
<tr><td><?= "Alarm " . $SLANG['RefImageBlendPct'] ?></td><td><select name="newMonitor[AlarmRefBlendPerc]"><?php foreach ( $fastblendopts_alarm as $name => $value ) { ?><option value="<?= $value ?>"<?php if ( $value == $newMonitor['AlarmRefBlendPerc'] ) { ?> selected="selected"<?php } ?>><?= $name ?></option><?php } ?></select></td></tr>
|
2013-11-03 16:26:04 +08:00
|
|
|
<?php
|
|
|
|
} else {
|
|
|
|
?>
|
2008-09-26 17:47:20 +08:00
|
|
|
<tr><td><?= $SLANG['RefImageBlendPct'] ?></td><td><input type="text" name="newMonitor[RefBlendPerc]" value="<?= validHtmlStr($newMonitor['RefBlendPerc']) ?>" size="4"/></td></tr>
|
2013-11-03 16:26:04 +08:00
|
|
|
<tr><td><?= "Alarm " . $SLANG['RefImageBlendPct'] ?></td><td><input type="text" name="newMonitor[AlarmRefBlendPerc]" value="<?= validHtmlStr($newMonitor['AlarmRefBlendPerc']) ?>" size="4"/></td></tr>
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
?>
|
2008-07-14 21:54:50 +08:00
|
|
|
<tr><td><?= $SLANG['Triggers'] ?></td><td>
|
|
|
|
<?php
|
2008-07-16 16:40:21 +08:00
|
|
|
$optTriggers = getSetValues( 'Monitors', 'Triggers' );
|
|
|
|
$breakCount = (int)(ceil(count($optTriggers)));
|
|
|
|
$breakCount = min( 3, $breakCount );
|
|
|
|
$optCount = 0;
|
|
|
|
foreach( $optTriggers as $optTrigger )
|
2008-07-14 21:54:50 +08:00
|
|
|
{
|
2008-07-16 16:40:21 +08:00
|
|
|
if ( !ZM_OPT_X10 && $optTrigger == 'X10' )
|
2008-07-14 21:54:50 +08:00
|
|
|
continue;
|
2008-07-16 16:40:21 +08:00
|
|
|
if ( $optCount && ($optCount%$breakCount == 0) )
|
2008-07-14 21:54:50 +08:00
|
|
|
echo "</br>";
|
|
|
|
?>
|
2008-07-16 16:40:21 +08:00
|
|
|
<input type="checkbox" name="newMonitor[Triggers][]" value="<?= $optTrigger ?>"<?php if ( isset($newMonitor['Triggers']) && in_array( $optTrigger, $newMonitor['Triggers'] ) ) { ?> checked="checked"<?php } ?>/> <?= $optTrigger ?>
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php
|
2008-07-16 16:40:21 +08:00
|
|
|
$optCount ++;
|
2008-07-14 21:54:50 +08:00
|
|
|
}
|
2008-07-16 16:40:21 +08:00
|
|
|
if ( !$optCount )
|
2008-07-14 21:54:50 +08:00
|
|
|
{
|
|
|
|
?>
|
|
|
|
<em><?= $SLANG['NoneAvailable'] ?></em>
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
?>
|
2008-07-16 16:40:21 +08:00
|
|
|
</td></tr>
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 'source' :
|
|
|
|
{
|
2011-02-16 05:59:06 +08:00
|
|
|
if ( ZM_HAS_V4L && $newMonitor['Type'] == "Local" )
|
2008-07-14 21:54:50 +08:00
|
|
|
{
|
|
|
|
?>
|
2008-09-26 17:47:20 +08:00
|
|
|
<tr><td><?= $SLANG['DevicePath'] ?></td><td><input type="text" name="newMonitor[Device]" value="<?= validHtmlStr($newMonitor['Device']) ?>" size="24"/></td></tr>
|
2009-01-27 19:07:24 +08:00
|
|
|
<tr><td><?= $SLANG['CaptureMethod'] ?></td><td><?= buildSelect( "newMonitor[Method]", $localMethods, "submitTab( '$tab' )" ); ?></td></tr>
|
|
|
|
<?php
|
2011-03-02 20:04:52 +08:00
|
|
|
if ( ZM_HAS_V4L1 && $newMonitor['Method'] == 'v4l1' )
|
2009-01-27 19:07:24 +08:00
|
|
|
{
|
|
|
|
?>
|
2009-02-13 06:44:11 +08:00
|
|
|
<tr><td><?= $SLANG['DeviceChannel'] ?></td><td><select name="newMonitor[Channel]"><?php foreach ( $v4l1DeviceChannels as $name => $value ) { ?><option value="<?= $value ?>"<?php if ( $value == $newMonitor['Channel'] ) { ?> selected="selected"<?php } ?>><?= $name ?></option><?php } ?></select></td></tr>
|
|
|
|
<tr><td><?= $SLANG['DeviceFormat'] ?></td><td><select name="newMonitor[Format]"><?php foreach ( $v4l1DeviceFormats as $name => $value ) { ?><option value="<?= $value ?>"<?php if ( $value == $newMonitor['Format'] ) { ?> selected="selected"<?php } ?>><?= $name ?></option><?php } ?></select></td></tr>
|
|
|
|
<tr><td><?= $SLANG['CapturePalette'] ?></td><td><select name="newMonitor[Palette]"><?php foreach ( $v4l1LocalPalettes as $name => $value ) { ?><option value="<?= $value ?>"<?php if ( $value == $newMonitor['Palette'] ) { ?> selected="selected"<?php } ?>><?= $name ?></option><?php } ?></select></td></tr>
|
2009-01-27 19:07:24 +08:00
|
|
|
<?php
|
|
|
|
}
|
2011-05-10 18:50:54 +08:00
|
|
|
else
|
2009-01-27 19:07:24 +08:00
|
|
|
{
|
|
|
|
?>
|
2009-02-13 06:44:11 +08:00
|
|
|
<tr><td><?= $SLANG['DeviceChannel'] ?></td><td><select name="newMonitor[Channel]"><?php foreach ( $v4l2DeviceChannels as $name => $value ) { ?><option value="<?= $value ?>"<?php if ( $value == $newMonitor['Channel'] ) { ?> selected="selected"<?php } ?>><?= $name ?></option><?php } ?></select></td></tr>
|
|
|
|
<tr><td><?= $SLANG['DeviceFormat'] ?></td><td><select name="newMonitor[Format]"><?php foreach ( $v4l2DeviceFormats as $name => $value ) { ?><option value="<?= $value ?>"<?php if ( $value == $newMonitor['Format'] ) { ?> selected="selected"<?php } ?>><?= $name ?></option><?php } ?></select></td></tr>
|
|
|
|
<tr><td><?= $SLANG['CapturePalette'] ?></td><td><select name="newMonitor[Palette]"><?php foreach ( $v4l2LocalPalettes as $name => $value ) { ?><option value="<?= $value ?>"<?php if ( $value == $newMonitor['Palette'] ) { ?> selected="selected"<?php } ?>><?= $name ?></option><?php } ?></select></td></tr>
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php
|
2009-01-27 19:07:24 +08:00
|
|
|
}
|
2008-07-14 21:54:50 +08:00
|
|
|
}
|
|
|
|
elseif ( $newMonitor['Type'] == "Remote" )
|
|
|
|
{
|
|
|
|
?>
|
2008-07-16 16:40:21 +08:00
|
|
|
<tr><td><?= $SLANG['RemoteProtocol'] ?></td><td><?= buildSelect( "newMonitor[Protocol]", $remoteProtocols, "updateMethods( this )" ); ?></td></tr>
|
2008-09-01 22:59:02 +08:00
|
|
|
<?php
|
|
|
|
if ( empty($newMonitor['Protocol']) || $newMonitor['Protocol'] == "http" )
|
|
|
|
{
|
|
|
|
?>
|
|
|
|
<tr><td><?= $SLANG['RemoteMethod'] ?></td><td><?= buildSelect( "newMonitor[Method]", $httpMethods ); ?></td></tr>
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
?>
|
|
|
|
<tr><td><?= $SLANG['RemoteMethod'] ?></td><td><?= buildSelect( "newMonitor[Method]", $rtspMethods ); ?></td></tr>
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
?>
|
2008-09-26 17:47:20 +08:00
|
|
|
<tr><td><?= $SLANG['RemoteHostName'] ?></td><td><input type="text" name="newMonitor[Host]" value="<?= validHtmlStr($newMonitor['Host']) ?>" size="36"/></td></tr>
|
|
|
|
<tr><td><?= $SLANG['RemoteHostPort'] ?></td><td><input type="text" name="newMonitor[Port]" value="<?= validHtmlStr($newMonitor['Port']) ?>" size="6"/></td></tr>
|
|
|
|
<tr><td><?= $SLANG['RemoteHostPath'] ?></td><td><input type="text" name="newMonitor[Path]" value="<?= validHtmlStr($newMonitor['Path']) ?>" size="36"/></td></tr>
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php
|
|
|
|
}
|
2014-05-05 19:29:12 +08:00
|
|
|
elseif ( $newMonitor['Type'] == "File" )
|
2008-07-14 21:54:50 +08:00
|
|
|
{
|
|
|
|
?>
|
2009-01-22 01:45:30 +08:00
|
|
|
<tr><td><?= $SLANG['SourcePath'] ?></td><td><input type="text" name="newMonitor[Path]" value="<?= validHtmlStr($newMonitor['Path']) ?>" size="36"/></td></tr>
|
2013-11-04 22:52:21 +08:00
|
|
|
<?php
|
|
|
|
}
|
|
|
|
elseif ( $newMonitor['Type'] == "cURL" )
|
|
|
|
{
|
|
|
|
?>
|
2014-04-23 17:12:41 +08:00
|
|
|
<tr><td><?= "URL" ?></td><td><input type="text" name="newMonitor[Path]" value="<?= validHtmlStr($newMonitor['Path']) ?>" size="36"/></td></tr>
|
2013-11-04 22:52:21 +08:00
|
|
|
<tr><td><?= "Username" ?></td><td><input type="text" name="newMonitor[User]" value="<?= validHtmlStr($newMonitor['User']) ?>" size="12"/></td></tr>
|
|
|
|
<tr><td><?= "Password" ?></td><td><input type="text" name="newMonitor[Pass]" value="<?= validHtmlStr($newMonitor['Pass']) ?>" size="12"/></td></tr>
|
2014-05-05 19:29:12 +08:00
|
|
|
<?php
|
|
|
|
}
|
|
|
|
elseif ( $newMonitor['Type'] == "Ffmpeg" || $newMonitor['Type'] == "Libvlc")
|
|
|
|
{
|
|
|
|
?>
|
|
|
|
<tr><td><?= $SLANG['SourcePath'] ?></td><td><input type="text" name="newMonitor[Path]" value="<?= validHtmlStr($newMonitor['Path']) ?>" size="36"/></td></tr>
|
2014-05-18 02:41:22 +08:00
|
|
|
<tr><td><?= $SLANG['RemoteMethod'] ?></td><td><?= buildSelect( "newMonitor[Method]", $rtspMethods ); ?></td></tr>
|
2014-05-17 10:33:33 +08:00
|
|
|
<tr><td><?= $SLANG['Options'] ?> (<?= makePopupLink( '?view=optionhelp&option=OPTIONS_'.strtoupper($newMonitor['Type']), 'zmOptionHelp', 'optionhelp', '?' ) ?>)</td><td><input type="text" name="newMonitor[Options]" value="<?= validHtmlStr($newMonitor['Options']) ?>" size="36"/></td></tr>
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php
|
|
|
|
}
|
|
|
|
?>
|
2011-05-05 17:52:00 +08:00
|
|
|
<tr><td><?= "Target Colorspace" ?></td><td><select name="newMonitor[Colours]"><?php foreach ( $Colours as $name => $value ) { ?><option value="<?= $value ?>"<?php if ( $value == $newMonitor['Colours'] ) { ?> selected="selected"<?php } ?>><?= $name ?></option><?php } ?></select></td></tr>
|
2008-09-26 17:47:20 +08:00
|
|
|
<tr><td><?= $SLANG['CaptureWidth'] ?> (<?= $SLANG['Pixels'] ?>)</td><td><input type="text" name="newMonitor[Width]" value="<?= validHtmlStr($newMonitor['Width']) ?>" size="4" onkeyup="updateMonitorDimensions(this);"/></td></tr>
|
|
|
|
<tr><td><?= $SLANG['CaptureHeight'] ?> (<?= $SLANG['Pixels'] ?>)</td><td><input type="text" name="newMonitor[Height]" value="<?= validHtmlStr($newMonitor['Height']) ?>" size="4" onkeyup="updateMonitorDimensions(this);"/></td></tr>
|
2008-07-14 21:54:50 +08:00
|
|
|
<tr><td><?= $SLANG['PreserveAspect'] ?></td><td><input type="checkbox" name="preserveAspectRatio" value="1"/></td></tr>
|
|
|
|
<tr><td><?= $SLANG['Orientation'] ?></td><td><select name="newMonitor[Orientation]"><?php foreach ( $orientations as $name => $value ) { ?><option value="<?= $value ?>"<?php if ( $value == $newMonitor['Orientation'] ) { ?> selected="selected"<?php } ?>><?= $name ?></option><?php } ?></select></td></tr>
|
2012-01-30 14:00:22 +08:00
|
|
|
<?php
|
|
|
|
if ( $newMonitor['Type'] == "Local" )
|
|
|
|
{
|
|
|
|
?>
|
|
|
|
<tr><td><?= "Deinterlacing" ?></td><td><select name="newMonitor[Deinterlacing]"><?php foreach ( $deinterlaceopts_v4l2 as $name => $value ) { ?><option value="<?= $value ?>"<?php if ( $value == $newMonitor['Deinterlacing'] ) { ?> selected="selected"<?php } ?>><?= $name ?></option><?php } ?></select></td></tr>
|
|
|
|
<?php
|
|
|
|
} else {
|
|
|
|
?>
|
2012-01-25 22:59:56 +08:00
|
|
|
<tr><td><?= "Deinterlacing" ?></td><td><select name="newMonitor[Deinterlacing]"><?php foreach ( $deinterlaceopts as $name => $value ) { ?><option value="<?= $value ?>"<?php if ( $value == $newMonitor['Deinterlacing'] ) { ?> selected="selected"<?php } ?>><?= $name ?></option><?php } ?></select></td></tr>
|
2012-01-30 14:00:22 +08:00
|
|
|
<?php
|
|
|
|
}
|
|
|
|
?>
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 'timestamp' :
|
|
|
|
{
|
|
|
|
?>
|
2008-09-26 17:47:20 +08:00
|
|
|
<tr><td><?= $SLANG['TimestampLabelFormat'] ?></td><td><input type="text" name="newMonitor[LabelFormat]" value="<?= validHtmlStr($newMonitor['LabelFormat']) ?>" size="32"/></td></tr>
|
|
|
|
<tr><td><?= $SLANG['TimestampLabelX'] ?></td><td><input type="text" name="newMonitor[LabelX]" value="<?= validHtmlStr($newMonitor['LabelX']) ?>" size="4"/></td></tr>
|
|
|
|
<tr><td><?= $SLANG['TimestampLabelY'] ?></td><td><input type="text" name="newMonitor[LabelY]" value="<?= validHtmlStr($newMonitor['LabelY']) ?>" size="4"/></td></tr>
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 'buffers' :
|
|
|
|
{
|
|
|
|
?>
|
2008-09-26 17:47:20 +08:00
|
|
|
<tr><td><?= $SLANG['ImageBufferSize'] ?></td><td><input type="text" name="newMonitor[ImageBufferCount]" value="<?= validHtmlStr($newMonitor['ImageBufferCount']) ?>" size="6"/></td></tr>
|
|
|
|
<tr><td><?= $SLANG['WarmupFrames'] ?></td><td><input type="text" name="newMonitor[WarmupCount]" value="<?= validHtmlStr($newMonitor['WarmupCount']) ?>" size="4"/></td></tr>
|
|
|
|
<tr><td><?= $SLANG['PreEventImageBuffer'] ?></td><td><input type="text" name="newMonitor[PreEventCount]" value="<?= validHtmlStr($newMonitor['PreEventCount']) ?>" size="4"/></td></tr>
|
|
|
|
<tr><td><?= $SLANG['PostEventImageBuffer'] ?></td><td><input type="text" name="newMonitor[PostEventCount]" value="<?= validHtmlStr($newMonitor['PostEventCount']) ?>" size="4"/></td></tr>
|
|
|
|
<tr><td><?= $SLANG['StreamReplayBuffer'] ?></td><td><input type="text" name="newMonitor[StreamReplayBuffer]" value="<?= validHtmlStr($newMonitor['StreamReplayBuffer']) ?>" size="6"/></td></tr>
|
|
|
|
<tr><td><?= $SLANG['AlarmFrameCount'] ?></td><td><input type="text" name="newMonitor[AlarmFrameCount]" value="<?= validHtmlStr($newMonitor['AlarmFrameCount']) ?>" size="4"/></td></tr>
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 'control' :
|
|
|
|
{
|
|
|
|
?>
|
2008-07-16 16:40:21 +08:00
|
|
|
<tr><td><?= $SLANG['Controllable'] ?></td><td><input type="checkbox" name="newMonitor[Controllable]" value="1"<?php if ( !empty($newMonitor['Controllable']) ) { ?> checked="checked"<?php } ?>/></td></tr>
|
2008-10-06 03:58:13 +08:00
|
|
|
<tr><td><?= $SLANG['ControlType'] ?></td><td><?= buildSelect( "newMonitor[ControlId]", $controlTypes, 'loadLocations( this )' ); ?><?php if ( canEdit( 'Control' ) ) { ?> <a href="#" onclick="createPopup( '?view=controlcaps', 'zmControlCaps', 'controlcaps' );"><?= $SLANG['Edit'] ?></a><?php } ?></td></tr>
|
2008-09-26 17:47:20 +08:00
|
|
|
<tr><td><?= $SLANG['ControlDevice'] ?></td><td><input type="text" name="newMonitor[ControlDevice]" value="<?= validHtmlStr($newMonitor['ControlDevice']) ?>" size="32"/></td></tr>
|
|
|
|
<tr><td><?= $SLANG['ControlAddress'] ?></td><td><input type="text" name="newMonitor[ControlAddress]" value="<?= validHtmlStr($newMonitor['ControlAddress']) ?>" size="32"/></td></tr>
|
|
|
|
<tr><td><?= $SLANG['AutoStopTimeout'] ?></td><td><input type="text" name="newMonitor[AutoStopTimeout]" value="<?= validHtmlStr($newMonitor['AutoStopTimeout']) ?>" size="4"/></td></tr>
|
2008-07-16 16:40:21 +08:00
|
|
|
<tr><td><?= $SLANG['TrackMotion'] ?></td><td><input type="checkbox" name="newMonitor[TrackMotion]" value="1"<?php if ( !empty($newMonitor['TrackMotion']) ) { ?> checked="checked"<?php } ?>/></td></tr>
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php
|
|
|
|
$return_options = array(
|
|
|
|
'-1' => $SLANG['None'],
|
|
|
|
'0' => $SLANG['Home'],
|
|
|
|
'1' => $SLANG['Preset']." 1",
|
|
|
|
);
|
|
|
|
?>
|
2008-09-26 17:47:20 +08:00
|
|
|
<tr><td><?= $SLANG['TrackDelay'] ?></td><td><input type="text" name="newMonitor[TrackDelay]" value="<?= validHtmlStr($newMonitor['TrackDelay']) ?>" size="4"/></td></tr>
|
2008-07-14 21:54:50 +08:00
|
|
|
<tr><td><?= $SLANG['ReturnLocation'] ?></td><td><?= buildSelect( "newMonitor[ReturnLocation]", $return_options ); ?></td></tr>
|
2008-09-26 17:47:20 +08:00
|
|
|
<tr><td><?= $SLANG['ReturnDelay'] ?></td><td><input type="text" name="newMonitor[ReturnDelay]" value="<?= validHtmlStr($newMonitor['ReturnDelay']) ?>" size="4"/></td></tr>
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 'x10' :
|
|
|
|
{
|
|
|
|
?>
|
2008-09-26 17:47:20 +08:00
|
|
|
<tr><td><?= $SLANG['X10ActivationString'] ?></td><td><input type="text" name="newX10Monitor[Activation]" value="<?= validHtmlStr($newX10Monitor['Activation']) ?>" size="20"/></td></tr>
|
|
|
|
<tr><td><?= $SLANG['X10InputAlarmString'] ?></td><td><input type="text" name="newX10Monitor[AlarmInput]" value="<?= validHtmlStr($newX10Monitor['AlarmInput']) ?>" size="20"/></td></tr>
|
|
|
|
<tr><td><?= $SLANG['X10OutputAlarmString'] ?></td><td><input type="text" name="newX10Monitor[AlarmOutput]" value="<?= validHtmlStr($newX10Monitor['AlarmOutput']) ?>" size="20"/></td></tr>
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 'misc' :
|
|
|
|
{
|
|
|
|
?>
|
2008-09-26 17:47:20 +08:00
|
|
|
<tr><td><?= $SLANG['EventPrefix'] ?></td><td><input type="text" name="newMonitor[EventPrefix]" value="<?= validHtmlStr($newMonitor['EventPrefix']) ?>" size="24"/></td></tr>
|
|
|
|
<tr><td><?= $SLANG['Sectionlength'] ?></td><td><input type="text" name="newMonitor[SectionLength]" value="<?= validHtmlStr($newMonitor['SectionLength']) ?>" size="6"/></td></tr>
|
|
|
|
<tr><td><?= $SLANG['FrameSkip'] ?></td><td><input type="text" name="newMonitor[FrameSkip]" value="<?= validHtmlStr($newMonitor['FrameSkip']) ?>" size="6"/></td></tr>
|
2014-04-10 19:56:14 +08:00
|
|
|
<tr><td><?= $SLANG['MotionFrameSkip'] ?></td><td><input type="text" name="newMonitor[MotionFrameSkip]" value="<?= validHtmlStr($newMonitor['MotionFrameSkip']) ?>" size="6"/></td></tr>
|
2008-09-26 17:47:20 +08:00
|
|
|
<tr><td><?= $SLANG['FPSReportInterval'] ?></td><td><input type="text" name="newMonitor[FPSReportInterval]" value="<?= validHtmlStr($newMonitor['FPSReportInterval']) ?>" size="6"/></td></tr>
|
2008-07-14 21:54:50 +08:00
|
|
|
<tr><td><?= $SLANG['DefaultView'] ?></td><td><select name="newMonitor[DefaultView]">
|
|
|
|
<?php
|
|
|
|
foreach ( getEnumValues( 'Monitors', 'DefaultView' ) as $opt_view )
|
|
|
|
{
|
|
|
|
if ( $opt_view == 'Control' && ( !ZM_OPT_CONTROL || !$monitor['Controllable'] ) )
|
|
|
|
continue;
|
|
|
|
?>
|
|
|
|
<option value="<?= $opt_view ?>"<?php if ( $opt_view == $newMonitor['DefaultView'] ) { ?> selected="selected"<?php } ?>><?= $opt_view ?></option>
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
</select></td></tr>
|
|
|
|
<tr><td><?= $SLANG['DefaultRate'] ?></td><td><?= buildSelect( "newMonitor[DefaultRate]", $rates ); ?></td></tr>
|
|
|
|
<tr><td><?= $SLANG['DefaultScale'] ?></td><td><?= buildSelect( "newMonitor[DefaultScale]", $scales ); ?></td></tr>
|
|
|
|
<?php
|
2011-02-16 05:59:06 +08:00
|
|
|
if ( ZM_HAS_V4L && $newMonitor['Type'] == "Local" )
|
2008-07-14 21:54:50 +08:00
|
|
|
{
|
|
|
|
?>
|
2008-09-26 17:47:20 +08:00
|
|
|
<tr><td><?= $SLANG['SignalCheckColour'] ?></td><td><input type="text" name="newMonitor[SignalCheckColour]" value="<?= validHtmlStr($newMonitor['SignalCheckColour']) ?>" size="10" onchange="$('SignalCheckSwatch').setStyle( 'backgroundColor', this.value )"/><span id="SignalCheckSwatch" class="swatch" style="background-color: <?= $newMonitor['SignalCheckColour'] ?>;"> </span></td></tr>
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php
|
|
|
|
}
|
|
|
|
?>
|
2008-09-26 17:47:20 +08:00
|
|
|
<tr><td><?= $SLANG['WebColour'] ?></td><td><input type="text" name="newMonitor[WebColour]" value="<?= validHtmlStr($newMonitor['WebColour']) ?>" size="10" onchange="$('WebSwatch').setStyle( 'backgroundColor', this.value )"/><span id="WebSwatch" class="swatch" style="background-color: <?= validHtmlStr($newMonitor['WebColour']) ?>;"> </span></td></tr>
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
<div id="contentButtons">
|
|
|
|
<input type="submit" value="<?= $SLANG['Save'] ?>"<?php if ( !canEdit( 'Monitors' ) ) { ?> disabled="disabled"<?php } ?>/><input type="button" value="<?= $SLANG['Cancel'] ?>" onclick="closeWindow()"/>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</body>
|
|
|
|
</html>
|