Browse Source

PP Check

master
Evgeny Gagua 3 years ago
parent
commit
625c255e83
  1. 2
      lib/1.json
  2. 50
      lib/controller/doMaskOperation.php
  3. 71
      lib/controller/doSensorOperation.php
  4. 86
      lib/controller/getSensorDetectionEditor.php
  5. 4
      lib/controller/getSensorEditor.php
  6. 18
      lib/controller/updateUserSettings.php
  7. 4
      lib/javascript/jsapi_dynamic/mojo_reports.js

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

50
lib/controller/doMaskOperation.php

@ -105,7 +105,10 @@
break;
};
case 4:{
// Default = 10x10 meters
$QS = "SELECT `ack_mask_type`, `ack_mask_size` FROM `lrf_sensors` WHERE `id`={$SenID}";
$LPP = $DATABASE->Query( $QS );
$TYP = intval( $LPP[0]['ack_mask_type'] );
$SIZE = intval( $LPP[0]['ack_mask_size'] ) / 2;
if( isset( $_POST['R'] ) ){
$RANGE = intval( $_POST['R'] );
} else {
@ -148,23 +151,34 @@
$QS = "INSERT INTO `lrf_mask_vertexes`(`mask_id`) VALUES({$CID})";
$DATABASE->Query( $QS );
$VID = $DATABASE->getLastInsertID();
$LX = $CX - ( 5*$PR);
$LY = $CY - ( 5*$PR);
$QS = "INSERT INTO `lrf_mask_vertex_points`(`vertex_id`,`x`,`y`) VALUES({$VID},{$LX},{$LY})";
$DATABASE->Query( $QS );
$LX = $CX + ( 5*$PR);
$LY = $CY - ( 5*$PR);
$QS = "INSERT INTO `lrf_mask_vertex_points`(`vertex_id`,`x`,`y`) VALUES({$VID},{$LX},{$LY})";
$DATABASE->Query( $QS );
$LX = $CX + ( 5*$PR);
$LY = $CY + ( 5*$PR);
$QS = "INSERT INTO `lrf_mask_vertex_points`(`vertex_id`,`x`,`y`) VALUES({$VID},{$LX},{$LY})";
$DATABASE->Query( $QS );
$LX = $CX - ( 5*$PR);
$LY = $CY + ( 5*$PR);
$QS = "INSERT INTO `lrf_mask_vertex_points`(`vertex_id`,`x`,`y`) VALUES({$VID},{$LX},{$LY})";
$DATABASE->Query( $QS );
if( $TYP == 0 ){
//Round
$LX = $CX - ( $SIZE*$PR);
$LY = $CY - ( $SIZE*$PR);
$QS = "INSERT INTO `lrf_mask_vertex_points`(`vertex_id`,`x`,`y`) VALUES({$VID},{$LX},{$LY})";
$DATABASE->Query( $QS );
$LX = $CX + ( $SIZE*$PR);
$LY = $CY - ( $SIZE*$PR);
$QS = "INSERT INTO `lrf_mask_vertex_points`(`vertex_id`,`x`,`y`) VALUES({$VID},{$LX},{$LY})";
$DATABASE->Query( $QS );
$LX = $CX + ( $SIZE*$PR);
$LY = $CY + ( $SIZE*$PR);
$QS = "INSERT INTO `lrf_mask_vertex_points`(`vertex_id`,`x`,`y`) VALUES({$VID},{$LX},{$LY})";
$DATABASE->Query( $QS );
$LX = $CX - ( $SIZE*$PR);
$LY = $CY + ( $SIZE*$PR);
$QS = "INSERT INTO `lrf_mask_vertex_points`(`vertex_id`,`x`,`y`) VALUES({$VID},{$LX},{$LY})";
$DATABASE->Query( $QS );
} else {
//Circle
$KLX = M_PI / 8;
for( $I = 0; $I < 16; $I++ ){
$LX = $CX + $SIZE*$PR*cos( $I*$KLX );
$LY = $CY + $SIZE*$PR*sin( $I*$KLX );
$QS = "INSERT INTO `lrf_mask_vertex_points`(`vertex_id`,`x`,`y`) VALUES({$VID},{$LX},{$LY})";
$DATABASE->Query( $QS );
};
};
$RBASE = new SQLite_DB( '/dev/shm/argus/mem_db.db');
$QS = "INSERT INTO `nodes_qcq`(`node_id`,`cmd`,`status`,`parameter`) VALUES({$NodeID}, 81,0,'')";
$Data['query'] = $QS;

71
lib/controller/doSensorOperation.php

@ -168,20 +168,30 @@
case 19:{
if( isset( $_POST['LRF'] ) ) $LRF = intval( $_POST['LRF'] ); else $LRF = 0;
if( isset( $_POST['PID'] ) ) $PID = intval( $_POST['PID'] ); else $PID = 0;
$ORD = intval( $_POST['ORD'] );
$OFF = intval( $_POST['OFF'] );
$SST = intval( $_POST['SST'] );
$FLI = intval( $_POST['FLI'] );
$SUN = intval( $_POST['SUN'] );
$WIZ = intval( $_POST['WIZ'] );
$DEL = intval( $_POST['DEL'] );
$QS = "INSERT INTO `lrf_detection_profiles`(`aux_id`,`profile_id`,`master`,`order`,`offset`,`delta`,`flip`,`width`,`sst`,`sun`,`gp`,`spikes`) VALUES({$SNID},{$PID},1,{$ORD},{$OFF},{$DEL},{$FLI},{$WIZ},{$SST},{$SUN},16,1 ) ON CONFLICT(`aux_id`,`lrf_id`,`master`) DO UPDATE SET `order`={$ORD},`offset`={$OFF},`delta`={$DEL},`flip`={$FLI},`width`={$WIZ},`sst`={$SST},`sun`={$SUN}";
$ORD = intval( $_POST['MORD'] );
$OFF = intval( $_POST['MOFF'] );
$SST = intval( $_POST['MSST'] );
$FLI = intval( $_POST['MFLI'] );
$SUN = intval( $_POST['MSUN'] );
$WIZ = intval( $_POST['MWIZ'] );
$DEL = intval( $_POST['MDEL'] );
$QS = "INSERT INTO `lrf_detection_profiles`(`aux_id`,`profile_id`,`master`,`order`,`offset`,`delta`,`flip`,`width`,`sst`,`sun`,`gp`,`spikes`) VALUES({$SNID},{$PID},1,{$ORD},{$OFF},{$DEL},{$FLI},{$WIZ},{$SST},{$SUN},16,1 ) ON CONFLICT(`aux_id`,`lrf_id`,`master`) DO UPDATE SET `order`={$ORD},`offset`={$OFF},`delta`={$DEL},`flip`={$FLI},`width`={$WIZ},`sst`={$SST},`sun`={$SUN}";
$DATABASE->Query( $QS, false );
$ORD = intval( $_POST['SORD'] );
$OFF = intval( $_POST['SOFF'] );
$SST = intval( $_POST['SSST'] );
$FLI = intval( $_POST['SFLI'] );
$SUN = intval( $_POST['SSUN'] );
$WIZ = intval( $_POST['SWIZ'] );
$DEL = intval( $_POST['SDEL'] );
$QS = "INSERT INTO `lrf_detection_profiles`(`aux_id`,`profile_id`,`master`,`order`,`offset`,`delta`,`flip`,`width`,`sst`,`sun`,`gp`,`spikes`) VALUES({$SNID},{$PID},0,{$ORD},{$OFF},{$DEL},{$FLI},{$WIZ},{$SST},{$SUN},16,1 ) ON CONFLICT(`aux_id`,`lrf_id`,`master`) DO UPDATE SET `order`={$ORD},`offset`={$OFF},`delta`={$DEL},`flip`={$FLI},`width`={$WIZ},`sst`={$SST},`sun`={$SUN}";
$DATABASE->Query( $QS, false );
//Parameter Send 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']},131,0,'')";
$RBASE->Query( $QS, false );
$QS='';
$Data['success'] = true;
break;
};
case 20:{
@ -190,6 +200,7 @@
$QS = "INSERT INTO `nodes_qcq`(`node_id`,`cmd`,`status`,`parameter`) VALUES({$CN['id']},130,0,'')";
$RBASE->Query( $QS, false );
$QS ='';
$Data['success'] = true;
break;
};
case 21:{
@ -200,6 +211,7 @@
$QS = "INSERT INTO `nodes_qcq`(`node_id`,`cmd`,`status`,`parameter`) VALUES({$CN['id']},130,0,'')";
$RBASE->Query( $QS, false );
$QS ='';
$Data['success'] = true;
break;
};
case 22:{
@ -210,6 +222,7 @@
$QS = "INSERT INTO `nodes_qcq`(`node_id`,`cmd`,`status`,`parameter`) VALUES({$CN['id']},130,0,'')";
$RBASE->Query( $QS, false );
$QS ='';
$Data['success'] = true;
break;
};
case 23:{
@ -220,6 +233,7 @@
$QS = "INSERT INTO `nodes_qcq`(`node_id`,`cmd`,`status`,`parameter`) VALUES({$CN['id']},130,0,'')";
$RBASE->Query( $QS, false );
$QS ='';
$Data['success'] = true;
break;
};
case 24:{
@ -228,15 +242,44 @@
$QS = "INSERT INTO `nodes_qcq`(`node_id`,`cmd`,`status`,`parameter`) VALUES({$CN['id']},1,0,'')";
$RBASE->Query( $QS, false );
$QS ='';
$Data['success'] = true;
break;
};
case 25:{
// Create Ack Masking
// Clear ACK Masking
// Select Current Events Targets
// Create Polygone
// Update Device masks
// 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
$OPCODE = intval( $_POST['OPCODE'] );
$SIZES = array( 10, 20, 30, 40, 50, 60, 70 );
$VAL = $SIZES[$OPCODE] / 1;
$QS = "UPDATE `lrf_sensors` SET `ack_mask_size`={$VAL} WHERE `id`={$SNID}";
$Data['success'] = true;
break;
};
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
$OPCODE = intval( $_POST['OPCODE'] );
$QS = "UPDATE `lrf_sensors` SET `dc_no`={$OPCODE} WHERE `id`={$SNID}";
$Data['success'] = true;
break;
};
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 255:{

86
lib/controller/getSensorDetectionEditor.php

@ -54,13 +54,20 @@ _DATA_BOUNDARY;
bbar:[{
text: 'Apply Settings',
handler: function(){
var oder = Ext.getCmp('ups_order').getValue();
var oset = Ext.getCmp('ups_offset').getValue();
var odel = Ext.getCmp('ups_delta').getValue();
var ofli = Ext.getCmp('ups_flip').getValue();
var owid = Ext.getCmp('ups_width').getValue();
var osst = Ext.getCmp('ups_sst').getValue();
var osun = Ext.getCmp('ups_sun').getValue();
var moder = Ext.getCmp('m_order').getValue();
var moset = Ext.getCmp('m_offset').getValue();
var model = Ext.getCmp('m_delta').getValue();
var mofli = Ext.getCmp('m_flip').getValue();
var mowid = Ext.getCmp('m_width').getValue();
var mosst = Ext.getCmp('m_sst').getValue();
var mosun = Ext.getCmp('m_sun').getValue();
var soder = Ext.getCmp('s_order').getValue();
var soset = Ext.getCmp('s_offset').getValue();
var sodel = Ext.getCmp('s_delta').getValue();
var sofli = Ext.getCmp('s_flip').getValue();
var sowid = Ext.getCmp('s_width').getValue();
var sosst = Ext.getCmp('s_sst').getValue();
var sosun = Ext.getCmp('s_sun').getValue();
Ext.Ajax.request({
url: '/lib/controller/doSensorOperation.php',
params: {
@ -68,18 +75,25 @@ _DATA_BOUNDARY;
SID: '{$Session}',
SNID: '{$SI}',
OPID: 19,
OFF: oset,
ORD: oder,
DEL: odel,
FLI: ofli,
WIZ: owid,
SST: osst,
SUN: osun
MOFF: moset,
MORD: moder,
MDEL: model,
MFLI: mofli,
MWIZ: mowid,
MSST: mosst,
MSUN: mosun,
SOFF: soset,
SORD: soder,
SDEL: sodel,
SFLI: sofli,
SWIZ: sowid,
SSST: sosst,
SSUN: sosun
},
success: function( response, opts ){
Ext.Msg.show({
title: 'Information',
msg: 'Settings are Saved',
title: '{$Labels->GetLabel('_INFO_')}',
msg: '{$Labels->GetLabel('_SARE_SAVED_')}',
buttons: Ext.Msg.OK,
icon: Ext.MessageBox.INFO
});
@ -148,37 +162,37 @@ _DATA_BOUNDARY;
xtype: 'numberfield',
id: 's_order',
fieldLabel: 'Order',
value: '{$SD['order']}'
value: '{$AD['order']}'
},{
xtype: 'numberfield',
id: 's_offset',
fieldLabel: 'Offset',
value: '{$SD['offset']}'
value: '{$AD['offset']}'
},{
xtype: 'numberfield',
id: 's_delta',
fieldLabel: 'Delta',
value: '{$SD['delta']}'
value: '{$AD['delta']}'
},{
xtype: 'numberfield',
id: 's_flip',
fieldLabel: 'Flip',
value: '{$SD['flip']}'
value: '{$AD['flip']}'
},{
xtype: 'numberfield',
id: 's_width',
fieldLabel: 'Width',
value: '{$SD['width']}'
value: '{$AD['width']}'
},{
xtype: 'numberfield',
id: 's_sst',
fieldLabel: 'SST',
value: '{$SD['sst']}'
value: '{$AD['sst']}'
},{
xtype: 'numberfield',
id: 's_sun',
fieldLabel: 'Sun',
value: '{$SD['sun']}'
value: '{$AD['sun']}'
}]
},{
title: '{$Labels->GetLabel('_DET_SET_WIDTH_T_')}',
@ -228,7 +242,16 @@ _DATA_BOUNDARY;
xtype: 'checkbox',
id: 'dc_ena',
fieldLabel: '{$Labels->GetLabel('_DC_AUTO_ENA_')}',
checked: true,
checked: {$DD['dc_auto']},
listeners:{
check: function( a, c ){
if( c ){
doSensorOperation( {$SI}, 27, 1, true );
} else {
doSensorOperation( {$SI}, 27, 0, true );
};
}
}
},{
xtype: 'combo',
fieldLabel: '{$Labels->GetLabel('_DC_WORK_MODE_')}',
@ -243,14 +266,23 @@ _DATA_BOUNDARY;
fields: ['sid', 'snam'],
data: [[0,'{$Labels->GetLabel('_DC_WM_NO_')}'], [1,'{$Labels->GetLabel('_DC_WM_NC_')}']]
}),
value: 0,
value: {$DD['dc_no']},
valueField: 'sid',
displayField: 'snam'
displayField: 'snam',listeners:{
select: function( a, c, b ){
doSensorOperation( {$SI}, 28, b, true );
}
}
},{
xtype: 'numberfield',
id: 'dc_window',
fieldLabel: '{$Labels->GetLabel('_DC_TIME_WINDOW_')}',
value: 2
value: {$DD['dc_window']},
listeners:{
change: function( a, c, b ){
doSensorOperation( {$SI}, 29, c, true );
}
}
}]
}]
%%%JUMPAPA%%%

