|
|
<?php require_once('../ajax_asm.php'); if( $CUser->Data['id'] > 1 ){ $NodeID = intval($_POST['NID']); $SiteID = intval($_POST['SITE']); $QS = "SELECT * FROM nodes WHERE id={$NodeID}"; $Data = array(); $result = $DATABASE->Query( $QS, false ); if( count( $result ) ){ $T = $result[0]; $AID = $T['aux_id']; $QS = "SELECT * FROM lrf_sensors WHERE id={$AID}"; $result = $DATABASE->Query( $QS, false ); if( count($result) ){ $CS = $result[0]; $K['name'] = $T['name']; $K['data_status'] = intval( $CS['data_status'] ); $K['online'] = intval( $T['online']); switch( intval( $CS['type'] ) ){ case 1: case 2: case 3: case 4:{ $K['profile_id'] = intval( $CS['detection_profile_id'] ); $K['profiles'] = array(); $QS = "SELECT `id` FROM `lrf_detection_profiles` WHERE `aux_id`={$AID} and `lrf_id`=0 ORDER BY `profile_id`"; //error_log( $QS, 4 );
foreach( $DATABASE->Query( $QS ) as $Z ) $K['profiles'][] = intval($Z['id']); //if( $K['profile_id'] == 0 ) $K['profile_id'] = K['profiles'][0];
$QS = "SELECT * FROM `lrf_masks` WHERE `sensor_id`={$AID} ORDER BY `layer`"; $UU = $DATABASE->Query( $QS ); $LL = array( 'N', 'N', 'N', 'N', 'N' ); foreach( $UU as $U ) $LL[intval($U['layer'])] = $U['status']; $K['masks_array'] = $LL; $K['additional'] = ''; break; }; case 5: { $K['additional'] = <<<KAKU{ xtype: 'panel', layout: 'table', width: '100%', border: false, disabled: false, defaults: { border: false, frame: false }, layoutConfig: { columns: 9 }, items:[{ html: 'Draw Master LRF:' },{ xtype: 'button', text: '1', id: 'DMTH1', width: 16, enableToggle: true, toggleGroup: 'sh_mdraw_btn_grp', handler: function(){ doDeviceOperation( deviceCtrlNode, 3, '0:0' ); } },{ xtype: 'button', text: '2', id: 'DMTH2', width: 16, enableToggle: true, toggleGroup: 'sh_mdraw_btn_grp', handler: function(){ doDeviceOperation( deviceCtrlNode, 3, '0:1' ); } },{ xtype: 'button', text: '3', id: 'DMTH3', width: 16, enableToggle: true, toggleGroup: 'sh_mdraw_btn_grp', handler: function(){ doDeviceOperation( deviceCtrlNode, 3, '0:2' ); } },{ xtype: 'button', text: '4', id: 'DMTH4', width: 16, enableToggle: true, toggleGroup: 'sh_mdraw_btn_grp', handler: function(){ doDeviceOperation( deviceCtrlNode, 3, '0:3' ); } },{ xtype: 'button', text: '5', id: 'DMTH5', width: 16, enableToggle: true, toggleGroup: 'sh_mdraw_btn_grp', handler: function(){ doDeviceOperation( deviceCtrlNode, 3, '0:4' ); } },{ xtype: 'button', text: '6', id: 'DMTH6', width: 16, enableToggle: true, toggleGroup: 'sh_mdraw_btn_grp', handler: function(){ doDeviceOperation( deviceCtrlNode, 3, '0:5' ); } },{ xtype: 'button', text: '7', id: 'DMTH7', width: 18, enableToggle: true, toggleGroup: 'sh_mdraw_btn_grp', handler: function(){ doDeviceOperation( deviceCtrlNode, 3, '0:6' ); } },{ xtype: 'button', text: '8', id: 'DMTH8', width: 18, enableToggle: true, toggleGroup: 'sh_mdraw_btn_grp', handler: function(){ doDeviceOperation( deviceCtrlNode, 3, '0:7' ); } },{ html: 'Draw Slave LRF:' },{ xtype: 'button', text: '1', id: 'DSTH1', width: 16, enableToggle: true, toggleGroup: 'sh_sdraw_btn_grp' },{ xtype: 'button', text: '2', id: 'DSTH2', width: 16, enableToggle: true, toggleGroup: 'sh_sdraw_btn_grp' },{ xtype: 'button', text: '3', id: 'DSTH3', width: 16, enableToggle: true, toggleGroup: 'sh_sdraw_btn_grp' },{ xtype: 'button', text: '4', id: 'DSTH4', width: 16, enableToggle: true, toggleGroup: 'sh_sdraw_btn_grp' },{ xtype: 'button', text: '5', id: 'DSTH5', width: 16, enableToggle: true, toggleGroup: 'sh_sdraw_btn_grp' },{ xtype: 'button', text: '6', id: 'DSTH6', width: 16, enableToggle: true, toggleGroup: 'sh_sdraw_btn_grp' },{ xtype: 'button', text: '7', id: 'DSTH7', width: 18, enableToggle: true, toggleGroup: 'sh_sdraw_btn_grp' },{ xtype: 'button', text: '8', id: 'DSTH8', width: 18, enableToggle: true, toggleGroup: 'sh_sdraw_btn_grp' },{ colspan: 9, xtype: 'button', text: 'Mask Editor', id: 'DMED', width: '100%', handler: function(){ showMaskEditor( true, 1, deviceCtrlNode ); } }]}KAKU; break; }; }; $Data = $K; }; }; echo json_encode( $Data ); exit(); }; header('location: /');?>
|