Web UI for ARGUS server
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

213 lines
4.4 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <?php
  2. require_once('../ajax_asm.php');
  3. if( $CUser->Data['id'] > 1 ){
  4. $NodeID = intval($_POST['NID']);
  5. $SiteID = intval($_POST['SITE']);
  6. $QS = "SELECT * FROM nodes WHERE id={$NodeID}";
  7. $Data = array();
  8. $result = $DATABASE->Query( $QS, false );
  9. if( count( $result ) ){
  10. $T = $result[0];
  11. $AID = $T['aux_id'];
  12. $QS = "SELECT * FROM lrf_sensors WHERE id={$AID}";
  13. $result = $DATABASE->Query( $QS, false );
  14. if( count($result) ){
  15. $CS = $result[0];
  16. $K['name'] = $T['name'];
  17. $K['data_status'] = intval( $CS['data_status'] );
  18. $K['online'] = intval( $T['online']);
  19. switch( intval( $CS['type_id'] ) ){
  20. case 1:
  21. case 2:
  22. case 3:
  23. case 4:{
  24. $K['profile_id'] = intval( $CS['detection_profile_id'] );
  25. $K['profiles'] = array();
  26. $QS = "SELECT `id` FROM `lrf_detection_profiles` WHERE `aux_id`={$AID} and `master`=b'1' ORDER BY `profile_id`";
  27. foreach( $DATABASE->Query( $QS ) as $Z ) $K['profiles'][] = intval($Z['id']);
  28. //if( $K['profile_id'] == 0 ) $K['profile_id'] = K['profiles'][0];
  29. $QS = "SELECT * FROM `lrf_masks` WHERE `sensor_id`={$AID} ORDER BY `layer`";
  30. $UU = $DATABASE->Query( $QS );
  31. $LL = array( 'N', 'N', 'N', 'N', 'N' );
  32. foreach( $UU as $U ) $LL[intval($U['layer'])] = $U['status'];
  33. $K['masks_array'] = $LL;
  34. $K['additional'] = '';
  35. break;
  36. };
  37. case 5: {
  38. $K['additional'] = <<<KAKU
  39. {
  40. xtype: 'panel',
  41. layout: 'table',
  42. width: '100%',
  43. border: false,
  44. disabled: false,
  45. defaults: {
  46. border: false,
  47. frame: false
  48. },
  49. layoutConfig: {
  50. columns: 9
  51. },
  52. items:[{
  53. html: 'Draw Master LRF:'
  54. },{
  55. xtype: 'button',
  56. text: '1',
  57. id: 'DMTH1',
  58. width: 16,
  59. enableToggle: true,
  60. toggleGroup: 'sh_mdraw_btn_grp',
  61. handler: function(){
  62. doDeviceOperation( deviceCtrlNode, 3, '0:0' );
  63. }
  64. },{
  65. xtype: 'button',
  66. text: '2',
  67. id: 'DMTH2',
  68. width: 16,
  69. enableToggle: true,
  70. toggleGroup: 'sh_mdraw_btn_grp',
  71. handler: function(){
  72. doDeviceOperation( deviceCtrlNode, 3, '0:1' );
  73. }
  74. },{
  75. xtype: 'button',
  76. text: '3',
  77. id: 'DMTH3',
  78. width: 16,
  79. enableToggle: true,
  80. toggleGroup: 'sh_mdraw_btn_grp',
  81. handler: function(){
  82. doDeviceOperation( deviceCtrlNode, 3, '0:2' );
  83. }
  84. },{
  85. xtype: 'button',
  86. text: '4',
  87. id: 'DMTH4',
  88. width: 16,
  89. enableToggle: true,
  90. toggleGroup: 'sh_mdraw_btn_grp',
  91. handler: function(){
  92. doDeviceOperation( deviceCtrlNode, 3, '0:3' );
  93. }
  94. },{
  95. xtype: 'button',
  96. text: '5',
  97. id: 'DMTH5',
  98. width: 16,
  99. enableToggle: true,
  100. toggleGroup: 'sh_mdraw_btn_grp',
  101. handler: function(){
  102. doDeviceOperation( deviceCtrlNode, 3, '0:4' );
  103. }
  104. },{
  105. xtype: 'button',
  106. text: '6',
  107. id: 'DMTH6',
  108. width: 16,
  109. enableToggle: true,
  110. toggleGroup: 'sh_mdraw_btn_grp',
  111. handler: function(){
  112. doDeviceOperation( deviceCtrlNode, 3, '0:5' );
  113. }
  114. },{
  115. xtype: 'button',
  116. text: '7',
  117. id: 'DMTH7',
  118. width: 18,
  119. enableToggle: true,
  120. toggleGroup: 'sh_mdraw_btn_grp',
  121. handler: function(){
  122. doDeviceOperation( deviceCtrlNode, 3, '0:6' );
  123. }
  124. },{
  125. xtype: 'button',
  126. text: '8',
  127. id: 'DMTH8',
  128. width: 18,
  129. enableToggle: true,
  130. toggleGroup: 'sh_mdraw_btn_grp',
  131. handler: function(){
  132. doDeviceOperation( deviceCtrlNode, 3, '0:7' );
  133. }
  134. },{
  135. html: 'Draw Slave LRF:'
  136. },{
  137. xtype: 'button',
  138. text: '1',
  139. id: 'DSTH1',
  140. width: 16,
  141. enableToggle: true,
  142. toggleGroup: 'sh_sdraw_btn_grp'
  143. },{
  144. xtype: 'button',
  145. text: '2',
  146. id: 'DSTH2',
  147. width: 16,
  148. enableToggle: true,
  149. toggleGroup: 'sh_sdraw_btn_grp'
  150. },{
  151. xtype: 'button',
  152. text: '3',
  153. id: 'DSTH3',
  154. width: 16,
  155. enableToggle: true,
  156. toggleGroup: 'sh_sdraw_btn_grp'
  157. },{
  158. xtype: 'button',
  159. text: '4',
  160. id: 'DSTH4',
  161. width: 16,
  162. enableToggle: true,
  163. toggleGroup: 'sh_sdraw_btn_grp'
  164. },{
  165. xtype: 'button',
  166. text: '5',
  167. id: 'DSTH5',
  168. width: 16,
  169. enableToggle: true,
  170. toggleGroup: 'sh_sdraw_btn_grp'
  171. },{
  172. xtype: 'button',
  173. text: '6',
  174. id: 'DSTH6',
  175. width: 16,
  176. enableToggle: true,
  177. toggleGroup: 'sh_sdraw_btn_grp'
  178. },{
  179. xtype: 'button',
  180. text: '7',
  181. id: 'DSTH7',
  182. width: 18,
  183. enableToggle: true,
  184. toggleGroup: 'sh_sdraw_btn_grp'
  185. },{
  186. xtype: 'button',
  187. text: '8',
  188. id: 'DSTH8',
  189. width: 18,
  190. enableToggle: true,
  191. toggleGroup: 'sh_sdraw_btn_grp'
  192. },{
  193. colspan: 9,
  194. xtype: 'button',
  195. text: 'Mask Editor',
  196. id: 'DMED',
  197. width: '100%',
  198. handler: function(){
  199. showMaskEditor( true, 1, deviceCtrlNode );
  200. }
  201. }]
  202. }
  203. KAKU;
  204. break;
  205. };
  206. };
  207. $Data = $K;
  208. };
  209. };
  210. echo json_encode( $Data );
  211. exit();
  212. };
  213. header('location: /');
  214. ?>