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.

1745 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
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months 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. [6,'BOSCH RCP+ via CGI']
  923. ]
  924. }),
  925. value: {$Cam['protocol']},
  926. valueField: 'type',
  927. displayField: 'type_txt',
  928. listeners:{
  929. select: function( a, c, b ){
  930. doCamOperation( {$CID}, 5, b );
  931. if( b > 0 ){
  932. Ext.getCmp('cam_drive_par').show();
  933. if(({$Cam['type']}==13)||({$Cam['type']}==11)){
  934. Ext.getCmp('cam_ptz_par').show();
  935. } else {
  936. Ext.getCmp('cam_ptz_par').hide();
  937. };
  938. if( b == 1 || b == 2 ){
  939. Ext.getCmp('cam_uart_par').show();
  940. Ext.getCmp('uart_id').enable();
  941. Ext.getCmp('prot_id').enable();
  942. } else {
  943. Ext.getCmp('cam_uart_par').hide();
  944. Ext.getCmp('uart_id').disable();
  945. Ext.getCmp('prot_id').disable();
  946. };
  947. Ext.getCmp('pan_mode').enable();
  948. Ext.getCmp('tilt_mode').enable();
  949. Ext.getCmp('pan_ang').enable();
  950. Ext.getCmp('tilt_ang').enable();
  951. } else {
  952. Ext.getCmp('cam_ptz_par').hide();
  953. Ext.getCmp('cam_drive_par').hide();
  954. Ext.getCmp('cam_uart_par').hide();
  955. Ext.getCmp('uart_id').disable();
  956. Ext.getCmp('prot_id').disable();
  957. Ext.getCmp('pan_mode').disable();
  958. Ext.getCmp('tilt_mode').disable();
  959. Ext.getCmp('pan_ang').disable();
  960. Ext.getCmp('tilt_ang').disable();
  961. };
  962. }
  963. }
  964. },{
  965. html: '&nbsp;'
  966. }]
  967. },{
  968. layout: 'table',
  969. id: 'cam_uart_par',
  970. frame: false,
  971. border: false,
  972. hidden: (({$Cam['protocol']}!=1) || ({$Cam['protocol']}!=2)),
  973. layoutConfig: {
  974. columns: 3
  975. },
  976. defaults: {
  977. frame: false,
  978. bodyStyle: 'padding:10px',
  979. border: false
  980. },
  981. items:[{
  982. width: 200,
  983. html: '{$Labels->GetLabel('_UART_PORT_')}'
  984. },{
  985. xtype: 'combo',
  986. fieldLabel: '{$Labels->GetLabel('_UART_PORT_')}',
  987. lazyRender: true,
  988. id: 'uart_id',
  989. mode: 'local',
  990. forceSelection: true,
  991. triggerAction: 'all',
  992. editable: false,
  993. disableKeyFilter: true,
  994. disabled: (({$Cam['protocol']}!=1 ) && ( {$Cam['protocol']}!=2 )),
  995. store: new Ext.data.ArrayStore({
  996. fields: ['uart','uart_txt'],
  997. data: [{$UARTS}]
  998. }),
  999. valueField: 'uart',
  1000. displayField: 'uart_txt',
  1001. value: {$Cam['uart_id']},
  1002. listeners:{
  1003. select: function( a, c, b ){
  1004. doCamOperation( {$CID}, 6, b );
  1005. }
  1006. }
  1007. },{
  1008. html: '&nbsp;'
  1009. },{
  1010. html: '{$Labels->GetLabel('_CAM_PROTO_ID_')}'
  1011. },{
  1012. xtype: 'numberfield',
  1013. id: 'prot_id',
  1014. width: '95%',
  1015. disabled: (({$Cam['protocol']}!=1 ) && ( {$Cam['protocol']}!=2 )),
  1016. minValue: 0,
  1017. maxValue: 255,
  1018. value: {$Cam['protocol_aux']},
  1019. listeners:{
  1020. change: function( a, c, b ){
  1021. doCamOperation( {$CID}, 7, c );
  1022. }
  1023. }
  1024. },{
  1025. html: '&nbsp;'
  1026. }]
  1027. },{
  1028. layout: 'table',
  1029. id: 'cam_drive_par',
  1030. frame: false,
  1031. border: false,
  1032. hidden: ({$Cam['protocol']}<1),
  1033. layoutConfig: {
  1034. columns: 3
  1035. },
  1036. defaults: {
  1037. frame: false,
  1038. bodyStyle: 'padding:10px',
  1039. border: false
  1040. },
  1041. items:[{
  1042. width: 200,
  1043. html: '{$Labels->GetLabel('_CAM_PTZ_MODE_')}'
  1044. },{
  1045. xtype: 'combo',
  1046. fieldLabel: '{$Labels->GetLabel('_CAM_PTZ_MODE_')}',
  1047. lazyRender: true,
  1048. id: 'cam_ptz_mode',
  1049. mode: 'local',
  1050. forceSelection: true,
  1051. triggerAction: 'all',
  1052. editable: false,
  1053. disableKeyFilter: true,
  1054. store: new Ext.data.ArrayStore({
  1055. fields: ['momo','momo_txt'],
  1056. data: [[0,'Absolute'],[1,'Presetets']]
  1057. }),
  1058. valueField: 'momo',
  1059. displayField: 'momo_txt',
  1060. value: ((({$Cam['type']}==13)||({$Cam['type']}==11))?0:1),
  1061. listeners:{
  1062. select: function( a, c, b ){
  1063. doCamOperation( {$CID}, 27, b );
  1064. if( b == 1 ){
  1065. Ext.getCmp('cam_ed_preset').enable();
  1066. Ext.getCmp('cam_ptz_par').hide();
  1067. } else {
  1068. Ext.getCmp('cam_ed_preset').disable();
  1069. Ext.getCmp('cam_ptz_par').show();
  1070. };
  1071. }
  1072. }
  1073. },{
  1074. xtype: 'button',
  1075. id: 'cam_ed_preset',
  1076. //disabled: (({$Cam['type']}==13)||({$Cam['type']}==11)),
  1077. text: '{$Labels->GetLabel('_CAM_PRES_EDIT_')}',
  1078. handler: function(){
  1079. var zaza = new Ext.Window({
  1080. title: '{$Labels->GetLabel('_CAM_PRES_EDITOR_')}',
  1081. modal: true,
  1082. resizable: false,
  1083. width: 800,
  1084. height: 804,
  1085. sukaMineWidth: -1,
  1086. items:[{
  1087. id: 'db_node_{$Node['id']}_pic',
  1088. border: true,
  1089. width: '100%',
  1090. 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>'
  1091. },{
  1092. layout: 'table',
  1093. layoutConfig: {
  1094. columns: 3
  1095. },
  1096. defaults: {
  1097. frame: false,
  1098. bodyStyle: 'padding:10px',
  1099. border: false
  1100. },
  1101. items:[{
  1102. width: 200,
  1103. html: '{$Labels->GetLabel('_CAM_PRES_SSELECT_')}'
  1104. },{
  1105. xtype: 'combo',
  1106. lazyRender: true,
  1107. id: 'sensor_id',
  1108. mode: 'local',
  1109. forceSelection: true,
  1110. triggerAction: 'all',
  1111. editable: false,
  1112. disableKeyFilter: true,
  1113. //disabled: (({$Cam['protocol']}!=1 ) && ( {$Cam['protocol']}!=2 )),
  1114. store: new Ext.data.ArrayStore({
  1115. fields: ['sens','sens_txt'],
  1116. data: {$SENSORS}
  1117. }),
  1118. valueField: 'sens',
  1119. displayField: 'sens_txt',
  1120. value: {$SENSOID},
  1121. listeners:{
  1122. select: function( a, c, b ){
  1123. selectedPresetsBackgroundSensor = c.data.sens;
  1124. }
  1125. }
  1126. },{
  1127. xtype: 'button',
  1128. text: '{$Labels->GetLabel('_CAM_PRES_LOBACK_')}',
  1129. width: 240,
  1130. handler: function(){
  1131. if( selectedPresetsBackgroundSensor == 0 ){
  1132. selectedPresetsBackgroundSensor = Ext.getCmp( 'sensor_id' ).getValue();
  1133. //selectedPresetsBackgroundSensor = {$SENSOID};
  1134. };
  1135. if( selectedPresetsBackgroundSensor ) preview2DDraw( selectedPresetsBackgroundSensor, 'ptz_presets_');
  1136. }
  1137. },{
  1138. html: ''
  1139. },{
  1140. xtype: 'button',
  1141. text: '{$Labels->GetLabel('_CAM_PRES_DELALL_')}',
  1142. width: 230,
  1143. handler: function(){
  1144. doCamOperation( {$CID}, 34, 0 );
  1145. window.setTimeout( "showCameraPresets( 'ptz_presets_0', "+{$Cam['id']}+" );", 1000 );
  1146. }
  1147. },{
  1148. xtype: 'button',
  1149. text: '{$Labels->GetLabel('_CAM_PRES_REMBG_')}',
  1150. width: 240,
  1151. handler: function(){
  1152. selectedPresetsBackgroundSensor = 0;
  1153. showCameraPresets( 'ptz_presets_0', {$Cam['id']} );
  1154. }
  1155. },{
  1156. html: '{$Labels->GetLabel('_CAM_PRES_COUNT_')}'
  1157. },{
  1158. xtype: 'numberfield',
  1159. id: 'pres_count',
  1160. width: 240
  1161. },{
  1162. xtype: 'button',
  1163. text: 'Set',
  1164. width: 240,
  1165. handler: function(){
  1166. var vv = Ext.getCmp('pres_count').getValue();
  1167. if( vv ){
  1168. doCamOperation( {$CID}, 31, vv );
  1169. };
  1170. }
  1171. },{
  1172. html: '{$Labels->GetLabel('_CAM_PRES_COLS_')}'
  1173. },{
  1174. xtype: 'numberfield',
  1175. id: 'pres_p_seg',
  1176. width: 240
  1177. },{
  1178. xtype: 'button',
  1179. text: '{$Labels->GetLabel('__SET__')}',
  1180. width: 240,
  1181. handler: function(){
  1182. var vv = Ext.getCmp('pres_p_seg').getValue();
  1183. if( vv ){
  1184. doCamOperation( {$CID}, 32, vv );
  1185. window.setTimeout( "showCameraPresets( 'ptz_presets_0', "+{$Cam['id']}+" );", 300 );
  1186. };
  1187. }
  1188. },{
  1189. html: '{$Labels->GetLabel('_CAM_PRES_ROWS_')}'
  1190. },{
  1191. xtype: 'numberfield',
  1192. id: 'pres_z_seg',
  1193. width: 240
  1194. },{
  1195. xtype: 'button',
  1196. text: '{$Labels->GetLabel('__SET__')}',
  1197. width: 240,
  1198. handler: function(){
  1199. var vv = Ext.getCmp('pres_z_seg').getValue();
  1200. if( vv ){
  1201. doCamOperation( {$CID}, 33, vv );
  1202. window.setTimeout( "showCameraPresets( 'ptz_presets_0', "+{$Cam['id']}+" );", 300 );
  1203. };
  1204. }
  1205. },{
  1206. html: '{$Labels->GetLabel('_CAM_PRES_IROFF_')}'
  1207. },{
  1208. xtype: 'numberfield',
  1209. id: 'pres_iroff',
  1210. width: 240
  1211. },{
  1212. xtype: 'button',
  1213. text: '{$Labels->GetLabel('__SET__')}',
  1214. width: 240,
  1215. handler: function(){
  1216. var vv = Ext.getCmp('pres_iroff').getValue();
  1217. doCamOperation( {$CID}, 35, vv );
  1218. }
  1219. },{
  1220. html: '{$Labels->GetLabel('_CAM_PRES_IRON_')}'
  1221. },{
  1222. xtype: 'numberfield',
  1223. id: 'pres_iron',
  1224. width: 240
  1225. },{
  1226. xtype: 'button',
  1227. text: '{$Labels->GetLabel('__SET__')}',
  1228. width: 240,
  1229. handler: function(){
  1230. var vv = Ext.getCmp('pres_iron').getValue();
  1231. doCamOperation( {$CID}, 36, vv );
  1232. }
  1233. },{
  1234. html: '{$Labels->GetLabel('_CAM_PRES_IRAUTO_')}'
  1235. },{
  1236. xtype: 'numberfield',
  1237. id: 'pres_irauto',
  1238. width: 240
  1239. },{
  1240. xtype: 'button',
  1241. text: '{$Labels->GetLabel('__SET__')}',
  1242. width: 240,
  1243. handler: function(){
  1244. var vv = Ext.getCmp('pres_irauto').getValue();
  1245. doCamOperation( {$CID}, 37, vv );
  1246. }
  1247. },{
  1248. html: '{$Labels->GetLabel('_CAM_PRES_IRWIPER_')}'
  1249. },{
  1250. xtype: 'numberfield',
  1251. id: 'pres_wiper',
  1252. width: 240
  1253. },{
  1254. xtype: 'button',
  1255. text: '{$Labels->GetLabel('__SET__')}',
  1256. width: 240,
  1257. handler: function(){
  1258. var vv = Ext.getCmp('pres_wiper').getValue();
  1259. doCamOperation( {$CID}, 38, vv );
  1260. }
  1261. }]
  1262. }],
  1263. listeners:{
  1264. resize: function( p, adjWidth, adjHeight, rawWidth, rawHeight ){
  1265. if( rawWidth!= undefined ){
  1266. if( p.sukaMineWidth != adjWidth ){
  1267. p.sukaMineWidth = adjWidth;
  1268. var XX = p.sukaMineWidth * 9 / 16;
  1269. //p.setHeight( XX + 32 );
  1270. var z = Ext.getCmp('db_node_{$Node['id']}_pic');
  1271. z.setHeight( XX );
  1272. };
  1273. };
  1274. },
  1275. afterrender: function( p ){
  1276. var xx = p.getWidth() * 9 / 16;
  1277. //p.setHeight( xx + 32 );
  1278. var z = Ext.getCmp('db_node_{$Node['id']}_pic');
  1279. z.setHeight( xx );
  1280. document.getElementById('img_btn_010_{$Node['id']}').addEventListener( 'mouseup', makePtzStop );
  1281. document.getElementById('img_btn_010_{$Node['id']}').addEventListener( 'mousedown', makePtzMove );
  1282. document.getElementById('img_btn_011_{$Node['id']}').addEventListener( 'mouseup', makePtzStop );
  1283. document.getElementById('img_btn_011_{$Node['id']}').addEventListener( 'mousedown', makePtzMove );
  1284. document.getElementById('img_btn_027_{$Node['id']}').addEventListener( 'mouseup', makePtzStop );
  1285. document.getElementById('img_btn_027_{$Node['id']}').addEventListener( 'mousedown', makePtzMove );
  1286. document.getElementById('img_btn_028_{$Node['id']}').addEventListener( 'mouseup', makePtzStop );
  1287. document.getElementById('img_btn_028_{$Node['id']}').addEventListener( 'mousedown', makePtzMove );
  1288. document.getElementById('img_btn_029_{$Node['id']}').addEventListener( 'mouseup', makePtzStop );
  1289. document.getElementById('img_btn_029_{$Node['id']}').addEventListener( 'mousedown', makePtzMove );
  1290. document.getElementById('img_btn_030_{$Node['id']}').addEventListener( 'mouseup', makePtzStop );
  1291. document.getElementById('img_btn_030_{$Node['id']}').addEventListener( 'mousedown', makePtzMove );
  1292. document.getElementById('img_btn_031_{$Node['id']}').addEventListener( 'mouseup', makePtzStop );
  1293. document.getElementById('img_btn_031_{$Node['id']}').addEventListener( 'mousedown', makePtzMove );
  1294. document.getElementById('img_btn_032_{$Node['id']}').addEventListener( 'mouseup', makePtzStop );
  1295. document.getElementById('img_btn_032_{$Node['id']}').addEventListener( 'mousedown', makePtzMove );
  1296. document.getElementById('img_btn_033_{$Node['id']}').addEventListener( 'mouseup', makePtzStop );
  1297. document.getElementById('img_btn_033_{$Node['id']}').addEventListener( 'mousedown', makePtzMove );
  1298. document.getElementById('img_btn_034_{$Node['id']}').addEventListener( 'mouseup', makePtzStop );
  1299. document.getElementById('img_btn_034_{$Node['id']}').addEventListener( 'mousedown', makePtzMove );
  1300. document.getElementById('img_btn_020_{$Node['id']}').addEventListener( 'mousedown', makePtzStop );
  1301. showCameraPresets( 'ptz_presets_0', {$Cam['id']} );
  1302. }
  1303. }
  1304. });
  1305. zaza.show();
  1306. }
  1307. },{
  1308. html: '{$Labels->GetLabel('_CAM_IR_ECO_')}'
  1309. },{
  1310. xtype: 'checkbox',
  1311. id: 'ptz_ir_eco',
  1312. checked: ({$Cam['eco_ir']} > 0 ),
  1313. listeners:{
  1314. check: function( a, c ){
  1315. if( c ){
  1316. doCamOperation( {$CID}, 39, 1 );
  1317. } else {
  1318. doCamOperation( {$CID}, 39, 0 );
  1319. };
  1320. }
  1321. }
  1322. },{
  1323. html: '&nbsp;'
  1324. },{
  1325. html: '{$Labels->GetLabel('_CAM_PTZ_AAC_')}'
  1326. },{
  1327. xtype: 'checkbox',
  1328. id: 'ptz_axel_c',
  1329. disabled: ({$Cam['protocol']} == 0),
  1330. checked: ({$Cam['ptz_axel']} < 6 ),
  1331. listeners:{
  1332. check: function( a, c ){
  1333. if( c ){
  1334. doCamOperation( {$CID}, 13, 0 );
  1335. var zz = Ext.getCmp('ptz_axel');
  1336. zz.disable();
  1337. } else {
  1338. var zz = Ext.getCmp('ptz_axel');
  1339. zz.enable();
  1340. var vava = zz.getValue();
  1341. if( vava < 5 ){
  1342. vava = 5;
  1343. zz.setValue( vava, true );
  1344. } else {
  1345. doCamOperation( {$CID}, 13, vava );
  1346. };
  1347. var jj = Ext.getCmp('ptz_axel_d');
  1348. if( jj.rendered ) jj.update('<p>X&nbsp;'+ vava + '</p>');
  1349. };
  1350. }
  1351. }
  1352. },{
  1353. html: '&nbsp;'
  1354. },{
  1355. html: '{$Labels->GetLabel('_CAM_PTZ_MAC_')}'
  1356. },{
  1357. xtype: 'slider',
  1358. id: 'ptz_axel',
  1359. disabled: (({$Cam['protocol']} == 0)||({$Cam['ptz_axel']} < 6)),
  1360. minValue: 5,
  1361. maxValue: 20,
  1362. value: {$Cam['ptz_axel']},
  1363. listeners:{
  1364. change: function( a, c, b ){
  1365. doCamOperation( {$CID}, 13, c );
  1366. var zz = Ext.getCmp('ptz_axel_d');
  1367. if( zz.rendered ) zz.update('<p>X&nbsp;'+ c + '</p>');
  1368. }
  1369. }
  1370. },{
  1371. id: 'ptz_axel_d',
  1372. html: '<p>X&nbsp;'+ {$Cam['ptz_axel']} + '</p>'
  1373. }]
  1374. },{
  1375. layout: 'table',
  1376. id: 'cam_ptz_par',
  1377. hidden: (({$Cam['protocol']}<1) || ({$Cam['type']}>13)),
  1378. frame: false,
  1379. border: false,
  1380. layoutConfig: {
  1381. columns: 3
  1382. },
  1383. defaults: {
  1384. frame: false,
  1385. bodyStyle: 'padding:10px',
  1386. border: false
  1387. },
  1388. items:[{
  1389. width: 200,
  1390. html: '{$Labels->GetLabel('_CAM_PANMOD_')}'
  1391. },{
  1392. xtype: 'combo',
  1393. fieldLabel: '{$Labels->GetLabel('_CAM_PANMOD_')}',
  1394. lazyRender: true,
  1395. id: 'pan_mode',
  1396. disabled: ({$Cam['protocol']} == 0),
  1397. mode: 'local',
  1398. forceSelection: true,
  1399. triggerAction: 'all',
  1400. editable: false,
  1401. disableKeyFilter: true,
  1402. store: new Ext.data.ArrayStore({
  1403. fields: ['pm','pm_txt'],
  1404. data: [
  1405. [0,'{$Labels->GetLabel('_CAM_TM_REGULAR_')}'],
  1406. [1,'{$Labels->GetLabel('_CAM_TM_REVERSED_')}']
  1407. ]
  1408. }),
  1409. valueField: 'pm',
  1410. displayField: 'pm_txt',
  1411. value: {$Cam['pan_model']},
  1412. listeners:{
  1413. select: function( a, c, b ){
  1414. doCamOperation( {$CID}, 8, b );
  1415. }
  1416. }
  1417. },{
  1418. html: '&nbsp;'
  1419. },{
  1420. html: '{$Labels->GetLabel('_CAM_PANANGS_')}'
  1421. },{
  1422. xtype: 'numberfield',
  1423. id: 'pan_ang',
  1424. width: '95%',
  1425. disabled: ({$Cam['protocol']} == 0),
  1426. minValue: 0,
  1427. maxValue: 360,
  1428. value: {$Cam['pan_angles']},
  1429. listeners:{
  1430. change: function( a, c, b ){
  1431. doCamOperation( {$CID}, 9, c );
  1432. }
  1433. }
  1434. },{
  1435. html: '&nbsp;'
  1436. },{
  1437. html: '{$Labels->GetLabel('_CAM_TILTMOD_')}'
  1438. },{
  1439. xtype: 'combo',
  1440. fieldLabel: '{$Labels->GetLabel('_CAM_TILTMOD_')}',
  1441. lazyRender: true,
  1442. id: 'tilt_mode',
  1443. disabled: ({$Cam['protocol']} == 0),
  1444. mode: 'local',
  1445. forceSelection: true,
  1446. triggerAction: 'all',
  1447. editable: false,
  1448. disableKeyFilter: true,
  1449. store: new Ext.data.ArrayStore({
  1450. fields: ['tm','tm_txt'],
  1451. data: [
  1452. [0,'{$Labels->GetLabel('_CAM_TM_REGULAR_')}'],
  1453. [1,'{$Labels->GetLabel('_CAM_TM_REVERSED_')}'],
  1454. [2,'{$Labels->GetLabel('_CAM_TM_SHIFTED_')} 90�'],
  1455. [3,'{$Labels->GetLabel('_CAM_TM_RSHIFTED_')} 90�']
  1456. ]
  1457. }),
  1458. valueField: 'tm',
  1459. displayField: 'tm_txt',
  1460. value: {$Cam['tilt_model']},
  1461. listeners:{
  1462. select: function( a, c, b ){
  1463. doCamOperation( {$CID}, 10, b );
  1464. }
  1465. }
  1466. },{
  1467. html: '&nbsp;'
  1468. },{
  1469. html: '{$Labels->GetLabel('_CAM_TILTANGS_')}'
  1470. },{
  1471. xtype: 'numberfield',
  1472. id: 'tilt_ang',
  1473. width: '95%',
  1474. disabled: ({$Cam['protocol']} == 0),
  1475. minValue: 0,
  1476. maxValue: 180,
  1477. value: {$Cam['tilt_angles']},
  1478. listeners:{
  1479. change: function( a, c, b ){
  1480. doCamOperation( {$CID}, 11, c );
  1481. }
  1482. }
  1483. },{
  1484. html: '&nbsp;'
  1485. }]
  1486. },{
  1487. layout: 'table',
  1488. id: 'cam_loc_ori',
  1489. frame: false,
  1490. border: false,
  1491. layoutConfig: {
  1492. columns: 3
  1493. },
  1494. defaults: {
  1495. frame: false,
  1496. bodyStyle: 'padding:10px',
  1497. border: false
  1498. },
  1499. items:[{
  1500. width: 200,
  1501. html: '<table ><tr><td>{$Labels->GetLabel('_AXIS_ROT_')}</td><td><img width="32" src="/style/wicons/rotate-axis-x-512.png"></td></tr></table>'
  1502. },{
  1503. xtype: 'numberfield',
  1504. decimalPrecision: 3,
  1505. value: {$Cam['x_rot']},
  1506. listeners:{
  1507. change: function( a, c, b ){
  1508. doCamOperation( {$CID}, 14, c );
  1509. }
  1510. }
  1511. },{
  1512. html: '&nbsp;'
  1513. },{
  1514. html: '<table ><tr><td>{$Labels->GetLabel('_AXIS_ROT_')}</td><td><img width="32" src="/style/wicons/rotate-axis-y-512.png"></td></tr></table>'
  1515. },{
  1516. xtype: 'numberfield',
  1517. decimalPrecision: 3,
  1518. value: {$Cam['y_rot']},
  1519. listeners:{
  1520. change: function( a, c, b ){
  1521. doCamOperation( {$CID}, 15, c );
  1522. }
  1523. }
  1524. },{
  1525. html: '&nbsp;'
  1526. },{
  1527. html: '<table ><tr><td>{$Labels->GetLabel('_AXIS_ROT_')}</td><td><img width="32" src="/style/wicons/rotate-axis-z-512.png"></td></tr></table>'
  1528. },{
  1529. xtype: 'numberfield',
  1530. decimalPrecision: 3,
  1531. value: {$Cam['z_rot']},
  1532. listeners:{
  1533. change: function( a, c, b ){
  1534. doCamOperation( {$CID}, 16, c );
  1535. }
  1536. }
  1537. },{
  1538. html: '&nbsp;'
  1539. },{
  1540. html: '<table ><tr><td>Δ {$Labels->GetLabel('_FROM_ANCH_')}</td><td><img width="32" src="/style/wicons/rotate-position-x-512.png"></td></tr></table>'
  1541. },{
  1542. xtype: 'numberfield',
  1543. decimalPrecision: 3,
  1544. value: {$Cam['x']},
  1545. listeners:{
  1546. change: function( a, c, b ){
  1547. doCamOperation( {$CID}, 17, c );
  1548. }
  1549. }
  1550. },{
  1551. html: '&nbsp;'
  1552. },{
  1553. html: '<table ><tr><td>Δ {$Labels->GetLabel('_FROM_ANCH_')}</td><td><img width="32" src="/style/wicons/rotate-position-y-512.png"></td></tr></table>'
  1554. },{
  1555. xtype: 'numberfield',
  1556. decimalPrecision: 3,
  1557. value: {$Cam['y']},
  1558. listeners:{
  1559. change: function( a, c, b ){
  1560. doCamOperation( {$CID}, 18, c );
  1561. }
  1562. }
  1563. },{
  1564. html: '&nbsp;'
  1565. },{
  1566. html: '<table ><tr><td>Δ {$Labels->GetLabel('_FROM_ANCH_')}</td><td><img width="32" src="/style/wicons/rotate-position-z-512.png"></td></tr></table>'
  1567. },{
  1568. xtype: 'numberfield',
  1569. decimalPrecision: 3,
  1570. value: {$Cam['z']},
  1571. listeners:{
  1572. change: function( a, c, b ){
  1573. doCamOperation( {$CID}, 19, c );
  1574. }
  1575. }
  1576. },{
  1577. html: '&nbsp;'
  1578. }]
  1579. }]
  1580. },{
  1581. title: '{$Labels->GetLabel('_TARGETING_TAB_')}',
  1582. id: 'target_tab',
  1583. frame: false,
  1584. border: false,
  1585. items:[{
  1586. layout: 'table',
  1587. frame: false,
  1588. border: false,
  1589. layoutConfig: {
  1590. columns: 3
  1591. },
  1592. defaults: {
  1593. frame: false,
  1594. bodyStyle: 'padding:10px',
  1595. border: false
  1596. },
  1597. items:[{
  1598. width: 200,
  1599. html: '{$Labels->GetLabel('_CAM_LABEL_')}'
  1600. },{
  1601. xtype: 'textfield',
  1602. id: 'cam_label',
  1603. width: 200,
  1604. value: '{$Cam['node_name']}',
  1605. listeners:{
  1606. change: function( a, c, b ){
  1607. doCamOperation( {$CID}, 20, c );
  1608. }
  1609. }
  1610. },{
  1611. xtype: 'spacer'
  1612. },{
  1613. width: 200,
  1614. html: '{$Labels->GetLabel('_CAM_TRIGGERING_MODE_')}'
  1615. },{
  1616. xtype: 'combo',
  1617. lazyRender: true,
  1618. id: 'cam_targeting',
  1619. mode: 'local',
  1620. forceSelection: true,
  1621. triggerAction: 'all',
  1622. editable: false,
  1623. disableKeyFilter: true,
  1624. store: new Ext.data.ArrayStore({
  1625. fields: ['type','type_txt'],
  1626. data: [
  1627. [0,'{$Labels->GetLabel('_CAM_TM_STRICT_VISIBLE_')}'],
  1628. [1,'{$Labels->GetLabel('_CAM_TM_ALL_NEAR_')}'],
  1629. [2,'{$Labels->GetLabel('_CAM_TM_ALL_FAR_')}'],
  1630. [3,'{$Labels->GetLabel('_CAM_TM_ALL_')}']
  1631. ]
  1632. }),
  1633. value: {$Cam['trigger_mode']},
  1634. valueField: 'type',
  1635. displayField: 'type_txt',
  1636. listeners:{
  1637. select: function( a, c, b ){
  1638. doCamOperation( {$CID}, 12, b );
  1639. }
  1640. }
  1641. },{
  1642. xtype: 'spacer'
  1643. },{
  1644. width: 200,
  1645. html: '{$Labels->GetLabel('_CAM_PREF_ONLY_')}'
  1646. },{
  1647. xtype: 'checkbox',
  1648. id: 'cam_pref_only',
  1649. fieldLabel: '',
  1650. width: 200,
  1651. checked: {$Cam['prefered_events_only']},
  1652. listeners:{
  1653. check: function( a, c ){
  1654. if( c ){
  1655. doCamOperation( {$CID}, 40, 1 );
  1656. } else {
  1657. doCamOperation( {$CID}, 40, 0 );
  1658. };
  1659. }
  1660. }
  1661. },{
  1662. xtype: 'spacer'
  1663. },{
  1664. width: 200,
  1665. html: '{$Labels->GetLabel('_CAM_AUTO_HOMING_')}'
  1666. },{
  1667. xtype: 'checkbox',
  1668. id: 'cam_horeten',
  1669. fieldLabel: '',
  1670. width: 200,
  1671. checked: {$Cam['homing_enable']},
  1672. listeners:{
  1673. check: function( a, c ){
  1674. if( c ){
  1675. doCamOperation( {$CID}, 25, 1 );
  1676. } else {
  1677. doCamOperation( {$CID}, 25, 0 );
  1678. };
  1679. }
  1680. }
  1681. },{
  1682. xtype: 'spacer'
  1683. },{
  1684. width: 200,
  1685. html: '{$Labels->GetLabel('_CAM_AH_TIME_')}'
  1686. },{
  1687. xtype: 'numberfield',
  1688. id: 'cam_horetto',
  1689. width: 200,
  1690. value: '{$Cam['homing_to']}',
  1691. listeners:{
  1692. change: function( a, c, b ){
  1693. doCamOperation( {$CID}, 26, c );
  1694. }
  1695. }
  1696. },{
  1697. xtype: 'spacer'
  1698. },{
  1699. width: 200,
  1700. html: '{$Labels->GetLabel('_CAM_AH_TOKEN_')}'
  1701. },{
  1702. xtype: 'textfield',
  1703. id: 'cam_horettk',
  1704. fieldLabel: '',
  1705. width: 200,
  1706. value: '{$Cam['home_token']}',
  1707. readOnly: true
  1708. },{
  1709. xtype: 'spacer'
  1710. }]
  1711. }]
  1712. }]
  1713. }
  1714. PZAKSJEJSDKGJHGASD;
  1715. $Data['status']='ok';
  1716. if( $Cam['status'] == 0 ){
  1717. $ADDCAMPOPO = '';
  1718. } else {
  1719. $ADDCAMPOPO = '';
  1720. };
  1721. if( $CAM_IP ){
  1722. switch( $Cam['status'] ){
  1723. case 0: $Data['content'] = $TPL_SET_CREDS_IP; break;
  1724. default: $Data['content'] = $TPL_CAM_EDITOR; break;
  1725. };
  1726. } else {
  1727. $Data['content'] = $TPL_CAM_EDITOR;
  1728. };
  1729. } else {
  1730. $Data['status']='error';
  1731. };
  1732. echo $Data['content'];
  1733. } else {
  1734. header('location: /');
  1735. };
  1736. ?>