From 96b94c17373b7eebbce94bbeed9e2215bc324dfa Mon Sep 17 00:00:00 2001 From: stan Date: Sat, 31 Dec 2005 18:08:07 +0000 Subject: [PATCH] Bug 240 - Added monitor presets. git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@1749 e3e1d417-86f3-4887-817a-d78f3d33393f --- web/Makefile.am | 2 + web/zm_config.php.in | 1 + web/zm_html.php | 1 + web/zm_html_view_monitor.php | 22 ++++++-- web/zm_html_view_monitorpreset.php | 81 ++++++++++++++++++++++++++++++ web/zm_lang_en_gb.php | 2 + 6 files changed, 106 insertions(+), 3 deletions(-) create mode 100644 web/zm_html_view_monitorpreset.php diff --git a/web/Makefile.am b/web/Makefile.am index 6c5c9a517..dabeb6b4d 100644 --- a/web/Makefile.am +++ b/web/Makefile.am @@ -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 \ diff --git a/web/zm_config.php.in b/web/zm_config.php.in index 9a084e016..83596c1ed 100644 --- a/web/zm_config.php.in +++ b/web/zm_config.php.in @@ -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 ), diff --git a/web/zm_html.php b/web/zm_html.php index 8cd4ffb17..a19fa6b23 100644 --- a/web/zm_html.php +++ b/web/zm_html.php @@ -162,6 +162,7 @@ switch( $view ) case "frames" : case "stats" : case "monitor" : + case "monitorpreset" : case "zones" : case "zone" : case "video" : diff --git a/web/zm_html_view_monitor.php b/web/zm_html_view_monitor.php index 8952cb09b..a954f9ebc 100644 --- a/web/zm_html_view_monitor.php +++ b/web/zm_html_view_monitor.php @@ -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 ) + @@ -504,10 +520,10 @@ switch ( $tab ) } ?> - + -
- ', ".$jws['monitorpreset']['w'].", ".$jws['monitorpreset']['h']." );", $zmSlangPresets, canEdit( 'Monitors' ) ) ?>
 
 
disabled>  
+ diff --git a/web/zm_html_view_monitorpreset.php b/web/zm_html_view_monitorpreset.php new file mode 100644 index 000000000..c14be9d56 --- /dev/null +++ b/web/zm_html_view_monitorpreset.php @@ -0,0 +1,81 @@ + + + + +<?= ZM_WEB_TITLE_PREFIX ?> - <?= $zmSlangMonitorPreset ?> + + + + +
+ + + + + + + + + + + + + + + +
 
+
+ + diff --git a/web/zm_lang_en_gb.php b/web/zm_lang_en_gb.php index 6749aaf1d..54447c6ac 100644 --- a/web/zm_lang_en_gb.php +++ b/web/zm_lang_en_gb.php @@ -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.

Please note that this may overwrite any values you already have configured for this monitor.

'; $zmSlangMonitors = 'Monitors'; $zmSlangMontage = 'Montage'; $zmSlangMonth = 'Month';