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.

1770 lines
47 KiB

​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. //<?php require_once('../../js_asm.php'); ?>
  2. var devices = new Array();
  3. var cameras = new Array();
  4. var systemDevicesAreLoadded = false;
  5. function loadSystemDevices(){
  6. Ext.Ajax.request({
  7. url: '/lib/controller/getSystemDevices.php',
  8. params: {
  9. UID: <?=$UserID;?>,
  10. SID: '<?=$Session;?>',
  11. },
  12. success: function( response, opts ){
  13. // If the response is JSON, you have to decode it
  14. var data = Ext.decode(response.responseText);
  15. devices = data.sensors;
  16. cameras = data.cameras;
  17. systemDevicesAreLoadded = true;
  18. },
  19. failure: failureAJAXFunction
  20. });
  21. };
  22. function getSensorByNodeId( NID ){
  23. if( systemDevicesAreLoadded ) for( i=0; i< devices.length; i++ ) if( devices[i].node_id == NID ) return devices[i];
  24. return null;
  25. };
  26. function getSensorById( SID ){
  27. if( systemDevicesAreLoadded ) for( i=0; i< devices.length; i++) if( devices[i].id == SID ) return devices[i];
  28. return null;
  29. };
  30. function getCameraByNodeId( NID ){
  31. if( systemDevicesAreLoadded ) for( i=0; i< cameras.length; i++) if( cameras[i].node_id == NID ) return cameras[i];
  32. return null;
  33. };
  34. function getCameraById( SID ){
  35. if( systemDevicesAreLoadded ) for( i=0; i< cameras.length; i++) if( cameras[i].id == SID ) return cameras[i];
  36. return null;
  37. };
  38. var UartListStore = new Ext.data.JsonStore({
  39. root: 'ports',
  40. totalProperty: 'totalCount',
  41. idProperty: 'uart_id',
  42. remoteSort: false,
  43. baseParams: {
  44. UID: '<?=$CUser->Data['id'];?>',
  45. SID: '<?=$Session;?>',
  46. SITE: <?=$SiteID;?>
  47. },
  48. fields: [{
  49. name: 'uart_id',
  50. type: 'int'
  51. },{
  52. name: 'uart_name',
  53. type: 'string'
  54. }],
  55. proxy : new Ext.data.HttpProxy({
  56. method: 'POST',
  57. prettyUrls: false,
  58. url: '/lib/controller/listUarts.php'
  59. })
  60. });
  61. var ServersListStore = new Ext.data.JsonStore({
  62. root: 'servers',
  63. totalProperty: 'totalCount',
  64. idProperty: 'server_id',
  65. remoteSort: false,
  66. baseParams: {
  67. UID: '<?=$CUser->Data['id'];?>',
  68. SID: '<?=$Session;?>',
  69. SITE: <?=$SiteID;?>
  70. },
  71. fields: [{
  72. name: 'server_id',
  73. type: 'int'
  74. },{
  75. name: 'server_name',
  76. type: 'string'
  77. }],
  78. proxy : new Ext.data.HttpProxy({
  79. method: 'POST',
  80. prettyUrls: false,
  81. url: '/lib/controller/listServers.php'
  82. })
  83. });
  84. var ServerListStore = new Ext.data.JsonStore({
  85. root: 'servers',
  86. totalProperty: 'totalCount',
  87. idProperty: 'server_id',
  88. remoteSort: false,
  89. baseParams: {
  90. UID: '<?=$CUser->Data['id'];?>',
  91. SID: '<?=$Session;?>',
  92. SITE: <?=$SiteID;?>
  93. },
  94. fields: [{
  95. name: 'server_id',
  96. type: 'int'
  97. },{
  98. name: 'server_name',
  99. type: 'string'
  100. }],
  101. proxy : new Ext.data.HttpProxy({
  102. method: 'POST',
  103. prettyUrls: false,
  104. url: '/lib/controller/listServers.php'
  105. })
  106. });
  107. function loadSettingsLidar3D( NodeID, Master ){
  108. SelectedNodeID = NodeID;
  109. Ext.Ajax.request({
  110. url: '/lib/controller/getSettingsLidsr3D.php',
  111. params: {
  112. NID: NodeID,
  113. MST: ((Master)?1:0),
  114. UID: <?=$UserID;?>,
  115. SID: '<?=$Session;?>',
  116. },
  117. success: function( response, opts ){
  118. // If the response is JSON, you have to decode it
  119. var data = Ext.decode(response.responseText);
  120. Ext.getCmp('setting_master_ip').setValue( data.ip_address );
  121. Ext.getCmp('setting_master_port').setValue( data.port );
  122. Ext.getCmp('setting_slave_ip').setValue( data.aux_ip_address );
  123. Ext.getCmp('setting_slave_port').setValue( data.aux_port );
  124. Ext.getCmp('setting_lat').setValue( data.lat );
  125. Ext.getCmp('setting_lon').setValue( data.lon );
  126. Ext.getCmp('setting_alt').setValue( data.alt );
  127. Ext.getCmp('setting_roll').setValue( data.roll );
  128. Ext.getCmp('setting_pitch').setValue( data.pitch );
  129. Ext.getCmp('setting_yaw').setValue( data.yaw );
  130. },
  131. failure: failureAJAXFunction
  132. });
  133. };
  134. function saveSettingsLidar3D( ){
  135. if( SelectedNodeID == 0 ) return;
  136. t1 = Ext.getCmp('setting_master_ip').getValue();
  137. t2 = Ext.getCmp('setting_master_port').getValue();
  138. t3 = Ext.getCmp('setting_slave_ip').getValue();
  139. t4 = Ext.getCmp('setting_slave_port').getValue();
  140. t5 = Ext.getCmp('setting_lat').getValue();
  141. t6 = Ext.getCmp('setting_lon').getValue();
  142. t7 = Ext.getCmp('setting_alt').getValue();
  143. t8 = Ext.getCmp('setting_roll').getValue();
  144. t9 = Ext.getCmp('setting_pitch').getValue();
  145. t10 = Ext.getCmp('setting_yaw').getValue();
  146. Ext.Ajax.request({
  147. url: '/lib/controller/setSettingsLidsr3D.php',
  148. params: {
  149. NID: SelectedNodeID,
  150. UID: <?=$UserID;?>,
  151. SID: '<?=$Session;?>',
  152. MIP: t1,
  153. MPP: t2,
  154. SIP: t3,
  155. SPP: t4,
  156. LAT: t5,
  157. LON: t6,
  158. ALT: t7,
  159. ROL: t8,
  160. PCH: t9,
  161. YAW: t10
  162. },
  163. success: function( response, opts ){
  164. // If the response is JSON, you have to decode it
  165. var data = Ext.decode(response.responseText);
  166. if( data.success == true ) {
  167. Ext.Msg.show({
  168. title:"<?=$Labels->GetLabel('_INFO_MSG_');?>",
  169. msg: "<?=$Labels->GetLabel('_SETTING_SAVE_OK_');?>",
  170. buttons: Ext.Msg.OK,//YESNOCANCEL,
  171. fn: function(){
  172. SettingsLidar3D.hide();
  173. },
  174. //animEl: 'elId',
  175. icon: Ext.MessageBox.INFO //QUESTION
  176. });
  177. } else {
  178. Ext.Msg.show({
  179. title: "<?=$Labels->GetLabel('_ERROR_MSG_');?>",
  180. msg: data['error'],
  181. buttons: Ext.Msg.OK,//YESNOCANCEL,
  182. fn: function(){
  183. SettingsLidar3D.hide();
  184. },
  185. //animEl: 'elId',
  186. icon: Ext.MessageBox.ERROR //QUESTION
  187. });
  188. };
  189. },
  190. failure: failureAJAXFunction
  191. });
  192. };
  193. function editSettingsLidar3D( NodeID, Master ){
  194. if( SettingsLidar3D == null ){
  195. SettingsLidar3D = new Ext.Window({
  196. modal: true,
  197. title: "<?=$Labels->GetLabel('_EDIT_LRF3D_SETTINGS_');?>",
  198. width: 773,
  199. height: 600,
  200. layout: 'fit',
  201. closeAction: 'hide',
  202. listeners:{
  203. beforehide : function(){
  204. Ext.getCmp('connectstarterbutton').toggle( false, false );
  205. }
  206. },
  207. items:[{
  208. layout: 'table',
  209. border: false,
  210. defaults: {
  211. // applied to each contained panel
  212. bodyStyle:'padding-top:10px;padding-left:20px;padding-right:20px;padding-bottom:10px;'
  213. },
  214. layoutConfig: {
  215. // The total column count must be specified here
  216. columns: 4
  217. },
  218. items: [{
  219. border: false,
  220. html: 'Master IP Address:'
  221. },{
  222. xtype: 'textfield',
  223. id: 'setting_master_ip',
  224. width: '70%'
  225. },{
  226. border: false,
  227. html: 'Port:'
  228. },{
  229. xtype: 'textfield',
  230. id: 'setting_master_port',
  231. width: '30%'
  232. },{
  233. border: false,
  234. html: 'Slave IP Address:'
  235. },{
  236. xtype: 'textfield',
  237. id: 'setting_slave_ip',
  238. width: '70%'
  239. },{
  240. border: false,
  241. html: 'Port:'
  242. },{
  243. xtype: 'textfield',
  244. id: 'setting_slave_port',
  245. width: '30%'
  246. },{
  247. border: false,
  248. html: 'Position Lat/Lon/Alt:'
  249. },{
  250. xtype: 'textfield',
  251. id: 'setting_lat',
  252. width: '30%'
  253. },{
  254. xtype: 'textfield',
  255. id: 'setting_lon',
  256. width: '30%'
  257. },{
  258. xtype: 'textfield',
  259. id: 'setting_alt',
  260. width: '30%'
  261. },{
  262. border: false,
  263. html: 'Orientation Roll/Pitch/Yaw:'
  264. },{
  265. xtype: 'textfield',
  266. id: 'setting_roll',
  267. width: '30%'
  268. },{
  269. xtype: 'textfield',
  270. id: 'setting_pitch',
  271. width: '30%'
  272. },{
  273. xtype: 'textfield',
  274. id: 'setting_yaw',
  275. width: '30%'
  276. }]
  277. }],
  278. bbar: [{
  279. text: '<?=$Labels->GetLabel("_CANCEL_");?>',
  280. handler: function(){
  281. SettingsLidar3D.hide();
  282. }
  283. },{
  284. text: '<?=$Labels->GetLabel("_SAVE_");?>',
  285. handler: SaveSettingsLidar3D
  286. }]
  287. });
  288. };
  289. SettingsLidar3D.show();
  290. loadSettingsLidar3D( NodeID, Master );
  291. };
  292. var devicesStore = new Ext.data.JsonStore({
  293. root: 'nodes',
  294. totalProperty: 'totalCount',
  295. idProperty: 'id',
  296. remoteSort: true,
  297. fields: [{
  298. name: 'id',
  299. type: 'int'
  300. },{
  301. name: 'name',
  302. type: 'string'
  303. },{
  304. name: 'hardware',
  305. type: 'string'
  306. },{
  307. name: 'caps',
  308. type: 'int'
  309. },{
  310. name: 'ip',
  311. type: 'string'
  312. },{
  313. name: 'mac',
  314. type: 'string'
  315. }],
  316. proxy : new Ext.data.HttpProxy({
  317. method: 'POST',
  318. prettyUrls: false,
  319. url: '/lib/controller/listDiscoveredCameraSources.php',
  320. headers: {
  321. 'UID': '<?=$CUser->Data['id'];?>',
  322. 'SID': '<?=$Session;?>'
  323. }
  324. })
  325. });
  326. var LRF1D2_st_win = null;
  327. var LRF2D2_st_win = null;
  328. var LRF16D3_st_win = null;
  329. var currentDeviceOperatioId = 0;
  330. var currentOperationTO = 0;
  331. var currentOperationTimer = null;
  332. var lastOperationCode = 0;
  333. function checkDeviceOperationStatus(){
  334. if( currentOperationTO ){
  335. currentOperationTO--;
  336. Ext.Ajax.request({
  337. url: '/lib/controller/checkDeviceOperation.php',
  338. params: {
  339. OID: currentDeviceOperatioId,
  340. UID: '<?=$CUser->Data['id'];?>',
  341. SID: '<?=$Session;?>'
  342. },
  343. success: function( response, opts ){
  344. var data = Ext.decode(response.responseText);
  345. if( !data.success ){
  346. Ext.MessageBox.hide();
  347. Ext.Msg.show({
  348. title:'Node Command Status',
  349. msg: data.msg,
  350. buttons: Ext.Msg.OK,
  351. icon: Ext.MessageBox.ERROR
  352. });
  353. } else {
  354. if( lastOperationCode != data.code || data.code == 0 ){
  355. lastOperationCode = data.code;
  356. currentOperationTO = 20;
  357. };
  358. if( data.code < 100 ){
  359. currentOperationTimer = window.setTimeout( checkDeviceOperationStatus, 100 );
  360. } else {
  361. Ext.MessageBox.hide();
  362. switch( data.code ){
  363. case 120:
  364. case 100:
  365. default:
  366. Ext.Msg.show({
  367. title:'Node Command Status',
  368. msg: 'Operation Complete',
  369. buttons: Ext.Msg.OK,
  370. icon: Ext.MessageBox.INFO
  371. });
  372. };
  373. };
  374. };
  375. },
  376. failure: failureAJAXFunction
  377. });
  378. } else {
  379. Ext.MessageBox.hide();
  380. Ext.Msg.show({
  381. title:'Node Command Status',
  382. msg: 'Operation Status - Time Out!',
  383. buttons: Ext.Msg.OK,
  384. icon: Ext.MessageBox.ERROR
  385. });
  386. };
  387. };
  388. function doDeviceOperation( NodeID, OpCode, Param='', nowait=false ){
  389. if( !nowait ){
  390. Ext.MessageBox.wait("<?=$Labels->GetLabel('_Loading_Calo_');?>","<?=$Labels->GetLabel('_Please_Wait_');?>",{
  391. width: '100%',
  392. hidden: true,
  393. progress: true,
  394. closable: false
  395. });
  396. };
  397. Ext.Ajax.request({
  398. url: '/lib/controller/doNodeOperation.php',
  399. params: {
  400. NID: NodeID,
  401. UID: '<?=$CUser->Data['id'];?>',
  402. CMD: OpCode,
  403. SID: '<?=$Session;?>',
  404. PARAM: Param
  405. },
  406. success: function( response, opts ){
  407. var data = Ext.decode(response.responseText);
  408. if( !data.success ){
  409. if( !nowait ) Ext.MessageBox.hide();
  410. Ext.Msg.show({
  411. title:'Node Command Status',
  412. msg: data.msg,
  413. buttons: Ext.Msg.OK,
  414. icon: Ext.MessageBox.ERROR
  415. });
  416. } else {
  417. if( !nowait ){
  418. currentDeviceOperatioId = data.operation_id;
  419. currentOperationTO = 20;
  420. lastOperationCode = 0;
  421. currentOperationTimer = window.setTimeout( checkDeviceOperationStatus, 100 );
  422. };
  423. };
  424. },
  425. failure: failureAJAXFunction
  426. });
  427. };
  428. function clearDeviceEvents( NodeID ){
  429. Ext.Ajax.request({
  430. url: '/lib/controller/clearEventCloud.php',
  431. params: {
  432. NID: NodeID,
  433. UID: '<?=$CUser->Data['id'];?>',
  434. SID: '<?=$Session;?>'
  435. },
  436. success: function( response, opts ){
  437. },
  438. failure: failureAJAXFunction
  439. });
  440. };
  441. function loadFullLRF1D2Data( NodeID ){
  442. if( LRF1D2_st_win == null ) return;
  443. Ext.Ajax.request({
  444. url: '/lib/controller/getSettingsLRF.php',
  445. params: {
  446. NID: NodeID,
  447. UID: '<?=$CUser->Data['id'];?>',
  448. SID: '<?=$Session;?>',
  449. },
  450. success: function( response, opts ){
  451. if( LRF1D2_st_win!= null ){
  452. var data = Ext.decode(response.responseText);
  453. if( data.online ){
  454. switch( data.data_status ){
  455. case 0: Ext.getCmp('dev_online').update('<p class="green_status">ONLINE/Data Incomplete</p>'); break;
  456. case 1: Ext.getCmp('dev_online').update('<p class="green_status">ONLINE/Synced</p>'); break;
  457. case 2: Ext.getCmp('dev_online').update('<p class="green_status">ONLINE/Data Not Applyed</p>'); break;
  458. };
  459. } else {
  460. switch( data.data_status ){
  461. case 0: Ext.getCmp('dev_online').update('<p class="blue_status">OFFLINE/Data Incomplete</p>'); break;
  462. case 1: Ext.getCmp('dev_online').update('<p class="blue_status">OFFLINE/Synced</p>'); break;
  463. case 2: Ext.getCmp('dev_online').update('<p class="blue_status">OFFLINE/Data Not Applyed</p>'); break;
  464. };
  465. };
  466. Ext.getCmp('dev_name').setValue( data.name );
  467. Ext.getCmp('serial_num').setValue( data.serial );
  468. Ext.getCmp('version_id').setValue( data.version );
  469. Ext.getCmp('device_id').setValue( data.device_id );
  470. Ext.getCmp('com_spd').setValue( data.com_spd );
  471. Ext.getCmp('max_range').setValue( data.max_range );
  472. Ext.getCmp('base_shift').setValue( data.base_shift );
  473. Ext.getCmp('com_spd').setValue( data.uart_speed );
  474. Ext.getCmp('mlrf_offset').setValue( data.m_offset );
  475. Ext.getCmp('slrf_offset').setValue( data.s_offset );
  476. Ext.getCmp('mlrf_delta').setValue( data.m_delta );
  477. Ext.getCmp('slrf_delta').setValue( data.s_delta );
  478. Ext.getCmp('mlrf_width').setValue( data.m_width );
  479. Ext.getCmp('slrf_width').setValue( data.s_width );
  480. Ext.getCmp('mlrf_order').setValue( data.m_order );
  481. Ext.getCmp('slrf_order').setValue( data.s_order );
  482. Ext.getCmp('mlrf_sst').setValue( data.m_sst );
  483. Ext.getCmp('slrf_sst').setValue( data.s_sst );
  484. Ext.getCmp('mlrf_flip').setValue( data.m_flip );
  485. Ext.getCmp('slrf_flip').setValue( data.s_flip );
  486. Ext.getCmp('mlrf_sun').setValue( data.m_sun );
  487. Ext.getCmp('slrf_sun').setValue( data.s_sun );
  488. };
  489. },
  490. failure: failureAJAXFunction
  491. });
  492. };
  493. function loadFullLRF2D2Data( NodeID ){
  494. if( LRF2D2_st_win == null ) return;
  495. Ext.Ajax.request({
  496. url: '/lib/controller/getSettingsLRF.php',
  497. params: {
  498. NID: NodeID,
  499. UID: '<?=$CUser->Data['id'];?>',
  500. SID: '<?=$Session;?>',
  501. },
  502. success: function( response, opts ){
  503. if( LRF2D2_st_win!= null ){
  504. var data = Ext.decode(response.responseText);
  505. if( data.online ){
  506. switch( data.data_status ){
  507. case 0: Ext.getCmp('LRF2D2_dev_status').update('<p class="green_status">ONLINE/Data Incomplete</p>'); break;
  508. case 1: Ext.getCmp('LRF2D2_dev_status').update('<p class="green_status">ONLINE/Synced</p>'); break;
  509. case 2: Ext.getCmp('LRF2D2_dev_status').update('<p class="green_status">ONLINE/Data Not Applyed</p>'); break;
  510. };
  511. } else {
  512. switch( data.data_status ){
  513. case 0: Ext.getCmp('LRF2D2_dev_status').update('<p class="blue_status">OFFLINE/Data Incomplete</p>'); break;
  514. case 1: Ext.getCmp('LRF2D2_dev_status').update('<p class="blue_status">OFFLINE/Synced</p>'); break;
  515. case 2: Ext.getCmp('LRF2D2_dev_status').update('<p class="blue_status">OFFLINE/Data Not Applyed</p>'); break;
  516. };
  517. };
  518. Ext.getCmp('LRF2D2_name').setValue( data.name );
  519. Ext.getCmp('LRF2D2_serial_num').setValue( data.serial );
  520. Ext.getCmp('LRF2D2_version_id').setValue( data.version );
  521. Ext.getCmp('LRF2D2_device_id').setValue( data.device_id );
  522. Ext.getCmp('LRF2D2_com_spd').setValue( data.com_spd );
  523. Ext.getCmp('LRF2D2_max_range').setValue( data.max_range );
  524. Ext.getCmp('LRF2D2_base_shift').setValue( data.base_shift );
  525. Ext.getCmp('LRF2D2_com_spd').setValue( data.uart_speed );
  526. Ext.getCmp('mlrf_offset').setValue( data.master_profile.offset );
  527. Ext.getCmp('slrf_offset').setValue( data.slave_profile.offset );
  528. Ext.getCmp('mlrf_delta').setValue( data.master_profile.delta );
  529. Ext.getCmp('slrf_delta').setValue( data.slave_profile.delta );
  530. Ext.getCmp('mlrf_width').setValue( data.master_profile.width );
  531. Ext.getCmp('slrf_width').setValue( data.slave_profile.width );
  532. Ext.getCmp('mlrf_order').setValue( data.master_profile.order );
  533. Ext.getCmp('slrf_order').setValue( data.slave_profile.order );
  534. Ext.getCmp('mlrf_sst').setValue( data.master_profile.sst );
  535. Ext.getCmp('slrf_sst').setValue( data.slave_profile.sst );
  536. Ext.getCmp('mlrf_flip').setValue( data.master_profile.flip );
  537. Ext.getCmp('slrf_flip').setValue( data.slave_profile.flip );
  538. Ext.getCmp('mlrf_sun').setValue( data.master_profile.sun );
  539. Ext.getCmp('slrf_sun').setValue( data.slave_profile.sun );
  540. };
  541. },
  542. failure: failureAJAXFunction
  543. });
  544. };
  545. function LRF1D2_settings(){
  546. if( LRF1D2_st_win == null ){
  547. LRF1D2_st_win = new Ext.Window({
  548. title: 'Sensor Settings',
  549. modal: true,
  550. width: 800,
  551. height: 600,
  552. closeAction: 'hide',
  553. items:{
  554. xtype: 'tabpanel',
  555. activeTab: 0,
  556. items:[{
  557. title: 'General Settings',
  558. xtype: 'form',
  559. layout: 'table',
  560. defaults: {
  561. bodyStyle:'padding:20px'
  562. },
  563. layoutConfig: {
  564. columns: 3
  565. },
  566. items:[{
  567. html: 'Status',
  568. frame: false,
  569. border: false
  570. },{
  571. html: '<p class="green_status">ONLINE</p>',
  572. id: 'dev_online',
  573. frame: false,
  574. border: false
  575. },{},{
  576. html: 'Device Title',
  577. frame: false,
  578. border: false
  579. },{
  580. xtype: 'field',
  581. id: 'dev_name',
  582. readOnly: false,
  583. value: 'KOKO'
  584. },{},{
  585. html: 'Serial Number',
  586. frame: false,
  587. border: false
  588. },{
  589. xtype: 'field',
  590. id: 'serial_num',
  591. readOnly: true,
  592. value: '1212'
  593. },{},{
  594. html: 'Version ID',
  595. frame: false,
  596. border: false
  597. },{
  598. xtype: 'field',
  599. id: 'version_id',
  600. readOnly: true,
  601. value: 'LiberManDA122'
  602. },{},{
  603. html: 'Device Adress',
  604. frame: false,
  605. border: false
  606. },{
  607. xtype: 'numberfield',
  608. id: 'device_id'
  609. },{
  610. xtype: 'button',
  611. id: 'upddiBTN',
  612. text: 'Update Device Address',
  613. handler: function(){
  614. Ext.Msg.show({
  615. title:'Update Device Address?',
  616. msg: 'Are you sure to do so?',
  617. buttons: Ext.Msg.YESNOCANCEL,
  618. //fn: processResult,
  619. animEl: 'upddiBTN',
  620. icon: Ext.MessageBox.QUESTION
  621. });
  622. }
  623. },{
  624. html: 'Device COM Speed',
  625. frame: false,
  626. border: false
  627. },{
  628. xtype: 'combo',
  629. id: 'com_spd',
  630. editable: false,
  631. typeAhead: true,
  632. triggerAction: 'all',
  633. width: '100%',
  634. lazyRender:true,
  635. mode: 'local',
  636. store: new Ext.data.ArrayStore({
  637. id: 0,
  638. fields: ['mySPD', 'displayText' ],
  639. data: [[4800,'4800'],[9600,'9600'],[14400,'14400'],[19200,'19200'],[38400, '38400'],[56000,'56000'],[57600,'57600'],[115200,'115200']]
  640. }),
  641. valueField: 'mySPD',
  642. displayField: 'displayText'
  643. },{
  644. xtype: 'button',
  645. id: 'updspBTN',
  646. text: 'Set Device Speed',
  647. handler: function(){
  648. Ext.Msg.show({
  649. title:'Update Device Speed?',
  650. msg: 'Are you sure to do so?',
  651. buttons: Ext.Msg.YESNOCANCEL,
  652. //fn: processResult,
  653. animEl: 'upddiBTN',
  654. icon: Ext.MessageBox.QUESTION
  655. });
  656. }
  657. },{
  658. html: 'Detection Maximal Range',
  659. frame: false,
  660. border: false
  661. },{
  662. xtype: 'numberfield',
  663. id: 'max_range',
  664. readOnly: true,
  665. value: '1212'
  666. },{},{
  667. html: 'Base Shift',
  668. frame: false,
  669. border: false
  670. },{
  671. xtype: 'numberfield',
  672. id: 'base_shift',
  673. readOnly: true,
  674. value: '1212'
  675. },{}]
  676. },{
  677. title: 'Mantenence',
  678. xtype: 'form',
  679. layout: 'table',
  680. defaults: {
  681. bodyStyle:'padding:20px'
  682. },
  683. layoutConfig: {
  684. columns: 2
  685. },
  686. items:[{
  687. html: 'Restart Device',
  688. frame: false,
  689. border: false
  690. },{
  691. xtype: 'button',
  692. id: 'rstBTN',
  693. text: 'Full Reset',
  694. handler: function(){
  695. Ext.Msg.show({
  696. title:'Reset Device?',
  697. msg: 'You are closing a tab that has unsaved changes. Would you like to save your changes?',
  698. buttons: Ext.Msg.YESNOCANCEL,
  699. //fn: processResult,
  700. animEl: 'rstBTN',
  701. icon: Ext.MessageBox.QUESTION
  702. });
  703. }
  704. }]
  705. },{
  706. title: 'Detection Settings',
  707. xtype: 'form',
  708. layout: 'table',
  709. defaults: {
  710. bodyStyle:'padding:20px'
  711. },
  712. layoutConfig: {
  713. columns: 4
  714. },
  715. items:[{
  716. html: 'Master Offset',
  717. frame: false,
  718. border: false
  719. },{
  720. xtype: 'numberfield',
  721. id: 'mlrf_offset',
  722. name: 'mlrf_offset',
  723. allowBlank: false,
  724. allowDecimals: false,
  725. maxText: 'The Range is: 0 - 60',
  726. maxValue: 60,
  727. minText: 'No Negative Values Allowed',
  728. minValue: 0,
  729. },{
  730. html: 'Slave Offset',
  731. frame: false,
  732. border: false
  733. },{
  734. xtype: 'numberfield',
  735. id: 'slrf_offset',
  736. name: 'slrf_offset',
  737. allowBlank: false,
  738. allowDecimals: false,
  739. maxText: 'The Range is: 0 - 60',
  740. maxValue: 60,
  741. minText: 'No Negative Values Allowed',
  742. minValue: 0,
  743. },{
  744. html: 'Master Delta',
  745. frame: false,
  746. border: false
  747. },{
  748. xtype: 'numberfield',
  749. id: 'mlrf_delta',
  750. name: 'mlrf_delta',
  751. allowBlank: false,
  752. allowDecimals: false,
  753. maxText: 'The Range is: 0 - 320',
  754. maxValue: 320,
  755. minText: 'No Negative Values Allowed',
  756. minValue: 0
  757. },{
  758. html: 'Slave Delta',
  759. frame: false,
  760. border: false
  761. },{
  762. xtype: 'numberfield',
  763. id: 'slrf_delta',
  764. name: 'slrf_delta',
  765. allowBlank: false,
  766. allowDecimals: false,
  767. maxText: 'The Range is: 0 - 320',
  768. maxValue: 320,
  769. minText: 'No Negative Values Allowed',
  770. minValue: 0
  771. },{
  772. html: 'Master Width',
  773. frame: false,
  774. border: false
  775. },{
  776. xtype: 'numberfield',
  777. id: 'mlrf_width',
  778. name: 'mlrf_width',
  779. allowBlank: false,
  780. allowDecimals: false,
  781. maxText: 'The Range is: 1800 - 16000',
  782. maxValue: 16000,
  783. minText: 'The Range is: 1800 - 16000',
  784. minValue: 1800
  785. },{
  786. html: 'Slave Width',
  787. frame: false,
  788. border: false
  789. },{
  790. xtype: 'numberfield',
  791. id: 'slrf_width',
  792. name: 'slrf_width',
  793. allowBlank: false,
  794. allowDecimals: false,
  795. maxText: 'The Range is: 1800 - 16000',
  796. maxValue: 16000,
  797. minText: 'The Range is: 1800 - 16000',
  798. minValue: 1800
  799. },{
  800. html: 'Master Order',
  801. frame: false,
  802. border: false
  803. },{
  804. xtype: 'numberfield',
  805. id: 'mlrf_order',
  806. name: 'mlrf_order',
  807. allowBlank: false,
  808. allowDecimals: false,
  809. maxText: 'The Range is: 0 - 10',
  810. maxValue: 10,
  811. minText: 'No Negative Values Allowed',
  812. minValue: 0
  813. },{
  814. html: 'Slave Order',
  815. frame: false,
  816. border: false
  817. },{
  818. xtype: 'numberfield',
  819. id: 'slrf_order',
  820. name: 'slrf_order',
  821. allowBlank: false,
  822. allowDecimals: false,
  823. maxText: 'The Range is: 0 - 10',
  824. maxValue: 10,
  825. minText: 'No Negative Values Allowed',
  826. minValue: 0
  827. },{
  828. html: 'Master SST',
  829. frame: false,
  830. border: false
  831. },{
  832. xtype: 'numberfield',
  833. id: 'mlrf_sst',
  834. name: 'mlrf_sst',
  835. allowBlank: false,
  836. allowDecimals: false,
  837. maxText: 'The Range is: 0 - 100',
  838. maxValue: 100,
  839. minText: 'No Negative Values Allowed',
  840. minValue: 0
  841. },{
  842. html: 'Slave SST',
  843. frame: false,
  844. border: false
  845. },{
  846. xtype: 'numberfield',
  847. id: 'slrf_sst',
  848. name: 'slrf_sst',
  849. allowBlank: false,
  850. allowDecimals: false,
  851. maxText: 'The Range is: 0 - 100',
  852. maxValue: 100,
  853. minText: 'No Negative Values Allowed',
  854. minValue: 0
  855. },{
  856. html: 'Mastr Flip',
  857. frame: false,
  858. border: false
  859. },{
  860. xtype: 'numberfield',
  861. id: 'mlrf_flip',
  862. name: 'mlrf_flip',
  863. allowBlank: false,
  864. allowDecimals: false,
  865. maxText: 'The Range is: 8 - 128',
  866. maxValue: 128,
  867. minText: 'The Range is: 8 - 128',
  868. minValue: 8
  869. },{
  870. html: 'Slave Flip',
  871. frame: false,
  872. border: false
  873. },{
  874. xtype: 'numberfield',
  875. id: 'slrf_flip',
  876. name: 'slrf_flip',
  877. allowBlank: false,
  878. allowDecimals: false,
  879. maxText: 'The Range is: 8 - 128',
  880. maxValue: 128,
  881. minText: 'The Range is: 8 - 128',
  882. minValue: 8
  883. },{
  884. html: 'Master Sun',
  885. frame: false,
  886. border: false
  887. },{
  888. xtype: 'numberfield',
  889. id: 'mlrf_sun',
  890. name: 'mlrf_sun',
  891. allowBlank: false,
  892. allowDecimals: false,
  893. maxText: 'The Range is: 0 - 100',
  894. maxValue: 100,
  895. minText: 'No Negative Values Allowed',
  896. minValue: 0
  897. },{
  898. html: 'Slave Sun',
  899. frame: false,
  900. border: false
  901. },{
  902. xtype: 'numberfield',
  903. id: 'slrf_sun',
  904. name: 'slrf_sun',
  905. allowBlank: false,
  906. allowDecimals: false,
  907. maxText: 'The Range is: 0 - 100',
  908. maxValue: 100,
  909. minText: 'No Negative Values Allowed',
  910. minValue: 0
  911. }]
  912. },{
  913. title: 'Embed Options'
  914. },{
  915. title: 'Target Width Table'
  916. }]
  917. }
  918. });
  919. };
  920. LRF1D2_st_win.show();
  921. loadFullLRF1D2Data( SelectedNodeID );
  922. };
  923. function LRF2D2_settings(){
  924. if( LRF2D2_st_win == null ){
  925. LRF2D2_st_win = new Ext.Window({
  926. title: 'Sensor Settings',
  927. modal: true,
  928. width: 800,
  929. height: 600,
  930. closeAction: 'hide',
  931. items:{
  932. xtype: 'tabpanel',
  933. activeTab: 0,
  934. items:[{
  935. title: 'General Settings',
  936. xtype: 'form',
  937. layout: 'table',
  938. defaults: {
  939. bodyStyle:'padding:20px'
  940. },
  941. layoutConfig: {
  942. columns: 3
  943. },
  944. items:[{
  945. html: 'Status',
  946. frame: false,
  947. border: false
  948. },{
  949. html: '<p class="green_status">ONLINE</p>',
  950. id: 'LRF2D2_dev_status',
  951. frame: false,
  952. border: false
  953. },{},{
  954. html: 'Device Title',
  955. frame: false,
  956. border: false
  957. },{
  958. xtype: 'field',
  959. id: 'LRF2D2_name',
  960. readOnly: false,
  961. value: ''
  962. },{},{
  963. html: 'Serial Number',
  964. frame: false,
  965. border: false
  966. },{
  967. xtype: 'field',
  968. id: 'LRF2D2_serial_num',
  969. readOnly: true,
  970. value: '1212'
  971. },{},{
  972. html: 'Version ID',
  973. frame: false,
  974. border: false
  975. },{
  976. xtype: 'field',
  977. id: 'LRF2D2_version_id',
  978. readOnly: true,
  979. value: 'LiberManDA122'
  980. },{},{
  981. html: 'Device Adress',
  982. frame: false,
  983. border: false
  984. },{
  985. xtype: 'numberfield',
  986. id: 'LRF2D2_device_id'
  987. },{
  988. xtype: 'button',
  989. text: 'Update Device Address',
  990. handler: function(){
  991. Ext.Msg.show({
  992. title:'Update Device Address?',
  993. msg: 'Are you sure to do so?',
  994. buttons: Ext.Msg.YESNOCANCEL,
  995. //fn: processResult,
  996. animEl: 'upddiBTN',
  997. icon: Ext.MessageBox.QUESTION
  998. });
  999. }
  1000. },{
  1001. html: 'Device COM Speed',
  1002. frame: false,
  1003. border: false
  1004. },{
  1005. xtype: 'combo',
  1006. id: 'LRF2D2_com_spd',
  1007. editable: false,
  1008. typeAhead: true,
  1009. triggerAction: 'all',
  1010. width: '100%',
  1011. lazyRender:true,
  1012. mode: 'local',
  1013. store: new Ext.data.ArrayStore({
  1014. id: 0,
  1015. fields: ['mySPD', 'displayText' ],
  1016. data: [[4800,'4800'],[9600,'9600'],[14400,'14400'],[19200,'19200'],[38400, '38400'],[56000,'56000'],[57600,'57600'],[115200,'115200']]
  1017. }),
  1018. valueField: 'mySPD',
  1019. displayField: 'displayText'
  1020. },{
  1021. xtype: 'button',
  1022. text: 'Set Device Speed',
  1023. handler: function(){
  1024. Ext.Msg.show({
  1025. title:'Update Device Speed?',
  1026. msg: 'Are you sure to do so?',
  1027. buttons: Ext.Msg.YESNOCANCEL,
  1028. //fn: processResult,
  1029. animEl: 'upddiBTN',
  1030. icon: Ext.MessageBox.QUESTION
  1031. });
  1032. }
  1033. },{
  1034. html: 'Detection Maximal Range',
  1035. frame: false,
  1036. border: false
  1037. },{
  1038. xtype: 'numberfield',
  1039. id: 'LRF2D2_max_range',
  1040. readOnly: false,
  1041. value: '1212'
  1042. },{},{
  1043. html: 'Base Shift',
  1044. frame: false,
  1045. border: false
  1046. },{
  1047. xtype: 'numberfield',
  1048. id: 'LRF2D2_base_shift',
  1049. readOnly: false,
  1050. value: '1212'
  1051. },{
  1052. xtype: 'button',
  1053. text: 'Update Base Shift',
  1054. handler: function(){
  1055. var bash = Ext.getCmp('LRF2D2_base_shift').getValue();
  1056. Ext.Ajax.request({
  1057. url: '/lib/controller/updateLrfSettings_baseshift.php',
  1058. params: {
  1059. NID: SelectedNodeID,
  1060. UID: '<?=$CUser->Data['id'];?>',
  1061. SID: '<?=$Session;?>',
  1062. PID: 0,
  1063. BASH: bash
  1064. },
  1065. success: function( response, opts ){
  1066. loadFullLRF2D2Data( SelectedNodeID );
  1067. },
  1068. failure: failureAJAXFunction
  1069. });
  1070. }
  1071. }]
  1072. },{
  1073. title: 'Detection Settings',
  1074. xtype: 'form',
  1075. layout: 'table',
  1076. defaults: {
  1077. bodyStyle:'padding:20px'
  1078. },
  1079. layoutConfig: {
  1080. columns: 4
  1081. },
  1082. items:[{
  1083. html: 'Master Offset',
  1084. frame: false,
  1085. border: false
  1086. },{
  1087. xtype: 'numberfield',
  1088. id: 'mlrf_offset',
  1089. name: 'mlrf_offset',
  1090. allowBlank: false,
  1091. allowDecimals: false,
  1092. maxText: 'The Range is: 0 - 60',
  1093. maxValue: 60,
  1094. minText: 'No Negative Values Allowed',
  1095. minValue: 0,
  1096. },{
  1097. html: 'Slave Offset',
  1098. frame: false,
  1099. border: false
  1100. },{
  1101. xtype: 'numberfield',
  1102. id: 'slrf_offset',
  1103. name: 'slrf_offset',
  1104. allowBlank: false,
  1105. allowDecimals: false,
  1106. maxText: 'The Range is: 0 - 60',
  1107. maxValue: 60,
  1108. minText: 'No Negative Values Allowed',
  1109. minValue: 0,
  1110. },{
  1111. html: 'Master Delta',
  1112. frame: false,
  1113. border: false
  1114. },{
  1115. xtype: 'numberfield',
  1116. id: 'mlrf_delta',
  1117. name: 'mlrf_delta',
  1118. allowBlank: false,
  1119. allowDecimals: false,
  1120. maxText: 'The Range is: 0 - 320',
  1121. maxValue: 320,
  1122. minText: 'No Negative Values Allowed',
  1123. minValue: 0
  1124. },{
  1125. html: 'Slave Delta',
  1126. frame: false,
  1127. border: false
  1128. },{
  1129. xtype: 'numberfield',
  1130. id: 'slrf_delta',
  1131. name: 'slrf_delta',
  1132. allowBlank: false,
  1133. allowDecimals: false,
  1134. maxText: 'The Range is: 0 - 320',
  1135. maxValue: 320,
  1136. minText: 'No Negative Values Allowed',
  1137. minValue: 0
  1138. },{
  1139. html: 'Master Width',
  1140. frame: false,
  1141. border: false
  1142. },{
  1143. xtype: 'numberfield',
  1144. id: 'mlrf_width',
  1145. name: 'mlrf_width',
  1146. allowBlank: false,
  1147. allowDecimals: false,
  1148. maxText: 'The Range is: 1800 - 16000',
  1149. maxValue: 16000,
  1150. minText: 'The Range is: 1800 - 16000',
  1151. minValue: 1800
  1152. },{
  1153. html: 'Slave Width',
  1154. frame: false,
  1155. border: false
  1156. },{
  1157. xtype: 'numberfield',
  1158. id: 'slrf_width',
  1159. name: 'slrf_width',
  1160. allowBlank: false,
  1161. allowDecimals: false,
  1162. maxText: 'The Range is: 1800 - 16000',
  1163. maxValue: 16000,
  1164. minText: 'The Range is: 1800 - 16000',
  1165. minValue: 1800
  1166. },{
  1167. html: 'Master Order',
  1168. frame: false,
  1169. border: false
  1170. },{
  1171. xtype: 'numberfield',
  1172. id: 'mlrf_order',
  1173. name: 'mlrf_order',
  1174. allowBlank: false,
  1175. allowDecimals: false,
  1176. maxText: 'The Range is: 0 - 10',
  1177. maxValue: 10,
  1178. minText: 'No Negative Values Allowed',
  1179. minValue: 0
  1180. },{
  1181. html: 'Slave Order',
  1182. frame: false,
  1183. border: false
  1184. },{
  1185. xtype: 'numberfield',
  1186. id: 'slrf_order',
  1187. name: 'slrf_order',
  1188. allowBlank: false,
  1189. allowDecimals: false,
  1190. maxText: 'The Range is: 0 - 10',
  1191. maxValue: 10,
  1192. minText: 'No Negative Values Allowed',
  1193. minValue: 0
  1194. },{
  1195. html: 'Master SST',
  1196. frame: false,
  1197. border: false
  1198. },{
  1199. xtype: 'numberfield',
  1200. id: 'mlrf_sst',
  1201. name: 'mlrf_sst',
  1202. allowBlank: false,
  1203. allowDecimals: false,
  1204. maxText: 'The Range is: 0 - 100',
  1205. maxValue: 100,
  1206. minText: 'No Negative Values Allowed',
  1207. minValue: 0
  1208. },{
  1209. html: 'Slave SST',
  1210. frame: false,
  1211. border: false
  1212. },{
  1213. xtype: 'numberfield',
  1214. id: 'slrf_sst',
  1215. name: 'slrf_sst',
  1216. allowBlank: false,
  1217. allowDecimals: false,
  1218. maxText: 'The Range is: 0 - 100',
  1219. maxValue: 100,
  1220. minText: 'No Negative Values Allowed',
  1221. minValue: 0
  1222. },{
  1223. html: 'Mastr Flip',
  1224. frame: false,
  1225. border: false
  1226. },{
  1227. xtype: 'numberfield',
  1228. id: 'mlrf_flip',
  1229. name: 'mlrf_flip',
  1230. allowBlank: false,
  1231. allowDecimals: false,
  1232. maxText: 'The Range is: 8 - 128',
  1233. maxValue: 128,
  1234. minText: 'The Range is: 8 - 128',
  1235. minValue: 8
  1236. },{
  1237. html: 'Slave Flip',
  1238. frame: false,
  1239. border: false
  1240. },{
  1241. xtype: 'numberfield',
  1242. id: 'slrf_flip',
  1243. name: 'slrf_flip',
  1244. allowBlank: false,
  1245. allowDecimals: false,
  1246. maxText: 'The Range is: 8 - 128',
  1247. maxValue: 128,
  1248. minText: 'The Range is: 8 - 128',
  1249. minValue: 8
  1250. },{
  1251. html: 'Master Sun',
  1252. frame: false,
  1253. border: false
  1254. },{
  1255. xtype: 'numberfield',
  1256. id: 'mlrf_sun',
  1257. name: 'mlrf_sun',
  1258. allowBlank: false,
  1259. allowDecimals: false,
  1260. maxText: 'The Range is: 0 - 100',
  1261. maxValue: 100,
  1262. minText: 'No Negative Values Allowed',
  1263. minValue: 0
  1264. },{
  1265. html: 'Slave Sun',
  1266. frame: false,
  1267. border: false
  1268. },{
  1269. xtype: 'numberfield',
  1270. id: 'slrf_sun',
  1271. name: 'slrf_sun',
  1272. allowBlank: false,
  1273. allowDecimals: false,
  1274. maxText: 'The Range is: 0 - 100',
  1275. maxValue: 100,
  1276. minText: 'No Negative Values Allowed',
  1277. minValue: 0
  1278. },{
  1279. xtype: 'button',
  1280. text: 'Update Detection Settings',
  1281. width: '100%',
  1282. colspan: 4,
  1283. handler: function(){
  1284. var MOFS=Ext.getCmp('mlrf_offset').getValue();
  1285. var MDEL=Ext.getCmp('mlrf_delta').getValue();
  1286. var MWIT=Ext.getCmp('mlrf_width').getValue();
  1287. var MORD=Ext.getCmp('mlrf_order').getValue();
  1288. var MSST=Ext.getCmp('mlrf_sst').getValue();
  1289. var MFLP=Ext.getCmp('mlrf_flip').getValue();
  1290. var MSUN=Ext.getCmp('mlrf_sun').getValue();
  1291. var SOFS=Ext.getCmp('slrf_offset').getValue();
  1292. var SDEL=Ext.getCmp('slrf_delta').getValue();
  1293. var SWIT=Ext.getCmp('slrf_width').getValue();
  1294. var SORD=Ext.getCmp('slrf_order').getValue();
  1295. var SSST=Ext.getCmp('slrf_sst').getValue();
  1296. var SFLP=Ext.getCmp('slrf_flip').getValue();
  1297. var SSUN=Ext.getCmp('slrf_sun').getValue();
  1298. Ext.Ajax.request({
  1299. url: '/lib/controller/updateDetecttionProfile.php',
  1300. params: {
  1301. NID: SelectedNodeID,
  1302. UID: '<?=$CUser->Data['id'];?>',
  1303. SID: '<?=$Session;?>',
  1304. PID: 0,
  1305. MOFS: MOFS,
  1306. MDEL: MDEL,
  1307. MWIT: MWIT,
  1308. MORD: MORD,
  1309. MSST: MSST,
  1310. MFLP: MFLP,
  1311. MSUN: MSUN,
  1312. SOFS: SOFS,
  1313. SDEL: SDEL,
  1314. SWIT: SWIT,
  1315. SORD: SORD,
  1316. SSST: SSST,
  1317. SFLP: SFLP,
  1318. SSUN: SSUN
  1319. },
  1320. success: function( response, opts ){
  1321. loadFullLRF2D2Data( SelectedNodeID );
  1322. },
  1323. failure: failureAJAXFunction
  1324. });
  1325. }
  1326. }]
  1327. },{
  1328. title: 'Embed Options'
  1329. },{
  1330. title: 'Target Width Table'
  1331. },{
  1332. title: 'Mantenence',
  1333. xtype: 'form',
  1334. layout: 'table',
  1335. defaults: {
  1336. bodyStyle:'padding:20px'
  1337. },
  1338. layoutConfig: {
  1339. columns: 2
  1340. },
  1341. items:[{
  1342. html: 'Restart Device',
  1343. frame: false,
  1344. border: false
  1345. },{
  1346. xtype: 'button',
  1347. id: 'rstBTN',
  1348. text: 'Full Reset',
  1349. handler: function(){
  1350. Ext.Msg.show({
  1351. title:'Reset Device?',
  1352. msg: 'You are closing a tab that has unsaved changes. Would you like to save your changes?',
  1353. buttons: Ext.Msg.YESNOCANCEL,
  1354. //fn: processResult,
  1355. animEl: 'rstBTN',
  1356. icon: Ext.MessageBox.QUESTION
  1357. });
  1358. }
  1359. }]
  1360. }]
  1361. }
  1362. });
  1363. };
  1364. LRF2D2_st_win.show();
  1365. loadFullLRF2D2Data( SelectedNodeID );
  1366. };
  1367. function LRF16D3_settings(){
  1368. };
  1369. var currentResolveDeviceNode = 0;
  1370. var ResolveDeviceNodeWin = null;
  1371. function resolveDeviceMistmatch( NodeID ){
  1372. currentResolveDeviceNode = NodeID;
  1373. if( ResolveDeviceNodeWin == null ){
  1374. ResolveDeviceNodeWin = new Ext.Window({
  1375. title: "<?=$Labels->GetLabel('_WDEV_MISTMATCH_');?>",
  1376. modal: true,
  1377. width: 500,
  1378. height: 200,
  1379. closeAction: 'hide',
  1380. items:[{
  1381. xtype: 'spacer',
  1382. style: {
  1383. marginTop: '13px'
  1384. },
  1385. html: "<center><?=$Labels->GetLabel('_DEV_MISTMATT1_');?></center>",
  1386. height: 30
  1387. },{
  1388. xtype: 'button',
  1389. width: '100%',
  1390. text: 'It is Newly Connected Device',
  1391. handler: function(){
  1392. Ext.Ajax.request({
  1393. url: '/lib/controller/validateNode.php',
  1394. params: {
  1395. NID: currentResolveDeviceNode,
  1396. UID: '<?=$CUser->Data['id'];?>',
  1397. SID: '<?=$Session;?>',
  1398. MET: 1
  1399. },
  1400. success: function( response, opts ){
  1401. ResolveDeviceNodeWin.hide();
  1402. },
  1403. failure: failureAJAXFunction
  1404. });
  1405. }
  1406. },{
  1407. xtype: 'button',
  1408. width: '100%',
  1409. text: "Apply Existing Detection Profiles to Newly Connected Device",
  1410. handler: function(){
  1411. Ext.Ajax.request({
  1412. url: '/lib/controller/validateNode.php',
  1413. params: {
  1414. NID: currentResolveDeviceNode,
  1415. UID: '<?=$CUser->Data['id'];?>',
  1416. SID: '<?=$Session;?>',
  1417. MET: 1
  1418. },
  1419. success: function( response, opts ){
  1420. ResolveDeviceNodeWin.hide();
  1421. },
  1422. failure: failureAJAXFunction
  1423. });
  1424. }
  1425. },{
  1426. xtype: 'button',
  1427. width: '100%',
  1428. text: "Discard old Detection Profiles and Start Device Setup Wizard",
  1429. handler: function(){
  1430. ResolveDeviceNodeWin.hide();
  1431. startDeviceDetectionWizard( currentResolveDeviceNode );
  1432. }
  1433. },{
  1434. xtype: 'button',
  1435. width: '100%',
  1436. text: "Discard old Detection Profiles and Load Factory Settings from Device"
  1437. },{
  1438. xtype: 'button',
  1439. width: '100%',
  1440. text: "Discard this Connection for NOW"
  1441. }]
  1442. });
  1443. };
  1444. ResolveDeviceNodeWin.show();
  1445. };
  1446. var DeviceDetectionWizardWnd = null;
  1447. var DDWizardActiveDevice = '';
  1448. var RangeSetBlocker = false;
  1449. function startDeviceDetectionWizard( NodeID ){
  1450. DDWizardActiveDevice = NodeID
  1451. if( DeviceDetectionWizardWnd == null ){
  1452. DeviceDetectionWizardWnd = new Ext.Window({
  1453. title: '<?=$Labels->GetLabel('_WDEV_DET_WIZT_');?>',
  1454. modal: true,
  1455. width: 500,
  1456. height: 208,
  1457. closeAction: 'hide',
  1458. items:[{
  1459. xtype: 'tabpanel',
  1460. activeTab: 1,
  1461. items: [{
  1462. title: "<?=$Labels->GetLabel('_WDEV_DET_WIZ0_');?>",
  1463. frame: false,
  1464. xtype: 'form',
  1465. items:[{
  1466. xtype: 'spacer',
  1467. height: 20
  1468. },{
  1469. xtype: 'combo',
  1470. id: 'DDWizST',
  1471. fieldLabel: "<?=$Labels->GetLabel('_DEV_TYPE_FLD_');?>",
  1472. typeAhead: true,
  1473. triggerAction: 'all',
  1474. lazyRender:true,
  1475. mode: 'local',
  1476. store: new Ext.data.ArrayStore({
  1477. id: 0,
  1478. fields: [
  1479. 'dtId',
  1480. 'dtText'
  1481. ],
  1482. data: [
  1483. [1, "<?=$Labels->GetLabel('_DEV_TYPE_ALS_');?>"],
  1484. [2, "<?=$Labels->GetLabel('_DEV_TYPE_LFS_');?>"],
  1485. [3, "<?=$Labels->GetLabel('_DEV_TYPE_PLS200_');?>"],
  1486. [4, "<?=$Labels->GetLabel('_DEV_TYPE_PLS360_');?>"],
  1487. [5, "<?=$Labels->GetLabel('_DEV_TYPE_3D_');?>"],
  1488. [6, "<?=$Labels->GetLabel('_DEV_TYPE_NPLS200_');?>"]
  1489. ]
  1490. }),
  1491. valueField: 'dtId',
  1492. displayField: 'dtText'
  1493. },{
  1494. xtype: 'numberfield',
  1495. id: 'DDWizSR',
  1496. fieldLabel: "<?=$Labels->GetLabel('_DEV_RANGE_FLD_');?>",
  1497. minValue: 15.0,
  1498. maxValue: 300.0,
  1499. listeners:{
  1500. change: function( m, nv, ov ){
  1501. if( RangeSetBlocker ) return;
  1502. RangeSetBlocker = true;
  1503. Ext.getCmp('DDWizSRS').setValue( nv );
  1504. RangeSetBlocker = false;
  1505. }
  1506. }
  1507. },{
  1508. xtype: 'slider',
  1509. id: 'DDWizSRS',
  1510. fieldLabel: "<?=$Labels->GetLabel('_DEV_RANGE_FLD_');?>",
  1511. minValue: 15.0,
  1512. maxValue: 300.0,
  1513. listeners:{
  1514. change: function( m, nv, ov ){
  1515. if( RangeSetBlocker ) return;
  1516. RangeSetBlocker = true;
  1517. Ext.getCmp('DDWizSR').setValue( nv );
  1518. RangeSetBlocker = false;
  1519. }
  1520. }
  1521. },{
  1522. xtype: 'spacer',
  1523. height: 10
  1524. }]
  1525. },{
  1526. title: "<?=$Labels->GetLabel('_WDEV_DET_WIZ1_');?>",
  1527. frame: false,
  1528. xtype: 'form',
  1529. labelWidth: 120,
  1530. items:[{
  1531. xtype: 'spacer',
  1532. height: 20
  1533. },{
  1534. xtype: 'combo',
  1535. id: 'DDWizIT',
  1536. fieldLabel: "<?=$Labels->GetLabel('_DEV_ITYPE_FLD_');?>",
  1537. typeAhead: true,
  1538. triggerAction: 'all',
  1539. lazyRender:true,
  1540. mode: 'local',
  1541. value: 1,
  1542. store: new Ext.data.ArrayStore({
  1543. id: 0,
  1544. fields: [
  1545. 'dpId',
  1546. 'dpText'
  1547. ],
  1548. data: [
  1549. [1, "<?=$Labels->GetLabel('_DEV_PL_HORI_');?>"],
  1550. [2, "<?=$Labels->GetLabel('_DEV_PL_VERT_');?>"],
  1551. [3, "<?=$Labels->GetLabel('_DEV_PL_ANG_');?>"]
  1552. ]
  1553. }),
  1554. valueField: 'dpId',
  1555. displayField: 'dpText'
  1556. }]
  1557. },{
  1558. title: "<?=$Labels->GetLabel('_WDEV_DET_WIZ2_');?>",
  1559. html: 'Another one'
  1560. },{
  1561. title: "<?=$Labels->GetLabel('_WDEV_DET_WIZ3_');?>",
  1562. html: 'Another one'
  1563. }]
  1564. }],
  1565. bbar:[{
  1566. text: "Create Profiles And Finish",
  1567. handler: function(){
  1568. DeviceDetectionWizardWnd.hide();
  1569. }
  1570. },{
  1571. text: "Advanced Config",
  1572. handler: function(){
  1573. DeviceDetectionWizardWnd.hide();
  1574. startAdvancedDeviceDetection( DDWizardActiveDevice );
  1575. }
  1576. }]
  1577. });
  1578. };
  1579. Ext.Ajax.request({
  1580. url: '/lib/controller/getNodeBasicNfo.php',
  1581. params: {
  1582. NID: DDWizardActiveDevice,
  1583. UID: '<?=$CUser->Data['id'];?>',
  1584. SID: '<?=$Session;?>'
  1585. },
  1586. success: function( response, opts ){
  1587. var data = Ext.decode(response.responseText);
  1588. DeviceDetectionWizardWnd.setTitle( "<?=$Labels->GetLabel('_WDEV_DET_WIZT_');?> [" + data.name+"]" );
  1589. Ext.getCmp('DDWizST').setValue( data.type );
  1590. RangeSetBlocker = true;
  1591. Ext.getCmp('DDWizSR').setValue( data.range );
  1592. Ext.getCmp('DDWizSRS').setValue( data.range );
  1593. RangeSetBlocker = false;
  1594. DeviceDetectionWizardWnd.show();
  1595. },
  1596. failure: failureAJAXFunction
  1597. });
  1598. };
  1599. var DeviceDetectionAdvancedWnd = null;
  1600. var DeviceDetectionProfileNames = ['factory default', 'low sens', 'medium sens', 'high sens'];
  1601. function loadAdvancedDeviceDetectionSettings(){
  1602. Ext.getCmp('ADD_TP').removeAll( false );
  1603. Ext.Ajax.request({
  1604. url: '/lib/controller/getNodeAdvancedNfo.php',
  1605. params: {
  1606. NID: DDWizardActiveDevice,
  1607. UID: '<?=$CUser->Data['id'];?>',
  1608. SID: '<?=$Session;?>'
  1609. },
  1610. success: function( response, opts ){
  1611. var data = Ext.decode(response.responseText);
  1612. DeviceDetectionAdvancedWnd.setTitle( "<?=$Labels->GetLabel('_WDEV_DET_WIZT_');?> ["+data.name+"]" );
  1613. if( data.profiles.length > 0 ){
  1614. if( data.profiles.length > 3 ) Ext.getCmp('ADD_PADD_BTN').disable();
  1615. switch( data.type ){
  1616. case 1:
  1617. case 5:{
  1618. for( i = 0; i < data.profiles.length / 2; i++){
  1619. };
  1620. break;
  1621. };
  1622. case 2:
  1623. case 3:
  1624. case 4:
  1625. case 6:{
  1626. for( i = 0; i < data.profiles.length; i++){
  1627. Ext.getCmp('ADD_TP').add({
  1628. title: DeviceDetectionProfileNames[ data.profiles[i].id ],
  1629. xtype: 'form',
  1630. frame: false,
  1631. items:[{xtype: 'spacer', height: 10 },{
  1632. xtype: 'numberfield',
  1633. id: 'OFFSET_P'+data.profiles[i].id,
  1634. fieldLabel: 'OFFSET',
  1635. minValue: 15.0,
  1636. maxValue: 300.0,
  1637. value: data.profiles[i].offset
  1638. },{
  1639. xtype: 'numberfield',
  1640. id: 'DELTA_P'+data.profiles[i].id,
  1641. fieldLabel: 'DELTA',
  1642. minValue: 15.0,
  1643. maxValue: 300.0,
  1644. value: data.profiles[i].delta
  1645. },{
  1646. xtype: 'numberfield',
  1647. id: 'WIDTH_P'+data.profiles[i].id,
  1648. fieldLabel: 'WIDTH',
  1649. minValue: 15.0,
  1650. maxValue: 300.0,
  1651. value: data.profiles[i].width
  1652. },{
  1653. xtype: 'numberfield',
  1654. id: 'SST_P'+data.profiles[i].id,
  1655. fieldLabel: 'SST',
  1656. minValue: 15.0,
  1657. maxValue: 300.0,
  1658. value: data.profiles[i].sst
  1659. },{
  1660. xtype: 'numberfield',
  1661. id: 'FLIP_P'+data.profiles[i].id,
  1662. fieldLabel: 'FLIP',
  1663. minValue: 15.0,
  1664. maxValue: 300.0,
  1665. value: data.profiles[i].flip
  1666. },{
  1667. xtype: 'numberfield',
  1668. id: 'SUN_P'+data.profiles[i].id,
  1669. fieldLabel: 'SUN',
  1670. minValue: 15.0,
  1671. maxValue: 300.0,
  1672. value: data.profiles[i].sun
  1673. }]
  1674. });
  1675. };
  1676. break;
  1677. };
  1678. };
  1679. //
  1680. } else {
  1681. Ext.getCmp('ADD_TP').add({
  1682. title: 'Error!',
  1683. html: 'No Profiles Defined'
  1684. });
  1685. };
  1686. DeviceDetectionAdvancedWnd.show();
  1687. },
  1688. failure: failureAJAXFunction
  1689. });
  1690. };
  1691. function startAdvancedDeviceDetection( NodeID ){
  1692. DDWizardActiveDevice = NodeID;
  1693. if( DeviceDetectionAdvancedWnd == null ){
  1694. DeviceDetectionAdvancedWnd = new Ext.Window({
  1695. title: '<?=$Labels->GetLabel('_WDEV_DET_WIZT_');?>',
  1696. modal: true,
  1697. width: 500,
  1698. height: 300,
  1699. closeAction: 'hide',
  1700. items:[{
  1701. xtype: 'tabpanel',
  1702. id: 'ADD_TP',
  1703. frame: false,
  1704. border: false,
  1705. activeTab: 0,
  1706. items: []
  1707. }],
  1708. bbar:[{
  1709. id: 'ADD_PADD_BTN',
  1710. text: 'Add Detection Profile',
  1711. handler: function(){
  1712. Ext.Ajax.request({
  1713. url: '/lib/controller/addDetectionProfile.php',
  1714. params: {
  1715. NID: DDWizardActiveDevice,
  1716. UID: '<?=$CUser->Data['id'];?>',
  1717. SID: '<?=$Session;?>'
  1718. },
  1719. success: function( response, opts ){
  1720. loadAdvancedDeviceDetectionSettings();
  1721. },
  1722. failure: failureAJAXFunction
  1723. });
  1724. }
  1725. },{
  1726. text: 'Apply And Finish'
  1727. },{
  1728. text: 'Use Wizard'
  1729. }]
  1730. });
  1731. };
  1732. loadAdvancedDeviceDetectionSettings();
  1733. };