From e0cd1f1f70003ed1767d8267d3731b86e0266c0f Mon Sep 17 00:00:00 2001 From: Evgeny Gagua Date: Tue, 12 Dec 2023 18:28:59 +0000 Subject: [PATCH] JAJAUZE --- lib/controller/getDeviceMask.php | 2 +- .../jsapi_dynamic/mojo_dashboard.js | 64 ++++++++++++++++++- .../jsapi_dynamic/rgoose_devices.js | 50 --------------- 3 files changed, 64 insertions(+), 52 deletions(-) diff --git a/lib/controller/getDeviceMask.php b/lib/controller/getDeviceMask.php index 130baee..28fae4c 100644 --- a/lib/controller/getDeviceMask.php +++ b/lib/controller/getDeviceMask.php @@ -17,7 +17,7 @@ $result = $DATABASE->Query( $QS, false ); if( count($result) ){ $CM = $result[0]; - $QS = "SELECT * FROM `lrf_mask_vertexes` WHERE `mask_id`={$CM['id']}"; + $QS = "SELECT `id` FROM `lrf_mask_vertexes` WHERE `mask_id`={$CM['id']}"; $ZA = $DATABASE->Query( $QS ); $CMA['vtx'] = array(); if( count( $ZA ) ){ diff --git a/lib/javascript/jsapi_dynamic/mojo_dashboard.js b/lib/javascript/jsapi_dynamic/mojo_dashboard.js index dea0f9f..211d411 100644 --- a/lib/javascript/jsapi_dynamic/mojo_dashboard.js +++ b/lib/javascript/jsapi_dynamic/mojo_dashboard.js @@ -868,7 +868,7 @@ function draw2DMasks( a, zzz='' ){ newpath.setAttributeNS(null, "fill-opacity", "1.0"); }; newpath.setAttributeNS(null, "id", "mask_"+a+"_"+i+"_"+k ); - console.log( "Added Poly: mask_"+a+"_"+i+"_"+k ); + //console.log( "Added Poly: mask_"+a+"_"+i+"_"+k ); newpath.setAttributeNS(null, "clip-path", "url(#svg_mask_"+a+")" ); var tch = csvg.getElementById( "border_"+a ); if( tch != undefined ){ @@ -997,6 +997,8 @@ function load2DDraw( a, id='' ){ draws_2d[a] = data.data; draw2DDraw( a, id ); load2DMasks( a, id ); + } else { + load2DMasks( a, id ); }; }, failure: failureAJAXFunction @@ -1891,6 +1893,66 @@ function finishAdd2DACK(){ }; }; +function cancelAdd2DACK(){ + if( mode_add_ack ){ + mode_add_ack = false; + }; +}; + function clear2DACK( a ){ }; + +function doAckOperation( NodeID, Cmd ){ + if( Cmd ){ + Ext.Msg.show({ + title:'GetLabel("_INFO_MSG_");?>', + msg: 'GetLabel("_DEV_ACK_START_");?>', + buttons: Ext.Msg.YESNOCANCEL, + fn: function( btn ){ + if( btn == 'yes' ){ + selectROI_mode = 1; + t = Ext.getCmp('cp_radar_'+NodeID ); + if( t != undefined ){ + t.addClass( 'yellow_bg' ); + }; + t = Ext.getCmp('toolbox_'+NodeID ); + if( t != undefined ){ + W = t.ownerCt.ownerCt.getWidth(); + H = t.ownerCt.ownerCt.getHeight(); + if( H ){ + if( ( W / H ) < 1.5 ) t.collapse( true ); + }; + }; + t = document.getElementById('draw_svg_'+NodeID ); + if( t != undefined ){ + t.style.cursor = 'cell'; + }; + } else { + t = Ext.getCmp('cp_ack_btn_'+NodeID ); + if( t != undefined ) t.toggle( false, true ); + }; + }, + icon: Ext.MessageBox.QUESTION + }); + } else { + if( mode_add_ack ){ + + } else { + Ext.Msg.show({ + title:'GetLabel("_INFO_MSG_");?>', + msg: 'GetLabel("_DEV_ACK_STOP_");?>', + buttons: Ext.Msg.YESNOCANCEL, + fn: function( btn ){ + if( btn == 'yes' ){ + doMaskOperation( NodeID, 3, 5 ); + } else { + t = Ext.getCmp('cp_ack_btn_'+NodeID ); + if( t != undefined ) t.toggle( true, true ); + }; + }, + icon: Ext.MessageBox.QUESTION + }); + }; + }; +}; diff --git a/lib/javascript/jsapi_dynamic/rgoose_devices.js b/lib/javascript/jsapi_dynamic/rgoose_devices.js index ad6e4ab..cb4007f 100644 --- a/lib/javascript/jsapi_dynamic/rgoose_devices.js +++ b/lib/javascript/jsapi_dynamic/rgoose_devices.js @@ -2009,56 +2009,6 @@ function doMaskOperation( NodeID, Cmd, Mid = 0, LRFID = 0 ){ }); } -function doAckOperation( NodeID, Cmd ){ - if( Cmd ){ - Ext.Msg.show({ - title:'GetLabel("_INFO_MSG_");?>', - msg: 'GetLabel("_DEV_ACK_START_");?>', - buttons: Ext.Msg.YESNOCANCEL, - fn: function( btn ){ - if( btn == 'yes' ){ - selectROI_mode = 1; - t = Ext.getCmp('cp_radar_'+NodeID ); - if( t != undefined ){ - t.addClass( 'yellow_bg' ); - }; - t = Ext.getCmp('toolbox_'+NodeID ); - if( t != undefined ){ - W = t.ownerCt.ownerCt.getWidth(); - H = t.ownerCt.ownerCt.getHeight(); - if( H ){ - if( ( W / H ) < 1.5 ) t.collapse( true ); - }; - }; - t = document.getElementById('draw_svg_'+NodeID ); - if( t != undefined ){ - t.style.cursor = 'cell'; - }; - } else { - t = Ext.getCmp('cp_ack_btn_'+NodeID ); - if( t != undefined ) t.toggle( false, true ); - }; - }, - icon: Ext.MessageBox.QUESTION - }); - } else { - Ext.Msg.show({ - title:'GetLabel("_INFO_MSG_");?>', - msg: 'GetLabel("_DEV_ACK_STOP_");?>', - buttons: Ext.Msg.YESNOCANCEL, - fn: function( btn ){ - if( btn == 'yes' ){ - doMaskOperation( NodeID, 3, 5 ); - } else { - t = Ext.getCmp('cp_ack_btn_'+NodeID ); - if( t != undefined ) t.toggle( true, true ); - }; - }, - icon: Ext.MessageBox.QUESTION - }); - }; -} - var ME_max_range = 100; function showMaskEditor( fromDevTool, DevType, NodeID ){ //alert( "DevType: "+DevType + " Dev Map size: "+ absDrawMapSizes[DevType][0]+"x"+absDrawMapSizes[DevType][1] );