www-thermferm/webcam.php

Mon, 15 Apr 2024 17:04:57 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Mon, 15 Apr 2024 17:04:57 +0200
changeset 678
cc49115e769e
parent 581
b56988cc516b
permissions
-rw-r--r--

Better websocket broadcast messages. Added GLOBAL JSON command to the server. Better logic to trigger websocket and mqtt data updates for the fermenter units. Websocket receive added fermenter mode, stage, setpoints, switches. Added more css styles for the fermenter screen. Added the fermenter screen php and javascript.

<?php
/*****************************************************************************
 * Copyright (C) 2019
 *   
 * Michiel Broek <mbroek at mbse dot eu>
 *
 * This file is part of ThermFerm
 *
 * This is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the
 * Free Software Foundation; either version 2, or (at your option) any
 * later version.
 *
 * ThermFerm is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with ThermFerm; see the file COPYING.  If not, write to the Free
 * Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
 *****************************************************************************/

/*
 * Look for the style names in the jqwidgets/styles directory.
 */
$my_style = 'ui-darkness';
if (file_exists('/srv/http/streamer')) {
    shell_exec('/srv/http/streamer start');
} else if (file_exists('/var/www/streamer')) {
    shell_exec('/var/www/streamer start');
} else {
    exit;
}
sleep(1);
?>

<!DOCTYPE html>
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  <title>ThermFerm - Web Camera</title>
  <link type="text/css" href="css/webcam.css" rel="stylesheet" media="all" />
  <link type="text/css" href="jqwidgets/styles/jqx.base.css" rel="stylesheet" />
  <link type="text/css" href="jqwidgets/styles/jqx.<?php echo $my_style; ?>.css" rel="stylesheet" />
  <meta name="viewport" content="width=device-width, initial-scale=1 maximum-scale=1 minimum-scale=1" />
  <script>
        var theme = "<?php echo $my_style; ?>";
  </script>
  <script src="js/jquery-2.1.1.min.js"></script>
  <script src="jqwidgets/jqxcore.js"></script>
  <script src="jqwidgets/jqxwindow.js"></script>
  <script src="jqwidgets/jqxbuttons.js"></script>
  <script src="js/webcam.js"></script>
 </head>
 <body class="default">
  <div id="jqxWidget">
   <div id="content">

    <div id="camera_display">
     <div id="streamwrap" class="xform-p">
      <img id="streamimage" class="xform" src="<?php echo "http://".$_SERVER['SERVER_NAME'].":8090/?action=stream"; ?>" />
     </div>
    </div>

    <div id="camera_controls">
     <table style="width: 100%; padding: 10px;">
      <tr>
       <td>
        <input style="float: left; margin-left: 144px;" type="button" id="rotate" />
        <input style="float: left; margin-left: 5px;" type="button" id="mirror" />
        <input style="float: left; margin-left: 5px;" type="button" id="flip" />
       </td>
      </tr>
      <tr>
       <td>
        <div id="camera_panel_buttons">
         <input style="margin-top: 50px; margin-left: 160px;" type="button" id="Close" value="Sluiten" />
        </div>
       </td>
      </tr>
     </table>
    </div>
   </div>
  </div> <!-- jqxWidget -->
 </body>
</html>

mercurial