From 5c372468d84ef4b88509718092d00914d49c7083 Mon Sep 17 00:00:00 2001 From: Evgeny Gagua Date: Thu, 23 Nov 2023 17:21:05 +0000 Subject: [PATCH] Rocopomps --- lib/controller/dash/node_1.js | 14 +++++++++----- lib/controller/dash/node_3.js | 15 ++++++++------- lib/controller/doApplicationOperation.php | 3 +++ lib/controller/getDashBoardItems.php | 8 ++++++++ lib/controller/getHistoryEvents.php | 6 +++++- lib/controller/getReportLayout.php | 4 ++++ lib/controller/report/node_1.js | 15 +++++++++++++-- lib/controller/report/node_3.js | 17 +++++++++-------- lib/javascript/jsapi_dynamic/mojo_reports.js | 2 +- lib/javascript/jsapi_dynamic/mojo_settings.js | 8 ++++++++ 10 files changed, 68 insertions(+), 24 deletions(-) diff --git a/lib/controller/dash/node_1.js b/lib/controller/dash/node_1.js index 87639c8..e2b6e3b 100644 --- a/lib/controller/dash/node_1.js +++ b/lib/controller/dash/node_1.js @@ -23,12 +23,16 @@ //var expH = document.body.clientHeight - p.ownerCt.ownerCt.getHeight(); var W = p.getWidth(); - //var H=9*(W/16) - 28; - var H = PanelH - p.ownerCt.getHeight() + 64; - //var H = document.body.clientHeight - p.ownerCt.ownerCt.getHeight(); - if( H > ( W * 0.5625 )+ 32 ){ - H = ( W * 0.5625 ) + 32; + var H = 9*(W/16) - 28; + if( %%%APPTYPE%%% == 2 ){ + H = PanelH - p.ownerCt.getHeight() + 64; + if( H > ( W * 0.5625 )+ 32 ){ + H = ( W * 0.5625 ) + 32; + }; + } else { + H = document.body.clientHeight - p.ownerCt.ownerCt.getHeight(); }; + //alert( H ); //var W = 16*(H/9); //p.ownerCt.setWidth( W ); diff --git a/lib/controller/dash/node_3.js b/lib/controller/dash/node_3.js index 1ee40fb..811a753 100644 --- a/lib/controller/dash/node_3.js +++ b/lib/controller/dash/node_3.js @@ -23,13 +23,14 @@ //var expH = document.body.clientHeight - p.ownerCt.ownerCt.getHeight(); var W = p.getWidth(); - //var H=9*(W/16) - 28; - //var H = PanelH - p.ownerCt.ownerCt.getHeight() + 64; - //var H = document.body.clientHeight - p.ownerCt.ownerCt.getHeight(); - var H = PanelH - p.ownerCt.getHeight() + 64; - //var H = document.body.clientHeight - p.ownerCt.ownerCt.getHeight(); - if( H > ( W * 0.5625 )+ 32 ){ - H = ( W * 0.5625 ) + 32; + var H = 9*(W/16) - 28; + if( %%%APPTYPE%%% == 2 ){ + H = PanelH - p.ownerCt.getHeight() + 64; + if( H > ( W * 0.5625 )+ 32 ){ + H = ( W * 0.5625 ) + 32; + }; + } else { + H = document.body.clientHeight - p.ownerCt.ownerCt.getHeight(); }; //var W = 16*(H/9); //p.ownerCt.setWidth( W ); diff --git a/lib/controller/doApplicationOperation.php b/lib/controller/doApplicationOperation.php index 0d9e02c..14d0b61 100644 --- a/lib/controller/doApplicationOperation.php +++ b/lib/controller/doApplicationOperation.php @@ -34,6 +34,9 @@ $Data['q'] = $QS; $Data['success'] = true; }; + case 4:{// Set Report autodelete + + }; }; } else { $Data['msg']='Wrong Parameters!'; diff --git a/lib/controller/getDashBoardItems.php b/lib/controller/getDashBoardItems.php index 8260dc8..9571354 100644 --- a/lib/controller/getDashBoardItems.php +++ b/lib/controller/getDashBoardItems.php @@ -156,6 +156,7 @@ _DATA_BOUNDARY; $TPL = str_replace('%%%NODENAME%%%', ''. urldecode( $DD['name'] ), $TPL ); $TPL = str_replace('%%%USERID%%%', $UserID, $TPL ); $TPL = str_replace('%%%SESSION%%%', $Session, $TPL ); + $TPL = str_replace('%%%APPTYPE%%%', $SP['type'], $TPL ); $OUT[]= $STA[$idx] . $TPL . $END; } else break; $idx++; @@ -184,6 +185,7 @@ _DATA_BOUNDARY; $TPL = str_replace('%%%NODENAME%%%', ''.urldecode( $DD['name'] ) , $TPL ); $TPL = str_replace('%%%USERID%%%', $UserID, $TPL ); $TPL = str_replace('%%%SESSION%%%', $Session, $TPL ); + $TPL = str_replace('%%%APPTYPE%%%', $SP['type'], $TPL ); $QS="SELECT * FROM `nodes` WHERE `id`={$DD['id']}"; $Z=$DATABASE->Query( $QS ); $QS="SELECT * FROM `module_eve` WHERE `id`=1"; @@ -270,6 +272,7 @@ _DATA_BOUNDARY; $TPL = str_replace('%%%NODENAME%%%', ''.html_entity_decode( $DD['name'] ) , $TPL ); $TPL = str_replace('%%%USERID%%%', $UserID, $TPL ); $TPL = str_replace('%%%SESSION%%%', $Session, $TPL ); + $TPL = str_replace('%%%APPTYPE%%%', $SP['type'], $TPL ); $OUT[]= $STA[$idx] . $TPL . $END; } else break; $idx++; @@ -298,6 +301,7 @@ _DATA_BOUNDARY; $TPL = str_replace('%%%NODENAME%%%', ''.urldecode($DD['name']) , $TPL ); $TPL = str_replace('%%%USERID%%%', $UserID, $TPL ); $TPL = str_replace('%%%SESSION%%%', $Session, $TPL ); + $TPL = str_replace('%%%APPTYPE%%%', $SP['type'], $TPL ); $QS="SELECT * FROM `nodes` WHERE `id`={$DD['id']}"; $Z=$DATABASE->Query( $QS ); $QS="SELECT * FROM `module_eve` WHERE `id`=1"; @@ -385,6 +389,7 @@ _DATA_BOUNDARY; $TPL = str_replace('%%%NODENAME%%%', ''.html_entity_decode( $DD['name'] ) , $TPL ); $TPL = str_replace('%%%USERID%%%', $UserID, $TPL ); $TPL = str_replace('%%%SESSION%%%', $Session, $TPL ); + $TPL = str_replace('%%%APPTYPE%%%', $SP['type'], $TPL ); $OUT[]= $STA[$idx] . $TPL . $END; } else break; $idx++; @@ -413,6 +418,7 @@ _DATA_BOUNDARY; $TPL = str_replace('%%%NODENAME%%%', ''.urldecode($DD['name']) , $TPL ); $TPL = str_replace('%%%USERID%%%', $UserID, $TPL ); $TPL = str_replace('%%%SESSION%%%', $Session, $TPL ); + $TPL = str_replace('%%%APPTYPE%%%', $SP['type'], $TPL ); $QS="SELECT * FROM `nodes` WHERE `id`={$DD['id']}"; $Z=$DATABASE->Query( $QS ); $QS="SELECT * FROM `module_eve` WHERE `id`=1"; @@ -492,6 +498,7 @@ _DATA_BOUNDARY; $TPL = str_replace('%%%NODENAME%%%', ''.urldecode($DD['name']) , $TPL ); $TPL = str_replace('%%%USERID%%%', $UserID, $TPL ); $TPL = str_replace('%%%SESSION%%%', $Session, $TPL ); + $TPL = str_replace('%%%APPTYPE%%%', $SP['type'], $TPL ); $QS="SELECT * FROM `nodes` WHERE `id`={$DD['id']}"; $Z=$DATABASE->Query( $QS ); $QS="SELECT * FROM `module_eve` WHERE `id`=1"; @@ -553,6 +560,7 @@ _DATA_BOUNDARY; $TPL = str_replace('%%%NODENAME%%%', ''.html_entity_decode( $DD['name'] ) , $TPL ); $TPL = str_replace('%%%USERID%%%', $UserID, $TPL ); $TPL = str_replace('%%%SESSION%%%', $Session, $TPL ); + $TPL = str_replace('%%%APPTYPE%%%', $SP['type'], $TPL ); $OUT[]= $STA[2+$idx] . $TPL . $END; } else break; $idx++; diff --git a/lib/controller/getHistoryEvents.php b/lib/controller/getHistoryEvents.php index c82ed42..099ff31 100644 --- a/lib/controller/getHistoryEvents.php +++ b/lib/controller/getHistoryEvents.php @@ -34,10 +34,14 @@ $CR['width'] = intval( $REC['area'] ); $CR['video_id'] = intval( $REC['video_id'] ); if( $REC['lat'] != 0 && $REC['lon'] != 0 ){ - $CR['geo'] = true; + $CR['geo'] = true; if( $SP['local_binding'] != 0 ){ + //$CHUCHA = ( M_PI / 180 ) * (floatval( $REC['azimuth'] )-40.9); + //$RUR = sqrt( $REC['lon']* $REC['lon'] + $REC['lat']*$REC['lat']); $CR['lon'] = floatval( $SP['anchor_lon'] ) + floatval( $REC['lon'] ); + //$CR['lon'] = floatval( $SP['anchor_lon'] ) + cos( $CHUCHA ) * $RUR; $CR['lat'] = floatval( $SP['anchor_lat'] ) + floatval( $REC['lat'] ); + //$CR['lat'] = floatval( $SP['anchor_lat'] ) + sin( $CHUCHA ) * $RUR; } else { $CR['lon'] = floatval( $REC['lon'] ); $CR['lat'] = floatval( $REC['lat'] ); diff --git a/lib/controller/getReportLayout.php b/lib/controller/getReportLayout.php index 9155dc0..67c892e 100644 --- a/lib/controller/getReportLayout.php +++ b/lib/controller/getReportLayout.php @@ -143,6 +143,7 @@ _DATA_BOUNDARY; $TPL = file_get_contents( $TFN ); $TPL = str_replace('%%%NODEID%%%', ''.$DD['id'] , $TPL ); $TPL = str_replace('%%%NODENAME%%%', ''.html_entity_decode( $DD['name'] ) , $TPL ); + $TPL = str_replace('%%%APPTYPE%%%', $SP['type'], $TPL ); $OUT[]= $STA[$idx] . $TPL . $END; } else break; $idx++; @@ -168,6 +169,7 @@ _DATA_BOUNDARY; $TPL = file_get_contents( $TFN ); $TPL = str_replace('%%%NODEID%%%', ''.$DD['id'] , $TPL ); $TPL = str_replace('%%%NODENAME%%%', ''.urldecode($DD['name']) , $TPL ); + $TPL = str_replace('%%%APPTYPE%%%', $SP['type'], $TPL ); $QS="SELECT * FROM `nodes` WHERE `id`={$DD['id']}"; $Z=$DATABASE->Query( $QS ); $QS="SELECT * FROM `module_eve` WHERE `id`=1"; @@ -222,6 +224,7 @@ _DATA_BOUNDARY; $TPL = file_get_contents( $TFN ); $TPL = str_replace('%%%NODEID%%%', ''.$DD['id'] , $TPL ); $TPL = str_replace('%%%NODENAME%%%', ''.urldecode($DD['name']) , $TPL ); + $TPL = str_replace('%%%APPTYPE%%%', $SP['type'], $TPL ); $QS="SELECT * FROM `nodes` WHERE `id`={$DD['id']}"; $Z=$DATABASE->Query( $QS ); $QS="SELECT * FROM `module_eve` WHERE `id`=1"; @@ -269,6 +272,7 @@ _DATA_BOUNDARY; $TPL = file_get_contents( $TFN ); $TPL = str_replace('%%%NODEID%%%', ''.$DD['id'] , $TPL ); $TPL = str_replace('%%%NODENAME%%%', ''.html_entity_decode( $DD['name'] ) , $TPL ); + $TPL = str_replace('%%%APPTYPE%%%', $SP['type'], $TPL ); $OUT[]= $STA[2+$idx] . $TPL . $END; } else break; $idx++; diff --git a/lib/controller/report/node_1.js b/lib/controller/report/node_1.js index 228619b..0750995 100644 --- a/lib/controller/report/node_1.js +++ b/lib/controller/report/node_1.js @@ -20,9 +20,20 @@ masks_exist[%%%NODEID%%%] = 0; var W = p.getWidth(); - //var H=9*(W/16) - 28; //var H = PanelH - p.ownerCt.ownerCt.getHeight() + 64; - var H = document.body.clientHeight - p.ownerCt.ownerCt.getHeight(); + var H = 9*(W/16) - 28; + if( %%%APPTYPE%%% == 2 ){ + H = PanelH - p.ownerCt.getHeight() + 64; + if( H > ( W * 0.5625 )+ 32 ){ + H = ( W * 0.5625 ) + 32; + }; + } else { + H = document.body.clientHeight - p.ownerCt.ownerCt.getHeight(); + if( H > W+60 ){ + H = W+60; + }; + }; + //var H = document.body.clientHeight - p.ownerCt.ownerCt.getHeight(); //var W = 16*(H/9); //p.ownerCt.setWidth( W ); p.setHeight( H ); diff --git a/lib/controller/report/node_3.js b/lib/controller/report/node_3.js index e26d045..4094b5a 100644 --- a/lib/controller/report/node_3.js +++ b/lib/controller/report/node_3.js @@ -20,14 +20,15 @@ masks_exist[%%%NODEID%%%] = 0; var W = p.getWidth(); - //var H=9*(W/16) - 28; - //var H = PanelH - p.ownerCt.ownerCt.getHeight() + 64; - //var H = document.body.clientHeight - p.ownerCt.ownerCt.getHeight(); - var H = PanelH - p.ownerCt.getHeight() + 64; - //var H = document.body.clientHeight - p.ownerCt.ownerCt.getHeight(); - if( H > W + 32 ){ - H = W + 32; - }; + var H = 9*(W/16) - 28; + if( %%%APPTYPE%%% == 2 ){ + H = PanelH - p.ownerCt.getHeight() + 64; + if( H > W + 60 ){ + H = W + 60; + }; + } else { + H = document.body.clientHeight - p.ownerCt.ownerCt.getHeight(); + }; //var W = 16*(H/9); //p.ownerCt.setWidth( W ); p.setHeight( H ); diff --git a/lib/javascript/jsapi_dynamic/mojo_reports.js b/lib/javascript/jsapi_dynamic/mojo_reports.js index 0384de2..26bd98a 100644 --- a/lib/javascript/jsapi_dynamic/mojo_reports.js +++ b/lib/javascript/jsapi_dynamic/mojo_reports.js @@ -1609,7 +1609,7 @@ var videoFileDownloadTarget = ''; var videoFileURI = ''; var videoFileFPS = 15; function setVideoDownloadButton( URI, fps, ts ){ - var d = new Date( ts ); + var d = new Date( ts*1000 ); videoFileDownloadTarget = d.getFullYear()+'_'+(d.getMonth()+1)+'_'+d.getDate()+'_'+d.getHours()+'-'+d.getMinutes()+'-'+d.getSeconds()+'.mp4'; videoFileURI = URI; videoFileFPS = fps; diff --git a/lib/javascript/jsapi_dynamic/mojo_settings.js b/lib/javascript/jsapi_dynamic/mojo_settings.js index c431b35..5411253 100644 --- a/lib/javascript/jsapi_dynamic/mojo_settings.js +++ b/lib/javascript/jsapi_dynamic/mojo_settings.js @@ -2674,6 +2674,11 @@ function showSettingsApplication(){ width: 300, value: , name: 'db_time', + listeners: { + onchange: function( t, b, o){ + doApplicationOperation( 4, b ); + } + } },{ xtype: 'spacer', height: 10 @@ -2684,6 +2689,9 @@ function showSettingsApplication(){ value: , width: 300, name: 'db_space', + onchange: function( t, b, o){ + doApplicationOperation( 5, b ); + } },{ xtype: 'spacer', height: 10