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.

192 lines
5.4 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <?php
  2. require_once('../ajax_asm.php');
  3. if( $CUser->Data['id'] > 1 ){
  4. $EID = intval( $_POST['CID'] );
  5. $QS = "SELECT `sen`.*, `no`.`enable`, `no`.`name` FROM `lrf_sensors` `sen` LEFT JOIN `nodes` `no` ON( `no`.`aux_id`=`sen`.`id` AND `no`.`type`=`sen`.`type`) WHERE `sen`.`id`={$EID}";
  6. $Result = $DATABASE->Query( $QS, false );
  7. if( count( $Result ) ){
  8. $CR = $Result[0];
  9. $TTPL=<<<JOJOKA
  10. {
  11. xtype: 'panel',
  12. border: false,
  13. frame: false,
  14. items:[%%%ITEMS%%%]
  15. }
  16. JOJOKA;
  17. $ITEMS = array();
  18. switch( $CR['type'] ){
  19. case 1: $NAME = '<b>'.$CR['name'].'</b><br/>ALS ' . $Labels->getLabel('SENSOR'); break;
  20. case 2: $NAME = '<b>'.$CR['name'].'</b><br/>LGS ' . $Labels->getLabel('SENSOR'); break;
  21. case 3: $NAME = '<b>'.$CR['name'].'</b><br/>PLS200 ' . $Labels->getLabel('SENSOR'); break;
  22. case 4: $NAME = '<b>'.$CR['name'].'</b><br/>PLS360 ' . $Labels->getLabel('SENSOR'); break;
  23. default: $NAME = '<b>'.$CR['name'].'</b><br/>Unknown Sensor';
  24. };
  25. $INFO = '<table width="100%" border=0 style="font-weight: bold;"><tr><td width="130px" align="right">Serial:</td><td>'.(($CR['serial']!='')?$CR['serial']:'No Serial Defined').'</td></tr><tr><td align="right">Version:</td><td>'.(($CR['version']!='')?$CR['version']:'No Version Info').'</td></tr></table>';
  26. $ITEMS[0]="{ xtype:'panel', border: false, frame: false, html: '<table width=\"100%\" border=0 class=\"setEd_infoPanel\" id=\"SENSOR_".(($CR['enable']==1)?'A':'N')."\"><tr><td width=\"200px\"><div class=\"node_".$CR['type']."_img_sset\"></div></td><td valign=\"middle\">{$NAME}</td></tr><tr><td colspan=2>{$INFO}</td></tr></table><br/>'}";
  27. $QS="SELECT aux_id, device FROM resources WHERE ( type=1 OR type=129 )";
  28. $RR=$DATABASE->Query( $QS );
  29. if( count( $RR ) ){
  30. $RE=array();
  31. foreach( $RR as $R ){
  32. $RE[] = "[ {$R['aux_id']}, '{$R['device']}']";
  33. };
  34. $UARTS = implode( ',', $RE );
  35. } else {
  36. $UARTS = "[0, \"".$Labels->GetLabel('_NO_UARTS_DEF_')."\"]";
  37. };
  38. $ED =<<<kokakskhkajhskr
  39. {
  40. xtype: 'form',
  41. labelWidth: 160,
  42. border: false,
  43. frame: false,
  44. labelAlign: 'right',
  45. items:[{
  46. xtype: 'combo',
  47. id: 'sens_se',
  48. fieldLabel: "{$Labels->GetLabel('_SENS_STATUS_')}",
  49. lazyRender: true,
  50. mode: 'local',
  51. forceSelection: true,
  52. triggerAction: 'all',
  53. editable: false,
  54. disableKeyFilter: true,
  55. store: new Ext.data.ArrayStore({
  56. fields: ['mode','mode_txt'],
  57. data: [
  58. [0,'{$Labels->GetLabel('__DISABLED__')}'],
  59. [1,'{$Labels->GetLabel('___ENABLED__')}']
  60. ]
  61. }),
  62. valueField: 'mode',
  63. displayField: 'mode_txt',
  64. value: {$CR['enable']},
  65. width: 200,
  66. listeners:{
  67. select: function( a, c, b ){
  68. doSensorOperation( {$CR['id']}, 1, b, true );
  69. }
  70. }
  71. },{
  72. xtype: 'combo',
  73. id: 'sens_range',
  74. fieldLabel: "{$Labels->GetLabel('SENS_RANGE')}",
  75. lazyRender: true,
  76. mode: 'local',
  77. forceSelection: true,
  78. triggerAction: 'all',
  79. editable: false,
  80. disableKeyFilter: true,
  81. store: new Ext.data.ArrayStore({
  82. fields: ['range','range_txt'],
  83. data: [
  84. [15,'15 Meters'],
  85. [35,'35 Meters'],
  86. [45,'45 Meters'],
  87. [65,'65 Meters'],
  88. [75,'75 Meters'],
  89. [150,'150 Meters'],
  90. [200,'200 Meters'],
  91. [300,'300 Meters']
  92. ]
  93. }),
  94. valueField: 'range',
  95. displayField: 'range_txt',
  96. value: {$CR['max_range']},
  97. width: 200,
  98. listeners:{
  99. select: function( a, c, b ){
  100. doSensorOperation( {$CR['id']}, 2, b, true );
  101. }
  102. }
  103. },{
  104. xtype: 'numberfield',
  105. id: 'sens_id',
  106. fieldLabel: '{$Labels->GetLabel('_PROTO_DEVICE_ID_')}',
  107. width: 200,
  108. value: {$CR['device_id']},
  109. listeners:{
  110. change: function( a, c, b ){
  111. doSensorOperation( {$CR['id']}, 3, c, true );
  112. }
  113. }
  114. },{
  115. xtype: 'combo',
  116. fieldLabel: '{$Labels->GetLabel('_UART_PORT_')}',
  117. lazyRender: true,
  118. id: 'uart_id',
  119. mode: 'local',
  120. disabled: false,
  121. forceSelection: true, triggerAction: 'all', editable: false, disableKeyFilter: true,
  122. store: new Ext.data.ArrayStore({
  123. fields: ['uart','uart_txt'],
  124. data: [{$UARTS}]
  125. }),
  126. valueField: 'uart',
  127. displayField: 'uart_txt',
  128. value: {$CR['uart_id']},
  129. width: 200,
  130. listeners:{
  131. select: function( a, c, b ){
  132. doSensorOperation( {$CR['id']}, 4, c.data.uart, true );
  133. }
  134. }
  135. },{
  136. xtype: 'combo',
  137. id: 'ad_se',
  138. fieldLabel: "{$Labels->GetLabel('AUTO_DRAW')}",
  139. lazyRender: true,
  140. mode: 'local',
  141. forceSelection: true,
  142. triggerAction: 'all',
  143. editable: false,
  144. disableKeyFilter: true,
  145. store: new Ext.data.ArrayStore({
  146. fields: ['ad','ad_txt'],
  147. data: [
  148. [0,'{$Labels->GetLabel('__DISABLED__')}'],
  149. [10,'Each 10 Flips'],
  150. [20,'Each 20 Flips'],
  151. [30,'Each 30 Flips'],
  152. [40,'Each 40 Flips'],
  153. [50,'Each 50 Flips'],
  154. [100,'Each 100 Flips'],
  155. [200,'Each 200 Flips']
  156. ]
  157. }),
  158. valueField: 'ad',
  159. displayField: 'ad_txt',
  160. value: {$CR['auto_draw']},
  161. width: 200,
  162. listeners:{
  163. select: function( a, c, b ){
  164. doSensorOperation( {$CR['id']}, 5, b, true );
  165. }
  166. }
  167. },{
  168. xtype: 'numberfield',
  169. id: 'basesh_id',
  170. fieldLabel: '{$Labels->GetLabel('__ZERO_SHIFT__')}',
  171. width: 200,
  172. value: {$CR['base_shift']},
  173. listeners:{
  174. change: function( a, c, b ){
  175. doSensorOperation( {$CR['id']}, 6, c, true );
  176. }
  177. }
  178. }]
  179. }
  180. kokakskhkajhskr;
  181. $ITEMS[1] = $ED;
  182. $CONTENT = implode(',',$ITEMS);
  183. $TTPL = str_ireplace( '%%%ITEMS%%%', $CONTENT, $TTPL );
  184. echo $TTPL;
  185. } else {
  186. echo '{ xtype: \'panel\', html: \'Node '.$_POST['NODE'].' Loadded\'}';
  187. };
  188. } else {
  189. header('location: /');
  190. };
  191. ?>