Bug 240 - Added monitor presets.
git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@1749 e3e1d417-86f3-4887-817a-d78f3d33393f
This commit is contained in:
parent
b46ab50467
commit
96b94c1737
|
@ -46,6 +46,7 @@ web_DATA = \
|
|||
zm_html_view_groups.php \
|
||||
zm_html_view_logout.php \
|
||||
zm_html_view_monitor.php \
|
||||
zm_html_view_monitorpreset.php \
|
||||
zm_html_view_montagefeed.php \
|
||||
zm_html_view_montageframe.php \
|
||||
zm_html_view_montagemenu.php \
|
||||
|
@ -144,6 +145,7 @@ EXTRA_DIST = \
|
|||
zm_html_view_login.php \
|
||||
zm_html_view_logout.php \
|
||||
zm_html_view_monitor.php \
|
||||
zm_html_view_monitorpreset.php \
|
||||
zm_html_view_montagefeed.php \
|
||||
zm_html_view_montageframe.php \
|
||||
zm_html_view_montage.php \
|
||||
|
|
|
@ -168,6 +168,7 @@ $jws = array(
|
|||
'login' => array( 'w'=>720, 'h'=>480 ),
|
||||
'logout' => array( 'w'=>200, 'h'=>100 ),
|
||||
'monitor' => array( 'w'=>360, 'h'=>324 ),
|
||||
'monitorpreset' => array( 'w'=>400, 'h'=>200 ),
|
||||
'montage' => array( 'w'=>10, 'h'=>20 ),
|
||||
'optionhelp' => array( 'w'=>320, 'h'=>284 ),
|
||||
'options' => array( 'w'=>780, 'h'=>540 ),
|
||||
|
|
|
@ -162,6 +162,7 @@ switch( $view )
|
|||
case "frames" :
|
||||
case "stats" :
|
||||
case "monitor" :
|
||||
case "monitorpreset" :
|
||||
case "zones" :
|
||||
case "zone" :
|
||||
case "video" :
|
||||
|
|
|
@ -92,7 +92,7 @@ else
|
|||
$monitor['SectionLength'] = 600;
|
||||
$monitor['FrameSkip'] = 0;
|
||||
$monitor['EventPrefix'] = 'Event-';
|
||||
$monitor['MaxFPS'] = 0;
|
||||
$monitor['MaxFPS'] = "";
|
||||
$monitor['FPSReportInterval'] = 1000;
|
||||
$monitor['RefBlendPerc'] = 7;
|
||||
$monitor['DefaultRate'] = '100';
|
||||
|
@ -106,6 +106,21 @@ if ( !isset( $new_monitor ) )
|
|||
$new_monitor['Triggers'] = split( ',', isset($monitor['Triggers'])?$monitor['Triggers']:"" );
|
||||
$new_x10_monitor = isset($x10_monitor)?$x10_monitor:array();
|
||||
}
|
||||
if ( !empty($preset) )
|
||||
{
|
||||
$result = mysql_query( "select Type, Device, Channel, Format, Host, Port, Path, Width, Height, Palette, MaxFPS, Controllable, ControlId, ControlDevice, ControlAddress, DefaultRate, DefaultScale from MonitorPresets where Id = '$preset'" );
|
||||
if ( !$result )
|
||||
die( mysql_error() );
|
||||
$preset = mysql_fetch_assoc( $result );
|
||||
foreach ( $preset as $name=>$value )
|
||||
{
|
||||
if ( isset($value) )
|
||||
{
|
||||
$new_monitor[$name] = $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$local_palettes = array( $zmSlangGrey=>1, "RGB24"=>4, "RGB565"=>3, "RGB555"=>6, "YUV422"=>7, "YUYV"=>8, "YUV422P"=>13, "YUV420P"=>15 );
|
||||
$remote_palettes = $file_palettes = array( $zmSlang8BitGrey=>1, $zmSlang24BitColour=>4 );
|
||||
$orientations = array( $zmSlangNormal=>'0', $zmSlangRotateRight=>'90', $zmSlangInverted=>'180', $zmSlangRotateLeft=>'270', $zmSlangFlippedHori=>'hori', $zmSlangFlippedVert=>'vert' );
|
||||
|
@ -221,6 +236,7 @@ function loadLocations( Form )
|
|||
<table border="0" cellspacing="0" cellpadding="0" width="100%">
|
||||
<tr>
|
||||
<td align="left" class="head"><?= $zmSlangMonitor ?> - <?= $monitor['Name'] ?></td>
|
||||
<td align="right" valign="bottom" class="text"><?= makeLink( "javascript: newWindow( '$PHP_SELF?view=monitorpreset&mid=$mid', 'zmMonitorPreset<?= $mid ?>', ".$jws['monitorpreset']['w'].", ".$jws['monitorpreset']['h']." );", $zmSlangPresets, canEdit( 'Monitors' ) ) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
|
@ -504,10 +520,10 @@ switch ( $tab )
|
|||
}
|
||||
?>
|
||||
<tr><td colspan="2" align="left" class="text"> </td></tr>
|
||||
<tr>
|
||||
<tr style="height: 100%; vertical-align: bottom;">
|
||||
<td colspan="2" align="right"><input type="submit" value="<?= $zmSlangSave ?>" class="form"<?php if ( !canEdit( 'Monitors' ) ) { ?> disabled<?php } ?>> <input type="button" value="<?= $zmSlangCancel ?>" class="form" onClick="closeWindow()"></td>
|
||||
</tr>
|
||||
</form>
|
||||
</table>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -0,0 +1,81 @@
|
|||
<?php
|
||||
//
|
||||
// ZoneMinder web monitor preset view file, $Date$, $Revision$
|
||||
// Copyright (C) 2003, 2004, 2005 Philip Coombes
|
||||
//
|
||||
// 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 ( !canEdit( 'Monitors' ) )
|
||||
{
|
||||
$view = "error";
|
||||
return;
|
||||
}
|
||||
$result = mysql_query( "select Id,Name from MonitorPresets" );
|
||||
if ( !$result )
|
||||
die( mysql_error() );
|
||||
$presets = array();
|
||||
$presets[0] = $zmSlangChoosePreset;
|
||||
while ( $preset = mysql_fetch_assoc( $result ) )
|
||||
{
|
||||
$presets[$preset['Id']] = $preset['Name'];
|
||||
}
|
||||
|
||||
?>
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<title><?= ZM_WEB_TITLE_PREFIX ?> - <?= $zmSlangMonitorPreset ?></title>
|
||||
<link rel="stylesheet" href="zm_html_styles.css" type="text/css">
|
||||
<script type="text/javascript">
|
||||
window.focus();
|
||||
function submitPreset()
|
||||
{
|
||||
document.presetForm.target = opener.name;
|
||||
document.presetForm.view.value = 'monitor';
|
||||
document.presetForm.submit();
|
||||
window.setTimeout( 'window.close()', 250 );
|
||||
}
|
||||
function configureButtons()
|
||||
{
|
||||
document.presetForm.saveBtn.disabled = (document.presetForm.preset.selectedIndex==0);
|
||||
}
|
||||
function closeWindow()
|
||||
{
|
||||
window.close();
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<form name="presetForm" method="get" action="<?= $PHP_SELF ?>">
|
||||
<input type="hidden" name="view" value="none">
|
||||
<input type="hidden" name="mid" value="<?= $mid ?>">
|
||||
<table border="0" cellspacing="0" cellpadding="4" width="100%">
|
||||
<tr>
|
||||
<td align="center" class="head"><?= $zmSlangMonitorPreset ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center" class="text"><?= $zmSlangMonitorPresetIntro ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center" class="text"><?= $zmSlangPreset ?>: <?= buildSelect( "preset", $presets, 'configureButtons()' ); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right"><input type="submit" name="saveBtn" value="<?= $zmSlangSave ?>" class="form" onClick="submitPreset()" disabled> <input type="button" value="<?= $zmSlangCancel ?>" class="form" onClick="closeWindow()"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
|
@ -396,6 +396,8 @@ $zmSlangMinZoomStep = 'Min Zoom Step';
|
|||
$zmSlangMisc = 'Misc';
|
||||
$zmSlangMonitorIds = 'Monitor Ids';
|
||||
$zmSlangMonitor = 'Monitor';
|
||||
$zmSlangMonitorPreset = 'Monitor Preset';
|
||||
$zmSlangMonitorPresetIntro = 'Select an appropriate preset from the list below.<br><br>Please note that this may overwrite any values you already have configured for this monitor.<br><br>';
|
||||
$zmSlangMonitors = 'Monitors';
|
||||
$zmSlangMontage = 'Montage';
|
||||
$zmSlangMonth = 'Month';
|
||||
|
|
Loading…
Reference in New Issue