Bug 211 - Added default rate for event replay.

git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@1616 e3e1d417-86f3-4887-817a-d78f3d33393f
This commit is contained in:
stan 2005-11-22 11:21:27 +00:00
parent 02f3ea1ac5
commit 5c38d0be38
10 changed files with 32 additions and 22 deletions

View File

@ -28,4 +28,5 @@ EXTRA_DIST = \
zmalter-1.21.0.sql \ zmalter-1.21.0.sql \
zmalter-1.21.1.sql \ zmalter-1.21.1.sql \
zmalter-1.21.2.sql \ zmalter-1.21.2.sql \
zmalter-1.21.3.sql zmalter-1.21.3.sql \
zmalter-1.21.4.sql

14
db/zmalter-1.21.4.sql Normal file
View File

@ -0,0 +1,14 @@
--
-- This updates a 1.21.3 database to 1.21.4
--
alter table Monitors add column DefaultRate smallint unsigned not null default 100 after ReturnDelay;
alter table Monitors modify column DefaultRate smallint unsigned not null default 100;
--
-- These are optional, but we might as well do it now
--
optimize table Frames;
optimize table Events;
optimize table Filters;
optimize table Zones;
optimize table Monitors;
optimize table Stats;

View File

@ -265,6 +265,7 @@ CREATE TABLE Monitors (
TrackDelay smallint(5) unsigned NOT NULL default '0', TrackDelay smallint(5) unsigned NOT NULL default '0',
ReturnLocation tinyint(3) NOT NULL default '-1', ReturnLocation tinyint(3) NOT NULL default '-1',
ReturnDelay smallint(5) unsigned NOT NULL default '0', ReturnDelay smallint(5) unsigned NOT NULL default '0',
DefaultRate smallint(5) unsigned NOT NULL default '100',
DefaultScale smallint(5) unsigned NOT NULL default '100', DefaultScale smallint(5) unsigned NOT NULL default '100',
WebColour varchar(32) NOT NULL default 'red', WebColour varchar(32) NOT NULL default 'red',
Sequence smallint(5) unsigned default NULL, Sequence smallint(5) unsigned default NULL,

View File

@ -122,8 +122,7 @@ switch ( $bandwidth )
} }
case "mobile" : // Very incomplete at present case "mobile" : // Very incomplete at present
{ {
define( "ZM_WEB_REFRESH_MAIN", ZM_WEB_P_REFRESH_MAIN ); // How often (in seconds) the main console window refreshes define( "ZM_WEB_DEFAULT_RATE", ZM_WEB_P_DEFAULT_RATE ); // What the default replay rate factor applied to 'event' views is (%)
define( "ZM_WEB_REFRESH_IMAGE", ZM_WEB_P_REFRESH_IMAGE ); // How often the watched image is refreshed (if not streaming)
break; break;
} }
} }

View File

@ -40,7 +40,7 @@ else
$mid_sql = ''; $mid_sql = '';
} }
$sql = "select E.*,M.Name as MonitorName,M.Width,M.Height,M.DefaultScale from Events as E inner join Monitors as M on E.MonitorId = M.Id where E.Id = '$eid'$mid_sql"; $sql = "select E.*,M.Name as MonitorName,M.Width,M.Height,M.DefaultRate,M.DefaultScale from Events as E inner join Monitors as M on E.MonitorId = M.Id where E.Id = '$eid'$mid_sql";
$result = mysql_query( $sql ); $result = mysql_query( $sql );
if ( !$result ) if ( !$result )
die( mysql_error() ); die( mysql_error() );
@ -76,7 +76,7 @@ while ( $row = mysql_fetch_assoc( $result ) )
} }
if ( !isset( $rate ) ) if ( !isset( $rate ) )
$rate = ZM_WEB_DEFAULT_RATE; $rate = reScale( RATE_SCALE, $event['DefaultRate'], ZM_WEB_DEFAULT_RATE );
if ( !isset( $scale ) ) if ( !isset( $scale ) )
$scale = reScale( SCALE_SCALE, $event['DefaultScale'], ZM_WEB_DEFAULT_SCALE ); $scale = reScale( SCALE_SCALE, $event['DefaultScale'], ZM_WEB_DEFAULT_SCALE );

View File

