Merge branch 'master' of github.com:zoneminder/ZoneMinder
This commit is contained in:
commit
958a6b8218
|
@ -434,6 +434,7 @@ DROP TABLE IF EXISTS `Monitors`;
|
||||||
CREATE TABLE `Monitors` (
|
CREATE TABLE `Monitors` (
|
||||||
`Id` int(10) unsigned NOT NULL auto_increment,
|
`Id` int(10) unsigned NOT NULL auto_increment,
|
||||||
`Name` varchar(64) NOT NULL default '',
|
`Name` varchar(64) NOT NULL default '',
|
||||||
|
`Notes` TEXT NOT NULL default '',
|
||||||
`ServerId` int(10) unsigned,
|
`ServerId` int(10) unsigned,
|
||||||
`StorageId` smallint(5) unsigned default 0,
|
`StorageId` smallint(5) unsigned default 0,
|
||||||
`Type` enum('Local','Remote','File','Ffmpeg','Libvlc','cURL','WebSite','NVSocket') NOT NULL default 'Local',
|
`Type` enum('Local','Remote','File','Ffmpeg','Libvlc','cURL','WebSite','NVSocket') NOT NULL default 'Local',
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
|
||||||
|
SET @s = (SELECT IF(
|
||||||
|
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema = DATABASE()
|
||||||
|
AND table_name = 'Monitors'
|
||||||
|
AND column_name = 'Notes'
|
||||||
|
) > 0,
|
||||||
|
"SELECT 'Column Notes already exists in Monitors'",
|
||||||
|
"ALTER TABLE `Monitors` ADD `Notes` TEXT NOT NULL default '' AFTER `Name`"
|
||||||
|
));
|
||||||
|
|
||||||
|
PREPARE stmt FROM @s;
|
||||||
|
EXECUTE stmt;
|
|
@ -23,7 +23,7 @@
|
||||||
%global _hardened_build 1
|
%global _hardened_build 1
|
||||||
|
|
||||||
Name: zoneminder
|
Name: zoneminder
|
||||||
Version: 1.33.15
|
Version: 1.33.16
|
||||||
Release: 1%{?dist}
|
Release: 1%{?dist}
|
||||||
Summary: A camera monitoring and analysis tool
|
Summary: A camera monitoring and analysis tool
|
||||||
Group: System Environment/Daemons
|
Group: System Environment/Daemons
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# ==========================================================================
|
# ==========================================================================
|
||||||
#
|
#
|
||||||
# ZoneMinder Airlink SkyIPCam AICN747/AICN747W Control Protocol Module, $Date: 2008-09-13 17:30:29 +0000 (Sat, 13 Sept 2008) $, $Revision: 2229 $
|
# ZoneMinder Airlink SkyIPCam AICN747/AICN747W Control Protocol Module
|
||||||
# Copyright (C) 2008 Brian Rudy (brudyNO@SPAMpraecogito.com)
|
# Copyright (C) 2008 Brian Rudy (brudyNO@SPAMpraecogito.com)
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
|
@ -43,8 +43,6 @@ our @ISA = qw(ZoneMinder::Control);
|
||||||
use ZoneMinder::Logger qw(:all);
|
use ZoneMinder::Logger qw(:all);
|
||||||
use ZoneMinder::Config qw(:all);
|
use ZoneMinder::Config qw(:all);
|
||||||
|
|
||||||
use Time::HiRes qw( usleep );
|
|
||||||
|
|
||||||
sub open {
|
sub open {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
|
@ -52,58 +50,50 @@ sub open {
|
||||||
|
|
||||||
use LWP::UserAgent;
|
use LWP::UserAgent;
|
||||||
$self->{ua} = LWP::UserAgent->new;
|
$self->{ua} = LWP::UserAgent->new;
|
||||||
$self->{ua}->agent( "ZoneMinder Control Agent/".ZoneMinder::Base::ZM_VERSION );
|
$self->{ua}->agent('ZoneMinder Control Agent/'.ZoneMinder::Base::ZM_VERSION);
|
||||||
|
|
||||||
$self->{state} = 'open';
|
$self->{state} = 'open';
|
||||||
}
|
}
|
||||||
|
|
||||||
sub printMsg {
|
|
||||||
my $self = shift;
|
|
||||||
my $msg = shift;
|
|
||||||
my $msg_len = length($msg);
|
|
||||||
|
|
||||||
Debug( $msg."[".$msg_len."]" );
|
|
||||||
}
|
|
||||||
|
|
||||||
sub sendCmd {
|
sub sendCmd {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my $cmd = shift;
|
my $cmd = shift;
|
||||||
|
|
||||||
my $result = undef;
|
my $result = undef;
|
||||||
|
|
||||||
printMsg( $cmd, "Tx" );
|
$self->printMsg($cmd, 'Tx');
|
||||||
|
|
||||||
my $url;
|
my $url;
|
||||||
if ( $self->{Monitor}->{ControlAddress} =~ /^http/ ) {
|
if ( $self->{Monitor}->{ControlAddress} =~ /^http/i ) {
|
||||||
$url = $self->{Monitor}->{ControlAddress}.$cmd;
|
$url = $self->{Monitor}->{ControlAddress}.$cmd;
|
||||||
} else {
|
} else {
|
||||||
$url = 'http://'.$self->{Monitor}->{ControlAddress}.$cmd;
|
$url = 'http://'.$self->{Monitor}->{ControlAddress}.$cmd;
|
||||||
} # en dif
|
} # end if
|
||||||
my $req = HTTP::Request->new( GET=>$url );
|
my $req = HTTP::Request->new(GET=>$url);
|
||||||
|
|
||||||
my $res = $self->{ua}->request($req);
|
my $res = $self->{ua}->request($req);
|
||||||
|
|
||||||
if ( $res->is_success ) {
|
if ( $res->is_success ) {
|
||||||
$result = !undef;
|
$result = !undef;
|
||||||
} else {
|
} else {
|
||||||
Error( "Error check failed: '".$res->status_line()."'" );
|
Error('Error check failed: \''.$res->status_line().'\'');
|
||||||
}
|
}
|
||||||
|
|
||||||
return( $result );
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub reset {
|
sub reset {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
Debug( "Camera Reset" );
|
Debug('Camera Reset');
|
||||||
my $cmd = "/admin/ptctl.cgi?move=reset";
|
my $cmd = '/admin/ptctl.cgi?move=reset';
|
||||||
$self->sendCmd( $cmd );
|
$self->sendCmd($cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
sub moveMap {
|
sub moveMap {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my $params = shift;
|
my $params = shift;
|
||||||
my $xcoord = $self->getParam( $params, 'xcoord' );
|
my $xcoord = $self->getParam($params, 'xcoord');
|
||||||
my $ycoord = $self->getParam( $params, 'ycoord' );
|
my $ycoord = $self->getParam($params, 'ycoord');
|
||||||
|
|
||||||
my $hor = $xcoord * 100 / $self->{Monitor}->{Width};
|
my $hor = $xcoord * 100 / $self->{Monitor}->{Width};
|
||||||
my $ver = $ycoord * 100 / $self->{Monitor}->{Height};
|
my $ver = $ycoord * 100 / $self->{Monitor}->{Height};
|
||||||
|
@ -125,81 +115,81 @@ sub moveMap {
|
||||||
elsif ( $hor > 50 ) {
|
elsif ( $hor > 50 ) {
|
||||||
# right
|
# right
|
||||||
$horSteps = (($hor - 50) / 50) * $maxhor;
|
$horSteps = (($hor - 50) / 50) * $maxhor;
|
||||||
$horDir = "right";
|
$horDir = 'right';
|
||||||
}
|
}
|
||||||
|
|
||||||
# Vertical movement
|
# Vertical movement
|
||||||
if ( $ver < 50 ) {
|
if ( $ver < 50 ) {
|
||||||
# up
|
# up
|
||||||
$verSteps = ((50 - $ver) / 50) * $maxver;
|
$verSteps = ((50 - $ver) / 50) * $maxver;
|
||||||
$verDir = "up";
|
$verDir = 'up';
|
||||||
}
|
}
|
||||||
elsif ( $ver > 50 ) {
|
elsif ( $ver > 50 ) {
|
||||||
# down
|
# down
|
||||||
$verSteps = (($ver - 50) / 50) * $maxver;
|
$verSteps = (($ver - 50) / 50) * $maxver;
|
||||||
$verDir = "down";
|
$verDir = 'down';
|
||||||
}
|
}
|
||||||
|
|
||||||
my $v = int($verSteps);
|
my $v = int($verSteps);
|
||||||
my $h = int($horSteps);
|
my $h = int($horSteps);
|
||||||
|
|
||||||
Debug( "Move Map to $xcoord,$ycoord, hor=$h $horDir, ver=$v $verDir");
|
Debug("Move Map to $xcoord,$ycoord, hor=$h $horDir, ver=$v $verDir");
|
||||||
my $cmd = "/cgi/admin/ptctrl.cgi?action=movedegree&Cmd=$horDir&Degree=$h";
|
my $cmd = "/cgi/admin/ptctrl.cgi?action=movedegree&Cmd=$horDir&Degree=$h";
|
||||||
$self->sendCmd( $cmd );
|
$self->sendCmd($cmd);
|
||||||
$cmd = "/cgi/admin/ptctrl.cgi?action=movedegree&Cmd=$verDir&Degree=$v";
|
$cmd = "/cgi/admin/ptctrl.cgi?action=movedegree&Cmd=$verDir&Degree=$v";
|
||||||
$self->sendCmd( $cmd );
|
$self->sendCmd($cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
sub moveRelUp {
|
sub moveRelUp {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my $params = shift;
|
my $params = shift;
|
||||||
my $step = $self->getParam( $params, 'tiltstep' );
|
my $step = $self->getParam($params, 'tiltstep');
|
||||||
Debug( "Step Up $step" );
|
Debug("Step Up $step");
|
||||||
my $cmd = "/admin/ptctl.cgi?move=up";
|
my $cmd = '/admin/ptctl.cgi?move=up';
|
||||||
$self->sendCmd( $cmd );
|
$self->sendCmd($cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
sub moveRelDown {
|
sub moveRelDown {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my $params = shift;
|
my $params = shift;
|
||||||
my $step = $self->getParam( $params, 'tiltstep' );
|
my $step = $self->getParam($params, 'tiltstep');
|
||||||
Debug( "Step Down $step" );
|
Debug("Step Down $step");
|
||||||
my $cmd = "/admin/ptctl.cgi?move=down";
|
my $cmd = '/admin/ptctl.cgi?move=down';
|
||||||
$self->sendCmd( $cmd );
|
$self->sendCmd($cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
sub moveRelLeft {
|
sub moveRelLeft {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my $params = shift;
|
my $params = shift;
|
||||||
my $step = $self->getParam( $params, 'panstep' );
|
my $step = $self->getParam($params, 'panstep');
|
||||||
|
|
||||||
if ( $self->{Monitor}->{Orientation} eq "hori" ) {
|
if ( $self->{Monitor}->{Orientation} eq 'FLIP_HORI' ) {
|
||||||
Debug( "Stepping Right because flipped horizontally " );
|
Debug('Stepping Right because flipped horizontally');
|
||||||
$self->sendCmd( "/admin/ptctl.cgi?move=right" );
|
$self->sendCmd('/admin/ptctl.cgi?move=right');
|
||||||
} else {
|
} else {
|
||||||
Debug( "Step Left" );
|
Debug('Step Left');
|
||||||
$self->sendCmd( "/admin/ptctl.cgi?move=left" );
|
$self->sendCmd('/admin/ptctl.cgi?move=left');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sub moveRelRight {
|
sub moveRelRight {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my $params = shift;
|
my $params = shift;
|
||||||
my $step = $self->getParam( $params, 'panstep' );
|
my $step = $self->getParam($params, 'panstep');
|
||||||
if ( $self->{Monitor}->{Orientation} eq "hori" ) {
|
if ( $self->{Monitor}->{Orientation} eq 'FLIP_HORI' ) {
|
||||||
Debug( "Stepping Left because flipped horizontally " );
|
Debug('Stepping Left because flipped horizontally');
|
||||||
$self->sendCmd( "/admin/ptctl.cgi?move=left" );
|
$self->sendCmd('/admin/ptctl.cgi?move=left');
|
||||||
} else {
|
} else {
|
||||||
Debug( "Step Right" );
|
Debug('Step Right');
|
||||||
$self->sendCmd( "/admin/ptctl.cgi?move=right" );
|
$self->sendCmd('/admin/ptctl.cgi?move=right');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sub presetClear {
|
sub presetClear {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my $params = shift;
|
my $params = shift;
|
||||||
my $preset = $self->getParam( $params, 'preset' );
|
my $preset = $self->getParam($params, 'preset');
|
||||||
Debug( "Clear Preset $preset" );
|
Debug("Clear Preset $preset");
|
||||||
#my $cmd = "/axis-cgi/com/ptz.cgi?removeserverpresetno=$preset";
|
#my $cmd = "/axis-cgi/com/ptz.cgi?removeserverpresetno=$preset";
|
||||||
#$self->sendCmd( $cmd );
|
#$self->sendCmd( $cmd );
|
||||||
}
|
}
|
||||||
|
@ -207,26 +197,26 @@ sub presetClear {
|
||||||
sub presetSet {
|
sub presetSet {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my $params = shift;
|
my $params = shift;
|
||||||
my $preset = $self->getParam( $params, 'preset' );
|
my $preset = $self->getParam($params, 'preset');
|
||||||
Debug( "Set Preset $preset" );
|
Debug("Set Preset $preset");
|
||||||
my $cmd = "/admin/ptctl.cgi?position=" . ($preset - 1) . "&positionname=zm$preset";
|
my $cmd = '/admin/ptctl.cgi?position=' . ($preset - 1) . "&positionname=zm$preset";
|
||||||
$self->sendCmd( $cmd );
|
$self->sendCmd( $cmd );
|
||||||
}
|
}
|
||||||
|
|
||||||
sub presetGoto {
|
sub presetGoto {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my $params = shift;
|
my $params = shift;
|
||||||
my $preset = $self->getParam( $params, 'preset' );
|
my $preset = $self->getParam($params, 'preset');
|
||||||
Debug( "Goto Preset $preset" );
|
Debug("Goto Preset $preset");
|
||||||
my $cmd = "/admin/ptctl.cgi?move=p" . ($preset - 1);
|
my $cmd = '/admin/ptctl.cgi?move=p'.($preset - 1);
|
||||||
$self->sendCmd( $cmd );
|
$self->sendCmd($cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
sub presetHome {
|
sub presetHome {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
Debug( "Home Preset" );
|
Debug('Home Preset');
|
||||||
my $cmd = "/admin/ptctl.cgi?move=h";
|
my $cmd = '/admin/ptctl.cgi?move=h';
|
||||||
$self->sendCmd( $cmd );
|
$self->sendCmd($cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
|
|
@ -77,16 +77,24 @@ class GroupsController extends AppController {
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->Group->create();
|
$this->Group->create();
|
||||||
if ( $this->Group->save($this->request->data) ) {
|
|
||||||
|
if ( $this->request->data['Group']['MonitorIds'] and ! isset($this->request->data['Monitor']) ) {
|
||||||
|
$this->request->data['Monitor'] = explode(',', $this->request->data['Group']['MonitorIds']);
|
||||||
|
unset($this->request->data['Group']['MonitorIds']);
|
||||||
|
}
|
||||||
|
if ( $this->Group->saveAssociated($this->request->data, array('atomic'=>true)) ) {
|
||||||
return $this->flash(
|
return $this->flash(
|
||||||
__('The group has been saved.'),
|
__('The group has been saved.'),
|
||||||
array('action' => 'index')
|
array('action' => 'index')
|
||||||
);
|
);
|
||||||
}
|
} else {
|
||||||
}
|
ZM\Error("Failed to save Group");
|
||||||
$monitors = $this->Group->Monitor->find('list');
|
debug($this->Group->invalidFields());
|
||||||
|
}
|
||||||
|
} # end if post
|
||||||
|
$monitors = $this->Group->Monitor->find('list');
|
||||||
$this->set(compact('monitors'));
|
$this->set(compact('monitors'));
|
||||||
}
|
} # end add
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* edit method
|
* edit method
|
||||||
|
|
|
@ -59,7 +59,7 @@ class Group extends AppModel {
|
||||||
*
|
*
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
public $hasMany = array(
|
public $hasAndBelongsToMany = array(
|
||||||
'Monitor' => array(
|
'Monitor' => array(
|
||||||
'className' => 'Monitor',
|
'className' => 'Monitor',
|
||||||
'joinTable' => 'Groups_Monitors',
|
'joinTable' => 'Groups_Monitors',
|
||||||
|
|
|
@ -9,111 +9,112 @@ require_once('Storage.php');
|
||||||
class Monitor extends ZM_Object {
|
class Monitor extends ZM_Object {
|
||||||
protected static $table = 'Monitors';
|
protected static $table = 'Monitors';
|
||||||
|
|
||||||
protected $defaults = array(
|
protected $defaults = array(
|
||||||
'Id' => null,
|
'Id' => null,
|
||||||
'Name' => '',
|
'Name' => '',
|
||||||
'ServerId' => 0,
|
'Notes' => '',
|
||||||
'StorageId' => 0,
|
'ServerId' => 0,
|
||||||
'Type' => 'Ffmpeg',
|
'StorageId' => 0,
|
||||||
'Function' => 'Mocord',
|
'Type' => 'Ffmpeg',
|
||||||
'Enabled' => array('type'=>'boolean','default'=>1),
|
'Function' => 'Mocord',
|
||||||
'LinkedMonitors' => array('type'=>'set', 'default'=>null),
|
'Enabled' => array('type'=>'boolean','default'=>1),
|
||||||
'Triggers' => array('type'=>'set','default'=>''),
|
'LinkedMonitors' => array('type'=>'set', 'default'=>null),
|
||||||
'Device' => '',
|
'Triggers' => array('type'=>'set','default'=>''),
|
||||||
'Channel' => 0,
|
'Device' => '',
|
||||||
'Format' => '0',
|
'Channel' => 0,
|
||||||
'V4LMultiBuffer' => null,
|
'Format' => '0',
|
||||||
'V4LCapturesPerFrame' => 1,
|
'V4LMultiBuffer' => null,
|
||||||
'Protocol' => null,
|
'V4LCapturesPerFrame' => 1,
|
||||||
'Method' => '',
|
'Protocol' => null,
|
||||||
'Host' => null,
|
'Method' => '',
|
||||||
'Port' => '',
|
'Host' => null,
|
||||||
'SubPath' => '',
|
'Port' => '',
|
||||||
'Path' => null,
|
'SubPath' => '',
|
||||||
'Options' => null,
|
'Path' => null,
|
||||||
'User' => null,
|
'Options' => null,
|
||||||
'Pass' => null,
|
'User' => null,
|
||||||
// These are NOT NULL default 0 in the db, but 0 is not a valid value. FIXME
|
'Pass' => null,
|
||||||
'Width' => null,
|
// These are NOT NULL default 0 in the db, but 0 is not a valid value. FIXME
|
||||||
'Height' => null,
|
'Width' => null,
|
||||||
'Colours' => 4,
|
'Height' => null,
|
||||||
'Palette' => '0',
|
'Colours' => 4,
|
||||||
'Orientation' => null,
|
'Palette' => '0',
|
||||||
'Deinterlacing' => 0,
|
'Orientation' => null,
|
||||||
'DecoderHWAccelName' => null,
|
'Deinterlacing' => 0,
|
||||||
'DecoderHWAccelDevice' => null,
|
'DecoderHWAccelName' => null,
|
||||||
'SaveJPEGs' => 3,
|
'DecoderHWAccelDevice' => null,
|
||||||
'VideoWriter' => '0',
|
'SaveJPEGs' => 3,
|
||||||
'OutputCodec' => null,
|
'VideoWriter' => '0',
|
||||||
'OutputContainer' => null,
|
'OutputCodec' => null,
|
||||||
'EncoderParameters' => "# Lines beginning with # are a comment \n# For changing quality, use the crf option\n# 1 is best, 51 is worst quality\n#crf=23\n",
|
'OutputContainer' => null,
|
||||||
'RecordAudio' => array('type'=>'boolean', 'default'=>0),
|
'EncoderParameters' => "# Lines beginning with # are a comment \n# For changing quality, use the crf option\n# 1 is best, 51 is worst quality\n#crf=23\n",
|
||||||
'RTSPDescribe' => array('type'=>'boolean','default'=>0),
|
'RecordAudio' => array('type'=>'boolean', 'default'=>0),
|
||||||
'Brightness' => -1,
|
'RTSPDescribe' => array('type'=>'boolean','default'=>0),
|
||||||
'Contrast' => -1,
|
'Brightness' => -1,
|
||||||
'Hue' => -1,
|
'Contrast' => -1,
|
||||||
'Colour' => -1,
|
'Hue' => -1,
|
||||||
'EventPrefix' => 'Event-',
|
'Colour' => -1,
|
||||||
'LabelFormat' => '%N - %d/%m/%y %H:%M:%S',
|
'EventPrefix' => 'Event-',
|
||||||
'LabelX' => 0,
|
'LabelFormat' => '%N - %d/%m/%y %H:%M:%S',
|
||||||
'LabelY' => 0,
|
'LabelX' => 0,
|
||||||
'LabelSize' => 1,
|
'LabelY' => 0,
|
||||||
'ImageBufferCount' => 100,
|
'LabelSize' => 1,
|
||||||
'WarmupCount' => 0,
|
'ImageBufferCount' => 100,
|
||||||
'PreEventCount' => 0,
|
'WarmupCount' => 0,
|
||||||
'PostEventCount' => 0,
|
'PreEventCount' => 0,
|
||||||
'StreamReplayBuffer' => 0,
|
'PostEventCount' => 0,
|
||||||
'AlarmFrameCount' => 1,
|
'StreamReplayBuffer' => 0,
|
||||||
'SectionLength' => 600,
|
'AlarmFrameCount' => 1,
|
||||||
'MinSectionLength' => 10,
|
'SectionLength' => 600,
|
||||||
'FrameSkip' => 0,
|
'MinSectionLength' => 10,
|
||||||
'MotionFrameSkip' => 0,
|
'FrameSkip' => 0,
|
||||||
'AnalysisFPSLimit' => null,
|
'MotionFrameSkip' => 0,
|
||||||
'AnalysisUpdateDelay' => 0,
|
'AnalysisFPSLimit' => null,
|
||||||
'MaxFPS' => null,
|
'AnalysisUpdateDelay' => 0,
|
||||||
'AlarmMaxFPS' => null,
|
'MaxFPS' => null,
|
||||||
'FPSReportInterval' => 100,
|
'AlarmMaxFPS' => null,
|
||||||
'RefBlendPerc' => 6,
|
'FPSReportInterval' => 100,
|
||||||
'AlarmRefBlendPerc' => 6,
|
'RefBlendPerc' => 6,
|
||||||
'Controllable' => array('type'=>'boolean','default'=>0),
|
'AlarmRefBlendPerc' => 6,
|
||||||
'ControlId' => null,
|
'Controllable' => array('type'=>'boolean','default'=>0),
|
||||||
'ControlDevice' => null,
|
'ControlId' => null,
|
||||||
'ControlAddress' => null,
|
'ControlDevice' => null,
|
||||||
'AutoStopTimeout' => null,
|
'ControlAddress' => null,
|
||||||
'TrackMotion' => array('type'=>'boolean','default'=>0),
|
'AutoStopTimeout' => null,
|
||||||
'TrackDelay' => null,
|
'TrackMotion' => array('type'=>'boolean','default'=>0),
|
||||||
'ReturnLocation' => -1,
|
'TrackDelay' => null,
|
||||||
'ReturnDelay' => null,
|
'ReturnLocation' => -1,
|
||||||
'DefaultRate' => 100,
|
'ReturnDelay' => null,
|
||||||
'DefaultScale' => 100,
|
'DefaultRate' => 100,
|
||||||
'SignalCheckPoints' => 0,
|
'DefaultScale' => 100,
|
||||||
'SignalCheckColour' => '#0000BE',
|
'SignalCheckPoints' => 0,
|
||||||
'WebColour' => 'red',
|
'SignalCheckColour' => '#0000BE',
|
||||||
'Exif' => array('type'=>'boolean','default'=>0),
|
'WebColour' => 'red',
|
||||||
'Sequence' => null,
|
'Exif' => array('type'=>'boolean','default'=>0),
|
||||||
'TotalEvents' => array('type'=>'integer', 'default'=>null, 'do_not_update'=>1),
|
'Sequence' => null,
|
||||||
'TotalEventDiskSpace' => array('type'=>'integer', 'default'=>null, 'do_not_update'=>1),
|
'TotalEvents' => array('type'=>'integer', 'default'=>null, 'do_not_update'=>1),
|
||||||
'HourEvents' => array('type'=>'integer', 'default'=>null, 'do_not_update'=>1),
|
'TotalEventDiskSpace' => array('type'=>'integer', 'default'=>null, 'do_not_update'=>1),
|
||||||
'HourEventDiskSpace' => array('type'=>'integer', 'default'=>null, 'do_not_update'=>1),
|
'HourEvents' => array('type'=>'integer', 'default'=>null, 'do_not_update'=>1),
|
||||||
'DayEvents' => array('type'=>'integer', 'default'=>null, 'do_not_update'=>1),
|
'HourEventDiskSpace' => array('type'=>'integer', 'default'=>null, 'do_not_update'=>1),
|
||||||
'DayEventDiskSpace' => array('type'=>'integer', 'default'=>null, 'do_not_update'=>1),
|
'DayEvents' => array('type'=>'integer', 'default'=>null, 'do_not_update'=>1),
|
||||||
'WeekEvents' => array('type'=>'integer', 'default'=>null, 'do_not_update'=>1),
|
'DayEventDiskSpace' => array('type'=>'integer', 'default'=>null, 'do_not_update'=>1),
|
||||||
'WeekEventDiskSpace' => array('type'=>'integer', 'default'=>null, 'do_not_update'=>1),
|
'WeekEvents' => array('type'=>'integer', 'default'=>null, 'do_not_update'=>1),
|
||||||
'MonthEvents' => array('type'=>'integer', 'default'=>null, 'do_not_update'=>1),
|
'WeekEventDiskSpace' => array('type'=>'integer', 'default'=>null, 'do_not_update'=>1),
|
||||||
'MonthEventDiskSpace' => array('type'=>'integer', 'default'=>null, 'do_not_update'=>1),
|
'MonthEvents' => array('type'=>'integer', 'default'=>null, 'do_not_update'=>1),
|
||||||
'ArchivedEvents' => array('type'=>'integer', 'default'=>null, 'do_not_update'=>1),
|
'MonthEventDiskSpace' => array('type'=>'integer', 'default'=>null, 'do_not_update'=>1),
|
||||||
'ArchivedEventDiskSpace' => array('type'=>'integer', 'default'=>null, 'do_not_update'=>1),
|
'ArchivedEvents' => array('type'=>'integer', 'default'=>null, 'do_not_update'=>1),
|
||||||
'ZoneCount' => 0,
|
'ArchivedEventDiskSpace' => array('type'=>'integer', 'default'=>null, 'do_not_update'=>1),
|
||||||
'Refresh' => null,
|
'ZoneCount' => 0,
|
||||||
'DefaultCodec' => 'auto',
|
'Refresh' => null,
|
||||||
'GroupIds' => array('default'=>array(), 'do_not_update'=>1),
|
'DefaultCodec' => 'auto',
|
||||||
);
|
'GroupIds' => array('default'=>array(), 'do_not_update'=>1),
|
||||||
private $status_fields = array(
|
);
|
||||||
'Status' => null,
|
private $status_fields = array(
|
||||||
'AnalysisFPS' => null,
|
'Status' => null,
|
||||||
'CaptureFPS' => null,
|
'AnalysisFPS' => null,
|
||||||
'CaptureBandwidth' => null,
|
'CaptureFPS' => null,
|
||||||
);
|
'CaptureBandwidth' => null,
|
||||||
|
);
|
||||||
|
|
||||||
public function Control() {
|
public function Control() {
|
||||||
if ( !property_exists($this, 'Control') ) {
|
if ( !property_exists($this, 'Control') ) {
|
||||||
|
|
|
@ -409,6 +409,11 @@ ZM\Logger::Debug("Event type: " . gettype($event));
|
||||||
|
|
||||||
global $user;
|
global $user;
|
||||||
|
|
||||||
|
if ( $event->Archived() ) {
|
||||||
|
ZM\Info('Cannot delete Archived event.');
|
||||||
|
return;
|
||||||
|
} # end if Archived
|
||||||
|
|
||||||
if ( $user['Events'] == 'Edit' ) {
|
if ( $user['Events'] == 'Edit' ) {
|
||||||
$event->delete();
|
$event->delete();
|
||||||
} # CAN EDIT
|
} # CAN EDIT
|
||||||
|
|
|
@ -9,6 +9,10 @@
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
textarea,
|
||||||
|
input[name="newMonitor[Name]"] {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
input[name="newMonitor[Width]"],
|
input[name="newMonitor[Width]"],
|
||||||
input[name="newMonitor[Height]"] {
|
input[name="newMonitor[Height]"] {
|
||||||
width: 80px;
|
width: 80px;
|
||||||
|
|
|
@ -40,8 +40,8 @@ if ( !empty($_REQUEST['mid']) ) {
|
||||||
if ( $monitor and ZM_OPT_X10 )
|
if ( $monitor and ZM_OPT_X10 )
|
||||||
$x10Monitor = dbFetchOne('SELECT * FROM TriggersX10 WHERE MonitorId = ?', NULL, array($_REQUEST['mid']));
|
$x10Monitor = dbFetchOne('SELECT * FROM TriggersX10 WHERE MonitorId = ?', NULL, array($_REQUEST['mid']));
|
||||||
}
|
}
|
||||||
if ( !$monitor ) {
|
|
||||||
|
|
||||||
|
if ( !$monitor ) {
|
||||||
$nextId = getTableAutoInc('Monitors');
|
$nextId = getTableAutoInc('Monitors');
|
||||||
if ( isset($_REQUEST['dupId']) ) {
|
if ( isset($_REQUEST['dupId']) ) {
|
||||||
$monitor = new ZM\Monitor($_REQUEST['dupId']);
|
$monitor = new ZM\Monitor($_REQUEST['dupId']);
|
||||||
|
@ -67,7 +67,6 @@ if ( ZM_OPT_X10 && empty($x10Monitor) ) {
|
||||||
function fourcc($a, $b, $c, $d) {
|
function fourcc($a, $b, $c, $d) {
|
||||||
return ord($a) | (ord($b) << 8) | (ord($c) << 16) | (ord($d) << 24);
|
return ord($a) | (ord($b) << 8) | (ord($c) << 16) | (ord($d) << 24);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( isset($_REQUEST['newMonitor']) ) {
|
if ( isset($_REQUEST['newMonitor']) ) {
|
||||||
# Update the monitor object with whatever has been set so far.
|
# Update the monitor object with whatever has been set so far.
|
||||||
$monitor->set($_REQUEST['newMonitor']);
|
$monitor->set($_REQUEST['newMonitor']);
|
||||||
|
@ -371,13 +370,6 @@ $label_size = array(
|
||||||
'Large' => 2
|
'Large' => 2
|
||||||
);
|
);
|
||||||
|
|
||||||
$savejpegopts = array(
|
|
||||||
'Disabled' => 0,
|
|
||||||
'Frames only' => 1,
|
|
||||||
'Analysis images only (if available)' => 2,
|
|
||||||
'Frames + Analysis images (if available)' => 3,
|
|
||||||
);
|
|
||||||
|
|
||||||
$codecs = array(
|
$codecs = array(
|
||||||
'auto' => translate('Auto'),
|
'auto' => translate('Auto'),
|
||||||
'MP4' => translate('MP4'),
|
'MP4' => translate('MP4'),
|
||||||
|
@ -459,8 +451,8 @@ foreach ( $tabs as $name=>$value ) {
|
||||||
if ( $tab != 'general' ) {
|
if ( $tab != 'general' ) {
|
||||||
?>
|
?>
|
||||||
<input type="hidden" name="newMonitor[Name]" value="<?php echo validHtmlStr($monitor->Name()) ?>"/>
|
<input type="hidden" name="newMonitor[Name]" value="<?php echo validHtmlStr($monitor->Name()) ?>"/>
|
||||||
|
<input type="hidden" name="newMonitor[Notes]" value="<?php echo validHtmlStr($monitor->Notes()) ?>"/>
|
||||||
<input type="hidden" name="newMonitor[ServerId]" value="<?php echo validHtmlStr($monitor->ServerId() ) ?>"/>
|
<input type="hidden" name="newMonitor[ServerId]" value="<?php echo validHtmlStr($monitor->ServerId() ) ?>"/>
|
||||||
<input type="hidden" name="newMonitor[StorageId]" value="<?= validHtmlStr($monitor->StorageId() ) ?>"/>
|
|
||||||
<input type="hidden" name="newMonitor[LinkedMonitors]" value="<?php echo (null !== $monitor->LinkedMonitors())?validHtmlStr($monitor->LinkedMonitors()):'' ?>"/>
|
<input type="hidden" name="newMonitor[LinkedMonitors]" value="<?php echo (null !== $monitor->LinkedMonitors())?validHtmlStr($monitor->LinkedMonitors()):'' ?>"/>
|
||||||
<?php
|
<?php
|
||||||
foreach ( $monitor->GroupIds() as $group_id ) {
|
foreach ( $monitor->GroupIds() as $group_id ) {
|
||||||
|
@ -529,6 +521,7 @@ if ( $tab != 'source' ) {
|
||||||
}
|
}
|
||||||
if ( $tab != 'storage' ) {
|
if ( $tab != 'storage' ) {
|
||||||
?>
|
?>
|
||||||
|
<input type="hidden" name="newMonitor[StorageId]" value="<?php echo validHtmlStr($monitor->StorageId()) ?>"/>
|
||||||
<input type="hidden" name="newMonitor[SaveJPEGs]" value="<?php echo validHtmlStr($monitor->SaveJPEGs()) ?>"/>
|
<input type="hidden" name="newMonitor[SaveJPEGs]" value="<?php echo validHtmlStr($monitor->SaveJPEGs()) ?>"/>
|
||||||
<input type="hidden" name="newMonitor[VideoWriter]" value="<?php echo validHtmlStr($monitor->VideoWriter()) ?>"/>
|
<input type="hidden" name="newMonitor[VideoWriter]" value="<?php echo validHtmlStr($monitor->VideoWriter()) ?>"/>
|
||||||
<input type="hidden" name="newMonitor[EncoderParameters]" value="<?php echo validHtmlStr($monitor->EncoderParameters()) ?>"/>
|
<input type="hidden" name="newMonitor[EncoderParameters]" value="<?php echo validHtmlStr($monitor->EncoderParameters()) ?>"/>
|
||||||
|
@ -612,6 +605,10 @@ switch ( $tab ) {
|
||||||
<td><?php echo translate('Name') ?></td>
|
<td><?php echo translate('Name') ?></td>
|
||||||
<td><input type="text" name="newMonitor[Name]" value="<?php echo validHtmlStr($monitor->Name()) ?>"/></td>
|
<td><input type="text" name="newMonitor[Name]" value="<?php echo validHtmlStr($monitor->Name()) ?>"/></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr class="Notes">
|
||||||
|
<td><?php echo translate('Notes') ?></td>
|
||||||
|
<td><textarea name="newMonitor[Notes]" rows="4"><?php echo validHtmlStr($monitor->Notes()) ?></textarea></td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><?php echo translate('Server') ?></td><td>
|
<td><?php echo translate('Server') ?></td><td>
|
||||||
<?php
|
<?php
|
||||||
|
@ -620,18 +617,6 @@ switch ( $tab ) {
|
||||||
$servers[$Server->Id()] = $Server->Name();
|
$servers[$Server->Id()] = $Server->Name();
|
||||||
}
|
}
|
||||||
echo htmlSelect( 'newMonitor[ServerId]', $servers, $monitor->ServerId() );
|
echo htmlSelect( 'newMonitor[ServerId]', $servers, $monitor->ServerId() );
|
||||||
?>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><?php echo translate('StorageArea') ?></td>
|
|
||||||
<td>
|
|
||||||
<?php
|
|
||||||
$storage_areas = array(0=>'Default');
|
|
||||||
foreach ( ZM\Storage::find(NULL, array('order'=>'lower(Name)')) as $Storage ) {
|
|
||||||
$storage_areas[$Storage->Id()] = $Storage->Name();
|
|
||||||
}
|
|
||||||
echo htmlSelect('newMonitor[StorageId]', $storage_areas, $monitor->StorageId());
|
|
||||||
?>
|
?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -921,7 +906,32 @@ if ( $monitor->Type() == 'Local' ) {
|
||||||
}
|
}
|
||||||
case 'storage' :
|
case 'storage' :
|
||||||
?>
|
?>
|
||||||
<tr><td><?php echo translate('SaveJPEGs') ?></td><td><select name="newMonitor[SaveJPEGs]"><?php foreach ( $savejpegopts as $name => $value ) { ?><option value="<?php echo validHtmlStr($value); ?>"<?php if ( $value == $monitor->SaveJPEGs() ) { ?> selected="selected"<?php } ?>><?php echo validHtmlStr($name); ?></option><?php } ?></select></td></tr>
|
<tr>
|
||||||
|
<td><?php echo translate('StorageArea') ?></td>
|
||||||
|
<td>
|
||||||
|
<?php
|
||||||
|
$storage_areas = array(0=>'Default');
|
||||||
|
foreach ( ZM\Storage::find(NULL, array('order'=>'lower(Name)')) as $Storage ) {
|
||||||
|
$storage_areas[$Storage->Id()] = $Storage->Name();
|
||||||
|
}
|
||||||
|
echo htmlSelect('newMonitor[StorageId]', $storage_areas, $monitor->StorageId());
|
||||||
|
?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><?php echo translate('SaveJPEGs') ?></td>
|
||||||
|
<td>
|
||||||
|
<?php
|
||||||
|
$savejpegopts = array(
|
||||||
|
0 => 'Disabled',
|
||||||
|
1 => 'Frames only',
|
||||||
|
2 => 'Analysis images only (if available)',
|
||||||
|
3 => 'Frames + Analysis images (if available)',
|
||||||
|
);
|
||||||
|
echo htmlSelect('newMonitor[SaveJPEGs]', $savejpegopts, $monitor->SaveJPEGs());
|
||||||
|
?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr><td><?php echo translate('VideoWriter') ?></td><td>
|
<tr><td><?php echo translate('VideoWriter') ?></td><td>
|
||||||
<?php
|
<?php
|
||||||
$videowriteropts = array(
|
$videowriteropts = array(
|
||||||
|
|
Loading…
Reference in New Issue