Merge ../ZoneMinder.connortechnology into storageareas
This commit is contained in:
commit
0c39ec1492
|
@ -205,6 +205,7 @@ CREATE TABLE `Events` (
|
||||||
`Messaged` tinyint(3) unsigned NOT NULL default '0',
|
`Messaged` tinyint(3) unsigned NOT NULL default '0',
|
||||||
`Executed` tinyint(3) unsigned NOT NULL default '0',
|
`Executed` tinyint(3) unsigned NOT NULL default '0',
|
||||||
`Notes` text,
|
`Notes` text,
|
||||||
|
`Orientation` enum('0','90','180','270','hori','vert') NOT NULL default '0',
|
||||||
PRIMARY KEY (`Id`,`MonitorId`),
|
PRIMARY KEY (`Id`,`MonitorId`),
|
||||||
KEY `MonitorId` (`MonitorId`),
|
KEY `MonitorId` (`MonitorId`),
|
||||||
KEY `StartTime` (`StartTime`),
|
KEY `StartTime` (`StartTime`),
|
||||||
|
@ -396,6 +397,7 @@ CREATE TABLE `Monitors` (
|
||||||
`WebColour` varchar(32) NOT NULL default 'red',
|
`WebColour` varchar(32) NOT NULL default 'red',
|
||||||
`Exif` tinyint(1) unsigned NOT NULL default '0',
|
`Exif` tinyint(1) unsigned NOT NULL default '0',
|
||||||
`Sequence` smallint(5) unsigned default NULL,
|
`Sequence` smallint(5) unsigned default NULL,
|
||||||
|
`Orientation` enum('0','90','180','270','hori','vert') NOT NULL default '0',
|
||||||
PRIMARY KEY (`Id`)
|
PRIMARY KEY (`Id`)
|
||||||
) ENGINE=@ZM_MYSQL_ENGINE@;
|
) ENGINE=@ZM_MYSQL_ENGINE@;
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
--
|
||||||
|
-- This updates a 1.30.7 database to 1.30.8
|
||||||
|
--
|
||||||
|
|
||||||
|
SET @s = (SELECT IF(
|
||||||
|
(SELECT COUNT(*)
|
||||||
|
FROM INFORMATION_SCHEMA.COLUMNS
|
||||||
|
WHERE table_name = 'Events'
|
||||||
|
AND table_schema = DATABASE()
|
||||||
|
AND column_name = 'Orientation'
|
||||||
|
) > 0,
|
||||||
|
"SELECT 'Column Orientation exists in Events'",
|
||||||
|
"ALTER TABLE `Events` ADD `Orientation` enum('0','90','180','270','hori','vert') NOT NULL default '0' AFTER Notes",
|
||||||
|
));
|
||||||
|
|
||||||
|
PREPARE stmt FROM @s;
|
||||||
|
EXECUTE stmt;
|
|
@ -84,7 +84,7 @@ Event::Event( Monitor *p_monitor, struct timeval p_start_time, const std::string
|
||||||
static char sql[ZM_SQL_MED_BUFSIZ];
|
static char sql[ZM_SQL_MED_BUFSIZ];
|
||||||
|
|
||||||
struct tm *stime = localtime( &start_time.tv_sec );
|
struct tm *stime = localtime( &start_time.tv_sec );
|
||||||
snprintf( sql, sizeof(sql), "insert into Events ( MonitorId, StorageId, Name, StartTime, Width, Height, Cause, Notes, Videoed ) values ( %d, %d, 'New Event', from_unixtime( %ld ), %d, %d, '%s', '%s', %d )", monitor->Id(), storage->Id(), start_time.tv_sec, monitor->Width(), monitor->Height(), cause.c_str(), notes.c_str(), videoEvent );
|
snprintf( sql, sizeof(sql), "insert into Events ( MonitorId, StorageId, Name, StartTime, Width, Height, Cause, Notes, Orientation, Videoed ) values ( %d, %d, 'New Event', from_unixtime( %ld ), %d, %d, '%s', '%s', %d, %d )", monitor->Id(), storage->Id(), start_time.tv_sec, monitor->Width(), monitor->Height(), cause.c_str(), notes.c_str(), monitor->getOrientation(), videoEvent );
|
||||||
if ( mysql_query( &dbconn, sql ) ) {
|
if ( mysql_query( &dbconn, sql ) ) {
|
||||||
Error( "Can't insert event: %s. sql was (%s)", mysql_error( &dbconn ), sql );
|
Error( "Can't insert event: %s. sql was (%s)", mysql_error( &dbconn ), sql );
|
||||||
exit( mysql_errno( &dbconn ) );
|
exit( mysql_errno( &dbconn ) );
|
||||||
|
@ -1243,7 +1243,14 @@ bool EventStream::sendFrame( int delta_us ) {
|
||||||
static struct stat filestat;
|
static struct stat filestat;
|
||||||
FILE *fdj = NULL;
|
FILE *fdj = NULL;
|
||||||
|
|
||||||
|
if ( monitor->GetOptSaveJPEGs() & 1) {
|
||||||
snprintf( filepath, sizeof(filepath), Event::capture_file_format, event_data->path, curr_frame_id );
|
snprintf( filepath, sizeof(filepath), Event::capture_file_format, event_data->path, curr_frame_id );
|
||||||
|
} else if ( monitor->GetOptSaveJPEGs() & 2 ) {
|
||||||
|
snprintf( filepath, sizeof(filepath), Event::analyse_file_format, event_data->path, curr_frame_id );
|
||||||
|
} else {
|
||||||
|
Fatal("JPEGS not saved.zms is not capable of streaming jpegs from mp4 yet");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
#if HAVE_LIBAVCODEC
|
#if HAVE_LIBAVCODEC
|
||||||
if ( type == STREAM_MPEG ) {
|
if ( type == STREAM_MPEG ) {
|
||||||
|
|
|
@ -4178,4 +4178,4 @@ int Monitor::PreCapture() {
|
||||||
int Monitor::PostCapture() {
|
int Monitor::PostCapture() {
|
||||||
return( camera->PostCapture() );
|
return( camera->PostCapture() );
|
||||||
}
|
}
|
||||||
Monitor::Orientation Monitor::getOrientation()const { return orientation; }
|
Monitor::Orientation Monitor::getOrientation() const { return orientation; }
|
||||||
|
|
|
@ -76,7 +76,6 @@ Storage::Storage( unsigned int p_id ) {
|
||||||
Debug(1,"No id passed to Storage constructor. Using default path %s instead", path );
|
Debug(1,"No id passed to Storage constructor. Using default path %s instead", path );
|
||||||
strcpy(name, "Default");
|
strcpy(name, "Default");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Storage::~Storage() {
|
Storage::~Storage() {
|
||||||
|
|
|
@ -6,7 +6,7 @@ if ( empty($_REQUEST['id']) && empty($_REQUEST['eids']) ) {
|
||||||
|
|
||||||
if ( canView( 'Events' ) ) {
|
if ( canView( 'Events' ) ) {
|
||||||
switch ( $_REQUEST['action'] ) {
|
switch ( $_REQUEST['action'] ) {
|
||||||
case "video" : {
|
case 'video' : {
|
||||||
if ( empty($_REQUEST['videoFormat']) ) {
|
if ( empty($_REQUEST['videoFormat']) ) {
|
||||||
ajaxError( "Video Generation Failure, no format given" );
|
ajaxError( "Video Generation Failure, no format given" );
|
||||||
} elseif ( empty($_REQUEST['rate']) ) {
|
} elseif ( empty($_REQUEST['rate']) ) {
|
||||||
|
@ -77,11 +77,9 @@ if ( canView( 'Events' ) ) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( canEdit( 'Events' ) )
|
if ( canEdit( 'Events' ) ) {
|
||||||
{
|
switch ( $_REQUEST['action'] ) {
|
||||||
switch ( $_REQUEST['action'] )
|
case 'rename' :
|
||||||
{
|
|
||||||
case "rename" :
|
|
||||||
{
|
{
|
||||||
if ( !empty($_REQUEST['eventName']) )
|
if ( !empty($_REQUEST['eventName']) )
|
||||||
dbQuery( 'UPDATE Events SET Name = ? WHERE Id = ?', array( $_REQUEST['eventName'], $_REQUEST['id'] ) );
|
dbQuery( 'UPDATE Events SET Name = ? WHERE Id = ?', array( $_REQUEST['eventName'], $_REQUEST['id'] ) );
|
||||||
|
@ -90,24 +88,29 @@ if ( canEdit( 'Events' ) )
|
||||||
ajaxResponse( array( 'refreshEvent'=>true, 'refreshParent'=>true ) );
|
ajaxResponse( array( 'refreshEvent'=>true, 'refreshParent'=>true ) );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case "eventdetail" :
|
case 'eventdetail' :
|
||||||
{
|
{
|
||||||
dbQuery( 'UPDATE Events SET Cause = ?, Notes = ? WHERE Id = ?', array( $_REQUEST['newEvent']['Cause'], $_REQUEST['newEvent']['Notes'], $_REQUEST['id'] ) );
|
dbQuery( 'UPDATE Events SET Cause = ?, Notes = ? WHERE Id = ?', array( $_REQUEST['newEvent']['Cause'], $_REQUEST['newEvent']['Notes'], $_REQUEST['id'] ) );
|
||||||
ajaxResponse( array( 'refreshEvent'=>true, 'refreshParent'=>true ) );
|
ajaxResponse( array( 'refreshEvent'=>true, 'refreshParent'=>true ) );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case "archive" :
|
case 'archive' :
|
||||||
case "unarchive" :
|
case 'unarchive' :
|
||||||
{
|
{
|
||||||
$archiveVal = ($_REQUEST['action'] == "archive")?1:0;
|
$archiveVal = ($_REQUEST['action'] == "archive")?1:0;
|
||||||
dbQuery( 'UPDATE Events SET Archived = ? WHERE Id = ?', array( $archiveVal, $_REQUEST['id']) );
|
dbQuery( 'UPDATE Events SET Archived = ? WHERE Id = ?', array( $archiveVal, $_REQUEST['id']) );
|
||||||
ajaxResponse( array( 'refreshEvent'=>true, 'refreshParent'=>false ) );
|
ajaxResponse( array( 'refreshEvent'=>true, 'refreshParent'=>false ) );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case "delete" :
|
case 'delete' :
|
||||||
{
|
{
|
||||||
deleteEvent( $_REQUEST['id'] );
|
$Event = new Event( $_REQUEST['id'] );
|
||||||
ajaxResponse( array( 'refreshEvent'=>false, 'refreshParent'=>true ) );
|
if ( ! $Event->Id() ) {
|
||||||
|
ajaxResponse( array( 'refreshEvent'=>false, 'refreshParent'=>true, 'message'=> 'Event not found.' ) );
|
||||||
|
} else {
|
||||||
|
$Event->delete();
|
||||||
|
ajaxResponse( array( 'refreshEvent'=>false, 'refreshParent'=>true ) );
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,6 +14,10 @@ class Event {
|
||||||
} elseif ( is_array( $IdOrRow ) ) {
|
} elseif ( is_array( $IdOrRow ) ) {
|
||||||
$row = $IdOrRow;
|
$row = $IdOrRow;
|
||||||
} else {
|
} else {
|
||||||
|
$backTrace = debug_backtrace();
|
||||||
|
$file = $backTrace[1]['file'];
|
||||||
|
$line = $backTrace[1]['line'];
|
||||||
|
Error("Unknown argument passed to Event Constructor from $file:$line)");
|
||||||
Error("Unknown argument passed to Event Constructor ($IdOrRow)");
|
Error("Unknown argument passed to Event Constructor ($IdOrRow)");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -30,6 +34,9 @@ class Event {
|
||||||
public function Storage() {
|
public function Storage() {
|
||||||
return new Storage( isset($this->{'StorageId'}) ? $this->{'StorageId'} : NULL );
|
return new Storage( isset($this->{'StorageId'}) ? $this->{'StorageId'} : NULL );
|
||||||
}
|
}
|
||||||
|
public function Monitor() {
|
||||||
|
return new Monitor( isset($this->{'MonitorId'}) ? $this->{'MonitorId'} : NULL );
|
||||||
|
}
|
||||||
public function __call( $fn, array $args){
|
public function __call( $fn, array $args){
|
||||||
if ( array_key_exists( $fn, $this ) ) {
|
if ( array_key_exists( $fn, $this ) ) {
|
||||||
return $this->{$fn};
|
return $this->{$fn};
|
||||||
|
|
|
@ -289,14 +289,15 @@ if ( !empty($action) ) {
|
||||||
if ( !empty($_REQUEST['mid']) && canEdit( 'Monitors', $_REQUEST['mid'] ) ) {
|
if ( !empty($_REQUEST['mid']) && canEdit( 'Monitors', $_REQUEST['mid'] ) ) {
|
||||||
$mid = validInt($_REQUEST['mid']);
|
$mid = validInt($_REQUEST['mid']);
|
||||||
if ( $action == 'function' ) {
|
if ( $action == 'function' ) {
|
||||||
$monitor = dbFetchOne( "SELECT * FROM Monitors WHERE Id=?", NULL, array($mid) );
|
$monitor = dbFetchOne( 'SELECT * FROM Monitors WHERE Id=?', NULL, array($mid) );
|
||||||
|
|
||||||
$newFunction = validStr($_REQUEST['newFunction']);
|
$newFunction = validStr($_REQUEST['newFunction']);
|
||||||
$newEnabled = isset( $_REQUEST['newEnabled'] ) and $_REQUEST['newEnabled'] != '1' ? '0' : '1';
|
# Because we use a checkbox, it won't get passed in the request. So not being in _REQUEST means 0
|
||||||
|
$newEnabled = ( !isset( $_REQUEST['newEnabled'] ) or $_REQUEST['newEnabled'] != '1' ) ? '0' : '1';
|
||||||
$oldFunction = $monitor['Function'];
|
$oldFunction = $monitor['Function'];
|
||||||
$oldEnabled = $monitor['Enabled'];
|
$oldEnabled = $monitor['Enabled'];
|
||||||
if ( $newFunction != $oldFunction || $newEnabled != $oldEnabled ) {
|
if ( $newFunction != $oldFunction || $newEnabled != $oldEnabled ) {
|
||||||
dbQuery( "update Monitors set Function=?, Enabled=? where Id=?", array( $newFunction, $newEnabled, $mid ) );
|
dbQuery( 'UPDATE Monitors SET Function=?, Enabled=? WHERE Id=?', array( $newFunction, $newEnabled, $mid ) );
|
||||||
|
|
||||||
$monitor['Function'] = $newFunction;
|
$monitor['Function'] = $newFunction;
|
||||||
$monitor['Enabled'] = $newEnabled;
|
$monitor['Enabled'] = $newEnabled;
|
||||||
|
|
|
@ -468,10 +468,11 @@ function getEventDefaultVideoPath( $event ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function deletePath( $path ) {
|
function deletePath( $path ) {
|
||||||
Error("deletePath $path");
|
|
||||||
if ( is_dir( $path ) ) {
|
if ( is_dir( $path ) ) {
|
||||||
|
Debug("deletePath rm -rf $path");
|
||||||
system( escapeshellcmd( "rm -rf ".$path ) );
|
system( escapeshellcmd( "rm -rf ".$path ) );
|
||||||
} else {
|
} else {
|
||||||
|
Debug("deletePath unlink $path");
|
||||||
unlink( $path );
|
unlink( $path );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -486,6 +487,8 @@ function deleteEvent( $event ) {
|
||||||
if ( gettype($event) != 'array' ) {
|
if ( gettype($event) != 'array' ) {
|
||||||
# $event could be an eid, so turn it into an event hash
|
# $event could be an eid, so turn it into an event hash
|
||||||
$event = new Event( $event );
|
$event = new Event( $event );
|
||||||
|
} else {
|
||||||
|
Debug("Event type: " . gettype($event));
|
||||||
}
|
}
|
||||||
|
|
||||||
global $user;
|
global $user;
|
||||||
|
|
|
@ -42,4 +42,8 @@
|
||||||
#monitors .monitorState {
|
#monitors .monitorState {
|
||||||
margin: 2px auto;
|
margin: 2px auto;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
border: 0;
|
||||||
|
}
|
||||||
|
#monitors .alert .monitorState {
|
||||||
|
border: 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,4 +42,9 @@
|
||||||
#monitors .monitorState {
|
#monitors .monitorState {
|
||||||
margin: 2px auto;
|
margin: 2px auto;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
border: 0;
|
||||||
}
|
}
|
||||||
|
#monitors .alert .monitorState {
|
||||||
|
border: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -48,4 +48,8 @@
|
||||||
#monitors .monitorState {
|
#monitors .monitorState {
|
||||||
margin: 2px auto;
|
margin: 2px auto;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
border: 0;
|
||||||
|
}
|
||||||
|
#monitors .alert .monitorState {
|
||||||
|
border: 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -220,6 +220,7 @@ function getNavBarHTML() {
|
||||||
?>
|
?>
|
||||||
<li><?php echo makePopupLink( '?view=cycle&group='.$cycleGroup, 'zmCycle'.$cycleGroup, array( 'cycle', $cycleWidth, $cycleHeight ), translate('Cycle'), $running ) ?></li>
|
<li><?php echo makePopupLink( '?view=cycle&group='.$cycleGroup, 'zmCycle'.$cycleGroup, array( 'cycle', $cycleWidth, $cycleHeight ), translate('Cycle'), $running ) ?></li>
|
||||||
<li><?php echo makePopupLink( '?view=montage&group='.$cycleGroup, 'zmMontage'.$cycleGroup, 'montage', translate('Montage'), $running ) ?></li>
|
<li><?php echo makePopupLink( '?view=montage&group='.$cycleGroup, 'zmMontage'.$cycleGroup, 'montage', translate('Montage'), $running ) ?></li>
|
||||||
|
<li><?php echo makePopupLink( '?view=montagereview&group='.$cycleGroup, 'zmMontageReview'.$cycleGroup, 'montagereview', translate('MontageReview'), $running ) ?></li>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
|
|
@ -102,7 +102,12 @@ function getPopupSize( tag, width, height )
|
||||||
function zmWindow()
|
function zmWindow()
|
||||||
{
|
{
|
||||||
var zmWin = window.open( 'http://www.zoneminder.com', 'ZoneMinder' );
|
var zmWin = window.open( 'http://www.zoneminder.com', 'ZoneMinder' );
|
||||||
zmWin.focus();
|
if ( ! zmWin ) {
|
||||||
|
// if popup blocking is enabled, the popup won't be defined.
|
||||||
|
console.log("Please disable popup blocking.");
|
||||||
|
} else {
|
||||||
|
zmWin.focus();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function createPopup( url, name, tag, width, height )
|
function createPopup( url, name, tag, width, height )
|
||||||
|
@ -114,7 +119,12 @@ function createPopup( url, name, tag, width, height )
|
||||||
if ( popupSize.height > 0 )
|
if ( popupSize.height > 0 )
|
||||||
popupDimensions += ",height="+popupSize.height;
|
popupDimensions += ",height="+popupSize.height;
|
||||||
var popup = window.open( url, name, popupOptions+popupDimensions );
|
var popup = window.open( url, name, popupOptions+popupDimensions );
|
||||||
popup.focus();
|
if ( ! popup ) {
|
||||||
|
// if popup blocking is enabled, the popup won't be defined.
|
||||||
|
console.log("Please disable popup blocking.");
|
||||||
|
} else {
|
||||||
|
popup.focus();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function createEventPopup( eventId, eventFilter, width, height )
|
function createEventPopup( eventId, eventFilter, width, height )
|
||||||
|
@ -125,7 +135,12 @@ function createEventPopup( eventId, eventFilter, width, height )
|
||||||
var name = 'zmEvent';
|
var name = 'zmEvent';
|
||||||
var popupSize = getPopupSize( 'event', width, height );
|
var popupSize = getPopupSize( 'event', width, height );
|
||||||
var popup = window.open( url, name, popupOptions+",width="+popupSize.width+",height="+popupSize.height );
|
var popup = window.open( url, name, popupOptions+",width="+popupSize.width+",height="+popupSize.height );
|
||||||
popup.focus();
|
if ( ! popup ) {
|
||||||
|
// if popup blocking is enabled, the popup won't be defined.
|
||||||
|
console.log("Please disable popup blocking.");
|
||||||
|
} else {
|
||||||
|
popup.focus();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function createFramesPopup( eventId, width, height )
|
function createFramesPopup( eventId, width, height )
|
||||||
|
@ -134,7 +149,12 @@ function createFramesPopup( eventId, width, height )
|
||||||
var name = 'zmFrames';
|
var name = 'zmFrames';
|
||||||
var popupSize = getPopupSize( 'frames', width, height );
|
var popupSize = getPopupSize( 'frames', width, height );
|
||||||
var popup = window.open( url, name, popupOptions+",width="+popupSize.width+",height="+popupSize.height );
|
var popup = window.open( url, name, popupOptions+",width="+popupSize.width+",height="+popupSize.height );
|
||||||
popup.focus();
|
if ( ! popup ) {
|
||||||
|
// if popup blocking is enabled, the popup won't be defined.
|
||||||
|
console.log("Please disable popup blocking.");
|
||||||
|
} else {
|
||||||
|
popup.focus();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function createFramePopup( eventId, frameId, width, height )
|
function createFramePopup( eventId, frameId, width, height )
|
||||||
|
@ -143,7 +163,12 @@ function createFramePopup( eventId, frameId, width, height )
|
||||||
var name = 'zmFrame';
|
var name = 'zmFrame';
|
||||||
var popupSize = getPopupSize( 'frame', width, height );
|
var popupSize = getPopupSize( 'frame', width, height );
|
||||||
var popup = window.open( url, name, popupOptions+",width="+popupSize.width+",height="+popupSize.height );
|
var popup = window.open( url, name, popupOptions+",width="+popupSize.width+",height="+popupSize.height );
|
||||||
popup.focus();
|
if ( ! popup ) {
|
||||||
|
// if popup blocking is enabled, the popup won't be defined.
|
||||||
|
console.log("Please disable popup blocking.");
|
||||||
|
} else {
|
||||||
|
popup.focus();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function windowToFront()
|
function windowToFront()
|
||||||
|
|
|
@ -18,36 +18,35 @@
|
||||||
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
//
|
//
|
||||||
|
|
||||||
if ( !canView( 'Events' ) )
|
if ( !canView( 'Events' ) ) {
|
||||||
{
|
$view = 'error';
|
||||||
$view = "error";
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$eid = validInt( $_REQUEST['eid'] );
|
$eid = validInt( $_REQUEST['eid'] );
|
||||||
$fid = !empty($_REQUEST['fid'])?validInt($_REQUEST['fid']):1;
|
$fid = !empty($_REQUEST['fid'])?validInt($_REQUEST['fid']):1;
|
||||||
|
|
||||||
$sql = 'SELECT E.*,M.Name AS MonitorName,E.Width,E.Height,M.DefaultRate,M.DefaultScale,M.VideoWriter,M.SaveJPEGs,M.Orientation,M.LabelFormat FROM Events AS E INNER JOIN Monitors AS M ON E.MonitorId = M.Id WHERE E.Id = ?';
|
$Event = new Event( $eid );
|
||||||
$sql_values = array( $eid );
|
$Monitor = $Event->Monitor();
|
||||||
|
|
||||||
if ( $user['MonitorIds'] ) {
|
if ( $user['MonitorIds'] ) {
|
||||||
$monitor_ids = explode( ',', $user['MonitorIds'] );
|
$monitor_ids = explode( ',', $user['MonitorIds'] );
|
||||||
$sql .= ' AND MonitorId IN (' .implode( ',', array_fill(0,count($monitor_ids),'?') ) . ')';
|
if ( count($monitor_ids) and ! in_array( $Event->MonitorId(), $monitors_ids ) ) {
|
||||||
$sql_values = array_merge( $sql_values, $monitor_ids );
|
$view = 'error';
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$event = dbFetchOne( $sql, NULL, $sql_values );
|
|
||||||
|
|
||||||
if ( isset( $_REQUEST['rate'] ) )
|
if ( isset( $_REQUEST['rate'] ) )
|
||||||
$rate = validInt($_REQUEST['rate']);
|
$rate = validInt($_REQUEST['rate']);
|
||||||
else
|
else
|
||||||
$rate = reScale( RATE_BASE, $event['DefaultRate'], ZM_WEB_DEFAULT_RATE );
|
$rate = reScale( RATE_BASE, $Monitor->DefaultRate(), ZM_WEB_DEFAULT_RATE );
|
||||||
|
|
||||||
if ( isset( $_REQUEST['scale'] ) ) {
|
if ( isset( $_REQUEST['scale'] ) ) {
|
||||||
$scale = validInt($_REQUEST['scale']);
|
$scale = validInt($_REQUEST['scale']);
|
||||||
} else if ( isset( $_COOKIE['zmWatchScale'.$event['MonitorId']] ) ) {
|
} else if ( isset( $_COOKIE['zmWatchScale'.$Event->MonitorId()] ) ) {
|
||||||
$scale = $_COOKIE['zmEventScale'.$event['MonitorId']];
|
$scale = $_COOKIE['zmEventScale'.$Event->MonitorId()];
|
||||||
} else {
|
} else {
|
||||||
$scale = reScale( SCALE_BASE, $event['DefaultScale'], ZM_WEB_DEFAULT_SCALE );
|
$scale = reScale( SCALE_BASE, $Monitor->DefaultScale(), ZM_WEB_DEFAULT_SCALE );
|
||||||
}
|
}
|
||||||
|
|
||||||
$replayModes = array(
|
$replayModes = array(
|
||||||
|
@ -73,11 +72,11 @@ else {
|
||||||
// videojs zoomrotate only when direct recording
|
// videojs zoomrotate only when direct recording
|
||||||
$Zoom = 1;
|
$Zoom = 1;
|
||||||
$Rotation = 0;
|
$Rotation = 0;
|
||||||
if ( $event['VideoWriter'] == "2" ) {
|
if ( $Monitor->VideoWriter() == '2' ) {
|
||||||
# Passthrough
|
# Passthrough
|
||||||
$Rotation = $event['Orientation'];
|
$Rotation = $Event->Orientation();
|
||||||
if ( in_array($event['Orientation'],array('90','270')) )
|
if ( in_array($Event->Orientation(),array('90','270')) )
|
||||||
$Zoom = $event['Height']/$event['Width'];
|
$Zoom = $Event->Height()/$Event->Width();
|
||||||
}
|
}
|
||||||
|
|
||||||
parseSort();
|
parseSort();
|
||||||
|
@ -85,7 +84,7 @@ parseFilter( $_REQUEST['filter'] );
|
||||||
$filterQuery = $_REQUEST['filter']['query'];
|
$filterQuery = $_REQUEST['filter']['query'];
|
||||||
|
|
||||||
$panelSections = 40;
|
$panelSections = 40;
|
||||||
$panelSectionWidth = (int)ceil(reScale($event['Width'],$scale)/$panelSections);
|
$panelSectionWidth = (int)ceil(reScale($Event->Width(),$scale)/$panelSections);
|
||||||
$panelWidth = ($panelSections*$panelSectionWidth-1);
|
$panelWidth = ($panelSections*$panelSectionWidth-1);
|
||||||
|
|
||||||
$connkey = generateConnKey();
|
$connkey = generateConnKey();
|
||||||
|
@ -97,110 +96,102 @@ xhtmlHeaders(__FILE__, translate('Event') );
|
||||||
<body>
|
<body>
|
||||||
<div id="page">
|
<div id="page">
|
||||||
<div id="content">
|
<div id="content">
|
||||||
|
<?php
|
||||||
|
if ( ! $Event->Id() ) {
|
||||||
|
echo 'Event was not found.';
|
||||||
|
} else {
|
||||||
|
?>
|
||||||
<div id="dataBar">
|
<div id="dataBar">
|
||||||
<table id="dataTable" class="major" cellspacing="0">
|
<table id="dataTable" class="major" cellspacing="0">
|
||||||
<tr>
|
<tr>
|
||||||
<td><span id="dataId" title="<?php echo translate('Id') ?>"><?php echo $event['Id'] ?></span></td>
|
<td><span id="dataId" title="<?php echo translate('Id') ?>"><?php echo $Event->Id() ?></span></td>
|
||||||
<td><span id="dataCause" title="<?php echo $event['Notes']?validHtmlStr($event['Notes']):translate('AttrCause') ?>"><?php echo validHtmlStr($event['Cause']) ?></span></td>
|
<td><span id="dataCause" title="<?php echo $Event->Notes()?validHtmlStr($Event->Notes()):translate('AttrCause') ?>"><?php echo validHtmlStr($Event->Cause()) ?></span></td>
|
||||||
<td><span id="dataTime" title="<?php echo translate('Time') ?>"><?php echo strftime( STRF_FMT_DATETIME_SHORT, strtotime($event['StartTime'] ) ) ?></span></td>
|
<td><span id="dataTime" title="<?php echo translate('Time') ?>"><?php echo strftime( STRF_FMT_DATETIME_SHORT, strtotime($Event->StartTime() ) ) ?></span></td>
|
||||||
<td><span id="dataDuration" title="<?php echo translate('Duration') ?>"><?php echo $event['Length'] ?></span>s</td>
|
<td><span id="dataDuration" title="<?php echo translate('Duration') ?>"><?php echo $Event->Length() ?></span>s</td>
|
||||||
<td><span id="dataFrames" title="<?php echo translate('AttrFrames')."/".translate('AttrAlarmFrames') ?>"><?php echo $event['Frames'] ?>/<?php echo $event['AlarmFrames'] ?></span></td>
|
<td><span id="dataFrames" title="<?php echo translate('AttrFrames')."/".translate('AttrAlarmFrames') ?>"><?php echo $Event->Frames() ?>/<?php echo $Event->AlarmFrames() ?></span></td>
|
||||||
<td><span id="dataScore" title="<?php echo translate('AttrTotalScore')."/".translate('AttrAvgScore')."/".translate('AttrMaxScore') ?>"><?php echo $event['TotScore'] ?>/<?php echo $event['AvgScore'] ?>/<?php echo $event['MaxScore'] ?></span></td>
|
<td><span id="dataScore" title="<?php echo translate('AttrTotalScore')."/".translate('AttrAvgScore')."/".translate('AttrMaxScore') ?>"><?php echo $Event->TotScore() ?>/<?php echo $Event->AvgScore() ?>/<?php echo $Event->MaxScore() ?></span></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<div id="menuBar1">
|
<div id="menuBar1">
|
||||||
<div id="scaleControl"><label for="scale"><?php echo translate('Scale') ?></label><?php echo buildSelect( "scale", $scales, "changeScale();" ); ?></div>
|
<div id="scaleControl"><label for="scale"><?php echo translate('Scale') ?></label><?php echo buildSelect( "scale", $scales, "changeScale();" ); ?></div>
|
||||||
<div id="replayControl"><label for="replayMode"><?php echo translate('Replay') ?></label><?php echo buildSelect( "replayMode", $replayModes, "changeReplayMode();" ); ?></div>
|
<div id="replayControl"><label for="replayMode"><?php echo translate('Replay') ?></label><?php echo buildSelect( "replayMode", $replayModes, "changeReplayMode();" ); ?></div>
|
||||||
<div id="nameControl"><input type="text" id="eventName" name="eventName" value="<?php echo validHtmlStr($event['Name']) ?>" size="16"/><input type="button" value="<?php echo translate('Rename') ?>" onclick="renameEvent()"<?php if ( !canEdit( 'Events' ) ) { ?> disabled="disabled"<?php } ?>/></div>
|
<div id="nameControl"><input type="text" id="eventName" name="eventName" value="<?php echo validHtmlStr($Event->Name()) ?>" size="16"/><input type="button" value="<?php echo translate('Rename') ?>" onclick="renameEvent()"<?php if ( !canEdit( 'Events' ) ) { ?> disabled="disabled"<?php } ?>/></div>
|
||||||
</div>
|
</div>
|
||||||
<div id="menuBar2">
|
<div id="menuBar2">
|
||||||
<div id="closeWindow"><a href="#" onclick="closeWindow();"><?php echo translate('Close') ?></a></div>
|
<div id="closeWindow"><a href="#" onclick="closeWindow();"><?php echo translate('Close') ?></a></div>
|
||||||
<?php
|
<?php
|
||||||
if ( canEdit( 'Events' ) )
|
if ( canEdit( 'Events' ) ) {
|
||||||
{
|
|
||||||
?>
|
?>
|
||||||
<div id="deleteEvent"><a href="#" onclick="deleteEvent()"><?php echo translate('Delete') ?></a></div>
|
<div id="deleteEvent"><a href="#" onclick="deleteEvent()"><?php echo translate('Delete') ?></a></div>
|
||||||
<div id="editEvent"><a href="#" onclick="editEvent()"><?php echo translate('Edit') ?></a></div>
|
<div id="editEvent"><a href="#" onclick="editEvent()"><?php echo translate('Edit') ?></a></div>
|
||||||
<div id="archiveEvent" class="hidden"><a href="#" onclick="archiveEvent()"><?php echo translate('Archive') ?></a></div>
|
<div id="archiveEvent" class="hidden"><a href="#" onclick="archiveEvent()"><?php echo translate('Archive') ?></a></div>
|
||||||
<div id="unarchiveEvent" class="hidden"><a href="#" onclick="unarchiveEvent()"><?php echo translate('Unarchive') ?></a></div>
|
<div id="unarchiveEvent" class="hidden"><a href="#" onclick="unarchiveEvent()"><?php echo translate('Unarchive') ?></a></div>
|
||||||
<?php
|
<?php
|
||||||
}
|
} // end if can edit Events
|
||||||
if ( canView( 'Events' ) )
|
if ( canView( 'Events' ) ) {
|
||||||
{
|
|
||||||
?>
|
?>
|
||||||
<div id="framesEvent"><a href="#" onclick="showEventFrames()"><?php echo translate('Frames') ?></a></div>
|
<div id="framesEvent"><a href="#" onclick="showEventFrames()"><?php echo translate('Frames') ?></a></div>
|
||||||
<?php
|
<?php
|
||||||
if ( $event['SaveJPEGs'] & 3 )
|
if ( $Event->SaveJPEGs() & 3 ) { // Analysis or Jpegs
|
||||||
{
|
|
||||||
?>
|
?>
|
||||||
<div id="stillsEvent"<?php if ( $streamMode == 'still' ) { ?> class="hidden"<?php } ?>><a href="#" onclick="showStills()"><?php echo translate('Stills') ?></a></div>
|
<div id="stillsEvent"<?php if ( $streamMode == 'still' ) { ?> class="hidden"<?php } ?>><a href="#" onclick="showStills()"><?php echo translate('Stills') ?></a></div>
|
||||||
<?php
|
<?php
|
||||||
}
|
} // has frames or analysis
|
||||||
?>
|
?>
|
||||||
<div id="videoEvent"<?php if ( $streamMode == 'video' ) { ?> class="hidden"<?php } ?>><a href="#" onclick="showVideo()"><?php echo translate('Video') ?></a></div>
|
<div id="videoEvent"<?php if ( $streamMode == 'video' ) { ?> class="hidden"<?php } ?>><a href="#" onclick="showVideo()"><?php echo translate('Video') ?></a></div>
|
||||||
<div id="exportEvent"><a href="#" onclick="exportEvent()"><?php echo translate('Export') ?></a></div>
|
<div id="exportEvent"><a href="#" onclick="exportEvent()"><?php echo translate('Export') ?></a></div>
|
||||||
</div>
|
</div>
|
||||||
<div id="eventVideo" class="">
|
<div id="eventVideo" class="">
|
||||||
<?php
|
<?php
|
||||||
if ( $event['DefaultVideo'] )
|
if ( $Event->DefaultVideo() ) {
|
||||||
{
|
|
||||||
?>
|
?>
|
||||||
<div id="videoFeed">
|
<div id="videoFeed">
|
||||||
<video id="videoobj" class="video-js vjs-default-skin" width="<?php echo reScale( $event['Width'], $scale ) ?>" height="<?php echo reScale( $event['Height'], $scale ) ?>" data-setup='{ "controls": true, "playbackRates": [0.5, 1, 1.5, 2, 4, 8, 16, 32, 64, 128, 256], "autoplay": true, "preload": "auto", "plugins": { "zoomrotate": { "rotate": "<?php echo $Rotation ?>", "zoom": "<?php echo $Zoom ?>"}}}'>
|
<video id="videoobj" class="video-js vjs-default-skin" width="<?php echo reScale( $Event->Width(), $scale ) ?>" height="<?php echo reScale( $Event->Height(), $scale ) ?>" data-setup='{ "controls": true, "playbackRates": [0.5, 1, 1.5, 2, 4, 8, 16, 32, 64, 128, 256], "autoplay": true, "preload": "auto", "plugins": { "zoomrotate": { "rotate": "<?php echo $Rotation ?>", "zoom": "<?php echo $Zoom ?>"}}}'>
|
||||||
<source src="<?php echo getEventDefaultVideoPath($event) ?>" type="video/mp4">
|
<source src="<?php echo $Event->getStreamSrc( array( "mode=mpeg&format=h264" ) ); ?>" type="video/mp4">
|
||||||
Your browser does not support the video tag.
|
Your browser does not support the video tag.
|
||||||
</video>
|
</video>
|
||||||
</div>
|
</div>
|
||||||
<!--script>includeVideoJs();</script-->
|
<!--script>includeVideoJs();</script-->
|
||||||
<link href="//vjs.zencdn.net/4.11/video-js.css" rel="stylesheet">
|
<link href="//vjs.zencdn.net/4.11/video-js.css" rel="stylesheet">
|
||||||
<script src="//vjs.zencdn.net/4.11/video.js"></script>
|
<script src="//vjs.zencdn.net/4.11/video.js"></script>
|
||||||
<script src="./js/videojs.zoomrotate.js"></script>
|
<script src="./js/videojs.zoomrotate.js"></script>
|
||||||
<script src="//cdnjs.cloudflare.com/ajax/libs/moment.js/2.10.6/moment.min.js"></script>
|
<script src="//cdnjs.cloudflare.com/ajax/libs/moment.js/2.10.6/moment.min.js"></script>
|
||||||
<script>
|
<script>
|
||||||
var LabelFormat = "<?php echo validJsStr($event['LabelFormat'])?>";
|
var LabelFormat = "<?php echo validJsStr($Monitor->LabelFormat())?>";
|
||||||
var monitorName = "<?php echo validJsStr($event['MonitorName'])?>";
|
var monitorName = "<?php echo validJsStr($Monitor->Name())?>";
|
||||||
var duration = <?php echo $event['Length'] ?>, startTime = '<?php echo $event['StartTime'] ?>';
|
var duration = <?php echo $Event->Length() ?>, startTime = '<?php echo $Event->StartTime() ?>';
|
||||||
|
|
||||||
addVideoTimingTrack(document.getElementById('videoobj'), LabelFormat, monitorName, duration, startTime);
|
|
||||||
</script>
|
|
||||||
|
|
||||||
|
addVideoTimingTrack(document.getElementById('videoobj'), LabelFormat, monitorName, duration, startTime);
|
||||||
|
</script>
|
||||||
<?php
|
<?php
|
||||||
}
|
} // end if DefaultVideo
|
||||||
else
|
|
||||||
{
|
|
||||||
?>
|
?>
|
||||||
<div id="imageFeed">
|
<div id="imageFeed" <?php if ( $Event->DefaultVideo() ) { ?>class="hidden"<?php } ?> >
|
||||||
<?php
|
<?php
|
||||||
if ( ZM_WEB_STREAM_METHOD == 'mpeg' && ZM_MPEG_LIVE_FORMAT )
|
if ( ZM_WEB_STREAM_METHOD == 'mpeg' && ZM_MPEG_LIVE_FORMAT ) {
|
||||||
{
|
|
||||||
$streamSrc = getStreamSrc( array( "source=event", "mode=mpeg", "event=".$eid, "frame=".$fid, "scale=".$scale, "rate=".$rate, "bitrate=".ZM_WEB_VIDEO_BITRATE, "maxfps=".ZM_WEB_VIDEO_MAXFPS, "format=".ZM_MPEG_REPLAY_FORMAT, "replay=".$replayMode ) );
|
$streamSrc = getStreamSrc( array( "source=event", "mode=mpeg", "event=".$eid, "frame=".$fid, "scale=".$scale, "rate=".$rate, "bitrate=".ZM_WEB_VIDEO_BITRATE, "maxfps=".ZM_WEB_VIDEO_MAXFPS, "format=".ZM_MPEG_REPLAY_FORMAT, "replay=".$replayMode ) );
|
||||||
outputVideoStream( "evtStream", $streamSrc, reScale( $event['Width'], $scale ), reScale( $event['Height'], $scale ), ZM_MPEG_LIVE_FORMAT );
|
outputVideoStream( "evtStream", $streamSrc, reScale( $Event->Width(), $scale ), reScale( $Event->Height(), $scale ), ZM_MPEG_LIVE_FORMAT );
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
$streamSrc = getStreamSrc( array( "source=event", "mode=jpeg", "event=".$eid, "frame=".$fid, "scale=".$scale, "rate=".$rate, "maxfps=".ZM_WEB_VIDEO_MAXFPS, "replay=".$replayMode) );
|
$streamSrc = getStreamSrc( array( "source=event", "mode=jpeg", "event=".$eid, "frame=".$fid, "scale=".$scale, "rate=".$rate, "maxfps=".ZM_WEB_VIDEO_MAXFPS, "replay=".$replayMode) );
|
||||||
if ( canStreamNative() )
|
if ( canStreamNative() ) {
|
||||||
{
|
outputImageStream( "evtStream", $streamSrc, reScale( $Event->Width(), $scale ), reScale( $Event->Height(), $scale ), validHtmlStr($Event->Name()) );
|
||||||
outputImageStream( "evtStream", $streamSrc, reScale( $event['Width'], $scale ), reScale( $event['Height'], $scale ), validHtmlStr($event['Name']) );
|
} else {
|
||||||
|
outputHelperStream( "evtStream", $streamSrc, reScale( $Event->Width(), $scale ), reScale( $Event->Height(), $scale ) );
|
||||||
}
|
}
|
||||||
else
|
} // end if stream method
|
||||||
{
|
|
||||||
outputHelperStream( "evtStream", $streamSrc, reScale( $event['Width'], $scale ), reScale( $event['Height'], $scale ) );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
<p id="dvrControls">
|
<p id="dvrControls">
|
||||||
<input type="button" value="<+" id="prevBtn" title="<?php echo translate('Prev') ?>" class="inactive" onclick="streamPrev( true )"/>
|
<input type="button" value="<+" id="prevBtn" title="<?php echo translate('Prev') ?>" class="inactive" onclick="streamPrev( true );"/>
|
||||||
<input type="button" value="<<" id="fastRevBtn" title="<?php echo translate('Rewind') ?>" class="inactive" disabled="disabled" onclick="streamFastRev( true )"/>
|
<input type="button" value="<<" id="fastRevBtn" title="<?php echo translate('Rewind') ?>" class="inactive" disabled="disabled" onclick="streamFastRev( true );"/>
|
||||||
<input type="button" value="<" id="slowRevBtn" title="<?php echo translate('StepBack') ?>" class="unavail" disabled="disabled" onclick="streamSlowRev( true )"/>
|
<input type="button" value="<" id="slowRevBtn" title="<?php echo translate('StepBack') ?>" class="unavail" disabled="disabled" onclick="streamSlowRev( true );"/>
|
||||||
<input type="button" value="||" id="pauseBtn" title="<?php echo translate('Pause') ?>" class="inactive" onclick="streamPause( true )"/>
|
<input type="button" value="||" id="pauseBtn" title="<?php echo translate('Pause') ?>" class="inactive" onclick="streamPause( true );"/>
|
||||||
<input type="button" value="|>" id="playBtn" title="<?php echo translate('Play') ?>" class="active" disabled="disabled" onclick="streamPlay( true )"/>
|
<input type="button" value="|>" id="playBtn" title="<?php echo translate('Play') ?>" class="active" disabled="disabled" onclick="streamPlay( true );"/>
|
||||||
<input type="button" value=">" id="slowFwdBtn" title="<?php echo translate('StepForward') ?>" class="unavail" disabled="disabled" onclick="streamSlowFwd( true )"/>
|
<input type="button" value=">" id="slowFwdBtn" title="<?php echo translate('StepForward') ?>" class="unavail" disabled="disabled" onclick="streamSlowFwd( true );"/>
|
||||||
<input type="button" value=">>" id="fastFwdBtn" title="<?php echo translate('FastForward') ?>" class="inactive" disabled="disabled" onclick="streamFastFwd( true )"/>
|
<input type="button" value=">>" id="fastFwdBtn" title="<?php echo translate('FastForward') ?>" class="inactive" disabled="disabled" onclick="streamFastFwd( true );"/>
|
||||||
<input type="button" value="–" id="zoomOutBtn" title="<?php echo translate('ZoomOut') ?>" class="avail" onclick="streamZoomOut()"/>
|
<input type="button" value="–" id="zoomOutBtn" title="<?php echo translate('ZoomOut') ?>" class="avail" onclick="streamZoomOut();"/>
|
||||||
<input type="button" value="+>" id="nextBtn" title="<?php echo translate('Next') ?>" class="inactive" onclick="streamNext( true )"/>
|
<input type="button" value="+>" id="nextBtn" title="<?php echo translate('Next') ?>" class="inactive" onclick="streamNext( true );"/>
|
||||||
</p>
|
</p>
|
||||||
<div id="replayStatus">
|
<div id="replayStatus">
|
||||||
<span id="mode"><?php echo translate('Mode') ?>: <span id="modeValue"> </span></span>
|
<span id="mode"><?php echo translate('Mode') ?>: <span id="modeValue"> </span></span>
|
||||||
|
@ -209,23 +200,14 @@ else
|
||||||
<span id="zoom"><?php echo translate('Zoom') ?>: <span id="zoomValue"></span>x</span>
|
<span id="zoom"><?php echo translate('Zoom') ?>: <span id="zoomValue"></span>x</span>
|
||||||
</div>
|
</div>
|
||||||
<div id="progressBar" class="invisible">
|
<div id="progressBar" class="invisible">
|
||||||
<?php
|
<?php for ( $i = 0; $i < $panelSections; $i++ ) { ?>
|
||||||
for ( $i = 0; $i < $panelSections; $i++ )
|
|
||||||
{
|
|
||||||
?>
|
|
||||||
<div class="progressBox" id="progressBox<?php echo $i ?>" title=""></div>
|
<div class="progressBox" id="progressBox<?php echo $i ?>" title=""></div>
|
||||||
<?php
|
<?php } ?>
|
||||||
}
|
|
||||||
?>
|
|
||||||
</div>
|
</div>
|
||||||
<?php
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
if ($event['SaveJPEGs'] & 3)
|
if ($Event->SaveJPEGs() & 3) { // frames or analysis
|
||||||
{
|
|
||||||
?>
|
?>
|
||||||
<div id="eventStills" class="hidden">
|
<div id="eventStills" class="hidden">
|
||||||
<div id="eventThumbsPanel">
|
<div id="eventThumbsPanel">
|
||||||
|
@ -262,9 +244,10 @@ if ($event['SaveJPEGs'] & 3)
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
}
|
} // end if SaveJPEGs() & 3 Analysis or Jpegs
|
||||||
}
|
} // end if canView
|
||||||
|
} // end if Event exists
|
||||||
?>
|
?>
|
||||||
</div>
|
</div><!--page-->
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -18,9 +18,8 @@
|
||||||
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
//
|
//
|
||||||
|
|
||||||
if ( !canView( 'Events' ) )
|
if ( !canView( 'Events' ) ) {
|
||||||
{
|
$view = 'error';
|
||||||
$view = "error";
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,7 +55,13 @@ if ( isset( $_REQUEST['scale'] ) )
|
||||||
else
|
else
|
||||||
$scale = max( reScale( SCALE_BASE, $event['DefaultScale'], ZM_WEB_DEFAULT_SCALE ), SCALE_BASE );
|
$scale = max( reScale( SCALE_BASE, $event['DefaultScale'], ZM_WEB_DEFAULT_SCALE ), SCALE_BASE );
|
||||||
|
|
||||||
$imageData = getImageSrc( $event, $frame, $scale, (isset($_REQUEST['show']) && $_REQUEST['show']=="capt") );
|
$show = 'capt';
|
||||||
|
if ( isset($_REQUEST['show']) ) {
|
||||||
|
$show = $_REQUEST['show'];
|
||||||
|
#} else if ( $imageData['hasAnalImage'] ) {
|
||||||
|
#$show = 'anal';
|
||||||
|
}
|
||||||
|
$imageData = getImageSrc( $event, $frame, $scale, ($show=="capt") );
|
||||||
|
|
||||||
$imagePath = $imageData['thumbPath'];
|
$imagePath = $imageData['thumbPath'];
|
||||||
$eventPath = $imageData['eventPath'];
|
$eventPath = $imageData['eventPath'];
|
||||||
|
@ -79,23 +84,16 @@ xhtmlHeaders(__FILE__, translate('Frame')." - ".$event['Id']." - ".$Frame->Frame
|
||||||
</div>
|
</div>
|
||||||
<div id="content">
|
<div id="content">
|
||||||
<p id="image">
|
<p id="image">
|
||||||
<?php if ( in_array($event['VideoWriter'],array("1","2")) ) { ?>
|
<a href="?view=frame&eid=<?php echo $event['Id'] ?>&fid=<?php echo $Frame->FrameId() ?>&scale=<?php echo $scale ?>&show=<?php echo $show == 'anal' ? 'capt':'anal' ?>">
|
||||||
<img src="?view=image&eid=<?php echo $event['Id'] ?>&fid=<?php echo $Frame->FrameId() ?>&scale=<?php echo $event['DefaultScale'] ?>&show=<?php echo $imageData['isAnalImage']?"capt":"anal" ?>" class="<?php echo $imageData['imageClass'] ?>" width="<?php echo reScale( $event['Width'], $event['DefaultScale'], $scale ) ?>" height="<?php echo reScale( $event['Height'], $event['DefaultScale'], $scale ) ?>" alt="<?php echo $Frame->EventId()."-".$Frame->FrameId() ?>">
|
<img src="<?php echo $Frame->getImageSrc($imageData['isAnalImage']?'analyse':'capture') ?>" width="<?php echo reScale( $event['Width'], $event['DefaultScale'], $scale ) ?>" height="<?php echo reScale( $event['Height'], $event['DefaultScale'], $scale ) ?>" alt="<?php echo $Frame->EventId()."-".$Frame->FrameId() ?>" class="<?php echo $imageData['imageClass'] ?>"/>
|
||||||
<?php } else {
|
</p>
|
||||||
if ( $imageData['hasAnalImage'] ) { ?>
|
|
||||||
<a href="?view=frame&eid=<?php echo $event['Id'] ?>&fid=<?php echo $Frame->FrameId() ?>&scale=<?php echo $scale ?>&show=<?php echo $imageData['isAnalImage']?'capt':'anal' ?>">
|
|
||||||
<?php } ?>
|
|
||||||
<img src="<?php echo $Frame->getImageSrc($imageData['isAnalImage']?'analyse':'capture') ?>" width="<?php echo reScale( $event['Width'], $event['DefaultScale'], $scale ) ?>" height="<?php echo reScale( $event['Height'], $event['DefaultScale'], $scale ) ?>" alt="<?php echo $Frame->EventId()."-".$Frame->FrameId() ?>" class="<?php echo $imageData['imageClass'] ?>"/>
|
|
||||||
<?php if ( $imageData['hasAnalImage'] ) { ?></a><?php } ?>
|
|
||||||
<?php } ?>
|
|
||||||
</p>
|
|
||||||
<p id="controls">
|
<p id="controls">
|
||||||
<?php if ( $Frame->FrameId() > 1 ) { ?>
|
<?php if ( $Frame->FrameId() > 1 ) { ?>
|
||||||
<a id="firstLink" href="?view=frame&eid=<?php echo $event['Id'] ?>&fid=<?php echo $firstFid ?>&scale=<?php echo $scale ?>"><?php echo translate('First') ?></a>
|
<a id="firstLink" href="?view=frame&eid=<?php echo $event['Id'] ?>&fid=<?php echo $firstFid ?>&scale=<?php echo $scale ?>&show=<?php echo $show ?>"><?php echo translate('First') ?></a>
|
||||||
<a id="prevLink" href="?view=frame&eid=<?php echo $event['Id'] ?>&fid=<?php echo $prevFid ?>&scale=<?php echo $scale ?>"><?php echo translate('Prev') ?></a>
|
<a id="prevLink" href="?view=frame&eid=<?php echo $event['Id'] ?>&fid=<?php echo $prevFid ?>&scale=<?php echo $scale ?>&show=<?php echo $show ?>"><?php echo translate('Prev') ?></a>
|
||||||
<?php } if ( $Frame->FrameId() < $maxFid ) { ?>
|
<?php } if ( $Frame->FrameId() < $maxFid ) { ?>
|
||||||
<a id="nextLink" href="?view=frame&eid=<?php echo $event['Id'] ?>&fid=<?php echo $nextFid ?>&scale=<?php echo $scale ?>"><?php echo translate('Next') ?></a>
|
<a id="nextLink" href="?view=frame&eid=<?php echo $event['Id'] ?>&fid=<?php echo $nextFid ?>&scale=<?php echo $scale ?>&show=<?php echo $show ?>"><?php echo translate('Next') ?></a>
|
||||||
<a id="lastLink" href="?view=frame&eid=<?php echo $event['Id'] ?>&fid=<?php echo $lastFid ?>&scale=<?php echo $scale ?>"><?php echo translate('Last') ?></a>
|
<a id="lastLink" href="?view=frame&eid=<?php echo $event['Id'] ?>&fid=<?php echo $lastFid ?>&scale=<?php echo $scale ?>&show=<?php echo $show ?>"><?php echo translate('Last') ?></a>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</p>
|
</p>
|
||||||
<?php if (file_exists ($dImagePath)) { ?>
|
<?php if (file_exists ($dImagePath)) { ?>
|
||||||
|
|
|
@ -18,9 +18,8 @@
|
||||||
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
//
|
//
|
||||||
|
|
||||||
if ( !canEdit( 'Monitors' ) )
|
if ( !canEdit( 'Monitors' ) ) {
|
||||||
{
|
$view = 'error';
|
||||||
$view = "error";
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,8 +42,7 @@ xhtmlHeaders(__FILE__, translate('Function')." - ".validHtmlStr($monitor['Name']
|
||||||
<p>
|
<p>
|
||||||
<select name="newFunction">
|
<select name="newFunction">
|
||||||
<?php
|
<?php
|
||||||
foreach ( getEnumValues( 'Monitors', 'Function' ) as $optFunction )
|
foreach ( getEnumValues( 'Monitors', 'Function' ) as $optFunction ) {
|
||||||
{
|
|
||||||
?>
|
?>
|
||||||
<option value="<?php echo $optFunction ?>"<?php if ( $optFunction == $monitor['Function'] ) { ?> selected="selected"<?php } ?>><?php echo translate('Fn'.$optFunction) ?></option>
|
<option value="<?php echo $optFunction ?>"<?php if ( $optFunction == $monitor['Function'] ) { ?> selected="selected"<?php } ?>><?php echo translate('Fn'.$optFunction) ?></option>
|
||||||
<?php
|
<?php
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
function setButtonState( element, butClass )
|
function setButtonState( element, butClass )
|
||||||
{
|
{
|
||||||
|
if ( element ) {
|
||||||
element.className = butClass;
|
element.className = butClass;
|
||||||
element.disabled = (butClass != 'inactive');
|
element.disabled = (butClass != 'inactive');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function changeScale() {
|
function changeScale() {
|
||||||
|
@ -87,7 +89,7 @@ function getCmdResponse( respObj, respText )
|
||||||
streamCmdTimer = streamQuery.delay( streamTimeout );
|
streamCmdTimer = streamQuery.delay( streamTimeout );
|
||||||
}
|
}
|
||||||
|
|
||||||
var streamReq = new Request.JSON( { url: thisUrl, method: 'post', timeout: AJAX_TIMEOUT, link: 'chain', onSuccess: getCmdResponse } );
|
var streamReq = new Request.JSON( { url: thisUrl, method: 'get', timeout: AJAX_TIMEOUT, link: 'chain', onSuccess: getCmdResponse } );
|
||||||
|
|
||||||
function streamPause( action )
|
function streamPause( action )
|
||||||
{
|
{
|
||||||
|
@ -251,7 +253,7 @@ function getEventResponse( respObj, respText )
|
||||||
nearEventsQuery( eventData.Id );
|
nearEventsQuery( eventData.Id );
|
||||||
}
|
}
|
||||||
|
|
||||||
var eventReq = new Request.JSON( { url: thisUrl, method: 'post', timeout: AJAX_TIMEOUT, link: 'cancel', onSuccess: getEventResponse } );
|
var eventReq = new Request.JSON( { url: thisUrl, method: 'get', timeout: AJAX_TIMEOUT, link: 'cancel', onSuccess: getEventResponse } );
|
||||||
|
|
||||||
function eventQuery( eventId )
|
function eventQuery( eventId )
|
||||||
{
|
{
|
||||||
|
@ -277,7 +279,7 @@ function getNearEventsResponse( respObj, respText )
|
||||||
$('nextEventBtn').disabled = !nextEventId;
|
$('nextEventBtn').disabled = !nextEventId;
|
||||||
}
|
}
|
||||||
|
|
||||||
var nearEventsReq = new Request.JSON( { url: thisUrl, method: 'post', timeout: AJAX_TIMEOUT, link: 'cancel', onSuccess: getNearEventsResponse } );
|
var nearEventsReq = new Request.JSON( { url: thisUrl, method: 'get', timeout: AJAX_TIMEOUT, link: 'cancel', onSuccess: getNearEventsResponse } );
|
||||||
|
|
||||||
function nearEventsQuery( eventId )
|
function nearEventsQuery( eventId )
|
||||||
{
|
{
|
||||||
|
@ -386,8 +388,12 @@ function hideEventImageComplete()
|
||||||
{
|
{
|
||||||
var eventImg = $('eventImage');
|
var eventImg = $('eventImage');
|
||||||
var thumbImg = $('eventThumb'+$('eventImage').getProperty( 'alt' ));
|
var thumbImg = $('eventThumb'+$('eventImage').getProperty( 'alt' ));
|
||||||
|
if ( thumbImg ) {
|
||||||
thumbImg.removeClass('selected');
|
thumbImg.removeClass('selected');
|
||||||
thumbImg.setOpacity( 1.0 );
|
thumbImg.setOpacity( 1.0 );
|
||||||
|
} else {
|
||||||
|
console.log("Unable to find eventThumb at " + 'eventThumb'+$('eventImage').getProperty( 'alt' ) );
|
||||||
|
}
|
||||||
$('prevImageBtn').disabled = true;
|
$('prevImageBtn').disabled = true;
|
||||||
$('nextImageBtn').disabled = true;
|
$('nextImageBtn').disabled = true;
|
||||||
$('eventImagePanel').setStyle( 'display', 'none' );
|
$('eventImagePanel').setStyle( 'display', 'none' );
|
||||||
|
@ -447,7 +453,7 @@ function getFrameResponse( respObj, respText )
|
||||||
loadEventThumb( eventData, frame, respObj.loopback=="true" );
|
loadEventThumb( eventData, frame, respObj.loopback=="true" );
|
||||||
}
|
}
|
||||||
|
|
||||||
var frameReq = new Request.JSON( { url: thisUrl, method: 'post', timeout: AJAX_TIMEOUT, link: 'chain', onSuccess: getFrameResponse } );
|
var frameReq = new Request.JSON( { url: thisUrl, method: 'get', timeout: AJAX_TIMEOUT, link: 'chain', onSuccess: getFrameResponse } );
|
||||||
|
|
||||||
function frameQuery( eventId, frameId, loadImage )
|
function frameQuery( eventId, frameId, loadImage )
|
||||||
{
|
{
|
||||||
|
@ -589,7 +595,7 @@ function getActResponse( respObj, respText )
|
||||||
eventQuery( eventData.Id );
|
eventQuery( eventData.Id );
|
||||||
}
|
}
|
||||||
|
|
||||||
var actReq = new Request.JSON( { url: thisUrl, method: 'post', timeout: AJAX_TIMEOUT, link: 'cancel', onSuccess: getActResponse } );
|
var actReq = new Request.JSON( { url: thisUrl, method: 'get', timeout: AJAX_TIMEOUT, link: 'cancel', onSuccess: getActResponse } );
|
||||||
|
|
||||||
function actQuery( action, parms )
|
function actQuery( action, parms )
|
||||||
{
|
{
|
||||||
|
@ -639,6 +645,7 @@ function showEventFrames()
|
||||||
function showVideo()
|
function showVideo()
|
||||||
{
|
{
|
||||||
$('eventStills').addClass( 'hidden' );
|
$('eventStills').addClass( 'hidden' );
|
||||||
|
$('imageFeed').addClass('hidden');
|
||||||
$('eventVideo').removeClass( 'hidden' );
|
$('eventVideo').removeClass( 'hidden' );
|
||||||
|
|
||||||
$('stillsEvent').removeClass( 'hidden' );
|
$('stillsEvent').removeClass( 'hidden' );
|
||||||
|
@ -651,7 +658,17 @@ function showVideo()
|
||||||
function showStills()
|
function showStills()
|
||||||
{
|
{
|
||||||
$('eventStills').removeClass( 'hidden' );
|
$('eventStills').removeClass( 'hidden' );
|
||||||
|
$('imageFeed').removeClass('hidden');
|
||||||
$('eventVideo').addClass( 'hidden' );
|
$('eventVideo').addClass( 'hidden' );
|
||||||
|
|
||||||
|
if (vid && ( vid.paused != true ) ) {
|
||||||
|
// Pause the video
|
||||||
|
vid.pause();
|
||||||
|
|
||||||
|
// Update the button text to 'Play'
|
||||||
|
//if ( playButton )
|
||||||
|
//playButton.innerHTML = "Play";
|
||||||
|
}
|
||||||
|
|
||||||
$('stillsEvent').addClass( 'hidden' );
|
$('stillsEvent').addClass( 'hidden' );
|
||||||
$('videoEvent').removeClass( 'hidden' );
|
$('videoEvent').removeClass( 'hidden' );
|
||||||
|
@ -659,8 +676,7 @@ function showStills()
|
||||||
streamMode = 'stills';
|
streamMode = 'stills';
|
||||||
|
|
||||||
streamPause( true );
|
streamPause( true );
|
||||||
if ( !scroll )
|
if ( !scroll ) {
|
||||||
{
|
|
||||||
scroll = new Fx.Scroll( 'eventThumbs', {
|
scroll = new Fx.Scroll( 'eventThumbs', {
|
||||||
wait: false,
|
wait: false,
|
||||||
duration: 500,
|
duration: 500,
|
||||||
|
@ -745,6 +761,7 @@ function handleClick( event )
|
||||||
}
|
}
|
||||||
function setupListener()
|
function setupListener()
|
||||||
{
|
{
|
||||||
|
// I think this stuff was to use our existing buttons instead of the videojs controls.
|
||||||
|
|
||||||
// Buttons
|
// Buttons
|
||||||
var playButton = document.getElementById("play-pause");
|
var playButton = document.getElementById("play-pause");
|
||||||
|
@ -840,42 +857,38 @@ function setupListener()
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function initPage()
|
function initPage() {
|
||||||
{
|
//FIXME prevent blocking...not sure what is happening or best way to unblock
|
||||||
//FIXME prevent blocking...not sure what is happening or best way to unblock
|
vid = videojs("videoobj");
|
||||||
vid=$('videoobj');
|
if ( vid ) {
|
||||||
if (vid)
|
/*
|
||||||
{
|
setupListener();
|
||||||
/*setupListener();
|
vid.removeAttribute("controls");
|
||||||
vid.removeAttribute("controls");
|
/* window.videoobj.oncanplay=null;
|
||||||
/* window.videoobj.oncanplay=null;
|
window.videoobj.currentTime=window.videoobj.currentTime-1;
|
||||||
window.videoobj.currentTime=window.videoobj.currentTime-1;
|
window.videoobj.currentTime=window.videoobj.currentTime+1;//may not be symetrical of course
|
||||||
window.videoobj.currentTime=window.videoobj.currentTime+1;//may not be symetrical of course
|
|
||||||
|
|
||||||
vid.onstalled=function(){window.vid.currentTime=window.vid.currentTime-1;window.vid.currentTime=window.vid.currentTime+1;}
|
|
||||||
vid.onwaiting=function(){window.vid.currentTime=window.vid.currentTime-1;window.vid.currentTime=window.vid.currentTime+1;}
|
|
||||||
vid.onloadstart=function(){window.vid.currentTime=window.vid.currentTime-1;window.vid.currentTime=window.vid.currentTime+1;}
|
|
||||||
vid.onplay=function(){window.vid.currentTime=window.vid.currentTime-1;window.vid.currentTime=window.vid.currentTime+1;}
|
|
||||||
vid.onplaying=function(){window.vid.currentTime=window.vid.currentTime-1;window.vid.currentTime=window.vid.currentTime+1;}
|
|
||||||
//window.vid.hide();//does not help
|
|
||||||
var sources = window.videoobj.getElementsByTagName('source');
|
|
||||||
sources[0].src=null;
|
|
||||||
window.videoobj.load();
|
|
||||||
streamPlay(); */
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
streamCmdTimer = streamQuery.delay( 250 );
|
|
||||||
eventQuery.pass( eventData.Id ).delay( 500 );
|
|
||||||
|
|
||||||
if ( canStreamNative )
|
vid.onstalled=function(){window.vid.currentTime=window.vid.currentTime-1;window.vid.currentTime=window.vid.currentTime+1;}
|
||||||
{
|
vid.onwaiting=function(){window.vid.currentTime=window.vid.currentTime-1;window.vid.currentTime=window.vid.currentTime+1;}
|
||||||
var streamImg = $('imageFeed').getElement('img');
|
vid.onloadstart=function(){window.vid.currentTime=window.vid.currentTime-1;window.vid.currentTime=window.vid.currentTime+1;}
|
||||||
if ( !streamImg )
|
vid.onplay=function(){window.vid.currentTime=window.vid.currentTime-1;window.vid.currentTime=window.vid.currentTime+1;}
|
||||||
streamImg = $('imageFeed').getElement('object');
|
vid.onplaying=function(){window.vid.currentTime=window.vid.currentTime-1;window.vid.currentTime=window.vid.currentTime+1;}
|
||||||
$(streamImg).addEvent( 'click', function( event ) { handleClick( event ); } );
|
//window.vid.hide();//does not help
|
||||||
}
|
var sources = window.videoobj.getElementsByTagName('source');
|
||||||
|
sources[0].src=null;
|
||||||
|
window.videoobj.load();
|
||||||
|
streamPlay(); */
|
||||||
|
} else {
|
||||||
|
streamCmdTimer = streamQuery.delay( 250 );
|
||||||
|
eventQuery.pass( eventData.Id ).delay( 500 );
|
||||||
|
|
||||||
|
if ( canStreamNative ) {
|
||||||
|
var streamImg = $('imageFeed').getElement('img');
|
||||||
|
if ( !streamImg )
|
||||||
|
streamImg = $('imageFeed').getElement('object');
|
||||||
|
$(streamImg).addEvent( 'click', function( event ) { handleClick( event ); } );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Kick everything off
|
// Kick everything off
|
||||||
|
|
|
@ -26,11 +26,11 @@ var SCALE_BASE = <?php echo SCALE_BASE ?>;
|
||||||
var connKey = '<?php echo $connkey ?>';
|
var connKey = '<?php echo $connkey ?>';
|
||||||
|
|
||||||
var eventData = {
|
var eventData = {
|
||||||
Id: '<?php echo $event['Id'] ?>',
|
Id: '<?php echo $Event->Id() ?>',
|
||||||
MonitorId: '<?php echo $event['MonitorId'] ?>',
|
MonitorId: '<?php echo $Event->MonitorId() ?>',
|
||||||
Width: '<?php echo $event['Width'] ?>',
|
Width: '<?php echo $Event->Width() ?>',
|
||||||
Height: '<?php echo $event['Height'] ?>',
|
Height: '<?php echo $Event->Height() ?>',
|
||||||
Length: '<?php echo $event['Length'] ?>'
|
Length: '<?php echo $Event->Length() ?>'
|
||||||
};
|
};
|
||||||
|
|
||||||
var filterQuery = '<?php echo isset($filterQuery)?validJsStr($filterQuery):'' ?>';
|
var filterQuery = '<?php echo isset($filterQuery)?validJsStr($filterQuery):'' ?>';
|
||||||
|
|
|
@ -151,7 +151,7 @@ if ( !empty($user['MonitorIds']) )
|
||||||
|
|
||||||
$eventsSql .= $monFilterSql;
|
$eventsSql .= $monFilterSql;
|
||||||
$monitorsSQL .= $monFilterSql;
|
$monitorsSQL .= $monFilterSql;
|
||||||
$frameSql .= $monFilterSql;
|
$frameSql .= ' AND e.MonitorId IN ('.$user['MonitorIds'].')';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parse input parameters -- note for future, validate/clean up better in case we don't get called from self.
|
// Parse input parameters -- note for future, validate/clean up better in case we don't get called from self.
|
||||||
|
@ -224,12 +224,12 @@ if( isset($minTime) && isset($maxTime) )
|
||||||
$eventsSql .= "having CalcEndTimeSecs > '" . $minTimeSecs . "' and StartTimeSecs < '" . $maxTimeSecs . "'";
|
$eventsSql .= "having CalcEndTimeSecs > '" . $minTimeSecs . "' and StartTimeSecs < '" . $maxTimeSecs . "'";
|
||||||
$frameSql .= "and TimeStamp > '" . $minTime . "' and TimeStamp < '" . $maxTime . "'";
|
$frameSql .= "and TimeStamp > '" . $minTime . "' and TimeStamp < '" . $maxTime . "'";
|
||||||
}
|
}
|
||||||
$frameSql .= "group by E.Id, E.MonitorId, F.TimeStamp order by E.MonitorId, F.TimeStamp asc";
|
$frameSql .= "group by E.Id, E.MonitorId, F.TimeStamp, F.Delta order by E.MonitorId, F.TimeStamp asc";
|
||||||
|
|
||||||
// This loads all monitors the user can see - even if we don't have data for one we still show all for switch to live.
|
// This loads all monitors the user can see - even if we don't have data for one we still show all for switch to live.
|
||||||
|
|
||||||
$monitors = array();
|
$monitors = array();
|
||||||
$monitorsSql .= " order by Sequence asc ";
|
$monitorsSql .= ' ORDER BY Sequence ASC ';
|
||||||
$index=0;
|
$index=0;
|
||||||
foreach( dbFetchAll( $monitorsSql ) as $row )
|
foreach( dbFetchAll( $monitorsSql ) as $row )
|
||||||
{
|
{
|
||||||
|
@ -256,42 +256,39 @@ input[type=range]::-ms-tooltip {
|
||||||
</div>
|
</div>
|
||||||
<h2><?php echo translate('MontageReview') ?></h2>
|
<h2><?php echo translate('MontageReview') ?></h2>
|
||||||
</div>
|
</div>
|
||||||
<div id='ScaleDiv' style='display: inline-flex; border: 1px solid black;'>
|
<div id="ScaleDiv" style="display: inline-flex; border: 1px solid black;">
|
||||||
<label style='margin:5px;' for=scaleslider><?php echo translate('Scale')?></label>
|
<label style="margin:5px;" for="scaleslider"><?php echo translate('Scale')?></label>
|
||||||
<input id=scaleslider type=range min=0.1 max=1.0 value=<?php echo $defaultScale ?> step=0.10 width=20% onchange='setScale(this.value)' oninput='showScale(this.value)'/>
|
<input id=scaleslider type=range min=0.1 max=1.0 value=<?php echo $defaultScale ?> step=0.10 width=20% onchange='setScale(this.value)' oninput='showScale(this.value)'/>
|
||||||
<span style='margin:5px;' id=scaleslideroutput><?php echo number_format((float)$defaultScale,2,'.','')?> x</span>
|
<span style='margin:5px;' id=scaleslideroutput><?php echo number_format((float)$defaultScale,2,'.','')?> x</span>
|
||||||
</div>
|
</div>
|
||||||
<div id='SpeedDiv' style='display: inline-flex; border: 1px solid black;'>
|
<div id="SpeedDiv" style='display: inline-flex; border: 1px solid black;'>
|
||||||
<label style='margin:5px;' for=speedslider><?php echo translate('Speed') ?></label>
|
<label style='margin:5px;' for=speedslider><?php echo translate('Speed') ?></label>
|
||||||
<input id=speedslider type=range min=0 max=<?php echo count($speeds)-1?> value=<?php echo $speedIndex ?> step=1 wdth=20% onchange='setSpeed(this.value)' oninput='showSpeed(this.value)'/>
|
<input id=speedslider type=range min=0 max=<?php echo count($speeds)-1?> value=<?php echo $speedIndex ?> step=1 wdth=20% onchange='setSpeed(this.value)' oninput='showSpeed(this.value)'/>
|
||||||
<span style='margin:5px;' id=speedslideroutput><?php echo $speeds[$speedIndex] ?> fps</span>
|
<span style='margin:5px;' id=speedslideroutput><?php echo $speeds[$speedIndex] ?> fps</span>
|
||||||
</div>
|
</div>
|
||||||
<div style='display: inline-flex; border: 1px solid black; flex-flow: row wrap;'>
|
<div style='display: inline-flex; border: 1px solid black; flex-flow: row wrap;'>
|
||||||
<button type='button' id=panleft onclick='panleft() '>< <?php echo translate('Pan') ?></button>
|
<button type="button" id=panleft onclick='panleft() '>< <?php echo translate('Pan') ?></button>
|
||||||
<button type='button' id=zoomin onclick='zoomin() '><?php echo translate('In +') ?></button>
|
<button type="button" id=zoomin onclick='zoomin() '><?php echo translate('In +') ?></button>
|
||||||
<button type='button' id=zoomout onclick='zoomout() '><?php echo translate('Out -') ?></button>
|
<button type="button" id=zoomout onclick='zoomout() '><?php echo translate('Out -') ?></button>
|
||||||
<button type='button' id=lasteight onclick='lastEight() '><?php echo translate('8 Hour') ?></button>
|
<button type="button" id=lasteight onclick='lastEight() '><?php echo translate('8 Hour') ?></button>
|
||||||
<button type='button' id=lasthour onclick='lastHour() '><?php echo translate('1 Hour') ?></button>
|
<button type="button" id=lasthour onclick='lastHour() '><?php echo translate('1 Hour') ?></button>
|
||||||
<button type='button' id=allof onclick='allof() '><?php echo translate('All Events') ?></button>
|
<button type="button" id=allof onclick='allof() '><?php echo translate('All Events') ?></button>
|
||||||
<button type='button' id=live onclick='setLive(1-liveMode)'><?php echo translate('Live') ?></button>
|
<button type="button" id=live onclick='setLive(1-liveMode)'><?php echo translate('Live') ?></button>
|
||||||
<button type='button' id=fit onclick='setFit(1-fitMode) '><?php echo translate('Fit') ?></button>
|
<button type="button" id=fit onclick='setFit(1-fitMode) '><?php echo translate('Fit') ?></button>
|
||||||
<button type='button' id=panright onclick='panright() '><?php echo translate('Pan') ?> ></button>
|
<button type="button" id=panright onclick='panright() '><?php echo translate('Pan') ?> ></button>
|
||||||
</div>
|
</div>
|
||||||
<div id=timelinediv style='position:relative; width:93%;'>
|
<div id="timelinediv" style="position:relative; width:93%;">
|
||||||
<canvas id=timeline style='border:1px solid;' onmousemove='mmove(event)' ontouchmove='tmove(event)' onmousedown='mdown(event)' onmouseup='mup(event)' onmouseout='mout(event)' ></canvas>
|
<canvas id="timeline" style="border:1px solid;" onmousemove="mmove(event);" ontouchmove="tmove(event);" onmousedown="mdown(event);" onmouseup="mup(event);" onmouseout="mout(event);"></canvas>
|
||||||
<span id=scrubleft ></span>
|
<span id="scrubleft"></span>
|
||||||
<span id=scrubright ></span>
|
<span id="scrubright"></span>
|
||||||
<span id=scruboutput ></span>
|
<span id="scruboutput"></span>
|
||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
// Monitor images - these had to be loaded after the monitors used were determined (after loading events)
|
// Monitor images - these had to be loaded after the monitors used were determined (after loading events)
|
||||||
|
|
||||||
echo "<div id='monitors' style='position:relative; background-color:black;' width='100%' height='100%'>\n";
|
echo "<div id='monitors' style='position:relative; background-color:black;' width='100%' height='100%'>\n";
|
||||||
foreach ($monitors as $m)
|
foreach ($monitors as $m) {
|
||||||
{
|
echo "<canvas width='" . $m['Width'] * $defaultScale . "px' height='" . $m['Height'] * $defaultScale . "px' id='Monitor" . $m['Id'] . "' style='border:3px solid " . $m['WebColour'] . "' onclick='clickMonitor(event," . $m['Id'] . ")'>No Canvas Support!!</canvas>\n";
|
||||||
{
|
|
||||||
echo "<canvas width='" . $m['Width'] * $defaultScale . "px' height='" . $m['Height'] * $defaultScale . "px' id='Monitor" . $m['Id'] . "' style='border:3px solid " . $m['WebColour'] . "' onclick='clickMonitor(event," . $m['Id'] . ")'>No Canvas Support!!</canvas>\n";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
echo "</div>\n";
|
echo "</div>\n";
|
||||||
echo "<p id='fps'>evaluating fps</p>\n";
|
echo "<p id='fps'>evaluating fps</p>\n";
|
||||||
|
@ -331,8 +328,7 @@ $maxTimeSecs = strtotime("1950-01-01 01:01:01");
|
||||||
$index=0;
|
$index=0;
|
||||||
$anyAlarms=false;
|
$anyAlarms=false;
|
||||||
|
|
||||||
foreach( dbFetchAll( $eventsSql ) as $event )
|
foreach( dbFetchAll( $eventsSql ) as $event ) {
|
||||||
{
|
|
||||||
if( $minTimeSecs > $event['StartTimeSecs']) $minTimeSecs=$event['StartTimeSecs'];
|
if( $minTimeSecs > $event['StartTimeSecs']) $minTimeSecs=$event['StartTimeSecs'];
|
||||||
if( $maxTimeSecs < $event['CalcEndTimeSecs']) $maxTimeSecs=$event['CalcEndTimeSecs'];
|
if( $maxTimeSecs < $event['CalcEndTimeSecs']) $maxTimeSecs=$event['CalcEndTimeSecs'];
|
||||||
echo "eMonId[$index]=" . $event['MonitorId'] . "; eId[$index]=" . $event['Id'] . "; ";
|
echo "eMonId[$index]=" . $event['MonitorId'] . "; eId[$index]=" . $event['Id'] . "; ";
|
||||||
|
@ -349,30 +345,25 @@ foreach( dbFetchAll( $eventsSql ) as $event )
|
||||||
echo "\n";
|
echo "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
if($index == 0) // if there is no data set the min/max to the passed in values
|
// if there is no data set the min/max to the passed in values
|
||||||
{
|
if($index == 0) {
|
||||||
if(isset($minTime) && isset($maxTime))
|
if(isset($minTime) && isset($maxTime)) {
|
||||||
{
|
$minTimeSecs = strtotime($minTime);
|
||||||
$minTimeSecs = strtotime($minTime);
|
$maxTimeSecs = strtotime($maxTime);
|
||||||
$maxTimeSecs = strtotime($maxTime);
|
} else {
|
||||||
}
|
// this is the case of no passed in times AND no data -- just set something arbitrary
|
||||||
else // this is the case of no passed in times AND no data -- just set something arbitrary
|
$minTimeSecs=strtotime('1950-06-01 01:01:01'); // random time so there's something to display
|
||||||
{
|
$maxTimeSecs=strtotime('2020-06-02 02:02:02');
|
||||||
$minTimeSecs=strtotime('1950-06-01 01:01:01'); // random time so there's something to display
|
}
|
||||||
$maxTimeSecs=strtotime('2020-06-02 02:02:02');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// We only reset the calling time if there was no calling time
|
// We only reset the calling time if there was no calling time
|
||||||
if(!isset($minTime) || !isset($maxTime))
|
if(!isset($minTime) || !isset($maxTime)) {
|
||||||
{
|
$maxTime = strftime($maxTimeSecs);
|
||||||
$maxTime = strftime($maxTimeSecs);
|
$minTime = strftime($minTimeSecs);
|
||||||
$minTime = strftime($minTimeSecs);
|
} else {
|
||||||
}
|
$minTimeSecs = strtotime($minTime);
|
||||||
else
|
$maxTimeSecs = strtotime($maxTime);
|
||||||
{
|
|
||||||
$minTimeSecs = strtotime($minTime);
|
|
||||||
$maxTimeSecs = strtotime($maxTime);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we had any alarms in those events, this builds the list of all alarm frames, but consolidated down to (nearly) contiguous segments
|
// If we had any alarms in those events, this builds the list of all alarm frames, but consolidated down to (nearly) contiguous segments
|
||||||
|
@ -389,41 +380,37 @@ $fromSecs=-1;
|
||||||
$toSecs=-1;
|
$toSecs=-1;
|
||||||
$maxScore=-1;
|
$maxScore=-1;
|
||||||
|
|
||||||
if($anyAlarms)
|
if($anyAlarms) {
|
||||||
foreach( dbFetchAll ($frameSql) as $frame )
|
foreach( dbFetchAll ($frameSql) as $frame ) {
|
||||||
{
|
if($mId<0) {
|
||||||
if($mId<0)
|
$mId=$frame['MonitorId'];
|
||||||
{
|
$fromSecs=$frame['TimeStampSecs'];
|
||||||
$mId=$frame['MonitorId'];
|
$toSecs=$frame['TimeStampSecs'];
|
||||||
$fromSecs=$frame['TimeStampSecs'];
|
$maxScore=$frame['Score'];
|
||||||
$toSecs=$frame['TimeStampSecs'];
|
} else if ($mId != $frame['MonitorId'] || $frame['TimeStampSecs'] - $toSecs > 10) {
|
||||||
$maxScore=$frame['Score'];
|
// dump this one start a new
|
||||||
}
|
$index++;
|
||||||
else if ($mId != $frame['MonitorId'] || $frame['TimeStampSecs'] - $toSecs > 10) // dump this one start a new
|
echo " fMonId[$index]=" . $mId . ";";
|
||||||
{
|
echo " fTimeFromSecs[$index]=" . $fromSecs . ";";
|
||||||
$index++;
|
echo " fTimeToSecs[$index]=" . $toSecs . ";";
|
||||||
echo " fMonId[$index]=" . $mId . ";";
|
echo " fScore[$index]=" . $maxScore . ";\n";
|
||||||
echo " fTimeFromSecs[$index]=" . $fromSecs . ";";
|
$mId=$frame['MonitorId'];
|
||||||
echo " fTimeToSecs[$index]=" . $toSecs . ";";
|
$fromSecs=$frame['TimeStampSecs'];
|
||||||
echo " fScore[$index]=" . $maxScore . ";\n";
|
$toSecs=$frame['TimeStampSecs'];
|
||||||
$mId=$frame['MonitorId'];
|
$maxScore=$frame['Score'];
|
||||||
$fromSecs=$frame['TimeStampSecs'];
|
} else {
|
||||||
$toSecs=$frame['TimeStampSecs'];
|
// just add this one on
|
||||||
$maxScore=$frame['Score'];
|
$toSecs=$frame['TimeStampSecs'];
|
||||||
}
|
if($maxScore < $frame['Score']) $maxScore=$frame['Score'];
|
||||||
else // just add this one on
|
|
||||||
{
|
|
||||||
$toSecs=$frame['TimeStampSecs'];
|
|
||||||
if($maxScore < $frame['Score']) $maxScore=$frame['Score'];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if($mId>0)
|
|
||||||
{
|
|
||||||
echo " fMonId[$index]=" . $mId . ";";
|
|
||||||
echo " fTimeFromSecs[$index]=" . $fromSecs . ";";
|
|
||||||
echo " fTimeToSecs[$index]=" . $toSecs . ";";
|
|
||||||
echo " fScore[$index]=" . $maxScore . ";\n";
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if($mId>0) {
|
||||||
|
echo " fMonId[$index]=" . $mId . ";";
|
||||||
|
echo " fTimeFromSecs[$index]=" . $fromSecs . ";";
|
||||||
|
echo " fTimeToSecs[$index]=" . $toSecs . ";";
|
||||||
|
echo " fScore[$index]=" . $maxScore . ";\n";
|
||||||
|
}
|
||||||
|
|
||||||
echo "var maxScore=$maxScore;\n"; // used to skip frame load if we find no alarms.
|
echo "var maxScore=$maxScore;\n"; // used to skip frame load if we find no alarms.
|
||||||
echo "var monitorName = [];\n";
|
echo "var monitorName = [];\n";
|
||||||
|
@ -446,17 +433,15 @@ echo "var monitorPtr = []; // monitorName[monitorPtr[0]] is first monitor\n";
|
||||||
$numMonitors=0; // this array is indexed by the monitor ID for faster access later, so it may be sparse
|
$numMonitors=0; // this array is indexed by the monitor ID for faster access later, so it may be sparse
|
||||||
$avgArea=floatval(0); // Calculations the normalizing scale
|
$avgArea=floatval(0); // Calculations the normalizing scale
|
||||||
|
|
||||||
foreach ($monitors as $m)
|
foreach ($monitors as $m) {
|
||||||
{
|
$avgArea = $avgArea + floatval($m['Width'] * $m['Height']);
|
||||||
$avgArea = $avgArea + floatval($m['Width'] * $m['Height']);
|
$numMonitors++;
|
||||||
$numMonitors++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if($numMonitors>0) $avgArea= $avgArea / $numMonitors;
|
if($numMonitors>0) $avgArea= $avgArea / $numMonitors;
|
||||||
|
|
||||||
$numMonitors=0;
|
$numMonitors=0;
|
||||||
foreach ($monitors as $m)
|
foreach ($monitors as $m) {
|
||||||
{
|
|
||||||
echo " monitorLoading[" . $m['Id'] . "]=false; ";
|
echo " monitorLoading[" . $m['Id'] . "]=false; ";
|
||||||
echo " monitorImageObject[" . $m['Id'] . "]=null; ";
|
echo " monitorImageObject[" . $m['Id'] . "]=null; ";
|
||||||
echo " monitorLoadingStageURL[" . $m['Id'] . "] = ''; ";
|
echo " monitorLoadingStageURL[" . $m['Id'] . "] = ''; ";
|
||||||
|
@ -543,34 +528,28 @@ function evaluateLoadTimes()
|
||||||
$('fps').innerHTML="Display refresh rate is " + (1000 / currentDisplayInterval).toFixed(1) + " per second, avgFrac=" + avgFrac.toFixed(3) + ".";
|
$('fps').innerHTML="Display refresh rate is " + (1000 / currentDisplayInterval).toFixed(1) + " per second, avgFrac=" + avgFrac.toFixed(3) + ".";
|
||||||
}
|
}
|
||||||
|
|
||||||
function SetImageSource(monId,val)
|
function SetImageSource(monId,val) {
|
||||||
{
|
if(liveMode==1) {
|
||||||
if(liveMode==1)
|
// This uses the standard php routine to set up the url and authentication, but because it is called repeatedly the built in random number is not usable, so one is appended below for two total (yuck)
|
||||||
{ // This uses the standard php routine to set up the url and authentication, but because it is called repeatedly the built in random number is not usable, so one is appended below for two total (yuck)
|
var effectiveScale = (100.0 * monitorCanvasObj[monId].width) / monitorWidth[monId];
|
||||||
var effectiveScale = (100.0 * monitorCanvasObj[monId].width) / monitorWidth[monId];
|
var $x = "<?php echo getStreamSrc( array("mode=single"),"&" )?>" + "&monitor=" + monId.toString() + "&scale=" + effectiveScale + Math.random().toString() ;
|
||||||
var $x = "<?php echo getStreamSrc( array("mode=single"),"&" )?>" + "&monitor=" + monId.toString() + "&scale=" + effectiveScale + Math.random().toString() ;
|
return $x;
|
||||||
return $x;
|
} else {
|
||||||
}
|
var zeropad = <?php echo sprintf("\"%0" . ZM_EVENT_IMAGE_DIGITS . "d\"",0); ?>;
|
||||||
else
|
for(var i=0, eIdlength = eId.length; i<eIdlength; i++) {
|
||||||
{
|
// Search for a match
|
||||||
var zeropad = <?php echo sprintf("\"%0" . ZM_EVENT_IMAGE_DIGITS . "d\"",0); ?>;
|
if(eMonId[i]==monId && val >= eStartSecs[i] && val <= eEndSecs[i]) {
|
||||||
for(var i=0, var eIdlength = eId.length; i<eIdlength; i++) // Search for a match
|
var frame=parseInt((val - eStartSecs[i])/(eEndSecs[i]-eStartSecs[i])*eventFrames[i])+1;
|
||||||
{
|
img = "index.php?view=image&eid=" + eId[i] + '&fid='+frame + "&width=" + monitorCanvasObj[monId].width + "&height=" + monitorCanvasObj[monId].height;
|
||||||
if(eMonId[i]==monId && val >= eStartSecs[i] && val <= eEndSecs[i])
|
return img;
|
||||||
{
|
}
|
||||||
var frame=parseInt((val - eStartSecs[i])/(eEndSecs[i]-eStartSecs[i])*eventFrames[i])+1;
|
} // end for
|
||||||
img = "index.php?view=image&eid=" + eId[i] + '&fid='+frame + "&width=" + monitorCanvasObj[monId].width + "&height=" + monitorCanvasObj[monId].height;
|
return "no data";
|
||||||
return img;
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
return "no data";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function imagedone(obj, monId, success)
|
function imagedone(obj, monId, success) {
|
||||||
{
|
if(success) {
|
||||||
if(success)
|
|
||||||
{
|
|
||||||
monitorCanvasCtx[monId].drawImage( monitorImageObject[monId], 0, 0, monitorCanvasObj[monId].width, monitorCanvasObj[monId].height);
|
monitorCanvasCtx[monId].drawImage( monitorImageObject[monId], 0, 0, monitorCanvasObj[monId].width, monitorCanvasObj[monId].height);
|
||||||
var iconSize=(Math.max(monitorCanvasObj[monId].width,monitorCanvasObj[monId].height) * 0.10);
|
var iconSize=(Math.max(monitorCanvasObj[monId].width,monitorCanvasObj[monId].height) * 0.10);
|
||||||
monitorCanvasCtx[monId].font = "600 " + iconSize.toString() + "px Arial";
|
monitorCanvasCtx[monId].font = "600 " + iconSize.toString() + "px Arial";
|
||||||
|
@ -583,10 +562,10 @@ function imagedone(obj, monId, success)
|
||||||
evaluateLoadTimes();
|
evaluateLoadTimes();
|
||||||
}
|
}
|
||||||
monitorLoading[monId]=false;
|
monitorLoading[monId]=false;
|
||||||
if(!success) // if we had a failrue queue up the no-data image
|
if(!success) {
|
||||||
|
// if we had a failrue queue up the no-data image
|
||||||
loadImage2Monitor(monId,"no data"); // leave the staged URL if there is one, just ignore it here.
|
loadImage2Monitor(monId,"no data"); // leave the staged URL if there is one, just ignore it here.
|
||||||
else
|
} else {
|
||||||
{
|
|
||||||
if(monitorLoadingStageURL[monId]=="") return;
|
if(monitorLoadingStageURL[monId]=="") return;
|
||||||
loadImage2Monitor(monId,monitorLoadingStageURL[monId]);
|
loadImage2Monitor(monId,monitorLoadingStageURL[monId]);
|
||||||
monitorLoadingStageURL[monId]="";
|
monitorLoadingStageURL[monId]="";
|
||||||
|
@ -594,24 +573,19 @@ function imagedone(obj, monId, success)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
function loadImage2Monitor(monId,url)
|
function loadImage2Monitor(monId,url) {
|
||||||
{
|
if(monitorLoading[monId] && monitorImageObject[monId].src != url ) {
|
||||||
if(monitorLoading[monId] && monitorImageObject[monId].src != url ) // never queue the same image twice (if it's loading it has to be defined, right?
|
// never queue the same image twice (if it's loading it has to be defined, right?
|
||||||
{
|
monitorLoadingStageURL[monId]=url; // we don't care if we are overriting, it means it didn't change fast enough
|
||||||
monitorLoadingStageURL[monId]=url; // we don't care if we are overriting, it means it didn't change fast enough
|
} else {
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
var skipthis=0;
|
var skipthis=0;
|
||||||
if( typeof monitorImageObject[monId] !== "undefined" && monitorImageObject[monId] != null && monitorImageObject[monId].src == url ) return; // do nothing if it's the same
|
if( typeof monitorImageObject[monId] !== "undefined" && monitorImageObject[monId] != null && monitorImageObject[monId].src == url ) return; // do nothing if it's the same
|
||||||
if( monitorImageObject[monId] == null )
|
if( monitorImageObject[monId] == null ) {
|
||||||
{
|
|
||||||
monitorImageObject[monId]=new Image();
|
monitorImageObject[monId]=new Image();
|
||||||
monitorImageObject[monId].onload = function() {imagedone(this, monId,true )};
|
monitorImageObject[monId].onload = function() {imagedone(this, monId,true )};
|
||||||
monitorImageObject[monId].onerror = function() {imagedone(this, monId,false)};
|
monitorImageObject[monId].onerror = function() {imagedone(this, monId,false)};
|
||||||
}
|
}
|
||||||
if(url=='no data')
|
if(url=='no data') {
|
||||||
{
|
|
||||||
monitorCanvasCtx[monId].fillStyle="white";
|
monitorCanvasCtx[monId].fillStyle="white";
|
||||||
monitorCanvasCtx[monId].fillRect(0,0,monitorCanvasObj[monId].width,monitorCanvasObj[monId].height);
|
monitorCanvasCtx[monId].fillRect(0,0,monitorCanvasObj[monId].width,monitorCanvasObj[monId].height);
|
||||||
var textSize=monitorCanvasObj[monId].width * 0.15;
|
var textSize=monitorCanvasObj[monId].width * 0.15;
|
||||||
|
@ -620,43 +594,38 @@ function loadImage2Monitor(monId,url)
|
||||||
monitorCanvasCtx[monId].fillStyle="black";
|
monitorCanvasCtx[monId].fillStyle="black";
|
||||||
var textWidth = monitorCanvasCtx[monId].measureText(text).width;
|
var textWidth = monitorCanvasCtx[monId].measureText(text).width;
|
||||||
monitorCanvasCtx[monId].fillText(text,monitorCanvasObj[monId].width/2 - textWidth/2,monitorCanvasObj[monId].height/2);
|
monitorCanvasCtx[monId].fillText(text,monitorCanvasObj[monId].width/2 - textWidth/2,monitorCanvasObj[monId].height/2);
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
monitorLoading[monId]=true;
|
monitorLoading[monId]=true;
|
||||||
monitorLoadStartTimems[monId]=new Date().getTime();
|
monitorLoadStartTimems[monId]=new Date().getTime();
|
||||||
monitorImageObject[monId].src=url; // starts a load but doesn't refresh yet, wait until ready
|
monitorImageObject[monId].src=url; // starts a load but doesn't refresh yet, wait until ready
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function timerFire()
|
function timerFire() {
|
||||||
{
|
// See if we need to reschedule
|
||||||
// See if we need to reschedule
|
if(currentDisplayInterval != timerInterval || currentSpeed == 0) {
|
||||||
if(currentDisplayInterval != timerInterval || currentSpeed == 0) // zero just turn off interrupts
|
// zero just turn off interrupts
|
||||||
{
|
clearInterval(timerObj);
|
||||||
clearInterval(timerObj);
|
timerInterval=currentDisplayInterval;
|
||||||
timerInterval=currentDisplayInterval;
|
if(currentSpeed>0 || liveMode!=0) timerObj=setInterval(timerFire,timerInterval); // don't fire out of live mode if speed is zero
|
||||||
if(currentSpeed>0 || liveMode!=0) timerObj=setInterval(timerFire,timerInterval); // don't fire out of live mode if speed is zero
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (liveMode) outputUpdate(currentTimeSecs); // In live mode we basically do nothing but redisplay
|
if (liveMode) outputUpdate(currentTimeSecs); // In live mode we basically do nothing but redisplay
|
||||||
else if (currentTimeSecs + playSecsperInterval >= maxTimeSecs) // beyond the end just stop
|
else if (currentTimeSecs + playSecsperInterval >= maxTimeSecs) // beyond the end just stop
|
||||||
{
|
{
|
||||||
setSpeed(0);
|
setSpeed(0);
|
||||||
outputUpdate(currentTimeSecs);
|
outputUpdate(currentTimeSecs);
|
||||||
}
|
}
|
||||||
else outputUpdate(currentTimeSecs + playSecsperInterval);
|
else outputUpdate(currentTimeSecs + playSecsperInterval);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
function drawSliderOnGraph(val)
|
function drawSliderOnGraph(val) {
|
||||||
{
|
|
||||||
var sliderWidth=10;
|
var sliderWidth=10;
|
||||||
var sliderLineWidth=1;
|
var sliderLineWidth=1;
|
||||||
var sliderHeight=cHeight;
|
var sliderHeight=cHeight;
|
||||||
|
|
||||||
if(liveMode==1)
|
if(liveMode==1) {
|
||||||
{
|
|
||||||
val=Math.floor( Date.now() / 1000);
|
val=Math.floor( Date.now() / 1000);
|
||||||
}
|
}
|
||||||
// Set some sizes
|
// Set some sizes
|
||||||
|
@ -665,8 +634,8 @@ function drawSliderOnGraph(val)
|
||||||
var labbottom=parseInt(cHeight * 0.2 / (numMonitors+1)).toString() + "px"; // This is positioning same as row labels below, but from bottom so 1-position
|
var labbottom=parseInt(cHeight * 0.2 / (numMonitors+1)).toString() + "px"; // This is positioning same as row labels below, but from bottom so 1-position
|
||||||
var labfont=labelpx + "px Georgia"; // set this like below row labels
|
var labfont=labelpx + "px Georgia"; // set this like below row labels
|
||||||
|
|
||||||
if(numMonitors>0) // if we have no data to display don't do the slider itself
|
if(numMonitors>0) {
|
||||||
{
|
// if we have no data to display don't do the slider itself
|
||||||
var sliderX=parseInt( (val - minTimeSecs) / rangeTimeSecs * cWidth - sliderWidth/2); // position left side of slider
|
var sliderX=parseInt( (val - minTimeSecs) / rangeTimeSecs * cWidth - sliderWidth/2); // position left side of slider
|
||||||
if(sliderX < 0) sliderX=0;
|
if(sliderX < 0) sliderX=0;
|
||||||
if(sliderX+sliderWidth > cWidth) sliderX=cWidth-sliderWidth-1;
|
if(sliderX+sliderWidth > cWidth) sliderX=cWidth-sliderWidth-1;
|
||||||
|
@ -896,18 +865,17 @@ HTMLCanvasElement.prototype.relMouseCoords = relMouseCoords;
|
||||||
// These are the functions for mouse movement in the timeline. Note that touch is treated as a mouse move with mouse down
|
// These are the functions for mouse movement in the timeline. Note that touch is treated as a mouse move with mouse down
|
||||||
|
|
||||||
var mouseisdown=false;
|
var mouseisdown=false;
|
||||||
function mdown(event) {mouseisdown=true; mmove(event)}
|
function mdown(event) {mouseisdown=true; mmove(event);}
|
||||||
function mup(event) {mouseisdown=false;}
|
function mup(event) {mouseisdown=false;}
|
||||||
function mout(event) {mouseisdown=false;} // if we go outside treat it as release
|
function mout(event) {mouseisdown=false;} // if we go outside treat it as release
|
||||||
function tmove(event) {mouseisdown=true; mmove(event);}
|
function tmove(event) {mouseisdown=true; mmove(event);}
|
||||||
|
|
||||||
function mmove(event)
|
function mmove(event) {
|
||||||
{
|
if(mouseisdown) {
|
||||||
if(mouseisdown) // only do anything if the mouse is depressed while on the sheet
|
// only do anything if the mouse is depressed while on the sheet
|
||||||
{
|
var sec = minTimeSecs + rangeTimeSecs / event.target.width * event.target.relMouseCoords(event).x;
|
||||||
var sec = minTimeSecs + rangeTimeSecs / event.target.width * event.target.relMouseCoords(event).x;
|
outputUpdate(sec);
|
||||||
outputUpdate(sec);
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function secs2dbstr (s)
|
function secs2dbstr (s)
|
||||||
|
|
|
@ -74,8 +74,9 @@ if ( empty($_REQUEST['path']) ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( ! file_exists( $path ) ) {
|
if ( ! file_exists( $path ) ) {
|
||||||
|
Debug( "$path does not exist");
|
||||||
# Generate the frame JPG
|
# Generate the frame JPG
|
||||||
if ( $Event->DefaultVideo() ) {
|
if ( $show == 'capt' and $Event->DefaultVideo() ) {
|
||||||
$command ='ffmpeg -i '.$Event->Path().'/'.$Event->DefaultVideo().' -vf "select=gte(n\\,'.$Frame->FrameId().'),setpts=PTS-STARTPTS" '.$path;
|
$command ='ffmpeg -i '.$Event->Path().'/'.$Event->DefaultVideo().' -vf "select=gte(n\\,'.$Frame->FrameId().'),setpts=PTS-STARTPTS" '.$path;
|
||||||
#$command ='ffmpeg -v 0 -i '.$Storage->Path().'/'.$Event->Path().'/'.$Event->DefaultVideo().' -vf "select=gte(n\\,'.$Frame->FrameId().'),setpts=PTS-STARTPTS" '.$path;
|
#$command ='ffmpeg -v 0 -i '.$Storage->Path().'/'.$Event->Path().'/'.$Event->DefaultVideo().' -vf "select=gte(n\\,'.$Frame->FrameId().'),setpts=PTS-STARTPTS" '.$path;
|
||||||
Debug( "Running $command" );
|
Debug( "Running $command" );
|
||||||
|
|
Loading…
Reference in New Issue