@ -172,6 +172,7 @@ function select2DROI( id, event ){
if ( csvg != undefined ) {
var roi = csvg . getElementById ( "roi" ) ;
if ( roi != null ) csvg . removeChild ( roi ) ;
var bBox = csvg . getBBox ( ) ;
var x = ( bBox . width / csvg . clientWidth ) * event . offsetX ;
var y = ( bBox . height / csvg . clientHeight ) * event . offsetY ;
@ -200,38 +201,45 @@ function select2DROI( id, event ){
csvg . appendChild ( cc ) ;
var lts = - 1 ;
if ( targets_lts_2d [ id ] != undefined ) lts = targets_lts_2d [ id ] ;
var r = 0 ;
if ( targets_lts_2d [ id ] != undefined ) lts = targets_lts_2d [ id ] ;
switch ( drawZoomLevels [ id ] ) {
case 100 : {
var r = Math . round ( hr * ( 2048.0 / ( bBox . width / 2.0 ) ) ) ;
r = Math . round ( hr * ( 2048.0 / ( bBox . width / 2.0 ) ) ) ;
if ( r > 2048 ) r = 2048 ;
roi_2d [ id ] = { range : r , az : zat , ts : lts } ;
set2DZoomLevel ( id , 100 ) ;
break ;
} ;
case 50 : {
var r = Math . round ( hr * ( 1024.0 / ( bBox . width / 2.0 ) ) ) ;
r = Math . round ( hr * ( 1024.0 / ( bBox . width / 2.0 ) ) ) ;
if ( r > 1024 ) r = 1024 ;
roi_2d [ id ] = { range : r , az : zat , ts : lts } ;
set2DZoomLevel ( id , 50 ) ;
break ;
} ;
case 25 : {
var r = Math . round ( hr * ( 512.0 / ( bBox . width / 2.0 ) ) ) ;
r = Math . round ( hr * ( 512.0 / ( bBox . width / 2.0 ) ) ) ;
if ( r > 512 ) r = 512 ;
roi_2d [ id ] = { range : r , az : zat , ts : lts } ;
set2DZoomLevel ( id , 25 ) ;
break ;
} ;
case 12 : {
var r = Math . round ( hr * ( 256.0 / ( bBox . width / 2.0 ) ) ) ;
r = Math . round ( hr * ( 256.0 / ( bBox . width / 2.0 ) ) ) ;
if ( r > 256 ) r = 256 ;
roi_2d [ id ] = { range : r , az : zat , ts : lts } ;
set2DZoomLevel ( id , 12 ) ;
break ;
} ;
default : {
var r = - 1 ;
r = - 1 ;
roi_2d [ id ] = { range : r , az : zat , ts : lts } ;
set2DZoomLevel ( id , 100 ) ;
break ;
} ;
} ;
//alert('R:'+r+' AZ:'+zat+' TS:'+lts );
if ( r > - 1 ) {
var z = Math . round ( zat * 3000 / Math . PI ) ;
if ( z < 0 ) z += 6000 ;
@ -657,6 +665,7 @@ var roi_2d=[];
var draws_2d = [ ] ;
var masks_2d = [ ] ;
var masks_2d_shown = [ ] ;
var ack_2d = [ ] ;
function cleanup2DTargets ( a ) {
targets_2d_el [ a ] = [ ] ;
@ -702,6 +711,7 @@ function draw2DTargets( a ){
//console.log( '2 box: '+ bBox.width+'x'+bBox.height );
if ( targets_2d [ a ] != undefined ) {
if ( targets_2d [ a ] . length ) {
playSound ( 1 ) ;
var ak = 2.0 * Math . PI / 360 ;
var ok = 1.0 / 35 ;
for ( idx = targets_2d [ a ] . length - 1 ; idx > 0 ; idx -- ) {
@ -785,7 +795,7 @@ function draw2DMasks( a, zzz='' ){
for ( i = 0 ; i < 5 ; i ++ ) {
masks_2d_shown [ a ] [ i ] = [ ] ;
if ( masks_2d [ a ] [ i ] . vtx != undefined ) {
console . log ( '0 box: ' + bBox . width + 'x' + bBox . height ) ;
//console.log( '0 box: '+ bBox.width+'x'+bBox.height );
var cpx = bBox . width / 2.0 ;
var cpy = bBox . height / 2.0 ;
var max = 2048 ;
@ -1131,6 +1141,10 @@ function setStatus2D( a, status, masksE = 0, masks = 0 ){
if ( t != undefined ) t . disable ( ) ;
t = Ext . getCmp ( 'DMED_' + a ) ;
if ( t != undefined ) t . disable ( ) ;
t = Ext . getCmp ( 'DACK_' + a ) ;
if ( t != undefined ) t . disable ( ) ;
t = Ext . getCmp ( 'DNACK_' + a ) ;
if ( t != undefined ) t . disable ( ) ;
var csvg = document . getElementById ( 'draw_svg_' + a ) ;
if ( csvg != undefined ) csvg . setAttribute ( 'opacity' , '0.3' ) ;
if ( masks_exist [ a ] != 0 ) {
@ -1155,6 +1169,10 @@ function setStatus2D( a, status, masksE = 0, masks = 0 ){
if ( t != undefined ) t . disable ( ) ;
t = Ext . getCmp ( 'DMED_' + a ) ;
if ( t != undefined ) t . disable ( ) ;
t = Ext . getCmp ( 'DACK_' + a ) ;
if ( t != undefined ) t . disable ( ) ;
t = Ext . getCmp ( 'DNACK_' + a ) ;
if ( t != undefined ) t . disable ( ) ;
var csvg = document . getElementById ( 'draw_svg_' + a ) ;
if ( csvg != undefined ) csvg . setAttribute ( 'opacity' , '0.3' ) ;
if ( masks_exist [ a ] != 0 ) {
@ -1179,6 +1197,10 @@ function setStatus2D( a, status, masksE = 0, masks = 0 ){
if ( t != undefined ) t . enable ( ) ;
t = Ext . getCmp ( 'DMED_' + a ) ;
if ( t != undefined ) t . enable ( ) ;
t = Ext . getCmp ( 'DACK_' + a ) ;
if ( t != undefined ) t . enable ( ) ;
t = Ext . getCmp ( 'DNACK_' + a ) ;
if ( t != undefined ) t . enable ( ) ;
var csvg = document . getElementById ( 'draw_svg_' + a ) ;
if ( csvg != undefined ) csvg . setAttribute ( 'opacity' , '1.0' ) ;
if ( masks_statuses [ a ] != masks || masks_exist [ a ] != masksE ) {
@ -1212,6 +1234,10 @@ function setStatus2D( a, status, masksE = 0, masks = 0 ){
if ( t != undefined ) t . enable ( ) ;
t = Ext . getCmp ( 'DMED_' + a ) ;
if ( t != undefined ) t . enable ( ) ;
t = Ext . getCmp ( 'DACK_' + a ) ;
if ( t != undefined ) t . enable ( ) ;
t = Ext . getCmp ( 'DNACK_' + a ) ;
if ( t != undefined ) t . enable ( ) ;
var csvg = document . getElementById ( 'draw_svg_' + a ) ;
if ( csvg != undefined ) csvg . setAttribute ( 'opacity' , '1.0' ) ;
if ( masks_statuses [ a ] != masks || masks_exist [ a ] != masksE ) {
@ -1245,6 +1271,10 @@ function setStatus2D( a, status, masksE = 0, masks = 0 ){
if ( t != undefined ) t . enable ( ) ;
t = Ext . getCmp ( 'DMED_' + a ) ;
if ( t != undefined ) t . enable ( ) ;
t = Ext . getCmp ( 'DACK_' + a ) ;
if ( t != undefined ) t . enable ( ) ;
t = Ext . getCmp ( 'DNACK_' + a ) ;
if ( t != undefined ) t . enable ( ) ;
var csvg = document . getElementById ( 'draw_svg_' + a ) ;
if ( csvg != undefined ) csvg . setAttribute ( 'opacity' , '1.0' ) ;
if ( masks_statuses [ a ] != masks || masks_exist [ a ] != masksE ) {
@ -1278,6 +1308,10 @@ function setStatus2D( a, status, masksE = 0, masks = 0 ){
if ( t != undefined ) t . enable ( ) ;
t = Ext . getCmp ( 'DMED_' + a ) ;
if ( t != undefined ) t . enable ( ) ;
t = Ext . getCmp ( 'DACK_' + a ) ;
if ( t != undefined ) t . enable ( ) ;
t = Ext . getCmp ( 'DNACK_' + a ) ;
if ( t != undefined ) t . enable ( ) ;
var csvg = document . getElementById ( 'draw_svg_' + a ) ;
if ( csvg != undefined ) csvg . setAttribute ( 'opacity' , '1.0' ) ;
if ( masks_statuses [ a ] != masks || masks_exist [ a ] != masksE ) {
@ -1311,6 +1345,10 @@ function setStatus2D( a, status, masksE = 0, masks = 0 ){
if ( t != undefined ) t . enable ( ) ;
t = Ext . getCmp ( 'DMED_' + a ) ;
if ( t != undefined ) t . enable ( ) ;
t = Ext . getCmp ( 'DACK_' + a ) ;
if ( t != undefined ) t . enable ( ) ;
t = Ext . getCmp ( 'DNACK_' + a ) ;
if ( t != undefined ) t . enable ( ) ;
var csvg = document . getElementById ( 'draw_svg_' + a ) ;
if ( csvg != undefined ) csvg . setAttribute ( 'opacity' , '1.0' ) ;
if ( masks_statuses [ a ] != masks || masks_exist [ a ] != masksE ) {
@ -1736,3 +1774,23 @@ function loadDashBoard(){
failure : failureAJAXFunction
} ) ;
} ;
var ack_2d_marker = null ;
var mode_add_ack = false ;
function startAdd2DACK ( a ) {
mode_add_ack = true ;
ack_2d [ a ] = 1 ;
} ;
function onClickAdd2DACK ( ) {
} ;
function finishAdd2DACK ( ) {
if ( mode_add_ack ) {
mode_add_ack = false ;
} ;
} ;
function clear2DACK ( a ) {
} ;