# HG changeset patch # User Michiel Broek # Date 1406142860 -7200 # Node ID f2f45c44942f3b8b03004bef73134551d83c8005 # Parent 480bbe88ce0e08283ad51e8c2648251ca10c407e Added the maintenance 1-Wire display tab diff -r 480bbe88ce0e -r f2f45c44942f www-thermferm/index.php --- a/www-thermferm/index.php Wed Jul 23 17:12:18 2014 +0200 +++ b/www-thermferm/index.php Wed Jul 23 21:14:20 2014 +0200 @@ -27,6 +27,7 @@ $my_style = 'ui-redmond'; require_once('liveview.php'); +require_once('maintenance_panel.php'); $outstr = ''.PHP_EOL; @@ -47,28 +48,12 @@ $outstr .= ' '.PHP_EOL; $outstr .= ' '.PHP_EOL; $outstr .= ' '.PHP_EOL; -$outstr .= ' '.PHP_EOL; +$outstr .= ' '.PHP_EOL; +$outstr .= ' '.PHP_EOL; +$outstr .= ' '.PHP_EOL; +$outstr .= ' '.PHP_EOL; -$outstr .= ' function createMaintenance() {'.PHP_EOL; -$outstr .= ' $("#maintenance_window").jqxWindow({'.PHP_EOL; -$outstr .= ' height: 400, width: 800, autoOpen: false, theme: \''.$my_style.'\', '.PHP_EOL; -$outstr .= ' position: { x:100, y:50 }, '.PHP_EOL; -$outstr .= ' resizable: false, isModal: true, modalOpacity: 0.5, '.PHP_EOL; -$outstr .= ' okButton: $("#maintenance_ok"), '.PHP_EOL; -$outstr .= ' initContent: function () {'.PHP_EOL; -$outstr .= ' $("#maintenance_ok").jqxButton({ width: 70, height: 25, theme: \''.$my_style.'\' });'.PHP_EOL; -$outstr .= ' }'.PHP_EOL; -$outstr .= ' });'.PHP_EOL; -$outstr .= ' $("#maintenance").jqxButton({ width: 150, height: 25, theme: \''.$my_style.'\'});'.PHP_EOL; -$outstr .= ' }'.PHP_EOL; -$outstr .= ' '.PHP_EOL; -$outstr .= ' '.PHP_EOL; $outstr .= ' '.PHP_EOL; $outstr .= '
'.PHP_EOL; $outstr .= ' '.PHP_EOL; $outstr .= liveview(); - -/* The maintenance popup window */ -$outstr .= '
'.PHP_EOL; -$outstr .= '
'.PHP_EOL; -$outstr .= ' Maintenance panel'.PHP_EOL; -$outstr .= '
'.PHP_EOL; -$outstr .= '
'.PHP_EOL; -$outstr .= '
'.PHP_EOL; -$outstr .= '
    '.PHP_EOL; -$outstr .= '
  • General
  • '.PHP_EOL; -$outstr .= '
  • 1-Wire Bus
  • '.PHP_EOL; -$outstr .= '
  • Profiles
  • '.PHP_EOL; -$outstr .= '
  • Units
  • '.PHP_EOL; -$outstr .= '
