|
|
|
@ -2,11 +2,13 @@ |
|
|
|
|
|
|
|
|
|
|
|
var monitoringViewLevel = 0; |
|
|
|
var monitoringActiveSession = false; |
|
|
|
var mon_selectedEventId = 0; |
|
|
|
var mon_selectedPlatform = 0; |
|
|
|
var mon_selectedStation = 0; |
|
|
|
var mon_selectedTrack = 0; |
|
|
|
var mon_selectedModule = 0; |
|
|
|
var mon_platform_train = 0; |
|
|
|
var autoRiseEvent = true; |
|
|
|
var activeEvents = []; |
|
|
|
var expiredEvents = []; |
|
|
|
@ -283,8 +285,8 @@ function addSetSessionUI( session_id ){ |
|
|
|
}; |
|
|
|
|
|
|
|
}; |
|
|
|
}, |
|
|
|
failure: failureAJAXFunction |
|
|
|
}//,
|
|
|
|
//failure: failureAJAXFunction
|
|
|
|
}); |
|
|
|
}; |
|
|
|
|
|
|
|
@ -316,6 +318,8 @@ function loadPlatformView( pid, buba ){ |
|
|
|
autoRiseEvent = buba; |
|
|
|
}; |
|
|
|
if( mon_selectedEventId ) unselectEvent( mon_selectedEventId ); |
|
|
|
mon_platform_train = 0; |
|
|
|
mTrainSvgElements = []; |
|
|
|
mon_selectedPlatform = pid; |
|
|
|
changeContent( 1, 2, pid ); |
|
|
|
updateUserContent(); |
|
|
|
@ -361,6 +365,14 @@ function loadTrackViewBySession( session_id ){ |
|
|
|
Ext.getCmp('main_content').removeAll(true); |
|
|
|
Ext.getCmp('main_content').add( Ext.decode( data.content ) ); |
|
|
|
Ext.getCmp('main_content').doLayout(); |
|
|
|
tt=document.getElementById('trx_status_txt'); |
|
|
|
tt.classList.remove('static_status_text'); |
|
|
|
tt.classList.add('blinking_status_text'); |
|
|
|
tt.innerText = 'ACTIVE'; |
|
|
|
tt=document.getElementById('trx_status_cell'); |
|
|
|
tt.classList.remove('top_status_hidden'); |
|
|
|
tt.classList.add('top_status_red_lbl'); |
|
|
|
monitoringActiveSession = true; |
|
|
|
fetchStatus(); |
|
|
|
}; |
|
|
|
}, |
|
|
|
@ -390,6 +402,12 @@ function loadTrackView( tid ){ |
|
|
|
Ext.getCmp('main_content').removeAll(true); |
|
|
|
Ext.getCmp('main_content').add( Ext.decode( data.content ) ); |
|
|
|
Ext.getCmp('main_content').doLayout(); |
|
|
|
tt=document.getElementById('trx_status_txt'); |
|
|
|
tt.innerText = 'LIVE VIEW'; |
|
|
|
monitoringActiveSession = false; |
|
|
|
tt=document.getElementById('trx_status_cell'); |
|
|
|
tt.classList.remove('top_status_hidden'); |
|
|
|
tt.classList.add('top_status_green_lbl'); |
|
|
|
fetchStatus(); |
|
|
|
}; |
|
|
|
}, |
|
|
|
@ -428,6 +446,8 @@ function loadModuleView( pid, mid ){ |
|
|
|
}; |
|
|
|
|
|
|
|
function loadMapView(){ |
|
|
|
changeContent( 0, 0, 0 ); |
|
|
|
updateUserContent(); |
|
|
|
autoRiseEvent = false; |
|
|
|
if( mon_selectedEventId ) unselectEvent( mon_selectedEventId ); |
|
|
|
Ext.Ajax.request({ |
|
|
|
@ -519,8 +539,9 @@ function initMonitoring( x, y ){ |
|
|
|
},{ |
|
|
|
id: 'sme_inner', |
|
|
|
layout:'vbox', |
|
|
|
width: "100%", |
|
|
|
width: '100%', |
|
|
|
height: PanelH/2, |
|
|
|
autoScroll: true , |
|
|
|
frame: false, |
|
|
|
border: false, |
|
|
|
items:[] |
|
|
|
@ -530,10 +551,10 @@ function initMonitoring( x, y ){ |
|
|
|
},{ |
|
|
|
id: 'sme_outer', |
|
|
|
layout:'vbox', |
|
|
|
width: "100%", |
|
|
|
height: PanelH/2, |
|
|
|
width: '100%', |
|
|
|
height: 1000,//PanelH/2,
|
|
|
|
frame: false, |
|
|
|
border: true, |
|
|
|
border: false, |
|
|
|
items:[] |
|
|
|
}] |
|
|
|
}); |
|
|
|
@ -542,6 +563,11 @@ function initMonitoring( x, y ){ |
|
|
|
switch( monitoringViewLevel ){ |
|
|
|
case 0:{ |
|
|
|
loadMapView(); |
|
|
|
autoRiseEvent = true; |
|
|
|
var tt = Ext.getCmp('aer_button'); |
|
|
|
if( tt != undefined ){ |
|
|
|
tt.toggle( true, true ); |
|
|
|
} |
|
|
|
break; |
|
|
|
}; |
|
|
|
case 1:{ |
|
|
|
@ -606,10 +632,11 @@ function manageSideTags( tag_area, buba ){ |
|
|
|
}; |
|
|
|
}; |
|
|
|
if( !f ){ |
|
|
|
var ichu = createEventTagContent( buba[zz] ); |
|
|
|
tP.insert( 0,{ |
|
|
|
id: 'tag_panel_'+buba[zz].id, |
|
|
|
width: "100%", |
|
|
|
html: createEventTagContent( buba[zz] ) |
|
|
|
width: '100%', |
|
|
|
html: ichu |
|
|
|
}); |
|
|
|
tt++; |
|
|
|
}; |
|
|
|
@ -648,12 +675,192 @@ function manageSideTags( tag_area, buba ){ |
|
|
|
}; |
|
|
|
}; |
|
|
|
tP.doLayout(); |
|
|
|
|
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
var mSvgElements = []; |
|
|
|
|
|
|
|
var mTrainSvgElements=[]; |
|
|
|
|
|
|
|
function animateTrainOnPlatform( _in, _out ){ |
|
|
|
if( ( _out & 3 ) > 0 ){ |
|
|
|
if( typeof mTrainSvgElements[0] === 'undefined') { |
|
|
|
switch( _out & 3 ) { |
|
|
|
case 1:{ |
|
|
|
var svgns = "http://www.w3.org/2000/svg"; |
|
|
|
mTrainSvgElements[0] = document.createElementNS(svgns, 'rect'); |
|
|
|
mTrainSvgElements[0].setAttribute('x', '1550'); |
|
|
|
mTrainSvgElements[0].setAttribute('y', '50' ); |
|
|
|
mTrainSvgElements[0].setAttribute('rx','5' ); |
|
|
|
mTrainSvgElements[0].setAttribute('height', ''+100); |
|
|
|
mTrainSvgElements[0].setAttribute('width', ''+540); |
|
|
|
mTrainSvgElements[0].setAttribute('fill', '#FF0000FF'); |
|
|
|
var anim1 = document.createElementNS(svgns, 'animate'); |
|
|
|
anim1.setAttribute('dur', '3s' ); |
|
|
|
anim1.setAttribute('attributeName', 'x' ); |
|
|
|
anim1.setAttribute('from', '2000' ); |
|
|
|
anim1.setAttribute('to', '1100' ); |
|
|
|
anim1.setAttribute('calcMode', 'linear' ); |
|
|
|
anim1.setAttribute('fill', 'freeze' ); |
|
|
|
var anim2 = document.createElementNS(svgns, 'animate'); |
|
|
|
anim2.setAttribute('dur', '3s' ); |
|
|
|
anim2.setAttribute('attributeName', 'opacity' ); |
|
|
|
anim2.setAttribute('from', '0' ); |
|
|
|
anim2.setAttribute('to', '1' ); |
|
|
|
anim2.setAttribute('calcMode','linear' ); |
|
|
|
anim2.setAttribute('fill', 'freeze' ); |
|
|
|
mTrainSvgElements[0].appendChild( anim1 ); |
|
|
|
mTrainSvgElements[0].appendChild( anim2 ); |
|
|
|
break; |
|
|
|
}; |
|
|
|
case 2:{ |
|
|
|
var svgns = "http://www.w3.org/2000/svg"; |
|
|
|
mTrainSvgElements[0] = document.createElementNS(svgns, 'rect'); |
|
|
|
mTrainSvgElements[0].setAttribute('x', '-550'); |
|
|
|
mTrainSvgElements[0].setAttribute('y', '50' ); |
|
|
|
mTrainSvgElements[0].setAttribute('rx','5' ); |
|
|
|
mTrainSvgElements[0].setAttribute('height', ''+100); |
|
|
|
mTrainSvgElements[0].setAttribute('width', ''+540); |
|
|
|
mTrainSvgElements[0].setAttribute('fill', '#FF0000FF'); |
|
|
|
var anim1 = document.createElementNS(svgns, 'animate'); |
|
|
|
anim1.setAttribute('dur', '3s' ); |
|
|
|
anim1.setAttribute('attributeName', 'x' ); |
|
|
|
anim1.setAttribute('from', '-550' ); |
|
|
|
anim1.setAttribute('to', '300' ); |
|
|
|
anim1.setAttribute('calcMode', 'linear' ); |
|
|
|
anim1.setAttribute('fill', 'freeze' ); |
|
|
|
var anim2 = document.createElementNS(svgns, 'animate'); |
|
|
|
anim2.setAttribute('dur', '3s' ); |
|
|
|
anim2.setAttribute('attributeName', 'opacity' ); |
|
|
|
anim2.setAttribute('from', '0' ); |
|
|
|
anim2.setAttribute('to', '1' ); |
|
|
|
anim2.setAttribute('calcMode','linear' ); |
|
|
|
anim2.setAttribute('fill', 'freeze' ); |
|
|
|
mTrainSvgElements[0].appendChild( anim1 ); |
|
|
|
mTrainSvgElements[0].appendChild( anim2 ); |
|
|
|
break; |
|
|
|
}; |
|
|
|
case 3:{ |
|
|
|
var svgns = "http://www.w3.org/2000/svg"; |
|
|
|
mTrainSvgElements[0] = document.createElementNS(svgns, 'rect'); |
|
|
|
mTrainSvgElements[0].setAttribute('x', '700'); |
|
|
|
mTrainSvgElements[0].setAttribute('y', '50' ); |
|
|
|
mTrainSvgElements[0].setAttribute('rx','5' ); |
|
|
|
mTrainSvgElements[0].setAttribute('height', ''+100); |
|
|
|
mTrainSvgElements[0].setAttribute('width', ''+540); |
|
|
|
mTrainSvgElements[0].setAttribute('fill', '#FF0000FF'); |
|
|
|
var anim = document.createElementNS(svgns, 'animate'); |
|
|
|
anim.setAttribute('dur', '3s' ); |
|
|
|
anim.setAttribute('attributeName', 'opacity' ); |
|
|
|
anim.setAttribute('from', '0' ); |
|
|
|
anim.setAttribute('to', '1' ); |
|
|
|
anim.setAttribute('calcMode','linear' ); |
|
|
|
anim.setAttribute('fill', 'freeze' ); |
|
|
|
mTrainSvgElements[0].appendChild( anim ); |
|
|
|
}; |
|
|
|
}; |
|
|
|
var tt = document.getElementById('svgTrackMap'); |
|
|
|
tt.appendChild( mTrainSvgElements[0] ); |
|
|
|
} else { |
|
|
|
|
|
|
|
}; |
|
|
|
} else { |
|
|
|
if( typeof mTrainSvgElements[0] != 'undefined') { |
|
|
|
var tt = document.getElementById('svgTrackMap'); |
|
|
|
tt.removeChild( mTrainSvgElements[0] ); |
|
|
|
mTrainSvgElements[0] = null; |
|
|
|
}; |
|
|
|
}; |
|
|
|
if( ( _out & 12 ) > 0 ){ |
|
|
|
if( typeof mTrainSvgElements[1] === 'undefined') { |
|
|
|
switch( ( _out >> 2 ) ) { |
|
|
|
case 2:{ |
|
|
|
var svgns = "http://www.w3.org/2000/svg"; |
|
|
|
mTrainSvgElements[1] = document.createElementNS(svgns, 'rect'); |
|
|
|
mTrainSvgElements[1].setAttribute('x', '1550'); |
|
|
|
mTrainSvgElements[1].setAttribute('y', '550' ); |
|
|
|
mTrainSvgElements[1].setAttribute('rx','5' ); |
|
|
|
mTrainSvgElements[1].setAttribute('height', ''+100); |
|
|
|
mTrainSvgElements[1].setAttribute('width', ''+540); |
|
|
|
mTrainSvgElements[1].setAttribute('fill', '#FF0000FF'); |
|
|
|
var anim1 = document.createElementNS(svgns, 'animate'); |
|
|
|
anim1.setAttribute('dur', '3s' ); |
|
|
|
anim1.setAttribute('attributeName', 'x' ); |
|
|
|
anim1.setAttribute('from', '2000' ); |
|
|
|
anim1.setAttribute('to', '1100' ); |
|
|
|
anim1.setAttribute('calcMode', 'linear' ); |
|
|
|
anim1.setAttribute('fill', 'freeze' ); |
|
|
|
var anim2 = document.createElementNS(svgns, 'animate'); |
|
|
|
anim2.setAttribute('dur', '3s' ); |
|
|
|
anim2.setAttribute('attributeName', 'opacity' ); |
|
|
|
anim2.setAttribute('from', '0' ); |
|
|
|
anim2.setAttribute('to', '1' ); |
|
|
|
anim2.setAttribute('calcMode','linear' ); |
|
|
|
anim2.setAttribute('fill', 'freeze' ); |
|
|
|
mTrainSvgElements[1].appendChild( anim1 ); |
|
|
|
mTrainSvgElements[1].appendChild( anim2 ); |
|
|
|
break; |
|
|
|
}; |
|
|
|
case 1:{ |
|
|
|
var svgns = "http://www.w3.org/2000/svg"; |
|
|
|
mTrainSvgElements[1] = document.createElementNS(svgns, 'rect'); |
|
|
|
mTrainSvgElements[1].setAttribute('x', '-550'); |
|
|
|
mTrainSvgElements[1].setAttribute('y', '550' ); |
|
|
|
mTrainSvgElements[1].setAttribute('rx','5' ); |
|
|
|
mTrainSvgElements[1].setAttribute('height', ''+100); |
|
|
|
mTrainSvgElements[1].setAttribute('width', ''+540); |
|
|
|
mTrainSvgElements[1].setAttribute('fill', '#FF0000FF'); |
|
|
|
var anim1 = document.createElementNS(svgns, 'animate'); |
|
|
|
anim1.setAttribute('dur', '3s' ); |
|
|
|
anim1.setAttribute('attributeName', 'x' ); |
|
|
|
anim1.setAttribute('from', '-550' ); |
|
|
|
anim1.setAttribute('to', '300' ); |
|
|
|
anim1.setAttribute('calcMode', 'linear' ); |
|
|
|
anim1.setAttribute('fill', 'freeze' ); |
|
|
|
var anim2 = document.createElementNS(svgns, 'animate'); |
|
|
|
anim2.setAttribute('dur', '3s' ); |
|
|
|
anim2.setAttribute('attributeName', 'opacity' ); |
|
|
|
anim2.setAttribute('from', '0' ); |
|
|
|
anim2.setAttribute('to', '1' ); |
|
|
|
anim2.setAttribute('calcMode','linear' ); |
|
|
|
anim2.setAttribute('fill', 'freeze' ); |
|
|
|
mTrainSvgElements[1].appendChild( anim1 ); |
|
|
|
mTrainSvgElements[1].appendChild( anim2 ); |
|
|
|
break; |
|
|
|
}; |
|
|
|
case 3:{ |
|
|
|
var svgns = "http://www.w3.org/2000/svg"; |
|
|
|
mTrainSvgElements[1] = document.createElementNS(svgns, 'rect'); |
|
|
|
mTrainSvgElements[1].setAttribute('x', '700'); |
|
|
|
mTrainSvgElements[1].setAttribute('y', '550' ); |
|
|
|
mTrainSvgElements[1].setAttribute('rx','5' ); |
|
|
|
mTrainSvgElements[1].setAttribute('height', ''+100); |
|
|
|
mTrainSvgElements[1].setAttribute('width', ''+540); |
|
|
|
mTrainSvgElements[1].setAttribute('fill', '#FF0000FF'); |
|
|
|
var anim = document.createElementNS(svgns, 'animate'); |
|
|
|
anim.setAttribute('dur', '3s' ); |
|
|
|
anim.setAttribute('attributeName', 'opacity' ); |
|
|
|
anim.setAttribute('from', '0' ); |
|
|
|
anim.setAttribute('to', '1' ); |
|
|
|
anim.setAttribute('calcMode','linear' ); |
|
|
|
anim.setAttribute('fill', 'freeze' ); |
|
|
|
mTrainSvgElements[1].appendChild( anim ); |
|
|
|
}; |
|
|
|
}; |
|
|
|
var tt = document.getElementById('svgTrackMap'); |
|
|
|
tt.appendChild( mTrainSvgElements[1] ); |
|
|
|
} else { |
|
|
|
|
|
|
|
}; |
|
|
|
} else { |
|
|
|
if( typeof mTrainSvgElements[1] != 'undefined') { |
|
|
|
var tt = document.getElementById('svgTrackMap'); |
|
|
|
tt.removeChild( mTrainSvgElements[1] ); |
|
|
|
mTrainSvgElements[1] = null; |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
}; |
|
|
|
function fetchStatus(){ |
|
|
|
if( tlInterval!= null ){ |
|
|
|
window.clearTimeout( tlInterval ); |
|
|
|
@ -753,8 +960,8 @@ function fetchStatus(){ |
|
|
|
}; |
|
|
|
//debugger;
|
|
|
|
switch( monitoringViewLevel ){ |
|
|
|
case 0:{ |
|
|
|
for( i=0; i < data.station_ids.length; i++ ){ |
|
|
|
case 0:{ //Map
|
|
|
|
for( i=0; i < data.station_ids.length; i++ ){ |
|
|
|
switch( data.station_status[i] ){ |
|
|
|
case 0: { |
|
|
|
if( stationMarkers[data.station_ids[i]].options.icon != GREY_Icon ) stationMarkers[data.station_ids[i]].setIcon( GREY_Icon ); |
|
|
|
@ -784,7 +991,7 @@ function fetchStatus(){ |
|
|
|
}; |
|
|
|
break; |
|
|
|
}; |
|
|
|
case 1:{ |
|
|
|
case 1:{ //Platforms
|
|
|
|
if( data.platforms != undefined ){ |
|
|
|
for( i=0; i< data.platforms.length; i++ ){ |
|
|
|
var tt = document.getElementById( 'plat_table_'+data.platforms[i].id ); |
|
|
|
@ -813,7 +1020,7 @@ function fetchStatus(){ |
|
|
|
}; |
|
|
|
break; |
|
|
|
}; |
|
|
|
case 2:{ |
|
|
|
case 2:{ // Platform
|
|
|
|
if( data.modules != undefined ){ |
|
|
|
for( var i=0; i< data.modules.length; i++){ |
|
|
|
if( data.modules[i].status > 0 ){ |
|
|
|
@ -942,16 +1149,20 @@ function fetchStatus(){ |
|
|
|
for( var i=0; i< max_grad_levels; i++ ) |
|
|
|
if( typeof mSvgElements[i] !== 'undefined') mSvgElements[i].setAttribute('fill', '#FF000000'); |
|
|
|
}; |
|
|
|
if( data.scada != undefined ){ |
|
|
|
|
|
|
|
if( data.train != undefined ){ |
|
|
|
if( mon_platform_train != data.train.status ){ |
|
|
|
animateTrainOnPlatform( mon_platform_train, data.train.status ); |
|
|
|
mon_platform_train = data.train.status; |
|
|
|
}; |
|
|
|
}; |
|
|
|
break; |
|
|
|
}; |
|
|
|
case 3:{ |
|
|
|
case 3:{ // Track
|
|
|
|
if( data.active_session_id != undefined ){ |
|
|
|
if( data.active_session_id > 0 ){ |
|
|
|
if( mon_selectedEventId != data.active_session_id ){ |
|
|
|
if( mon_selectedEventId != data.active_session_id ){ |
|
|
|
mon_selectedEventId = data.active_session_id; |
|
|
|
monitoringActiveSession = true; |
|
|
|
for( var zz=0; zz< activeEvents.length; zz++ ){ |
|
|
|
var tP = document.getElementById('event_tag_'+activeEvents[zz].id ); |
|
|
|
if( tP != undefined ){ |
|
|
|
@ -964,6 +1175,47 @@ function fetchStatus(){ |
|
|
|
}; |
|
|
|
}; |
|
|
|
addSetSessionUI( mon_selectedEventId ); |
|
|
|
tt=document.getElementById('trx_status_txt'); |
|
|
|
tt.classList.remove('static_status_text'); |
|
|
|
tt.classList.add('blinking_status_text'); |
|
|
|
tt.innerText = 'ACTIVE'; |
|
|
|
tt=document.getElementById('trx_status_cell'); |
|
|
|
tt.classList.remove('top_status_hidden'); |
|
|
|
tt.classList.remove('top_status_green_lbl'); |
|
|
|
tt.classList.add('top_status_red_lbl'); |
|
|
|
}; |
|
|
|
} else { |
|
|
|
if( mon_selectedEventId ){ |
|
|
|
var d = true; |
|
|
|
for( var zz=activeEvents.length-1; zz> -1; zz-- ){ |
|
|
|
if( activeEvents[zz].id != mon_selectedEventId ){ |
|
|
|
selectEvent( activeEvents[zz].id, false ); |
|
|
|
d = false; |
|
|
|
break; |
|
|
|
}; |
|
|
|
}; |
|
|
|
if( d ){ |
|
|
|
mon_selectedEventId = 0; |
|
|
|
monitoringActiveSession = false; |
|
|
|
tt=document.getElementById('trx_status_txt'); |
|
|
|
tt.classList.remove('blinking_status_text'); |
|
|
|
tt.classList.add('static_status_text'); |
|
|
|
tt.innerText = 'LIVE VEW'; |
|
|
|
tt=document.getElementById('trx_status_cell'); |
|
|
|
tt.classList.remove('top_status_hidden'); |
|
|
|
tt.classList.remove('top_status_red_lbl'); |
|
|
|
tt.classList.add('top_status_green_lbl'); |
|
|
|
var tv = Ext.getCmp('trx_view'); |
|
|
|
if( tv != undefined ){ |
|
|
|
var tt = Ext.getCmp('sets_ui'); |
|
|
|
if( tt != undefined ){ |
|
|
|
tv.remove( tt ); |
|
|
|
}; |
|
|
|
tv.doLayout(); |
|
|
|
}; |
|
|
|
for( var i=0; i< max_grad_levels; i++ ) |
|
|
|
if( typeof mSvgElements[i] !== 'undefined') mSvgElements[i].setAttribute('fill', '#FF000000'); |
|
|
|
}; |
|
|
|
}; |
|
|
|
}; |
|
|
|
}; |
|
|
|
@ -1045,36 +1297,38 @@ function selectEvent( ii, bb ){ |
|
|
|
window.clearTimeout( tlInterval ); |
|
|
|
tlInterval = null; |
|
|
|
}; |
|
|
|
for( var zz=0; zz< expiredEvents.length; zz++ ){ |
|
|
|
var tP = document.getElementById('event_tag_'+expiredEvents[zz].id ); |
|
|
|
if( tP != undefined ){ |
|
|
|
tP.className =''; |
|
|
|
if( expiredEvents[zz].id == mon_selectedEventId ){ |
|
|
|
tP.classList.add("evt_side_tag_selected"); |
|
|
|
} else { |
|
|
|
tP.classList.add("evt_side_tag"); |
|
|
|
if( bb ){ |
|
|
|
for( var zz=0; zz< expiredEvents.length; zz++ ){ |
|
|
|
var tP = document.getElementById('event_tag_'+expiredEvents[zz].id ); |
|
|
|
if( tP != undefined ){ |
|
|
|
tP.className =''; |
|
|
|
if( expiredEvents[zz].id == mon_selectedEventId ){ |
|
|
|
monitoringActiveSession = false; |
|
|
|
tP.classList.add("evt_side_tag_selected"); |
|
|
|
} else { |
|
|
|
tP.classList.add("evt_side_tag"); |
|
|
|
}; |
|
|
|
}; |
|
|
|
}; |
|
|
|
}; |
|
|
|
for( var zz=0; zz< activeEvents.length; zz++ ){ |
|
|
|
var tP = document.getElementById('event_tag_'+activeEvents[zz].id ); |
|
|
|
if( tP != undefined ){ |
|
|
|
tP.className =''; |
|
|
|
if( activeEvents[zz].id == mon_selectedEventId ){ |
|
|
|
tP.classList.add("evt_side_tag_selected"); |
|
|
|
} else { |
|
|
|
tP.classList.add("evt_side_tag"); |
|
|
|
loadMonitoringSessionView( ii ); |
|
|
|
} else { |
|
|
|
for( var zz=0; zz< activeEvents.length; zz++ ){ |
|
|
|
var tP = document.getElementById('event_tag_'+activeEvents[zz].id ); |
|
|
|
if( tP != undefined ){ |
|
|
|
tP.className =''; |
|
|
|
if( activeEvents[zz].id == mon_selectedEventId ){ |
|
|
|
monitoringActiveSession = true; |
|
|
|
tP.classList.add("evt_side_tag_selected"); |
|
|
|
} else { |
|
|
|
tP.classList.add("evt_side_tag"); |
|
|
|
}; |
|
|
|
}; |
|
|
|
}; |
|
|
|
}; |
|
|
|
if( bb ){ |
|
|
|
loadMonitoringSessionView( ii ); |
|
|
|
} else { |
|
|
|
loadTrackViewBySession( ii ); |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
function setSessionStatus( a , b ){ |
|
|
|
function setSessionStatus( a , b, autoremove ){ |
|
|
|
Ext.Ajax.request({ |
|
|
|
url: '/lib/controller/doSessionOperations.php', |
|
|
|
params: { |
|
|
|
@ -1087,16 +1341,34 @@ function setSessionStatus( a , b ){ |
|
|
|
success: function( response, opts ){ |
|
|
|
var data = Ext.decode(response.responseText); |
|
|
|
if( data.status == 'ok' ){ |
|
|
|
var tv = Ext.getCmp('trx_view'); |
|
|
|
if( tv != undefined ){ |
|
|
|
var tt = Ext.getCmp('sets_ui'); |
|
|
|
if( tt != undefined ){ |
|
|
|
tv.remove( tt ); |
|
|
|
if( autoremove ){ |
|
|
|
//On Expired
|
|
|
|
var d = true; |
|
|
|
for( var zz=expiredEvents.length-1; zz> -1; zz-- ){ |
|
|
|
if( expiredEvents[zz].id != mon_selectedEventId ){ |
|
|
|
selectEvent( expiredEvents[zz].id, true ); |
|
|
|
d = false; |
|
|
|
break; |
|
|
|
}; |
|
|
|
}; |
|
|
|
if( d ){ |
|
|
|
loadMapView(); |
|
|
|
autoRiseEvent = true; |
|
|
|
var tt = Ext.getCmp('aer_button'); |
|
|
|
if( tt != undefined ) tt.toggle( true, true ); |
|
|
|
}; |
|
|
|
} else { |
|
|
|
// On LiveSession
|
|
|
|
var tv = Ext.getCmp('trx_view'); |
|
|
|
if( tv != undefined ){ |
|
|
|
var tt = Ext.getCmp('sets_ui'); |
|
|
|
if( tt != undefined ){ |
|
|
|
tv.remove( tt ); |
|
|
|
}; |
|
|
|
tv.add( Ext.decode( data.content ) ); |
|
|
|
tv.doLayout(); |
|
|
|
}; |
|
|
|
tv.add( Ext.decode( data.content ) ); |
|
|
|
tv.doLayout(); |
|
|
|
}; |
|
|
|
|
|
|
|
}; |
|
|
|
}, |
|
|
|
failure: failureAJAXFunction |
|
|
|
@ -1144,7 +1416,17 @@ function loadMonitoringSessionView( session_id ){ |
|
|
|
Ext.getCmp('main_content').removeAll(true); |
|
|
|
Ext.getCmp('main_content').add( Ext.decode( data.content ) ); |
|
|
|
Ext.getCmp('main_content').doLayout(); |
|
|
|
tt=document.getElementById('trx_status_txt'); |
|
|
|
//tt.classList.remove('static_status_text');
|
|
|
|
//tt.classList.add('blinking_status_text');
|
|
|
|
tt.innerText = 'EXPIRED'; |
|
|
|
tt=document.getElementById('trx_status_cell'); |
|
|
|
tt.classList.remove('top_status_hidden'); |
|
|
|
tt.classList.remove('top_status_red_lbl'); |
|
|
|
tt.classList.remove('top_status_green_lbl'); |
|
|
|
tt.classList.add('top_status_orange_lbl'); |
|
|
|
mSesPlay = new argusSessionPlayer( mon_selectedEventId ); |
|
|
|
mSesPlay.play(); |
|
|
|
fetchStatus(); |
|
|
|
}; |
|
|
|
}, |
|
|
|
|