Browse Source

Fixed Ongoing Session Statistics

Evgeny Gagua 3 months ago
parent
commit
18aa886c18
  1. 6
      lib/controller/getHistoryDay.php
  2. 2
      lib/controller/getSessionData.php
  3. 29
      lib/javascript/jsapi_dynamic/argus_reports.js

6
lib/controller/getHistoryDay.php

@ -22,7 +22,11 @@
if( count($JU) ){
foreach( $JU as $CP ){
//$QS = "SELECT * FROM `sessions` WHERE `final`='Y' AND `track_id` IN (SELECT DISTINCT `id` FROM `metro_tracks` AND `platform_id` IN ( SELECT DISTINCT `id` FROM `metro_platforms` WHERE `station_id`={$STT} )) ORDER BY `ts`*1000+`ts_ms`";
$QS = "SELECT * FROM `sessions` WHERE `ts` >= {$STS} AND `ts` <= {$ETS} AND `final`='Y' AND `track_id` IN ( SELECT DISTINCT `id` FROM `metro_tracks` WHERE `platform_id`={$CP['id']}) ORDER BY `ts`*1000+`ts_ms`";
/* Fixing Ongoing session to be viewed
$QS = "SELECT * FROM `sessions` WHERE `ts` >= {$STS} AND `ts` <= {$ETS} AND `final`='Y' AND `track_id` IN ( SELECT DISTINCT `id`
FROM `metro_tracks` WHERE `platform_id`={$CP['id']}) ORDER BY `ts`*1000+`ts_ms`";
*/
$QS = "SELECT * FROM `sessions` WHERE `ts` >= {$STS} AND `ts` <= {$ETS} AND `track_id` IN ( SELECT DISTINCT `id` FROM `metro_tracks` WHERE `platform_id`={$CP['id']}) ORDER BY `ts`*1000+`ts_ms`";
$RR = $DATABASE->Query( $QS );
$S = count( $RR );
$V = 0;//intval( $RR[0]['v'] );

2
lib/controller/getSessionData.php

@ -46,6 +46,7 @@
} else {
$Data['composed_video_status'] = 'D';
$Data['composed_left_video_exists'] = file_exists('data/composed_videos/' . $RR[0]['uuid'].'_L.mp4' );
$Data['composed_right_video_exists'] = file_exists('data/composed_videos/' . $RR[0]['uuid'].'_R.mp4' );
if( $Data['composed_left_video_exists'] ){
$CMD = "ffprobe -hide_banner ./data/composed_videos/{$RR[0]['uuid']}_L.mp4 2>&1";
$Zaza = `$CMD`;
@ -68,7 +69,6 @@
};
};
};
$Data['composed_right_video_exists'] = file_exists('data/composed_videos/' . $RR[0]['uuid'].'_R.mp4' );
if( $Data['composed_right_video_exists'] ){
$CMD = "ffprobe -hide_banner ./data/composed_videos/{$RR[0]['uuid']}_R.mp4 2>&1";
$Zaza = `$CMD`;

29
lib/javascript/jsapi_dynamic/argus_reports.js

@ -729,15 +729,24 @@ function CompositeVideoStatusUpdate(){
oldCompositeVideoStatus = CompositeVideoStatus;
switch( CompositeVideoStatus ){
case 0:{
rr.add({
xtype: 'panel',
frame: false,
border: false,
html: '<div class="vid_dwc_panel"><table width="100%"><tr><td align="center" colspan=2>Compose Videos into one file</td></tr><tr><td colspan=2>&nbsp;</td></tr><tr><td align="center" colspan=2><a class="big_vd_btn" href="javascript:startVideoComposer()">Start Video Composer</a></td></tr><tr><td colspan=2>&nbsp;</td></tr></table></div>'
});
if( mSesPlay.Videos.length > 1 ){
rr.add({
xtype: 'panel',
frame: false,
border: false,
html: '<div class="vid_dwc_panel"><table width="100%"><tr><td align="center" colspan=2>Compose Videos into one file</td></tr><tr><td colspan=2>&nbsp;</td></tr><tr><td align="center" colspan=2><div id="s_c_button"></div></td></tr><tr><td colspan=2>&nbsp;</td></tr></table></div>'
});
rr.doLayout();
new Ext.Button({
text: 'Start Video Composer',
width: '80%',
renderTo: 's_c_button',
handler: startVideoComposer
});
};
break;
};
case 1:{
case 1:{
rr.add({
border: false,
frame: false,
@ -773,7 +782,7 @@ function CompositeVideoStatusUpdate(){
handler: function(){
const l = document.createElement('a');
l.style.display = 'none';
l.href = '/lib/controller/getComposedVideo.php?SESSION='+rep_selectedEventId+'&SIDE=L';
l.href = '/lib/controller/getComposedVideo.php?SESSION='+rep_selectedEventId+'&SIDE=R';
document.body.appendChild(l);
l.click();
}
@ -1691,7 +1700,6 @@ class argusSessionPlayer{
sesVideosListLExists = false;
}
} else CompositeVideoStatus = 0;
if( data.events.length ){
mSesPlay.Events = data.events;
for( var i=0; i < data.events.length; i++ ){
@ -2141,7 +2149,6 @@ class argusSessionPlayer33{
//mSesPlay.rVideoJS = document.getElementById( 'video_obj_'+data.r_module_id );
//mSesPlay.lVideoJS = document.getElementById( 'video_obj_'+data.l_module_id );
mSesPlay.mMapID = document.getElementById( 'plat_map_'+data.track_id );
//debugger;
if( data.data_ok ){
mSesPlay.startTime = data.start_ts;
mSesPlay.endTime = data.start_ts + data.length;
@ -2155,8 +2162,8 @@ class argusSessionPlayer33{
if( data.composed_video ){
if( data.composed_video_status == 'D' ){
CompositeVideoStatus = 2;
sesVideosListRExists = data.composed_right_video_exists;
sesVideosListLExists = data.composed_left_video_exists;
sesVideosListRExists = data.composed_right_video_exists;
if( sesVideosListLExists ) CompositeVideoLeftInfo = data.composed_left_info; else CompositeVideoLeftInfo = null;
if( sesVideosListRExists ) CompositeVideoRightInfo = data.composed_right_info; else CompositeVideoRightInfo = null;
} else {

Loading…
Cancel
Save