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.

659 lines
18 KiB

​
​
​
​
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. $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/>LFS ' . $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. $QS = "SELECT * FROM `lrf_ini_settings` WHERE `sensor_id`={$EID}";
  39. $RRR = $DATABASE->Query( $QS );
  40. if( count( $RRR ) ){
  41. $INI_S = $RRR[0];
  42. } else {
  43. $INI_S = array();
  44. $INI_S['AUTORESET_ENABLE'] = 0;
  45. $INI_S['AUTORESET_INTERLEAVE'] = 0;
  46. $INI_S['AUTORESET_TIMEOUT'] = 0;
  47. $INI_S['BOARD_TEMPERATURE'] = 0;
  48. $INI_S['BOARD_ZEROSHIFT'] = 0;
  49. $INI_S['BOARD_SPEED'] = 4;
  50. $INI_S['RUN_DIR'] = 2;
  51. $INI_S['NO_BLACK_TARGETS'] = 0;
  52. $INI_S['JUST_MOVING_TARGETS'] = 0;
  53. $INI_S['JUST_MOVING_RADIAL'] = 0;
  54. $INI_S['JUST_MOVING_DISTANCE'] = 0;
  55. $INI_S['FREEZ_FIRST_TH'] = 0;
  56. $INI_S['SAVE_FIRST_TH'] = 0;
  57. $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,0,0)";
  58. $DATABASE->Query( $QS );
  59. };
  60. $ED =<<<kokakskhkajhskr
  61. {
  62. xtype: 'tabpanel',
  63. activeTab: 0,
  64. items:[{
  65. xtype: 'form',
  66. title: 'General',
  67. labelWidth: 200,
  68. border: false,
  69. frame: false,
  70. labelAlign: 'right',
  71. height: PanelH - 283,
  72. items:[{
  73. xtype: 'combo',
  74. id: 'sens_se',
  75. fieldLabel: "{$Labels->GetLabel('_SENS_STATUS_')}",
  76. lazyRender: true,
  77. mode: 'local',
  78. forceSelection: true,
  79. triggerAction: 'all',
  80. editable: false,
  81. disableKeyFilter: true,
  82. store: new Ext.data.ArrayStore({
  83. fields: ['mode','mode_txt'],
  84. data: [
  85. [0,'{$Labels->GetLabel('__DISABLED__')}'],
  86. [1,'{$Labels->GetLabel('___ENABLED__')}']
  87. ]
  88. }),
  89. valueField: 'mode',
  90. displayField: 'mode_txt',
  91. value: {$CR['enable']},
  92. width: 200,
  93. listeners:{
  94. select: function( a, c, b ){
  95. doSensorOperation( {$CR['id']}, 1, b, true );
  96. }
  97. }
  98. },{
  99. xtype: 'combo',
  100. id: 'sens_range',
  101. fieldLabel: "{$Labels->GetLabel('SENS_RANGE')}",
  102. lazyRender: true,
  103. mode: 'local',
  104. forceSelection: true,
  105. triggerAction: 'all',
  106. editable: false,
  107. disableKeyFilter: true,
  108. store: new Ext.data.ArrayStore({
  109. fields: ['range','range_txt'],
  110. data: [
  111. [15,'15 Meters'],
  112. [35,'35 Meters'],
  113. [45,'45 Meters'],
  114. [65,'65 Meters'],
  115. [75,'75 Meters'],
  116. [150,'150 Meters'],
  117. [200,'200 Meters'],
  118. [300,'300 Meters']
  119. ]
  120. }),
  121. valueField: 'range',
  122. displayField: 'range_txt',
  123. value: {$CR['max_range']},
  124. width: 200,
  125. listeners:{
  126. select: function( a, c, b ){
  127. doSensorOperation( {$CR['id']}, 2, b, true );
  128. }
  129. }
  130. },{
  131. xtype: 'numberfield',
  132. id: 'sens_id',
  133. fieldLabel: '{$Labels->GetLabel('_PROTO_DEVICE_ID_')}',
  134. width: 200,
  135. value: {$CR['device_id']},
  136. listeners:{
  137. change: function( a, c, b ){
  138. doSensorOperation( {$CR['id']}, 3, c, true );
  139. }
  140. }
  141. },{
  142. xtype: 'combo',
  143. fieldLabel: '{$Labels->GetLabel('_UART_PORT_')}',
  144. lazyRender: true,
  145. id: 'uart_id',
  146. mode: 'local',
  147. disabled: false,
  148. forceSelection: true, triggerAction: 'all', editable: false, disableKeyFilter: true,
  149. store: new Ext.data.ArrayStore({
  150. fields: ['uart','uart_txt'],
  151. data: [{$UARTS}]
  152. }),
  153. valueField: 'uart',
  154. displayField: 'uart_txt',
  155. value: {$CR['uart_id']},
  156. width: 200,
  157. listeners:{
  158. select: function( a, c, b ){
  159. doSensorOperation( {$CR['id']}, 4, c.data.uart, true );
  160. }
  161. }
  162. },{
  163. xtype: 'combo',
  164. id: 'ad_se',
  165. fieldLabel: "{$Labels->GetLabel('AUTO_DRAW')}",
  166. lazyRender: true,
  167. mode: 'local',
  168. forceSelection: true,
  169. triggerAction: 'all',
  170. editable: false,
  171. disableKeyFilter: true,
  172. store: new Ext.data.ArrayStore({
  173. fields: ['ad','ad_txt'],
  174. data: [
  175. [0,'{$Labels->GetLabel('__DISABLED__')}'],
  176. [10,'Each 10 Flips'],
  177. [20,'Each 20 Flips'],
  178. [30,'Each 30 Flips'],
  179. [40,'Each 40 Flips'],
  180. [50,'Each 50 Flips'],
  181. [100,'Each 100 Flips'],
  182. [200,'Each 200 Flips']
  183. ]
  184. }),
  185. valueField: 'ad',
  186. displayField: 'ad_txt',
  187. value: {$CR['auto_draw']},
  188. width: 200,
  189. listeners:{
  190. select: function( a, c, b ){
  191. doSensorOperation( {$CR['id']}, 5, b, true );
  192. }
  193. }
  194. },{
  195. xtype: 'numberfield',
  196. id: 'basesh_id',
  197. fieldLabel: 'Background {$Labels->GetLabel('__ZERO_SHIFT__')}',
  198. width: 200,
  199. value: {$CR['base_shift']},
  200. listeners:{
  201. change: function( a, c, b ){
  202. doSensorOperation( {$CR['id']}, 6, c, true );
  203. }
  204. }
  205. }]
  206. },{
  207. xtype: 'form',
  208. title: 'Hardware',
  209. labelWidth: 200,
  210. border: false,
  211. frame: false,
  212. labelAlign: 'right',
  213. height: PanelH - 283,
  214. items:[{
  215. xtype: 'checkbox',
  216. id: 'autores_ena',
  217. fieldLabel: 'Auto Reset Enabled',
  218. width: 200,
  219. checked: {$INI_S['AUTORESET_ENABLE']},
  220. listeners:{
  221. check: function( a, c ){
  222. if( c ){
  223. doSensorOperation( {$CR['id']}, 7, 1, false );
  224. } else {
  225. doSensorOperation( {$CR['id']}, 7, 0, false );
  226. };
  227. }
  228. }
  229. },{
  230. xtype: 'numberfield',
  231. id: 'autores_il',
  232. fieldLabel: 'Auto Reset Interleave',
  233. width: 200,
  234. value: {$INI_S['AUTORESET_INTERLEAVE']},
  235. listeners:{
  236. change: function( a, c, b ){
  237. doSensorOperation( {$CR['id']}, 8, c, false );
  238. }
  239. }
  240. },{
  241. xtype: 'numberfield',
  242. id: 'autores_to',
  243. fieldLabel: 'Auto Timeout',
  244. width: 200,
  245. value: {$INI_S['AUTORESET_TIMEOUT']},
  246. listeners:{
  247. change: function( a, c, b ){
  248. doSensorOperation( {$CR['id']}, 9, c, false );
  249. }
  250. }
  251. },{
  252. xtype: 'numberfield',
  253. id: 'board_zsh',
  254. fieldLabel: 'Board Zero Shift',
  255. width: 200,
  256. value: {$INI_S['BOARD_ZEROSHIFT']},
  257. listeners:{
  258. change: function( a, c, b ){
  259. doSensorOperation( {$CR['id']}, 10, c, false );
  260. }
  261. }
  262. },{
  263. xtype: 'numberfield',
  264. id: 'board_temp',
  265. fieldLabel: 'Heater Temperature',
  266. width: 200,
  267. value: {$INI_S['BOARD_TEMPERATURE']},
  268. listeners:{
  269. change: function( a, c, b ){
  270. doSensorOperation( {$CR['id']}, 11, c, false );
  271. }
  272. }
  273. },{
  274. xtype: 'combo',
  275. id: 'board_spd',
  276. fieldLabel: "Scan Speed",
  277. lazyRender: true,
  278. mode: 'local',
  279. forceSelection: true,
  280. triggerAction: 'all',
  281. editable: false,
  282. disableKeyFilter: true,
  283. store: new Ext.data.ArrayStore({
  284. fields: ['sd','sd_txt'],
  285. data: [
  286. [2,'2 Scans per second'],
  287. [4,'4 Scans per second'],
  288. [6,'6 Scans per second'],
  289. [8,'8 Scans per second'],
  290. [10,'10 Scans per second'],
  291. [12,'12 Scans per second']
  292. ]
  293. }),
  294. valueField: 'sd',
  295. displayField: 'sd_txt',
  296. value: {$INI_S['BOARD_SPEED']},
  297. width: 200,
  298. listeners:{
  299. select: function( a, c, b ){
  300. doSensorOperation( {$CR['id']}, 12, b, false );
  301. }
  302. }
  303. },{
  304. xtype: 'checkbox',
  305. id: 'nbt_ena',
  306. fieldLabel: 'No Black Targets',
  307. width: 200,
  308. checked: {$INI_S['NO_BLACK_TARGETS']},
  309. listeners:{
  310. check: function( a, c ){
  311. if( c ){
  312. doSensorOperation( {$CR['id']}, 13, 1, false );
  313. } else {
  314. doSensorOperation( {$CR['id']}, 13, 0, false );
  315. };
  316. }
  317. }
  318. },{
  319. xtype: 'checkbox',
  320. id: 'jmt_ena',
  321. fieldLabel: 'Just Moving Targets',
  322. width: 200,
  323. checked: {$INI_S['JUST_MOVING_TARGETS']},
  324. listeners:{
  325. check: function( a, c ){
  326. if( c ){
  327. doSensorOperation( {$CR['id']}, 14, 1, false );
  328. } else {
  329. doSensorOperation( {$CR['id']}, 14, 0, false );
  330. };
  331. }
  332. }
  333. },{
  334. xtype: 'checkbox',
  335. id: 'jmt_rad',
  336. fieldLabel: 'Just Moving Radial',
  337. width: 200,
  338. checked: {$INI_S['JUST_MOVING_RADIAL']},
  339. listeners:{
  340. check: function( a, c ){
  341. if( c ){
  342. doSensorOperation( {$CR['id']}, 15, 1, false );
  343. } else {
  344. doSensorOperation( {$CR['id']}, 15, 0, false );
  345. };
  346. }
  347. }
  348. },{
  349. xtype: 'checkbox',
  350. id: 'jmt_range',
  351. fieldLabel: 'Just Moving Distance',
  352. width: 200,
  353. checked: {$INI_S['JUST_MOVING_DISTANCE']},
  354. listeners:{
  355. check: function( a, c ){
  356. if( c ){
  357. doSensorOperation( {$CR['id']}, 16, 1, false );
  358. } else {
  359. doSensorOperation( {$CR['id']}, 16, 0, false );
  360. };
  361. }
  362. }
  363. },{
  364. xtype: 'checkbox',
  365. id: 'fth_freeze',
  366. fieldLabel: 'Freeze First Threshold',
  367. width: 200,
  368. checked: {$INI_S['FREEZ_FIRST_TH']},
  369. listeners:{
  370. check: function( a, c ){
  371. if( c ){
  372. doSensorOperation( {$CR['id']}, 17, 1, false );
  373. } else {
  374. doSensorOperation( {$CR['id']}, 17, 0, false );
  375. };
  376. }
  377. }
  378. },{
  379. xtype: 'checkbox',
  380. id: 'fth_save',
  381. fieldLabel: 'Save First Threshold',
  382. width: 200,
  383. checked: {$INI_S['SAVE_FIRST_TH']},
  384. listeners:{
  385. check: function( a, c ){
  386. if( c ){
  387. doSensorOperation( {$CR['id']}, 18, 1, false );
  388. } else {
  389. doSensorOperation( {$CR['id']}, 18, 0, false );
  390. };
  391. }
  392. }
  393. },{
  394. xtype: 'button',
  395. text: 'Apply To Device and Reset',
  396. width: '100%',
  397. iconCls: 'srv_op_download',
  398. scale: 'large',
  399. handler: function(){
  400. doSensorOperation( {$CR['id']}, 20, 0, true );
  401. }
  402. },{
  403. xtype: 'button',
  404. text: 'Issue Sensor Full Reset',
  405. width: '100%',
  406. iconCls: 'srv_op_restart',
  407. scale: 'large',
  408. handler: function(){
  409. doDeviceOperation( {$CR['node_id']}, 1,'', true );
  410. }
  411. }]
  412. },{
  413. xtype: 'panel',
  414. title: 'Position',
  415. height: PanelH - 283,
  416. items:[]
  417. },{
  418. xtype: 'panel',
  419. title: 'Maintenence',
  420. height: PanelH - 283,
  421. items:[{
  422. xtype: 'button',
  423. text: 'Issue Sensor Full Reset',
  424. width: '100%',
  425. iconCls: 'srv_op_restart',
  426. scale: 'large',
  427. handler: function(){
  428. doDeviceOperation( {$CR['node_id']}, 1,'', true );
  429. }
  430. },{
  431. xtype: 'button',
  432. text: 'Read All Settings from Sensor',
  433. width: '100%',
  434. iconCls: 'srv_op_upload',
  435. scale: 'large',
  436. handler: function(){
  437. doDeviceOperation( {$CR['node_id']}, 128,'', true );
  438. }
  439. },{
  440. xtype: 'button',
  441. text: 'Save All Settings to Sensor',
  442. width: '100%',
  443. iconCls: 'srv_op_download',
  444. scale: 'large',
  445. handler: function(){
  446. doDeviceOperation( {$CR['node_id']}, 129,'', true );
  447. }
  448. }]
  449. },{
  450. xtype: 'panel',
  451. title: '{$Labels->getLabel('_SND_FILES2_DEV__')}',
  452. height: PanelH - 283,
  453. items:[{
  454. title: '{$Labels->getLabel('_UPLOAD_PACKAGE_')}',
  455. xtype: 'panel',
  456. //height: 300,
  457. //flex: 1,
  458. frame: true,
  459. border: false,
  460. //layout: 'vbox',
  461. items:[{
  462. xtype:'button',
  463. id: 'pickfiles_3',
  464. width: '100%',
  465. text: 'Choose File',
  466. listeners:{
  467. afterrender: function(){
  468. muploader = new plupload.Uploader({
  469. runtimes : 'html5,html4',
  470. browse_button : Ext.getDom('pickfiles_3'),
  471. max_file_size : '1000mb',
  472. chunk_size: '200kb',
  473. max_retries: 3,
  474. multi_selection: false,
  475. max_file_count: 1,
  476. url: '/lib/controller/uploadToDevice.php?DID={$EID}',
  477. init: {
  478. PostInit: function() {
  479. },
  480. FilesAdded: function( up, files ) {
  481. Ext.getCmp('upload_files_btn').enable();
  482. Ext.getCmp('uploads_clr_btn').enable();
  483. plupload.each( files, function(file) {
  484. uploads_store.loadData( [[ uploads_store_id, file.name, file.id, plupload.formatSize( file.size ), 0, 'N' ]], true );
  485. uploads_store_id++;
  486. Ext.getCmp('upload_grid').doLayout();
  487. });
  488. },
  489. UploadProgress: function(up, file) {
  490. var pb = Ext.getCmp( 'progress_'+file.id );
  491. if( file.percent < 100 ){
  492. pb.updateProgress( file.percent / 100, file.percent + '%', false );
  493. } else {
  494. pb.updateProgress( 1.0, 'Uploaded', false );
  495. uploads_store.removeAll();
  496. loadModuleFiles( {$EID} );
  497. };
  498. },
  499. Error: function(up, err) {
  500. Ext.Msg.show({
  501. title:'Upload Status',
  502. msg: "Error #" + err.code + ": " + err.message,
  503. buttons: Ext.Msg.OK,
  504. icon: Ext.MessageBox.ERROR
  505. });
  506. }
  507. }
  508. });
  509. muploader.init();
  510. //Ext.getCmp('uploaded_grid').hide();
  511. //Ext.getCmp('upload_progres_panel').show();
  512. devUploadID = {$CR['id']};
  513. fetchDeviceUploadStatus();
  514. //loadModuleFiles( {$EID} );
  515. }
  516. }
  517. },{
  518. height: 200,
  519. xtype: 'grid',
  520. id: 'upload_grid',
  521. border: false,
  522. frame: false,
  523. mode: 'local',
  524. lazyRender: true,
  525. width: '100%',
  526. autoScroll: true,
  527. ds: uploads_store,
  528. cm: new Ext.grid.ColumnModel( fileUploadsColModel_ops ),
  529. sm: new Ext.grid.RowSelectionModel( fileUploadsSelModel_ops ),
  530. viewConfig: {
  531. forceFit: true
  532. },
  533. bbar: [{
  534. text: 'Clear',
  535. id: 'uploads_clr_btn',
  536. disabled: true,
  537. handler: function(){
  538. muploader.splice();
  539. uploads_store.removeAll();
  540. uploads_store_id = 0;
  541. Ext.getCmp('uploads_clr_btn').disable();
  542. Ext.getCmp('upload_files_btn').disable();
  543. }
  544. },{
  545. xtype:'button',
  546. id: 'upload_files_btn',
  547. disabled: true,
  548. text: 'Upload to Module',
  549. handler: function(){
  550. if( muploader!= null ){
  551. muploader.start();
  552. Ext.getCmp('upload_files_btn').disable();
  553. };
  554. }
  555. }]
  556. },{
  557. xtype: 'panel',
  558. height: 20
  559. },{
  560. title: 'Files Saved on Module',
  561. height: 200,
  562. xtype: 'grid',
  563. id: 'uploaded_grid',
  564. border: false,
  565. hidden: true,
  566. frame: false,
  567. mode: 'local',
  568. lazyRender: true,
  569. width: '100%',
  570. autoScroll: true,
  571. ds: uploaded_store,
  572. cm: new Ext.grid.ColumnModel( fileModuleColModel_ops ),
  573. sm: new Ext.grid.RowSelectionModel( fileUploadsSelModel_ops ),
  574. viewConfig: {
  575. forceFit: true
  576. },
  577. bbar: [{
  578. text: 'Clear',
  579. id: 'oploaded_clr_btn',
  580. disabled: false,
  581. handler: function(){
  582. //muploader.splice();
  583. uploaded_store.removeAll();
  584. uploaded_store_id = 0;
  585. }
  586. },{
  587. text: 'Reset Status',
  588. id: 'oploaded_rst_btn',
  589. disabled: true,
  590. handler: function(){
  591. //muploader.splice();
  592. //uploaded_store.removeAll();
  593. //uploaded_store_id = 0;
  594. }
  595. },{
  596. text: 'Issue Reset',
  597. id: 'oploaded_sres_btn',
  598. disabled: true,
  599. handler: function(){
  600. //muploader.splice();
  601. //uploaded_store.removeAll();
  602. //uploaded_store_id = 0;
  603. }
  604. },{
  605. xtype:'button',
  606. //disabled: true,
  607. id: 'oploaded_snd_btn',
  608. text: 'Send to Sensor',
  609. handler: function(){
  610. doDeviceOperation( {$CR['node_id']}, 120,'', true );
  611. Ext.getCmp('uploaded_grid').hide();
  612. Ext.getCmp('upload_progres_panel').show();
  613. devUploadID = {$CR['id']};
  614. fetchDeviceUploadStatus();
  615. }
  616. }]
  617. },{
  618. xtype: 'panel',
  619. id: 'upload_progres_panel',
  620. hidden: false,
  621. items:[{
  622. id: 'upp_ttext',
  623. html: 'Sending 3 file(s) to the device'
  624. },{
  625. id: 'upp_ctext_',
  626. 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>'
  627. },{
  628. xtype: 'progress',
  629. id: 'upp_pbar',
  630. width: '100%',
  631. value: 0.0
  632. }]
  633. }]
  634. }]
  635. }],
  636. bbar:[{
  637. text: 'Remove Sensor',
  638. handler: function(){
  639. doSensorOperation( {$CR['id']}, 255,'', true );
  640. }
  641. }]
  642. }
  643. kokakskhkajhskr;
  644. $ITEMS[1] = $ED;
  645. $CONTENT = implode(',',$ITEMS);
  646. $TTPL = str_ireplace( '%%%ITEMS%%%', $CONTENT, $TTPL );
  647. echo $TTPL;
  648. } else {
  649. echo '{ xtype: \'panel\', html: \'Node '.$_POST['NODE'].' Loadded\'}';
  650. };
  651. } else {
  652. header('location: /');
  653. };
  654. ?>