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.

1744 lines
50 KiB

4 years ago
​
​
​
​
​
​
​
​
​
​
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
2 years ago
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
4 years ago
​
​
​
​
4 years ago
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
4 years ago
​
​
​
​
​
​
​
​
4 years ago
4 years ago
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
4 years ago
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <?php
  2. require_once('../ajax_asm.php');
  3. ob_start();
  4. $UID = intval( $CUser->Data['id'] );
  5. $ACCESS = intval( $CUser->Data['access'] );
  6. if( $UID > 1 ){
  7. $CID = intval( $_POST['CID'] );
  8. $QS = "SELECT * FROM `cameras` WHERE `id`={$CID}";
  9. $Result = $DATABASE->Query( $QS, false );
  10. $STREAMS = array();
  11. if( count( $Result ) ){
  12. $Cam = $Result[0];
  13. $QS="SELECT * FROM `nodes` WHERE `type`>9 AND `type`<16 AND `aux_id`={$CID}";
  14. $JJ = $DATABASE->Query( $QS );
  15. if( count( $JJ ) ){
  16. $Node = $JJ[0];
  17. } else {
  18. $Node['id'] = 0;
  19. };
  20. $Cam['node_name'] = $Node['name'];
  21. $Cam['name']=urldecode( $Cam['name'] );
  22. $TB = explode( ' ', $Cam['name'] );
  23. $Cam['name'] = $TB[0];
  24. if( stripos($Cam['ip'],'/dev/video') !==false ){
  25. $CLS = "camera_analog_set";
  26. $CAM_IP = false;
  27. } else {
  28. $CAM_IP = true;
  29. $CamLabel = $Cam['name'] . '_' . $CID;
  30. if( stripos( $Cam['name'], 'hikvision' ) !== false ){
  31. $CLS = "camera_hikvision_set";
  32. } elseif( stripos( $Cam['name'], 'dahua' ) !== false ){
  33. $CLS = "camera_dahua_set";
  34. } elseif( stripos( $Cam['name'], 'axis' ) !== false ){
  35. $CLS = "camera_axis_set";
  36. } elseif( stripos( $Cam['name'], 'General' ) !== false ){
  37. $CLS = "cam_vehicle_set";
  38. } else {
  39. $CLS = "camera_generic_set";
  40. };
  41. };
  42. if( intval($Cam['port'] ) ) $Cam['ip'] = $Cam['ip'] . ':' . $Cam['port'];
  43. $QS = "SELECT * FROM media_streams WHERE source_id={$CID}";
  44. $Result = $DATABASE->Query($QS,false);
  45. $SELECTED_STREAM = 0;
  46. $STREAMS = array();
  47. if( count( $Result ) > 0 ){
  48. $ii = 0;
  49. foreach( $Result as $CD ){
  50. $STREAMS[] = "[{$CD['id']},'{$CD['name']}','{$CD['img_width']}x{$CD['img_height']}@{$CD['fps']}','{$CD['compression_type']}',{$CD['bitrate']}]";
  51. if( $Cam['stream_id'] == $CD['id'] ) $SELECTED_STREAM = $ii;
  52. $ii++;
  53. };
  54. };
  55. $STREAMS = implode(',',$STREAMS);
  56. $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 ) ORDER BY re.aux_id";
  57. $RR=$DATABASE->Query( $QS );
  58. if( count( $RR ) ){
  59. $RE=array();
  60. foreach( $RR as $R ){
  61. $RE[] = "[ {$R['aux_id']}, '{$R['device']}']";
  62. };
  63. $UARTS = implode( ',', $RE );
  64. } else {
  65. $UARTS = "[0, \"".$Labels->GetLabel('_NO_UARTS_DEF_')."\"]";
  66. };
  67. $ATAB = 0;
  68. //v4l2-ctl -d /dev/video0 --stream-mmap --stream-count=1 --stream-to=output.jpg
  69. $QS = "SELECT `no`.`id`, `sen`.`type`, `sen`.`max_range`, `no`.`enable`, `no`.`name` FROM `lrf_sensors` `sen` LEFT JOIN `nodes` `no` ON( `no`.`aux_id`=`sen`.`id` AND `no`.`type`=`sen`.`type`)";
  70. $Result = $DATABASE->Query( $QS, false );
  71. $SENSORS = array();
  72. $SENSOID = 0;
  73. if( count( $Result ) ){
  74. $SenPart = array();
  75. foreach( $Result as $R ){
  76. switch( $R['type'] ){
  77. case 1: $HWT = 'ALS ' . $R['max_range'] . ' meters'; break;
  78. case 2: $HWT = 'LFS ' . $R['max_range'] . ' meters'; break;
  79. case 3: $HWT = 'PLS200 ' . $R['max_range'] . ' meters'; break;
  80. case 4: $HWT = 'PLS360 ' . $R['max_range'] . ' meters'; break;
  81. case 5: $HWT = '3DLRF ' . $R['max_range'] . ' meters'; break;
  82. };
  83. $SenPart[] = '[ '.$R['id'].',\''.$R['name'].'('.$HWT.')\']';
  84. };
  85. $SENSORS = '['.implode( ',', $SenPart ) .']';
  86. if( $SENSOID == 0 ) $SENSOID = intval( $R['id'] );
  87. } else {
  88. $SENSORS ='[ [ 0, \'--No Sensors Defined--\']]';
  89. };
  90. if( $CAM_IP ){
  91. $RESET_CREDENTIALS=<<<kskjhiiuwye
  92. ,{
  93. xtype: 'button',
  94. width: '100%',
  95. text: '{$Labels->GetLabel('_CHANGE_CREDENTIALS_')}/{$Labels->GetLabel('_CONNECTION_')}',
  96. handler: function(){
  97. var RCC_Window = new Ext.Window({
  98. title: '{$Labels->GetLabel('_CHANGE_CREDENTIALS_')}/{$Labels->GetLabel('_CONNECTION_')}',
  99. width: 500,
  100. height: 400,
  101. modal: true,
  102. layout: 'form',
  103. labelWidth: 150,
  104. labelAlign: 'right',
  105. items:[{
  106. xtype: 'textfield',
  107. id: 'am_ip_addr',
  108. fieldLabel: '{$Labels->GetLabel('_CAM_IP_ADDRESS_')}',
  109. width: '100%',
  110. value: '{$Cam['ip']}'
  111. },{
  112. xtype: 'textfield',
  113. id: 'am_login',
  114. fieldLabel: '{$Labels->GetLabel('_ACCESS_LOGIN_')}',
  115. width: '100%',
  116. value: '{$Cam['access_login']}'
  117. },{
  118. xtype: 'textfield',
  119. id: 'am_password',
  120. fieldLabel: '{$Labels->GetLabel('_ACCESS_PASSWORD_')}',
  121. width: '100%',
  122. value: '{$Cam['access_pass']}'
  123. },{
  124. xtype: 'combo',
  125. id: 'am_auth_mode',
  126. fieldLabel: '{$Labels->GetLabel('_AUTH_MODE_0_')}',
  127. lazyRender: true,
  128. mode: 'local',
  129. forceSelection: true,
  130. triggerAction: 'all',
  131. editable: false,
  132. disableKeyFilter: true,
  133. store: new Ext.data.ArrayStore({
  134. fields: ['mode','mode_txt'],
  135. data: [
  136. [0,'BASIC'],
  137. [1,'DIGEST'],
  138. [2,'DIGEST_IE'],
  139. [3,'BEARER'],
  140. [4,'NEGOTIATE'],
  141. [5,'NTLM'],
  142. [6,'NTLM_WB'],
  143. [7,'ANY'],
  144. [8,'ANYSAFE'],
  145. [9,'ONLY'],
  146. [10,'AWS_SIGV4']
  147. ]
  148. }),
  149. valueField: 'mode',
  150. displayField: 'mode_txt',
  151. value: '{$Cam['auth_mode']}',
  152. width: 200
  153. },{
  154. xtype: 'button',
  155. text: 'Apply',
  156. width: '100%',
  157. handler: function(){
  158. var NIP = Ext.getCmp('am_ip_addr').getValue();
  159. var NUU = Ext.getCmp('am_login').getValue();
  160. var NPP = Ext.getCmp('am_password').getValue();
  161. var NAM = Ext.getCmp('am_auth_mode').getValue();
  162. Ext.Ajax.request({
  163. url: '/lib/controller/doCameraOperation.php',
  164. params: {
  165. UID: {$UserID},
  166. SID: '{$Session}',
  167. CID: {$CID},
  168. UI: NIP,
  169. UU: NUU,
  170. PP: NPP,
  171. AU: NAM,
  172. CMD: 4
  173. },
  174. success: function( response, opts ){
  175. RCC_Window.destroy();
  176. var data = Ext.decode(response.responseText);
  177. if( data.status == 'ok' ){
  178. loadDetectedCameras();
  179. } else {
  180. Ext.Msg.show({
  181. title:'Error!',
  182. msg: data.msg,
  183. buttons: Ext.Msg.OK,
  184. icon: Ext.MessageBox.WARNING
  185. });
  186. };
  187. },
  188. failure: failureAJAXFunction
  189. });
  190. }
  191. },{
  192. xtype: 'button',
  193. text: 'Cancel',
  194. width: '100%',
  195. handler: function(){
  196. RCC_Window.destroy();
  197. }
  198. }]
  199. });
  200. RCC_Window.show();
  201. }
  202. }
  203. kskjhiiuwye;
  204. } else {
  205. $RESET_CREDENTIALS='';
  206. };
  207. if( $Cam['status'] < 3 ){
  208. $ADD_CAMERA=<<<hzzhoiuyhetrkh
  209. {
  210. xtype: 'button',
  211. width: '100%',
  212. text: '{$Labels->GetLabel('_ASSIGN_CAMERA_')}',
  213. handler: function(){
  214. Ext.Ajax.request({
  215. url: '/lib/controller/doCameraOperation.php',
  216. params: {
  217. UID: {$UserID},
  218. SID: '{$Session}',
  219. CMD: 2,
  220. CID: {$CID}
  221. },
  222. success: function( response, opts ){
  223. var tData = Ext.decode(response.responseText);
  224. if( tData.status == 'ok' ){
  225. loadDetectedCameras();
  226. } else {
  227. Ext.Msg.show({
  228. title:'{$Labels->GetLabel('_ERROR_')}',
  229. msg: tData.msg,
  230. buttons: Ext.Msg.OK,
  231. icon: Ext.MessageBox.ERROR
  232. });
  233. };
  234. },
  235. failure: failureAJAXFunction
  236. });
  237. }
  238. }
  239. hzzhoiuyhetrkh;
  240. } else {
  241. //$RESET_CREDENTIALS='';
  242. $ADD_CAMERA=<<<hhoiuyhetrkh
  243. {
  244. xtype: 'button',
  245. width: '100%',
  246. text: '{$Labels->GetLabel('_REMOVE_CAMERA_')}',
  247. handler: function(){
  248. Ext.Ajax.request({
  249. url: '/lib/controller/doCameraOperation.php',
  250. params: {
  251. UID: {$UserID},
  252. SID: '{$Session}',
  253. CMD: 7,
  254. CID: {$CID}
  255. },
  256. success: function( response, opts ){
  257. var tData = Ext.decode(response.responseText);
  258. if( tData.status == 'ok' ){
  259. loadAssignedCameras();
  260. } else {
  261. Ext.Msg.show({
  262. title:'Error!',
  263. msg: tData.msg,
  264. buttons: Ext.Msg.OK,
  265. icon: Ext.MessageBox.ERROR
  266. });
  267. };
  268. },
  269. failure: failureAJAXFunction
  270. });
  271. }
  272. }
  273. hhoiuyhetrkh;
  274. };
  275. $BBAR_BTN = $ADD_CAMERA;
  276. $TPL_SET_CREDS_IP=<<<ZUZAKA
  277. {
  278. xtype: 'form',
  279. id: 'cam_credentials',
  280. labelWidth: 260,
  281. labelAlign: 'right',
  282. items: [{
  283. xtype: 'panel',
  284. height: 290,
  285. border: false,
  286. frame: false,
  287. html: '<table width="100%" border=0><tr><td height=290 align="center"><div class="{$CLS}"></div></td>'
  288. },{
  289. xtype: 'panel',
  290. html: '<div class="sideInfo_item" id="INFO_ON"><b>{$Cam['ip']}</b><br/>{$Cam['name']}<br/>{$Cam['hardware']}</div>'
  291. },{
  292. xtype: 'panel',
  293. html: '<div class="sideInfo_item" id="INFO_ID">{$Labels->GetLabel('_PROV_CAC_')}</div>'
  294. },{
  295. xtype: 'textfield',
  296. id: 'cam_login',
  297. fieldLabel: '{$Labels->GetLabel('__LOGIN__')}',
  298. width: 200
  299. },{
  300. xtype: 'textfield',
  301. id: 'cam_password',
  302. inputType: 'password',
  303. fieldLabel: '{$Labels->GetLabel('__PASSWORD__')}',
  304. width: 200
  305. },{
  306. xtype: 'combo',
  307. id: 'cam_auth_mode',
  308. fieldLabel: '{$Labels->GetLabel('_AUTH_MODE_0_')}',
  309. lazyRender: true,
  310. mode: 'local',
  311. forceSelection: true,
  312. triggerAction: 'all',
  313. editable: false,
  314. disableKeyFilter: true,
  315. store: new Ext.data.ArrayStore({
  316. fields: ['mode','mode_txt'],
  317. data: [
  318. [0,'BASIC'],
  319. [1,'DIGEST'],
  320. [2,'DIGEST_IE'],
  321. [3,'BEARER'],
  322. [4,'NEGOTIATE'],
  323. [5,'NTLM'],
  324. [6,'NTLM_WB'],
  325. [7,'ANY'],
  326. [8,'ANYSAFE'],
  327. [9,'ONLY'],
  328. [10,'AWS_SIGV4']
  329. ]
  330. }),
  331. valueField: 'mode',
  332. displayField: 'mode_txt',
  333. value: 0,
  334. width: 200
  335. },{
  336. xtype: 'button',
  337. width: '100%',
  338. text: '{$Labels->GetLabel('_SET_CREDENTIALS_')}',
  339. handler: function(){
  340. addDetCamWM = new Ext.LoadMask( Ext.getCmp('cam_credentials').getEl(), {msg:"{$Labels->GetLabel('_Please_Wait_')}..."});
  341. addDetCamWM.show();
  342. var NUU = Ext.getCmp('cam_login').getValue();
  343. var NPP = Ext.getCmp('cam_password').getValue();
  344. var NAM = Ext.getCmp('cam_auth_mode').getValue();
  345. Ext.Ajax.request({
  346. url: '/lib/controller/doCameraOperation.php',
  347. params: {
  348. UID: {$UserID},
  349. SID: '{$Session}',
  350. CID: {$CID},
  351. UU: NUU,
  352. PP: NPP,
  353. AU: NAM,
  354. CMD: 3
  355. },
  356. success: function( response, opts ){
  357. addDetCamWM.hide();
  358. var data = Ext.decode(response.responseText);
  359. if( data.status == 'ok' ){
  360. loadDetectedCameras();
  361. } else {
  362. Ext.Msg.show({
  363. title:'Error!',
  364. msg: data.msg,
  365. buttons: Ext.Msg.OK,
  366. icon: Ext.MessageBox.WARNING
  367. });
  368. };
  369. },
  370. failure: failureAJAXFunction
  371. });
  372. }
  373. }]
  374. }
  375. ZUZAKA;
  376. $TPL_ANALOG_CAM =<<<CHUPAKABRA
  377. {
  378. xtype: 'panel',
  379. id: 'cam_info',
  380. labelWidth: 260,
  381. labelAlign: 'right',
  382. bbar:[{$BBAR_BTN}],
  383. items: [{
  384. xtype: 'panel',
  385. height: 290,
  386. border: false,
  387. frame: false,
  388. html: '<table width="100%" border=0><tr><td height=290 align="center"><div class="{$CLS}"></div></td>'
  389. },{
  390. xtype: 'panel',
  391. html: '<div class="sideInfo_item" id="INFO_ON"><b>{$Cam['ip']}</b><br/>{$Cam['name']}<br/>{$Cam['hardware']}</div>'
  392. }]
  393. }
  394. CHUPAKABRA;
  395. //$QS="SELECT * FROM `module_eve` WHERE `id`=1";
  396. //$S=$DATABASE->Query( $QS );
  397. //$MODULE_DATA = $S[0];
  398. if( $Cam['status'] < 3 ){
  399. $FU = "/lib/controller/getCameraPreview.php?UID={$CUser->Data['id']}&SID={$Session}&FID=";
  400. } else {
  401. //$FU = 'http://' . $_SERVER['SERVER_ADDR'].':' . $MODULE_DATA['web_port'] .'/stream?id=';
  402. $FU = '/video_feed/stream?id=';
  403. };
  404. $TPL_CAM_EDITOR=<<<PZAKSJEJSDKGJHGASD
  405. {
  406. id: 'camedi_tabs',
  407. xtype: 'tabpanel',
  408. activeTab: 0,
  409. bbar:[{$BBAR_BTN}],
  410. items: [{
  411. title: '{$Labels->GetLabel('_GENERAL_')}',
  412. id: 'cam_info',
  413. frame: false,
  414. border: false,
  415. items: [{
  416. xtype: 'panel',
  417. height: 290,
  418. border: false,
  419. frame: false,
  420. html: '<table width="100%" border=0><tr><td height=290 align="center"><div class="{$CLS}"></div></td>'
  421. },{
  422. xtype: 'panel',
  423. html: '<div class="sideInfo_item" id="INFO_ON"><b>{$Cam['ip']}</b><br/>{$Cam['name']}<br/>{$Cam['hardware']}</div>'
  424. },{
  425. xtype: 'form',
  426. labelWidth: 200,
  427. border: false,
  428. frame: false,
  429. labelAlign: 'right',
  430. items:[{
  431. xtype: 'combo',
  432. id: 'cam_status_ed',
  433. fieldLabel: '{$Labels->GetLabel('_STATUS_')}',
  434. lazyRender: true,
  435. mode: 'local',
  436. forceSelection: true,
  437. triggerAction: 'all',
  438. editable: false,
  439. disableKeyFilter: true,
  440. store: new Ext.data.ArrayStore({
  441. fields: ['mode','mode_txt'],
  442. data: [
  443. [0,'{$Labels->GetLabel('__DISABLED__')}'],
  444. [1,'{$Labels->GetLabel('___ENABLED__')}']
  445. ]
  446. }),
  447. valueField: 'mode',
  448. displayField: 'mode_txt',
  449. value: '{$Node['enable']}',
  450. width: 200,
  451. listeners:{
  452. select: function( a, c, b ){
  453. doCamOperation( {$Node['id']}, 41, b, true );
  454. }
  455. }
  456. },{
  457. xtype: 'checkbox',
  458. id: 'cam_manassign',
  459. fieldLabel: '{$Labels->GetLabel('_STATIC_CONNECTION_')}',
  460. width: 200,
  461. checked: {$Cam['manual']},
  462. listeners:{
  463. check: function( a, c ){
  464. if( c ){
  465. doCamOperation( {$CID}, 24, 1 );
  466. } else {
  467. doCamOperation( {$CID}, 24, 0 );
  468. };
  469. }
  470. }
  471. }]
  472. }{$RESET_CREDENTIALS}]
  473. },{
  474. title: '{$Labels->GetLabel('_STREAMS_')}',
  475. id: 'str_tab',
  476. frame: false,
  477. border: false,
  478. layout: 'form',
  479. labelWidth: 150,
  480. labelAlign: 'right',
  481. items:[{
  482. xtype: 'grid',
  483. height: 124,
  484. id: 'nd_cam_grid',
  485. frame: false,
  486. ds: new Ext.data.ArrayStore({
  487. fields: ['id','name','size','encode','bitrate'],
  488. data: [{$STREAMS}]
  489. }),
  490. cm: new Ext.grid.ColumnModel({
  491. columns: [
  492. {header: "id", width: 50, sortable: false, menuDisabled: true, align: 'center', fixed: true, css: 'vertical-align: middle;', dataIndex: 'id' },
  493. {header: "Name", dataIndex: 'name' },
  494. {header: "Encoding",width: 120, sortable: false, fixed: true, menuDisabled: true, dataIndex: 'encode' },
  495. {header: "Frame", width: 120, sortable: false, menuDisabled: true, align: 'left', css: 'vertical-align: middle;', dataIndex: 'size' },
  496. {header: "Bitrate", width: 80, sortable: false, fixed: true, menuDisabled: true, align: 'left', css: 'vertical-align: middle;', dataIndex: 'bitrate' }
  497. ],
  498. defaults: {
  499. sortable: false,
  500. menuDisabled: true,
  501. width: 100
  502. }
  503. }),
  504. sm: new Ext.grid.RowSelectionModel({
  505. singleSelect: true,
  506. listeners: {
  507. rowselect: function(sm, row, rec) {
  508. SelectedSource = rec.data.id;
  509. doCamOperation( {$CID}, 1, SelectedSource );
  510. var tt = Ext.getCmp('pic_prev');
  511. if( tt!= undefined ){
  512. //tt.update( '<center><img width="100%" src="/lib/controller/getCameraPreview.php?UID={$CUser->Data['id']}&SID={$Session}&FID='+SelectedSource+'"></center>' );
  513. tt.update( '<center><img width="100%" ondblclick="fullScreen(\'img-{$CID}\');" style="cursor: zoom-in" id="img-{$CID}" src="{$FU}'+SelectedSource+'"></center>' );
  514. };
  515. }
  516. }
  517. }),
  518. listeners:{
  519. viewready: function( t ){
  520. var tt = t.getSelectionModel();
  521. tt.selectRow({$SELECTED_STREAM});
  522. }
  523. }
  524. },{
  525. xtype: 'combo',
  526. fieldLabel: '{$Labels->GetLabel('_CAM_FLIPMO_')}',
  527. lazyRender: true,
  528. id: 'flip_mo',
  529. mode: 'local',
  530. forceSelection: true,
  531. triggerAction: 'all',
  532. editable: false,
  533. disableKeyFilter: true,
  534. store: new Ext.data.ArrayStore({
  535. fields: ['fm','fm_txt'],
  536. data: [
  537. [0,'{$Labels->GetLabel('__DISABLED__')}'],
  538. [1,'{$Labels->GetLabel('_CAM_FLIPHO_')}'],
  539. [2,'{$Labels->GetLabel('_CAM_FLIPVE_')}'],
  540. [3,'{$Labels->GetLabel('_CAM_FLIPVEHO_')}']
  541. ]
  542. }),
  543. valueField: 'fm',
  544. displayField: 'fm_txt',
  545. value: '{$Cam['flip_mode']}',
  546. listeners:{
  547. select:function( c, r, i ){
  548. doCamOperation( {$CID}, 42, i );
  549. }
  550. }
  551. },{
  552. height: PanelH,
  553. id: 'pic_prev',
  554. html: '<center><img width="100%" src="/style/img/cam_cap0.png"></center>',
  555. listeners:{
  556. afterrender: function( t ){
  557. if( SelectedSource ){
  558. //t.update( '<center><img width="100%" src="/lib/controller/getCameraPreview.php?UID={$CUser->Data['id']}&SID={$Session}&FID='+SelectedSource+'"></center>' );
  559. };
  560. }
  561. }
  562. }],
  563. },{
  564. title: '{$Labels->GetLabel('_CAM_LENS_SETTINGS_')}',
  565. id: 'lens_tab',
  566. frame: false,
  567. border: false,
  568. items:[{
  569. layout: 'table',
  570. frame: false,
  571. border: false,
  572. layoutConfig: {
  573. columns: 3
  574. },
  575. defaults: {
  576. frame: false,
  577. bodyStyle: 'padding:10px',
  578. border: false
  579. },
  580. items:[{
  581. html: '{$Labels->GetLabel('_CAM_ZOOMMO_')}'
  582. },{
  583. xtype: 'combo',
  584. fieldLabel: '{$Labels->GetLabel('_CAM_ZOOMMO_')}',
  585. lazyRender: true,
  586. id: 'zoom_mo',
  587. mode: 'local',
  588. forceSelection: true,
  589. triggerAction: 'all',
  590. editable: false,
  591. disableKeyFilter: true,
  592. store: new Ext.data.ArrayStore({
  593. fields: ['zm','zm_txt'],
  594. data: [
  595. [0,'{$Labels->GetLabel('_CAM_FIXEDZ_')}'],
  596. [1,'{$Labels->GetLabel('_CAM_CUSTOMZ_')}'],
  597. [2,'{$Labels->GetLabel('_CAM_VARIOZ_')}']
  598. ]
  599. }),
  600. valueField: 'zm',
  601. displayField: 'zm_txt',
  602. value: {$Cam['zoom_model']},
  603. listeners:{
  604. select:function( c, r, i ){
  605. doCamOperation( {$CID}, 21, i );
  606. switch( i ){
  607. case 0:{
  608. Ext.getCmp('lbbel0').show();
  609. Ext.getCmp('sens_size').show();
  610. Ext.getCmp('empty0').show();
  611. Ext.getCmp('lbbel11').show();
  612. Ext.getCmp('lens_fl').show();
  613. Ext.getCmp('empty1').show();
  614. Ext.getCmp('lbbel1').hide();
  615. Ext.getCmp('zoom_val').hide();
  616. Ext.getCmp('zoom_d').hide();
  617. Ext.getCmp('lbbel2').hide();
  618. Ext.getCmp('zoom_val2').hide();
  619. Ext.getCmp('zoom_d2').hide();
  620. Ext.getCmp('lbbel3').hide();
  621. Ext.getCmp('zoom_range1').hide();
  622. Ext.getCmp('empup_2').hide();
  623. Ext.getCmp('zoom_perc1').hide();
  624. Ext.getCmp('lbbel4').hide();
  625. Ext.getCmp('empup_3').hide();
  626. break;
  627. };
  628. case 1:{
  629. Ext.getCmp('lbbel2').hide();
  630. Ext.getCmp('zoom_val2').hide();
  631. Ext.getCmp('zoom_d2').hide();
  632. Ext.getCmp('lbbel3').hide();
  633. Ext.getCmp('zoom_range1').hide();
  634. Ext.getCmp('empup_2').hide();
  635. Ext.getCmp('zoom_perc1').hide();
  636. Ext.getCmp('lbbel4').hide();
  637. Ext.getCmp('empup_3').hide();
  638. Ext.getCmp('lbbel0').show();
  639. Ext.getCmp('sens_size').show();
  640. Ext.getCmp('empty0').show();
  641. Ext.getCmp('lbbel11').show();
  642. Ext.getCmp('lens_fl').show();
  643. Ext.getCmp('empty1').show();
  644. Ext.getCmp('lbbel1').show();
  645. Ext.getCmp('zoom_val').show();
  646. Ext.getCmp('zoom_d').show();
  647. break;
  648. };
  649. case 2:{
  650. Ext.getCmp('lbbel0').hide();
  651. Ext.getCmp('sens_size').hide();
  652. Ext.getCmp('empty0').hide();
  653. Ext.getCmp('lbbel11').hide();
  654. Ext.getCmp('lens_fl').hide();
  655. Ext.getCmp('empty1').hide();
  656. Ext.getCmp('lbbel1').hide();
  657. Ext.getCmp('zoom_val').hide();
  658. Ext.getCmp('zoom_d').hide();
  659. Ext.getCmp('lbbel2').show();
  660. Ext.getCmp('zoom_val2').show();
  661. Ext.getCmp('zoom_d2').show();
  662. Ext.getCmp('lbbel3').show();
  663. Ext.getCmp('zoom_range1').show();
  664. Ext.getCmp('empup_2').show();
  665. Ext.getCmp('zoom_perc1').show();
  666. Ext.getCmp('lbbel4').show();
  667. Ext.getCmp('empup_3').show();
  668. break;
  669. };
  670. };
  671. }
  672. }
  673. },{
  674. html: '&nbsp;'
  675. },{
  676. id: 'lbbel0',
  677. width: 200,
  678. hidden: ({$Cam['zoom_model']}==2),
  679. html: '{$Labels->GetLabel('_CAM_SENS_SIZE_')}'
  680. },{
  681. xtype: 'combo',
  682. id: 'sens_size',
  683. hidden: ({$Cam['zoom_model']}==2),
  684. fieldLabel: '{$Labels->GetLabel('_CAM_SENS_SIZE_')}',
  685. lazyRender: true,
  686. mode: 'local',
  687. forceSelection: true,
  688. triggerAction: 'all',
  689. editable: false,
  690. disableKeyFilter: true,
  691. store: new Ext.data.ArrayStore({
  692. fields: ['size','size_txt'],
  693. data: [
  694. [0,'1/3.6"'],
  695. [1,'1/3.2"'],
  696. [2,'1/3"'],
  697. [3,'1/2.7"'],
  698. [4,'1/2"'],
  699. [5,'1/1.8"'],
  700. [6,'2/3"'],
  701. [7,'1"'],
  702. [8,'4/3"'],
  703. [9,'APS-C'],
  704. [10,'35 mm'],
  705. [11,'645']
  706. ]
  707. }),
  708. valueField: 'size',
  709. displayField: 'size_txt',
  710. value: {$Cam['imager_type']},
  711. listeners:{
  712. select:function( c, r, i ){
  713. doCamOperation( {$CID}, 2, i );
  714. }
  715. }
  716. },{
  717. id: 'empty0',
  718. hidden: ({$Cam['zoom_model']}==2),
  719. html: '&nbsp;'
  720. },{
  721. id: 'lbbel11',
  722. hidden: ({$Cam['zoom_model']}==2),
  723. html: '{$Labels->GetLabel('_CAM_FOCALL_')}'
  724. },{
  725. xtype: 'combo',
  726. id: 'lens_fl',
  727. hidden: ({$Cam['zoom_model']}==2),
  728. fieldLabel: '{$Labels->GetLabel('_CAM_FOCALL_')}',
  729. lazyRender: true,
  730. mode: 'local',
  731. forceSelection: true,
  732. triggerAction: 'all',
  733. editable: false,
  734. disableKeyFilter: true,
  735. store: new Ext.data.ArrayStore({
  736. fields: ['fl','fl_txt'],
  737. data: [
  738. [0,'2.7 mm.'],
  739. [1,'3.0 mm.'],
  740. [2,'3.2 mm.'],
  741. [3,'3.5 mm.'],
  742. [4,'3.7 mm.'],
  743. [5,'3.9 mm.'],
  744. [6,'4.0 mm.'],
  745. [7,'4.3 mm.'],
  746. [8,'4.8 mm.'],
  747. [9,'5.0 mm.'],
  748. [10,'5.1 mm.'],
  749. [11,'5.5 mm.'],
  750. [12,'5.8 mm.'],
  751. [13,'6.0 mm.'],
  752. [14,'6.2 mm.'],
  753. [15,'6.6 mm.'],
  754. [16,'7.0 mm.'],
  755. [17,'7.1 mm.'],
  756. [18,'7.5 mm.'],
  757. [19,'7.6 mm.'],
  758. [20,'8.0 mm.'],
  759. [21,'8.6 mm.'],
  760. [22,'8.9 mm.'],
  761. [23,'9.0 mm.'],
  762. [24,'9.2 mm.'],
  763. [25,'9.3 mm.'],
  764. [26,'10.0 mm.'],
  765. [27,'10.5 mm.'],
  766. [28,'10.6 mm.'],
  767. [29,'10.7 mm.'],
  768. [30,'11.0 mm.'],
  769. [31,'11.3 mm.'],
  770. [32,'12.0 mm.'],
  771. [33,'12.9 mm.'],
  772. [34,'13.0 mm.'],
  773. [35,'13.5 mm.'],
  774. [36,'13.6 mm.'],
  775. [37,'14.0 mm.'],
  776. [38,'14.6 mm.'],
  777. [39,'15.0 mm.'],
  778. [40,'15.1 mm.'],
  779. [41,'15.5 mm.'],
  780. [42,'16.0 mm.'],
  781. [43,'17.0 mm.'],
  782. [44,'17.5 mm.'],
  783. [44,'17.7 mm.'],
  784. [45,'18.0 mm.'],
  785. [46,'18.2 mm.'],
  786. [47,'19.0 mm.']
  787. ]
  788. }),
  789. valueField: 'fl',
  790. displayField: 'fl_txt',
  791. value: {$Cam['lens_f']},
  792. listeners:{
  793. select:function( c, r, i ){
  794. doCamOperation( {$CID}, 3, i );
  795. }
  796. }
  797. },{
  798. id: 'empty1',
  799. hidden: ({$Cam['zoom_model']}==2),
  800. html: '&nbsp;'
  801. },{
  802. id: 'lbbel1',
  803. hidden: ({$Cam['zoom_model']}!=1),
  804. html: '{$Labels->GetLabel('_CAM_ZOOMR_')}'
  805. },{
  806. xtype: 'slider',
  807. id: 'zoom_val',
  808. hidden: ({$Cam['zoom_model']}!=1),
  809. disabled: ( parseFloat({$Cam['zoom']})==0 ),
  810. minValue: 1.0,
  811. maxValue: 140.0,
  812. value: {$Cam['zoom']},
  813. listeners:{
  814. change: function( a, c, b ){
  815. doCamOperation( {$CID}, 4, c );
  816. var zz = Ext.getCmp('zoom_d');
  817. if( zz.rendered ) zz.update('<p>X&nbsp;'+ c + '</p>');
  818. }
  819. }
  820. },{
  821. id: 'zoom_d',
  822. hidden: ({$Cam['zoom_model']}!=1),
  823. html: (( parseFloat({$Cam['zoom']})==0 )?'&nbsp;':'<p>X&nbsp;'+ {$Cam['zoom']} + '</p>' )
  824. },{
  825. id: 'lbbel3',
  826. hidden: ({$Cam['zoom_model']}!=2),
  827. html: '{$Labels->GetLabel('_CAM_MAX_RANGE_')}'
  828. },{
  829. xtype: 'numberfield',
  830. id: 'zoom_range1',
  831. width: 240,
  832. hidden: ({$Cam['zoom_model']}!=2),
  833. value: {$Cam['max_range']},
  834. listeners:{
  835. change: function( a, c, b ){
  836. doCamOperation( {$CID}, 22, c );
  837. }
  838. }
  839. },{
  840. id: 'empup_2',
  841. hidden: ({$Cam['zoom_model']}!=2),
  842. html: '{$Labels->GetLabel('_METERS_')}'
  843. },{
  844. id: 'lbbel4',
  845. hidden: ({$Cam['zoom_model']}!=2),
  846. html: ''
  847. },{
  848. id: 'zoom_perc1',
  849. width: 240,
  850. hidden: ({$Cam['zoom_model']}!=2),
  851. html: '<center><p>'+ {$Cam['zoom']} + '%</p></center>'
  852. },{
  853. id: 'empup_3',
  854. hidden: ({$Cam['zoom_model']}!=2),
  855. html: ''
  856. },{
  857. id: 'lbbel2',
  858. hidden: ({$Cam['zoom_model']}!=2),
  859. style: {
  860. marginLeft: '120px' //https://www.biostar.com.tw/app/en/eol/introduction.php?S_ID=711
  861. },
  862. html: '<img width="32px" src="/style/wicons/wide.png"/>'
  863. },{
  864. xtype: 'slider',
  865. id: 'zoom_val2',
  866. hidden: ({$Cam['zoom_model']}!=2),
  867. minValue: 1.0,
  868. maxValue: 100.0,
  869. value: {$Cam['zoom']},
  870. listeners:{
  871. change: function( a, c, b ){
  872. doCamOperation( {$CID}, 23, c );
  873. var zz = Ext.getCmp('zoom_perc1');
  874. if( zz.rendered ) zz.update('<center><p>'+ c + '%</p></center>');
  875. }
  876. }
  877. },{
  878. id: 'zoom_d2',
  879. hidden: ({$Cam['zoom_model']}!=2),
  880. html: '<img width="32px" src="/style/wicons/narrow.png"/>'
  881. }]
  882. }]
  883. },{
  884. title: '{$Labels->GetLabel('_PTZ_TAB_')}',
  885. id: 'ptz_tab',
  886. frame: false,
  887. border: false,
  888. items:[{
  889. layout: 'table',
  890. frame: false,
  891. border: false,
  892. layoutConfig: {
  893. columns: 3
  894. },
  895. defaults: {
  896. frame: false,
  897. bodyStyle: 'padding:10px',
  898. border: false
  899. },
  900. items:[{
  901. width: 200,
  902. html: '{$Labels->GetLabel('__PTZ_CONTROL__')}'
  903. },{
  904. xtype: 'combo',
  905. fieldLabel: '{$Labels->GetLabel('__PTZ_CONTROL__')}',
  906. lazyRender: true,
  907. id: 'ptz_proto',
  908. mode: 'local',
  909. forceSelection: true,
  910. triggerAction: 'all',
  911. editable: false,
  912. disableKeyFilter: true,
  913. store: new Ext.data.ArrayStore({
  914. fields: ['type','type_txt'],
  915. data: [
  916. [0,'{$Labels->GetLabel('_NO_PTZ_')}'],
  917. [1,'Sony VISCA'],
  918. [2,'Pelco-D'],
  919. [3,'OnVif'],
  920. [4,'PSIA'],
  921. [5,'GB/T28181']
  922. ]
  923. }),
  924. value: {$Cam['protocol']},
  925. valueField: 'type',
  926. displayField: 'type_txt',
  927. listeners:{
  928. select: function( a, c, b ){
  929. doCamOperation( {$CID}, 5, b );
  930. if( b > 0 ){
  931. Ext.getCmp('cam_drive_par').show();
  932. if(({$Cam['type']}==13)||({$Cam['type']}==11)){
  933. Ext.getCmp('cam_ptz_par').show();
  934. } else {
  935. Ext.getCmp('cam_ptz_par').hide();
  936. };
  937. if( b == 1 || b == 2 ){
  938. Ext.getCmp('cam_uart_par').show();
  939. Ext.getCmp('uart_id').enable();
  940. Ext.getCmp('prot_id').enable();
  941. } else {
  942. Ext.getCmp('cam_uart_par').hide();
  943. Ext.getCmp('uart_id').disable();
  944. Ext.getCmp('prot_id').disable();
  945. };
  946. Ext.getCmp('pan_mode').enable();
  947. Ext.getCmp('tilt_mode').enable();
  948. Ext.getCmp('pan_ang').enable();
  949. Ext.getCmp('tilt_ang').enable();
  950. } else {
  951. Ext.getCmp('cam_ptz_par').hide();
  952. Ext.getCmp('cam_drive_par').hide();
  953. Ext.getCmp('cam_uart_par').hide();
  954. Ext.getCmp('uart_id').disable();
  955. Ext.getCmp('prot_id').disable();
  956. Ext.getCmp('pan_mode').disable();
  957. Ext.getCmp('tilt_mode').disable();
  958. Ext.getCmp('pan_ang').disable();
  959. Ext.getCmp('tilt_ang').disable();
  960. };
  961. }
  962. }
  963. },{
  964. html: '&nbsp;'
  965. }]
  966. },{
  967. layout: 'table',
  968. id: 'cam_uart_par',
  969. frame: false,
  970. border: false,
  971. hidden: (({$Cam['protocol']}!=1) || ({$Cam['protocol']}!=2)),
  972. layoutConfig: {
  973. columns: 3
  974. },
  975. defaults: {
  976. frame: false,
  977. bodyStyle: 'padding:10px',
  978. border: false
  979. },
  980. items:[{
  981. width: 200,
  982. html: '{$Labels->GetLabel('_UART_PORT_')}'
  983. },{
  984. xtype: 'combo',
  985. fieldLabel: '{$Labels->GetLabel('_UART_PORT_')}',
  986. lazyRender: true,
  987. id: 'uart_id',
  988. mode: 'local',
  989. forceSelection: true,
  990. triggerAction: 'all',
  991. editable: false,
  992. disableKeyFilter: true,
  993. disabled: (({$Cam['protocol']}!=1 ) && ( {$Cam['protocol']}!=2 )),
  994. store: new Ext.data.ArrayStore({
  995. fields: ['uart','uart_txt'],
  996. data: [{$UARTS}]
  997. }),
  998. valueField: 'uart',
  999. displayField: 'uart_txt',
  1000. value: {$Cam['uart_id']},
  1001. listeners:{
  1002. select: function( a, c, b ){
  1003. doCamOperation( {$CID}, 6, b );
  1004. }
  1005. }
  1006. },{
  1007. html: '&nbsp;'
  1008. },{
  1009. html: '{$Labels->GetLabel('_CAM_PROTO_ID_')}'
  1010. },{
  1011. xtype: 'numberfield',
  1012. id: 'prot_id',
  1013. width: '95%',
  1014. disabled: (({$Cam['protocol']}!=1 ) && ( {$Cam['protocol']}!=2 )),
  1015. minValue: 0,
  1016. maxValue: 255,
  1017. value: {$Cam['protocol_aux']},
  1018. listeners:{
  1019. change: function( a, c, b ){
  1020. doCamOperation( {$CID}, 7, c );
  1021. }
  1022. }
  1023. },{
  1024. html: '&nbsp;'
  1025. }]
  1026. },{
  1027. layout: 'table',
  1028. id: 'cam_drive_par',
  1029. frame: false,
  1030. border: false,
  1031. hidden: ({$Cam['protocol']}<1),
  1032. layoutConfig: {
  1033. columns: 3
  1034. },
  1035. defaults: {
  1036. frame: false,
  1037. bodyStyle: 'padding:10px',
  1038. border: false
  1039. },
  1040. items:[{
  1041. width: 200,
  1042. html: '{$Labels->GetLabel('_CAM_PTZ_MODE_')}'
  1043. },{
  1044. xtype: 'combo',
  1045. fieldLabel: '{$Labels->GetLabel('_CAM_PTZ_MODE_')}',
  1046. lazyRender: true,
  1047. id: 'cam_ptz_mode',
  1048. mode: 'local',
  1049. forceSelection: true,
  1050. triggerAction: 'all',
  1051. editable: false,
  1052. disableKeyFilter: true,
  1053. store: new Ext.data.ArrayStore({
  1054. fields: ['momo','momo_txt'],
  1055. data: [[0,'Absolute'],[1,'Presetets']]
  1056. }),
  1057. valueField: 'momo',
  1058. displayField: 'momo_txt',
  1059. value: ((({$Cam['type']}==13)||({$Cam['type']}==11))?0:1),
  1060. listeners:{
  1061. select: function( a, c, b ){
  1062. doCamOperation( {$CID}, 27, b );
  1063. if( b == 1 ){
  1064. Ext.getCmp('cam_ed_preset').enable();
  1065. Ext.getCmp('cam_ptz_par').hide();
  1066. } else {
  1067. Ext.getCmp('cam_ed_preset').disable();
  1068. Ext.getCmp('cam_ptz_par').show();
  1069. };
  1070. }
  1071. }
  1072. },{
  1073. xtype: 'button',
  1074. id: 'cam_ed_preset',
  1075. //disabled: (({$Cam['type']}==13)||({$Cam['type']}==11)),
  1076. text: '{$Labels->GetLabel('_CAM_PRES_EDIT_')}',
  1077. handler: function(){
  1078. var zaza = new Ext.Window({
  1079. title: '{$Labels->GetLabel('_CAM_PRES_EDITOR_')}',
  1080. modal: true,
  1081. resizable: false,
  1082. width: 800,
  1083. height: 804,
  1084. sukaMineWidth: -1,
  1085. items:[{
  1086. id: 'db_node_{$Node['id']}_pic',
  1087. border: true,
  1088. width: '100%',
  1089. html: '<div id="img-1" style="display: flex;align-items: center;" ><img id="img-img-1" src="/video_feed/stream?id={$Cam['stream_id']}" width="100%" /><div style="float: left; position: absolute; left: 30px; bottom: 50px; z-index: 1000;"><table width="100%" border=0><tr><td width="24"><img id="img_btn_010_{$Node['id']}" class="ptz_ctrl_btn" src="/style/png/player/010.png"></td><td width="24"><img id="img_btn_032_{$Node['id']}" class="ptz_ctrl_btn" src="/style/png/player/032.png"></td><td width="24"><img id="img_btn_033_{$Node['id']}" class="ptz_ctrl_btn" src="/style/png/player/033.png"></td><td width="24"><img id="img_btn_034_{$Node['id']}" class="ptz_ctrl_btn" src="/style/png/player/034.png"></td><td width="24"><img id="img_btn_035_{$CID}" class="ptz_ctrl_btn_hdn" src="/style/png/player/ir_off.png"></td></tr><tr><td><img id="img_btn_011_{$Node['id']}" class="ptz_ctrl_btn" src="/style/png/player/011.png"></td><td><img id="img_btn_031_{$Node['id']}" class="ptz_ctrl_btn" src="/style/png/player/031.png"></td><td><img id="img_btn_020_{$Node['id']}" class="ptz_ctrl_btn" src="/style/png/basic/020.png"></td><td><img id="img_btn_027_{$Node['id']}" class="ptz_ctrl_btn" src="/style/png/player/027.png"></td><td width="24"><img id="img_btn_036_{$CID}" class="ptz_ctrl_btn_hdn" src="/style/png/player/ir_on.png"></td></tr><tr><td></td><td><img id="img_btn_030_{$Node['id']}" class="ptz_ctrl_btn" src="/style/png/player/030.png"></td><td><img id="img_btn_029_{$Node['id']}" class="ptz_ctrl_btn" src="/style/png/player/029.png"></td><td><img id="img_btn_028_{$Node['id']}" class="ptz_ctrl_btn" src="/style/png/player/028.png"></td><td width="24"><img id="img_btn_037_{$CID}" class="ptz_ctrl_btn_hdn" src="/style/png/player/washer.png"></td></tr></table></div><div style="float: right; position: absolute; right: 0px; top: 0px; z-index: 1000;"><svg width="450px" height="450px" id="ptz_presets_0" version="1.1" style="shape-rendering:geometricPrecision; text-rendering:geometricPrecision; image-rendering:optimizeQuality; fill-rule:evenodd; clip-rule:evenodd;"></svg></div></div>'
  1090. },{
  1091. layout: 'table',
  1092. layoutConfig: {
  1093. columns: 3
  1094. },
  1095. defaults: {
  1096. frame: false,
  1097. bodyStyle: 'padding:10px',
  1098. border: false
  1099. },
  1100. items:[{
  1101. width: 200,
  1102. html: '{$Labels->GetLabel('_CAM_PRES_SSELECT_')}'
  1103. },{
  1104. xtype: 'combo',
  1105. lazyRender: true,
  1106. id: 'sensor_id',
  1107. mode: 'local',
  1108. forceSelection: true,
  1109. triggerAction: 'all',
  1110. editable: false,
  1111. disableKeyFilter: true,
  1112. //disabled: (({$Cam['protocol']}!=1 ) && ( {$Cam['protocol']}!=2 )),
  1113. store: new Ext.data.ArrayStore({
  1114. fields: ['sens','sens_txt'],
  1115. data: {$SENSORS}
  1116. }),
  1117. valueField: 'sens',
  1118. displayField: 'sens_txt',
  1119. value: {$SENSOID},
  1120. listeners:{
  1121. select: function( a, c, b ){
  1122. selectedPresetsBackgroundSensor = c.data.sens;
  1123. }
  1124. }
  1125. },{
  1126. xtype: 'button',
  1127. text: '{$Labels->GetLabel('_CAM_PRES_LOBACK_')}',
  1128. width: 240,
  1129. handler: function(){
  1130. if( selectedPresetsBackgroundSensor == 0 ){
  1131. selectedPresetsBackgroundSensor = Ext.getCmp( 'sensor_id' ).getValue();
  1132. //selectedPresetsBackgroundSensor = {$SENSOID};
  1133. };
  1134. if( selectedPresetsBackgroundSensor ) preview2DDraw( selectedPresetsBackgroundSensor, 'ptz_presets_');
  1135. }
  1136. },{
  1137. html: ''
  1138. },{
  1139. xtype: 'button',
  1140. text: '{$Labels->GetLabel('_CAM_PRES_DELALL_')}',
  1141. width: 230,
  1142. handler: function(){
  1143. doCamOperation( {$CID}, 34, 0 );
  1144. window.setTimeout( "showCameraPresets( 'ptz_presets_0', "+{$Cam['id']}+" );", 1000 );
  1145. }
  1146. },{
  1147. xtype: 'button',
  1148. text: '{$Labels->GetLabel('_CAM_PRES_REMBG_')}',
  1149. width: 240,
  1150. handler: function(){
  1151. selectedPresetsBackgroundSensor = 0;
  1152. showCameraPresets( 'ptz_presets_0', {$Cam['id']} );
  1153. }
  1154. },{
  1155. html: '{$Labels->GetLabel('_CAM_PRES_COUNT_')}'
  1156. },{
  1157. xtype: 'numberfield',
  1158. id: 'pres_count',
  1159. width: 240
  1160. },{
  1161. xtype: 'button',
  1162. text: 'Set',
  1163. width: 240,
  1164. handler: function(){
  1165. var vv = Ext.getCmp('pres_count').getValue();
  1166. if( vv ){
  1167. doCamOperation( {$CID}, 31, vv );
  1168. };
  1169. }
  1170. },{
  1171. html: '{$Labels->GetLabel('_CAM_PRES_COLS_')}'
  1172. },{
  1173. xtype: 'numberfield',
  1174. id: 'pres_p_seg',
  1175. width: 240
  1176. },{
  1177. xtype: 'button',
  1178. text: '{$Labels->GetLabel('__SET__')}',
  1179. width: 240,
  1180. handler: function(){
  1181. var vv = Ext.getCmp('pres_p_seg').getValue();
  1182. if( vv ){
  1183. doCamOperation( {$CID}, 32, vv );
  1184. window.setTimeout( "showCameraPresets( 'ptz_presets_0', "+{$Cam['id']}+" );", 300 );
  1185. };
  1186. }
  1187. },{
  1188. html: '{$Labels->GetLabel('_CAM_PRES_ROWS_')}'
  1189. },{
  1190. xtype: 'numberfield',
  1191. id: 'pres_z_seg',
  1192. width: 240
  1193. },{
  1194. xtype: 'button',
  1195. text: '{$Labels->GetLabel('__SET__')}',
  1196. width: 240,
  1197. handler: function(){
  1198. var vv = Ext.getCmp('pres_z_seg').getValue();
  1199. if( vv ){
  1200. doCamOperation( {$CID}, 33, vv );
  1201. window.setTimeout( "showCameraPresets( 'ptz_presets_0', "+{$Cam['id']}+" );", 300 );
  1202. };
  1203. }
  1204. },{
  1205. html: '{$Labels->GetLabel('_CAM_PRES_IROFF_')}'
  1206. },{
  1207. xtype: 'numberfield',
  1208. id: 'pres_iroff',
  1209. width: 240
  1210. },{
  1211. xtype: 'button',
  1212. text: '{$Labels->GetLabel('__SET__')}',
  1213. width: 240,
  1214. handler: function(){
  1215. var vv = Ext.getCmp('pres_iroff').getValue();
  1216. doCamOperation( {$CID}, 35, vv );
  1217. }
  1218. },{
  1219. html: '{$Labels->GetLabel('_CAM_PRES_IRON_')}'
  1220. },{
  1221. xtype: 'numberfield',
  1222. id: 'pres_iron',
  1223. width: 240
  1224. },{
  1225. xtype: 'button',
  1226. text: '{$Labels->GetLabel('__SET__')}',
  1227. width: 240,
  1228. handler: function(){
  1229. var vv = Ext.getCmp('pres_iron').getValue();
  1230. doCamOperation( {$CID}, 36, vv );
  1231. }
  1232. },{
  1233. html: '{$Labels->GetLabel('_CAM_PRES_IRAUTO_')}'
  1234. },{
  1235. xtype: 'numberfield',
  1236. id: 'pres_irauto',
  1237. width: 240
  1238. },{
  1239. xtype: 'button',
  1240. text: '{$Labels->GetLabel('__SET__')}',
  1241. width: 240,
  1242. handler: function(){
  1243. var vv = Ext.getCmp('pres_irauto').getValue();
  1244. doCamOperation( {$CID}, 37, vv );
  1245. }
  1246. },{
  1247. html: '{$Labels->GetLabel('_CAM_PRES_IRWIPER_')}'
  1248. },{
  1249. xtype: 'numberfield',
  1250. id: 'pres_wiper',
  1251. width: 240
  1252. },{
  1253. xtype: 'button',
  1254. text: '{$Labels->GetLabel('__SET__')}',
  1255. width: 240,
  1256. handler: function(){
  1257. var vv = Ext.getCmp('pres_wiper').getValue();
  1258. doCamOperation( {$CID}, 38, vv );
  1259. }
  1260. }]
  1261. }],
  1262. listeners:{
  1263. resize: function( p, adjWidth, adjHeight, rawWidth, rawHeight ){
  1264. if( rawWidth!= undefined ){
  1265. if( p.sukaMineWidth != adjWidth ){
  1266. p.sukaMineWidth = adjWidth;
  1267. var XX = p.sukaMineWidth * 9 / 16;
  1268. //p.setHeight( XX + 32 );
  1269. var z = Ext.getCmp('db_node_{$Node['id']}_pic');
  1270. z.setHeight( XX );
  1271. };
  1272. };
  1273. },
  1274. afterrender: function( p ){
  1275. var xx = p.getWidth() * 9 / 16;
  1276. //p.setHeight( xx + 32 );
  1277. var z = Ext.getCmp('db_node_{$Node['id']}_pic');
  1278. z.setHeight( xx );
  1279. document.getElementById('img_btn_010_{$Node['id']}').addEventListener( 'mouseup', makePtzStop );
  1280. document.getElementById('img_btn_010_{$Node['id']}').addEventListener( 'mousedown', makePtzMove );
  1281. document.getElementById('img_btn_011_{$Node['id']}').addEventListener( 'mouseup', makePtzStop );
  1282. document.getElementById('img_btn_011_{$Node['id']}').addEventListener( 'mousedown', makePtzMove );
  1283. document.getElementById('img_btn_027_{$Node['id']}').addEventListener( 'mouseup', makePtzStop );
  1284. document.getElementById('img_btn_027_{$Node['id']}').addEventListener( 'mousedown', makePtzMove );
  1285. document.getElementById('img_btn_028_{$Node['id']}').addEventListener( 'mouseup', makePtzStop );
  1286. document.getElementById('img_btn_028_{$Node['id']}').addEventListener( 'mousedown', makePtzMove );
  1287. document.getElementById('img_btn_029_{$Node['id']}').addEventListener( 'mouseup', makePtzStop );
  1288. document.getElementById('img_btn_029_{$Node['id']}').addEventListener( 'mousedown', makePtzMove );
  1289. document.getElementById('img_btn_030_{$Node['id']}').addEventListener( 'mouseup', makePtzStop );
  1290. document.getElementById('img_btn_030_{$Node['id']}').addEventListener( 'mousedown', makePtzMove );
  1291. document.getElementById('img_btn_031_{$Node['id']}').addEventListener( 'mouseup', makePtzStop );
  1292. document.getElementById('img_btn_031_{$Node['id']}').addEventListener( 'mousedown', makePtzMove );
  1293. document.getElementById('img_btn_032_{$Node['id']}').addEventListener( 'mouseup', makePtzStop );
  1294. document.getElementById('img_btn_032_{$Node['id']}').addEventListener( 'mousedown', makePtzMove );
  1295. document.getElementById('img_btn_033_{$Node['id']}').addEventListener( 'mouseup', makePtzStop );
  1296. document.getElementById('img_btn_033_{$Node['id']}').addEventListener( 'mousedown', makePtzMove );
  1297. document.getElementById('img_btn_034_{$Node['id']}').addEventListener( 'mouseup', makePtzStop );
  1298. document.getElementById('img_btn_034_{$Node['id']}').addEventListener( 'mousedown', makePtzMove );
  1299. document.getElementById('img_btn_020_{$Node['id']}').addEventListener( 'mousedown', makePtzStop );
  1300. showCameraPresets( 'ptz_presets_0', {$Cam['id']} );
  1301. }
  1302. }
  1303. });
  1304. zaza.show();
  1305. }
  1306. },{
  1307. html: '{$Labels->GetLabel('_CAM_IR_ECO_')}'
  1308. },{
  1309. xtype: 'checkbox',
  1310. id: 'ptz_ir_eco',
  1311. checked: ({$Cam['eco_ir']} > 0 ),
  1312. listeners:{
  1313. check: function( a, c ){
  1314. if( c ){
  1315. doCamOperation( {$CID}, 39, 1 );
  1316. } else {
  1317. doCamOperation( {$CID}, 39, 0 );
  1318. };
  1319. }
  1320. }
  1321. },{
  1322. html: '&nbsp;'
  1323. },{
  1324. html: '{$Labels->GetLabel('_CAM_PTZ_AAC_')}'
  1325. },{
  1326. xtype: 'checkbox',
  1327. id: 'ptz_axel_c',
  1328. disabled: ({$Cam['protocol']} == 0),
  1329. checked: ({$Cam['ptz_axel']} < 6 ),
  1330. listeners:{
  1331. check: function( a, c ){
  1332. if( c ){
  1333. doCamOperation( {$CID}, 13, 0 );
  1334. var zz = Ext.getCmp('ptz_axel');
  1335. zz.disable();
  1336. } else {
  1337. var zz = Ext.getCmp('ptz_axel');
  1338. zz.enable();
  1339. var vava = zz.getValue();
  1340. if( vava < 5 ){
  1341. vava = 5;
  1342. zz.setValue( vava, true );
  1343. } else {
  1344. doCamOperation( {$CID}, 13, vava );
  1345. };
  1346. var jj = Ext.getCmp('ptz_axel_d');
  1347. if( jj.rendered ) jj.update('<p>X&nbsp;'+ vava + '</p>');
  1348. };
  1349. }
  1350. }
  1351. },{
  1352. html: '&nbsp;'
  1353. },{
  1354. html: '{$Labels->GetLabel('_CAM_PTZ_MAC_')}'
  1355. },{
  1356. xtype: 'slider',
  1357. id: 'ptz_axel',
  1358. disabled: (({$Cam['protocol']} == 0)||({$Cam['ptz_axel']} < 6)),
  1359. minValue: 5,
  1360. maxValue: 20,
  1361. value: {$Cam['ptz_axel']},
  1362. listeners:{
  1363. change: function( a, c, b ){
  1364. doCamOperation( {$CID}, 13, c );
  1365. var zz = Ext.getCmp('ptz_axel_d');
  1366. if( zz.rendered ) zz.update('<p>X&nbsp;'+ c + '</p>');
  1367. }
  1368. }
  1369. },{
  1370. id: 'ptz_axel_d',
  1371. html: '<p>X&nbsp;'+ {$Cam['ptz_axel']} + '</p>'
  1372. }]
  1373. },{
  1374. layout: 'table',
  1375. id: 'cam_ptz_par',
  1376. hidden: (({$Cam['protocol']}<1) || ({$Cam['type']}>13)),
  1377. frame: false,
  1378. border: false,
  1379. layoutConfig: {
  1380. columns: 3
  1381. },
  1382. defaults: {
  1383. frame: false,
  1384. bodyStyle: 'padding:10px',
  1385. border: false
  1386. },
  1387. items:[{
  1388. width: 200,
  1389. html: '{$Labels->GetLabel('_CAM_PANMOD_')}'
  1390. },{
  1391. xtype: 'combo',
  1392. fieldLabel: '{$Labels->GetLabel('_CAM_PANMOD_')}',
  1393. lazyRender: true,
  1394. id: 'pan_mode',
  1395. disabled: ({$Cam['protocol']} == 0),
  1396. mode: 'local',
  1397. forceSelection: true,
  1398. triggerAction: 'all',
  1399. editable: false,
  1400. disableKeyFilter: true,
  1401. store: new Ext.data.ArrayStore({
  1402. fields: ['pm','pm_txt'],
  1403. data: [
  1404. [0,'{$Labels->GetLabel('_CAM_TM_REGULAR_')}'],
  1405. [1,'{$Labels->GetLabel('_CAM_TM_REVERSED_')}']
  1406. ]
  1407. }),
  1408. valueField: 'pm',
  1409. displayField: 'pm_txt',
  1410. value: {$Cam['pan_model']},
  1411. listeners:{
  1412. select: function( a, c, b ){
  1413. doCamOperation( {$CID}, 8, b );
  1414. }
  1415. }
  1416. },{
  1417. html: '&nbsp;'
  1418. },{
  1419. html: '{$Labels->GetLabel('_CAM_PANANGS_')}'
  1420. },{
  1421. xtype: 'numberfield',
  1422. id: 'pan_ang',
  1423. width: '95%',
  1424. disabled: ({$Cam['protocol']} == 0),
  1425. minValue: 0,
  1426. maxValue: 360,
  1427. value: {$Cam['pan_angles']},
  1428. listeners:{
  1429. change: function( a, c, b ){
  1430. doCamOperation( {$CID}, 9, c );
  1431. }
  1432. }
  1433. },{
  1434. html: '&nbsp;'
  1435. },{
  1436. html: '{$Labels->GetLabel('_CAM_TILTMOD_')}'
  1437. },{
  1438. xtype: 'combo',
  1439. fieldLabel: '{$Labels->GetLabel('_CAM_TILTMOD_')}',
  1440. lazyRender: true,
  1441. id: 'tilt_mode',
  1442. disabled: ({$Cam['protocol']} == 0),
  1443. mode: 'local',
  1444. forceSelection: true,
  1445. triggerAction: 'all',
  1446. editable: false,
  1447. disableKeyFilter: true,
  1448. store: new Ext.data.ArrayStore({
  1449. fields: ['tm','tm_txt'],
  1450. data: [
  1451. [0,'{$Labels->GetLabel('_CAM_TM_REGULAR_')}'],
  1452. [1,'{$Labels->GetLabel('_CAM_TM_REVERSED_')}'],
  1453. [2,'{$Labels->GetLabel('_CAM_TM_SHIFTED_')} 90�'],
  1454. [3,'{$Labels->GetLabel('_CAM_TM_RSHIFTED_')} 90�']
  1455. ]
  1456. }),
  1457. valueField: 'tm',
  1458. displayField: 'tm_txt',
  1459. value: {$Cam['tilt_model']},
  1460. listeners:{
  1461. select: function( a, c, b ){
  1462. doCamOperation( {$CID}, 10, b );
  1463. }
  1464. }
  1465. },{
  1466. html: '&nbsp;'
  1467. },{
  1468. html: '{$Labels->GetLabel('_CAM_TILTANGS_')}'
  1469. },{
  1470. xtype: 'numberfield',
  1471. id: 'tilt_ang',
  1472. width: '95%',
  1473. disabled: ({$Cam['protocol']} == 0),
  1474. minValue: 0,
  1475. maxValue: 180,
  1476. value: {$Cam['tilt_angles']},
  1477. listeners:{
  1478. change: function( a, c, b ){
  1479. doCamOperation( {$CID}, 11, c );
  1480. }
  1481. }
  1482. },{
  1483. html: '&nbsp;'
  1484. }]
  1485. },{
  1486. layout: 'table',
  1487. id: 'cam_loc_ori',
  1488. frame: false,
  1489. border: false,
  1490. layoutConfig: {
  1491. columns: 3
  1492. },
  1493. defaults: {
  1494. frame: false,
  1495. bodyStyle: 'padding:10px',
  1496. border: false
  1497. },
  1498. items:[{
  1499. width: 200,
  1500. html: '<table ><tr><td>{$Labels->GetLabel('_AXIS_ROT_')}</td><td><img width="32" src="/style/wicons/rotate-axis-x-512.png"></td></tr></table>'
  1501. },{
  1502. xtype: 'numberfield',
  1503. decimalPrecision: 3,
  1504. value: {$Cam['x_rot']},
  1505. listeners:{
  1506. change: function( a, c, b ){
  1507. doCamOperation( {$CID}, 14, c );
  1508. }
  1509. }
  1510. },{
  1511. html: '&nbsp;'
  1512. },{
  1513. html: '<table ><tr><td>{$Labels->GetLabel('_AXIS_ROT_')}</td><td><img width="32" src="/style/wicons/rotate-axis-y-512.png"></td></tr></table>'
  1514. },{
  1515. xtype: 'numberfield',
  1516. decimalPrecision: 3,
  1517. value: {$Cam['y_rot']},
  1518. listeners:{
  1519. change: function( a, c, b ){
  1520. doCamOperation( {$CID}, 15, c );
  1521. }
  1522. }
  1523. },{
  1524. html: '&nbsp;'
  1525. },{
  1526. html: '<table ><tr><td>{$Labels->GetLabel('_AXIS_ROT_')}</td><td><img width="32" src="/style/wicons/rotate-axis-z-512.png"></td></tr></table>'
  1527. },{
  1528. xtype: 'numberfield',
  1529. decimalPrecision: 3,
  1530. value: {$Cam['z_rot']},
  1531. listeners:{
  1532. change: function( a, c, b ){
  1533. doCamOperation( {$CID}, 16, c );
  1534. }
  1535. }
  1536. },{
  1537. html: '&nbsp;'
  1538. },{
  1539. html: '<table ><tr><td>Δ {$Labels->GetLabel('_FROM_ANCH_')}</td><td><img width="32" src="/style/wicons/rotate-position-x-512.png"></td></tr></table>'
  1540. },{
  1541. xtype: 'numberfield',
  1542. decimalPrecision: 3,
  1543. value: {$Cam['x']},
  1544. listeners:{
  1545. change: function( a, c, b ){
  1546. doCamOperation( {$CID}, 17, c );
  1547. }
  1548. }
  1549. },{
  1550. html: '&nbsp;'
  1551. },{
  1552. html: '<table ><tr><td>Δ {$Labels->GetLabel('_FROM_ANCH_')}</td><td><img width="32" src="/style/wicons/rotate-position-y-512.png"></td></tr></table>'
  1553. },{
  1554. xtype: 'numberfield',
  1555. decimalPrecision: 3,
  1556. value: {$Cam['y']},
  1557. listeners:{
  1558. change: function( a, c, b ){
  1559. doCamOperation( {$CID}, 18, c );
  1560. }
  1561. }
  1562. },{
  1563. html: '&nbsp;'
  1564. },{
  1565. html: '<table ><tr><td>Δ {$Labels->GetLabel('_FROM_ANCH_')}</td><td><img width="32" src="/style/wicons/rotate-position-z-512.png"></td></tr></table>'
  1566. },{
  1567. xtype: 'numberfield',
  1568. decimalPrecision: 3,
  1569. value: {$Cam['z']},
  1570. listeners:{
  1571. change: function( a, c, b ){
  1572. doCamOperation( {$CID}, 19, c );
  1573. }
  1574. }
  1575. },{
  1576. html: '&nbsp;'
  1577. }]
  1578. }]
  1579. },{
  1580. title: '{$Labels->GetLabel('_TARGETING_TAB_')}',
  1581. id: 'target_tab',
  1582. frame: false,
  1583. border: false,
  1584. items:[{
  1585. layout: 'table',
  1586. frame: false,
  1587. border: false,
  1588. layoutConfig: {
  1589. columns: 3
  1590. },
  1591. defaults: {
  1592. frame: false,
  1593. bodyStyle: 'padding:10px',
  1594. border: false
  1595. },
  1596. items:[{
  1597. width: 200,
  1598. html: '{$Labels->GetLabel('_CAM_LABEL_')}'
  1599. },{
  1600. xtype: 'textfield',
  1601. id: 'cam_label',
  1602. width: 200,
  1603. value: '{$Cam['node_name']}',
  1604. listeners:{
  1605. change: function( a, c, b ){
  1606. doCamOperation( {$CID}, 20, c );
  1607. }
  1608. }
  1609. },{
  1610. xtype: 'spacer'
  1611. },{
  1612. width: 200,
  1613. html: '{$Labels->GetLabel('_CAM_TRIGGERING_MODE_')}'
  1614. },{
  1615. xtype: 'combo',
  1616. lazyRender: true,
  1617. id: 'cam_targeting',
  1618. mode: 'local',
  1619. forceSelection: true,
  1620. triggerAction: 'all',
  1621. editable: false,
  1622. disableKeyFilter: true,
  1623. store: new Ext.data.ArrayStore({
  1624. fields: ['type','type_txt'],
  1625. data: [
  1626. [0,'{$Labels->GetLabel('_CAM_TM_STRICT_VISIBLE_')}'],
  1627. [1,'{$Labels->GetLabel('_CAM_TM_ALL_NEAR_')}'],
  1628. [2,'{$Labels->GetLabel('_CAM_TM_ALL_FAR_')}'],
  1629. [3,'{$Labels->GetLabel('_CAM_TM_ALL_')}']
  1630. ]
  1631. }),
  1632. value: {$Cam['trigger_mode']},
  1633. valueField: 'type',
  1634. displayField: 'type_txt',
  1635. listeners:{
  1636. select: function( a, c, b ){
  1637. doCamOperation( {$CID}, 12, b );
  1638. }
  1639. }
  1640. },{
  1641. xtype: 'spacer'
  1642. },{
  1643. width: 200,
  1644. html: '{$Labels->GetLabel('_CAM_PREF_ONLY_')}'
  1645. },{
  1646. xtype: 'checkbox',
  1647. id: 'cam_pref_only',
  1648. fieldLabel: '',
  1649. width: 200,
  1650. checked: {$Cam['prefered_events_only']},
  1651. listeners:{
  1652. check: function( a, c ){
  1653. if( c ){
  1654. doCamOperation( {$CID}, 40, 1 );
  1655. } else {
  1656. doCamOperation( {$CID}, 40, 0 );
  1657. };
  1658. }
  1659. }
  1660. },{
  1661. xtype: 'spacer'
  1662. },{
  1663. width: 200,
  1664. html: '{$Labels->GetLabel('_CAM_AUTO_HOMING_')}'
  1665. },{
  1666. xtype: 'checkbox',
  1667. id: 'cam_horeten',
  1668. fieldLabel: '',
  1669. width: 200,
  1670. checked: {$Cam['homing_enable']},
  1671. listeners:{
  1672. check: function( a, c ){
  1673. if( c ){
  1674. doCamOperation( {$CID}, 25, 1 );
  1675. } else {
  1676. doCamOperation( {$CID}, 25, 0 );
  1677. };
  1678. }
  1679. }
  1680. },{
  1681. xtype: 'spacer'
  1682. },{
  1683. width: 200,
  1684. html: '{$Labels->GetLabel('_CAM_AH_TIME_')}'
  1685. },{
  1686. xtype: 'numberfield',
  1687. id: 'cam_horetto',
  1688. width: 200,
  1689. value: '{$Cam['homing_to']}',
  1690. listeners:{
  1691. change: function( a, c, b ){
  1692. doCamOperation( {$CID}, 26, c );
  1693. }
  1694. }
  1695. },{
  1696. xtype: 'spacer'
  1697. },{
  1698. width: 200,
  1699. html: '{$Labels->GetLabel('_CAM_AH_TOKEN_')}'
  1700. },{
  1701. xtype: 'textfield',
  1702. id: 'cam_horettk',
  1703. fieldLabel: '',
  1704. width: 200,
  1705. value: '{$Cam['home_token']}',
  1706. readOnly: true
  1707. },{
  1708. xtype: 'spacer'
  1709. }]
  1710. }]
  1711. }]
  1712. }
  1713. PZAKSJEJSDKGJHGASD;
  1714. $Data['status']='ok';
  1715. if( $Cam['status'] == 0 ){
  1716. $ADDCAMPOPO = '';
  1717. } else {
  1718. $ADDCAMPOPO = '';
  1719. };
  1720. if( $CAM_IP ){
  1721. switch( $Cam['status'] ){
  1722. case 0: $Data['content'] = $TPL_SET_CREDS_IP; break;
  1723. default: $Data['content'] = $TPL_CAM_EDITOR; break;
  1724. };
  1725. } else {
  1726. $Data['content'] = $TPL_CAM_EDITOR;
  1727. };
  1728. } else {
  1729. $Data['status']='error';
  1730. };
  1731. echo $Data['content'];
  1732. } else {
  1733. header('location: /');
  1734. };
  1735. ?>