www-thermferm/liveview.php

changeset 375
f707d22c72f8
parent 374
20999ef6d487
child 380
75afd21885f2
equal deleted inserted replaced
374:20999ef6d487 375:f707d22c72f8
199 $outstr .= ' \'<body>\' + content + \'</body></html>\';'.PHP_EOL; 199 $outstr .= ' \'<body>\' + content + \'</body></html>\';'.PHP_EOL;
200 $outstr .= ' document.write(pageContent);'.PHP_EOL; 200 $outstr .= ' document.write(pageContent);'.PHP_EOL;
201 $outstr .= ' document.close();'.PHP_EOL; 201 $outstr .= ' document.close();'.PHP_EOL;
202 $outstr .= ' newWindow.print();'.PHP_EOL; 202 $outstr .= ' newWindow.print();'.PHP_EOL;
203 $outstr .= ' });'.PHP_EOL; 203 $outstr .= ' });'.PHP_EOL;
204 $outstr .= ' $("#print_'.$unr.'").jqxButton({ width: 100, height: 25, theme: "ui-redmond" });'.PHP_EOL; 204 $outstr .= ' $("#print_'.$unr.'").jqxButton({ width: 70, height: 25, theme: "ui-redmond" });'.PHP_EOL;
205 205
206 $outstr .= ' $("#pngButton_'.$unr.'").click(function () {'.PHP_EOL; 206 $outstr .= ' $("#pngButton_'.$unr.'").click(function () {'.PHP_EOL;
207 // call the export server to create a PNG image 207 // call the export server to create a PNG image
208 $outstr .= ' $("#fermentor_chart_'.$unit.'").jqxChart("saveAsPNG", "Chart_'.$name.'.png", getExportServer'.$unr.'());'.PHP_EOL; 208 $outstr .= ' $("#fermentor_chart_'.$unit.'").jqxChart("saveAsPNG", "Chart_'.$name.'.png", getExportServer'.$unr.'());'.PHP_EOL;
209 $outstr .= ' });'.PHP_EOL; 209 $outstr .= ' });'.PHP_EOL;
210 $outstr .= ' $("#pngButton_'.$unr.'").jqxButton({ width: 100, height: 25, theme: "ui-redmond" });'.PHP_EOL; 210 $outstr .= ' $("#pdfButton_'.$unr.'").click(function () {'.PHP_EOL;
211 $outstr .= ' $("#fermentor_chart_'.$unit.'").jqxChart("saveAsPDF", "Chart_'.$name.'.pdf", getExportServer'.$unr.'());'.PHP_EOL;
212 $outstr .= ' });'.PHP_EOL;
213 $outstr .= ' $("#pngButton_'.$unr.'").jqxButton({ width: 70, height: 25, theme: "ui-redmond" });'.PHP_EOL;
214 $outstr .= ' $("#pdfButton_'.$unr.'").jqxButton({ width: 70, height: 25, theme: "ui-redmond" });'.PHP_EOL;
211 215
212 $outstr .= ' setInterval(function(){'.PHP_EOL; 216 $outstr .= ' setInterval(function(){'.PHP_EOL;
213 $outstr .= ' $.getJSON("getstate.php?uuid='.$unit.'", function(data) {'.PHP_EOL; 217 $outstr .= ' $.getJSON("getstate.php?uuid='.$unit.'", function(data) {'.PHP_EOL;
214 $outstr .= ' $("#load_air_'.$unr.'").html(data.air_temperature);'.PHP_EOL; 218 $outstr .= ' $("#load_air_'.$unr.'").html(data.air_temperature);'.PHP_EOL;
215 $outstr .= ' $("#load_beer_'.$unr.'").html(data.beer_temperature);'.PHP_EOL; 219 $outstr .= ' $("#load_beer_'.$unr.'").html(data.beer_temperature);'.PHP_EOL;
407 $outstr .= ' </form>'.PHP_EOL; 411 $outstr .= ' </form>'.PHP_EOL;
408 $outstr .= ' </div>'.PHP_EOL; 412 $outstr .= ' </div>'.PHP_EOL;
409 $outstr .= ' </div> <!-- fermentor_panel_control -->'.PHP_EOL; 413 $outstr .= ' </div> <!-- fermentor_panel_control -->'.PHP_EOL;
410 414
411 $outstr .= ' <div id="fermentor_panel_buttons">'.PHP_EOL; 415 $outstr .= ' <div id="fermentor_panel_buttons">'.PHP_EOL;
412 $outstr .= ' <div style="margin-top: 2px; margin-left: 10px;">'.PHP_EOL; 416 $outstr .= ' <div style="margin-top: 2px; margin-left: 5px;">'.PHP_EOL;
413 $outstr .= ' <input style="float: left;" id="print_'.$unr.'" type="button" value="Print Graph" />'.PHP_EOL; 417 $outstr .= ' <input style="float: left;" id="print_'.$unr.'" type="button" value="Print" />'.PHP_EOL;
414 $outstr .= ' <input style="float: left; margin-left: 15px;" id="pngButton_'.$unr.'" type="button" value="Save Graph" />'.PHP_EOL; 418 $outstr .= ' <input style="float: left; margin-left: 7px;" id="pngButton_'.$unr.'" type="button" value="as PNG" />'.PHP_EOL;
419 $outstr .= ' <input style="float: left; margin-left: 7px;" id="pdfButton_'.$unr.'" type="button" value="as PDF" />'.PHP_EOL;
415 $outstr .= ' </div>'.PHP_EOL; 420 $outstr .= ' </div>'.PHP_EOL;
416 $outstr .= ' </div> <!-- fermentor_panel_buttons -->'.PHP_EOL; 421 $outstr .= ' </div> <!-- fermentor_panel_buttons -->'.PHP_EOL;
417 422
418 $outstr .= ' </div> <!-- fermentor -->'.PHP_EOL; 423 $outstr .= ' </div> <!-- fermentor -->'.PHP_EOL;
419 } 424 }

mercurial