www-thermferm/liveview.php

changeset 123
597688feda2f
parent 122
e57043423e72
child 124
350401bac16e
equal deleted inserted replaced
122:e57043423e72 123:597688feda2f
67 if (startsWith($arr[0], "213")) { 67 if (startsWith($arr[0], "213")) {
68 68
69 $outstr .= ' <script type="text/javascript">'.PHP_EOL; 69 $outstr .= ' <script type="text/javascript">'.PHP_EOL;
70 $outstr .= ' $(document).ready(function () {'.PHP_EOL; 70 $outstr .= ' $(document).ready(function () {'.PHP_EOL;
71 71
72 $outstr .= ' var sampleData'.$unr.' = ['.PHP_EOL; 72 $outstr .= ' var source'.$unr.' ='.PHP_EOL;
73 $outstr .= ' { Date:\'2014-07-15 20:44\',Mode:\'NONE\',Air:20.625,Beer:23.687},'.PHP_EOL; 73 $outstr .= ' {'.PHP_EOL;
74 $outstr .= ' { Date:\'2014-07-15 21:00\',Mode:\'NONE\',Air:20.250,Beer:23.437},'.PHP_EOL; 74 $outstr .= ' datatype: "json",'.PHP_EOL;
75 $outstr .= ' { Date:\'2014-07-15 22:00\',Mode:\'NONE\',Air:20.375,Beer:22.812},'.PHP_EOL; 75 $outstr .= ' datafields: ['.PHP_EOL;
76 $outstr .= ' { Date:\'2014-07-15 23:00\',Mode:\'NONE\',Air:20.500,Beer:22.437},'.PHP_EOL; 76 $outstr .= ' { name: \'Date\' },'.PHP_EOL;
77 $outstr .= ' { Date:\'2014-07-16 00:00\',Mode:\'NONE\',Air:20.437,Beer:22.250},'.PHP_EOL; 77 $outstr .= ' { name: \'Mode\' },'.PHP_EOL;
78 $outstr .= ' { Date:\'2014-07-16 01:00\',Mode:\'NONE\',Air:20.375,Beer:22.000},'.PHP_EOL; 78 $outstr .= ' { name: \'Air\', type: \'float\' },'.PHP_EOL;
79 $outstr .= ' { Date:\'2014-07-16 02:00\',Mode:\'NONE\',Air:20.312,Beer:21.750},'.PHP_EOL; 79 $outstr .= ' { name: \'Beer\', type: \'float\' },'.PHP_EOL;
80 $outstr .= ' { Date:\'2014-07-16 03:00\',Mode:\'NONE\',Air:20.375,Beer:21.687},'.PHP_EOL; 80 $outstr .= ' { name: \'Target\', type: \'float\' },'.PHP_EOL;
81 $outstr .= ' { Date:\'2014-07-16 04:00\',Mode:\'NONE\',Air:20.312,Beer:21.562},'.PHP_EOL; 81 $outstr .= ' { name: \'Heater\' },'.PHP_EOL;
82 $outstr .= ' { Date:\'2014-07-16 05:00\',Mode:\'NONE\',Air:20.187,Beer:21.500},'.PHP_EOL; 82 $outstr .= ' { name: \'Cooler\' },'.PHP_EOL;
83 $outstr .= ' { Date:\'2014-07-16 06:00\',Mode:\'NONE\',Air:20.125,Beer:21.500}'.PHP_EOL; 83 $outstr .= ' { name: \'Fan\' },'.PHP_EOL;
84 $outstr .= ' ];'.PHP_EOL; 84 $outstr .= ' { name: \'Door\' }'.PHP_EOL;
85 $outstr .= ' ],'.PHP_EOL;
86 $outstr .= ' url: \'getlog.php?unit='.$unr.'\''.PHP_EOL;
87 $outstr .= ' };'.PHP_EOL;
88
89 $outstr .= ' var dataAdapter'.$unr.' = new $.jqx.dataAdapter(source'.$unr.','.PHP_EOL;
90 $outstr .= ' {'.PHP_EOL;
91 $outstr .= ' autoBind: true,'.PHP_EOL;
92 $outstr .= ' async: false,'.PHP_EOL;
93 $outstr .= ' downloadComplete: function () { },'.PHP_EOL;
94 $outstr .= ' loadComplete: function () { },'.PHP_EOL;
95 $outstr .= ' loadError: function () { }'.PHP_EOL;
96 $outstr .= ' });'.PHP_EOL;
85 97
86 $outstr .= ' var settings'.$unr.' = {'.PHP_EOL; 98 $outstr .= ' var settings'.$unr.' = {'.PHP_EOL;
87 $outstr .= ' title: "Fermentation temperature '.$unr.'",'.PHP_EOL; 99 $outstr .= ' title: "Fermentation temperature '.$unr.'",'.PHP_EOL;
88 $outstr .= ' description: "",'.PHP_EOL; 100 $outstr .= ' description: "",'.PHP_EOL;
89 $outstr .= ' padding: { left: 5, top: 5, right: 5, bottom: 5 },'.PHP_EOL; 101 $outstr .= ' padding: { left: 5, top: 5, right: 5, bottom: 5 },'.PHP_EOL;
90 $outstr .= ' titlePadding: { left: 90, top: 0, right: 0, bottom: 10 },'.PHP_EOL; 102 $outstr .= ' titlePadding: { left: 90, top: 0, right: 0, bottom: 10 },'.PHP_EOL;
91 $outstr .= ' source: sampleData'.$unr.','.PHP_EOL; 103 $outstr .= ' source: dataAdapter'.$unr.','.PHP_EOL;
92 $outstr .= ' categoryAxis:'.PHP_EOL; 104 $outstr .= ' categoryAxis:'.PHP_EOL;
93 $outstr .= ' {'.PHP_EOL; 105 $outstr .= ' {'.PHP_EOL;
94 $outstr .= ' dataField: \'Date\','.PHP_EOL; 106 $outstr .= ' dataField: \'Date\','.PHP_EOL;
95 $outstr .= ' textRotationAngle: 45,'.PHP_EOL; 107 $outstr .= ' textRotationAngle: 45,'.PHP_EOL;
96 $outstr .= ' showGridLines: false'.PHP_EOL; 108 $outstr .= ' showGridLines: false'.PHP_EOL;

mercurial