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.

1749 lines
50 KiB

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