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.

727 lines
20 KiB

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