Code spacing and doc

This commit is contained in:
Isaac Connor 2021-05-03 15:20:11 -04:00
parent 934c726beb
commit b10b2932ee
1 changed files with 5 additions and 6 deletions

View File

@ -212,9 +212,8 @@ if ( empty($_REQUEST['path']) ) {
$Frame->FrameId('snapshot'); $Frame->FrameId('snapshot');
} # end if found snapshot.jpg } # end if found snapshot.jpg
} else { } else {
$Frame = ZM\Frame::find_one(array('EventId'=>$_REQUEST['eid'], 'FrameId'=>$_REQUEST['fid'])); $Frame = ZM\Frame::find_one(array('EventId'=>$_REQUEST['eid'], 'FrameId'=>$_REQUEST['fid']));
if ( ! $Frame ) { if (!$Frame) {
$previousBulkFrame = dbFetchOne( $previousBulkFrame = dbFetchOne(
'SELECT * FROM Frames WHERE EventId=? AND FrameId < ? ORDER BY FrameID DESC LIMIT 1', 'SELECT * FROM Frames WHERE EventId=? AND FrameId < ? ORDER BY FrameID DESC LIMIT 1',
NULL, array($_REQUEST['eid'], $_REQUEST['fid']) NULL, array($_REQUEST['eid'], $_REQUEST['fid'])
@ -223,22 +222,22 @@ if ( empty($_REQUEST['path']) ) {
'SELECT * FROM Frames WHERE EventId=? AND FrameId > ? ORDER BY FrameID ASC LIMIT 1', 'SELECT * FROM Frames WHERE EventId=? AND FrameId > ? ORDER BY FrameID ASC LIMIT 1',
NULL, array($_REQUEST['eid'], $_REQUEST['fid']) NULL, array($_REQUEST['eid'], $_REQUEST['fid'])
); );
if ( $previousBulkFrame and $nextBulkFrame ) { if ($previousBulkFrame and $nextBulkFrame) {
$Frame = new ZM\Frame($previousBulkFrame); $Frame = new ZM\Frame($previousBulkFrame);
$Frame->FrameId($_REQUEST['fid']); $Frame->FrameId($_REQUEST['fid']);
$percentage = ($Frame->FrameId() - $previousBulkFrame['FrameId']) / ($nextBulkFrame['FrameId'] - $previousBulkFrame['FrameId']); $percentage = ($Frame->FrameId() - $previousBulkFrame['FrameId']) / ($nextBulkFrame['FrameId'] - $previousBulkFrame['FrameId']);
$Frame->Delta($previousBulkFrame['Delta'] + floor( 100* ( $nextBulkFrame['Delta'] - $previousBulkFrame['Delta'] ) * $percentage )/100); $Frame->Delta($previousBulkFrame['Delta'] + floor( 100* ( $nextBulkFrame['Delta'] - $previousBulkFrame['Delta'] ) * $percentage )/100);
ZM\Debug("Got virtual frame from Bulk Frames previous delta: " . $previousBulkFrame['Delta'] . " + nextdelta:" . $nextBulkFrame['Delta'] . ' - ' . $previousBulkFrame['Delta'] . ' * ' . $percentage ); ZM\Debug('Got virtual frame from Bulk Frames previous delta: ' . $previousBulkFrame['Delta'] . ' + nextdelta:' . $nextBulkFrame['Delta'] . ' - ' . $previousBulkFrame['Delta'] . ' * ' . $percentage );
} else { } else {
ZM\Fatal('No Frame found for event('.$_REQUEST['eid'].') and frame id('.$_REQUEST['fid'].')'); ZM\Fatal('No Frame found for event('.$_REQUEST['eid'].') and frame id('.$_REQUEST['fid'].')');
} }
} } # end if !Frame
// Frame can be non-existent. We have Bulk frames. So now we should try to load the bulk frame // Frame can be non-existent. We have Bulk frames. So now we should try to load the bulk frame
$path = $Event->Path().'/'.sprintf('%0'.ZM_EVENT_IMAGE_DIGITS.'d',$Frame->FrameId()).'-'.$show.'.jpg'; $path = $Event->Path().'/'.sprintf('%0'.ZM_EVENT_IMAGE_DIGITS.'d',$Frame->FrameId()).'-'.$show.'.jpg';
ZM\Debug("Path: $path"); ZM\Debug("Path: $path");
} } # if special frame (snapshot, alarm etc) or identified by id
} else { } else {
# If we are only specifying fid, then the fid must be the primary key into the frames table. But when the event is specified, then it is the frame # # If we are only specifying fid, then the fid must be the primary key into the frames table. But when the event is specified, then it is the frame #