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:
stan 2005-12-31 18:08:07 +00:00
parent b46ab50467
commit 96b94c1737
6 changed files with 106 additions and 3 deletions

View File

@ -46,6 +46,7 @@ web_DATA = \
zm_html_view_groups.php \ zm_html_view_groups.php \
zm_html_view_logout.php \ zm_html_view_logout.php \
zm_html_view_monitor.php \ zm_html_view_monitor.php \
zm_html_view_monitorpreset.php \
zm_html_view_montagefeed.php \ zm_html_view_montagefeed.php \
zm_html_view_montageframe.php \ zm_html_view_montageframe.php \
zm_html_view_montagemenu.php \ zm_html_view_montagemenu.php \
@ -144,6 +145,7 @@ EXTRA_DIST = \
zm_html_view_login.php \ zm_html_view_login.php \
zm_html_view_logout.php \ zm_html_view_logout.php \
zm_html_view_monitor.php \ zm_html_view_monitor.php \
zm_html_view_monitorpreset.php \
zm_html_view_montagefeed.php \ zm_html_view_montagefeed.php \
zm_html_view_montageframe.php \ zm_html_view_montageframe.php \
zm_html_view_montage.php \ zm_html_view_montage.php \

View File

@ -168,6 +168,7 @@ $jws = array(
'login' => array( 'w'=>720, 'h'=>480 ), 'login' => array( 'w'=>720, 'h'=>480 ),
'logout' => array( 'w'=>200, 'h'=>100 ), 'logout' => array( 'w'=>200, 'h'=>100 ),
'monitor' => array( 'w'=>360, 'h'=>324 ), 'monitor' => array( 'w'=>360, 'h'=>324 ),
'monitorpreset' => array( 'w'=>400, 'h'=>200 ),
'montage' => array( 'w'=>10, 'h'=>20 ), 'montage' => array( 'w'=>10, 'h'=>20 ),
'optionhelp' => array( 'w'=>320, 'h'=>284 ), 'optionhelp' => array( 'w'=>320, 'h'=>284 ),
'options' => array( 'w'=>780, 'h'=>540 ), 'options' => array( 'w'=>780, 'h'=>540 ),

View File

@ -162,6 +162,7 @@ switch( $view )
case "frames" : case "frames" :
case "stats" : case "stats" :
case "monitor" : case "monitor" :
case "monitorpreset" :
case "zones" : case "zones" :
case "zone" : case "zone" :
case "video" : case "video" :

View File

@ -92,7 +92,7 @@ else
$monitor['SectionLength'] = 600; $monitor['SectionLength'] = 600;
$monitor['FrameSkip'] = 0; $monitor['FrameSkip'] = 0;
$monitor['EventPrefix'] = 'Event-'; $monitor['EventPrefix'] = 'Event-';
$monitor['MaxFPS'] = 0; $monitor['MaxFPS'] = "";
$monitor['FPSReportInterval'] = 1000; $monitor['FPSReportInterval'] = 1000;
$monitor['RefBlendPerc'] = 7; $monitor['RefBlendPerc'] = 7;
$monitor['DefaultRate'] = '100'; $monitor['DefaultRate'] = '100';
@ -106,6 +106,21 @@ if ( !isset( $new_monitor ) )
$new_monitor['Triggers'] = split( ',', isset($monitor['Triggers'])?$monitor['Triggers']:"" ); $new_monitor['Triggers'] = split( ',', isset($monitor['Triggers'])?$monitor['Triggers']:"" );
$new_x10_monitor = isset($x10_monitor)?$x10_monitor:array(); $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 ); $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 ); $remote_palettes = $file_palettes = array( $zmSlang8BitGrey=>1, $zmSlang24BitColour=>4 );
$orientations = array( $zmSlangNormal=>'0', $zmSlangRotateRight=>'90', $zmSlangInverted=>'180', $zmSlangRotateLeft=>'270', $zmSlangFlippedHori=>'hori', $zmSlangFlippedVert=>'vert' ); $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%"> <table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr> <tr>
<td align="left" class="head"><?= $zmSlangMonitor ?> - <?= $monitor['Name'] ?></td> <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>
<tr> <tr>
<td>&nbsp;</td> <td>&nbsp;</td>
@ -504,10 +520,10 @@ switch ( $tab )
} }
?> ?>
<tr><td colspan="2" align="left" class="text">&nbsp;</td></tr> <tr><td colspan="2" align="left" class="text">&nbsp;</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 } ?>>&nbsp;&nbsp;<input type="button" value="<?= $zmSlangCancel ?>" class="form" onClick="closeWindow()"></td> <td colspan="2" align="right"><input type="submit" value="<?= $zmSlangSave ?>" class="form"<?php if ( !canEdit( 'Monitors' ) ) { ?> disabled<?php } ?>>&nbsp;&nbsp;<input type="button" value="<?= $zmSlangCancel ?>" class="form" onClick="closeWindow()"></td>
</tr> </tr>
</form>
</table> </table>
</form>
</body> </body>
</html> </html>

View File

@ -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 ?>:&nbsp;<?= buildSelect( "preset", $presets, 'configureButtons()' ); ?></td>
</tr>
<tr>
<td align="right"><input type="submit" name="saveBtn" value="<?= $zmSlangSave ?>" class="form" onClick="submitPreset()" disabled>&nbsp;<input type="button" value="<?= $zmSlangCancel ?>" class="form" onClick="closeWindow()"></td>
</tr>
</table>
</form>
</body>
</html>

View File

@ -396,6 +396,8 @@ $zmSlangMinZoomStep = 'Min Zoom Step';
$zmSlangMisc = 'Misc'; $zmSlangMisc = 'Misc';
$zmSlangMonitorIds = 'Monitor&nbsp;Ids'; $zmSlangMonitorIds = 'Monitor&nbsp;Ids';
$zmSlangMonitor = 'Monitor'; $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'; $zmSlangMonitors = 'Monitors';
$zmSlangMontage = 'Montage'; $zmSlangMontage = 'Montage';
$zmSlangMonth = 'Month'; $zmSlangMonth = 'Month';