PageRenderTime 48ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/monitorremoto/view/axis214ipptz_extra.php

https://gitlab.com/talueses/SIPVE
PHP | 287 lines | 228 code | 15 blank | 44 comment | 5 complexity | 9747acc622c8a0a4450edafbf31066cb MD5 | raw file
  1. <?php
  2. /*******************************************************************************\
  3. * @copyright
  4. *
  5. * === SIPve ===
  6. * Sistema Integrado de Protección con capacidades de Videovigilancia
  7. * Control de Acceso y Carnetización para el resguardo físico de instalaciones.
  8. *
  9. * Copyright (C) 2012 Fundación Centro Nacional de Innovación Tecnológica, Cenit.
  10. * Dirección de Investigación, Desarrollo e Innovación.
  11. * Gilda Ramos.
  12. * José Medina.
  13. * Héctor Reverón.
  14. * David Concepción.
  15. * Ronald Delgado.
  16. * Jenner Fuentes.
  17. *
  18. * This program is free software: you can redistribute it and/or modify
  19. * it under the terms of the GNU General Public License as published by
  20. * the Free Software Foundation, either VERSION 3 of the License, or
  21. * (at your option) any later version.
  22. *
  23. * This program is distributed in the hope that it will be useful,
  24. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  25. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  26. * GNU General Public License for more details.
  27. *
  28. * You should have received a copy of the GNU General Public License
  29. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  30. *
  31. * Para mas información visite
  32. * @link http://repositorio.softwarelibre.gob.ve/ - RNA
  33. * @link http://sourceforge.net/projects/sipve/ - SourceForge
  34. * @link https://gitlab.com/talueses/SIPVE - Gitlab Repositorio.
  35. *
  36. \*******************************************************************************/
  37. ?>
  38. <?php
  39. session_start(); // start up your PHP session!
  40. header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
  41. header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past
  42. require_once "../controller/monitorremoto.control.php"; // Class CONTROLLER
  43. $obj = new CamaraCommands();
  44. //echo "<div align='left'><pre>".print_r($_REQUEST,true)."</pre></div>";
  45. if (method_exists($obj, $_REQUEST["extraPanelMethod"])){
  46. call_user_func(array($obj, $_REQUEST["extraPanelMethod"]));
  47. }
  48. ?>
  49. <html>
  50. <head>
  51. <meta http-equiv="Content-Type" content="text/html; charset=utf-8 ">
  52. <link href="../../inicio/css/comunes.css" rel="stylesheet" type="text/css" />
  53. <link type="text/css" href="../../inicio/css/jquery-ui.css" rel="stylesheet" />
  54. <script type="text/javascript" src="../../inicio/js/jquery.js"></script>
  55. <script type="text/javascript" src="../../inicio/js/jquery-ui.min.js"></script>
  56. <style type="text/css">
  57. .listado{
  58. background:#fff;
  59. margin: 0px 1px 0px 1px;
  60. border: #aaaaaa solid 1px;
  61. -moz-border-radius: 6px;
  62. -webkit-border-radius: 6px;
  63. border-radius: 6px;
  64. }
  65. .listado tr {
  66. background:#fff;
  67. }
  68. .listado tr th {
  69. border: 1px solid #d3d3d3; background: #e6e6e6 url(../../inicio/css/images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #555555;
  70. -moz-border-radius: 6px;
  71. -webkit-border-radius: 6px;
  72. border-radius: 6px;
  73. }
  74. </style>
  75. <script type="text/javascript" language="javascript">
  76. $(function() {
  77. var maxFocus = parseInt(<?php echo $obj->maxFocus;?>);
  78. var minFocus = parseInt(<?php echo $obj->minFocus;?>);
  79. var maxIris = parseInt(<?php echo $obj->maxIris;?>);
  80. var minIris = parseInt(<?php echo $obj->minIris;?>);
  81. if($('#keyAccess', parent.document).val()=='on'){
  82. $("#radioKeyAccess1").attr("checked", true);
  83. }
  84. $('input:button, input:submit').button();
  85. $('#radioKeyAccess').buttonset();
  86. $( "#focus" ).slider({
  87. max:maxFocus,
  88. min:minFocus,
  89. stop: function( event, ui ) {
  90. setComandoCamara('focus',ui.value);
  91. $('#resFocus').html(setValPercent(ui.value,parseInt(<?php echo $obj->maxFocus;?>)));
  92. },
  93. animate: true
  94. });
  95. // IRIS
  96. $( "#iris" ).slider({
  97. max:maxIris,
  98. min:minIris,
  99. stop: function( event, ui ) {
  100. setComandoCamara('iris',ui.value);
  101. $('#resIris').html(setValPercent(ui.value,parseInt(<?php echo $obj->maxIris;?>)));
  102. },
  103. animate: true
  104. });
  105. // --------- Posicion Actual de la Camara ---------- //
  106. setComandoCamara('position','');
  107. });
  108. function setComandoCamara(option,value){
  109. //alert('idcamara='+$('#idcamara', parent.document).val()+'&extraPanelMethod='+$('#extraPanelMethod', parent.document).val()+'&option='+option+'&value='+value);
  110. $.ajax({
  111. dataType: 'json',
  112. type: "POST",
  113. url: "setComandoCamara.php",
  114. //data: 'idcamara='+$('#idcamara').val()+'&',
  115. data: 'idcamara='+$('#idcamara', parent.document).val()+'&control=extra&extraPanelMethod='+$('#extraPanelMethod', parent.document).val()+'&option='+option+'&value='+value,
  116. success: function(data){
  117. //alert(data);
  118. if (data[0]=='position'){
  119. //alert(data);
  120. // FOCUS
  121. var focus = parseInt(data[4]);
  122. if (focus){
  123. $('#focus').slider( "option", "value", focus);
  124. $('#resFocus').html(setValPercent(focus,parseInt(<?php echo $obj->maxFocus;?>)));
  125. }
  126. // IRIS
  127. var iris = parseInt(data[5]);
  128. if (iris){
  129. $('#iris').slider( "option", "value", iris);
  130. $('#resIris').html(setValPercent(iris,parseInt(<?php echo $obj->maxIris;?>)));
  131. }
  132. }
  133. }
  134. });
  135. }
  136. function setMove(option){
  137. var value = null;
  138. switch(option) {
  139. case 'autofocusOn':
  140. option = 'autofocus';
  141. value = 'on';
  142. break;
  143. case 'autofocusOff':
  144. option = 'autofocus';
  145. value = 'off';
  146. break;
  147. case 'autoirisOn':
  148. option = 'autoiris';
  149. value = 'on';
  150. break;
  151. case 'autoirisOff':
  152. option = 'autoiris';
  153. value = 'off';
  154. break;
  155. case 'ircutfilterOn':
  156. option = 'ircutfilter';
  157. value = 'on';
  158. break;
  159. case 'ircutfilterOff':
  160. option = 'ircutfilter';
  161. value = 'off';
  162. break;
  163. case 'ircutfilterAuto':
  164. option = 'ircutfilter';
  165. value = 'auto';
  166. break;
  167. case 'keyAccessOn':
  168. $('#keyAccess', parent.document).val('on');
  169. return false;
  170. break;
  171. case 'keyAccessOff':
  172. $('#keyAccess',parent.document).val('off');
  173. return false;
  174. break;
  175. }
  176. setComandoCamara(option,value);
  177. setTimeout('setComandoCamara(\'position\',\'\');',1000);
  178. }
  179. function setValPercent(value,maxVal){
  180. return parseInt(((parseInt(value) * 100) / maxVal))+'%';
  181. }
  182. </script>
  183. </head>
  184. <body style="margin:0px;background:#fff;">
  185. <center>
  186. <table border="0" width="99%" class="listado" >
  187. <tr>
  188. <td align="center">
  189. <table class="listado" width="100%" style="padding: 0px;margin: 0px;" >
  190. <tr>
  191. <th>Foco: <b><label id="resFocus">0%</label></b></th>
  192. </tr>
  193. <tr>
  194. <td>
  195. <div id="focus"></div>
  196. </td>
  197. </tr>
  198. </table>
  199. <table class="listado" width="100%" style="padding: 0px;margin: 5px 0px 0px 0px;" >
  200. <tr>
  201. <th>Iris: <b><label id="resIris">0%</label></b></th>
  202. </tr>
  203. <tr>
  204. <td>
  205. <div id="iris"></div>
  206. </td>
  207. </tr>
  208. </table>
  209. <table class="listado" width="80%" style="padding: 0px;margin: 5px 0px 0px 0px;" >
  210. <tr>
  211. <th>Auto Foco</th>
  212. </tr>
  213. <tr>
  214. <td align="center" >
  215. <input type="button" value="On" onclick="setMove('autofocusOn');" />
  216. <input type="button" value="Off" onclick="setMove('autofocusOff');" />
  217. </td>
  218. </tr>
  219. </table>
  220. <table class="listado" width="80%" style="padding: 0px;margin: 5px 0px 0px 0px; " >
  221. <tr>
  222. <th>Auto Iris</th>
  223. </tr>
  224. <tr>
  225. <td align="center" >
  226. <input type="button" value="On" onclick="setMove('autoirisOn');" />
  227. <input type="button" value="Off" onclick="setMove('autoirisOff');" />
  228. </td>
  229. </tr>
  230. </table>
  231. <table class="listado" width="80%" style="padding: 0px;margin: 5px 0px 0px 0px; " >
  232. <tr>
  233. <th style="font-size: 11px;">Compensaci&oacute;n de luz de fondo</th>
  234. </tr>
  235. <tr>
  236. <td align="center" >
  237. <input type="button" value="On" onclick="setMove('autoirisOn');" />
  238. <input type="button" value="Off" onclick="setMove('autoirisOff');" />
  239. </td>
  240. </tr>
  241. </table>
  242. <table class="listado" width="80%" style="padding: 0px;margin: 5px 0px 0px 0px; " >
  243. <tr>
  244. <th>Filtro IR Cut</th>
  245. </tr>
  246. <tr>
  247. <td align="center" >
  248. <input type="button" value="On" onclick="setMove('ircutfilterOn');" style="width: 40px;"/>
  249. <input type="button" value="Off" onclick="setMove('ircutfilterOff');" style="width: 40px;"/>
  250. <input type="button" value="Auto" onclick="setMove('ircutfilterAuto');" style="width: 40px;"/>
  251. </td>
  252. </tr>
  253. </table>
  254. <table class="listado" width="80%" style="padding: 0px;margin: 5px 0px 0px 0px; " >
  255. <tr>
  256. <th >Movimiento por Teclado</th>
  257. </tr>
  258. <tr>
  259. <td align="center" >
  260. <div id="radioKeyAccess">
  261. <input type="radio" name="radioKey" id="radioKeyAccess1" onclick="setMove('keyAccessOn');"/><label for="radioKeyAccess1">On</label>
  262. <input type="radio" name="radioKey" id="radioKeyAccess2" onclick="setMove('keyAccessOff');" checked="checked"/><label for="radioKeyAccess2">Off</label>
  263. </div>
  264. </td>
  265. </tr>
  266. </table>
  267. </td>
  268. </tr>
  269. </table>
  270. </center>
  271. </body>
  272. </html>