diff --git a/CMakeLists.txt b/CMakeLists.txt index fba6360a6..7b3b8f7fd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,7 +4,7 @@ # cmake_minimum_required (VERSION 2.6) project (zoneminder) -set(zoneminder_VERSION "1.28.103") +set(zoneminder_VERSION "1.28.104") # make API version a minor of ZM version set(zoneminder_API_VERSION "${zoneminder_VERSION}.1") diff --git a/configure.ac b/configure.ac index db8562c68..32548d791 100644 --- a/configure.ac +++ b/configure.ac @@ -3,7 +3,7 @@ # For instructions on building with cmake, please see INSTALL # AC_PREREQ(2.59) -AC_INIT(zm,1.28.103,[http://www.zoneminder.com/forums/ - Please check FAQ first],zoneminder,http://www.zoneminder.com/downloads.html) +AC_INIT(zm,1.28.104,[http://www.zoneminder.com/forums/ - Please check FAQ first],zoneminder,http://www.zoneminder.com/downloads.html) AM_INIT_AUTOMAKE AC_CONFIG_SRCDIR(src/zm.h) AC_CONFIG_HEADERS(config.h) diff --git a/db/zm_create.sql.in b/db/zm_create.sql.in index 6026546d5..6c376be7f 100644 --- a/db/zm_create.sql.in +++ b/db/zm_create.sql.in @@ -359,6 +359,8 @@ CREATE TABLE `Monitors` ( `SectionLength` int(10) unsigned NOT NULL default '600', `FrameSkip` smallint(5) unsigned NOT NULL default '0', `MotionFrameSkip` smallint(5) unsigned NOT NULL default '0', + `AnalysisFPS` decimal(5,2) default NULL, + `AnalysisUpdateDelay` smallint(5) unsigned NOT NULL default '0', `MaxFPS` decimal(5,2) default NULL, `AlarmMaxFPS` decimal(5,2) default NULL, `FPSReportInterval` smallint(5) unsigned NOT NULL default '250', diff --git a/db/zm_update-1.28.101.sql b/db/zm_update-1.28.101.sql index adf3f34e8..1ba26bf98 100644 --- a/db/zm_update-1.28.101.sql +++ b/db/zm_update-1.28.101.sql @@ -6,7 +6,6 @@ -- Add Groups column to Users -- - SET @s = (SELECT IF( (SELECT COUNT(*) FROM INFORMATION_SCHEMA.COLUMNS diff --git a/db/zm_update-1.28.104.sql b/db/zm_update-1.28.104.sql new file mode 100644 index 000000000..b2a88c377 --- /dev/null +++ b/db/zm_update-1.28.104.sql @@ -0,0 +1,40 @@ +-- +-- This updates a 1.28.103 database to 1.28.104 +-- + +-- +-- Add AnalysisFPS column to Monitors +-- + +SET @s = (SELECT IF( + (SELECT COUNT(*) + FROM INFORMATION_SCHEMA.COLUMNS + WHERE table_name = 'Monitors' + AND table_schema = DATABASE() + AND column_name = 'AnalysisFPS' + ) > 0, +"SELECT 'Column AnalysisFPS exists in Monitors'", +"ALTER TABLE Monitors ADD `AnalysisFPS` decimal(5,2) default NULL AFTER `MotionFrameSkip`" +)); + +PREPARE stmt FROM @s; +EXECUTE stmt; + +-- +-- Add AnalysisUpdateDelay column to Monitors +-- + +SET @s = (SELECT IF( + (SELECT COUNT(*) + FROM INFORMATION_SCHEMA.COLUMNS + WHERE table_name = 'Monitors' + AND table_schema = DATABASE() + AND column_name = 'AnalysisUpdateDelay' + ) > 0, +"SELECT 'Column AnalysisUpdateDelay exists in Monitors'", +"ALTER TABLE Monitors ADD `AnalysisUpdateDelay` smallint(5) unsigned not null default 0 AFTER `AnalysisFPS`" +)); + +PREPARE stmt FROM @s; +EXECUTE stmt; + diff --git a/src/zm_monitor.cpp b/src/zm_monitor.cpp index 4dae4de25..d3d873f4c 100644 --- a/src/zm_monitor.cpp +++ b/src/zm_monitor.cpp @@ -282,6 +282,8 @@ Monitor::Monitor( int p_section_length, int p_frame_skip, int p_motion_frame_skip, + double p_analysis_fps, + unsigned int p_analysis_update_delay, int p_capture_delay, int p_alarm_capture_delay, int p_fps_report_interval, @@ -310,6 +312,8 @@ Monitor::Monitor( section_length( p_section_length ), frame_skip( p_frame_skip ), motion_frame_skip( p_motion_frame_skip ), + analysis_fps( p_analysis_fps ), + analysis_update_delay( p_analysis_update_delay ), capture_delay( p_capture_delay ), alarm_capture_delay( p_alarm_capture_delay ), alarm_frame_count( p_alarm_frame_count ), @@ -494,6 +498,9 @@ Monitor::Monitor( n_linked_monitors = 0; linked_monitors = 0; + + adaptive_skip = true; + ReloadLinkedMonitors( p_linked_monitors ); } } @@ -572,6 +579,21 @@ bool Monitor::connect() { next_buffer.image = new Image( width, height, camera->Colours(), camera->SubpixelOrder()); next_buffer.timestamp = new struct timeval; } + + if ( ( purpose == ANALYSIS ) && analysis_fps ) + { + // Size of pre event buffer must be greater than pre_event_count + // if alarm_frame_count > 1, because in this case the buffer contains + // alarmed images that must be discarded when event is created + pre_event_buffer_count = pre_event_count + alarm_frame_count - 1; + pre_event_buffer = new Snapshot[pre_event_buffer_count]; + for ( int i = 0; i < pre_event_buffer_count; i++ ) + { + pre_event_buffer[i].timestamp = new struct timeval; + pre_event_buffer[i].image = new Image( width, height, camera->Colours(), camera->SubpixelOrder()); + } + } + return true; } @@ -600,7 +622,6 @@ Monitor::~Monitor() delete image_buffer[i].image; } delete[] image_buffer; - } // end if mem_ptr for ( int i = 0; i < n_zones; i++ ) @@ -617,6 +638,16 @@ Monitor::~Monitor() shared_data->state = state = IDLE; shared_data->last_read_index = image_buffer_count; shared_data->last_read_time = 0; + + if ( analysis_fps ) + { + for ( int i = 0; i < pre_event_buffer_count; i++ ) + { + delete pre_event_buffer[i].image; + delete pre_event_buffer[i].timestamp; + } + delete[] pre_event_buffer; + } } else if ( purpose == CAPTURE ) { @@ -784,6 +815,46 @@ double Monitor::GetFPS() const return( curr_fps ); } +useconds_t Monitor::GetAnalysisRate() +{ + double capturing_fps = GetFPS(); + if ( !analysis_fps ) + { + return( 0 ); + } + else if ( analysis_fps > capturing_fps ) + { + Warning( "Analysis fps (%.2f) is greater than capturing fps (%.2f)", analysis_fps, capturing_fps ); + return( 0 ); + } + else + { + return( ( 1000000 / analysis_fps ) - ( 1000000 / capturing_fps ) ); + } +} + +void Monitor::UpdateAdaptiveSkip() +{ + if ( config.opt_adaptive_skip ) + { + double capturing_fps = GetFPS(); + if ( adaptive_skip && analysis_fps && ( analysis_fps < capturing_fps ) ) + { + Info( "Analysis fps (%.2f) is lower than capturing fps (%.2f), disabling adaptive skip feature", analysis_fps, capturing_fps ); + adaptive_skip = false; + } + else if ( !adaptive_skip && ( !analysis_fps || ( analysis_fps >= capturing_fps ) ) ) + { + Info( "Enabling adaptive skip feature" ); + adaptive_skip = true; + } + } + else + { + adaptive_skip = false; + } +} + void Monitor::ForceAlarmOn( int force_score, const char *force_cause, const char *force_text ) { trigger_data->trigger_state = TRIGGER_ON; @@ -1176,12 +1247,12 @@ bool Monitor::Analyse() if ( image_count && fps_report_interval && !(image_count%fps_report_interval) ) { fps = double(fps_report_interval)/(now.tv_sec-last_fps_time); - Info( "%s: %d - Processing at %.2f fps", name, image_count, fps ); + Info( "%s: %d - Analysing at %.2f fps", name, image_count, fps ); last_fps_time = now.tv_sec; } int index; - if ( config.opt_adaptive_skip ) + if ( adaptive_skip ) { int read_margin = shared_data->last_read_index - shared_data->last_write_index; if ( read_margin < 0 ) read_margin += image_buffer_count; @@ -1432,23 +1503,57 @@ bool Monitor::Analyse() //if ( config.overlap_timed_events ) if ( false ) { - int pre_index = ((index+image_buffer_count)-pre_event_count)%image_buffer_count; + int pre_index; int pre_event_images = pre_event_count; - while ( pre_event_images && !image_buffer[pre_index].timestamp->tv_sec ) + + if ( analysis_fps ) { - pre_index = (pre_index+1)%image_buffer_count; - pre_event_images--; + // If analysis fps is set, + // compute the index for pre event images in the dedicated buffer + pre_index = image_count%pre_event_buffer_count; + + // Seek forward the next filled slot in to the buffer (oldest data) + // from the current position + while ( pre_event_images && !pre_event_buffer[pre_index].timestamp->tv_sec ) + { + pre_index = (pre_index + 1)%pre_event_buffer_count; + // Slot is empty, removing image from counter + pre_event_images--; + } + } + else + { + // If analysis fps is not set (analysis performed at capturing framerate), + // compute the index for pre event images in the capturing buffer + pre_index = ((index + image_buffer_count) - pre_event_count)%image_buffer_count; + + // Seek forward the next filled slot in to the buffer (oldest data) + // from the current position + while ( pre_event_images && !image_buffer[pre_index].timestamp->tv_sec ) + { + pre_index = (pre_index + 1)%image_buffer_count; + // Slot is empty, removing image from counter + pre_event_images--; + } } if ( pre_event_images ) { - for ( int i = 0; i < pre_event_images; i++ ) - { - timestamps[i] = image_buffer[pre_index].timestamp; - images[i] = image_buffer[pre_index].image; + if ( analysis_fps ) + for ( int i = 0; i < pre_event_images; i++ ) + { + timestamps[i] = pre_event_buffer[pre_index].timestamp; + images[i] = pre_event_buffer[pre_index].image; + pre_index = (pre_index + 1)%pre_event_buffer_count; + } + else + for ( int i = 0; i < pre_event_images; i++ ) + { + timestamps[i] = image_buffer[pre_index].timestamp; + images[i] = image_buffer[pre_index].image; + pre_index = (pre_index + 1)%image_buffer_count; + } - pre_index = (pre_index+1)%image_buffer_count; - } event->AddFrames( pre_event_images, images, timestamps ); } } @@ -1465,32 +1570,66 @@ bool Monitor::Analyse() if ( signal_change || (function != MOCORD && state != ALERT) ) { int pre_index; - if ( alarm_frame_count > 1 ) - pre_index = ((index+image_buffer_count)-((alarm_frame_count-1)+pre_event_count))%image_buffer_count; - else - pre_index = ((index+image_buffer_count)-pre_event_count)%image_buffer_count; - int pre_event_images = pre_event_count; - while ( pre_event_images && !image_buffer[pre_index].timestamp->tv_sec ) - { - pre_index = (pre_index+1)%image_buffer_count; - pre_event_images--; - } - event = new Event( this, *(image_buffer[pre_index].timestamp), cause, noteSetMap ); + if ( analysis_fps ) + { + // If analysis fps is set, + // compute the index for pre event images in the dedicated buffer + pre_index = image_count%pre_event_buffer_count; + + // Seek forward the next filled slot in to the buffer (oldest data) + // from the current position + while ( pre_event_images && !pre_event_buffer[pre_index].timestamp->tv_sec ) + { + pre_index = (pre_index + 1)%pre_event_buffer_count; + // Slot is empty, removing image from counter + pre_event_images--; + } + + event = new Event( this, *(pre_event_buffer[pre_index].timestamp), cause, noteSetMap ); + } + else + { + // If analysis fps is not set (analysis performed at capturing framerate), + // compute the index for pre event images in the capturing buffer + if ( alarm_frame_count > 1 ) + pre_index = ((index + image_buffer_count) - ((alarm_frame_count - 1) + pre_event_count))%image_buffer_count; + else + pre_index = ((index + image_buffer_count) - pre_event_count)%image_buffer_count; + + // Seek forward the next filled slot in to the buffer (oldest data) + // from the current position + while ( pre_event_images && !image_buffer[pre_index].timestamp->tv_sec ) + { + pre_index = (pre_index + 1)%image_buffer_count; + // Slot is empty, removing image from counter + pre_event_images--; + } + + event = new Event( this, *(image_buffer[pre_index].timestamp), cause, noteSetMap ); + } shared_data->last_event = event->Id(); Info( "%s: %03d - Opening new event %d, alarm start", name, image_count, event->Id() ); if ( pre_event_images ) { - for ( int i = 0; i < pre_event_images; i++ ) - { - timestamps[i] = image_buffer[pre_index].timestamp; - images[i] = image_buffer[pre_index].image; + if ( analysis_fps ) + for ( int i = 0; i < pre_event_images; i++ ) + { + timestamps[i] = pre_event_buffer[pre_index].timestamp; + images[i] = pre_event_buffer[pre_index].image; + pre_index = (pre_index + 1)%pre_event_buffer_count; + } + else + for ( int i = 0; i < pre_event_images; i++ ) + { + timestamps[i] = image_buffer[pre_index].timestamp; + images[i] = image_buffer[pre_index].image; + pre_index = (pre_index + 1)%image_buffer_count; + } - pre_index = (pre_index+1)%image_buffer_count; - } event->AddFrames( pre_event_images, images, timestamps ); } if ( alarm_frame_count ) @@ -1656,6 +1795,15 @@ bool Monitor::Analyse() shared_data->last_read_index = index%image_buffer_count; //shared_data->last_read_time = image_buffer[index].timestamp->tv_sec; shared_data->last_read_time = now.tv_sec; + + if ( analysis_fps ) + { + // If analysis fps is set, add analysed image to dedicated pre event buffer + int pre_index = image_count%pre_event_buffer_count; + pre_event_buffer[pre_index].image->Assign(*snap->image); + memcpy( pre_event_buffer[pre_index].timestamp, snap->timestamp, sizeof(struct timeval) ); + } + image_count++; return( true ); @@ -1671,7 +1819,7 @@ void Monitor::Reload() closeEvent(); static char sql[ZM_SQL_MED_BUFSIZ]; - snprintf( sql, sizeof(sql), "select Function+0, Enabled, LinkedMonitors, EventPrefix, LabelFormat, LabelX, LabelY, LabelSize, WarmupCount, PreEventCount, PostEventCount, AlarmFrameCount, SectionLength, FrameSkip, MotionFrameSkip, MaxFPS, AlarmMaxFPS, FPSReportInterval, RefBlendPerc, AlarmRefBlendPerc, TrackMotion, SignalCheckColour from Monitors where Id = '%d'", id ); + snprintf( sql, sizeof(sql), "select Function+0, Enabled, LinkedMonitors, EventPrefix, LabelFormat, LabelX, LabelY, LabelSize, WarmupCount, PreEventCount, PostEventCount, AlarmFrameCount, SectionLength, FrameSkip, MotionFrameSkip, AnalysisFPS, AnalysisUpdateDelay, MaxFPS, AlarmMaxFPS, FPSReportInterval, RefBlendPerc, AlarmRefBlendPerc, TrackMotion, SignalCheckColour from Monitors where Id = '%d'", id ); if ( mysql_query( &dbconn, sql ) ) { @@ -1709,6 +1857,8 @@ void Monitor::Reload() section_length = atoi(dbrow[index++]); frame_skip = atoi(dbrow[index++]); motion_frame_skip = atoi(dbrow[index++]); + analysis_fps = dbrow[index] ? strtod(dbrow[index], NULL) : 0; index++; + analysis_update_delay = strtoul(dbrow[index++], NULL, 0); capture_delay = (dbrow[index]&&atof(dbrow[index])>0.0)?int(DT_PREC_3/atof(dbrow[index])):0; index++; alarm_capture_delay = (dbrow[index]&&atof(dbrow[index])>0.0)?int(DT_PREC_3/atof(dbrow[index])):0; index++; fps_report_interval = atoi(dbrow[index++]); @@ -1864,11 +2014,11 @@ int Monitor::LoadLocalMonitors( const char *device, Monitor **&monitors, Purpose static char sql[ZM_SQL_MED_BUFSIZ]; if ( !device[0] ) { - strncpy( sql, "select Id, Name, Function+0, Enabled, LinkedMonitors, Device, Channel, Format, V4LMultiBuffer, V4LCapturesPerFrame, Method, Width, Height, Colours, Palette, Orientation+0, Deinterlacing, Brightness, Contrast, Hue, Colour, EventPrefix, LabelFormat, LabelX, LabelY, LabelSize, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, StreamReplayBuffer, AlarmFrameCount, SectionLength, FrameSkip, MotionFrameSkip, MaxFPS, AlarmMaxFPS, FPSReportInterval, RefBlendPerc, AlarmRefBlendPerc, TrackMotion, SignalCheckColour, Exif from Monitors where Function != 'None' and Type = 'Local' order by Device, Channel", sizeof(sql) ); + strncpy( sql, "select Id, Name, Function+0, Enabled, LinkedMonitors, Device, Channel, Format, V4LMultiBuffer, V4LCapturesPerFrame, Method, Width, Height, Colours, Palette, Orientation+0, Deinterlacing, Brightness, Contrast, Hue, Colour, EventPrefix, LabelFormat, LabelX, LabelY, LabelSize, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, StreamReplayBuffer, AlarmFrameCount, SectionLength, FrameSkip, MotionFrameSkip, AnalysisFPS, AnalysisUpdateDelay, MaxFPS, AlarmMaxFPS, FPSReportInterval, RefBlendPerc, AlarmRefBlendPerc, TrackMotion, SignalCheckColour, Exif from Monitors where Function != 'None' and Type = 'Local' order by Device, Channel", sizeof(sql) ); } else { - snprintf( sql, sizeof(sql), "select Id, Name, Function+0, Enabled, LinkedMonitors, Device, Channel, Format, V4LMultiBuffer, V4LCapturesPerFrame, Method, Width, Height, Colours, Palette, Orientation+0, Deinterlacing, Brightness, Contrast, Hue, Colour, EventPrefix, LabelFormat, LabelX, LabelY, LabelSize, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, StreamReplayBuffer, AlarmFrameCount, SectionLength, FrameSkip, MotionFrameSkip, MaxFPS, AlarmMaxFPS, FPSReportInterval, RefBlendPerc, AlarmRefBlendPerc, TrackMotion, SignalCheckColour, Exif from Monitors where Function != 'None' and Type = 'Local' and Device = '%s' order by Channel", device ); + snprintf( sql, sizeof(sql), "select Id, Name, Function+0, Enabled, LinkedMonitors, Device, Channel, Format, V4LMultiBuffer, V4LCapturesPerFrame, Method, Width, Height, Colours, Palette, Orientation+0, Deinterlacing, Brightness, Contrast, Hue, Colour, EventPrefix, LabelFormat, LabelX, LabelY, LabelSize, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, StreamReplayBuffer, AlarmFrameCount, SectionLength, FrameSkip, MotionFrameSkip, AnalysisFPS, AnalysisUpdateDelay, MaxFPS, AlarmMaxFPS, FPSReportInterval, RefBlendPerc, AlarmRefBlendPerc, TrackMotion, SignalCheckColour, Exif from Monitors where Function != 'None' and Type = 'Local' and Device = '%s' order by Channel", device ); } if ( mysql_query( &dbconn, sql ) ) { @@ -1948,6 +2098,8 @@ Debug( 1, "Got %d for v4l_captures_per_frame", v4l_captures_per_frame ); int section_length = atoi(dbrow[col]); col++; int frame_skip = atoi(dbrow[col]); col++; int motion_frame_skip = atoi(dbrow[col]); col++; + double analysis_fps = dbrow[col] ? strtod(dbrow[col], NULL) : 0; col++; + unsigned int analysis_update_delay = strtoul(dbrow[col++], NULL, 0); int capture_delay = (dbrow[col]&&atof(dbrow[col])>0.0)?int(DT_PREC_3/atof(dbrow[col])):0; col++; int alarm_capture_delay = (dbrow[col]&&atof(dbrow[col])>0.0)?int(DT_PREC_3/atof(dbrow[col])):0; col++; int fps_report_interval = atoi(dbrow[col]); col++; @@ -2010,6 +2162,8 @@ Debug( 1, "Got %d for v4l_captures_per_frame", v4l_captures_per_frame ); section_length, frame_skip, motion_frame_skip, + analysis_fps, + analysis_update_delay, capture_delay, alarm_capture_delay, fps_report_interval, @@ -2044,11 +2198,11 @@ int Monitor::LoadRemoteMonitors( const char *protocol, const char *host, const c static char sql[ZM_SQL_MED_BUFSIZ]; if ( !protocol ) { - strncpy( sql, "select Id, Name, Function+0, Enabled, LinkedMonitors, Protocol, Method, Host, Port, Path, Width, Height, Colours, Palette, Orientation+0, Deinterlacing, Brightness, Contrast, Hue, Colour, EventPrefix, LabelFormat, LabelX, LabelY, LabelSize, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, StreamReplayBuffer, AlarmFrameCount, SectionLength, FrameSkip, MotionFrameSkip, MaxFPS, AlarmMaxFPS, FPSReportInterval, RefBlendPerc, AlarmRefBlendPerc, TrackMotion, Exif from Monitors where Function != 'None' and Type = 'Remote'", sizeof(sql) ); + strncpy( sql, "select Id, Name, Function+0, Enabled, LinkedMonitors, Protocol, Method, Host, Port, Path, Width, Height, Colours, Palette, Orientation+0, Deinterlacing, Brightness, Contrast, Hue, Colour, EventPrefix, LabelFormat, LabelX, LabelY, LabelSize, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, StreamReplayBuffer, AlarmFrameCount, SectionLength, FrameSkip, MotionFrameSkip, AnalysisFPS, AnalysisUpdateDelay, MaxFPS, AlarmMaxFPS, FPSReportInterval, RefBlendPerc, AlarmRefBlendPerc, TrackMotion, Exif from Monitors where Function != 'None' and Type = 'Remote'", sizeof(sql) ); } else { - snprintf( sql, sizeof(sql), "select Id, Name, Function+0, Enabled, LinkedMonitors, Protocol, Method, Host, Port, Path, Width, Height, Colours, Palette, Orientation+0, Deinterlacing, Brightness, Contrast, Hue, Colour, EventPrefix, LabelFormat, LabelX, LabelY, LabelSize, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, StreamReplayBuffer, AlarmFrameCount, SectionLength, FrameSkip, MotionFrameSkip, MaxFPS, AlarmMaxFPS, FPSReportInterval, RefBlendPerc, AlarmRefBlendPerc, TrackMotion, Exif from Monitors where Function != 'None' and Type = 'Remote' and Protocol = '%s' and Host = '%s' and Port = '%s' and Path = '%s'", protocol, host, port, path ); + snprintf( sql, sizeof(sql), "select Id, Name, Function+0, Enabled, LinkedMonitors, Protocol, Method, Host, Port, Path, Width, Height, Colours, Palette, Orientation+0, Deinterlacing, Brightness, Contrast, Hue, Colour, EventPrefix, LabelFormat, LabelX, LabelY, LabelSize, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, StreamReplayBuffer, AlarmFrameCount, SectionLength, FrameSkip, MotionFrameSkip, AnalysisFPS, AnalysisUpdateDelay, MaxFPS, AlarmMaxFPS, FPSReportInterval, RefBlendPerc, AlarmRefBlendPerc, TrackMotion, Exif from Monitors where Function != 'None' and Type = 'Remote' and Protocol = '%s' and Host = '%s' and Port = '%s' and Path = '%s'", protocol, host, port, path ); } if ( mysql_query( &dbconn, sql ) ) { @@ -2109,6 +2263,8 @@ int Monitor::LoadRemoteMonitors( const char *protocol, const char *host, const c int section_length = atoi(dbrow[col]); col++; int frame_skip = atoi(dbrow[col]); col++; int motion_frame_skip = atoi(dbrow[col]); col++; + double analysis_fps = dbrow[col] ? strtod(dbrow[col], NULL) : 0; col++; + unsigned int analysis_update_delay = strtoul(dbrow[col++], NULL, 0); int capture_delay = (dbrow[col]&&atof(dbrow[col])>0.0)?int(DT_PREC_3/atof(dbrow[col])):0; col++; int alarm_capture_delay = (dbrow[col]&&atof(dbrow[col])>0.0)?int(DT_PREC_3/atof(dbrow[col])):0; col++; int fps_report_interval = atoi(dbrow[col]); col++; @@ -2186,6 +2342,8 @@ int Monitor::LoadRemoteMonitors( const char *protocol, const char *host, const c section_length, frame_skip, motion_frame_skip, + analysis_fps, + analysis_update_delay, capture_delay, alarm_capture_delay, fps_report_interval, @@ -2220,11 +2378,11 @@ int Monitor::LoadFileMonitors( const char *file, Monitor **&monitors, Purpose pu static char sql[ZM_SQL_MED_BUFSIZ]; if ( !file[0] ) { - strncpy( sql, "select Id, Name, Function+0, Enabled, LinkedMonitors, Path, Width, Height, Colours, Palette, Orientation+0, Deinterlacing, Brightness, Contrast, Hue, Colour, EventPrefix, LabelFormat, LabelX, LabelY, LabelSize, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, StreamReplayBuffer, AlarmFrameCount, SectionLength, FrameSkip, MotionFrameSkip, MaxFPS, AlarmMaxFPS, FPSReportInterval, RefBlendPerc, AlarmRefBlendPerc, TrackMotion, Exif from Monitors where Function != 'None' and Type = 'File'", sizeof(sql) ); + strncpy( sql, "select Id, Name, Function+0, Enabled, LinkedMonitors, Path, Width, Height, Colours, Palette, Orientation+0, Deinterlacing, Brightness, Contrast, Hue, Colour, EventPrefix, LabelFormat, LabelX, LabelY, LabelSize, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, StreamReplayBuffer, AlarmFrameCount, SectionLength, FrameSkip, MotionFrameSkip, AnalysisFPS, AnalysisUpdateDelay, MaxFPS, AlarmMaxFPS, FPSReportInterval, RefBlendPerc, AlarmRefBlendPerc, TrackMotion, Exif from Monitors where Function != 'None' and Type = 'File'", sizeof(sql) ); } else { - snprintf( sql, sizeof(sql), "select Id, Name, Function+0, Enabled, LinkedMonitors, Path, Width, Height, Colours, Palette, Orientation+0, Deinterlacing, Brightness, Contrast, Hue, Colour, EventPrefix, LabelFormat, LabelX, LabelY, LabelSize, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, StreamReplayBuffer, AlarmFrameCount, SectionLength, FrameSkip, MotionFrameSkip, MaxFPS, AlarmMaxFPS, FPSReportInterval, RefBlendPerc, AlarmRefBlendPerc, TrackMotion, Exif from Monitors where Function != 'None' and Type = 'File' and Path = '%s'", file ); + snprintf( sql, sizeof(sql), "select Id, Name, Function+0, Enabled, LinkedMonitors, Path, Width, Height, Colours, Palette, Orientation+0, Deinterlacing, Brightness, Contrast, Hue, Colour, EventPrefix, LabelFormat, LabelX, LabelY, LabelSize, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, StreamReplayBuffer, AlarmFrameCount, SectionLength, FrameSkip, MotionFrameSkip, AnalysisFPS, AnalysisUpdateDelay, MaxFPS, AlarmMaxFPS, FPSReportInterval, RefBlendPerc, AlarmRefBlendPerc, TrackMotion, Exif from Monitors where Function != 'None' and Type = 'File' and Path = '%s'", file ); } if ( mysql_query( &dbconn, sql ) ) { @@ -2281,6 +2439,8 @@ int Monitor::LoadFileMonitors( const char *file, Monitor **&monitors, Purpose pu int section_length = atoi(dbrow[col]); col++; int frame_skip = atoi(dbrow[col]); col++; int motion_frame_skip = atoi(dbrow[col]); col++; + double analysis_fps = dbrow[col] ? strtod(dbrow[col], NULL) : 0; col++; + unsigned int analysis_update_delay = strtoul(dbrow[col++], NULL, 0); int capture_delay = (dbrow[col]&&atof(dbrow[col])>0.0)?int(DT_PREC_3/atof(dbrow[col])):0; col++; int alarm_capture_delay = (dbrow[col]&&atof(dbrow[col])>0.0)?int(DT_PREC_3/atof(dbrow[col])):0; col++; int fps_report_interval = atoi(dbrow[col]); col++; @@ -2327,6 +2487,8 @@ int Monitor::LoadFileMonitors( const char *file, Monitor **&monitors, Purpose pu section_length, frame_skip, motion_frame_skip, + analysis_fps, + analysis_update_delay, capture_delay, alarm_capture_delay, fps_report_interval, @@ -2361,11 +2523,11 @@ int Monitor::LoadFfmpegMonitors( const char *file, Monitor **&monitors, Purpose static char sql[ZM_SQL_MED_BUFSIZ]; if ( !file[0] ) { - strncpy( sql, "select Id, Name, Function+0, Enabled, LinkedMonitors, Path, Method, Options, Width, Height, Colours, Palette, Orientation+0, Deinterlacing, Brightness, Contrast, Hue, Colour, EventPrefix, LabelFormat, LabelX, LabelY, LabelSize, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, StreamReplayBuffer, AlarmFrameCount, SectionLength, FrameSkip, MotionFrameSkip, MaxFPS, AlarmMaxFPS, FPSReportInterval, RefBlendPerc, AlarmRefBlendPerc, TrackMotion, Exif from Monitors where Function != 'None' and Type = 'Ffmpeg'", sizeof(sql) ); + strncpy( sql, "select Id, Name, Function+0, Enabled, LinkedMonitors, Path, Method, Options, Width, Height, Colours, Palette, Orientation+0, Deinterlacing, Brightness, Contrast, Hue, Colour, EventPrefix, LabelFormat, LabelX, LabelY, LabelSize, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, StreamReplayBuffer, AlarmFrameCount, SectionLength, FrameSkip, MotionFrameSkip, AnalysisFPS, AnalysisUpdateDelay, MaxFPS, AlarmMaxFPS, FPSReportInterval, RefBlendPerc, AlarmRefBlendPerc, TrackMotion, Exif from Monitors where Function != 'None' and Type = 'Ffmpeg'", sizeof(sql) ); } else { - snprintf( sql, sizeof(sql), "select Id, Name, Function+0, Enabled, LinkedMonitors, Path, Method, Options, Width, Height, Colours, Palette, Orientation+0, Deinterlacing, Brightness, Contrast, Hue, Colour, EventPrefix, LabelFormat, LabelX, LabelY, LabelSize, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, StreamReplayBuffer, AlarmFrameCount, SectionLength, FrameSkip, MotionFrameSkip, MaxFPS, AlarmMaxFPS, FPSReportInterval, RefBlendPerc, AlarmRefBlendPerc, TrackMotion, Exif from Monitors where Function != 'None' and Type = 'Ffmpeg' and Path = '%s'", file ); + snprintf( sql, sizeof(sql), "select Id, Name, Function+0, Enabled, LinkedMonitors, Path, Method, Options, Width, Height, Colours, Palette, Orientation+0, Deinterlacing, Brightness, Contrast, Hue, Colour, EventPrefix, LabelFormat, LabelX, LabelY, LabelSize, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, StreamReplayBuffer, AlarmFrameCount, SectionLength, FrameSkip, MotionFrameSkip, AnalysisFPS, AnalysisUpdateDelay, MaxFPS, AlarmMaxFPS, FPSReportInterval, RefBlendPerc, AlarmRefBlendPerc, TrackMotion, Exif from Monitors where Function != 'None' and Type = 'Ffmpeg' and Path = '%s'", file ); } if ( mysql_query( &dbconn, sql ) ) { @@ -2424,6 +2586,8 @@ int Monitor::LoadFfmpegMonitors( const char *file, Monitor **&monitors, Purpose int section_length = atoi(dbrow[col]); col++; int frame_skip = atoi(dbrow[col]); col++; int motion_frame_skip = atoi(dbrow[col]); col++; + double analysis_fps = dbrow[col] ? strtod(dbrow[col], NULL) : 0; col++; + unsigned int analysis_update_delay = strtoul(dbrow[col++], NULL, 0); int capture_delay = (dbrow[col]&&atof(dbrow[col])>0.0)?int(DT_PREC_3/atof(dbrow[col])):0; col++; int alarm_capture_delay = (dbrow[col]&&atof(dbrow[col])>0.0)?int(DT_PREC_3/atof(dbrow[col])):0; col++; int fps_report_interval = atoi(dbrow[col]); col++; @@ -2472,6 +2636,8 @@ int Monitor::LoadFfmpegMonitors( const char *file, Monitor **&monitors, Purpose section_length, frame_skip, motion_frame_skip, + analysis_fps, + analysis_update_delay, capture_delay, alarm_capture_delay, fps_report_interval, @@ -2504,7 +2670,7 @@ int Monitor::LoadFfmpegMonitors( const char *file, Monitor **&monitors, Purpose Monitor *Monitor::Load( int id, bool load_zones, Purpose purpose ) { static char sql[ZM_SQL_MED_BUFSIZ]; - snprintf( sql, sizeof(sql), "select Id, Name, Type, Function+0, Enabled, LinkedMonitors, Device, Channel, Format, V4LMultiBuffer, V4LCapturesPerFrame, Protocol, Method, Host, Port, Path, Options, User, Pass, Width, Height, Colours, Palette, Orientation+0, Deinterlacing, Brightness, Contrast, Hue, Colour, EventPrefix, LabelFormat, LabelX, LabelY, LabelSize, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, StreamReplayBuffer, AlarmFrameCount, SectionLength, FrameSkip, MotionFrameSkip, MaxFPS, AlarmMaxFPS, FPSReportInterval, RefBlendPerc, AlarmRefBlendPerc, TrackMotion, SignalCheckColour, Exif from Monitors where Id = %d", id ); + snprintf( sql, sizeof(sql), "select Id, Name, Type, Function+0, Enabled, LinkedMonitors, Device, Channel, Format, V4LMultiBuffer, V4LCapturesPerFrame, Protocol, Method, Host, Port, Path, Options, User, Pass, Width, Height, Colours, Palette, Orientation+0, Deinterlacing, Brightness, Contrast, Hue, Colour, EventPrefix, LabelFormat, LabelX, LabelY, LabelSize, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, StreamReplayBuffer, AlarmFrameCount, SectionLength, FrameSkip, MotionFrameSkip, AnalysisFPS, AnalysisUpdateDelay, MaxFPS, AlarmMaxFPS, FPSReportInterval, RefBlendPerc, AlarmRefBlendPerc, TrackMotion, SignalCheckColour, Exif from Monitors where Id = %d", id ); if ( mysql_query( &dbconn, sql ) ) { Error( "Can't run query: %s", mysql_error( &dbconn ) ); @@ -2592,6 +2758,8 @@ Debug( 1, "Got %d for v4l_captures_per_frame", v4l_captures_per_frame ); int section_length = atoi(dbrow[col]); col++; int frame_skip = atoi(dbrow[col]); col++; int motion_frame_skip = atoi(dbrow[col]); col++; + double analysis_fps = dbrow[col] ? strtod(dbrow[col], NULL) : 0; col++; + unsigned int analysis_update_delay = strtoul(dbrow[col++], NULL, 0); int capture_delay = (dbrow[col]&&atof(dbrow[col])>0.0)?int(DT_PREC_3/atof(dbrow[col])):0; col++; int alarm_capture_delay = (dbrow[col]&&atof(dbrow[col])>0.0)?int(DT_PREC_3/atof(dbrow[col])):0; col++; int fps_report_interval = atoi(dbrow[col]); col++; @@ -2790,6 +2958,8 @@ Debug( 1, "Got %d for v4l_captures_per_frame", v4l_captures_per_frame ); section_length, frame_skip, motion_frame_skip, + analysis_fps, + analysis_update_delay, capture_delay, alarm_capture_delay, fps_report_interval, diff --git a/src/zm_monitor.h b/src/zm_monitor.h index fff1b401a..567de6a57 100644 --- a/src/zm_monitor.h +++ b/src/zm_monitor.h @@ -228,13 +228,18 @@ protected: Coord label_coord; // The coordinates of the timestamp on the images int label_size; // Size of the timestamp on the images int image_buffer_count; // Size of circular image buffer, at least twice the size of the pre_event_count + int pre_event_buffer_count; // Size of dedicated circular pre event buffer used when analysis is not performed at capturing framerate, + // value is pre_event_count + alarm_frame_count - 1 int warmup_count; // How many images to process before looking for events int pre_event_count; // How many images to hold and prepend to an alarm event int post_event_count; // How many unalarmed images must occur before the alarm state is reset int stream_replay_buffer; // How many frames to store to support DVR functions, IGNORED from this object, passed directly into zms now int section_length; // How long events should last in continuous modes + bool adaptive_skip; // Whether to use the newer adaptive algorithm for this monitor int frame_skip; // How many frames to skip in continuous modes int motion_frame_skip; // How many frames to skip in motion detection + double analysis_fps; // Target framerate for video analysis + unsigned int analysis_update_delay; // How long we wait before updating analysis parameters int capture_delay; // How long we wait between capture frames int alarm_capture_delay; // How long we wait between capture frames when in alarm state int alarm_frame_count; // How many alarm frames are required before an event is triggered @@ -281,6 +286,7 @@ protected: Snapshot *image_buffer; Snapshot next_buffer; /* Used by four field deinterlacing */ + Snapshot *pre_event_buffer; Camera *camera; @@ -300,7 +306,7 @@ protected: public: // OurCheckAlarms seems to be unused. Check it on zm_monitor.cpp for more info. //bool OurCheckAlarms( Zone *zone, const Image *pImage ); - Monitor( int p_id, const char *p_name, int p_function, bool p_enabled, const char *p_linked_monitors, Camera *p_camera, int p_orientation, unsigned int p_deinterlacing, const char *p_event_prefix, const char *p_label_format, const Coord &p_label_coord, int label_size, int p_image_buffer_count, int p_warmup_count, int p_pre_event_count, int p_post_event_count, int p_stream_replay_buffer, int p_alarm_frame_count, int p_section_length, int p_frame_skip, int p_motion_frame_skip, int p_capture_delay, int p_alarm_capture_delay, int p_fps_report_interval, int p_ref_blend_perc, int p_alarm_ref_blend_perc, bool p_track_motion, Rgb p_signal_check_colour, bool p_embed_exif, Purpose p_purpose, int p_n_zones=0, Zone *p_zones[]=0 ); + Monitor( int p_id, const char *p_name, int p_function, bool p_enabled, const char *p_linked_monitors, Camera *p_camera, int p_orientation, unsigned int p_deinterlacing, const char *p_event_prefix, const char *p_label_format, const Coord &p_label_coord, int label_size, int p_image_buffer_count, int p_warmup_count, int p_pre_event_count, int p_post_event_count, int p_stream_replay_buffer, int p_alarm_frame_count, int p_section_length, int p_frame_skip, int p_motion_frame_skip, double p_analysis_fps, unsigned int p_analysis_update_delay, int p_capture_delay, int p_alarm_capture_delay, int p_fps_report_interval, int p_ref_blend_perc, int p_alarm_ref_blend_perc, bool p_track_motion, Rgb p_signal_check_colour, bool p_embed_exif, Purpose p_purpose, int p_n_zones=0, Zone *p_zones[]=0 ); ~Monitor(); void AddZones( int p_n_zones, Zone *p_zones[] ); @@ -359,6 +365,9 @@ public: State GetState() const; int GetImage( int index=-1, int scale=100 ); struct timeval GetTimestamp( int index=-1 ) const; + void UpdateAdaptiveSkip(); + useconds_t GetAnalysisRate(); + unsigned int GetAnalysisUpdateDelay() const { return( analysis_update_delay ); } int GetCaptureDelay() const { return( capture_delay ); } int GetAlarmCaptureDelay() const { return( alarm_capture_delay ); } unsigned int GetLastReadIndex() const; diff --git a/src/zma.cpp b/src/zma.cpp index fdf15303e..2d22d713a 100644 --- a/src/zma.cpp +++ b/src/zma.cpp @@ -153,14 +153,38 @@ int main( int argc, char *argv[] ) sigset_t block_set; sigemptyset( &block_set ); + useconds_t analysis_rate = monitor->GetAnalysisRate(); + unsigned int analysis_update_delay = monitor->GetAnalysisUpdateDelay(); + time_t last_analysis_update_time, cur_time; + monitor->UpdateAdaptiveSkip(); + last_analysis_update_time = time( 0 ); + while( !zm_terminate ) { // Process the next image sigprocmask( SIG_BLOCK, &block_set, 0 ); + + // Some periodic updates are required for variable capturing framerate + if ( analysis_update_delay ) + { + cur_time = time( 0 ); + if ( ( cur_time - last_analysis_update_time ) > analysis_update_delay ) + { + analysis_rate = monitor->GetAnalysisRate(); + monitor->UpdateAdaptiveSkip(); + last_analysis_update_time = cur_time; + } + } + if ( !monitor->Analyse() ) { usleep( monitor->Active()?ZM_SAMPLE_RATE:ZM_SUSPENDED_RATE ); } + else if ( analysis_rate ) + { + usleep( analysis_rate ); + } + if ( zm_reload ) { monitor->Reload(); diff --git a/version b/version index 48d698ba5..e6a0823f8 100644 --- a/version +++ b/version @@ -1 +1 @@ -1.28.103 +1.28.104 diff --git a/web/lang/big5_big5.php b/web/lang/big5_big5.php index 84da0f622..7f4b52d9b 100644 --- a/web/lang/big5_big5.php +++ b/web/lang/big5_big5.php @@ -95,6 +95,8 @@ $SLANG = array( 'AlarmRefImageBlendPct'=> 'Alarm Reference Image Blend %ge', // Added - 2015-04-18 'Alert' => '警告', 'All' => '全部', + 'AnalysisFPS' => 'Analysis FPS', // Added - 2015-07-22 + 'AnalysisUpdateDelay' => 'Analysis Update Delay', // Added - 2015-07-23 'Apply' => '確定', 'ApplyingStateChange' => '確定狀態改變', 'ArchArchived' => 'Archived Only', @@ -131,6 +133,8 @@ $SLANG = array( 'BackgroundFilter' => 'Run filter in background', 'BadAlarmFrameCount' => 'Alarm frame count must be an integer of one or more', 'BadAlarmMaxFPS' => 'Alarm Maximum FPS must be a positive integer or floating point value', + 'BadAnalysisFPS' => 'Analysis FPS must be a positive integer or floating point value', // Added - 2015-07-22 + 'BadAnalysisUpdateDelay'=> 'Analysis update delay must be set to an integer of zero or more', // Added - 2015-07-23 'BadChannel' => 'Channel must be set to an integer of zero or more', 'BadColours' => 'Target colour must be set to a valid value', // Added - 2011-06-15 'BadDevice' => 'Device must be set to a valid value', diff --git a/web/lang/cn_zh.php b/web/lang/cn_zh.php index 21bd2f269..7b8232e1b 100644 --- a/web/lang/cn_zh.php +++ b/web/lang/cn_zh.php @@ -91,6 +91,8 @@ $SLANG = array( 'AlarmRefImageBlendPct'=> 'Alarm Reference Image Blend %ge', // Added - 2015-04-18 'Alert' => '警报', 'All' => '全部', + 'AnalysisFPS' => 'Analysis FPS', // Added - 2015-07-22 + 'AnalysisUpdateDelay' => 'Analysis Update Delay', // Added - 2015-07-23 'Apply' => '应用', 'ApplyingStateChange' => '状态改变生效', 'ArchArchived' => '仅限于存档', @@ -127,6 +129,8 @@ $SLANG = array( 'BackgroundFilter' => '在后台运行筛选器', 'BadAlarmFrameCount' => '报警帧数必须设为大于1的整数', 'BadAlarmMaxFPS' => '报警最大帧率必须是正整数或正浮点数', + 'BadAnalysisFPS' => 'Analysis FPS must be a positive integer or floating point value', // Added - 2015-07-22 + 'BadAnalysisUpdateDelay'=> 'Analysis update delay must be set to an integer of zero or more', // Added - 2015-07-23 'BadChannel' => '通道必须设为大于零的整数', 'BadColours' => 'Target colour must be set to a valid value', // Added - 2011-06-15 'BadDevice' => '必须为器件设置有效值', diff --git a/web/lang/cs_cz.php b/web/lang/cs_cz.php index ff0f6f260..88f7b05b7 100644 --- a/web/lang/cs_cz.php +++ b/web/lang/cs_cz.php @@ -91,6 +91,8 @@ $SLANG = array( 'AlarmRefImageBlendPct'=> 'Alarm Reference Image Blend %ge', // Added - 2015-04-18 'Alert' => 'Pozor', 'All' => 'Vechny', + 'AnalysisFPS' => 'Analysis FPS', // Added - 2015-07-22 + 'AnalysisUpdateDelay' => 'Analysis Update Delay', // Added - 2015-07-23 'Apply' => 'Pout', 'ApplyingStateChange' => 'Aplikuji zmnu stavu', 'ArchArchived' => 'Pouze archivovan', @@ -127,6 +129,8 @@ $SLANG = array( 'BackgroundFilter' => 'Run filter in background', 'BadAlarmFrameCount' => 'Alarm frame count must be an integer of one or more', 'BadAlarmMaxFPS' => 'Alarm Maximum FPS must be a positive integer or floating point value', + 'BadAnalysisFPS' => 'Analysis FPS must be a positive integer or floating point value', // Added - 2015-07-22 + 'BadAnalysisUpdateDelay'=> 'Analysis update delay must be set to an integer of zero or more', // Added - 2015-07-23 'BadChannel' => 'Channel must be set to an integer of zero or more', 'BadColours' => 'Target colour must be set to a valid value', // Added - 2011-06-15 'BadDevice' => 'Device must be set to a valid value', diff --git a/web/lang/de_de.php b/web/lang/de_de.php index c1a7bf0c7..64477ecd2 100644 --- a/web/lang/de_de.php +++ b/web/lang/de_de.php @@ -93,6 +93,8 @@ $SLANG = array( 'AlarmRefImageBlendPct'=> 'Alarm Reference Image Blend %ge', // Added - 2015-04-18 'Alert' => 'Alarm', 'All' => 'Alle', + 'AnalysisFPS' => 'Analysis FPS', // Added - 2015-07-22 + 'AnalysisUpdateDelay' => 'Analysis Update Delay', // Added - 2015-07-23 'Apply' => 'Anwenden', 'ApplyingStateChange' => 'Aktiviere neuen Status', 'ArchArchived' => 'Nur Archivierte', @@ -129,6 +131,8 @@ $SLANG = array( 'BackgroundFilter' => 'Filter im Hintergrund laufen lassen', 'BadAlarmFrameCount' => 'Die Bildanzahl muss ganzzahlig 1 oder größer sein', 'BadAlarmMaxFPS' => 'Alarm-Maximum-FPS muss eine positive Ganzzahl oder eine Gleitkommazahl sein', + 'BadAnalysisFPS' => 'Analysis FPS must be a positive integer or floating point value', // Added - 2015-07-22 + 'BadAnalysisUpdateDelay'=> 'Analysis update delay must be set to an integer of zero or more', // Added - 2015-07-23 'BadChannel' => 'Der Kanal muss ganzzahlig 0 oder größer sein', 'BadColours' => 'Zielfarbe muss auf einen gültigen Wert gesetzt werden', // Added - 2011-06-15 'BadDevice' => 'Das Gerät muss eine gültige Systemresource sein', diff --git a/web/lang/dk_dk.php b/web/lang/dk_dk.php index 08795edf4..8ba852bd2 100644 --- a/web/lang/dk_dk.php +++ b/web/lang/dk_dk.php @@ -92,6 +92,8 @@ $SLANG = array( 'AlarmRefImageBlendPct'=> 'Alarm Reference Image Blend %ge', // Added - 2015-04-18 'Alert' => 'Alarm', 'All' => 'Alle', + 'AnalysisFPS' => 'Analysis FPS', // Added - 2015-07-22 + 'AnalysisUpdateDelay' => 'Analysis Update Delay', // Added - 2015-07-23 'Apply' => 'Aktiver', 'ApplyingStateChange' => 'Aktivere State ndring', 'ArchArchived' => 'Kun Arkiverede', @@ -128,6 +130,8 @@ $SLANG = array( 'BackgroundFilter' => 'Run filter in background', 'BadAlarmFrameCount' => 'Alarm frame count must be an integer of one or more', 'BadAlarmMaxFPS' => 'Alarm Maximum FPS must be a positive integer or floating point value', + 'BadAnalysisFPS' => 'Analysis FPS must be a positive integer or floating point value', // Added - 2015-07-22 + 'BadAnalysisUpdateDelay'=> 'Analysis update delay must be set to an integer of zero or more', // Added - 2015-07-23 'BadChannel' => 'Channel must be set to an integer of zero or more', 'BadColours' => 'Target colour must be set to a valid value', // Added - 2011-06-15 'BadDevice' => 'Device must be set to a valid value', diff --git a/web/lang/en_gb.php b/web/lang/en_gb.php index 7e6fcb33c..bf0258caf 100644 --- a/web/lang/en_gb.php +++ b/web/lang/en_gb.php @@ -100,6 +100,8 @@ $SLANG = array( 'AlarmRGBUnset' => 'You must set an alarm RGB colour', 'Alert' => 'Alert', 'All' => 'All', + 'AnalysisFPS' => 'Analysis FPS', + 'AnalysisUpdateDelay' => 'Analysis Update Delay', 'Apply' => 'Apply', 'ApplyingStateChange' => 'Applying State Change', 'ArchArchived' => 'Archived Only', @@ -137,6 +139,8 @@ $SLANG = array( 'BackgroundFilter' => 'Run filter in background', 'BadAlarmFrameCount' => 'Alarm frame count must be an integer of one or more', 'BadAlarmMaxFPS' => 'Alarm Maximum FPS must be a positive integer or floating point value', + 'BadAnalysisFPS' => 'Analysis FPS must be a positive integer or floating point value', + 'BadAnalysisUpdateDelay'=> 'Analysis update delay must be set to an integer of zero or more', 'BadChannel' => 'Channel must be set to an integer of zero or more', 'BadDevice' => 'Device must be set to a valid value', 'BadFormat' => 'Format must be set to a valid value', diff --git a/web/lang/es_ar.php b/web/lang/es_ar.php index 1445437f6..cb050361a 100644 --- a/web/lang/es_ar.php +++ b/web/lang/es_ar.php @@ -42,6 +42,8 @@ $SLANG = array( 'AlarmRefImageBlendPct'=> 'Alarm Reference Image Blend %ge', // Added - 2015-04-18 'Alert' => 'Alerta', 'All' => 'Todo', + 'AnalysisFPS' => 'Analysis FPS', // Added - 2015-07-22 + 'AnalysisUpdateDelay' => 'Analysis Update Delay', // Added - 2015-07-23 'Apply' => 'Aplicar', 'ApplyingStateChange' => 'Aplicar Cambio Estado', 'ArchArchived' => 'Solo Archivados', @@ -78,6 +80,8 @@ $SLANG = array( 'BackgroundFilter' => 'Run filter in background', 'BadAlarmFrameCount' => 'Alarm frame count must be an integer of one or more', 'BadAlarmMaxFPS' => 'Alarm Maximum FPS must be a positive integer or floating point value', + 'BadAnalysisFPS' => 'Analysis FPS must be a positive integer or floating point value', // Added - 2015-07-22 + 'BadAnalysisUpdateDelay'=> 'Analysis update delay must be set to an integer of zero or more', // Added - 2015-07-23 'BadChannel' => 'Channel must be set to an integer of zero or more', 'BadColours' => 'Target colour must be set to a valid value', // Added - 2011-06-15 'BadDevice' => 'Device must be set to a valid value', diff --git a/web/lang/es_es.php b/web/lang/es_es.php index 8343bd8f3..d33044ba8 100644 --- a/web/lang/es_es.php +++ b/web/lang/es_es.php @@ -91,6 +91,8 @@ $SLANG = array( 'AlarmRefImageBlendPct'=> 'Alarm Reference Image Blend %ge', // Added - 2015-04-18 'Alert' => 'Alerta', 'All' => 'Todo', + 'AnalysisFPS' => 'Analysis FPS', // Added - 2015-07-22 + 'AnalysisUpdateDelay' => 'Analysis Update Delay', // Added - 2015-07-23 'Apply' => 'Aplicar', 'ApplyingStateChange' => 'Aplicando cambio de estado...', 'ArchArchived' => 'Sólo archivados', @@ -127,6 +129,8 @@ $SLANG = array( 'BackgroundFilter' => 'Ejecutar filtro en segundo plano', 'BadAlarmFrameCount' => 'El número de marcos de alarma debe tener un número entero de uno o más', 'BadAlarmMaxFPS' => 'Máximos MPS de alarma debe ser un valor entero positivo o de punto flotante', + 'BadAnalysisFPS' => 'Analysis FPS must be a positive integer or floating point value', // Added - 2015-07-22 + 'BadAnalysisUpdateDelay'=> 'Analysis update delay must be set to an integer of zero or more', // Added - 2015-07-23 'BadChannel' => 'El canal debe estar establecido en un entero de cero o más', 'BadColours' => 'Target colour must be set to a valid value', // Added - 2015-04-18 'BadDevice' => 'El dispositivo debe tener un valor válido', diff --git a/web/lang/et_ee.php b/web/lang/et_ee.php index 21274663d..f6777bbf9 100644 --- a/web/lang/et_ee.php +++ b/web/lang/et_ee.php @@ -92,6 +92,8 @@ $SLANG = array( 'AlarmRefImageBlendPct'=> 'Alarm Reference Image Blend %ge', // Added - 2015-04-18 'Alert' => 'Hoiatus', 'All' => 'All', + 'AnalysisFPS' => 'Analysis FPS', // Added - 2015-07-22 + 'AnalysisUpdateDelay' => 'Analysis Update Delay', // Added - 2015-07-23 'Apply' => 'Apply', 'ApplyingStateChange' => 'Applying State Change', 'ArchArchived' => 'Arhiveeritud Ainult', @@ -128,6 +130,8 @@ $SLANG = array( 'BackgroundFilter' => 'Käivita filter taustal', 'BadAlarmFrameCount' => 'Alarmi kaadri hulga ühik peab olema integer. Kas üks või rohkem', 'BadAlarmMaxFPS' => 'Alarmi maksimaalne FPS peab olema positiivne integer või floating point väärtus', + 'BadAnalysisFPS' => 'Analysis FPS must be a positive integer or floating point value', // Added - 2015-07-22 + 'BadAnalysisUpdateDelay'=> 'Analysis update delay must be set to an integer of zero or more', // Added - 2015-07-23 'BadChannel' => 'Kanal peab olema integer, null või rohkem', 'BadColours' => 'Sihtmärgi värv peab olema pandud õige väärtus', // Added - 2011-06-15 'BadDevice' => 'Seadmel peab olema õige väärtus', diff --git a/web/lang/fr_fr.php b/web/lang/fr_fr.php index 14de0be0b..13986efec 100644 --- a/web/lang/fr_fr.php +++ b/web/lang/fr_fr.php @@ -97,6 +97,8 @@ $SLANG = array( 'AlarmRefImageBlendPct'=> '% fusion image référence en alarme', // Added - 2015-04-18 'Alert' => 'Alerte', 'All' => 'Tous', + 'AnalysisFPS' => 'i/s à traiter en analyse', // Added - 2015-07-22 + 'AnalysisUpdateDelay' => 'Délai mise à jour analyse', // Added - 2015-07-23 'Apply' => 'Appliquer', 'ApplyingStateChange' => 'Appl. chgt état', 'ArchArchived' => 'Archivé seul.', @@ -133,6 +135,8 @@ $SLANG = array( 'BackgroundFilter' => 'Lancer les filtres en arrière-plan', 'BadAlarmFrameCount' => 'Le nombre d\'images en alarme doit être un entier supérieur ou égal à 1', 'BadAlarmMaxFPS' => 'Le nombre maximum d\'i/s en alarme doit être un entier ou un nombre à virgule flottante supérieur à 0', + 'BadAnalysisFPS' => 'Le nombre d\'i/s à traiter en analyse doit être un entier ou un nombre à virgule flottante supérieur à 0', // Added - 2015-07-22 + 'BadAnalysisUpdateDelay'=> 'Le délai de mise à jour analyse doit être un nombre entier supérieur ou égal à 0', // Added - 2015-07-23 'BadChannel' => 'Le canal doit être un nombre entier supérieur ou égal à 0', 'BadColours' => 'La valeur de la couleur cible est invalide', // Added - 2011-06-15 'BadDevice' => 'Le chemin de l\'équipement être défini', diff --git a/web/lang/he_il.php b/web/lang/he_il.php index b7e89858c..c452b52bc 100644 --- a/web/lang/he_il.php +++ b/web/lang/he_il.php @@ -91,6 +91,8 @@ $SLANG = array( 'AlarmRefImageBlendPct'=> 'Alarm Reference Image Blend %ge', // Added - 2015-04-18 'Alert' => '', 'All' => '', + 'AnalysisFPS' => 'Analysis FPS', // Added - 2015-07-22 + 'AnalysisUpdateDelay' => 'Analysis Update Delay', // Added - 2015-07-23 'Apply' => '', 'ApplyingStateChange' => ' ', 'ArchArchived' => ' ', @@ -127,6 +129,8 @@ $SLANG = array( 'BackgroundFilter' => ' ', 'BadAlarmFrameCount' => 'Alarm frame count must be an integer of one or more', 'BadAlarmMaxFPS' => 'Alarm Maximum FPS must be a positive integer or floating point value', + 'BadAnalysisFPS' => 'Analysis FPS must be a positive integer or floating point value', // Added - 2015-07-22 + 'BadAnalysisUpdateDelay'=> 'Analysis update delay must be set to an integer of zero or more', // Added - 2015-07-23 'BadChannel' => 'Channel must be set to an integer of zero or more', 'BadColours' => 'Target colour must be set to a valid value', // Added - 2011-06-15 'BadDevice' => 'Device must be set to a valid value', diff --git a/web/lang/hu_hu.php b/web/lang/hu_hu.php index 6c97fa150..564e9d1f6 100644 --- a/web/lang/hu_hu.php +++ b/web/lang/hu_hu.php @@ -134,6 +134,8 @@ $SLANG = array( 'AlarmRefImageBlendPct'=> 'Alarm Reference Image Blend %ge', // Added - 2015-04-18 'Alert' => 'Figyelem', 'All' => 'Mind', + 'AnalysisFPS' => 'Analysis FPS', // Added - 2015-07-22 + 'AnalysisUpdateDelay' => 'Analysis Update Delay', // Added - 2015-07-23 'Apply' => 'Alkalmaz', 'ApplyingStateChange' => 'Állapot váltása...', 'ArchArchived' => 'Csak archivált', @@ -170,6 +172,8 @@ $SLANG = array( 'BackgroundFilter' => 'Szűrő automatikus futtatása a háttérben', 'BadAlarmFrameCount' => 'Riasztáshoz szükséges képkockák száma legyen legalább 1', 'BadAlarmMaxFPS' => 'Maximális FPS riasztott állapotban legyen megadva', + 'BadAnalysisFPS' => 'Analysis FPS must be a positive integer or floating point value', // Added - 2015-07-22 + 'BadAnalysisUpdateDelay'=> 'Analysis update delay must be set to an integer of zero or more', // Added - 2015-07-23 'BadChannel' => 'A csatorna száma legyen legalább 0', 'BadColours' => 'Target colour must be set to a valid value', // Added - 2015-04-18 'BadDevice' => 'Az eszköz elérése valós legyen', diff --git a/web/lang/it_it.php b/web/lang/it_it.php index b367da15a..22b03ef40 100644 --- a/web/lang/it_it.php +++ b/web/lang/it_it.php @@ -96,6 +96,8 @@ $SLANG = array( 'AlarmRefImageBlendPct'=> 'Alarm Reference Image Blend %ge', // Added - 2015-04-18 'Alert' => 'Attenzione', 'All' => 'Tutto', + 'AnalysisFPS' => 'Analysis FPS', // Added - 2015-07-22 + 'AnalysisUpdateDelay' => 'Analysis Update Delay', // Added - 2015-07-23 'Apply' => 'Applica', 'ApplyingStateChange' => 'Sto applicando le modifiche', 'ArchArchived' => 'Archiviato', @@ -132,6 +134,8 @@ $SLANG = array( 'BackgroundFilter' => 'Esegui filtro in background', 'BadAlarmFrameCount' => 'Il numero di frame di un allarme deve essere un numero intero superiore a uno', 'BadAlarmMaxFPS' => 'Il numero massimo di FPS dell\'allarme deve essere un numero intero positivo o un valore in virgola mobile', + 'BadAnalysisFPS' => 'Analysis FPS must be a positive integer or floating point value', // Added - 2015-07-22 + 'BadAnalysisUpdateDelay'=> 'Analysis update delay must be set to an integer of zero or more', // Added - 2015-07-23 'BadChannel' => 'Il canale deve essere settato con un numero intero uguale o maggiore di zero', 'BadColours' => 'Target colour must be set to a valid value', // Added - 2011-06-15 'BadDevice' => 'Il dispositivo deve essere impostato con un valore valido', diff --git a/web/lang/ja_jp.php b/web/lang/ja_jp.php index 9f0134f0a..be18787e4 100644 --- a/web/lang/ja_jp.php +++ b/web/lang/ja_jp.php @@ -91,6 +91,8 @@ $SLANG = array( 'AlarmRefImageBlendPct'=> 'Alarm Reference Image Blend %ge', // Added - 2015-04-18 'Alert' => 'x', 'All' => 'S', + 'AnalysisFPS' => 'Analysis FPS', // Added - 2015-07-22 + 'AnalysisUpdateDelay' => 'Analysis Update Delay', // Added - 2015-07-23 'Apply' => 'Kp', 'ApplyingStateChange' => 'ύXKp', 'ArchArchived' => 'ۑ̂', @@ -127,6 +129,8 @@ $SLANG = array( 'BackgroundFilter' => 'Run filter in background', 'BadAlarmFrameCount' => 'Alarm frame count must be an integer of one or more', 'BadAlarmMaxFPS' => 'Alarm Maximum FPS must be a positive integer or floating point value', + 'BadAnalysisFPS' => 'Analysis FPS must be a positive integer or floating point value', // Added - 2015-07-22 + 'BadAnalysisUpdateDelay'=> 'Analysis update delay must be set to an integer of zero or more', // Added - 2015-07-23 'BadChannel' => 'Channel must be set to an integer of zero or more', 'BadColours' => 'Target colour must be set to a valid value', // Added - 2011-06-15 'BadDevice' => 'Device must be set to a valid value', diff --git a/web/lang/nl_nl.php b/web/lang/nl_nl.php index 298521b6a..4c3f6a060 100644 --- a/web/lang/nl_nl.php +++ b/web/lang/nl_nl.php @@ -91,6 +91,8 @@ $SLANG = array( 'AlarmRefImageBlendPct'=> 'Alarm Reference Image Blend %ge', // Added - 2015-04-18 'Alert' => 'Waarschuwing', 'All' => 'Alle', + 'AnalysisFPS' => 'Analysis FPS', // Added - 2015-07-22 + 'AnalysisUpdateDelay' => 'Analysis Update Delay', // Added - 2015-07-23 'Apply' => 'Voer uit', 'ApplyingStateChange' => 'Status verandering aan het uitvoeren', 'ArchArchived' => 'Alleen gearchiveerd', @@ -127,6 +129,8 @@ $SLANG = array( 'BackgroundFilter' => 'Run filter in achtergrond', 'BadAlarmFrameCount' => 'Alarm frame moet een getal zijn van 1 of meer', 'BadAlarmMaxFPS' => 'Alarm Maximum FPS moet een positiev getal zijn of een floating point waarde', + 'BadAnalysisFPS' => 'Analysis FPS must be a positive integer or floating point value', // Added - 2015-07-22 + 'BadAnalysisUpdateDelay'=> 'Analysis update delay must be set to an integer of zero or more', // Added - 2015-07-23 'BadChannel' => 'Kanaal moet een getal zijn van 1 of meer', 'BadColours' => 'Target colour must be set to a valid value', // Added - 2015-04-18 'BadDevice' => 'Apparaat moet een bestaande waarde krijgen', diff --git a/web/lang/pl_pl.php b/web/lang/pl_pl.php index 71c4bbac6..14688e189 100644 --- a/web/lang/pl_pl.php +++ b/web/lang/pl_pl.php @@ -91,6 +91,8 @@ $SLANG = array( 'AlarmRefImageBlendPct'=> 'Alarm Reference Image Blend %ge', // Added - 2015-04-18 'Alert' => 'Gotowosc', 'All' => 'Wszystko', + 'AnalysisFPS' => 'Analysis FPS', // Added - 2015-07-22 + 'AnalysisUpdateDelay' => 'Analysis Update Delay', // Added - 2015-07-23 'Apply' => 'Zastosuj', 'ApplyingStateChange' => 'Zmieniam stan pracy', 'ArchArchived' => 'Tylko zarchiwizowane', @@ -127,6 +129,8 @@ $SLANG = array( 'BackgroundFilter' => 'Run filter in background', 'BadAlarmFrameCount' => 'Alarm frame count must be an integer of one or more', 'BadAlarmMaxFPS' => 'Alarm Maximum FPS must be a positive integer or floating point value', + 'BadAnalysisFPS' => 'Analysis FPS must be a positive integer or floating point value', // Added - 2015-07-22 + 'BadAnalysisUpdateDelay'=> 'Analysis update delay must be set to an integer of zero or more', // Added - 2015-07-23 'BadChannel' => 'Channel must be set to an integer of zero or more', 'BadColours' => 'Target colour must be set to a valid value', // Added - 2011-06-15 'BadDevice' => 'Device must be set to a valid value', diff --git a/web/lang/pt_br.php b/web/lang/pt_br.php index d079db359..6ac24a837 100644 --- a/web/lang/pt_br.php +++ b/web/lang/pt_br.php @@ -31,6 +31,8 @@ $SLANG = array( 'AlarmRefImageBlendPct'=> 'Alarm Reference Image Blend %ge', // Added - 2015-04-18 'Alert' => 'Alerta', 'All' => 'Tudo', + 'AnalysisFPS' => 'Analysis FPS', // Added - 2015-07-22 + 'AnalysisUpdateDelay' => 'Analysis Update Delay', // Added - 2015-07-23 'Apply' => 'Aplicar', 'ApplyingStateChange' => 'Aplicando mudana de estado', 'ArchArchived' => 'Somente Arquivados', @@ -67,6 +69,8 @@ $SLANG = array( 'BackgroundFilter' => 'Run filter in background', 'BadAlarmFrameCount' => 'Alarm frame count must be an integer of one or more', 'BadAlarmMaxFPS' => 'Alarm Maximum FPS must be a positive integer or floating point value', + 'BadAnalysisFPS' => 'Analysis FPS must be a positive integer or floating point value', // Added - 2015-07-22 + 'BadAnalysisUpdateDelay'=> 'Analysis update delay must be set to an integer of zero or more', // Added - 2015-07-23 'BadChannel' => 'Channel must be set to an integer of zero or more', 'BadColours' => 'Target colour must be set to a valid value', // Added - 2011-06-15 'BadDevice' => 'Device must be set to a valid value', diff --git a/web/lang/ro_ro.php b/web/lang/ro_ro.php index 1b1bcb6dc..761a24527 100644 --- a/web/lang/ro_ro.php +++ b/web/lang/ro_ro.php @@ -62,6 +62,8 @@ $SLANG = array( 'AlarmRefImageBlendPct'=> 'Alarm Reference Image Blend %ge', // Added - 2015-04-18 'Alert' => 'Alert', 'All' => 'Toate', + 'AnalysisFPS' => 'Analysis FPS', // Added - 2015-07-22 + 'AnalysisUpdateDelay' => 'Analysis Update Delay', // Added - 2015-07-23 'Apply' => 'Accept', 'ApplyingStateChange' => 'Aplic schimbarea de stare', 'ArchArchived' => 'Numai arhivate', @@ -98,6 +100,8 @@ $SLANG = array( 'BackgroundFilter' => 'Run filter in background', 'BadAlarmFrameCount' => 'Alarm frame count must be an integer of one or more', 'BadAlarmMaxFPS' => 'Alarm Maximum FPS must be a positive integer or floating point value', + 'BadAnalysisFPS' => 'Analysis FPS must be a positive integer or floating point value', // Added - 2015-07-22 + 'BadAnalysisUpdateDelay'=> 'Analysis update delay must be set to an integer of zero or more', // Added - 2015-07-23 'BadChannel' => 'Channel must be set to an integer of zero or more', 'BadColours' => 'Target colour must be set to a valid value', // Added - 2011-06-15 'BadDevice' => 'Device must be set to a valid value', diff --git a/web/lang/ru_ru.php b/web/lang/ru_ru.php index 7c98e4f48..64f7a8ec7 100644 --- a/web/lang/ru_ru.php +++ b/web/lang/ru_ru.php @@ -91,6 +91,8 @@ $SLANG = array( 'AlarmRefImageBlendPct'=> 'Alarm Reference Image Blend %ge', // Added - 2015-04-18 'Alert' => '', 'All' => '', + 'AnalysisFPS' => 'Analysis FPS', // Added - 2015-07-22 + 'AnalysisUpdateDelay' => 'Analysis Update Delay', // Added - 2015-07-23 'Apply' => '', 'ApplyingStateChange' => ' ', 'ArchArchived' => ' ', @@ -127,6 +129,8 @@ $SLANG = array( 'BackgroundFilter' => 'Run filter in background', 'BadAlarmFrameCount' => 'Alarm frame count must be an integer of one or more', 'BadAlarmMaxFPS' => 'Alarm Maximum FPS must be a positive integer or floating point value', + 'BadAnalysisFPS' => 'Analysis FPS must be a positive integer or floating point value', // Added - 2015-07-22 + 'BadAnalysisUpdateDelay'=> 'Analysis update delay must be set to an integer of zero or more', // Added - 2015-07-23 'BadChannel' => 'Channel must be set to an integer of zero or more', 'BadColours' => 'Target colour must be set to a valid value', // Added - 2011-06-15 'BadDevice' => 'Device must be set to a valid value', diff --git a/web/lang/se_se.php b/web/lang/se_se.php index ca4f05254..eaa712259 100644 --- a/web/lang/se_se.php +++ b/web/lang/se_se.php @@ -92,6 +92,8 @@ $SLANG = array( 'AlarmRefImageBlendPct'=> 'Alarm Reference Image Blend %ge', // Added - 2015-04-18 'Alert' => 'Varning', 'All' => 'Alla', + 'AnalysisFPS' => 'Analysis FPS', // Added - 2015-07-22 + 'AnalysisUpdateDelay' => 'Analysis Update Delay', // Added - 2015-07-23 'Apply' => 'Lgg till', 'ApplyingStateChange' => 'Aktivera statusndring', 'ArchArchived' => 'Arkivera endast', @@ -128,6 +130,8 @@ $SLANG = array( 'BackgroundFilter' => 'Kr filter i bakgrunden', 'BadAlarmFrameCount' => 'Ramantalet fr larm mste vara ett heltal, minsta vrdet r 1', 'BadAlarmMaxFPS' => 'Larm fr bilder/s mste vara ett positivt heltal eller ett flyttal', + 'BadAnalysisFPS' => 'Analysis FPS must be a positive integer or floating point value', // Added - 2015-07-22 + 'BadAnalysisUpdateDelay'=> 'Analysis update delay must be set to an integer of zero or more', // Added - 2015-07-23 'BadChannel' => 'Kanalen mste vara ett heltal, noll eller hgre', 'BadColours' => 'Target colour must be set to a valid value', // Added - 2011-06-15 'BadDevice' => 'Enheten mste sttas till ett giltigt vrde', diff --git a/web/skins/classic/views/js/monitor.js.php b/web/skins/classic/views/js/monitor.js.php index 2d017129b..1ceba3fff 100644 --- a/web/skins/classic/views/js/monitor.js.php +++ b/web/skins/classic/views/js/monitor.js.php @@ -63,7 +63,9 @@ function validateForm( form ) errors[errors.length] = ""; else if ( form.elements.mid.value == 0 && monitorNames[form.elements['newMonitor[Name]'].value] ) errors[errors.length] = ""; - + + if ( form.elements['newMonitor[AnalysisFPS]'].value && !(parseFloat(form.elements['newMonitor[AnalysisFPS]'].value) > 0 ) ) + errors[errors.length] = ""; if ( form.elements['newMonitor[MaxFPS]'].value && !(parseFloat(form.elements['newMonitor[MaxFPS]'].value) > 0 ) ) errors[errors.length] = ""; if ( form.elements['newMonitor[AlarmMaxFPS]'].value && !(parseFloat(form.elements['newMonitor[AlarmMaxFPS]'].value) > 0 ) ) @@ -119,6 +121,8 @@ function validateForm( form ) errors[errors.length] = ""; if ( !form.elements['newMonitor[SectionLength]'].value || !(parseInt(form.elements['newMonitor[SectionLength]'].value) >= 30 ) ) errors[errors.length] = ""; + if ( !form.elements['newMonitor[AnalysisUpdateDelay]'].value || !(parseInt(form.elements['newMonitor[AnalysisUpdateDelay]'].value) >= 0 ) ) + errors[errors.length] = ""; if ( !form.elements['newMonitor[FPSReportInterval]'].value || !(parseInt(form.elements['newMonitor[FPSReportInterval]'].value) >= 0 ) ) errors[errors.length] = ""; if ( !form.elements['newMonitor[FrameSkip]'].value || !(parseInt(form.elements['newMonitor[FrameSkip]'].value) >= 0 ) ) diff --git a/web/skins/classic/views/monitor.php b/web/skins/classic/views/monitor.php index 432d90ecb..5920409ad 100644 --- a/web/skins/classic/views/monitor.php +++ b/web/skins/classic/views/monitor.php @@ -102,6 +102,8 @@ if ( ! empty($_REQUEST['mid']) ) { 'FrameSkip' => 0, 'MotionFrameSkip' => 0, 'EventPrefix' => 'Event-', + 'AnalysisFPS' => "", + 'AnalysisUpdateDelay' => 0, 'MaxFPS' => "", 'AlarmMaxFPS' => "", 'FPSReportInterval' => 1000, @@ -148,6 +150,8 @@ else $newX10Monitor = $x10Monitor; } +if ( $newMonitor['AnalysisFPS'] == '0.00' ) + $newMonitor['AnalysisFPS'] = ''; if ( $newMonitor['MaxFPS'] == '0.00' ) $newMonitor['MaxFPS'] = ''; if ( $newMonitor['AlarmMaxFPS'] == '0.00' ) @@ -496,6 +500,7 @@ if ( $tab != 'general' ) + "/> + @@ -673,6 +679,7 @@ switch ( $tab ) +