From 52b8f3e6e3050e35f10c2456a6173f47191ae049 Mon Sep 17 00:00:00 2001 From: stan Date: Fri, 21 Mar 2003 12:22:56 +0000 Subject: [PATCH] Added montage view and associated elements. git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@403 e3e1d417-86f3-4887-817a-d78f3d33393f --- web/zmconfig.php.z | 6 +- web/zmhtml.php | 244 ++++++++++++++++++++++++++++++++++++++++++++- zmconfig.pl.in | 7 ++ 3 files changed, 253 insertions(+), 4 deletions(-) diff --git a/web/zmconfig.php.z b/web/zmconfig.php.z index e7c74ccc3..ce417c08b 100644 --- a/web/zmconfig.php.z +++ b/web/zmconfig.php.z @@ -29,8 +29,8 @@ define( "ZM_DB_SERVER", "" ); // Database server define( "ZM_DB_NAME", "" ); // Database containing the tables define( "ZM_DB_USERA", "" ); // Database login define( "ZM_DB_PASSA", "" ); // Database password -define( "ZM_DIR_EVENTS", "" ); // Drectory where events live -define( "ZM_DIR_IMAGES", "" ); // Drectory where images live +define( "ZM_DIR_EVENTS", "" ); // Directory where events live +define( "ZM_DIR_IMAGES", "" ); // Directory where images live define( "ZM_DIR_SOUNDS", "" ); // Drectory where sounds live define( "ZM_OPT_CAMBOZOLA", "" ); // Is the (optional) cambozola java streaming client installed (recommended) define( "ZM_PATH_CAMBOZOLA", "" ); // Path to (optional) cambozola java streaming client (recommended) @@ -40,6 +40,7 @@ define( "ZM_PATH_NETPBM", "" ); // Path to (optional) Netpbm ut define( "ZM_WEB_POPUP_ON_ALARM", ); // Whether the watch window jumps to front if an alarm occurs define( "ZM_WEB_SOUND_ON_ALARM", ); // Whether the watch window jumps to front if an alarm occurs define( "ZM_WEB_ALARM_SOUND", ); // A sound to play on alarm, put this in the sounds directory +define( "ZM_WEB_MONTAGE_MAX_COLS", ); // The maximum number of Monitor columns in the montage view define( "ZM_OPT_FAST_DELETE", ); // Whether we only delete event DB records and leave zmaudit to do the rest define( "ZM_OPT_X10", ); // Whether we want to interface with X10 devices @@ -141,6 +142,7 @@ switch ( $bandwidth ) $jws = array( 'console' => array( 'w'=>720, 'h'=>400 ), 'cycle' => array( 'w'=>46, 'h'=>80 ), + 'montage' => array( 'w'=>20, 'h'=>20 ), 'monitor' => array( 'w'=>360, 'h'=>450 ), 'watch' => array( 'w'=>72, 'h'=>315 ), 'device' => array( 'w'=>196, 'h'=>164 ), diff --git a/web/zmhtml.php b/web/zmhtml.php index 22d9479d7..8a575ad7a 100644 --- a/web/zmhtml.php +++ b/web/zmhtml.php @@ -101,6 +101,8 @@ switch( $view ) $cycle_count++; } } + $montage_rows = intval(ceil(count($monitors)/ZM_WEB_MONTAGE_MAX_COLS)); + $montage_cols = count($monitors)>=ZM_WEB_MONTAGE_MAX_COLS?ZM_WEB_MONTAGE_MAX_COLS:count($monitors); ?> @@ -148,9 +150,20 @@ function confirmStatus( new_status ) - 1 ) { ?> + 1 ) + { +?> + Monitor (Montage) + Monitor - 1 ) { ?> + Configured for bandwidth (change to +=ZM_WEB_MONTAGE_MAX_COLS?ZM_WEB_MONTAGE_MAX_COLS:count($monitors); + $widths = array(); + $heights = array(); + for ( $i = 0; $i < count($monitors); $i++ ) + { + $monitor = $monitors[$i]; + $frame_height = $monitor[Height]+16; + $row = $i/ZM_WEB_MONTAGE_MAX_COLS; + $col = $i%ZM_WEB_MONTAGE_MAX_COLS; + if ( $frame_height > $heights[$row] ) + $heights[$row] = $frame_height; + if ( $monitor[Width] > $widths[$col] ) + $widths[$col] = $monitor[Width]; + } + $row_spec = join( ',', $heights ); + $col_spec = join( ',', $widths ); +?> + + +ZM - Montage + + + + + + + + + + + + + + +ZM - Montage Header + + + + + +
+ + + + + +ZM - <?= $monitor[Name] ?> - MontageFeed + + + + + + + + + + + + + + + + + + + + + +
StillsStream 
+ + + 0 && $last_status == 0 ); + $old_alarm = ( $status == 0 && $last_status > 0 ); + + $refresh = (isset($force)||$forced||$status)?1:REFRESH_STATUS; + $url = "$PHP_SELF?view=montagestatus&mid=$mid&last_status=$status"; + header("Refresh: $refresh; URL='$url'" ); + header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past + header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // always modified + header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1 + header("Cache-Control: post-check=0, pre-check=0", false); + header("Pragma: no-cache"); // HTTP/1.0 +?> + + + + + + + + + + + + +
 Status:  -  fps 
+ + + + + $types{file}, requires => [ { name => "ZM_WEB_SOUND_ON_ALARM", value => "yes" } ], }, + { + name => "ZM_WEB_MONTAGE_MAX_COLS", + default => "2", + description => "The maximum number of monitor columns in the montage view", + help => "The 'montage' view shows images from all your monitors at once. This parameter defines how many monitors to place across your screen before moving to the next row. If you have a very wide screen and/or small images from your cameras this can be a bigger value however if not, of if you prefer the images stacked vertically it should be small.", + type => $types{integer}, + }, { name => "ZM_OPT_FAST_DELETE", default => "yes",