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.

1828 lines
47 KiB

6 years ago
​
​
5 years ago
​
5 years ago
​
5 years ago
​
6 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
6 years ago
​
​
​
​
​
​
​
6 years ago
​
​
​
4 years ago
6 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
6 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
6 years ago
​
​
​
​
​
​
​
​
5 years ago
6 years ago
​
​
​
​
​
​
5 years ago
6 years ago
5 years ago
6 years ago
​
5 years ago
6 years ago
5 years ago
6 years ago
​
5 years ago
6 years ago
5 years ago
6 years ago
​
​
​
6 years ago
​
6 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
6 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
6 years ago
​
​
5 years ago
6 years ago
4 years ago
6 years ago
5 years ago
6 years ago
​
​
​
6 years ago
​
​
4 years ago
5 years ago
​
​
​
​
​
6 years ago
​
5 years ago
6 years ago
​
​
4 years ago
5 years ago
​
​
​
​
​
6 years ago
5 years ago
​
​
​
​
​
​
​
​
​
6 years ago
​
​
​
​
4 years ago
5 years ago
​
​
​
​
6 years ago
​
​
​
​
4 years ago
6 years ago
​
​
​
​
​
​
​
4 years ago
​
6 years ago
​
​
6 years ago
​
​
​
​
​
6 years ago
​
6 years ago
​
5 years ago
6 years ago
5 years ago
6 years ago
5 years ago
6 years ago
​
​
​
​
5 years ago
6 years ago
​
​
5 years ago
​
​
​
6 years ago
5 years ago
6 years ago
​
​
​
​
​
5 years ago
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
5 years ago
​
​
​
​
5 years ago
​
​
6 years ago
5 years ago
​
​
6 years ago
​
5 years ago
​
​
​
​
6 years ago
5 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 years ago
​
​
​
​
​
​
​
​
​
4 years ago
​
5 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
​
​
​
​
​
​
​
​
​
​
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
​
5 years ago
​
​
5 years ago
5 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
​
​
​
​
​
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
​
​
​
6 years ago
5 years ago
​
​
6 years ago
​
​
5 years ago
6 years ago
​
​
​
5 years ago
​
6 years ago
5 years ago
​
​
​
​
​
​
​
​
5 years ago
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 years ago
5 years ago
5 years ago
5 years ago
​
​
4 years ago
5 years ago
​
​
​
​
​
​
​
5 years ago
​
5 years ago
5 years ago
​
5 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 years ago
​
​
​
6 years ago
​
5 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 years ago
​
​
​
​
6 years ago
5 years ago
6 years ago
​
​
5 years ago
​
6 years ago
5 years ago
6 years ago
​
​
​
​
​
​
6 years ago
​
6 years ago
​
​
​
5 years ago
​
​
6 years ago
​
5 years ago
6 years ago
​
​
​
​
​
5 years ago
6 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 years ago
6 years ago
​
​
​
​
5 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
​
​
​
6 years ago
​
6 years ago
6 years ago
​
​
​
​
​
​
​
​
​
5 years ago
​
​
​
5 years ago
​
​
​
​
​
​
​
5 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 years ago
​
​
​
​
​
6 years ago
​
​
​
  1. //<?php require_once('../../js_asm.php'); ?>
  2. var SelectedCam = 0;
  3. var SelectedSource = 0;
  4. var SelectedCamTYPE = 0;
  5. var connectIPCamDialog = null;
  6. var connectAnalCamDialog = null;
  7. var addIpCamDialog = null;
  8. var addE2UDialog = null;
  9. var addAnalogCamDialog = null;
  10. var cameraListStore = new Ext.data.JsonStore({
  11. root: 'nodes',
  12. totalProperty: 'totalCount',
  13. idProperty: 'id',
  14. remoteSort: true,
  15. fields: [{
  16. name: 'id',
  17. type: 'int'
  18. },{
  19. name: 'name',
  20. type: 'string'
  21. },{
  22. name: 'hardware',
  23. type: 'string'
  24. },{
  25. name: 'caps',
  26. type: 'string'
  27. },{
  28. name: 'ip',
  29. type: 'string'
  30. },{
  31. name: 'mac',
  32. type: 'string'
  33. },{
  34. name: 'ena',
  35. type: 'int'
  36. }],
  37. proxy : new Ext.data.HttpProxy({
  38. method: 'POST',
  39. prettyUrls: false,
  40. url: '/lib/controller/listMediaSources.php',
  41. headers: {
  42. 'UID': '<?=$CUser->Data['id'];?>',
  43. 'SID': '<?=$Session;?>'
  44. }
  45. })
  46. });
  47. var sourceListStore = new Ext.data.JsonStore({
  48. root: 'nodes',
  49. totalProperty: 'totalCount',
  50. idProperty: 'id',
  51. remoteSort: true,
  52. fields: [{
  53. name: 'id',
  54. type: 'int'
  55. },{
  56. name: 'name',
  57. type: 'string'
  58. },{
  59. name: 'encode',
  60. type: 'string'
  61. },{
  62. name: 'bitrate',
  63. type: 'int'
  64. },{
  65. name: 'size',
  66. type: 'string'
  67. }]
  68. });
  69. var IPCameraListSelModel = new Ext.grid.RowSelectionModel({
  70. singleSelect: true,
  71. listeners: {
  72. rowselect: function(sm, row, rec) {
  73. SelectedCam = rec.data.id;
  74. var CB = Ext.getCmp('con_to_ip_src');
  75. if( rec.data.ena ){
  76. CB.enable();
  77. } else {
  78. CB.disable();
  79. };
  80. }
  81. }
  82. });
  83. var AnalogCameraListSelModel = new Ext.grid.RowSelectionModel({
  84. singleSelect: true,
  85. listeners: {
  86. rowselect: function(sm, row, rec) {
  87. SelectedSource = rec.data.id;
  88. var CB = Ext.getCmp('con_to_anal_src');
  89. var CC = Ext.getCmp('cha_an_strim_set');
  90. if( rec.data.ena ){
  91. CB.enable();
  92. CC.enable();
  93. } else {
  94. CB.disable();
  95. CC.disable();
  96. };
  97. }
  98. }
  99. });
  100. var sourceListSelModel = new Ext.grid.RowSelectionModel({
  101. singleSelect: true,
  102. listeners: {
  103. rowselect: function(sm, row, rec) {
  104. SelectedSource = rec.data.id;
  105. Ext.getCmp('pic_prev').update( '<center><img height="300px" src="/lib/controller/getVideoFeed.php?UID=<?=$CUser->Data['id'];?>&SID=<?=$Session;?>&FID='+SelectedSource+'"></center>' );
  106. }
  107. }
  108. });
  109. function camCapRenderer(val){
  110. var p1, p2, p3;
  111. if( ( val & 1 ) == 1 ){
  112. p1 = '<img src="/style/img/cam_cap3.png" alt="Video Source">';
  113. } else {
  114. p1 = '<img src="/style/img/cam_cap0.png" alt="NO Video Source">';
  115. };
  116. if( ( val & 2 ) == 2 ){
  117. p2 = '<img src="/style/img/cam_cap2.png" alt="Audio Source">';
  118. } else {
  119. p2 = '<img src="/style/img/cam_cap0.png" alt="NO Audio Source">';
  120. };
  121. if( ( val & 4 ) == 4 ){
  122. p3 = '<img src="/style/img/cam_cap1.png" alt="PTZ Control">';
  123. } else {
  124. p3 = '<img src="/style/img/cam_cap0.png" alt="NO PTZ Control">';
  125. };
  126. return p1+p2+p3;
  127. };
  128. var IPCameraListColModel = new Ext.grid.ColumnModel({
  129. columns: [
  130. {header: "id", width: 50, sortable: false, menuDisabled: true, align: 'center', fixed: true, css: 'vertical-align: middle;', dataIndex: 'id' },
  131. {header: "Type",width: 60, sortable: false, fixed: true, menuDisabled: true, /*renderer: camCapRenderer,*/ dataIndex: 'caps' },
  132. {header: "IP Address", width: 120, sortable: false, menuDisabled: true, align: 'left', css: 'vertical-align: middle;', dataIndex: 'ip' },
  133. {header: "MAC", width: 120, sortable: false, fixed: true, menuDisabled: true, align: 'left', css: 'vertical-align: middle;', dataIndex: 'mac' },
  134. {header: "Name", dataIndex: 'name' },
  135. {header: "HW", menuDisabled: true, dataIndex: 'hardware' }
  136. ],
  137. defaults: {
  138. sortable: true,
  139. menuDisabled: true,
  140. width: 100
  141. },
  142. listeners: {
  143. hiddenchange: function(cm, colIndex, hidden) {
  144. //saveConfig(colIndex, hidden);
  145. }
  146. }
  147. });
  148. var AnalogCameraListColModel = new Ext.grid.ColumnModel({
  149. columns: [
  150. {header: "id", width: 50, sortable: false, menuDisabled: true, align: 'center', fixed: true, css: 'vertical-align: middle;', dataIndex: 'id' },
  151. {header: "Type",width: 60, sortable: false, fixed: true, menuDisabled: true, /*renderer: camCapRenderer,*/ dataIndex: 'caps' },
  152. {header: "Frame Size", width: 60, sortable: false, menuDisabled: true, align: 'left', css: 'vertical-align: middle;', dataIndex: 'ip' },
  153. {header: "Device", width: 120, sortable: false, fixed: true, menuDisabled: true, align: 'left', css: 'vertical-align: middle;', dataIndex: 'mac' },
  154. {header: "Name", width: 200, dataIndex: 'name' },
  155. {header: "HW", menuDisabled: true, dataIndex: 'hardware' }
  156. ],
  157. defaults: {
  158. sortable: true,
  159. menuDisabled: true,
  160. width: 100
  161. },
  162. listeners: {
  163. hiddenchange: function(cm, colIndex, hidden) {
  164. //saveConfig(colIndex, hidden);
  165. }
  166. }
  167. });
  168. var sourceListColModel = new Ext.grid.ColumnModel({
  169. columns: [
  170. {header: "id", width: 50, sortable: false, menuDisabled: true, align: 'center', fixed: true, css: 'vertical-align: middle;', dataIndex: 'id' },
  171. {header: "Name", dataIndex: 'name' },
  172. {header: "Encoding",width: 120, sortable: false, fixed: true, menuDisabled: true, dataIndex: 'encode' },
  173. {header: "Frame", width: 120, sortable: false, menuDisabled: true, align: 'left', css: 'vertical-align: middle;', dataIndex: 'size' },
  174. {header: "Bitrate", width: 80, sortable: false, fixed: true, menuDisabled: true, align: 'left', css: 'vertical-align: middle;', dataIndex: 'bitrate' }
  175. ],
  176. defaults: {
  177. sortable: false,
  178. menuDisabled: true,
  179. width: 100
  180. },
  181. listeners: {
  182. hiddenchange: function(cm, colIndex, hidden) {
  183. //saveConfig(colIndex, hidden);
  184. }
  185. }
  186. });
  187. function discoverOnvifSources(){
  188. Ext.Ajax.request({
  189. url: '/lib/controller/listAndDiscoverOnvifSources.php',
  190. params: {
  191. NID: 0,
  192. UID: <?=$UserID;?>,
  193. SID: '<?=$Session;?>'
  194. },
  195. success: function( response, opts ){
  196. cameraListStore.reload();
  197. },
  198. failure: failureAJAXFunction
  199. });
  200. };
  201. function loadCameraSettings( SC ){
  202. Ext.Ajax.request({
  203. url: '/lib/controller/getCameraSettings.php',
  204. params: {
  205. CID: SC,
  206. UID: <?=$UserID;?>,
  207. SID: '<?=$Session;?>'
  208. },
  209. success: function( response, opts ){
  210. var data = Ext.decode( response.responseText );
  211. if( data.success ){
  212. } else {
  213. };
  214. },
  215. failure: function( response, opts ) {
  216. Ext.getCmp('cam_login').setValue('');
  217. Ext.getCmp('cam_password').setValue('');
  218. Ext.getCmp('cac_tab').enable();
  219. Ext.getCmp('str_tab').disable();
  220. Ext.getCmp('ptz_tab').disable();
  221. Ext.getCmp('loc_tab').disable();
  222. Ext.getCmp('coc_tabs').setActiveTab( 0 );
  223. sourceListStore.removeAll();
  224. }
  225. });
  226. };
  227. function preloadOnvifCredentials( SC ){
  228. showIPCamPropDialog();
  229. Ext.Ajax.request({
  230. url: '/lib/controller/getIpCamCredentials.php',
  231. params: {
  232. CID: SC,
  233. UID: <?=$UserID;?>,
  234. SID: '<?=$Session;?>'
  235. },
  236. success: function( response, opts ){
  237. var data = Ext.decode( response.responseText );
  238. if( data.success ){
  239. Ext.getCmp('cam_login').setValue( data.login );
  240. Ext.getCmp('cam_password').setValue( data.password );
  241. Ext.getCmp('cam_auth_mode').setValue( data.auth_mode );
  242. Ext.getCmp('acm_btn').enable();
  243. Ext.getCmp('cac_tab').disable();
  244. Ext.getCmp('lens_tab').enable();
  245. Ext.getCmp('str_tab').enable();
  246. Ext.getCmp('ptz_tab').enable();
  247. Ext.getCmp('coc_tabs').setActiveTab( 1 );
  248. sourceListStore.loadData( data, false );
  249. var tpic = document.getElementById('pic_prev');
  250. if( tpic != null ) tpic.src = '/lib/controller/getVideoFeed.php?UID=<?=$CUser->Data['id'];?>&SID<?=$Session;?>&FID='+data.nodes[0].id;
  251. //document.getElementById('pic_prev').src = '/lib/controller/getVideoFeed.php?UID=<?=$CUser->Data['id'];?>&SID<?=$Session;?>&FID='+data.nodes[0].id;
  252. } else {
  253. Ext.getCmp('cam_login').setValue('');
  254. Ext.getCmp('cam_password').setValue('');
  255. Ext.getCmp('cam_auth_mode').setValue( 0 );
  256. Ext.getCmp('acm_btn').disable();
  257. Ext.getCmp('cac_tab').enable();
  258. Ext.getCmp('lens_tab').disable();
  259. Ext.getCmp('str_tab').disable();
  260. Ext.getCmp('ptz_tab').disable();
  261. Ext.getCmp('coc_tabs').setActiveTab( 0 );
  262. sourceListStore.removeAll();
  263. if( data.error != null ){
  264. Ext.Msg.show({
  265. title:'<?=$Labels->GetLabel('Error_Message');?>',
  266. msg: data['error'],
  267. buttons: Ext.Msg.OK,//YESNOCANCEL,
  268. //fn: processResult,
  269. //animEl: 'elId',
  270. icon: Ext.MessageBox.ERROR //QUESTION
  271. });
  272. };
  273. };
  274. },
  275. failure: function( response, opts ) {
  276. Ext.getCmp('cam_login').setValue('');
  277. Ext.getCmp('cam_password').setValue('');
  278. Ext.getCmp('cam_auth_mode').setValue( 0 );
  279. Ext.getCmp('cac_tab').enable();
  280. Ext.getCmp('lens_tab').disable();
  281. Ext.getCmp('str_tab').disable();
  282. Ext.getCmp('ptz_tab').disable();
  283. Ext.getCmp('coc_tabs').setActiveTab( 0 );
  284. sourceListStore.removeAll();
  285. }
  286. });
  287. };
  288. function discoverOnvifProfiles( CamID, camUser, camPasswd, Auth ){
  289. Ext.Ajax.request({
  290. url: '/lib/controller/listAndDiscoverOnvifProfiles.php',
  291. params: {
  292. NID: 0,
  293. UID: <?=$UserID;?>,
  294. SID: '<?=$Session;?>',
  295. CID: CamID,
  296. GUG: camUser,
  297. GOG: camPasswd,
  298. GAT: Auth
  299. },
  300. success: function( response, opts ){
  301. var data = Ext.decode( response.responseText );
  302. Ext.getCmp('cac_tab').getEl().unmask();
  303. if( data['success'] == true ){
  304. Ext.getCmp('acm_btn').enable();
  305. Ext.getCmp('cac_tab').disable();
  306. Ext.getCmp('lens_tab').enable();
  307. Ext.getCmp('str_tab').enable();
  308. Ext.getCmp('ptz_tab').enable();
  309. Ext.getCmp('coc_tabs').setActiveTab( 1 );
  310. sourceListStore.loadData( data, false );
  311. var tpic = document.getElementById('pic_prev');
  312. if( tpic != null ) tpic.src = '/lib/controller/getVideoFeed.php?UID=<?=$CUser->Data['id'];?>&SID<?=$Session;?>&FID='+data.nodes[0].id;
  313. } else {
  314. Ext.Msg.show({
  315. title:'<?=$Labels->GetLabel('Error_Message');?>',
  316. msg: data['error'],
  317. width: 640,
  318. buttons: Ext.Msg.OK,//YESNOCANCEL,
  319. //fn: processResult,602811123
  320. //animEl: 'elId',
  321. icon: Ext.MessageBox.ERROR //QUESTION
  322. });
  323. };
  324. },
  325. failure: failureAJAXFunction
  326. });
  327. };
  328. var CamPropType = 0;
  329. function showIPCamPropDialog(){
  330. if( connectIPCamDialog == null ){
  331. connectIPCamDialog = new Ext.Window({
  332. modal: true,
  333. title: (CamPropType)?'<?=$Labels->GetLabel('_CON_2_IP_CAM_');?>':'IP Camera Settings',
  334. width: 600,
  335. height: 500,
  336. layout: 'vbox',
  337. closeAction: 'hide',
  338. border: false,
  339. items:[{
  340. xtype: 'form',
  341. width: '100%',
  342. labelWidth: 200,
  343. labelAlign: 'right',
  344. labelSeparator: '',
  345. items: [{
  346. xtype: 'spacer',
  347. height: 5
  348. },{
  349. id: 'cam_label',
  350. xtype: 'textfield',
  351. fieldLabel: '<?=$Labels->GetLabel('_CAM_MAP_NAME_');?>'
  352. //width: 200
  353. },{
  354. xtype: 'combo',
  355. fieldLabel: '<?=$Labels->GetLabel('_CTL_SERVER_NODE_');?>',
  356. lazyRender: true,
  357. id: 'cam_server_id',
  358. //width: 200,
  359. disabled: false,
  360. forceSelection: true,
  361. triggerAction: 'all',
  362. editable: false,
  363. disableKeyFilter: true,
  364. store: ServerListStore,
  365. valueField: 'server_id',
  366. displayField: 'server_name'
  367. },{
  368. xtype: 'spacer',
  369. height: 5
  370. }]
  371. },{
  372. id: 'coc_tabs',
  373. xtype: 'tabpanel',
  374. activeTab: 0,
  375. items: [{
  376. title: '<?=$Labels->GetLabel('_CAC_TAB_');?>',
  377. id: 'cac_tab',
  378. layout: 'table',
  379. width: '100%',
  380. border: false,
  381. disabled: false,
  382. defaults: {
  383. border: false,
  384. frame: false,
  385. bodyStyle: 'padding:10px'
  386. },
  387. layoutConfig: {
  388. columns: 3
  389. },
  390. items: [{
  391. colspan: 3,
  392. html: '<p align="center"><?=$Labels->GetLabel('_PROV_CAC_');?></p>'
  393. },{
  394. html: '<p align="right"><?=$Labels->GetLabel('_LOGIN_0_');?></p>',
  395. width: 170
  396. },{
  397. id: 'cam_login',
  398. xtype: 'textfield',
  399. width: 200
  400. },{
  401. html: '&nbsp;'
  402. },{
  403. html: '<p align="right"><?=$Labels->GetLabel('_PASSWORD_0_');?></p>'
  404. },{
  405. id: 'cam_password',
  406. xtype: 'textfield',
  407. inputType: 'password',
  408. width: 200
  409. },{
  410. html: '&nbsp;'
  411. },{
  412. html: '<p align="right"><?=$Labels->GetLabel('_AUTH_MODE_0_');?></p>'
  413. },{
  414. id: 'cam_auth_mode',
  415. xtype: 'combo',
  416. lazyRender: true,
  417. mode: 'local',
  418. forceSelection: true,
  419. triggerAction: 'all',
  420. editable: false,
  421. disableKeyFilter: true,
  422. store: new Ext.data.ArrayStore({
  423. fields: ['mode','mode_txt'],
  424. data: [
  425. [0,'BASIC'],
  426. [1,'DIGEST'],
  427. [2,'DIGEST_IE'],
  428. [3,'BEARER'],
  429. [4,'NEGOTIATE'],
  430. [5,'NTLM'],
  431. [6,'NTLM_WB'],
  432. [7,'ANY'],
  433. [8,'ANYSAFE'],
  434. [9,'ONLY'],
  435. [10,'AWS_SIGV4']
  436. ]
  437. }),
  438. valueField: 'mode',
  439. displayField: 'mode_txt',
  440. value: 0,
  441. width: 200
  442. },{
  443. html: '&nbsp;'
  444. },{
  445. html: '&nbsp;'
  446. },{
  447. xtype: 'button',
  448. text: 'Connect to Camera',
  449. width: '100%',
  450. handler: function(){
  451. Ext.getCmp('cac_tab').getEl().mask("Please wait...","x-mask-loading");
  452. var User = Ext.getCmp('cam_login').getValue();
  453. var Passwd = Ext.getCmp('cam_password').getValue();
  454. var Auth = Ext.getCmp('cam_auth_mode').getValue();
  455. discoverOnvifProfiles( SelectedCam, User, Passwd, Auth );
  456. }
  457. },{
  458. html: '&nbsp;'
  459. }]
  460. },{
  461. title: '<?=$Labels->GetLabel('_STREAMS_');?>',
  462. id: 'str_tab',
  463. frame: false,
  464. disabled: true,
  465. items:[{
  466. xtype: 'grid',
  467. //title: '<?=$Labels->GetLabel('_STREAMS_');?>',
  468. height: 124,
  469. frame: false,
  470. disableSelection: true,
  471. ds: sourceListStore,
  472. cm: sourceListColModel,
  473. sm: sourceListSelModel
  474. },{
  475. height: 300,
  476. id: 'pic_prev',
  477. width: 600,
  478. html: '<center><img height="300px" src="/style/img/cam_cap0.png"></center>'
  479. }]
  480. },{
  481. title: 'Lens Settings',
  482. id: 'lens_tab',
  483. disabled: true,
  484. items:[{
  485. layout: 'table',
  486. layoutConfig: {
  487. columns: 3
  488. },
  489. defaults: {
  490. frame: false,
  491. bodyStyle: 'padding:10px',
  492. border: false
  493. },
  494. items:[{
  495. width: 200,
  496. html: 'Sensor Size'
  497. },{
  498. xtype: 'combo',
  499. fieldLabel: 'Sensor Size',
  500. lazyRender: true,
  501. id: 'sens_size',
  502. mode: 'local',
  503. forceSelection: true,
  504. triggerAction: 'all',
  505. editable: false,
  506. disableKeyFilter: true,
  507. store: new Ext.data.ArrayStore({
  508. fields: ['size','size_txt'],
  509. data: [
  510. [0,'1/3.6"'],
  511. [1,'1/3.2"'],
  512. [2,'1/3"'],
  513. [3,'1/2.7"'],
  514. [4,'1/2"'],
  515. [5,'1/1.8"'],
  516. [6,'2/3"'],
  517. [7,'1"'],
  518. [8,'4/3"'],
  519. [9,'APS-C'],
  520. [10,'35 mm'],
  521. [11,'645']
  522. ]
  523. }),
  524. valueField: 'size',
  525. displayField: 'size_txt',
  526. value: 0
  527. },{
  528. html: '&nbsp;'
  529. },{
  530. html: 'Focal Length'
  531. },{
  532. xtype: 'combo',
  533. fieldLabel: 'Lens Focal Length',
  534. lazyRender: true,
  535. id: 'lens_fl',
  536. mode: 'local',
  537. forceSelection: true,
  538. triggerAction: 'all',
  539. editable: false,
  540. disableKeyFilter: true,
  541. store: new Ext.data.ArrayStore({
  542. fields: ['fl','fl_txt'],
  543. data: [
  544. [0,'2.7 mm.'],
  545. [1,'3.0 mm.'],
  546. [2,'3.2 mm.'],
  547. [3,'3.5 mm.'],
  548. [4,'3.7 mm.'],
  549. [5,'3.9 mm.'],
  550. [6,'4.0 mm.'],
  551. [7,'4.3 mm.'],
  552. [8,'4.8 mm.'],
  553. [9,'5.0 mm.'],
  554. [10,'5.1 mm.'],
  555. [11,'5.5 mm.'],
  556. [12,'5.8 mm.'],
  557. [13,'6.0 mm.'],
  558. [14,'6.2 mm.'],
  559. [15,'6.6 mm.'],
  560. [16,'7.0 mm.'],
  561. [17,'7.1 mm.'],
  562. [18,'7.5 mm.'],
  563. [19,'7.6 mm.'],
  564. [20,'8.0 mm.'],
  565. [21,'8.6 mm.'],
  566. [22,'8.9 mm.'],
  567. [23,'9.0 mm.'],
  568. [24,'9.2 mm.'],
  569. [25,'9.3 mm.'],
  570. [26,'10.0 mm.'],
  571. [27,'10.5 mm.'],
  572. [28,'10.6 mm.'],
  573. [29,'10.7 mm.'],
  574. [30,'11.0 mm.'],
  575. [31,'11.3 mm.'],
  576. [32,'12.0 mm.'],
  577. [33,'12.9 mm.'],
  578. [34,'13.0 mm.'],
  579. [35,'13.5 mm.'],
  580. [36,'13.6 mm.'],
  581. [37,'14.0 mm.'],
  582. [38,'14.6 mm.'],
  583. [39,'15.0 mm.'],
  584. [40,'15.1 mm.'],
  585. [41,'15.5 mm.'],
  586. [42,'16.0 mm.'],
  587. [43,'17.0 mm.'],
  588. [44,'17.5 mm.'],
  589. [44,'17.7 mm.'],
  590. [45,'18.0 mm.'],
  591. [46,'18.2 mm.'],
  592. [47,'19.0 mm.']
  593. ]
  594. }),
  595. valueField: 'fl',
  596. displayField: 'fl_txt',
  597. value: 0
  598. },{
  599. html: '&nbsp;'
  600. },{
  601. html: 'Fixed Zoom'
  602. },{
  603. xtype: 'radio',
  604. id: 'no_zoom',
  605. name: 'zoom_ena',
  606. value: 1,
  607. checked: true
  608. },{
  609. html: '&nbsp;'
  610. },{
  611. html: 'Variable Zoom'
  612. },{
  613. xtype: 'radio',
  614. id: 'on_zoom',
  615. hideLabel: false,
  616. fieldLabel: 'Variable Zoom',
  617. name: 'zoom_ena',
  618. value: 0,
  619. checked: false,
  620. handler: function( a, c ){
  621. if( c ){
  622. Ext.getCmp('zoom_val').enable();
  623. Ext.getCmp('zoom_val').setValue( 1 );
  624. var zz = Ext.getCmp('zoom_d');
  625. if( zz.rendered ) zz.update('<p>X&nbsp;1</p>');
  626. } else {
  627. Ext.getCmp('zoom_val').disable();
  628. var zz = Ext.getCmp('zoom_d');
  629. if( zz.rendered ) zz.update('&nbsp;');
  630. };
  631. }
  632. },{
  633. html: '&nbsp;'
  634. },{
  635. html: 'Zoom Ratio'
  636. },{
  637. xtype: 'slider',
  638. id: 'zoom_val',
  639. disabled: true,
  640. minValue: 1.0,
  641. maxValue: 40.0,
  642. listeners:{
  643. change: function( a, c, b ){
  644. var zz = Ext.getCmp('zoom_d');
  645. if( zz.rendered ) zz.update('<p>X&nbsp;'+ c + '</p>');
  646. }
  647. }
  648. },{
  649. id: 'zoom_d',
  650. html: '&nbsp;'
  651. }]
  652. }]
  653. },{
  654. title: '<?=$Labels->GetLabel('_PTZ_TAB_');?>',
  655. id: 'ptz_tab',
  656. disabled: true,
  657. items:[{
  658. layout: 'table',
  659. layoutConfig: {
  660. columns: 3
  661. },
  662. defaults: {
  663. frame: false,
  664. bodyStyle: 'padding:10px',
  665. border: false
  666. },
  667. items:[{
  668. width: 200,
  669. html: '<?=$Labels->GetLabel('__PTZ_CONTROL__');?>'
  670. },{
  671. xtype: 'combo',
  672. fieldLabel: '<?=$Labels->GetLabel('__PTZ_CONTROL__');?>',
  673. lazyRender: true,
  674. id: 'ptz_proto',
  675. mode: 'local',
  676. forceSelection: true,
  677. triggerAction: 'all',
  678. editable: false,
  679. disableKeyFilter: true,
  680. store: new Ext.data.ArrayStore({
  681. fields: ['type','type_txt'],
  682. data: [
  683. [0,'<?=$Labels->GetLabel('_NO_PTZ_');?>'],
  684. [1,'Sony VISCA'],
  685. [2,'Pelco-D'],
  686. [3,'OnVif'],
  687. [4,'PSIA'],
  688. [5,'GB/T28181']
  689. ]
  690. }),
  691. value: 0,
  692. valueField: 'type',
  693. displayField: 'type_txt',
  694. listeners:{
  695. change: function( a, c, b ){
  696. if( c > 0 ){
  697. if( c != 3 ){
  698. Ext.getCmp('uart_id').enable();
  699. Ext.getCmp('prot_id').enable();
  700. } else {
  701. Ext.getCmp('uart_id').disable();
  702. Ext.getCmp('prot_id').disable();
  703. };
  704. Ext.getCmp('pan_mode').enable();
  705. Ext.getCmp('tilt_mode').enable();
  706. Ext.getCmp('pan_ang').enable();
  707. Ext.getCmp('tilt_ang').enable();
  708. } else {
  709. Ext.getCmp('uart_id').disable();
  710. Ext.getCmp('prot_id').disable();
  711. Ext.getCmp('pan_mode').disable();
  712. Ext.getCmp('tilt_mode').disable();
  713. Ext.getCmp('pan_ang').disable();
  714. Ext.getCmp('tilt_ang').disable();
  715. };
  716. }
  717. }
  718. },{
  719. html: '&nbsp;'
  720. },{
  721. html: '<?=$Labels->GetLabel('_UART_PORT_');?>'
  722. },{
  723. xtype: 'combo',
  724. fieldLabel: '<?=$Labels->GetLabel('_UART_PORT_');?>',
  725. lazyRender: true,
  726. id: 'uart_id',
  727. mode: 'local',
  728. forceSelection: true,
  729. triggerAction: 'all',
  730. editable: false,
  731. disableKeyFilter: true,
  732. disabled: true,
  733. store: new Ext.data.ArrayStore({
  734. fields: ['uart','uart_txt'],
  735. data: [<?php
  736. $QS="SELECT re.aux_id, re.device FROM resources re LEFT JOIN nodes no ON( re.node_id = no.id ) WHERE ( re.type=1 OR re.type=129 ) AND no.site_id={$SiteID} ";
  737. $RR=$DATABASE->Query( $QS );
  738. if( count( $RR ) ){
  739. $RE=array();
  740. foreach( $RR as $R ){
  741. $RE[] = "[ {$R['aux_id']}, '{$R['device']}']";
  742. };
  743. echo implode( ',', $RE );
  744. } else {
  745. echo "[0, \"".$Labels->GetLabel('_NO_UARTS_DEF_')."\"]";
  746. };
  747. ?>]
  748. }),
  749. valueField: 'uart',
  750. displayField: 'uart_txt'
  751. },{
  752. html: '&nbsp;'
  753. },{
  754. html: '<?=$Labels->GetLabel('_CAM_PROTO_ID_');?>'
  755. },{
  756. xtype: 'numberfield',
  757. id: 'prot_id',
  758. width: '95%',
  759. disabled: true,
  760. minValue: 0,
  761. maxValue: 255
  762. },{
  763. html: '&nbsp;'
  764. },{
  765. html: 'Pan Model'
  766. },{
  767. xtype: 'combo',
  768. fieldLabel: 'Pan Model',
  769. lazyRender: true,
  770. id: 'pan_mode',
  771. disabled: true,
  772. mode: 'local',
  773. forceSelection: true,
  774. triggerAction: 'all',
  775. editable: false,
  776. disableKeyFilter: true,
  777. store: new Ext.data.ArrayStore({
  778. fields: ['pm','pm_txt'],
  779. data: [
  780. [0,'Regular'],
  781. [1,'Reversed']
  782. ]
  783. }),
  784. valueField: 'pm',
  785. displayField: 'pm_txt',
  786. value: 0
  787. },{
  788. html: '&nbsp;'
  789. },{
  790. html: 'Tottal Pan Angles'
  791. },{
  792. xtype: 'numberfield',
  793. id: 'pan_ang',
  794. width: '95%',
  795. disabled: true,
  796. minValue: 0,
  797. maxValue: 360,
  798. value: 360
  799. },{
  800. html: '&nbsp;'
  801. },{
  802. html: 'Tilt Model'
  803. },{
  804. xtype: 'combo',
  805. fieldLabel: 'Tilt Model',
  806. lazyRender: true,
  807. id: 'tilt_mode',
  808. disabled: true,
  809. mode: 'local',
  810. forceSelection: true,
  811. triggerAction: 'all',
  812. editable: false,
  813. disableKeyFilter: true,
  814. store: new Ext.data.ArrayStore({
  815. fields: ['tm','tm_txt'],
  816. data: [
  817. [0,'Regular'],
  818. [1,'Reversed'],
  819. [2,'Shifted 90°'],
  820. [3,'Rev-Shifted 90°']
  821. ]
  822. }),
  823. valueField: 'tm',
  824. displayField: 'tm_txt',
  825. value: 0
  826. },{
  827. html: '&nbsp;'
  828. },{
  829. html: 'Tottal Tilt Angles'
  830. },{
  831. xtype: 'numberfield',
  832. id: 'tilt_ang',
  833. width: '95%',
  834. disabled: true,
  835. minValue: 0,
  836. maxValue: 180,
  837. value: 90
  838. },{
  839. html: '&nbsp;'
  840. }]
  841. }]
  842. }]
  843. }],
  844. bbar:[{
  845. text: '<?=$Labels->GetLabel('_CANCEL_');?>',
  846. handler: function(){
  847. //addDialog.close();
  848. //addDialog = null;
  849. connectCamDialog.hide();
  850. //connectOnvifDialog = null;
  851. }
  852. },'->',{
  853. text: 'Add Camera to Map',
  854. id: 'acm_btn',
  855. disabled: true,
  856. handler: function(){
  857. var CLAB = Ext.getCmp('cam_label').getValue();
  858. var CPTZP = Ext.getCmp('ptz_proto').getValue();
  859. var CPTZU = Ext.getCmp('uart_id').getValue();
  860. var CPTZID = Ext.getCmp('prot_id').getValue();
  861. var CPANM = Ext.getCmp('pan_mode').getValue();
  862. var CTILTM = Ext.getCmp('tilt_mode').getValue();
  863. var CPANANG = Ext.getCmp('pan_ang').getValue();
  864. var CTILTANG = Ext.getCmp('tilt_ang').getValue();
  865. var CIMAGER = Ext.getCmp('sens_size').getValue();
  866. var CLFL = Ext.getCmp('lens_fl').getValue();
  867. var CZOOM = Ext.getCmp('zoom_val').getValue();
  868. var SRVID = Ext.getCmp('cam_server_id').getValue();
  869. var AllOK = true;
  870. if( CLAB == '' ) {
  871. AllOK = false;
  872. Ext.Msg.show({
  873. title:'Data Error!',
  874. msg: 'Please Provide Camera Name!',
  875. buttons: Ext.Msg.OK,
  876. icon: Ext.MessageBox.INFO
  877. });
  878. return;
  879. };
  880. if( SelectedSource == 0 ){
  881. AllOK = false;
  882. Ext.Msg.show({
  883. title:'Data Error!',
  884. msg: 'Please Select Image Source!',
  885. buttons: Ext.Msg.OK,
  886. icon: Ext.MessageBox.INFO
  887. });
  888. return;
  889. };
  890. if( SRVID == 0 ){
  891. AllOK = false;
  892. Ext.Msg.show({
  893. title:'Data Error!',
  894. msg: 'Please Select Server to Connect Camera!',
  895. buttons: Ext.Msg.OK,
  896. icon: Ext.MessageBox.INFO
  897. });
  898. return;
  899. };
  900. if( ( SelectedCamTYPE == 11 || SelectedCamTYPE == 13 ) && CPTZP == 0 ){
  901. AllOK = false;
  902. Ext.Msg.show({
  903. title:'Data Error!',
  904. msg: 'Please Provide PTZ Protocol type!',
  905. buttons: Ext.Msg.OK,
  906. icon: Ext.MessageBox.INFO
  907. });
  908. return;
  909. };
  910. if( ( CPTZP == 1 || CPTZP == 2 ) && CPTZU == 0 ){
  911. AllOK = false;
  912. Ext.Msg.show({
  913. title:'Data Error!',
  914. msg: 'Please Provide UART Port!',
  915. buttons: Ext.Msg.OK,
  916. icon: Ext.MessageBox.INFO
  917. });
  918. return;
  919. };
  920. if( ( CPTZP == 1 || CPTZP == 2 ) && CPTZID == 0 ){
  921. AllOK = false;
  922. Ext.Msg.show({
  923. title:'Data Error!',
  924. msg: 'Please Provide Camera ID!',
  925. buttons: Ext.Msg.OK,
  926. icon: Ext.MessageBox.INFO
  927. });
  928. return;
  929. };
  930. if( AllOK ){
  931. Ext.Ajax.request({
  932. url: '/lib/controller/addNetworkNode.php',
  933. params: {
  934. SITEID: <?=$SiteID;?>,
  935. UID: <?=$UserID;?>,
  936. SID: '<?=$Session;?>',
  937. CID: SelectedCam,
  938. STREAM: SelectedSource,
  939. SRVID: SRVID,
  940. LAB: CLAB,
  941. UART: CPTZU,
  942. PROTOID: CPTZID,
  943. PANMODE: CPANM,
  944. TILTMODE: CTILTM,
  945. PANANG: CPANANG,
  946. TILTANG: CTILTANG,
  947. IMSIZE: CIMAGER,
  948. LFL: CLFL,
  949. ZOOM: CZOOM,
  950. PTZ: CPTZP,
  951. TYPE: SelectedCamTYPE
  952. },
  953. success: function( response, opts ){
  954. var data = Ext.decode(response.responseText);
  955. if( data.success ){
  956. addIpCamDialog.close();
  957. addIpCamDialog = null;
  958. connectIPCamDialog.close();
  959. connectIPCamDialog = null;
  960. } else {
  961. Ext.Msg.show({
  962. title:'Error Message',
  963. msg: data.msg,
  964. buttons: Ext.Msg.OK,//YESNOCANCEL,
  965. fn: function(){
  966. //SettingsLidar3D.hide();
  967. },
  968. //animEl: 'elId',
  969. icon: Ext.MessageBox.ERROR //QUESTION
  970. });
  971. };
  972. },
  973. failure: failureAJAXFunction
  974. });
  975. };
  976. }
  977. }]
  978. });
  979. } else {
  980. };
  981. connectIPCamDialog.show();
  982. };
  983. function showAnalCamPropDialog(){
  984. if( connectAnalCamDialog == null ){
  985. connectAnalCamDialog = new Ext.Window({
  986. modal: true,
  987. title: '<?=$Labels->GetLabel('_CREA_ANAL_CAM_');?>',
  988. width: 600,
  989. height: 500,
  990. layout: 'vbox',
  991. closeAction: 'hide',
  992. border: false,
  993. items:[{
  994. xtype: 'form',
  995. width: '100%',
  996. labelWidth: 200,
  997. labelAlign: 'right',
  998. labelSeparator: '',
  999. items: [{
  1000. xtype: 'spacer',
  1001. height: 5
  1002. },{
  1003. id: 'cam_label',
  1004. xtype: 'textfield',
  1005. fieldLabel: '<?=$Labels->GetLabel('_CAM_MAP_NAME_');?>'
  1006. //width: 200
  1007. },{
  1008. xtype: 'combo',
  1009. fieldLabel: '<?=$Labels->GetLabel('_CTL_SERVER_NODE_');?>',
  1010. lazyRender: true,
  1011. id: 'cam_server_id',
  1012. //width: 200,
  1013. disabled: false,
  1014. forceSelection: true,
  1015. triggerAction: 'all',
  1016. editable: false,
  1017. disableKeyFilter: true,
  1018. store: ServerListStore,
  1019. valueField: 'server_id',
  1020. displayField: 'server_name'
  1021. },{
  1022. xtype: 'spacer',
  1023. height: 5
  1024. }]
  1025. },{
  1026. id: 'coc_tabs',
  1027. xtype: 'tabpanel',
  1028. activeTab: 0,
  1029. items: [{
  1030. title: 'Lens Settings',
  1031. xtype: 'form',
  1032. id: 'lens_tab',
  1033. disabled: false,
  1034. items:[{
  1035. layout: 'table',
  1036. layoutConfig: {
  1037. columns: 3
  1038. },
  1039. defaults: {
  1040. frame: false,
  1041. bodyStyle: 'padding:10px',
  1042. border: false
  1043. },
  1044. items:[{
  1045. width: 200,
  1046. html: 'Sensor Size'
  1047. },{
  1048. xtype: 'combo',
  1049. fieldLabel: 'Sensor Size',
  1050. lazyRender: true,
  1051. id: 'sens_size',
  1052. mode: 'local',
  1053. store: new Ext.data.ArrayStore({
  1054. fields: ['size','size_txt'],
  1055. data: [
  1056. [0,'1/3.6"'],
  1057. [1,'1/3.2"'],
  1058. [2,'1/3"'],
  1059. [3,'1/2.7"'],
  1060. [4,'1/2"'],
  1061. [5,'1/1.8"'],
  1062. [6,'2/3"'],
  1063. [7,'1"'],
  1064. [8,'4/3"'],
  1065. [9,'APS-C'],
  1066. [10,'35 mm'],
  1067. [11,'645']
  1068. ]
  1069. }),
  1070. valueField: 'size',
  1071. displayField: 'size_txt'
  1072. },{
  1073. html: '&nbsp;'
  1074. },{
  1075. html: 'Fixed Zoom'
  1076. },{
  1077. xtype: 'radio',
  1078. id: 'no_zoom',
  1079. name: 'zoom_ena',
  1080. value: 0,
  1081. checked: true
  1082. },{
  1083. html: '&nbsp;'
  1084. },{
  1085. html: 'Variable Zoom'
  1086. },{
  1087. xtype: 'radio',
  1088. id: 'on_zoom',
  1089. hideLabel: false,
  1090. fieldLabel: 'Variable Zoom',
  1091. html: 'koko',
  1092. name: 'zoom_ena',
  1093. value: 1,
  1094. checked: false,
  1095. handler: function( a, c ){
  1096. if( c ){
  1097. Ext.getCmp('max_foc').enable();
  1098. Ext.getCmp('zoom_val').enable();
  1099. var mf = Ext.getCmp('min_foc').getValue();
  1100. if( mf > 0 ){
  1101. Ext.getCmp('max_foc').setValue( mf );
  1102. Ext.getCmp('zoom_val').setValue( 1 );
  1103. };
  1104. } else {
  1105. Ext.getCmp('max_foc').disable();
  1106. Ext.getCmp('zoom_val').disable();
  1107. Ext.getCmp('zoom_disp').update('&nbsp;');
  1108. };
  1109. }
  1110. },{
  1111. html: '&nbsp;'
  1112. },{
  1113. html: 'Min. Focal Length'
  1114. },{
  1115. xtype: 'numberfield',
  1116. id: 'min_foc',
  1117. width: '95%',
  1118. minValue: 1.0,
  1119. maxValue: 270.0
  1120. },{
  1121. html: '&nbsp;'
  1122. },{
  1123. html: 'Max. Focal Length'
  1124. },{
  1125. xtype: 'numberfield',
  1126. id: 'max_foc',
  1127. width: '95%',
  1128. disabled: true,
  1129. minValue: 1.0,
  1130. maxValue: 270.0,
  1131. listeners:{
  1132. change: function( a, c, b ){
  1133. if( b == c ) return;
  1134. var mf = Ext.getCmp('min_foc').getValue();
  1135. if( mf > 0 ){
  1136. if( c < mf ){
  1137. Ext.getCmp('max_foc').setValue( mf );
  1138. } else {
  1139. var zl = c / mf;
  1140. Ext.getCmp('zoom_val').setValue( zl );
  1141. };
  1142. };
  1143. }
  1144. }
  1145. },{
  1146. html: '&nbsp;'
  1147. },{
  1148. html: 'Zoom Ratio'
  1149. },{
  1150. xtype: 'slider',
  1151. id: 'zoom_val',
  1152. disabled: true,
  1153. minValue: 1.0,
  1154. maxValue: 40.0,
  1155. listeners:{
  1156. change: function( a, c, b ){
  1157. var mf = Ext.getCmp('min_foc').getValue();
  1158. if( mf > 0 ){
  1159. Ext.getCmp('max_foc').setValue( mf*c );
  1160. Ext.getCmp('zoom_disp').update('<p>X&nbsp;'+ c + '</p>');
  1161. };
  1162. }
  1163. }
  1164. },{
  1165. id: 'zoom_disp',
  1166. html: '&nbsp;'
  1167. }]
  1168. }]
  1169. },{
  1170. title: '<?=$Labels->GetLabel('_PTZ_TAB_');?>',
  1171. id: 'ptz_tab',
  1172. disabled: true,
  1173. items:[{
  1174. layout: 'table',
  1175. layoutConfig: {
  1176. columns: 3
  1177. },
  1178. defaults: {
  1179. frame: false,
  1180. bodyStyle: 'padding:10px',
  1181. border: false
  1182. },
  1183. items:[{
  1184. width: 200,
  1185. html: '<?=$Labels->GetLabel('__PTZ_CONTROL__');?>'
  1186. },{
  1187. xtype: 'combo',
  1188. fieldLabel: '<?=$Labels->GetLabel('__PTZ_CONTROL__');?>',
  1189. lazyRender: true,
  1190. id: 'ptz_proto',
  1191. mode: 'local',
  1192. forceSelection: true, triggerAction: 'all', editable: false, disableKeyFilter: true,
  1193. store: new Ext.data.ArrayStore({
  1194. fields: ['type','type_txt'],
  1195. data: [
  1196. [0,'<?=$Labels->GetLabel('_NO_PTZ_');?>'],
  1197. [1,'Sony VISCA'],
  1198. [2,'Pelco-D'],
  1199. [3,'OnVif'],
  1200. [4,'PSIA'],
  1201. [5,'GB/T28181']
  1202. ]
  1203. }),
  1204. valueField: 'type',
  1205. displayField: 'type_txt',
  1206. listeners:{
  1207. change: function( a, c, b ){
  1208. if( c > 0 ){
  1209. if( c != 3 ){
  1210. Ext.getCmp('uart_id').enable();
  1211. Ext.getCmp('prot_id').enable();
  1212. } else {
  1213. Ext.getCmp('uart_id').disable();
  1214. Ext.getCmp('prot_id').disable();
  1215. };
  1216. Ext.getCmp('pan_mode').enable();
  1217. Ext.getCmp('tilt_mode').enable();
  1218. Ext.getCmp('pan_ang').enable();
  1219. Ext.getCmp('tilt_ang').enable();
  1220. } else {
  1221. Ext.getCmp('uart_id').disable();
  1222. Ext.getCmp('prot_id').disable();
  1223. Ext.getCmp('pan_mode').disable();
  1224. Ext.getCmp('tilt_mode').disable();
  1225. Ext.getCmp('pan_ang').disable();
  1226. Ext.getCmp('tilt_ang').disable();
  1227. };
  1228. }
  1229. }
  1230. },{
  1231. html: '&nbsp;'
  1232. },{
  1233. html: '<?=$Labels->GetLabel('_UART_PORT_');?>'
  1234. },{
  1235. xtype: 'combo',
  1236. fieldLabel: '<?=$Labels->GetLabel('_UART_PORT_');?>',
  1237. lazyRender: true,
  1238. id: 'uart_id',
  1239. mode: 'local',
  1240. disabled: true,
  1241. forceSelection: true, triggerAction: 'all', editable: false, disableKeyFilter: true,
  1242. store: new Ext.data.ArrayStore({
  1243. fields: ['uart','uart_txt'],
  1244. data: [<?php
  1245. $QS="SELECT re.aux_id, re.device FROM resources re LEFT JOIN nodes no ON( re.node_id = no.id ) WHERE ( re.type=1 OR re.type=129 ) AND no.site_id={$SiteID} ";
  1246. $RR=$DATABASE->Query( $QS );
  1247. if( count( $RR ) ){
  1248. $RE=array();
  1249. foreach( $RR as $R ){
  1250. $RE[] = "[ {$R['aux_id']}, '{$R['device']}']";
  1251. };
  1252. echo implode( ',', $RE );
  1253. } else {
  1254. echo "[0, \"".$Labels->GetLabel('_NO_UARTS_DEF_')."\"]";
  1255. };
  1256. ?>]
  1257. }),
  1258. valueField: 'uart',
  1259. displayField: 'uart_txt'
  1260. },{
  1261. html: '&nbsp;'
  1262. },{
  1263. html: '<?=$Labels->GetLabel('_CAM_PROTO_ID_');?>'
  1264. },{
  1265. xtype: 'numberfield',
  1266. id: 'prot_id',
  1267. width: '95%',
  1268. disabled: true,
  1269. minValue: 0,
  1270. maxValue: 255
  1271. },{
  1272. html: '&nbsp;'
  1273. },{
  1274. html: 'Pan Model'
  1275. },{
  1276. xtype: 'combo',
  1277. fieldLabel: 'Pan Model',
  1278. lazyRender: true,
  1279. id: 'pan_mode',
  1280. forceSelection: true, triggerAction: 'all', editable: false, disableKeyFilter: true,
  1281. disabled: true,
  1282. mode: 'local',
  1283. store: new Ext.data.ArrayStore({
  1284. fields: ['pm','pm_txt'],
  1285. data: [
  1286. [0,'Regular'],
  1287. [1,'Reversed']
  1288. ]
  1289. }),
  1290. valueField: 'pm',
  1291. displayField: 'pm_txt'
  1292. },{
  1293. html: '&nbsp;'
  1294. },{
  1295. html: 'Tottal Pan Angles'
  1296. },{
  1297. xtype: 'numberfield',
  1298. id: 'pan_ang',
  1299. width: '95%',
  1300. disabled: true,
  1301. minValue: 0,
  1302. maxValue: 360
  1303. },{
  1304. html: '&nbsp;'
  1305. },{
  1306. html: 'Tilt Model'
  1307. },{
  1308. xtype: 'combo',
  1309. fieldLabel: 'Tilt Model',
  1310. lazyRender: true,
  1311. id: 'tilt_mode',
  1312. disabled: true,
  1313. forceSelection: true, triggerAction: 'all', editable: false, disableKeyFilter: true,
  1314. mode: 'local',
  1315. store: new Ext.data.ArrayStore({
  1316. fields: ['tm','tm_txt'],
  1317. data: [
  1318. [0,'Regular'],
  1319. [1,'Reversed'],
  1320. [2,'Shifted 90°'],
  1321. [3,'Rev-Shifted 90°']
  1322. ]
  1323. }),
  1324. valueField: 'tm',
  1325. displayField: 'tm_txt'
  1326. },{
  1327. html: '&nbsp;'
  1328. },{
  1329. html: 'Tottal Tilt Angles'
  1330. },{
  1331. xtype: 'numberfield',
  1332. id: 'tilt_ang',
  1333. width: '95%',
  1334. disabled: true,
  1335. minValue: 0,
  1336. maxValue: 180
  1337. },{
  1338. html: '&nbsp;'
  1339. }]
  1340. }]
  1341. }]
  1342. }],
  1343. bbar:[{
  1344. text: '<?=$Labels->GetLabel('_CANCEL_');?>',
  1345. handler: function(){
  1346. //connectAnalCamDialog.hide();
  1347. connectAnalCamDialog.close();
  1348. connectAnalCamDialog = null;
  1349. }
  1350. },'->',{
  1351. text: '<?=$Labels->GetLabel('_ADD_CAMERA2SITE_');?>',
  1352. id: 'acm_btn',
  1353. handler: function(){
  1354. var CLAB = Ext.getCmp('cam_label').getValue();
  1355. var CPTZP = Ext.getCmp('ptz_proto').getValue();
  1356. var CPTZU = Ext.getCmp('uart_id').getValue();
  1357. var CPTZID = Ext.getCmp('prot_id').getValue();
  1358. var CPANM = Ext.getCmp('pan_mode').getValue();
  1359. var CTILTM = Ext.getCmp('tilt_mode').getValue();
  1360. var CPANANG = Ext.getCmp('pan_ang').getValue();
  1361. var CTILTANG = Ext.getCmp('tilt_ang').getValue();
  1362. var CIMAGER = Ext.getCmp('sens_size').getValue();
  1363. var CMINF = Ext.getCmp('min_foc').getValue();
  1364. var CMAXF = Ext.getCmp('max_foc').getValue();
  1365. var SRVID = Ext.getCmp('cam_server_id').getValue();
  1366. var AllOK = true;
  1367. if( CLAB == '' ) {
  1368. AllOK = false;
  1369. Ext.Msg.show({
  1370. title:'Data Error!',
  1371. msg: 'Please Provide Camera Name!',
  1372. buttons: Ext.Msg.OK,
  1373. icon: Ext.MessageBox.INFO
  1374. });
  1375. return;
  1376. };
  1377. if( SelectedSource == 0 ){
  1378. AllOK = false;
  1379. Ext.Msg.show({
  1380. title:'Data Error!',
  1381. msg: 'Please Select Image Source!',
  1382. buttons: Ext.Msg.OK,
  1383. icon: Ext.MessageBox.INFO
  1384. });
  1385. return;
  1386. };
  1387. if( SRVID == 0 ){
  1388. AllOK = false;
  1389. Ext.Msg.show({
  1390. title:'Data Error!',
  1391. msg: 'Please Select Server to Connect Camera!',
  1392. buttons: Ext.Msg.OK,
  1393. icon: Ext.MessageBox.INFO
  1394. });
  1395. return;
  1396. };
  1397. if( ( SelectedCamTYPE == 11 || SelectedCamTYPE == 13 ) && CPTZP == 0 ){
  1398. AllOK = false;
  1399. Ext.Msg.show({
  1400. title:'Data Error!',
  1401. msg: 'Please Provide PTZ Protocol type!',
  1402. buttons: Ext.Msg.OK,
  1403. icon: Ext.MessageBox.INFO
  1404. });
  1405. return;
  1406. };
  1407. if( ( CPTZP == 1 || CPTZP == 2 ) && CPTZU == 0 ){
  1408. AllOK = false;
  1409. Ext.Msg.show({
  1410. title:'Data Error!',
  1411. msg: 'Please Provide UART Port!',
  1412. buttons: Ext.Msg.OK,
  1413. icon: Ext.MessageBox.INFO
  1414. });
  1415. return;
  1416. };
  1417. if( ( CPTZP == 1 || CPTZP == 2 ) && CPTZID == 0 ){
  1418. AllOK = false;
  1419. Ext.Msg.show({
  1420. title:'Data Error!',
  1421. msg: 'Please Provide Camera ID!',
  1422. buttons: Ext.Msg.OK,
  1423. icon: Ext.MessageBox.INFO
  1424. });
  1425. return;
  1426. };
  1427. if( AllOK ){
  1428. Ext.Ajax.request({
  1429. url: '/lib/controller/addNetworkNode.php',
  1430. params: {
  1431. SITEID: <?=$SiteID;?>,
  1432. UID: <?=$UserID;?>,
  1433. SID: '<?=$Session;?>',
  1434. CID: SelectedCam,
  1435. STREAM: SelectedSource,
  1436. SRVID: SRVID,
  1437. LAB: CLAB,
  1438. UART: CPTZU,
  1439. PROTOID: CPTZID,
  1440. PANMODE: CPANM,
  1441. TILTMODE: CTILTM,
  1442. PANANG: CPANANG,
  1443. TILTANG: CTILTANG,
  1444. IMSIZE: CIMAGER,
  1445. FMIN: CMINF,
  1446. FMAX: CMAXF,
  1447. PTZ: CPTZP,
  1448. TYPE: SelectedCamTYPE
  1449. },
  1450. success: function( response, opts ){
  1451. var data = Ext.decode(response.responseText);
  1452. if( data.success ){
  1453. reloadNetworkData();
  1454. addAnalogCamDialog.close();
  1455. addAnalogCamDialog = null;
  1456. connectAnalCamDialog.close();
  1457. connectAnalCamDialog = null;
  1458. } else {
  1459. Ext.Msg.show({
  1460. title:'Data Error!',
  1461. msg: data.msg,
  1462. buttons: Ext.Msg.OK,
  1463. icon: Ext.MessageBox.ERROR
  1464. });
  1465. };
  1466. //loadSystemEditor();
  1467. },
  1468. failure: failureAJAXFunction
  1469. });
  1470. };
  1471. }
  1472. }]
  1473. });
  1474. } else {
  1475. };
  1476. connectAnalCamDialog.show();
  1477. if( SelectedCamTYPE == 11 ){
  1478. Ext.getCmp('ptz_tab').enable();
  1479. Ext.getCmp('on_zoom').enable();
  1480. } else {
  1481. Ext.getCmp('ptz_tab').disable();
  1482. Ext.getCmp('on_zoom').disable();
  1483. };
  1484. };
  1485. function connectToSeleced(){
  1486. CamPropType = 1;
  1487. if( SelectedCam > 0 ){
  1488. preloadOnvifCredentials( SelectedCam );
  1489. //loadCameraSettings( SelectedCam );
  1490. };
  1491. };
  1492. function addIpCam(){
  1493. if( addIpCamDialog == null ){
  1494. addIpCamDialog = new Ext.Window({
  1495. modal: true,
  1496. title: '<?=$Labels->GetLabel('_DET_IP_CAMERA_LST_');?>',
  1497. width: 800,
  1498. height: 600,
  1499. layout: 'fit',
  1500. closeAction: 'hide',
  1501. items:{
  1502. xtype: 'grid',
  1503. frame: false,
  1504. border: false,
  1505. ds: cameraListStore,
  1506. cm: IPCameraListColModel,
  1507. sm: IPCameraListSelModel,
  1508. viewConfig: {
  1509. forceFit: true
  1510. },
  1511. bbar: [{
  1512. text: '<?=$Labels->GetLabel('_CANCEL_');?>',
  1513. handler: function(){
  1514. addIpCamDialog.hide();
  1515. }
  1516. },'->',{
  1517. id: 'con_to_ip_src',
  1518. text: '<?=$Labels->GetLabel('_CONNECT_2_SEL_');?>',
  1519. disabled: ( SelectedCam == 0 ),
  1520. handler: connectToSeleced
  1521. }]
  1522. }
  1523. });
  1524. };
  1525. addIpCamDialog.show();
  1526. cameraListStore.load({params:{cam_sources:'ipv'}});
  1527. };
  1528. function addAnalogCam(){
  1529. if( addAnalogCamDialog == null ){
  1530. addAnalogCamDialog = new Ext.Window({
  1531. modal: true,
  1532. title: '<?=$Labels->GetLabel('_ANAL_SOURCES_LST_');?>',
  1533. width: 800,
  1534. height: 600,
  1535. layout: 'fit',
  1536. closeAction: 'hide',
  1537. items:[{
  1538. xtype: 'grid',
  1539. frame: false,
  1540. border: false,
  1541. ds: cameraListStore,
  1542. cm: AnalogCameraListColModel,
  1543. sm: AnalogCameraListSelModel,
  1544. viewConfig: {
  1545. forceFit: true
  1546. }
  1547. }],
  1548. bbar: [{
  1549. text: '<?=$Labels->GetLabel('_CANCEL_');?>',
  1550. handler: function(){
  1551. addAnalogCamDialog.hide();
  1552. }
  1553. },'->',{
  1554. id: 'cha_an_strim_set',
  1555. text: '<?=$Labels->GetLabel('_SETTINGS_');?>',
  1556. disabled: ( SelectedSource == 0 ),
  1557. handler: function(){
  1558. editAnalogStream( SelectedSource );
  1559. }
  1560. },{
  1561. id: 'con_to_anal_src',
  1562. text: '<?=$Labels->GetLabel('_CONNECT_2_SEL_');?>',
  1563. disabled: ( SelectedSource == 0 ),
  1564. handler: function(){
  1565. //alert( 'Cam Type:'+SelectedCamTYPE );
  1566. showAnalCamPropDialog();
  1567. }
  1568. }]
  1569. });
  1570. };
  1571. addAnalogCamDialog.show();
  1572. cameraListStore.load({params:{cam_sources:'anal'}});
  1573. };
  1574. var changer_locked = false;
  1575. function changeASS( stream, id ){
  1576. if(changer_locked) return;
  1577. changer_locked = true;
  1578. var ll = Ext.getCmp( id );
  1579. var name = ll.name;
  1580. var value = ll.getValue();
  1581. Ext.Ajax.request({
  1582. url: '/lib/controller/setAnalogStreamCtrl.php',
  1583. params: {
  1584. STREAM: stream,
  1585. PID: name,
  1586. VALUE: value,
  1587. UID: <?=$UserID;?>,
  1588. SID: '<?=$Session;?>',
  1589. },
  1590. success: function( response, opts ){
  1591. changer_locked = false;
  1592. // If the response is JSON, you have to decode it
  1593. //var data = Ext.decode(response.responseText);
  1594. },
  1595. failure: failureAJAXFunction
  1596. });
  1597. };
  1598. var AnalogStreamEditor = null;
  1599. function editAnalogStream( SelStream, live=0 ){
  1600. if( AnalogStreamEditor == null ){
  1601. AnalogStreamEditor = new Ext.Window({
  1602. modal: ((live==0)?true:false),
  1603. title: 'Analog Input Settings',
  1604. width: 440,
  1605. height: 400,
  1606. layout: 'fit',
  1607. closeAction: 'hide',
  1608. buttonAlign:'center',
  1609. items:[{
  1610. }],
  1611. bbar: ['->',{
  1612. text: '<?=$Labels->GetLabel('_CLOSE_');?>',
  1613. handler: function(){//discoverOnvifSources
  1614. AnalogStreamEditor.hide();
  1615. }
  1616. }]
  1617. });
  1618. };
  1619. AnalogStreamEditor.show();
  1620. Ext.Ajax.request({
  1621. url: '/lib/controller/getAnalogStreamCtrl.php',
  1622. params: {
  1623. STREAM: SelStream,
  1624. UID: <?=$UserID;?>,
  1625. SID: '<?=$Session;?>',
  1626. },
  1627. success: function( response, opts ){
  1628. // If the response is JSON, you have to decode it
  1629. var data = Ext.decode(response.responseText);
  1630. AnalogStreamEditor.removeAll( true );
  1631. AnalogStreamEditor.add( data );
  1632. AnalogStreamEditor.doLayout();
  1633. },
  1634. failure: failureAJAXFunction
  1635. });
  1636. };
  1637. function addEthernet2Uart(){
  1638. if( addE2UDialog == null ){
  1639. addE2UDialog = new Ext.Window({
  1640. modal: true,
  1641. title: 'Add Ethernet To Serial Adapter',
  1642. width: 400,
  1643. height: 540,
  1644. layout: 'fit',
  1645. closeAction: 'hide',
  1646. items:[{
  1647. xtype: 'form',
  1648. labelWidth: 120, // label settings here cascade unless overridden
  1649. frame: false,
  1650. width: 400,
  1651. labelAlign: 'right',
  1652. //bodyStyle:'padding:5px 5px 0',
  1653. defaultType: 'textfield',
  1654. items:[{
  1655. xtype: 'panel',
  1656. height: 200,
  1657. frame: false,
  1658. border: false,
  1659. html: '<center><img width="200px" src="/style/assets/eth2uart.png"></center>'
  1660. },{
  1661. fieldLabel: 'Name',
  1662. id: 'ued_name'
  1663. },{
  1664. xtype: 'combo',
  1665. fieldLabel: 'Speed',
  1666. id: 'ued_speed',
  1667. lazyRender:true,
  1668. mode: 'local',
  1669. store: new Ext.data.ArrayStore({
  1670. fields: ['speed'],
  1671. data: [[19200], [115200]]
  1672. }),
  1673. value: 19200,
  1674. valueField: 'speed',
  1675. displayField: 'speed'
  1676. },{
  1677. xtype: 'combo',
  1678. fieldLabel: 'Bits',
  1679. id: 'ued_bit',
  1680. lazyRender:true,
  1681. mode: 'local',
  1682. store: new Ext.data.ArrayStore({
  1683. fields: ['bits'],
  1684. data: [[5],[6],[7],[8],[9]]
  1685. }),
  1686. value: 8,
  1687. valueField: 'bits',
  1688. displayField: 'bits'
  1689. },{
  1690. xtype: 'combo',
  1691. fieldLabel: 'Stop Bit',
  1692. lazyRender:true,
  1693. id: 'ued_stops',
  1694. mode: 'local',
  1695. store: new Ext.data.ArrayStore({
  1696. fields: ['stops'],
  1697. data: [[1],[1.5],[2]]
  1698. }),
  1699. value: 1,
  1700. valueField: 'stops',
  1701. displayField: 'stops'
  1702. },{
  1703. xtype: 'combo',
  1704. fieldLabel: 'Parity',
  1705. lazyRender:true,
  1706. id: 'ued_parity',
  1707. mode: 'local',
  1708. store: new Ext.data.ArrayStore({
  1709. fields: ['parity'],
  1710. data: [['Odd'], ['Even'],['None']]
  1711. }),
  1712. value: 'None',
  1713. valueField: 'parity',
  1714. displayField: 'parity'
  1715. },{
  1716. xtype: 'combo',
  1717. fieldLabel: 'Working Mode',
  1718. lazyRender: true,
  1719. id: 'ued_mode',
  1720. mode: 'local',
  1721. store: new Ext.data.ArrayStore({
  1722. fields: ['mode','mode_txt'],
  1723. data: [[0,'UDP Client'], [1,'TCP Client'], [2,'UDP Server'], [3,'TCP Server']]
  1724. }),
  1725. value: 3,
  1726. valueField: 'mode',
  1727. displayField: 'mode_txt'
  1728. },{
  1729. fieldLabel: 'IP Address',
  1730. id: 'ued_ip'
  1731. },{
  1732. fieldLabel: 'IP Port',
  1733. value: 8234,
  1734. id: 'ued_port'
  1735. },{
  1736. fieldLabel: 'MAC Address',
  1737. id: 'ued_mac'
  1738. }],
  1739. bbar: [{
  1740. text: 'Cancel',
  1741. handler: function(){//discoverOnvifSources
  1742. addE2UDialog.hide();
  1743. }
  1744. },'->',{
  1745. id: 'con_to_src',
  1746. text: 'Add Adapter to Site',
  1747. disabled: false,
  1748. handler: function(){
  1749. var SPD = Ext.getCmp('ued_speed').getValue();
  1750. var BIT = Ext.getCmp('ued_bit').getValue();
  1751. var STP = Ext.getCmp('ued_stops').getValue();
  1752. var PAR = Ext.getCmp('ued_parity').getValue();
  1753. var MOD = Ext.getCmp('ued_mode').getValue();
  1754. var IP = Ext.getCmp('ued_ip').getValue();
  1755. var PORT= Ext.getCmp('ued_port').getValue();
  1756. var MAC = Ext.getCmp('ued_mac').getValue();
  1757. var NAME= Ext.getCmp('ued_name').getValue();
  1758. Ext.Ajax.request({
  1759. url: '/lib/controller/addNetworkNode.php',
  1760. params: {
  1761. SITEID: <?=$SiteID;?>,
  1762. TYPE: 20,
  1763. UART_SPEED: SPD,
  1764. UART_BITS: BIT,
  1765. UART_STOP: STP,
  1766. UART_PAR: PAR,
  1767. UART_MODE: MOD,
  1768. UART_IP: IP,
  1769. UART_PORT: PORT,
  1770. UART_MAC: MAC,
  1771. UART_NAME: NAME,
  1772. UID: <?=$UserID;?>,
  1773. SID: '<?=$Session;?>'
  1774. },
  1775. success: function( response, opts ){
  1776. var data = Ext.decode(response.responseText);
  1777. if( data.sucess == false ){
  1778. Ext.Msg.show({
  1779. title:'Request Failure!',
  1780. msg: data.error,
  1781. buttons: Ext.Msg.OK,
  1782. icon: Ext.MessageBox.INFO
  1783. });
  1784. } else {
  1785. loadSystemEditor();
  1786. };
  1787. addE2UDialog.hide();
  1788. },
  1789. failure: function( response, opts ) {
  1790. failureAJAXFunction( response, opts );
  1791. addE2UDialog.hide();
  1792. }
  1793. });
  1794. }
  1795. }]
  1796. }]
  1797. });
  1798. };
  1799. addE2UDialog.show();
  1800. };