@ -95,6 +95,7 @@ else
$monitor['MaxFPS'] = 0; $monitor['MaxFPS'] = 0;
$monitor['FPSReportInterval'] = 1000; $monitor['FPSReportInterval'] = 1000;
$monitor['RefBlendPerc'] = 10; $monitor['RefBlendPerc'] = 10;
$monitor['DefaultRate'] = '100';
$monitor['DefaultScale'] = '100'; $monitor['DefaultScale'] = '100';
$monitor['WebColour'] = 'red'; $monitor['WebColour'] = 'red';
$monitor['Triggers'] = ""; $monitor['Triggers'] = "";
@ -328,6 +329,7 @@ if ( $tab != 'misc' )
<input type="hidden" name="new_monitor[MaxFPS]" value="<?= $new_monitor['MaxFPS'] ?>"> <input type="hidden" name="new_monitor[MaxFPS]" value="<?= $new_monitor['MaxFPS'] ?>">
<input type="hidden" name="new_monitor[FPSReportInterval]" value="<?= $new_monitor['FPSReportInterval'] ?>"> <input type="hidden" name="new_monitor[FPSReportInterval]" value="<?= $new_monitor['FPSReportInterval'] ?>">
<input type="hidden" name="new_monitor[RefBlendPerc]" value="<?= $new_monitor['RefBlendPerc'] ?>"> <input type="hidden" name="new_monitor[RefBlendPerc]" value="<?= $new_monitor['RefBlendPerc'] ?>">
<input type="hidden" name="new_monitor[DefaultRate]" value="<?= $new_monitor['DefaultRate'] ?>">
<input type="hidden" name="new_monitor[DefaultScale]" value="<?= $new_monitor['DefaultScale'] ?>"> <input type="hidden" name="new_monitor[DefaultScale]" value="<?= $new_monitor['DefaultScale'] ?>">
<input type="hidden" name="new_monitor[WebColour]" value="<?= $new_monitor['WebColour'] ?>"> <input type="hidden" name="new_monitor[WebColour]" value="<?= $new_monitor['WebColour'] ?>">
<?php <?php
@ -493,6 +495,7 @@ switch ( $tab )
<tr><td align="left" class="text"><?= $zmSlangMaximumFPS ?></td><td align="left" class="text"><input type="text" name="new_monitor[MaxFPS]" value="<?= $new_monitor['MaxFPS'] ?>" size="6" class="form"></td></tr> <tr><td align="left" class="text"><?= $zmSlangMaximumFPS ?></td><td align="left" class="text"><input type="text" name="new_monitor[MaxFPS]" value="<?= $new_monitor['MaxFPS'] ?>" size="6" class="form"></td></tr>
<tr><td align="left" class="text"><?= $zmSlangFPSReportInterval ?></td><td align="left" class="text"><input type="text" name="new_monitor[FPSReportInterval]" value="<?= $new_monitor['FPSReportInterval'] ?>" size="6" class="form"></td></tr> <tr><td align="left" class="text"><?= $zmSlangFPSReportInterval ?></td><td align="left" class="text"><input type="text" name="new_monitor[FPSReportInterval]" value="<?= $new_monitor['FPSReportInterval'] ?>" size="6" class="form"></td></tr>
<tr><td align="left" class="text"><?= $zmSlangRefImageBlendPct ?></td><td align="left" class="text"><input type="text" name="new_monitor[RefBlendPerc]" value="<?= $new_monitor['RefBlendPerc'] ?>" size="4" class="form"></td></tr> <tr><td align="left" class="text"><?= $zmSlangRefImageBlendPct ?></td><td align="left" class="text"><input type="text" name="new_monitor[RefBlendPerc]" value="<?= $new_monitor['RefBlendPerc'] ?>" size="4" class="form"></td></tr>
<tr><td align="left" class="text"><?= $zmSlangDefaultRate ?></td><td align="left" class="text"><?= buildSelect( "new_monitor[DefaultRate]", $rates ); ?></td></tr>
<tr><td align="left" class="text"><?= $zmSlangDefaultScale ?></td><td align="left" class="text"><?= buildSelect( "new_monitor[DefaultScale]", $scales ); ?></td></tr> <tr><td align="left" class="text"><?= $zmSlangDefaultScale ?></td><td align="left" class="text"><?= buildSelect( "new_monitor[DefaultScale]", $scales ); ?></td></tr>
<tr><td align="left" class="text"><?= $zmSlangWebColour ?></td><td align="left" class="text"><input type="text" name="new_monitor[WebColour]" value="<?= $new_monitor['WebColour'] ?>" size="10" class="form" onChange="document.getElementById('Swatch').style.backgroundColor=this.value">&nbsp;&nbsp;<span id="Swatch" style="background-color: <?= $new_monitor['WebColour'] ?>; border: 1px solid black; width: 20px; height: 10px; padding: 0px;">&nbsp;&nbsp;&nbsp;&nbsp;</span></td></tr> <tr><td align="left" class="text"><?= $zmSlangWebColour ?></td><td align="left" class="text"><input type="text" name="new_monitor[WebColour]" value="<?= $new_monitor['WebColour'] ?>" size="10" class="form" onChange="document.getElementById('Swatch').style.backgroundColor=this.value">&nbsp;&nbsp;<span id="Swatch" style="background-color: <?= $new_monitor['WebColour'] ?>; border: 1px solid black; width: 20px; height: 10px; padding: 0px;">&nbsp;&nbsp;&nbsp;&nbsp;</span></td></tr>
<?php <?php

View File

