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.

786 lines
22 KiB

​
​
​
​
4 years ago
​
​
3 years ago
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
3 years ago
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
4 years ago
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
4 years ago
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
3 years ago
​
4 years ago
4 years ago
4 years ago
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
4 years ago
​
​
4 years ago
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
4 years ago
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
4 years ago
​
​
4 years ago
​
​
​
​
​
​
​
4 years ago
​
​
​
​
4 years ago
​
4 years ago
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  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`, `no`.`id` as `node_id` 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. $CR['ack_mask_type'] = intval( $CR['ack_mask_type'] );
  10. $CR['ack_mask_size'] = intval( $CR['ack_mask_size'] );
  11. $TTPL=<<<JOJOKA
  12. {
  13. xtype: 'panel',
  14. border: false,
  15. frame: false,
  16. items:[%%%ITEMS%%%]
  17. }
  18. JOJOKA;
  19. $ITEMS = array();
  20. switch( $CR['type'] ){
  21. case 1: $NAME = '<b>'.$CR['name'].'</b><br/>ALS ' . $Labels->getLabel('SENSOR'); break;
  22. case 2: $NAME = '<b>'.$CR['name'].'</b><br/>LFS ' . $Labels->getLabel('SENSOR'); break;
  23. case 3: $NAME = '<b>'.$CR['name'].'</b><br/>PLS200 ' . $Labels->getLabel('SENSOR'); break;
  24. case 4: $NAME = '<b>'.$CR['name'].'</b><br/>PLS360 ' . $Labels->getLabel('SENSOR'); break;
  25. default: $NAME = '<b>'.$CR['name'].'</b><br/>Unknown Sensor';
  26. };
  27. $NAME .='<br/>communication errors per minute: '.$CR['com_epm'];
  28. $INFO = '<table width="100%" border=0 style="font-weight: bold;"><tr><td width="130px" align="right">'.$Labels->GetLabel('_SERIAL_').':</td><td>'.(($CR['serial']!='')?$CR['serial']:'No Serial Defined').'</td></tr><tr><td align="right">'.$Labels->GetLabel('_VERSION_').':</td><td>'.(($CR['version']!='')?$CR['version']:'No Version Info').'</td></tr></table>';
  29. $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/>'}";
  30. $QS="SELECT aux_id, device FROM resources WHERE ( type=1 OR type=129 )";
  31. $RR=$DATABASE->Query( $QS );
  32. if( count( $RR ) ){
  33. $RE=array();
  34. foreach( $RR as $R ){
  35. $RE[] = "[ {$R['aux_id']}, '{$R['device']}']";
  36. };
  37. $UARTS = implode( ',', $RE );
  38. } else {
  39. $UARTS = "[0, \"".$Labels->GetLabel('_NO_UARTS_DEF_')."\"]";
  40. };
  41. $QS = "SELECT * FROM `lrf_ini_settings` WHERE `sensor_id`={$EID}";
  42. $RRR = $DATABASE->Query( $QS );
  43. if( count( $RRR ) ){
  44. $INI_S = $RRR[0];
  45. } else {
  46. $INI_S = array();
  47. $INI_S['AUTORESET_ENABLE'] = 0;
  48. $INI_S['AUTORESET_INTERLEAVE'] = 2000;
  49. $INI_S['AUTORESET_TIMEOUT'] = 60000;
  50. $INI_S['BOARD_TEMPERATURE'] = 1;
  51. $INI_S['BOARD_ZEROSHIFT'] = 0;
  52. $INI_S['BOARD_SPEED'] = 4;
  53. $INI_S['RUN_DIR'] = 2;
  54. $INI_S['NO_BLACK_TARGETS'] = 1;
  55. $INI_S['JUST_MOVING_TARGETS'] = 0;
  56. $INI_S['JUST_MOVING_RADIAL'] = 0;
  57. $INI_S['JUST_MOVING_DISTANCE'] = 0;
  58. if( stripos( $CR['version'], 'FF' )!== false ) {
  59. $INI_S['FREEZ_FIRST_TH'] = 1;
  60. $INI_S['SAVE_FIRST_TH'] = 1;
  61. } else if( stripos( $CR['version'], 'FS' )!== false ){
  62. $INI_S['FREEZ_FIRST_TH'] = 1;
  63. $INI_S['SAVE_FIRST_TH'] = 1;
  64. } else if( stripos( $CR['version'], 'FD' )!== false ){
  65. $INI_S['FREEZ_FIRST_TH'] = 0;
  66. $INI_S['SAVE_FIRST_TH'] = 0;
  67. } else {
  68. $INI_S['FREEZ_FIRST_TH'] = 0;
  69. $INI_S['SAVE_FIRST_TH'] = 0;
  70. };
  71. $QS = "INSERT INTO `lrf_ini_settings`(`sensor_id`,`AUTORESET_ENABLE`,`AUTORESET_INTERLEAVE`,`AUTORESET_TIMEOUT`,`BOARD_TEMPERATURE`,`BOARD_ZEROSHIFT`,`BOARD_SPEED`,`RUN_DIR`,`NO_BLACK_TARGETS`,`JUST_MOVING_TARGETS`,`JUST_MOVING_RADIAL`,`JUST_MOVING_DISTANCE`,`FREEZ_FIRST_TH`,`SAVE_FIRST_TH`) VALUES({$EID},0,0,0,0,0,4,2,0,0,0,0,{$INI_S['FREEZ_FIRST_TH']},{$INI_S['SAVE_FIRST_TH']})";
  72. $DATABASE->Query( $QS );
  73. };
  74. if( ( stripos( $CR['version'], 'FD' )!== false ) || ( stripos( $CR['version'], 'FS' )!== false ) || ( stripos( $CR['version'], 'FF' )!== false ) ){
  75. //Frozen TH
  76. if( stripos( $CR['version'], 'FD' )!== false ){
  77. $THF_OPERATION = ",{
  78. xtype: 'button',
  79. text: '{$Labels->GetLabel('_SENS_ENA_FROTH_')}',
  80. width: '100%',
  81. iconCls: 'srv_op_fth_ble',
  82. scale: 'large',
  83. handler: function(){
  84. doSensorOperation( {$CR['id']}, 21, 0, true );
  85. }
  86. }";
  87. } else {
  88. if( stripos( $CR['version'], 'FS' )!== false ){
  89. $THF_OPERATION = ",{
  90. xtype: 'button',
  91. text: '{$Labels->GetLabel('_SENS_FIN_FROTH_')}',
  92. width: '100%',
  93. iconCls: 'srv_op_fth_study',
  94. scale: 'large',
  95. handler: function(){
  96. doSensorOperation( {$CR['id']}, 24, 0, true );
  97. }
  98. }";
  99. };
  100. if( stripos( $CR['version'], 'FF' )!== false ){
  101. $THF_OPERATION = ",{
  102. xtype: 'button',
  103. text: '{$Labels->GetLabel('_SENS_DEL_FROTH_')}',
  104. width: '100%',
  105. iconCls: 'srv_op_fth_frozen',
  106. scale: 'large',
  107. handler: function(){
  108. doSensorOperation( {$CR['id']}, 23, 0, true );
  109. }
  110. }";
  111. };
  112. $THF_OPERATION .= ",{
  113. xtype: 'button',
  114. text: '{$Labels->GetLabel('_SENS_DIS_FROTH_')}',
  115. width: '100%',
  116. iconCls: 'srv_op_fth_ble',
  117. scale: 'large',
  118. handler: function(){
  119. doSensorOperation( {$CR['id']}, 22, 0, true );
  120. }
  121. }";
  122. };
  123. } else {
  124. $THF_OPERATION = '';
  125. }
  126. $ED =<<<kokakskhkajhskr
  127. {
  128. xtype: 'tabpanel',
  129. activeTab: 0,
  130. items:[{
  131. xtype: 'form',
  132. title: '{$Labels->GetLabel('_GENERAL_')}',
  133. labelWidth: 200,
  134. border: false,
  135. frame: false,
  136. labelAlign: 'right',
  137. height: PanelH - 283,
  138. items:[{
  139. xtype: 'combo',
  140. id: 'sens_se',
  141. fieldLabel: "{$Labels->GetLabel('_SENS_STATUS_')}",
  142. lazyRender: true,
  143. mode: 'local',
  144. forceSelection: true,
  145. triggerAction: 'all',
  146. editable: false,
  147. disableKeyFilter: true,
  148. store: new Ext.data.ArrayStore({
  149. fields: ['mode','mode_txt'],
  150. data: [
  151. [0,'{$Labels->GetLabel('__DISABLED__')}'],
  152. [1,'{$Labels->GetLabel('___ENABLED__')}']
  153. ]
  154. }),
  155. valueField: 'mode',
  156. displayField: 'mode_txt',
  157. value: {$CR['enable']},
  158. width: 200,
  159. listeners:{
  160. select: function( a, c, b ){
  161. doSensorOperation( {$CR['id']}, 1, b, true );
  162. }
  163. }
  164. },{
  165. xtype: 'combo',
  166. id: 'sens_range',
  167. fieldLabel: "{$Labels->GetLabel('SENS_RANGE')}",
  168. lazyRender: true,
  169. mode: 'local',
  170. forceSelection: true,
  171. triggerAction: 'all',
  172. editable: false,
  173. disableKeyFilter: true,
  174. store: new Ext.data.ArrayStore({
  175. fields: ['range','range_txt'],
  176. data: [
  177. [15,'15 {$Labels->GetLabel('_METERS_')}'],
  178. [35,'35 {$Labels->GetLabel('_METERS_')}'],
  179. [45,'45 {$Labels->GetLabel('_METERS_')}'],
  180. [65,'65 {$Labels->GetLabel('_METERS_')}'],
  181. [75,'75 {$Labels->GetLabel('_METERS_')}'],
  182. [150,'150 {$Labels->GetLabel('_METERS_')}'],
  183. [200,'200 {$Labels->GetLabel('_METERS_')}'],
  184. [300,'300 {$Labels->GetLabel('_METERS_')}'],
  185. [350,'350 {$Labels->GetLabel('_METERS_')}']
  186. ]
  187. }),
  188. valueField: 'range',
  189. displayField: 'range_txt',
  190. value: {$CR['max_range']},
  191. width: 200,
  192. listeners:{
  193. select: function( a, c, b ){
  194. doSensorOperation( {$CR['id']}, 2, b, true );
  195. }
  196. }
  197. },{
  198. xtype: 'numberfield',
  199. id: 'sens_id',
  200. fieldLabel: '{$Labels->GetLabel('_PROTO_DEVICE_ID_')}',
  201. width: 200,
  202. value: {$CR['device_id']},
  203. listeners:{
  204. change: function( a, c, b ){
  205. doSensorOperation( {$CR['id']}, 3, c, true );
  206. }
  207. }
  208. },{
  209. xtype: 'combo',
  210. fieldLabel: '{$Labels->GetLabel('_UART_PORT_')}',
  211. lazyRender: true,
  212. id: 'uart_id',
  213. mode: 'local',
  214. disabled: false,
  215. forceSelection: true, triggerAction: 'all', editable: false, disableKeyFilter: true,
  216. store: new Ext.data.ArrayStore({
  217. fields: ['uart','uart_txt'],
  218. data: [{$UARTS}]
  219. }),
  220. valueField: 'uart',
  221. displayField: 'uart_txt',
  222. value: {$CR['uart_id']},
  223. width: 200,
  224. listeners:{
  225. select: function( a, c, b ){
  226. doSensorOperation( {$CR['id']}, 4, c.data.uart, true );
  227. }
  228. }
  229. },{
  230. xtype: 'combo',
  231. id: 'ad_se',
  232. fieldLabel: "{$Labels->GetLabel('AUTO_DRAW')}",
  233. lazyRender: true,
  234. mode: 'local',
  235. forceSelection: true,
  236. triggerAction: 'all',
  237. editable: false,
  238. disableKeyFilter: true,
  239. store: new Ext.data.ArrayStore({
  240. fields: ['ad','ad_txt'],
  241. data: [
  242. [0,'{$Labels->GetLabel('__DISABLED__')}'],
  243. [10,'Each 10 Flips'],
  244. [20,'Each 20 Flips'],
  245. [30,'Each 30 Flips'],
  246. [40,'Each 40 Flips'],
  247. [50,'Each 50 Flips'],
  248. [100,'Each 100 Flips'],
  249. [200,'Each 200 Flips']
  250. ]
  251. }),
  252. valueField: 'ad',
  253. displayField: 'ad_txt',
  254. value: {$CR['auto_draw']},
  255. width: 200,
  256. listeners:{
  257. select: function( a, c, b ){
  258. doSensorOperation( {$CR['id']}, 5, b, true );
  259. }
  260. }
  261. },{
  262. xtype: 'numberfield',
  263. id: 'basesh_id',
  264. fieldLabel: 'Background {$Labels->GetLabel('__ZERO_SHIFT__')}',
  265. width: 200,
  266. value: {$CR['base_shift']},
  267. listeners:{
  268. change: function( a, c, b ){
  269. doSensorOperation( {$CR['id']}, 6, c, true );
  270. }
  271. }
  272. },{
  273. xtype: 'combo',
  274. id: 'sens_at',
  275. fieldLabel: "{$Labels->GetLabel('_SENS_ACKT_')}",
  276. lazyRender: true,
  277. mode: 'local',
  278. forceSelection: true,
  279. triggerAction: 'all',
  280. editable: false,
  281. disableKeyFilter: true,
  282. store: new Ext.data.ArrayStore({
  283. fields: ['mode','mode_txt'],
  284. data: [
  285. [0,'{$Labels->GetLabel('_MA_ROUND_')}'],
  286. [1,'{$Labels->GetLabel('_MA_CIRCLE__')}']
  287. ]
  288. }),
  289. valueField: 'mode',
  290. displayField: 'mode_txt',
  291. value: {$CR['ack_mask_type']},
  292. width: 200,
  293. listeners:{
  294. select: function( a, c, b ){
  295. doSensorOperation( {$CR['id']}, 25, b, true );
  296. }
  297. }
  298. },{
  299. xtype: 'combo',
  300. id: 'sens_as',
  301. fieldLabel: "{$Labels->GetLabel('_SENS_ACKS_')}",
  302. lazyRender: true,
  303. mode: 'local',
  304. forceSelection: true,
  305. triggerAction: 'all',
  306. editable: false,
  307. disableKeyFilter: true,
  308. store: new Ext.data.ArrayStore({
  309. fields: ['size','size_txt'],
  310. data: [
  311. [10,'10 {$Labels->GetLabel('_METERS_')}'],
  312. [20,'20 {$Labels->GetLabel('_METERS_')}'],
  313. [30,'30 {$Labels->GetLabel('_METERS_')}'],
  314. [40,'40 {$Labels->GetLabel('_METERS_')}'],
  315. [50,'50 {$Labels->GetLabel('_METERS_')}'],
  316. [60,'60 {$Labels->GetLabel('_METERS_')}'],
  317. [70,'70 {$Labels->GetLabel('_METERS_')}']
  318. ]
  319. }),
  320. valueField: 'size',
  321. displayField: 'size_txt',
  322. value: {$CR['ack_mask_size']},
  323. width: 200,
  324. listeners:{
  325. select: function( a, c, b ){
  326. doSensorOperation( {$CR['id']}, 26, b, true );
  327. }
  328. }
  329. }]
  330. },{
  331. xtype: 'form',
  332. title: '{$Labels->GetLabel('_HARDWARE_')}',
  333. labelWidth: 200,
  334. border: false,
  335. frame: false,
  336. labelAlign: 'right',
  337. height: PanelH - 283,
  338. items:[{
  339. xtype: 'checkbox',
  340. id: 'autores_ena',
  341. fieldLabel: '{$Labels->GetLabel('_SENS_AUTOR_ENA_')}',
  342. width: 200,
  343. checked: {$INI_S['AUTORESET_ENABLE']},
  344. listeners:{
  345. check: function( a, c ){
  346. if( c ){
  347. doSensorOperation( {$CR['id']}, 7, 1, false );
  348. } else {
  349. doSensorOperation( {$CR['id']}, 7, 0, false );
  350. };
  351. }
  352. }
  353. },{
  354. xtype: 'numberfield',
  355. id: 'autores_il',
  356. fieldLabel: '{$Labels->GetLabel('_SENS_AUTOR_INTER_')}',
  357. width: 200,
  358. value: {$INI_S['AUTORESET_INTERLEAVE']},
  359. listeners:{
  360. change: function( a, c, b ){
  361. doSensorOperation( {$CR['id']}, 8, c, false );
  362. }
  363. }
  364. },{
  365. xtype: 'numberfield',
  366. id: 'autores_to',
  367. fieldLabel: '{$Labels->GetLabel('_SENS_AUTOR_TO_')}',
  368. width: 200,
  369. value: {$INI_S['AUTORESET_TIMEOUT']},
  370. listeners:{
  371. change: function( a, c, b ){
  372. doSensorOperation( {$CR['id']}, 9, c, false );
  373. }
  374. }
  375. },{
  376. xtype: 'numberfield',
  377. id: 'board_zsh',
  378. fieldLabel: '{$Labels->GetLabel('_SENS_BZSHIFT_')}',
  379. width: 200,
  380. value: {$INI_S['BOARD_ZEROSHIFT']},
  381. listeners:{
  382. change: function( a, c, b ){
  383. doSensorOperation( {$CR['id']}, 10, c, false );
  384. }
  385. }
  386. },{
  387. xtype: 'numberfield',
  388. id: 'board_temp',
  389. fieldLabel: '{$Labels->GetLabel('_SENS_HTEMP_')}',
  390. width: 200,
  391. value: {$INI_S['BOARD_TEMPERATURE']},
  392. listeners:{
  393. change: function( a, c, b ){
  394. doSensorOperation( {$CR['id']}, 11, c, false );
  395. }
  396. }
  397. },{
  398. xtype: 'combo',
  399. id: 'board_spd',
  400. fieldLabel: "{$Labels->GetLabel('_SENS_SCANSPEED_')}",
  401. lazyRender: true,
  402. mode: 'local',
  403. forceSelection: true,
  404. triggerAction: 'all',
  405. editable: false,
  406. disableKeyFilter: true,
  407. store: new Ext.data.ArrayStore({
  408. fields: ['sd','sd_txt'],
  409. data: [
  410. [2,'2 Scans per second'],
  411. [4,'4 Scans per second'],
  412. [6,'6 Scans per second'],
  413. [8,'8 Scans per second'],
  414. [10,'10 Scans per second'],
  415. [12,'12 Scans per second']
  416. ]
  417. }),
  418. valueField: 'sd',
  419. displayField: 'sd_txt',
  420. value: {$INI_S['BOARD_SPEED']},
  421. width: 200,
  422. listeners:{
  423. select: function( a, c, b ){
  424. doSensorOperation( {$CR['id']}, 12, b, false );
  425. }
  426. }
  427. },{
  428. xtype: 'checkbox',
  429. id: 'nbt_ena',
  430. fieldLabel: '{$Labels->GetLabel('_SENS_NOBLA_')}',
  431. width: 200,
  432. checked: {$INI_S['NO_BLACK_TARGETS']},
  433. listeners:{
  434. check: function( a, c ){
  435. if( c ){
  436. doSensorOperation( {$CR['id']}, 13, 1, false );
  437. } else {
  438. doSensorOperation( {$CR['id']}, 13, 0, false );
  439. };
  440. }
  441. }
  442. },{
  443. xtype: 'checkbox',
  444. id: 'jmt_ena',
  445. fieldLabel: '{$Labels->GetLabel('_SENS_JUMOTA_')}',
  446. width: 200,
  447. checked: {$INI_S['JUST_MOVING_TARGETS']},
  448. listeners:{
  449. check: function( a, c ){
  450. if( c ){
  451. doSensorOperation( {$CR['id']}, 14, 1, false );
  452. } else {
  453. doSensorOperation( {$CR['id']}, 14, 0, false );
  454. };
  455. }
  456. }
  457. },{
  458. xtype: 'checkbox',
  459. id: 'jmt_rad',
  460. fieldLabel: '{$Labels->GetLabel('_SENS_JUMORA_')}',
  461. width: 200,
  462. checked: {$INI_S['JUST_MOVING_RADIAL']},
  463. listeners:{
  464. check: function( a, c ){
  465. if( c ){
  466. doSensorOperation( {$CR['id']}, 15, 1, false );
  467. } else {
  468. doSensorOperation( {$CR['id']}, 15, 0, false );
  469. };
  470. }
  471. }
  472. },{
  473. xtype: 'checkbox',
  474. id: 'jmt_range',
  475. fieldLabel: '{$Labels->GetLabel('_SENS_JUMODI_')}',
  476. width: 200,
  477. checked: {$INI_S['JUST_MOVING_DISTANCE']},
  478. listeners:{
  479. check: function( a, c ){
  480. if( c ){
  481. doSensorOperation( {$CR['id']}, 16, 1, false );
  482. } else {
  483. doSensorOperation( {$CR['id']}, 16, 0, false );
  484. };
  485. }
  486. }
  487. },{
  488. xtype: 'checkbox',
  489. id: 'fth_freeze',
  490. fieldLabel: '{$Labels->GetLabel('_SENS_FFTH_')}',
  491. width: 200,
  492. checked: {$INI_S['FREEZ_FIRST_TH']},
  493. listeners:{
  494. check: function( a, c ){
  495. if( c ){
  496. doSensorOperation( {$CR['id']}, 17, 1, false );
  497. } else {
  498. doSensorOperation( {$CR['id']}, 17, 0, false );
  499. };
  500. }
  501. }
  502. },{
  503. xtype: 'checkbox',
  504. id: 'fth_save',
  505. fieldLabel: '{$Labels->GetLabel('_SENS_SFTH_')}',
  506. width: 200,
  507. checked: {$INI_S['SAVE_FIRST_TH']},
  508. listeners:{
  509. check: function( a, c ){
  510. if( c ){
  511. doSensorOperation( {$CR['id']}, 18, 1, false );
  512. } else {
  513. doSensorOperation( {$CR['id']}, 18, 0, false );
  514. };
  515. }
  516. }
  517. },{
  518. xtype: 'button',
  519. text: '{$Labels->GetLabel('_SENS_APPLY_RES_')}',
  520. width: '100%',
  521. iconCls: 'srv_op_download',
  522. scale: 'large',
  523. handler: function(){
  524. doSensorOperation( {$CR['id']}, 20, 0, true );
  525. }
  526. }]
  527. },{
  528. xtype: 'panel',
  529. title: '{$Labels->GetLabel('_POSITION_')}',
  530. height: PanelH - 283,
  531. items:[{
  532. xtype: 'panel',
  533. id: 'loc_ed_map',
  534. height: PanelH - 283,
  535. html: '&nbsp;',
  536. listeners: {
  537. afterrender: function(p){
  538. //var W=p.getWidth(); p.setHeight( 32+(W/16)*9);
  539. //initMapMonitoring();
  540. loadLocationEditor( 'loc_ed_map', {$CR['type']}, {$CR['id']} );
  541. }
  542. }
  543. }]
  544. },{
  545. xtype: 'panel',
  546. title: '{$Labels->GetLabel('_MAINTENENCE_')}',
  547. height: PanelH - 283,
  548. items:[{
  549. xtype: 'button',
  550. text: '{$Labels->GetLabel('_SENS_DO_FULLR_')}',
  551. width: '100%',
  552. iconCls: 'srv_op_restart',
  553. scale: 'large',
  554. handler: function(){
  555. doDeviceOperation( {$CR['node_id']}, 1,'', true );
  556. }
  557. },{
  558. xtype: 'button',
  559. text: '{$Labels->GetLabel('_SENS_DO_READALL_')}',
  560. width: '100%',
  561. iconCls: 'srv_op_upload',
  562. scale: 'large',
  563. handler: function(){
  564. doDeviceOperation( {$CR['node_id']}, 128,'', true );
  565. }
  566. },{
  567. xtype: 'button',
  568. text: '{$Labels->GetLabel('_SENS_DO_SAVEALL_')}',
  569. width: '100%',
  570. iconCls: 'srv_op_download',
  571. scale: 'large',
  572. handler: function(){
  573. doDeviceOperation( {$CR['node_id']}, 129,'', true );
  574. }
  575. }{$THF_OPERATION}]
  576. },{
  577. xtype: 'panel',
  578. title: '{$Labels->getLabel('_SND_FILES2_DEV__')}',
  579. height: PanelH - 283,
  580. items:[{
  581. title: '{$Labels->getLabel('_UPLOAD_PACKAGE_')}',
  582. xtype: 'panel',
  583. //height: 300,
  584. //flex: 1,
  585. frame: true,
  586. border: false,
  587. //layout: 'vbox',
  588. items:[{
  589. xtype:'button',
  590. id: 'pickfiles_3',
  591. width: '100%',
  592. text: '{$Labels->GetLabel('_CHOOSEF_')}',
  593. listeners:{
  594. afterrender: function(){
  595. muploader = new plupload.Uploader({
  596. runtimes : 'html5,html4',
  597. browse_button : Ext.getDom('pickfiles_3'),
  598. max_file_size : '1000mb',
  599. chunk_size: '200kb',
  600. max_retries: 3,
  601. multi_selection: false,
  602. max_file_count: 1,
  603. url: '/lib/controller/uploadToDevice.php?DID={$EID}',
  604. init: {
  605. PostInit: function() {
  606. },
  607. FilesAdded: function( up, files ) {
  608. Ext.getCmp('upload_files_btn').enable();
  609. Ext.getCmp('uploads_clr_btn').enable();
  610. plupload.each( files, function(file) {
  611. uploads_store.loadData( [[ uploads_store_id, file.name, file.id, plupload.formatSize( file.size ), 0, 'N' ]], true );
  612. uploads_store_id++;
  613. Ext.getCmp('upload_grid').doLayout();
  614. });
  615. },
  616. UploadProgress: function(up, file) {
  617. var pb = Ext.getCmp( 'progress_'+file.id );
  618. if( file.percent < 100 ){
  619. pb.updateProgress( file.percent / 100, file.percent + '%', false );
  620. } else {
  621. pb.updateProgress( 1.0, 'Uploaded', false );
  622. uploads_store.removeAll();
  623. loadModuleFiles( {$EID} );
  624. };
  625. },
  626. Error: function(up, err) {
  627. Ext.Msg.show({
  628. title:'Upload Status',
  629. msg: "Error #" + err.code + ": " + err.message,
  630. buttons: Ext.Msg.OK,
  631. icon: Ext.MessageBox.ERROR
  632. });
  633. }
  634. }
  635. });
  636. muploader.init();
  637. //Ext.getCmp('uploaded_grid').hide();
  638. //Ext.getCmp('upload_progres_panel').show();
  639. devUploadID = {$CR['id']};
  640. fetchDeviceUploadStatus();
  641. //loadModuleFiles( {$EID} );
  642. }
  643. }
  644. },{
  645. height: 200,
  646. xtype: 'grid',
  647. id: 'upload_grid',
  648. border: false,
  649. frame: false,
  650. mode: 'local',
  651. lazyRender: true,
  652. width: '100%',
  653. autoScroll: true,
  654. ds: uploads_store,
  655. cm: new Ext.grid.ColumnModel( fileUploadsColModel_ops ),
  656. sm: new Ext.grid.RowSelectionModel( fileUploadsSelModel_ops ),
  657. viewConfig: {
  658. forceFit: true
  659. },
  660. bbar: [{
  661. text: '{$Labels->GetLabel('_CLEAR_')}',
  662. id: 'uploads_clr_btn',
  663. disabled: true,
  664. handler: function(){
  665. muploader.splice();
  666. uploads_store.removeAll();
  667. uploads_store_id = 0;
  668. Ext.getCmp('uploads_clr_btn').disable();
  669. Ext.getCmp('upload_files_btn').disable();
  670. }
  671. },{
  672. xtype:'button',
  673. id: 'upload_files_btn',
  674. disabled: true,
  675. text: '{$Labels->GetLabel('_UPLOA2MODULE_')}',
  676. handler: function(){
  677. if( muploader!= null ){
  678. muploader.start();
  679. Ext.getCmp('upload_files_btn').disable();
  680. };
  681. }
  682. }]
  683. },{
  684. xtype: 'panel',
  685. height: 20
  686. },{
  687. title: '{$Labels->GetLabel('_FISONMODULE_')}',
  688. height: 200,
  689. xtype: 'grid',
  690. id: 'uploaded_grid',
  691. border: false,
  692. hidden: true,
  693. frame: false,
  694. mode: 'local',
  695. lazyRender: true,
  696. width: '100%',
  697. autoScroll: true,
  698. ds: uploaded_store,
  699. cm: new Ext.grid.ColumnModel( fileModuleColModel_ops ),
  700. sm: new Ext.grid.RowSelectionModel( fileUploadsSelModel_ops ),
  701. viewConfig: {
  702. forceFit: true
  703. },
  704. bbar: [{
  705. text: '{$Labels->GetLabel('_CLEAR_')}',
  706. id: 'oploaded_clr_btn',
  707. disabled: false,
  708. handler: function(){
  709. //muploader.splice();
  710. uploaded_store.removeAll();
  711. uploaded_store_id = 0;
  712. }
  713. },{
  714. text: '{$Labels->GetLabel('_RESETSTATUS_')}',
  715. id: 'oploaded_rst_btn',
  716. disabled: true,
  717. handler: function(){
  718. //muploader.splice();
  719. //uploaded_store.removeAll();
  720. //uploaded_store_id = 0;
  721. }
  722. },{
  723. text: '{$Labels->GetLabel('_ISSURES_')}',
  724. id: 'oploaded_sres_btn',
  725. disabled: true,
  726. handler: function(){
  727. //muploader.splice();
  728. //uploaded_store.removeAll();
  729. //uploaded_store_id = 0;
  730. }
  731. },{
  732. xtype:'button',
  733. //disabled: true,
  734. id: 'oploaded_snd_btn',
  735. text: '{$Labels->GetLabel('_SENDTOSENS_')}',
  736. handler: function(){
  737. doDeviceOperation( {$CR['node_id']}, 120,'', true );
  738. Ext.getCmp('uploaded_grid').hide();
  739. Ext.getCmp('upload_progres_panel').show();
  740. devUploadID = {$CR['id']};
  741. fetchDeviceUploadStatus();
  742. }
  743. }]
  744. },{
  745. xtype: 'panel',
  746. id: 'upload_progres_panel',
  747. hidden: false,
  748. items:[{
  749. id: 'upp_ttext',
  750. html: 'Sending 3 file(s) to the device'
  751. },{
  752. id: 'upp_ctext_',
  753. html: '<table width="100%" height="50" border=0><tr><td width="100">&nbsp;</td><td width="50" align="right" height="50"><svg version="1.1" id="L3" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 100 100" enable-background="new 0 0 0 0" xml:space="preserve"><circle fill="none" stroke="#fff" stroke-width="4" cx="50" cy="50" r="44" style="opacity:0.5;"/><circle fill="#fff" stroke="#e74c3c" stroke-width="3" cx="8" cy="54" r="6" ><animateTransform attributeName="transform" dur="2s" type="rotate" from="0 50 48" to="360 50 52" repeatCount="indefinite" /></circle></svg></td><td align="left" id="upp_ctext"></td></tr></table>'
  754. },{
  755. xtype: 'progress',
  756. id: 'upp_pbar',
  757. width: '100%',
  758. value: 0.0
  759. }]
  760. }]
  761. }]
  762. }],
  763. bbar:[{
  764. text: '{$Labels->GetLabel('_REMOVE_SENSOR_')}',
  765. handler: function(){
  766. doSensorOperation( {$CR['id']}, 255,'', true );
  767. }
  768. }]
  769. }
  770. kokakskhkajhskr;
  771. $ITEMS[1] = $ED;
  772. $CONTENT = implode(',',$ITEMS);
  773. $TTPL = str_ireplace( '%%%ITEMS%%%', $CONTENT, $TTPL );
  774. echo $TTPL;
  775. } else {
  776. echo '{ xtype: \'panel\', html: \'Node '.$_POST['NODE'].' Loadded\'}';
  777. };
  778. } else {
  779. header('location: /');
  780. };
  781. ?>