4
lib/controller/getSensorEditor.php

@ -293,7 +293,7 @@ JOJOKA;
width: 200,
listeners:{
select: function( a, c, b ){
doSensorOperation( {$CR['id']}, 1, b, true );
doSensorOperation( {$CR['id']}, 25, b, true );
}
}
},{
@ -324,7 +324,7 @@ JOJOKA;
width: 200,
listeners:{
select: function( a, c, b ){
doSensorOperation( {$CR['id']}, 1, b, true );
doSensorOperation( {$CR['id']}, 26, b, true );
}
}
}]

18
lib/controller/updateUserSettings.php

@ -12,6 +12,24 @@
//$LOG->ScreenChanges( $CUser->Data['width'], $CUser->Data['height'], $WIDTH, $HEIGHT );
break;
};
case 20:{
$VOL = intval($_POST['VOL']);
$QS="UPDATE `users` SET `sound_enable`={$VOL} WHERE id={$CUser->Data['id']}";
$DATABASE->Query( $QS );
break;
};
case 21:{
$LAN = intval($_POST['LAN']);
$QS="UPDATE `users` SET `language`={$LAN} WHERE id={$CUser->Data['id']}";
$DATABASE->Query( $QS );
break;
};
case 21:{
$SS = intval($_POST['SS']);
$QS="UPDATE `users` SET `ss_timeout`={$LAN} WHERE id={$CUser->Data['id']}";
$DATABASE->Query( $QS );
break;
};
case 26:{
$CID = intval($_POST['CID']);
$QS="UPDATE `users` SET `last_content_view`={$CID} WHERE id={$CUser->Data['id']}";

4
lib/javascript/jsapi_dynamic/mojo_reports.js

@ -1526,7 +1526,7 @@ function loadReportDayTree( ts ){
width: '100%',
scale: 'large',
iconCls: 'reports_delete_btn',
text: 'Delete Selected',
text: '<?=$Labels->GetLabel('_BTN_CLR_SELECTED_');?>',
handler: function(){
}
<?php }; ?>
@ -1623,7 +1623,7 @@ function initReportsView(){
width: '100%',
scale: 'large',
iconCls: 'reports_delete_btn',
text: 'Clear All History'
text: '<?=$Labels->GetLabel('_BTN_CLR_AHIST_');?>'
<?php } else { ?>
height: PanelH - 30
<?php }; ?>

Loading…
Cancel
Save