@ -32,14 +32,14 @@ else
{ {
$mid_sql = ''; $mid_sql = '';
} }
$sql = "select E.*,M.Name as MonitorName,M.Width,M.Height,M.DefaultScale from Events as E inner join Monitors as M on E.MonitorId = M.Id where E.Id = '$eid'$mid_sql"; $sql = "select E.*,M.Name as MonitorName,M.Width,M.Height,M.DefaultRate,M.DefaultScale from Events as E inner join Monitors as M on E.MonitorId = M.Id where E.Id = '$eid'$mid_sql";
$result = mysql_query( $sql ); $result = mysql_query( $sql );
if ( !$result ) if ( !$result )
die( mysql_error() ); die( mysql_error() );
$event = mysql_fetch_assoc( $result ); $event = mysql_fetch_assoc( $result );
if ( !isset( $rate ) ) if ( !isset( $rate ) )
$rate = ZM_WEB_DEFAULT_RATE; $rate = reScale( RATE_SCALE, $event['DefaultRate'], ZM_WEB_DEFAULT_RATE );
if ( !isset( $scale ) ) if ( !isset( $scale ) )
$scale = reScale( SCALE_SCALE, $event['DefaultScale'], ZM_WEB_DEFAULT_SCALE ); $scale = reScale( SCALE_SCALE, $event['DefaultScale'], ZM_WEB_DEFAULT_SCALE );

View File

@ -195,6 +195,7 @@ $zmSlangControlType = 'Control Type';
$zmSlangCycle = 'Cycle'; $zmSlangCycle = 'Cycle';
$zmSlangCycleWatch = 'Cycle Watch'; $zmSlangCycleWatch = 'Cycle Watch';
$zmSlangDay = 'Day'; $zmSlangDay = 'Day';
$zmSlangDefaultRate = 'Default Rate';
$zmSlangDefaultScale = 'Default Scale'; $zmSlangDefaultScale = 'Default Scale';
$zmSlangDeleteAndNext = 'Delete &amp; Next'; $zmSlangDeleteAndNext = 'Delete &amp; Next';
$zmSlangDeleteAndPrev = 'Delete &amp; Prev'; $zmSlangDeleteAndPrev = 'Delete &amp; Prev';

View File

@ -32,7 +32,7 @@ else
{ {
$mid_sql = ''; $mid_sql = '';
} }
$sql = "select E.*,M.Name as MonitorName,M.Width,M.Height,M.DefaultScale from Events as E inner join Monitors as M on E.MonitorId = M.Id where E.Id = '$eid'$mid_sql"; $sql = "select E.*,M.Name as MonitorName,M.Width,M.Height,M.DefaultRate from Events as E inner join Monitors as M on E.MonitorId = M.Id where E.Id = '$eid'$mid_sql";
$result = mysql_query( $sql ); $result = mysql_query( $sql );
if ( !$result ) if ( !$result )
die( mysql_error() ); die( mysql_error() );
@ -61,7 +61,7 @@ else
} }
if ( !isset( $rate ) ) if ( !isset( $rate ) )
$rate = RATE_SCALE; $rate = reScale( RATE_SCALE, $event['DefaultRate'], ZM_WEB_DEFAULT_RATE );
$event_dir = ZM_DIR_EVENTS."/".$event['MonitorId']."/".sprintf( "%d", $eid ); $event_dir = ZM_DIR_EVENTS."/".$event['MonitorId']."/".sprintf( "%d", $eid );

View File

@ -1486,19 +1486,10 @@ my @options =
category => 'lowband', category => 'lowband',
}, },
{ {
name => "ZM_WEB_P_REFRESH_MAIN", name => "ZM_WEB_P_DEFAULT_RATE",
default => "300", default => "100",
description => "How often (in seconds) the main console window should refresh itself", description => "What the default replay rate factor applied to 'event' views is (%)",
introduction => "The next few options control what happens when the WAP client is being accessed over a mobile phone link. You should set these options for when accessing the ZoneMinder WAP client over a mobile dialup or GPRS link. In most cases the default values will be suitable as a starting point.", help => "Normally ZoneMinder will display 'event' streams at their native rate, i.e. as close to real-time as possible. However if you have long events it is often convenient to replay them at a faster rate for review. This option lets you specify what the default replay rate will be. It is expressed as a percentage so 100 is normal rate, 200 is double speed etc.",
help => "The main console window lists a general status and the event totals for all monitors. This is not a trivial task and should not be repeated too frequently or it may affect the performance of the rest of the system.",
type => $types{integer},
category => 'phoneband',
},
{
name => "ZM_WEB_P_REFRESH_IMAGE",
default => "30",
description => "How often (in seconds) the watched image is refreshed",
help => "The live images from a monitor are viewed as a sequence of still images. This option determines how the image is refreshed. Though the images are small setting this at too frequent a value may rapidly consume a lot of bandwidth resource.",
type => $types{integer}, type => $types{integer},
category => 'phoneband', category => 'phoneband',
}, },