Browse Source

MER UI finish stage 1

master
Evgeny Gagua 3 years ago
parent
commit
4543422b85
  1. 2
      lib/1.json
  2. 17
      lib/controller/addMap.php
  3. 2
      lib/controller/dash/node_3.js
  4. 13
      lib/controller/delWidthTableRecord.php
  5. 35
      lib/controller/doApplicationOperation.php
  6. 66
      lib/controller/doSensorOperation.php
  7. 13
      lib/controller/getReportLayout.php
  8. 110
      lib/controller/getSensorDetectionEditor.php
  9. 98
      lib/controller/getSensorEditor.php
  10. 23
      lib/controller/updateMap.php
  11. 13
      lib/controller/validateUserSession.php
  12. 33
      lib/javascript/jsapi_dynamic/mojo_dashboard.js
  13. 2
      lib/javascript/jsapi_dynamic/mojo_global_vars.js
  14. 9
      lib/javascript/jsapi_dynamic/mojo_main.js
  15. 51
      lib/javascript/jsapi_dynamic/mojo_map.js
  16. 50
      lib/javascript/jsapi_dynamic/mojo_settings.js

2
lib/1.json
File diff suppressed because it is too large
View File

17
lib/controller/addMap.php

@ -52,10 +52,19 @@
$BM = intval( $_POST['bounds_mode'] );
$K_X = $MA_WI / ( $width - $LB - $RB );
$K_Y = $MA_HE / ( $height - $TB - $BB );
$IBLX = (-$LB)*$K_X;
$IBLY = (-$TB)*$K_Y;
$IBRX = ( $width + $RB ) * $K_X;
$IBRY = ( $height + $BB ) * $K_Y;
if( $BM ){
$THW = (($width + $RB + $LB) * $K_X ) / 2.0;
$THH = (($height + $BB + $TB) * $K_Y ) / 2.0;
$IBLX = -$THW;
$IBLY = -$THH;
$IBRX = $THW;
$IBRY = $THH;
} else {
$IBLX = (-$LB)*$K_X;
$IBLY = (-$TB)*$K_Y;
$IBRX = ( $width + $RB ) * $K_X;
$IBRY = ( $height + $BB ) * $K_Y;
};
$QS = "INSERT INTO `location_maps`(`type`,`name`,`layer_url`,`desc`,`maxNativeZoom`,`maxZoom`,`attribution`,`bounds_lx`,`bounds_ly`,`bounds_rx`,`bounds_ry`,`bounds_mode`,`img_w`,`img_h`,`img_map_w`,`img_map_h`,`img_lb`,`img_tb`,`img_rb`,`img_bb`) values(2,'{$ENAME}','{$FNAME}','{$EDESC}',{$INZOOM},{$IZOOM},'{$EATTR}',{$IBLX},{$IBLY},{$IBRX},{$IBRY},{$BM},{$width},{$height},{$MA_WI},{$MA_HE},{$LB},{$TB},{$RB},{$BB})";
$DATABASE->Query( $QS );
verbose( 1, "ALL IS OK" );

2
lib/controller/dash/node_3.js

