Web Interface For Lite Argus Control modules
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.

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