Bug 209 - Optional prevent ongoing alarms from keeping events open.

git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@1608 e3e1d417-86f3-4887-817a-d78f3d33393f
This commit is contained in:
stan 2005-11-21 12:18:36 +00:00
parent c345eb0706
commit 76252c4831
2 changed files with 23 additions and 8 deletions

View File

@ -689,21 +689,28 @@ bool Monitor::Analyse()
{ {
if ( event ) if ( event )
{ {
if ( state == IDLE || state == TAPE ) int section_mod = timestamp->tv_sec%section_length;
if ( section_mod < last_section_mod )
{ {
int section_mod = timestamp->tv_sec%section_length; if ( state == IDLE || state == TAPE || config.force_close_events )
if ( section_mod < last_section_mod )
{ {
Info(( "Ended event" )); if ( state == IDLE || state == TAPE )
{
Info(( "Ended event" ));
}
else
{
Info(( "Force closed event" ));
}
gettimeofday( &(event->EndTime()), &dummy_tz ); gettimeofday( &(event->EndTime()), &dummy_tz );
delete event; delete event;
event = 0; event = 0;
last_section_mod = 0; last_section_mod = 0;
} }
else }
{ else
last_section_mod = section_mod; {
} last_section_mod = section_mod;
} }
} }
if ( !event ) if ( !event )

View File

@ -1108,6 +1108,14 @@ my @options =
type => { db_type=>'string', hint=>'asc|desc', pattern=>qr|^([ad])|i, format=>q( $1 =~ /^a/i ? 'asc' : 'desc' ) }, type => { db_type=>'string', hint=>'asc|desc', pattern=>qr|^([ad])|i, format=>q( $1 =~ /^a/i ? 'asc' : 'desc' ) },
category => 'system', category => 'system',
}, },
{
name => "ZM_FORCE_CLOSE_EVENTS",
default => "no",
description => "Whether events are closed at section ends.",
help => "When a monitor is running in a continuous recording moe (Record or Mocord) events are usually closed after a fixed period of time (the section length). However in Mocord mode it is possible that motion detection may occur near the end of a section and ordinarily this will prevent the event being closed until the motion has ceased. Switching this option on will force the event closed at the specified time regardless of any motion activity.",
type => $types{boolean},
category => 'system',
},
{ {
name => "ZM_CHECK_FOR_UPDATES", name => "ZM_CHECK_FOR_UPDATES",
default => "yes", default => "yes",