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.

852 lines
22 KiB

6 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
6 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 years ago
​
​
5 years ago
​
​
​
​
​
5 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 years ago
​
​
​
​
​
5 years ago
​
​
​
​
​
​
​
5 years ago
​
​
​
​
​
​
​
​
​
​
​
5 years ago
​
​
​
​
​
​
​
5 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 years ago
​
​
​
​
​
​
​
5 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 years ago
5 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. //<?php require_once('../../js_asm.php'); ?>
  2. var devicesStore = new Ext.data.JsonStore({
  3. root: 'nodes',
  4. totalProperty: 'totalCount',
  5. idProperty: 'id',
  6. remoteSort: true,
  7. fields: [{
  8. name: 'id',
  9. type: 'int'
  10. },{
  11. name: 'name',
  12. type: 'string'
  13. },{
  14. name: 'hardware',
  15. type: 'string'
  16. },{
  17. name: 'caps',
  18. type: 'int'
  19. },{
  20. name: 'ip',
  21. type: 'string'
  22. },{
  23. name: 'mac',
  24. type: 'string'
  25. }],
  26. proxy : new Ext.data.HttpProxy({
  27. method: 'POST',
  28. prettyUrls: false,
  29. url: '/lib/controller/listDiscoveredCameraSources.php',
  30. headers: {
  31. 'UID': '<?=$CUser->Data['id'];?>',
  32. 'SID': '<?=$Session;?>'
  33. }
  34. })
  35. });
  36. var LRF1D2_st_win = null;
  37. var LRF2D2_st_win = null;
  38. var LRF16D3_st_win = null;
  39. function doDeviceOperation( NodeID, OpCode ){
  40. Ext.Ajax.request({
  41. url: '/lib/controller/doDeviceOperation.php',
  42. params: {
  43. NID: NodeID,
  44. UID: '<?=$CUser->Data['id'];?>',
  45. CMD: OpCode,
  46. SID: '<?=$Session;?>'
  47. },
  48. success: function( response, opts ){
  49. },
  50. failure: failureAJAXFunction
  51. });
  52. };
  53. function loadFullLRF1D2Data( NodeID ){
  54. if( LRF1D2_st_win == null ) return;
  55. Ext.Ajax.request({
  56. url: '/lib/controller/getSettingsLRF.php',
  57. params: {
  58. NID: NodeID,
  59. UID: '<?=$CUser->Data['id'];?>',
  60. SID: '<?=$Session;?>',
  61. },
  62. success: function( response, opts ){
  63. if( LRF1D2_st_win!= null ){
  64. var data = Ext.decode(response.responseText);
  65. if( data.online ){
  66. switch( data.data_status ){
  67. case 0: Ext.getCmp('dev_online').update('<p class="green_status">ONLINE/Data Incomplete</p>'); break;
  68. case 1: Ext.getCmp('dev_online').update('<p class="green_status">ONLINE/Synced</p>'); break;
  69. case 2: Ext.getCmp('dev_online').update('<p class="green_status">ONLINE/Data Not Applyed</p>'); break;
  70. };
  71. } else {
  72. switch( data.data_status ){
  73. case 0: Ext.getCmp('dev_online').update('<p class="blue_status">OFFLINE/Data Incomplete</p>'); break;
  74. case 1: Ext.getCmp('dev_online').update('<p class="blue_status">OFFLINE/Synced</p>'); break;
  75. case 2: Ext.getCmp('dev_online').update('<p class="blue_status">OFFLINE/Data Not Applyed</p>'); break;
  76. };
  77. };
  78. Ext.getCmp('dev_name').setValue( data.name );
  79. Ext.getCmp('serial_num').setValue( data.serial );
  80. Ext.getCmp('version_id').setValue( data.version );
  81. Ext.getCmp('device_id').setValue( data.device_id );
  82. Ext.getCmp('com_spd').setValue( data.com_spd );
  83. Ext.getCmp('max_range').setValue( data.max_range );
  84. Ext.getCmp('base_shift').setValue( data.base_shift );
  85. Ext.getCmp('com_spd').setValue( data.uart_speed );
  86. Ext.getCmp('mlrf_offset').setValue( data.m_offset );
  87. Ext.getCmp('slrf_offset').setValue( data.s_offset );
  88. Ext.getCmp('mlrf_delta').setValue( data.m_delta );
  89. Ext.getCmp('slrf_delta').setValue( data.s_delta );
  90. Ext.getCmp('mlrf_width').setValue( data.m_width );
  91. Ext.getCmp('slrf_width').setValue( data.s_width );
  92. Ext.getCmp('mlrf_order').setValue( data.m_order );
  93. Ext.getCmp('slrf_order').setValue( data.s_order );
  94. Ext.getCmp('mlrf_sst').setValue( data.m_sst );
  95. Ext.getCmp('slrf_sst').setValue( data.s_sst );
  96. Ext.getCmp('mlrf_flip').setValue( data.m_flip );
  97. Ext.getCmp('slrf_flip').setValue( data.s_flip );
  98. Ext.getCmp('mlrf_sun').setValue( data.m_sun );
  99. Ext.getCmp('slrf_sun').setValue( data.s_sun );
  100. };
  101. },
  102. failure: failureAJAXFunction
  103. });
  104. };
  105. function LRF1D2_settings(){
  106. if( LRF1D2_st_win == null ){
  107. LRF1D2_st_win = new Ext.Window({
  108. title: 'Sensor Settings',
  109. modal: true,
  110. width: 800,
  111. height: 600,
  112. closeAction: 'hide',
  113. items:{
  114. xtype: 'tabpanel',
  115. activeTab: 0,
  116. items:[{
  117. title: 'General Settings',
  118. xtype: 'form',
  119. layout: 'table',
  120. defaults: {
  121. bodyStyle:'padding:20px'
  122. },
  123. layoutConfig: {
  124. columns: 3
  125. },
  126. items:[{
  127. html: 'Status',
  128. frame: false,
  129. border: false
  130. },{
  131. html: '<p class="green_status">ONLINE</p>',
  132. id: 'dev_online',
  133. frame: false,
  134. border: false
  135. },{},{
  136. html: 'Device Title',
  137. frame: false,
  138. border: false
  139. },{
  140. xtype: 'field',
  141. id: 'dev_name',
  142. readOnly: false,
  143. value: 'KOKO'
  144. },{},{
  145. html: 'Serial Number',
  146. frame: false,
  147. border: false
  148. },{
  149. xtype: 'field',
  150. id: 'serial_num',
  151. readOnly: true,
  152. value: '1212'
  153. },{},{
  154. html: 'Version ID',
  155. frame: false,
  156. border: false
  157. },{
  158. xtype: 'field',
  159. id: 'version_id',
  160. readOnly: true,
  161. value: 'LiberManDA122'
  162. },{},{
  163. html: 'Device Adress',
  164. frame: false,
  165. border: false
  166. },{
  167. xtype: 'numberfield',
  168. id: 'device_id'
  169. },{
  170. xtype: 'button',
  171. id: 'upddiBTN',
  172. text: 'Update Device Address',
  173. handler: function(){
  174. Ext.Msg.show({
  175. title:'Update Device Address?',
  176. msg: 'Are you sure to do so?',
  177. buttons: Ext.Msg.YESNOCANCEL,
  178. //fn: processResult,
  179. animEl: 'upddiBTN',
  180. icon: Ext.MessageBox.QUESTION
  181. });
  182. }
  183. },{
  184. html: 'Device COM Speed',
  185. frame: false,
  186. border: false
  187. },{
  188. xtype: 'combo',
  189. id: 'com_spd',
  190. editable: false,
  191. typeAhead: true,
  192. triggerAction: 'all',
  193. width: '100%',
  194. lazyRender:true,
  195. mode: 'local',
  196. store: new Ext.data.ArrayStore({
  197. id: 0,
  198. fields: ['mySPD', 'displayText' ],
  199. data: [[4800,'4800'],[9600,'9600'],[14400,'14400'],[19200,'19200'],[38400, '38400'],[56000,'56000'],[57600,'57600'],[115200,'115200']]
  200. }),
  201. valueField: 'mySPD',
  202. displayField: 'displayText'
  203. },{
  204. xtype: 'button',
  205. id: 'updspBTN',
  206. text: 'Set Device Speed',
  207. handler: function(){
  208. Ext.Msg.show({
  209. title:'Update Device Speed?',
  210. msg: 'Are you sure to do so?',
  211. buttons: Ext.Msg.YESNOCANCEL,
  212. //fn: processResult,
  213. animEl: 'upddiBTN',
  214. icon: Ext.MessageBox.QUESTION
  215. });
  216. }
  217. },{
  218. html: 'Detection Maximal Range',
  219. frame: false,
  220. border: false
  221. },{
  222. xtype: 'numberfield',
  223. id: 'max_range',
  224. readOnly: true,
  225. value: '1212'
  226. },{},{
  227. html: 'Base Shift',
  228. frame: false,
  229. border: false
  230. },{
  231. xtype: 'numberfield',
  232. id: 'base_shift',
  233. readOnly: true,
  234. value: '1212'
  235. },{}]
  236. },{
  237. title: 'Mantenence',
  238. xtype: 'form',
  239. layout: 'table',
  240. defaults: {
  241. bodyStyle:'padding:20px'
  242. },
  243. layoutConfig: {
  244. columns: 2
  245. },
  246. items:[{
  247. html: 'Restart Device',
  248. frame: false,
  249. border: false
  250. },{
  251. xtype: 'button',
  252. id: 'rstBTN',
  253. text: 'Full Reset',
  254. handler: function(){
  255. Ext.Msg.show({
  256. title:'Reset Device?',
  257. msg: 'You are closing a tab that has unsaved changes. Would you like to save your changes?',
  258. buttons: Ext.Msg.YESNOCANCEL,
  259. //fn: processResult,
  260. animEl: 'rstBTN',
  261. icon: Ext.MessageBox.QUESTION
  262. });
  263. }
  264. }]
  265. },{
  266. title: 'Detection Settings',
  267. xtype: 'form',
  268. layout: 'table',
  269. defaults: {
  270. bodyStyle:'padding:20px'
  271. },
  272. layoutConfig: {
  273. columns: 4
  274. },
  275. items:[{
  276. html: 'Master Offset',
  277. frame: false,
  278. border: false
  279. },{
  280. xtype: 'numberfield',
  281. id: 'mlrf_offset',
  282. name: 'mlrf_offset',
  283. allowBlank: false,
  284. allowDecimals: false,
  285. maxText: 'The Range is: 0 - 60',
  286. maxValue: 60,
  287. minText: 'No Negative Values Allowed',
  288. minValue: 0,
  289. },{
  290. html: 'Slave Offset',
  291. frame: false,
  292. border: false
  293. },{
  294. xtype: 'numberfield',
  295. id: 'slrf_offset',
  296. name: 'slrf_offset',
  297. allowBlank: false,
  298. allowDecimals: false,
  299. maxText: 'The Range is: 0 - 60',
  300. maxValue: 60,
  301. minText: 'No Negative Values Allowed',
  302. minValue: 0,
  303. },{
  304. html: 'Master Delta',
  305. frame: false,
  306. border: false
  307. },{
  308. xtype: 'numberfield',
  309. id: 'mlrf_delta',
  310. name: 'mlrf_delta',
  311. allowBlank: false,
  312. allowDecimals: false,
  313. maxText: 'The Range is: 0 - 320',
  314. maxValue: 320,
  315. minText: 'No Negative Values Allowed',
  316. minValue: 0
  317. },{
  318. html: 'Slave Delta',
  319. frame: false,
  320. border: false
  321. },{
  322. xtype: 'numberfield',
  323. id: 'slrf_delta',
  324. name: 'slrf_delta',
  325. allowBlank: false,
  326. allowDecimals: false,
  327. maxText: 'The Range is: 0 - 320',
  328. maxValue: 320,
  329. minText: 'No Negative Values Allowed',
  330. minValue: 0
  331. },{
  332. html: 'Master Width',
  333. frame: false,
  334. border: false
  335. },{
  336. xtype: 'numberfield',
  337. id: 'mlrf_width',
  338. name: 'mlrf_width',
  339. allowBlank: false,
  340. allowDecimals: false,
  341. maxText: 'The Range is: 1800 - 16000',
  342. maxValue: 16000,
  343. minText: 'The Range is: 1800 - 16000',
  344. minValue: 1800
  345. },{
  346. html: 'Slave Width',
  347. frame: false,
  348. border: false
  349. },{
  350. xtype: 'numberfield',
  351. id: 'slrf_width',
  352. name: 'slrf_width',
  353. allowBlank: false,
  354. allowDecimals: false,
  355. maxText: 'The Range is: 1800 - 16000',
  356. maxValue: 16000,
  357. minText: 'The Range is: 1800 - 16000',
  358. minValue: 1800
  359. },{
  360. html: 'Master Order',
  361. frame: false,
  362. border: false
  363. },{
  364. xtype: 'numberfield',
  365. id: 'mlrf_order',
  366. name: 'mlrf_order',
  367. allowBlank: false,
  368. allowDecimals: false,
  369. maxText: 'The Range is: 0 - 10',
  370. maxValue: 10,
  371. minText: 'No Negative Values Allowed',
  372. minValue: 0
  373. },{
  374. html: 'Slave Order',
  375. frame: false,
  376. border: false
  377. },{
  378. xtype: 'numberfield',
  379. id: 'slrf_order',
  380. name: 'slrf_order',
  381. allowBlank: false,
  382. allowDecimals: false,
  383. maxText: 'The Range is: 0 - 10',
  384. maxValue: 10,
  385. minText: 'No Negative Values Allowed',
  386. minValue: 0
  387. },{
  388. html: 'Master SST',
  389. frame: false,
  390. border: false
  391. },{
  392. xtype: 'numberfield',
  393. id: 'mlrf_sst',
  394. name: 'mlrf_sst',
  395. allowBlank: false,
  396. allowDecimals: false,
  397. maxText: 'The Range is: 0 - 100',
  398. maxValue: 100,
  399. minText: 'No Negative Values Allowed',
  400. minValue: 0
  401. },{
  402. html: 'Slave SST',
  403. frame: false,
  404. border: false
  405. },{
  406. xtype: 'numberfield',
  407. id: 'slrf_sst',
  408. name: 'slrf_sst',
  409. allowBlank: false,
  410. allowDecimals: false,
  411. maxText: 'The Range is: 0 - 100',
  412. maxValue: 100,
  413. minText: 'No Negative Values Allowed',
  414. minValue: 0
  415. },{
  416. html: 'Mastr Flip',
  417. frame: false,
  418. border: false
  419. },{
  420. xtype: 'numberfield',
  421. id: 'mlrf_flip',
  422. name: 'mlrf_flip',
  423. allowBlank: false,
  424. allowDecimals: false,
  425. maxText: 'The Range is: 8 - 128',
  426. maxValue: 128,
  427. minText: 'The Range is: 8 - 128',
  428. minValue: 8
  429. },{
  430. html: 'Slave Flip',
  431. frame: false,
  432. border: false
  433. },{
  434. xtype: 'numberfield',
  435. id: 'slrf_flip',
  436. name: 'slrf_flip',
  437. allowBlank: false,
  438. allowDecimals: false,
  439. maxText: 'The Range is: 8 - 128',
  440. maxValue: 128,
  441. minText: 'The Range is: 8 - 128',
  442. minValue: 8
  443. },{
  444. html: 'Master Sun',
  445. frame: false,
  446. border: false
  447. },{
  448. xtype: 'numberfield',
  449. id: 'mlrf_sun',
  450. name: 'mlrf_sun',
  451. allowBlank: false,
  452. allowDecimals: false,
  453. maxText: 'The Range is: 0 - 100',
  454. maxValue: 100,
  455. minText: 'No Negative Values Allowed',
  456. minValue: 0
  457. },{
  458. html: 'Slave Sun',
  459. frame: false,
  460. border: false
  461. },{
  462. xtype: 'numberfield',
  463. id: 'slrf_sun',
  464. name: 'slrf_sun',
  465. allowBlank: false,
  466. allowDecimals: false,
  467. maxText: 'The Range is: 0 - 100',
  468. maxValue: 100,
  469. minText: 'No Negative Values Allowed',
  470. minValue: 0
  471. }]
  472. },{
  473. title: 'Embed Options'
  474. },{
  475. title: 'Target Width Table'
  476. }]
  477. }
  478. });
  479. };
  480. LRF1D2_st_win.show();
  481. loadFullLRF1D2Data( SelectedNodeID );
  482. };
  483. function LRF2D2_settings(){
  484. };
  485. function LRF16D3_settings(){
  486. };
  487. var currentResolveDeviceNode = 0;
  488. var ResolveDeviceNodeWin = null;
  489. function resolveDeviceMistmatch( NodeID ){
  490. currentResolveDeviceNode = NodeID;
  491. if( ResolveDeviceNodeWin == null ){
  492. ResolveDeviceNodeWin = new Ext.Window({
  493. title: '<?=$Labels->GetLabel('_WDEV_MISTMATCH_');?>',
  494. modal: true,
  495. width: 500,
  496. height: 200,
  497. closeAction: 'hide',
  498. items:[{
  499. xtype: 'spacer',
  500. style: {
  501. marginTop: '13px'
  502. },
  503. html: '<center><?=$Labels->GetLabel('_DEV_MISTMATT1_');?></center>',
  504. height: 30
  505. },{
  506. xtype: 'button',
  507. width: '100%',
  508. text: 'Apply Existing Detection Profiles to Newly Connected Device',
  509. handler: function(){
  510. Ext.Ajax.request({
  511. url: '/lib/controller/validateNode.php',
  512. params: {
  513. NID: currentResolveDeviceNode,
  514. UID: '<?=$CUser->Data['id'];?>',
  515. SID: '<?=$Session;?>',
  516. MET: 1
  517. },
  518. success: function( response, opts ){
  519. ResolveDeviceNodeWin.hide();
  520. },
  521. failure: failureAJAXFunction
  522. });
  523. }
  524. },{
  525. xtype: 'button',
  526. width: '100%',
  527. text: 'Discard old Detection Profiles and Start Device Setup Wizard',
  528. handler: function(){
  529. ResolveDeviceNodeWin.hide();
  530. startDeviceDetectionWizard( currentResolveDeviceNode );
  531. }
  532. },{
  533. xtype: 'button',
  534. width: '100%',
  535. text: 'Discard old Detection Profiles and Load Factory Settings from Device'
  536. },{
  537. xtype: 'button',
  538. width: '100%',
  539. text: 'Discard this Connection for NOW'
  540. }]
  541. });
  542. };
  543. ResolveDeviceNodeWin.show();
  544. };
  545. var DeviceDetectionWizardWnd = null;
  546. var DDWizardActiveDevice = '';
  547. var RangeSetBlocker = false;
  548. function startDeviceDetectionWizard( NodeID ){
  549. DDWizardActiveDevice = NodeID
  550. if( DeviceDetectionWizardWnd == null ){
  551. DeviceDetectionWizardWnd = new Ext.Window({
  552. title: '<?=$Labels->GetLabel('_WDEV_DET_WIZT_');?>',
  553. modal: true,
  554. width: 500,
  555. height: 208,
  556. closeAction: 'hide',
  557. items:[{
  558. xtype: 'tabpanel',
  559. activeTab: 1,
  560. items: [{
  561. title: '<?=$Labels->GetLabel('_WDEV_DET_WIZ0_');?>',
  562. frame: false,
  563. xtype: 'form',
  564. items:[{
  565. xtype: 'spacer',
  566. height: 20
  567. },{
  568. xtype: 'combo',
  569. id: 'DDWizST',
  570. fieldLabel: '<?=$Labels->GetLabel('_DEV_TYPE_FLD_');?>',
  571. typeAhead: true,
  572. triggerAction: 'all',
  573. lazyRender:true,
  574. mode: 'local',
  575. store: new Ext.data.ArrayStore({
  576. id: 0,
  577. fields: [
  578. 'dtId',
  579. 'dtText'
  580. ],
  581. data: [
  582. [1, '<?=$Labels->GetLabel('_DEV_TYPE_ALS_');?>'],
  583. [2, '<?=$Labels->GetLabel('_DEV_TYPE_LFS_');?>'],
  584. [3, '<?=$Labels->GetLabel('_DEV_TYPE_PLS200_');?>'],
  585. [4, '<?=$Labels->GetLabel('_DEV_TYPE_PLS360_');?>'],
  586. [5, '<?=$Labels->GetLabel('_DEV_TYPE_3D_');?>'],
  587. [6, '<?=$Labels->GetLabel('_DEV_TYPE_NPLS200_');?>']
  588. ]
  589. }),
  590. valueField: 'dtId',
  591. displayField: 'dtText'
  592. },{
  593. xtype: 'numberfield',
  594. id: 'DDWizSR',
  595. fieldLabel: '<?=$Labels->GetLabel('_DEV_RANGE_FLD_');?>',
  596. minValue: 15.0,
  597. maxValue: 300.0,
  598. listeners:{
  599. change: function( m, nv, ov ){
  600. if( RangeSetBlocker ) return;
  601. RangeSetBlocker = true;
  602. Ext.getCmp('DDWizSRS').setValue( nv );
  603. RangeSetBlocker = false;
  604. }
  605. }
  606. },{
  607. xtype: 'slider',
  608. id: 'DDWizSRS',
  609. fieldLabel: '<?=$Labels->GetLabel('_DEV_RANGE_FLD_');?>',
  610. minValue: 15.0,
  611. maxValue: 300.0,
  612. listeners:{
  613. change: function( m, nv, ov ){
  614. if( RangeSetBlocker ) return;
  615. RangeSetBlocker = true;
  616. Ext.getCmp('DDWizSR').setValue( nv );
  617. RangeSetBlocker = false;
  618. }
  619. }
  620. },{
  621. xtype: 'spacer',
  622. height: 10
  623. }]
  624. },{
  625. title: '<?=$Labels->GetLabel('_WDEV_DET_WIZ1_');?>',
  626. frame: false,
  627. xtype: 'form',
  628. labelWidth: 120,
  629. items:[{
  630. xtype: 'spacer',
  631. height: 20
  632. },{
  633. xtype: 'combo',
  634. id: 'DDWizIT',
  635. fieldLabel: '<?=$Labels->GetLabel('_DEV_ITYPE_FLD_');?>',
  636. typeAhead: true,
  637. triggerAction: 'all',
  638. lazyRender:true,
  639. mode: 'local',
  640. value: 1,
  641. store: new Ext.data.ArrayStore({
  642. id: 0,
  643. fields: [
  644. 'dpId',
  645. 'dpText'
  646. ],
  647. data: [
  648. [1, '<?=$Labels->GetLabel('_DEV_PL_HORI_');?>'],
  649. [2, '<?=$Labels->GetLabel('_DEV_PL_VERT_');?>'],
  650. [3, '<?=$Labels->GetLabel('_DEV_PL_ANG_');?>']
  651. ]
  652. }),
  653. valueField: 'dpId',
  654. displayField: 'dpText'
  655. }]
  656. },{
  657. title: '<?=$Labels->GetLabel('_WDEV_DET_WIZ2_');?>',
  658. html: 'Another one'
  659. },{
  660. title: '<?=$Labels->GetLabel('_WDEV_DET_WIZ3_');?>',
  661. html: 'Another one'
  662. }]
  663. }],
  664. bbar:[{
  665. text: 'Create Profiles And Finish',
  666. handler: function(){
  667. DeviceDetectionWizardWnd.hide();
  668. }
  669. },{
  670. text: 'Advanced Config',
  671. handler: function(){
  672. DeviceDetectionWizardWnd.hide();
  673. startAdvancedDeviceDetection( DDWizardActiveDevice );
  674. }
  675. }]
  676. });
  677. };
  678. Ext.Ajax.request({
  679. url: '/lib/controller/getNodeBasicNfo.php',
  680. params: {
  681. NID: DDWizardActiveDevice,
  682. UID: '<?=$CUser->Data['id'];?>',
  683. SID: '<?=$Session;?>'
  684. },
  685. success: function( response, opts ){
  686. var data = Ext.decode(response.responseText);
  687. DeviceDetectionWizardWnd.setTitle( '<?=$Labels->GetLabel('_WDEV_DET_WIZT_');?> [' + data.name+']' );
  688. Ext.getCmp('DDWizST').setValue( data.type );
  689. RangeSetBlocker = true;
  690. Ext.getCmp('DDWizSR').setValue( data.range );
  691. Ext.getCmp('DDWizSRS').setValue( data.range );
  692. RangeSetBlocker = false;
  693. DeviceDetectionWizardWnd.show();
  694. },
  695. failure: failureAJAXFunction
  696. });
  697. };
  698. var DeviceDetectionAdvancedWnd = null;
  699. var DeviceDetectionProfileNames = ['factory default', 'low sens', 'medium sens', 'high sens'];
  700. function loadAdvancedDeviceDetectionSettings(){
  701. Ext.getCmp('ADD_TP').removeAll( false );
  702. Ext.Ajax.request({
  703. url: '/lib/controller/getNodeAdvancedNfo.php',
  704. params: {
  705. NID: DDWizardActiveDevice,
  706. UID: '<?=$CUser->Data['id'];?>',
  707. SID: '<?=$Session;?>'
  708. },
  709. success: function( response, opts ){
  710. var data = Ext.decode(response.responseText);
  711. DeviceDetectionAdvancedWnd.setTitle( '<?=$Labels->GetLabel('_WDEV_DET_WIZT_');?> [' + data.name+']' );
  712. if( data.profiles.length > 0 ){
  713. if( data.profiles.length > 3 ) Ext.getCmp('ADD_PADD_BTN').disable();
  714. switch( data.type ){
  715. case 1:
  716. case 5:{
  717. for( i = 0; i < data.profiles.length / 2; i++){
  718. };
  719. break;
  720. };
  721. case 2:
  722. case 3:
  723. case 4:
  724. case 6:{
  725. for( i = 0; i < data.profiles.length; i++){
  726. Ext.getCmp('ADD_TP').add({
  727. title: DeviceDetectionProfileNames[ data.profiles[i].id ],
  728. xtype: 'form',
  729. frame: false,
  730. items:[{xtype: 'spacer', height: 10 },{
  731. xtype: 'numberfield',
  732. id: 'OFFSET_P'+data.profiles[i].id,
  733. fieldLabel: 'OFFSET',
  734. minValue: 15.0,
  735. maxValue: 300.0,
  736. value: data.profiles[i].offset
  737. },{
  738. xtype: 'numberfield',
  739. id: 'DELTA_P'+data.profiles[i].id,
  740. fieldLabel: 'DELTA',
  741. minValue: 15.0,
  742. maxValue: 300.0,
  743. value: data.profiles[i].delta
  744. },{
  745. xtype: 'numberfield',
  746. id: 'WIDTH_P'+data.profiles[i].id,
  747. fieldLabel: 'WIDTH',
  748. minValue: 15.0,
  749. maxValue: 300.0,
  750. value: data.profiles[i].width
  751. },{
  752. xtype: 'numberfield',
  753. id: 'SST_P'+data.profiles[i].id,
  754. fieldLabel: 'SST',
  755. minValue: 15.0,
  756. maxValue: 300.0,
  757. value: data.profiles[i].sst
  758. },{
  759. xtype: 'numberfield',
  760. id: 'FLIP_P'+data.profiles[i].id,
  761. fieldLabel: 'FLIP',
  762. minValue: 15.0,
  763. maxValue: 300.0,
  764. value: data.profiles[i].flip
  765. },{
  766. xtype: 'numberfield',
  767. id: 'SUN_P'+data.profiles[i].id,
  768. fieldLabel: 'SUN',
  769. minValue: 15.0,
  770. maxValue: 300.0,
  771. value: data.profiles[i].sun
  772. }]
  773. });
  774. };
  775. break;
  776. };
  777. };
  778. //
  779. } else {
  780. Ext.getCmp('ADD_TP').add({
  781. title: 'Error!',
  782. html: 'No Profiles Defined'
  783. });
  784. };
  785. DeviceDetectionAdvancedWnd.show();
  786. },
  787. failure: failureAJAXFunction
  788. });
  789. };
  790. function startAdvancedDeviceDetection( NodeID ){
  791. DDWizardActiveDevice = NodeID;
  792. if( DeviceDetectionAdvancedWnd == null ){
  793. DeviceDetectionAdvancedWnd = new Ext.Window({
  794. title: '<?=$Labels->GetLabel('_WDEV_DET_WIZT_');?>',
  795. modal: true,
  796. width: 500,
  797. height: 300,
  798. closeAction: 'hide',
  799. items:[{
  800. xtype: 'tabpanel',
  801. id: 'ADD_TP',
  802. frame: false,
  803. border: false,
  804. activeTab: 0,
  805. items: []
  806. }],
  807. bbar:[{
  808. id: 'ADD_PADD_BTN',
  809. text: 'Add Detection Profile',
  810. handler: function(){
  811. Ext.Ajax.request({
  812. url: '/lib/controller/addDetectionProfile.php',
  813. params: {
  814. NID: DDWizardActiveDevice,
  815. UID: '<?=$CUser->Data['id'];?>',
  816. SID: '<?=$Session;?>'
  817. },
  818. success: function( response, opts ){
  819. loadAdvancedDeviceDetectionSettings();
  820. },
  821. failure: failureAJAXFunction
  822. });
  823. }
  824. },{
  825. text: 'Apply And Finish'
  826. },{
  827. text: 'Use Wizard'
  828. }]
  829. });
  830. };
  831. loadAdvancedDeviceDetectionSettings();
  832. };