@ -24,7 +24,7 @@
var W = p.getWidth();
var H = 9*(W/16) - 28;
if( %%%APPTYPE%%% == 2 ){
if( %%%APPTYPE%%% == 33 ){
H = PanelH - p.ownerCt.getHeight() + 64;
if( H > ( W * 0.5625 )+ 32 ){
H = ( W * 0.5625 ) + 32;

13
lib/controller/delWidthTableRecord.php

@ -0,0 +1,13 @@
<?php
require_once('../ajax_asm.php');
if( $CUser->Data['id'] > 1 ){
if( isset( $_POST['DID'] ) ){
$DID = intval( $_POST['DID'] );
$ID = intval( $_POST['RID'] );
if( $DID && $ID ){
$QS = "DELETE FROM `lrf_detection_width_tables` WHERE `id`={$ID}";
$RR = $DATABASE->Query( $QS );
};
};
};
?>

35
lib/controller/doApplicationOperation.php

@ -33,9 +33,40 @@
$RBASE->Query( $QS, false );
$Data['q'] = $QS;
$Data['success'] = true;
break;
};
case 4:{//Set Report autodelete
$PARAM = intval( $_POST['OPCODE'] );
if( $PARAM < 0 ) $PARAM = 0;
if( $PARAM > 0 && $PARAM < 3 ) $PARAM = 3; // Minimum three days
$QS = "UPDATE `system_props` SET `report_cleanup`={$PARAM} WHERE `id`=1";
$DATABASE->Query( $QS );
break;
};
case 5:{//Set Preserve Free Space
$PARAM = intval( $_POST['OPCODE'] );
if( $PARAM < 0 ) $PARAM = 0;
if( $PARAM > 0 && $PARAM < 10 ) $PARAM = 10; // Minimum ten percents
$QS = "UPDATE `system_props` SET `preserve_empty`={$PARAM} WHERE `id`=1";
$DATABASE->Query( $QS );
break;
};
case 4:{// Set Report autodelete
case 6:{//Set volume
$PARAM = intval( $_POST['OPCODE'] );
if( $PARAM < 0 ) $PARAM = 0;
if( $PARAM > 3 ) $PARAM = 3;
$QS = "UPDATE `users` SET `sound_enable`={$PARAM} WHERE `id`={$CUser->Data['id']}";
$DATABASE->Query( $QS );
break;
};
case 7:{// Time Sync
$RBASE = new SQLite_DB( '/dev/shm/argus/mem_db.db');
$PARAM = intval($_POST['OPCODE']);
$QS = "INSERT INTO `nodes_qcq`(`node_id`,`cmd`,`status`,`parameter`) VALUES(1,252,0,'{$PARAM}')";
$RBASE->Query( $QS, false );
$Data['q'] = $QS;
$Data['success'] = true;
break;
};
};
} else {

66
lib/controller/doSensorOperation.php

@ -194,8 +194,7 @@
$Data['success'] = true;
break;
};
case 20:{
//Save INI to device
case 20:{//Save INI to device
$RBASE = new SQLite_DB( '/dev/shm/argus/mem_db.db');
$QS = "INSERT INTO `nodes_qcq`(`node_id`,`cmd`,`status`,`parameter`) VALUES({$CN['id']},130,0,'')";
$RBASE->Query( $QS, false );
@ -203,8 +202,7 @@
$Data['success'] = true;
break;
};
case 21:{
// Enable Frozen
case 21:{// Enable Frozen
$QS = "UPDATE `lrf_ini_settings` SET `FREEZ_FIRST_TH`=1, `SAVE_FIRST_TH`=1 WHERE `sensor_id`={$SNID}";
$DATABASE->Query( $QS );
$RBASE = new SQLite_DB( '/dev/shm/argus/mem_db.db');
@ -214,8 +212,7 @@
$Data['success'] = true;
break;
};
case 22:{
// Disable Frozen
case 22:{// Disable Frozen
$QS = "UPDATE `lrf_ini_settings` SET `FREEZ_FIRST_TH`=0, `SAVE_FIRST_TH`=0 WHERE `sensor_id`={$SNID}";
$DATABASE->Query( $QS );
$RBASE = new SQLite_DB( '/dev/shm/argus/mem_db.db');
@ -225,8 +222,7 @@
$Data['success'] = true;
break;
};
case 23:{
// Delete Frozen
case 23:{// Delete Frozen
$QS = "UPDATE `lrf_ini_settings` SET `FREEZ_FIRST_TH`=0, `SAVE_FIRST_TH`=1 WHERE `sensor_id`={$SNID}";
$DATABASE->Query( $QS );
$RBASE = new SQLite_DB( '/dev/shm/argus/mem_db.db');
@ -236,8 +232,7 @@
$Data['success'] = true;
break;
};
case 24:{
// Finish Study Frozen
case 24:{// Finish Study Frozen
$RBASE = new SQLite_DB( '/dev/shm/argus/mem_db.db');
$QS = "INSERT INTO `nodes_qcq`(`node_id`,`cmd`,`status`,`parameter`) VALUES({$CN['id']},1,0,'')";
$RBASE->Query( $QS, false );
@ -245,15 +240,13 @@
$Data['success'] = true;
break;
};
case 25:{
// Set ACK masking Shape
case 25:{// Set ACK masking Shape
$OPCODE = intval( $_POST['OPCODE'] );
$QS = "UPDATE `lrf_sensors` SET `ack_mask_type`={$OPCODE} WHERE `id`={$SNID}";
$Data['success'] = true;
break;
};
case 26:{
// Set ACK masking Size
case 26:{// Set ACK masking Size
$OPCODE = intval( $_POST['OPCODE'] );
$SIZES = array( 10, 20, 30, 40, 50, 60, 70 );
$VAL = $SIZES[$OPCODE] / 1;
@ -261,27 +254,60 @@
$Data['success'] = true;
break;
};
case 27:{
// Enable Relay Mode
case 27:{// Enable Relay Mode
$OPCODE = intval( $_POST['OPCODE'] );
$QS = "UPDATE `lrf_sensors` SET `dc_auto`={$OPCODE} WHERE `id`={$SNID}";
$Data['success'] = true;
break;
};
case 28:{
// Set Relay Mode
case 28:{// Set Relay Mode
$OPCODE = intval( $_POST['OPCODE'] );
$QS = "UPDATE `lrf_sensors` SET `dc_no`={$OPCODE} WHERE `id`={$SNID}";
$Data['success'] = true;
break;
};
case 29:{
// Set Relay Delay
case 29:{// Set Relay Delay
$OPCODE = intval( $_POST['OPCODE'] );
$QS = "UPDATE `lrf_sensors` SET `dc_window`={$OPCODE} WHERE `id`={$SNID}";
$Data['success'] = true;
break;
};
case 30:{//X-Axis Rotation
$OPCODE = floatval( $_POST['OPCODE'] );
$QS = "UPDATE `lrf_sensors` SET `x_rot`={$OPCODE} WHERE `id`={$SNID}";
$Data['success'] = true;
break;
};
case 31:{//Y-Axis Rotation
$OPCODE = floatval( $_POST['OPCODE'] );
$QS = "UPDATE `lrf_sensors` SET `y_rot`={$OPCODE} WHERE `id`={$SNID}";
$Data['success'] = true;
break;
};
case 32:{//Z-Axis Rotation
$OPCODE = floatval( $_POST['OPCODE'] );
$QS = "UPDATE `lrf_sensors` SET `z_rot`={$OPCODE} WHERE `id`={$SNID}";
$Data['success'] = true;
break;
};
case 33:{//X-Shift From Anchore
$OPCODE = floatval( $_POST['OPCODE'] );
$QS = "UPDATE `lrf_sensors` SET `x`={$OPCODE} WHERE `id`={$SNID}";
$Data['success'] = true;
break;
};
case 34:{//Y-Shift From Anchore
$OPCODE = floatval( $_POST['OPCODE'] );
$QS = "UPDATE `lrf_sensors` SET `y`={$OPCODE} WHERE `id`={$SNID}";
$Data['success'] = true;
break;
};
case 35:{//Z-Shift From Anchore
$OPCODE = floatval( $_POST['OPCODE'] );
$QS = "UPDATE `lrf_sensors` SET `z`={$OPCODE} WHERE `id`={$SNID}";
$Data['success'] = true;
break;
};
case 255:{
// Delete Sensor
$NID = $CN['id'];

13
lib/controller/getReportLayout.php

@ -5,8 +5,11 @@
if( $UID > 1 ){
$QS = "SELECT * FROM `system_props` LIMIT 1";
$SPD = $DATABASE->Query( $QS );
$QS = "SELECT * FROM `users` WHERE `id`={$UID}";
$EPD = $DATABASE->Query( $QS );
if( count( $SPD ) ){
$SP = $SPD[0];
$UP = $EPD[0];
$DUMMY = array();
if( $CUser->Data['access'] > 5 ){
$TABA =<<<_DATA_BOUNDARY
@ -210,8 +213,14 @@ _DATA_BOUNDARY;
} else {
$STA[0]="{ columnWidth: .5, stylse:'padding:10px 0 10px 10px', items:[";
$STA[1]="{ columnWidth: .5, stylse:'padding:10px 0 10px 10px', items:[";
$STA[2]="{ columnWidth: .33, stylse:'padding:10px 0 10px 10px', items:[";
$STA[3]="{ columnWidth: .67, stylse:'padding:10px 0 10px 10px', items:[";
if( $UP['width'] > 1.6* $UP['height'] ){
$STA[2]="{ columnWidth: .33, stylse:'padding:10px 0 10px 10px', items:[";
$STA[3]="{ columnWidth: .67, stylse:'padding:10px 0 10px 10px', items:[";
} else {
$STA[2]="{ columnWidth: .45, stylse:'padding:10px 0 10px 10px', items:[";
$STA[3]="{ columnWidth: .55, stylse:'padding:10px 0 10px 10px', items:[";
};
$OUT[]= $STA[0] . $MAPIO . $END;
$QS = "SELECT * FROM `nodes` WHERE `type`>9 AND `type`< 14 AND `enable`=1";
$R = $DATABASE->Query( $QS );

110
lib/controller/getSensorDetectionEditor.php

@ -20,6 +20,9 @@
// Dual LRF Device (ALS)
$AD = $JJR[1];
};
$DD['dc_auto'] = intval( $DD['dc_auto'] );
$DD['dc_no'] = intval( $DD['dc_no'] );
$DD['dc_window'] = intval( $DD['dc_window'] );
$SOK = true;
} else {
$MSG = 'The Sensor ID is Wrong!';
@ -44,7 +47,55 @@
}
}
_DATA_BOUNDARY;
$SLRFDET=<<<_DATA_BOUNDARY
,{
xtype: 'panel',
id: 'up_sse_popanel',
border: true,
title: '{$Labels->GetLabel('_SLV_LRF_DET_SET_')}',
frame: false,
labelWidth: 150,
labelAlign: 'right',
layout: 'form',
height: PanelH-42,
items:[{
xtype: 'numberfield',
id: 's_order',
fieldLabel: 'Order',
value: '{$AD['order']}'
},{
xtype: 'numberfield',
id: 's_offset',
fieldLabel: 'Offset',
value: '{$AD['offset']}'
},{
xtype: 'numberfield',
id: 's_delta',
fieldLabel: 'Delta',
value: '{$AD['delta']}'
},{
xtype: 'numberfield',
id: 's_flip',
fieldLabel: 'Flip',
value: '{$AD['flip']}'
},{
xtype: 'numberfield',
id: 's_width',
fieldLabel: 'Width',
value: '{$AD['width']}'
},{
xtype: 'numberfield',
id: 's_sst',
fieldLabel: 'SST',
value: '{$AD['sst']}'
},{
xtype: 'numberfield',
id: 's_sun',
fieldLabel: 'Sun',
value: '{$AD['sun']}'
}]
}
_DATA_BOUNDARY;
$TPL=<<<_DATA_BOUNDARY
{
xtype: 'tabpanel',
@ -148,53 +199,7 @@ _DATA_BOUNDARY;
fieldLabel: 'Sun',
value: '{$SD['sun']}'
}]
},{
xtype: 'panel',
id: 'up_sse_popanel',
border: true,
title: '{$Labels->GetLabel('_SLV_LRF_DET_SET_')}',
frame: false,
labelWidth: 150,
labelAlign: 'right',
layout: 'form',
height: PanelH-42,
items:[{
xtype: 'numberfield',
id: 's_order',
fieldLabel: 'Order',
value: '{$AD['order']}'
},{
xtype: 'numberfield',
id: 's_offset',
fieldLabel: 'Offset',
value: '{$AD['offset']}'
},{
xtype: 'numberfield',
id: 's_delta',
fieldLabel: 'Delta',
value: '{$AD['delta']}'
},{
xtype: 'numberfield',
id: 's_flip',
fieldLabel: 'Flip',
value: '{$AD['flip']}'
},{
xtype: 'numberfield',
id: 's_width',
fieldLabel: 'Width',
value: '{$AD['width']}'
},{
xtype: 'numberfield',
id: 's_sst',
fieldLabel: 'SST',
value: '{$AD['sst']}'
},{
xtype: 'numberfield',
id: 's_sun',
fieldLabel: 'Sun',
value: '{$AD['sun']}'
}]
},{
}%%%SLAVE_LRF_DET%%%,{
title: '{$Labels->GetLabel('_DET_SET_WIDTH_T_')}',
height: PanelH-42,
tbar:[{
@ -207,8 +212,7 @@ _DATA_BOUNDARY;
text: '{$Labels->GetLabel('_DEL_SELECTED_')}',
disabled: true,
id: 'del_btn_width_table',
handler: function(){
}
handler: deleteWTRow
}],
layout:'fit',
items:{
@ -288,7 +292,11 @@ _DATA_BOUNDARY;
%%%JUMPAPA%%%
}
_DATA_BOUNDARY;
if( $DD['type'] != 1 ){
$TPL = str_replace('%%%SLAVE_LRF_DET%%%', '', $TPL );
} else {
$TPL = str_replace('%%%SLAVE_LRF_DET%%%', $SLRFDET, $TPL );
};
if( $FOK && $SOK ){
$TPL = str_replace('%%%JUMPAPA%%%', '', $TPL );
} else {

98
lib/controller/getSensorEditor.php

@ -531,16 +531,98 @@ JOJOKA;
height: PanelH - 283,
items:[{
xtype: 'panel',
id: 'loc_ed_map',
id: 'sens_posrot',
height: PanelH - 283,
html: '&nbsp;',
listeners: {
afterrender: function(p){
//var W=p.getWidth(); p.setHeight( 32+(W/16)*9);
//initMapMonitoring();
loadLocationEditor( 'loc_ed_map', {$CR['type']}, {$CR['id']} );
layout: 'table',
frame: false,
border: false,
layoutConfig: {
columns: 3
},
defaults: {
frame: false,
bodyStyle: 'padding:10px',
border: false
},
items:[{
html: '<table ><tr><td>{$Labels->GetLabel('_AXIS_ROT_')}</td><td><img width="32" src="/style/wicons/rotate-axis-x-512.png"></td></tr></table>'
},{
xtype: 'numberfield',
decimalPrecision: 3,
value: {$CR['x_rot']},
listeners:{
change: function( a, c, b ){
doSensorOperation( {$CR['id']}, 30, c );
}
}
},{
html: '&nbsp;'
},{
html: '<table ><tr><td>{$Labels->GetLabel('_AXIS_ROT_')}</td><td><img width="32" src="/style/wicons/rotate-axis-y-512.png"></td></tr></table>'
},{
xtype: 'numberfield',
decimalPrecision: 3,
value: {$CR['y_rot']},
listeners:{
change: function( a, c, b ){
doSensorOperation( {$CR['id']}, 31, c );
}
}
},{
html: '&nbsp;'
},{
html: '<table ><tr><td>{$Labels->GetLabel('_AXIS_ROT_')}</td><td><img width="32" src="/style/wicons/rotate-axis-z-512.png"></td></tr></table>'
},{
xtype: 'numberfield',
decimalPrecision: 3,
value: {$CR['z_rot']},
listeners:{
change: function( a, c, b ){
doSensorOperation( {$CR['id']}, 32, c );
}
}
},{
html: '&nbsp;'
},{
html: '<table ><tr><td>Δ {$Labels->GetLabel('_FROM_ANCH_')}</td><td><img width="32" src="/style/wicons/rotate-position-x-512.png"></td></tr></table>'
},{
xtype: 'numberfield',
decimalPrecision: 3,
value: {$CR['x']},
listeners:{
change: function( a, c, b ){
doSensorOperation( {$CR['id']}, 33, c );
}
}
}
},{
html: '&nbsp;'
},{
html: '<table ><tr><td>Δ {$Labels->GetLabel('_FROM_ANCH_')}</td><td><img width="32" src="/style/wicons/rotate-position-y-512.png"></td></tr></table>'
},{
xtype: 'numberfield',
decimalPrecision: 3,
value: {$CR['y']},
listeners:{
change: function( a, c, b ){
doSensorOperation( {$CR['id']}, 34, c );
}
}
},{
html: '&nbsp;'
},{
html: '<table ><tr><td>Δ {$Labels->GetLabel('_FROM_ANCH_')}</td><td><img width="32" src="/style/wicons/rotate-position-z-512.png"></td></tr></table>'
},{
xtype: 'numberfield',
decimalPrecision: 3,
value: {$CR['z']},
listeners:{
change: function( a, c, b ){
doSensorOperation( {$CR['id']}, 35, c );
}
}
},{
html: '&nbsp;'
}]
}]
},{
xtype: 'panel',

23
lib/controller/updateMap.php

@ -6,14 +6,16 @@
if( $ok==0 ){
http_response_code(400);
};
die(json_encode(["ok"=>$ok, "info"=>$info]));
die(json_encode(["success"=>true, "ok"=>$ok, "info"=>$info]));
};
header('content-type text/html;');
if( $CUser->Data['id'] > 1 ){
$MID = intval( $_POST['MID'] );
if( $MID ){
$QS = "SELECT * FROM `location_maps` WHERE `id`={$MID}";
$DDD = $DATABASE->Query( $QS );
if( count( $DDD ) ){
$BM = intval( $_POST['bounds_mode'] );
$MD = $DDD[0];
list( $width, $height, $type, $attr ) = getimagesize( $SYSPath . 'lib/controller/data/assets/images/' . $MD['layer_url'] );
$ENAME = $DATABASE->escape($_POST['map_name']);
@ -29,11 +31,20 @@
$BB = intval( $_POST['map_bpb'] );
$K_X = $MA_WI / ( $width - $LB - $RB );
$K_Y = $MA_HE / ( $height - $TB - $BB );
$IBLX = (-$LB)*$K_X;
$IBLY = (-$TB)*$K_Y;
$IBRX = ( $width + $RB ) * $K_X;
$IBRY = ( $height + $BB ) * $K_Y;
$QS = "UPDATE `location_maps` SET `name`='{$ENAME}',`desc`='{$EDESC}', `maxNativeZoom`={$INZOOM},`maxZoom`={$IZOOM}, `attribution`='{$EATTR}',`bounds_lx`={$IBLX},`bounds_ly`={$IBLY}, `bounds_rx`={$IBRX},`bounds_ry`={$IBRY}, `img_w`={$width}, `img_h`={$height}, `img_lb`={$LB}, `img_rb`={$RB}, `img_tb`={$TB},`img_bb`={$BB}, `img_map_w`={$MA_WI}, `img_map_h`={$MA_HE} WHERE `id`={$MID}";
if( $BM ){
$THW = (($width + $RB + $LB) * $K_X ) / 2.0;
$THH = (($height + $BB + $TB) * $K_Y ) / 2.0;
$IBLX = -$THW;
$IBLY = -$THH;
$IBRX = $THW;
$IBRY = $THH;
} else {
$IBLX = (-$LB)*$K_X;
$IBLY = (-$TB)*$K_Y;
$IBRX = ( $width + $RB ) * $K_X;
$IBRY = ( $height + $BB ) * $K_Y;
};
$QS = "UPDATE `location_maps` SET `name`='{$ENAME}',`desc`='{$EDESC}', `maxNativeZoom`={$INZOOM},`maxZoom`={$IZOOM}, `attribution`='{$EATTR}',`bounds_lx`={$IBLX},`bounds_ly`={$IBLY}, `bounds_rx`={$IBRX},`bounds_ry`={$IBRY}, `img_w`={$width}, `img_h`={$height}, `img_lb`={$LB}, `img_rb`={$RB}, `img_tb`={$TB},`img_bb`={$BB}, `img_map_w`={$MA_WI}, `img_map_h`={$MA_HE}, `bounds_mode`={$BM} WHERE `id`={$MID}";
$DATABASE->Query( $QS );
verbose( 1, "ALL IS OK" );
} else verbose( 0, "WRONG MAPID" );

13
lib/controller/validateUserSession.php

@ -1,6 +1,19 @@
<?php
require_once('../ajax_asm.php');
if( $CUser->Data['id'] > 1 ){
//Check Time Sync
$MTS = time();
$CTS = intval( $_POST['CTS'] );
// If difference more then 2 minutes
if( abs( $MTS-$CTS ) > 120 ){
//Push Kernel Command -> Sync Time
$RBASE = new SQLite_DB( '/dev/shm/argus/mem_db.db');
$QS = "INSERT INTO `nodes_qcq`(`node_id`,`cmd`,`status`,`parameter`) VALUES(1,252,0,'{$CTS}')";
$RBASE->Query( $QS, false );
// Logout user to perform time sync
echo "{'sessionIsValid': false }";
exit();
};
echo "{'sessionIsValid': true }";
} else {
echo "{'sessionIsValid': false }";

33
lib/javascript/jsapi_dynamic/mojo_dashboard.js

@ -874,13 +874,14 @@ function draw2DMasks( a, zzz='' ){
masks_2d_shown[a] = [];
var cpath = csvg.getElementById( "svg_mask_"+a );
var bBox;
//if( cpath!=undefined){
// bBox = cpath.getBBox();
//} else {
if( cpath!=undefined ){
bBox = cpath.getBBox();
} else {
bBox = csvg.getBBox();
//};
};
var colors=['#FF0000','#FFFF00','#00FF00','#203080','#0000FF','#FFFF00'];
for( i = 0; i<6; i++){
for( i = 0; i < 6; i++ ){
masks_2d_shown[a][i] = [];
if( masks_2d[a][i].vtx != undefined ){
//console.log( '0 box: '+ bBox.width+'x'+bBox.height );
@ -902,26 +903,25 @@ function draw2DMasks( a, zzz='' ){
newpath.setAttributeNS(null, "points", pp );
newpath.setAttributeNS(null, "fill",colors[i] );
if( i < 5 ){
if( i < 5 ){ // if regular mask - transparency
if( masks_2d[a][i].status ){
newpath.setAttributeNS(null, "fill-opacity", "0.6");
} else {
newpath.setAttributeNS(null, "fill-opacity", "0.2");
};
} else {
} else { // Olways ON
newpath.setAttributeNS(null, "fill-opacity", "1.0");
};
newpath.setAttributeNS(null, "id", "mask_"+a+"_"+i+"_"+k );
newpath.setAttributeNS(null, "clip-path", "url(#svg_mask_"+a+")" );
var tch = csvg.getElementById( "border_"+a );
if( 0 && tch != undefined ){
if( tch != undefined ){
csvg.insertBefore( newpath, tch );
} else {
csvg.appendChild( newpath );
};
masks_2d_shown[a][i][k] = 1;
};
};
};
};
@ -974,11 +974,12 @@ function draw2DDraw( a, zzz = '' ){
if( csvg != undefined ){
var cpath = csvg.getElementById( "svg_mask_"+a );
var bBox;
//if( cpath!=undefined){
// bBox = cpath.getBBox();
//} else {
if( cpath!=undefined){
bBox = cpath.getBBox();
} else {
bBox = csvg.getBBox();
//};
};
//alert( '0 box: '+ bBox.width+'x'+bBox.height );
var newpath = document.createElementNS('http://www.w3.org/2000/svg', "polygon");
var ak = 2.0*Math.PI/draws_2d[a].length;
//console.log( '1 box: '+ bBox.width+'x'+bBox.height );
@ -1202,7 +1203,11 @@ function setDonatStatus( node_id, param_id, value ){
var per3 = val3/total*100;
var offset = 25;
if( ( val1 != undefined ) && ( value > -1 ) ){
totalValue.textContent = val1+'%';
if( param_id < 3 ){
totalValue.textContent = val1+'%';
} else {
totalValue.textContent = val1+'°C';
}
} else {
totalValue.textContent = 'No Data';
};

2
lib/javascript/jsapi_dynamic/mojo_global_vars.js

@ -14,7 +14,7 @@ var content_lvl0= -1;
var content_lvl1= -1;
var content_lvl2= -1;
var content_lvl3= -1;
var SoundMode = 2;
var SoundMode=<?=intval($CUser->Data['sound_enable']);?>;
var PanelW = winW;
var PanelH = winH-90;
var SelectedSite = <?=$SiteID;?>;

9
lib/javascript/jsapi_dynamic/mojo_main.js

@ -184,11 +184,13 @@ function updateUserContent(){
var gSessionValidatorInterval = null;
function sessionValidator(){
var cTS = (new Date())/1000;
Ext.Ajax.request({
url: '/lib/controller/validateUserSession.php',
params: {
UID: <?=$UserID;?>,
SID: '<?=$Session;?>'
SID: '<?=$Session;?>',
CTS: cTS
},
success: function( response, opts ){
var data = Ext.decode(response.responseText);
@ -437,11 +439,14 @@ Ext.onReady(function(){
handler: function(){
if( SoundMode == 0 ){
SoundMode = 3;
SoundEnable = true;
} else {
SoundMode --;
SoundMode --;
if( SoundMode == 0 ) SoundEnable = false;
};
Ext.getCmp('snd_mode_btn').setIconClass( 'snd'+SoundMode );
playSound();
doApplicationOperation( 6, SoundMode );
}
},{
xtype: 'spacer',

51
lib/javascript/jsapi_dynamic/mojo_map.js

@ -1315,6 +1315,7 @@ function createNewMap(){
xtype: 'form',
title: '<?=$Labels->GetLabel('_INTER_MAP_');?>',
id: 'map_map_frm',
fileUpload: true,
labelWidth: 250,
labelAlign: 'right',
height: 450,
@ -1507,9 +1508,8 @@ function createNewMap(){
},{
xtype: 'radio',
name: 'bounds_mode',
value: 0,
checked: 1,
fieldLabel: '',
inputValue: 0,
checked: 1
},{
width: 80,
html: '<img src="/style/assets/cust_map_cord_sys-0.png">'
@ -1517,8 +1517,7 @@ function createNewMap(){
xtype: 'radio',
name: 'bounds_mode',
checked: 0,
value: 1,
fieldLabel: '',
inputValue: 1
},{
html: '<img src="/style/assets/cust_map_cord_sys-1.png">'
}]
@ -1677,25 +1676,28 @@ function editCurrentMap(){
if( tt.id == 'map_map_frm' ){
if( Ext.getCmp('map_map_frm').getForm().isValid()){
Ext.getCmp('map_map_frm').getForm().submit({
url: '/lib/controller/addMap.php',
waitMsg: 'Uploading Image...',
url: '/lib/controller/updateMap.php',
waitMsg: '<?=$Labels->GetLabel('_UPDATING_DATA_');?>...',
clientValidation: false,
encoding: 'multipart/form-data',
success: function(fp, o){
//msg('Success', 'Processed file "'+o.result.file+'" on the server');
//alert('Processed file on the server');
mapEditorWindow.destroy();
success: function(f,a){
alert('Processed file on the server1');
//mapEditorWindow.hide();
//mapEditorWindow.destroy();
}
});
};
} else {
if( Ext.getCmp('map_pic_frm').getForm().isValid()){
Ext.getCmp('map_pic_frm').getForm().submit({
url: '/lib/controller/addMap.php',
waitMsg: 'Uploading Image...',
url: '/lib/controller/updateMap.php',
clientValidation: false,
waitMsg: '<?=$Labels->GetLabel('_UPDATING_DATA_');?>...',
encoding: 'multipart/form-data',
success: function(fp, o){
//alert('Processed file on the server');
mapEditorWindow.destroy();
success: function( f, a ){
alert('Processed file on the server2');
//mapEditorWindow.hide();
//mapEditorWindow.destroy();
}
});
};
@ -1716,7 +1718,6 @@ function editCurrentMap(){
height: 540,
title: '<?=$Labels->GetLabel('_EDIT_CUR_MAP_');?>',
modal: true,
//closeAction: 'hide',
frame: true,
border: false,
resizable: false,
@ -1852,18 +1853,17 @@ function editCurrentMap(){
},{
xtype: 'radio',
name: 'bounds_mode',
value: 0,
checked: ( newMapData.bounds_mode == 0 ),
fieldLabel: '',
inputValue: 0,
checked: (newMapData.bounds_mode == 0)
},{
width: 80,
border: false,
html: '<img src="/style/assets/cust_map_cord_sys-0.png">'
},{
xtype: 'radio',
name: 'bounds_mode',
checked: ( newMapData.bounds_mode == 1 ),
value: 1,
fieldLabel: '',
inputValue: 1,
checked: (newMapData.bounds_mode != 0)
},{
html: '<img src="/style/assets/cust_map_cord_sys-1.png">'
}]
@ -1880,12 +1880,9 @@ function editCurrentMap(){
if( Ext.getCmp('map_edt_frm').getForm().isValid()){
Ext.getCmp('map_edt_frm').getForm().submit({
url: '/lib/controller/updateMap.php',
waitMsg: 'Uploading Image...',
waitMsg: '<?=$Labels->GetLabel('_UPDATING_DATA_');?>...',
encoding: 'multipart/form-data',
success: function(fp, o){
alert('Processed file on the server');
//msg('Success', 'Processed file "'+o.result.file+'" on the server');
//alert('Processed file on the server');
mapEditorWindow.destroy();
}
});

50
lib/javascript/jsapi_dynamic/mojo_settings.js

@ -103,14 +103,34 @@ var targetWidthTable_store = new Ext.data.ArrayStore({
]
});
var cWTRowSelected = null;
var WTSelectedSensor = 0;
var widthTableSelModel_ops = {
singleSelect: true,
listeners: {
rowselect: function( sm, row, rec ) {
cRowSelected = row;
cWTRowSelected = rec.data.id;
Ext.getCmp('del_btn_width_table').enable();
}
}
};
function deleteWTRow(){
Ext.Ajax.request({
url: '/lib/controller/delWidthTableRecord.php',
params: {
UID: <?=$UserID;?>,
SID: '<?=$Session;?>',
DID: WTSelectedSensor,
RID: cWTRowSelected
},
success: function( response, opts ){
Ext.getCmp('del_btn_width_table').disable();
loadWidthTable( WTSelectedSensor );
},
failure: failureAJAXFunction
});
};
var targetWidthTableColModel_ops = {
columns: [
{header: "<?=$Labels->GetLabel('_WIDTH_CORRECT_');?> (%)", width: 250, align: 'center', css: 'vertical-align: middle;', dataIndex: 'width' },
@ -131,6 +151,7 @@ function addWidthTableRecord( sensid ){
modal: true,
layout: 'form',
labelWidth: 150,
closeAction: 'hide',
labelAlign: 'right',
items:[{
xtype: 'numberfield',
@ -159,6 +180,7 @@ function addWidthTableRecord( sensid ){
NWW: tWidth
},
success: function( response, opts ){
widthTableAddDialog.hide();
loadWidthTable( sensid );
},
failure: failureAJAXFunction
@ -171,6 +193,7 @@ function addWidthTableRecord( sensid ){
};
function loadWidthTable( SensorID ){
WTSelectedSensor = SensorID;
Ext.Ajax.request({
url: '/lib/controller/getWidthTable.php',
params: {
@ -1951,30 +1974,30 @@ tPanel.add({
tabchange: function( tp, t ){
switch( t.getId() ){
case 'gi_tab': {
content_lvl3=0;
//content_lvl3=0;
updateServerStatus();
break;
};
case 'res_tab': {
content_lvl3=1;
//content_lvl3=1;
stopStatusUpdater();
loadRessources();
break;
};
case 'mod_tab':{
content_lvl3=2;
//content_lvl3=2;
stopStatusUpdater();
loadModules();
break;
};
case 'flt_tab':{
content_lvl3=3;
//content_lvl3=3;
stopStatusUpdater();
loadFilters();
break;
};
};
updateUserContent();
//updateUserContent();
},
afterrender: function(){
settingsAreChanged = false;
@ -2669,13 +2692,12 @@ function showSettingsApplication(){
},{
xtype: 'numberfield',
id: 'stor_days',
emptyText: '<?=$Labels->GetLabel('_SELE_DBBACKUP_');?>',
fieldLabel: '<?=$Labels->GetLabel('_STORE_DAYS_');?>',
width: 300,
value: <?=intval($AP_DATA['report_cleanup']);?>,
name: 'db_time',
name: 'stor_time',
listeners: {
onchange: function( t, b, o){
change: function( t, b, o ){
doApplicationOperation( 4, b );
}
}
@ -2685,12 +2707,14 @@ function showSettingsApplication(){
},{
xtype: 'slider',
id: 'stor_space',
fieldLabel: '<?=$Labels->GetLabel('_SELE_DBBACKUP_');?>',
fieldLabel: '<?=$Labels->GetLabel('_STORE_EMPTY_SPACE_');?>',
value: <?=intval($AP_DATA['preserve_empty']);?>,
width: 300,
name: 'db_space',
onchange: function( t, b, o){
doApplicationOperation( 5, b );
name: 'stor_space',
listeners: {
change: function( t, b, o ){
doApplicationOperation( 5, b );
}
}
},{
xtype: 'spacer',

Loading…
Cancel
Save