From 181a8c29e105f6865236b8a656fbf6492160350f Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Tue, 6 Nov 2018 15:28:37 -0500 Subject: [PATCH 1/5] Add SaveJPEGs to Event --- scripts/ZoneMinder/lib/ZoneMinder/Event.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Event.pm b/scripts/ZoneMinder/lib/ZoneMinder/Event.pm index bb0923c99..d1394dd29 100644 --- a/scripts/ZoneMinder/lib/ZoneMinder/Event.pm +++ b/scripts/ZoneMinder/lib/ZoneMinder/Event.pm @@ -86,6 +86,7 @@ $serial = $primary_key = 'Id'; StateId Orientation DiskSpace + SaveJPEGs ); %defaults = ( Cause => q`'Unknown'`, From f86ed5c66cc1e6c0b52f802d4a8cfefd31fbcdc9 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Tue, 6 Nov 2018 15:28:56 -0500 Subject: [PATCH 2/5] allow interactive=0 and use Inf for log lines about resurecting events --- scripts/zmrecover.pl.in | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/zmrecover.pl.in b/scripts/zmrecover.pl.in index 5d1942ce2..5a6b5b0f9 100644 --- a/scripts/zmrecover.pl.in +++ b/scripts/zmrecover.pl.in @@ -46,7 +46,7 @@ logInit(); GetOptions( force =>\$force, - interactive =>\$interactive, + 'interactive=i' =>\$interactive, 'monitor_id=i' =>\$monitor_id, report =>\$report, 'server_id=i' =>\$server_id, @@ -233,7 +233,7 @@ Debug("@Monitors"); $Event->recover_timestamps(); $Event->save({}, 1); - Debug("Event resurrected as " . $Event->to_string() ); + Info("Event resurrected as " . $Event->to_string() ); next; } # end if resurrection } # event path exists @@ -340,7 +340,7 @@ Debug("@Monitors"); $Event = new ZoneMinder::Event(); $$Event{Id} = $event_id; $$Event{Path} = join('/', $Storage->Path(), $event_dir ); - Debug("Have event $$Event{Id} at $$Event{Path}"); + Info("Have event $$Event{Id} at $$Event{Path}"); if ( confirm() ) { $$Event{Scheme} = 'Medium'; $$Event{RelativePath} = $event_dir; @@ -352,7 +352,7 @@ Debug("@Monitors"); $Event->StorageId( $Storage->Id() ); $Event->recover_timestamps(); $Event->save({}, 1); - Debug("Event resurrected as " . $Event->to_string() ); + Info("Event resurrected as " . $Event->to_string() ); } } # end foreach event } # end search for Medium @@ -377,7 +377,7 @@ Debug("@Monitors"); } $$Event{Id} = $event; $$Event{Path} = join('/', $Storage->Path(), $event ); - Debug("Have event $$Event{Id} at $$Event{Path}"); + Info("Have event $$Event{Id} at $$Event{Path}"); if ( confirm() ) { $$Event{Scheme} = 'Shallow'; $$Event{Name} = "Event $event recovered"; From c60bd3af1e2662c18a96e85627a0eaa6e890483c Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Tue, 6 Nov 2018 15:43:22 -0500 Subject: [PATCH 3/5] Need to new an Event --- scripts/zmrecover.pl.in | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/zmrecover.pl.in b/scripts/zmrecover.pl.in index 5a6b5b0f9..4a3858a70 100644 --- a/scripts/zmrecover.pl.in +++ b/scripts/zmrecover.pl.in @@ -375,6 +375,7 @@ Debug("@Monitors"); Debug("Found an event in db for $event"); next; } + $Event = new openprint::Event(); $$Event{Id} = $event; $$Event{Path} = join('/', $Storage->Path(), $event ); Info("Have event $$Event{Id} at $$Event{Path}"); From 5495ab80364ea543c2500e4c93f77fec619f6e9d Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Tue, 6 Nov 2018 16:15:27 -0500 Subject: [PATCH 4/5] Fix package for Event --- scripts/zmrecover.pl.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/zmrecover.pl.in b/scripts/zmrecover.pl.in index 4a3858a70..6b8f3831f 100644 --- a/scripts/zmrecover.pl.in +++ b/scripts/zmrecover.pl.in @@ -375,7 +375,7 @@ Debug("@Monitors"); Debug("Found an event in db for $event"); next; } - $Event = new openprint::Event(); + $Event = new ZoneMinder::Event(); $$Event{Id} = $event; $$Event{Path} = join('/', $Storage->Path(), $event ); Info("Have event $$Event{Id} at $$Event{Path}"); From 9a96785fa424f491a7f25b0c932f2403ea807bad Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Tue, 6 Nov 2018 20:37:00 -0500 Subject: [PATCH 5/5] Add in Frame.php --- scripts/ZoneMinder/lib/ZoneMinder/Frame.pm | 78 ++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 scripts/ZoneMinder/lib/ZoneMinder/Frame.pm diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Frame.pm b/scripts/ZoneMinder/lib/ZoneMinder/Frame.pm new file mode 100644 index 000000000..6ce8f9ca0 --- /dev/null +++ b/scripts/ZoneMinder/lib/ZoneMinder/Frame.pm @@ -0,0 +1,78 @@ +# ========================================================================== +# +# ZoneMinder Monitor Module, $Date$, $Revision$ +# Copyright (C) 2001-2008 Philip Coombes +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# ========================================================================== +# +# This module contains the common definitions and functions used by the rest +# of the ZoneMinder scripts +# +package ZoneMinder::Frame; + +use 5.006; +use strict; +use warnings; + +require ZoneMinder::Base; +require ZoneMinder::Object; + +use parent qw(ZoneMinder::Object); + +use vars qw/ $table $primary_key %fields /; +$table = 'Frames'; +$primary_key = 'Id'; + +%fields = ( + Id => 'Id', + EventId => 'EventId', + FrameId => 'FrameId', + Type => 'Type', + TimeStamp => 'TimeStamp', + Delta => 'Delta', + Score => 'Score', +); + +sub Event { + return new ZoneMinder::Event( $_[0]{EventId} ); +} # end sub Event + +1; +__END__ + +=head1 NAME + +ZoneMinder::Frame - Perl Class for Frames + +=head1 SYNOPSIS + +use ZoneMinder::Frame; + +=head1 AUTHOR + +Isaac Connor, Eisaac@zoneminder.comE + +=head1 COPYRIGHT AND LICENSE + +Copyright (C) 2001-2017 ZoneMinder LLC + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.3 or, +at your option, any later version of Perl 5 you may have available. + + +=cut