13 changed files with 956 additions and 1 deletions
-
25lib/controller/addWidthTableRow.php
-
23lib/controller/getMaskSchedule.php
-
226lib/controller/getMaskScheduleEditor.php
-
252lib/controller/getNodeSettings.php
-
27lib/controller/getWidthTable.php
-
229lib/controller/getWidthTableEditor.php
-
3lib/controller/props/1_node_prop.js
-
8lib/controller/updateUserSssion.php
-
27lib/javascript/jsapi_dynamic/rgoose_main.js
-
93lib/javascript/jsapi_dynamic/rgoose_sysmap_editor.js
-
BINstyle/assets/mCamx4knTO6C4J_usFsMVw.png_500xaaaf.png
-
BINstyle/assets/mCamx4knTO6C4J_usFsMVw.spng_500xaf.png
-
44style/style.css
@ -0,0 +1,25 @@ |
|||
<?php |
|||
require_once('../ajax_asm.php'); |
|||
if( $CUser->Data['id'] > 1 ){ |
|||
if( isset( $_POST['NID'] ) ){ |
|||
$NID = intval( $_POST['NID'] ); |
|||
$SBM = ( $_POST['SBM'] == 'true' ); |
|||
$RNG = floatval( $_POST['RNG'] ); |
|||
$WDZ = floatval( $_POST['WDZ'] ) / 100.0; |
|||
if( $NID ){ |
|||
if( $SBM ){ |
|||
$QS = "SELECT `max_range` FROM `lrf_sensors` WHERE `id`={$NID}"; |
|||
$RR = $DATABASE->Query( $QS ); |
|||
$MR = floatval($RR[0]['max_range']); |
|||
$VAL = $RNG / $MR; |
|||
if( $VAL > 1.0 ) $VAL = 1.0; |
|||
} else { |
|||
$VAL = $RNG / 100.0; |
|||
if( $VAL > 1.0 ) $VAL = 1.0; |
|||
}; |
|||
$QS = "INSERT INTO `lrf_detection_width_tables` SET `aux_id`={$NID}, `width_k`={$WDZ}, `range_k`={$VAL}"; |
|||
$DATABASE->Query( $QS ); |
|||
}; |
|||
}; |
|||
}; |
|||
?>
|
|||
@ -0,0 +1,23 @@ |
|||
<?php |
|||
require_once('../ajax_asm.php'); |
|||
if( $CUser->Data['id'] > 1 ){ |
|||
if( isset( $_POST['NID'] ) ){ |
|||
$NID = intval( $_POST['NID'] ); |
|||
$QS = "SELECT * FROM `lrf_mask_schedule` WHERE `sensor_id`={$NID} ORDER BY `time`, `date`"; |
|||
$RR = $DATABASE->Query( $QS ); |
|||
if( count( $RR ) ){ |
|||
$Data['totalCount'] = count( $RR ); |
|||
$Data['rows'] = array(); |
|||
foreach( $RR as $R ){ |
|||
$CC['id'] = intval( $R['id'] ); |
|||
$CC['op_mask'] = intval( $R['op_mask'] ); |
|||
$CC['day_mask'] = intval( $R['day_mask'] ); |
|||
$Data['rows'][] = $CC; |
|||
}; |
|||
echo json_encode( $Data ); |
|||
} else { |
|||
echo "{ 'totalCount': 0, 'rows':[] }"; |
|||
}; |
|||
}; |
|||
}; |
|||
?>
|
|||
@ -0,0 +1,226 @@ |
|||
<?php |
|||
require_once('../ajax_asm.php'); |
|||
|
|||
if( $CUser->Data['id'] > 1 ){ |
|||
$EID = intval( $_POST['DID'] ); |
|||
$TPL =<<<EFUFU |
|||
{ |
|||
title: 'Mask Schedule Editor', |
|||
frame: true, |
|||
border: false, |
|||
xtype: 'editorgrid', |
|||
id: 'tw_grid', |
|||
cm: new Ext.grid.ColumnModel({ |
|||
columns: [ |
|||
{header: "1", tooltip:"First Mask", width: 22, sortable: false, fixed: true, menuDisabled: true, renderer: renderer_mask_0, dataIndex: 'op_mask' }, |
|||
{header: "2", width: 22, sortable: false, fixed: true, menuDisabled: true, renderer: renderer_mask_1, dataIndex: 'op_mask' }, |
|||
{header: "3", width: 22, sortable: false, fixed: true, menuDisabled: true, renderer: renderer_mask_2, dataIndex: 'op_mask' }, |
|||
{header: "4", width: 22, sortable: false, fixed: true, menuDisabled: true, renderer: renderer_mask_3, dataIndex: 'op_mask' }, |
|||
{header: "5", width: 22, sortable: false, fixed: true, menuDisabled: true, renderer: renderer_mask_4, dataIndex: 'op_mask' }, |
|||
|
|||
{header: "SA", tooltip:"Saturday", width: 32, sortable: false, fixed: true, menuDisabled: true, renderer: renderer_day_0, dataIndex: 'day_mask' }, |
|||
{header: "SU", tooltip:"Sunday", width: 32, sortable: false, fixed: true, menuDisabled: true, renderer: renderer_day_1, dataIndex: 'day_mask' }, |
|||
{header: "MO", tooltip:"Monday", width: 34, sortable: false, fixed: true, menuDisabled: true, renderer: renderer_day_2, dataIndex: 'day_mask' }, |
|||
{header: "TW", tooltip:"Twesday", width: 32, sortable: false, fixed: true, menuDisabled: true, renderer: renderer_day_3, dataIndex: 'day_mask' }, |
|||
{header: "WE", tooltip:"Wensday",width: 34, sortable: false, fixed: true, menuDisabled: true, renderer: renderer_day_4, dataIndex: 'day_mask' }, |
|||
{header: "TH", tooltip:"Thusday",width: 32, sortable: false, fixed: true, menuDisabled: true, renderer: renderer_day_5, dataIndex: 'day_mask' }, |
|||
{header: "FR", tooltip:"Friday",width: 32, sortable: false, fixed: true, menuDisabled: true, renderer: renderer_day_6, dataIndex: 'day_mask' }, |
|||
{header: '<img src="/style/icons/fam/bell.png">', tooltip:"Special Date", width: 32, sortable: false, fixed: true, menuDisabled: true, renderer: renderer_day_s, dataIndex: 'day_mask' }, |
|||
], |
|||
defaults: { |
|||
sortable: true, |
|||
menuDisabled: true, |
|||
width: 100 |
|||
}/*, |
|||
listeners: { |
|||
hiddenchange: function(cm, colIndex, hidden) { |
|||
//saveConfig(colIndex, hidden);
|
|||
} |
|||
}*/ |
|||
}), |
|||
sm: new Ext.grid.RowSelectionModel({ |
|||
singleSelect: true, |
|||
listeners: { |
|||
rowselect: function(sm, row, rec ) { |
|||
} |
|||
} |
|||
}), |
|||
ds: new Ext.data.JsonStore({ |
|||
root: 'rows', |
|||
totalProperty: 'totalCount', |
|||
idProperty: 'id', |
|||
autoLoad: true, |
|||
fields: [{ |
|||
name: 'id', |
|||
type: 'int' |
|||
},{ |
|||
name: 'op_mask', |
|||
type: 'int' |
|||
},{ |
|||
name: 'day_mask', |
|||
type: 'int' |
|||
}], |
|||
baseParams:{ |
|||
UID: {$UserID}, |
|||
SID: '{$Session}', |
|||
NID: {$EID} |
|||
}, |
|||
proxy: |
|||
new Ext.data.HttpProxy({ |
|||
method: 'POST', |
|||
noCache: false, |
|||
type: 'ajax', |
|||
prettyUrls: false, |
|||
url: '/lib/controller/getMaskSchedule.php' |
|||
}) |
|||
}), |
|||
tbar:[{ |
|||
text: 'Add Row', |
|||
handler: function(){ |
|||
var wiwin = new Ext.Window({ |
|||
title: 'Add Row', |
|||
width: 300, |
|||
height: 220, |
|||
modal: true, |
|||
layout: 'fit', |
|||
items:{ |
|||
xtype: 'form', |
|||
id: 'm_a_w_f', |
|||
border: false, |
|||
frame: true, |
|||
labelWidth: 160, |
|||
hideLabel: false, |
|||
items:[{ |
|||
xtype: 'radio', |
|||
fieldLabel: 'Range by Meters', |
|||
id: 'ra_ty_me', |
|||
name: 'ra_ra_ty', |
|||
checked: true, |
|||
listeners:{ |
|||
check: function( t, n ){ |
|||
if( n ){ |
|||
Ext.getCmp('ra_ra_vam').enable(); |
|||
Ext.getCmp('ra_ra_vap').disable(); |
|||
} else { |
|||
Ext.getCmp('ra_ra_vap').enable(); |
|||
Ext.getCmp('ra_ra_vam').disable(); |
|||
}; |
|||
} |
|||
} |
|||
},{ |
|||
xtype: 'radio', |
|||
fieldLabel: 'Range by Percents', |
|||
id: 'ra_ty_pe', |
|||
name: 'ra_ra_ty', |
|||
checked: false |
|||
},{ |
|||
xtype: 'numberfield', |
|||
id: 'ra_ra_vam', |
|||
fieldLabel: 'Range [m]', |
|||
hideLabel: false, |
|||
width: 60, |
|||
listeners:{ |
|||
change: function( t, n, o ){ |
|||
var cmm = Ext.getCmp('node_range').getValue() / 100; |
|||
if( cmm > 0 ){ |
|||
Ext.getCmp('ra_ra_vap').setValue( n / cmm ); |
|||
} else { |
|||
Ext.getCmp('ra_ra_vap').setValue( 0 ); |
|||
}; |
|||
} |
|||
} |
|||
},{ |
|||
xtype: 'numberfield', |
|||
id: 'ra_ra_vap', |
|||
fieldLabel: 'Range [%]', |
|||
hideLabel: false, |
|||
disabled: true, |
|||
minValue: 1, |
|||
maxValue: 100, |
|||
width: 60, |
|||
listeners:{ |
|||
change: function( t, n, o ){ |
|||
var cmm = Ext.getCmp('node_range').getValue() / 100; |
|||
if( cmm > 0 ){ |
|||
Ext.getCmp('ra_ra_vam').setValue( n * cmm ); |
|||
} else { |
|||
Ext.getCmp('ra_ra_vam').setValue( 0 ); |
|||
}; |
|||
} |
|||
} |
|||
},{ |
|||
xtype: 'numberfield', |
|||
id: 'wi_wi_va', |
|||
fieldLabel: 'Width [%]', |
|||
width: 60, |
|||
minValue: 1, |
|||
maxValue: 5000, |
|||
value: 100 |
|||
}] |
|||
}, |
|||
bbar:[{ |
|||
text: 'Cancel', |
|||
handler: function(){ |
|||
wiwin.close(); |
|||
} |
|||
},{ |
|||
text: 'Add', |
|||
handler: function(){ |
|||
var CT = Ext.getCmp('ra_ty_me').getValue(); |
|||
if( CT ){ |
|||
var CV = Ext.getCmp('ra_ra_vam').getValue(); |
|||
} else { |
|||
var CV = Ext.getCmp('ra_ra_vap').getValue(); |
|||
}; |
|||
var CW = Ext.getCmp('wi_wi_va').getValue(); |
|||
Ext.Ajax.request({ |
|||
url: '/lib/controller/addWidthTableRow.php', |
|||
params: { |
|||
UID: {$UserID}, |
|||
SID: '{$Session}', |
|||
NID: {$EID}, |
|||
SBM: CT, |
|||
RNG: CV, |
|||
WDZ: CW |
|||
}, |
|||
success: function( response, opts ){ |
|||
//get DS and reload!
|
|||
}, |
|||
failure: failureAJAXFunction |
|||
}); |
|||
} |
|||
}] |
|||
}); |
|||
wiwin.show(); |
|||
var cmm = Ext.getCmp('node_range').getValue(); |
|||
Ext.getCmp('ra_ra_vam').setRawValue( cmm ); |
|||
Ext.getCmp('ra_ra_vap').setRawValue( 100 ); |
|||
} |
|||
},{ |
|||
text: 'Remove Row', |
|||
handler: function(){ |
|||
|
|||
} |
|||
},{ |
|||
text: 'Clear Table', |
|||
handler: function(){ |
|||
|
|||
} |
|||
}] |
|||
} |
|||
EFUFU; |
|||
$TPL = str_ireplace( '%%%NAME%%%', $R_name, $TPL ); |
|||
$TPL = str_ireplace( '%%%INFO%%%', $R_dev, $TPL ); |
|||
$TPL = str_ireplace( '%%%SPD%%%', $Labels->GetLabel('UART_COM_SPEED'), $TPL ); |
|||
$TPL = str_ireplace( '%%%SPD_VAL%%%', $Z['speed'], $TPL ); |
|||
$TPL = str_ireplace( '%%%BITS_VAL%%%',$Z['bit'], $TPL ); |
|||
$TPL = str_ireplace( '%%%PARITY_VAL%%%',$Z['parity'], $TPL ); |
|||
$TPL = str_ireplace( '%%%STOPS_VAL%%%',$Z['stop_bit'], $TPL ); |
|||
$TPL = str_ireplace( '%%%%RES_ID%%%',$EID, $TPL ); |
|||
$TPL = str_ireplace( '%%%USER_ID%%%',$UserID, $TPL ); |
|||
$TPL = str_ireplace( '%%%SESSION%%%',$Session, $TPL ); |
|||
echo $TPL; |
|||
} else { |
|||
header('location: /'); |
|||
}; |
|||
?>
|
|||
@ -0,0 +1,27 @@ |
|||
<?php |
|||
require_once('../ajax_asm.php'); |
|||
if( $CUser->Data['id'] > 1 ){ |
|||
if( isset( $_POST['NID'] ) ){ |
|||
$NID = intval( $_POST['NID'] ); |
|||
$QS = "SELECT * FROM `lrf_detection_width_tables` WHERE `aux_id`={$NID} ORDER BY `range_k`"; |
|||
$RR = $DATABASE->Query( $QS ); |
|||
if( count( $RR ) ){ |
|||
$QS = "SELECT `max_range` FROM `lrf_sensors` WHERE `id`={$NID}"; |
|||
$ZZ = $DATABASE->Query( $QS ); |
|||
$MR = floatval( $ZZ[0]['max_range'] ); |
|||
$Data['totalCount'] = count( $RR ); |
|||
$Data['rows'] = array(); |
|||
foreach( $RR as $R ){ |
|||
$CC['id'] = intval( $R['id'] ); |
|||
$CC['width'] = intval( 100.0 * floatval($R['width_k'])); |
|||
$CC['range'] = intval( 100.0 * floatval($R['range_k'])); |
|||
$CC['range_m'] = intval( $MR * floatval($R['range_k']) ); |
|||
$Data['rows'][] = $CC; |
|||
}; |
|||
echo json_encode( $Data ); |
|||
} else { |
|||
echo "{ 'totalCount': 0, 'rows':[] }"; |
|||
}; |
|||
}; |
|||
}; |
|||
?>
|
|||
@ -0,0 +1,229 @@ |
|||
<?php |
|||
require_once('../ajax_asm.php'); |
|||
|
|||
if( $CUser->Data['id'] > 1 ){ |
|||
$EID = intval( $_POST['DID'] ); |
|||
$TPL =<<<EFUFU |
|||
{ |
|||
title: 'Width Table Editor', |
|||
frame: true, |
|||
border: false, |
|||
xtype: 'editorgrid', |
|||
id: 'tw_grid', |
|||
cm: new Ext.grid.ColumnModel({ |
|||
columns: [ |
|||
{header: "Width [%]", width: 100, sortable: false, menuDisabled: true, align: 'center', fixed: true, css: 'vertical-align: middle;', dataIndex: 'width' }, |
|||
{header: "Range [%]", width: 100, sortable: false, fixed: true, menuDisabled: true, /*renderer: camCapRenderer,*/ dataIndex: 'range' }, |
|||
{header: "Range [m]", width: 100, sortable: false, fixed: true, menuDisabled: true, /*renderer: camCapRenderer,*/ dataIndex: 'range_m' }, |
|||
], |
|||
defaults: { |
|||
sortable: true, |
|||
menuDisabled: true, |
|||
width: 100 |
|||
}/*, |
|||
listeners: { |
|||
hiddenchange: function(cm, colIndex, hidden) { |
|||
//saveConfig(colIndex, hidden);
|
|||
} |
|||
}*/ |
|||
}), |
|||
sm: new Ext.grid.RowSelectionModel({ |
|||
singleSelect: true, |
|||
listeners: { |
|||
rowselect: function(sm, row, rec ) { |
|||
//loadEventProperties( rec.data );
|
|||
//SelectedEvent = rec.data.id;
|
|||
//SelectedRow = row;
|
|||
//alert( SelectedEvent );
|
|||
//var CB = Ext.getCmp('con_to_src');
|
|||
//CB.enable();
|
|||
} |
|||
} |
|||
}), |
|||
ds: new Ext.data.JsonStore({ |
|||
root: 'rows', |
|||
totalProperty: 'totalCount', |
|||
idProperty: 'id', |
|||
autoLoad: true, |
|||
fields: [{ |
|||
name: 'id', |
|||
type: 'int' |
|||
},{ |
|||
name: 'width', |
|||
type: 'int' |
|||
},{ |
|||
name: 'range', |
|||
type: 'int' |
|||
},{ |
|||
name: 'range_m', |
|||
type: 'int' |
|||
}], |
|||
baseParams:{ |
|||
UID: {$UserID}, |
|||
SID: '{$Session}', |
|||
NID: {$EID} |
|||
}, |
|||
proxy: |
|||
new Ext.data.HttpProxy({ |
|||
method: 'POST', |
|||
noCache: false, |
|||
type: 'ajax', |
|||
prettyUrls: false, |
|||
url: '/lib/controller/getWidthTable.php', |
|||
headers: { |
|||
UIDZ: {$UserID}, |
|||
SIDZ: '{$Session}', |
|||
NIDZ: {$EID} |
|||
} |
|||
}) |
|||
}), |
|||
tbar:[{ |
|||
text: 'Add Row', |
|||
handler: function(){ |
|||
var wiwin = new Ext.Window({ |
|||
title: 'Add Row', |
|||
width: 300, |
|||
height: 220, |
|||
modal: true, |
|||
layout: 'fit', |
|||
items:{ |
|||
xtype: 'form', |
|||
id: 'm_a_w_f', |
|||
border: false, |
|||
frame: true, |
|||
labelWidth: 160, |
|||
hideLabel: false, |
|||
items:[{ |
|||
xtype: 'radio', |
|||
fieldLabel: 'Range by Meters', |
|||
id: 'ra_ty_me', |
|||
name: 'ra_ra_ty', |
|||
checked: true, |
|||
listeners:{ |
|||
check: function( t, n ){ |
|||
if( n ){ |
|||
Ext.getCmp('ra_ra_vam').enable(); |
|||
Ext.getCmp('ra_ra_vap').disable(); |
|||
} else { |
|||
Ext.getCmp('ra_ra_vap').enable(); |
|||
Ext.getCmp('ra_ra_vam').disable(); |
|||
}; |
|||
} |
|||
} |
|||
},{ |
|||
xtype: 'radio', |
|||
fieldLabel: 'Range by Percents', |
|||
id: 'ra_ty_pe', |
|||
name: 'ra_ra_ty', |
|||
checked: false |
|||
},{ |
|||
xtype: 'numberfield', |
|||
id: 'ra_ra_vam', |
|||
fieldLabel: 'Range [m]', |
|||
hideLabel: false, |
|||
width: 60, |
|||
listeners:{ |
|||
change: function( t, n, o ){ |
|||
var cmm = Ext.getCmp('node_range').getValue() / 100; |
|||
if( cmm > 0 ){ |
|||
Ext.getCmp('ra_ra_vap').setValue( n / cmm ); |
|||
} else { |
|||
Ext.getCmp('ra_ra_vap').setValue( 0 ); |
|||
}; |
|||
} |
|||
} |
|||
},{ |
|||
xtype: 'numberfield', |
|||
id: 'ra_ra_vap', |
|||
fieldLabel: 'Range [%]', |
|||
hideLabel: false, |
|||
disabled: true, |
|||
minValue: 1, |
|||
maxValue: 100, |
|||
width: 60, |
|||
listeners:{ |
|||
change: function( t, n, o ){ |
|||
var cmm = Ext.getCmp('node_range').getValue() / 100; |
|||
if( cmm > 0 ){ |
|||
Ext.getCmp('ra_ra_vam').setValue( n * cmm ); |
|||
} else { |
|||
Ext.getCmp('ra_ra_vam').setValue( 0 ); |
|||
}; |
|||
} |
|||
} |
|||
},{ |
|||
xtype: 'numberfield', |
|||
id: 'wi_wi_va', |
|||
fieldLabel: 'Width [%]', |
|||
width: 60, |
|||
minValue: 1, |
|||
maxValue: 5000, |
|||
value: 100 |
|||
}] |
|||
}, |
|||
bbar:[{ |
|||
text: 'Cancel', |
|||
handler: function(){ |
|||
wiwin.close(); |
|||
} |
|||
},{ |
|||
text: 'Add', |
|||
handler: function(){ |
|||
var CT = Ext.getCmp('ra_ty_me').getValue(); |
|||
if( CT ){ |
|||
var CV = Ext.getCmp('ra_ra_vam').getValue(); |
|||
} else { |
|||
var CV = Ext.getCmp('ra_ra_vap').getValue(); |
|||
}; |
|||
var CW = Ext.getCmp('wi_wi_va').getValue(); |
|||
Ext.Ajax.request({ |
|||
url: '/lib/controller/addWidthTableRow.php', |
|||
params: { |
|||
UID: {$UserID}, |
|||
SID: '{$Session}', |
|||
NID: {$EID}, |
|||
SBM: CT, |
|||
RNG: CV, |
|||
WDZ: CW |
|||
}, |
|||
success: function( response, opts ){ |
|||
//get DS and reload!
|
|||
}, |
|||
failure: failureAJAXFunction |
|||
}); |
|||
} |
|||
}] |
|||
}); |
|||
wiwin.show(); |
|||
var cmm = Ext.getCmp('node_range').getValue(); |
|||
Ext.getCmp('ra_ra_vam').setRawValue( cmm ); |
|||
Ext.getCmp('ra_ra_vap').setRawValue( 100 ); |
|||
} |
|||
},{ |
|||
text: 'Remove Row', |
|||
handler: function(){ |
|||
|
|||
} |
|||
},{ |
|||
text: 'Clear Table', |
|||
handler: function(){ |
|||
|
|||
} |
|||
}] |
|||
} |
|||
EFUFU; |
|||
$TPL = str_ireplace( '%%%NAME%%%', $R_name, $TPL ); |
|||
$TPL = str_ireplace( '%%%INFO%%%', $R_dev, $TPL ); |
|||
$TPL = str_ireplace( '%%%SPD%%%', $Labels->GetLabel('UART_COM_SPEED'), $TPL ); |
|||
$TPL = str_ireplace( '%%%SPD_VAL%%%', $Z['speed'], $TPL ); |
|||
$TPL = str_ireplace( '%%%BITS_VAL%%%',$Z['bit'], $TPL ); |
|||
$TPL = str_ireplace( '%%%PARITY_VAL%%%',$Z['parity'], $TPL ); |
|||
$TPL = str_ireplace( '%%%STOPS_VAL%%%',$Z['stop_bit'], $TPL ); |
|||
$TPL = str_ireplace( '%%%%RES_ID%%%',$EID, $TPL ); |
|||
$TPL = str_ireplace( '%%%USER_ID%%%',$UserID, $TPL ); |
|||
$TPL = str_ireplace( '%%%SESSION%%%',$Session, $TPL ); |
|||
echo $TPL; |
|||
} else { |
|||
header('location: /'); |
|||
}; |
|||
?>
|
|||
@ -0,0 +1,8 @@ |
|||
<?php |
|||
require_once('../ajax_asm.php'); |
|||
if( $CUser->Data['id'] > 1 ){ |
|||
echo "{'sessionIsValid': true }"; |
|||
} else { |
|||
echo "{'sessionIsValid': false }"; |
|||
}; |
|||
?>
|
|||
Binary file not shown.
|
After Width: 244 | Height: 354 | Size: 98 KiB |
Binary file not shown.
|
After Width: 244 | Height: 322 | Size: 83 KiB |
Write
Preview
Loading…
Cancel
Save
Reference in new issue