'.PHP_EOL; -$outstr .= '
'.PHP_EOL; -$outstr .= ' General'.PHP_EOL; -$outstr .= '
'.PHP_EOL; -$outstr .= '
'.PHP_EOL; -$outstr .= ' 1-Wire Bus'.PHP_EOL; -$outstr .= '
'.PHP_EOL; -$outstr .= '
'.PHP_EOL; -$outstr .= ' Profiles'.PHP_EOL; -$outstr .= '
'.PHP_EOL; -$outstr .= '
'.PHP_EOL; -$outstr .= ' Units'.PHP_EOL; -$outstr .= '
'.PHP_EOL; -$outstr .= '
'.PHP_EOL; -$outstr .= ' '.PHP_EOL; -$outstr .= '
'.PHP_EOL; -$outstr .= ' '.PHP_EOL; -$outstr .= '
'.PHP_EOL; +$outstr .= maintenance_panel(); /* Create the tabs */ -$outstr .= ' '.PHP_EOL; - +$outstr .= ' '.PHP_EOL; $outstr .= '
'.PHP_EOL; $outstr .= ' '.PHP_EOL; $outstr .= ''.PHP_EOL; diff -r 480bbe88ce0e -r f2f45c44942f www-thermferm/js/main.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/www-thermferm/js/main.js Wed Jul 23 21:14:20 2014 +0200 @@ -0,0 +1,49 @@ +/***************************************************************************** + * Copyright (C) 2014 + * + * Michiel Broek + * + * 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. + *****************************************************************************/ + + +function addEventListeners() { + $("#maintenance").mousedown(function () { + $("#maintenance_window").jqxWindow('open'); + }); +} + +function createMaintenance() { + $("#maintenance_window").jqxWindow({ + height: 400, width: 800, autoOpen: false, theme: 'ui-redmond', + position: { x:100, y:50 }, + resizable: false, isModal: true, modalOpacity: 0.5, + okButton: $("#maintenance_ok"), + initContent: function () { + $("#maintenance_ok").jqxButton({ width: 70, height: 25, theme: 'ui-redmond' }); + } + }); + $("#maintenance").jqxButton({ width: 150, height: 25, theme: 'ui-redmond' }); +} + +$(document).ready(function () { + // Create jqxTabs. + $("#jqxTabs").jqxTabs({ width: 978, height: 428, position: 'top', theme: 'ui-redmond'}); + addEventListeners(); + createMaintenance(); +}); + diff -r 480bbe88ce0e -r f2f45c44942f www-thermferm/js/maintenance_panel.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/www-thermferm/js/maintenance_panel.js Wed Jul 23 21:14:20 2014 +0200 @@ -0,0 +1,53 @@ +/***************************************************************************** + * Copyright (C) 2014 + * + * Michiel Broek + * + * 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. + *****************************************************************************/ + +$(document).ready(function () { + var source_bus = { + datatype: "json", + datafields: [ + { name: 'Address', type: 'string' }, + { name: 'Refcnt', type: 'int' }, + { name: 'Chip', type: 'string' }, + { name: 'Description', type: 'string' } + ], + url: 'getbus.php', + sortcolumn: 'Address', + sortdirection: 'asc' + }; + var dataAdapter_bus = new $.jqx.dataAdapter(source_bus,{ + downloadComplete: function (data, status, xhr) { }, + loadComplete: function (data) { }, + loadError: function (xhr, status, error) { } + }); + $("#jqxgrid_bus").jqxGrid( { + width: 770, height: 280, + source: dataAdapter_bus, + theme: 'ui-redmond', + columnsresize: true, + columns: [ + { text: 'Address', datafield: 'Address', width: 150 }, + { text: 'References', datafield: 'Refcnt', width: 100 }, + { text: 'Chipset', datafield: 'Chip', width: 120 }, + { text: 'Description', datafield: 'Description', minwidth: 120 } + ] + }); +}); diff -r 480bbe88ce0e -r f2f45c44942f www-thermferm/maintenance_panel.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/www-thermferm/maintenance_panel.php Wed Jul 23 21:14:20 2014 +0200 @@ -0,0 +1,74 @@ + + * + * 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-redmond'; + + + +/* The maintenance popup window */ +function maintenance_panel() +{ + global $my_style; + + $outstr = PHP_EOL; + $outstr .= '
'.PHP_EOL; + $outstr .= ' '.PHP_EOL; + $outstr .= '
'.PHP_EOL; + $outstr .= ' Maintenance panel'.PHP_EOL; + $outstr .= '
'.PHP_EOL; + $outstr .= '
'.PHP_EOL; + $outstr .= '
'.PHP_EOL; + $outstr .= '
    '.PHP_EOL; + $outstr .= '
  • General
  • '.PHP_EOL; + $outstr .= '
  • 1-Wire Bus
  • '.PHP_EOL; + $outstr .= '
  • Profiles
  • '.PHP_EOL; + $outstr .= '
  • Units
  • '.PHP_EOL; + $outstr .= '
'.PHP_EOL; + $outstr .= '
'.PHP_EOL; + $outstr .= ' General'.PHP_EOL; + $outstr .= '
'.PHP_EOL; + $outstr .= '
'.PHP_EOL; + $outstr .= '
'.PHP_EOL; + $outstr .= '
'.PHP_EOL; + $outstr .= '
'.PHP_EOL; + $outstr .= ' Profiles'.PHP_EOL; + $outstr .= '
'.PHP_EOL; + $outstr .= '
'.PHP_EOL; + $outstr .= ' Units'.PHP_EOL; + $outstr .= '
'.PHP_EOL; + $outstr .= '
'.PHP_EOL; + $outstr .= ' '.PHP_EOL; + $outstr .= '
'.PHP_EOL; + $outstr .= ' '.PHP_EOL; + $outstr .= '
'.PHP_EOL; + + return $outstr; +} + diff -r 480bbe88ce0e -r f2f45c44942f www-thermferm/utilities.php --- a/www-thermferm/utilities.php Wed Jul 23 17:12:18 2014 +0200 +++ b/www-thermferm/utilities.php Wed Jul 23 21:14:20 2014 +0200 @@ -27,6 +27,7 @@ $sock = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); if (!($sock === false)) { +// if (socket_connect($sock, "rpi02", 6554)) { if (socket_connect($sock, "localhost", 6554)) { socket_set_option($sock, SOL_SOCKET, SO_RCVTIMEO, array('sec' => 15, 'usec' => 0)); } else {