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.

223 lines
4.4 KiB

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