65 $product_name = $vals[1]; |
65 $product_name = $vals[1]; |
66 } |
66 } |
67 if (strcmp($vals[0], "AIR_STATE") == 0) { |
67 if (strcmp($vals[0], "AIR_STATE") == 0) { |
68 $air_state = $vals[1]; |
68 $air_state = $vals[1]; |
69 } |
69 } |
70 if ((strcmp($vals[0], "AIR_TEMPERATURE") == 0) && ($air_state == 0)) { |
70 if ((strcmp($vals[0], "AIR_TEMPERATURE") == 0) && (strcmp($air_state, "YES") == 0)) { |
71 $air_temperature = $vals[1]; |
71 $air_temperature = $vals[1]; |
72 } |
72 } |
73 if (strcmp($vals[0], "BEER_STATE") == 0) { |
73 if (strcmp($vals[0], "BEER_STATE") == 0) { |
74 $beer_state = $vals[1]; |
74 $beer_state = $vals[1]; |
75 } |
75 } |
131 |
131 |
132 $logname = $product_code . " " . $product_name; |
132 $logname = $product_code . " " . $product_name; |
133 $outstr .= ' <script type="text/javascript">'.PHP_EOL; |
133 $outstr .= ' <script type="text/javascript">'.PHP_EOL; |
134 $outstr .= ' $(document).ready(function () {'.PHP_EOL; |
134 $outstr .= ' $(document).ready(function () {'.PHP_EOL; |
135 |
135 |
136 if ("$air_state" == "OK") { |
136 if ("$air_state" == "YES") { |
137 $outstr .= ' $("#gaugeContainer_air'.$unr.'").jqxGauge({'.PHP_EOL; |
137 $outstr .= ' $("#gaugeContainer_air'.$unr.'").jqxGauge({'.PHP_EOL; |
138 $outstr .= ' min: -5, max: 45, width: 275, height: 275,'.PHP_EOL; |
138 $outstr .= ' min: -5, max: 45, width: 275, height: 275,'.PHP_EOL; |
139 $outstr .= ' ranges: [{ startValue: -5, endValue: 0, style: { fill: \'#3399FF\', stroke: \'#3399FF\' }, endWidth: 10, startWidth: 10 },'.PHP_EOL; |
139 $outstr .= ' ranges: [{ startValue: -5, endValue: 0, style: { fill: \'#3399FF\', stroke: \'#3399FF\' }, endWidth: 10, startWidth: 10 },'.PHP_EOL; |
140 $outstr .= ' { startValue: 0, endValue: 16, style: { fill: \'#00CC33\', stroke: \'#00CC33\' }, endWidth: 10, startWidth: 10 },'.PHP_EOL; |
140 $outstr .= ' { startValue: 0, endValue: 16, style: { fill: \'#00CC33\', stroke: \'#00CC33\' }, endWidth: 10, startWidth: 10 },'.PHP_EOL; |
141 $outstr .= ' { startValue: 16, endValue: 24, style: { fill: \'#FCA76A\', stroke: \'#FCA76A\' }, endWidth: 10, startWidth: 10 },'.PHP_EOL; |
141 $outstr .= ' { startValue: 16, endValue: 24, style: { fill: \'#FCA76A\', stroke: \'#FCA76A\' }, endWidth: 10, startWidth: 10 },'.PHP_EOL; |
148 $outstr .= ' animationDuration: 5000,'.PHP_EOL; |
148 $outstr .= ' animationDuration: 5000,'.PHP_EOL; |
149 $outstr .= ' caption: { value: \'Air\', position: \'bottom\', offset: [0, 10] }'.PHP_EOL; |
149 $outstr .= ' caption: { value: \'Air\', position: \'bottom\', offset: [0, 10] }'.PHP_EOL; |
150 $outstr .= ' });'.PHP_EOL; |
150 $outstr .= ' });'.PHP_EOL; |
151 } |
151 } |
152 |
152 |
153 if ("$beer_state" == "OK") { |
153 if ("$beer_state" == "YES") { |
154 $outstr .= ' $(\'#gaugeContainer_beer'.$unr.'\').jqxGauge({'.PHP_EOL; |
154 $outstr .= ' $(\'#gaugeContainer_beer'.$unr.'\').jqxGauge({'.PHP_EOL; |
155 $outstr .= ' min: -5, max: 45, width: 275, height: 275,'.PHP_EOL; |
155 $outstr .= ' min: -5, max: 45, width: 275, height: 275,'.PHP_EOL; |
156 $outstr .= ' ranges: [{ startValue: -5, endValue: 0, style: { fill: \'#3399FF\', stroke: \'#3399FF\' }, endWidth: 10, startWidth: 10 },'.PHP_EOL; |
156 $outstr .= ' ranges: [{ startValue: -5, endValue: 0, style: { fill: \'#3399FF\', stroke: \'#3399FF\' }, endWidth: 10, startWidth: 10 },'.PHP_EOL; |
157 $outstr .= ' { startValue: 0, endValue: 16, style: { fill: \'#00CC33\', stroke: \'#00CC33\' }, endWidth: 10, startWidth: 10 },'.PHP_EOL; |
157 $outstr .= ' { startValue: 0, endValue: 16, style: { fill: \'#00CC33\', stroke: \'#00CC33\' }, endWidth: 10, startWidth: 10 },'.PHP_EOL; |
158 $outstr .= ' { startValue: 16, endValue: 24, style: { fill: \'#FCA76A\', stroke: \'#FCA76A\' }, endWidth: 10, startWidth: 10 },'.PHP_EOL; |
158 $outstr .= ' { startValue: 16, endValue: 24, style: { fill: \'#FCA76A\', stroke: \'#FCA76A\' }, endWidth: 10, startWidth: 10 },'.PHP_EOL; |
165 $outstr .= ' animationDuration: 5000,'.PHP_EOL; |
165 $outstr .= ' animationDuration: 5000,'.PHP_EOL; |
166 $outstr .= ' caption: { value: \'Beer\', position: \'bottom\', offset: [0, 10] }'.PHP_EOL; |
166 $outstr .= ' caption: { value: \'Beer\', position: \'bottom\', offset: [0, 10] }'.PHP_EOL; |
167 $outstr .= ' });'.PHP_EOL; |
167 $outstr .= ' });'.PHP_EOL; |
168 } |
168 } |
169 |
169 |
170 if ("$chiller_state" == "OK") { |
170 if ("$chiller_state" == "YES") { |
171 $outstr .= ' $(\'#gaugeContainer_chiller'.$unr.'\').jqxGauge({'.PHP_EOL; |
171 $outstr .= ' $(\'#gaugeContainer_chiller'.$unr.'\').jqxGauge({'.PHP_EOL; |
172 $outstr .= ' min: -20, max: 25, width: 150, height: 150,'.PHP_EOL; |
172 $outstr .= ' min: -20, max: 25, width: 150, height: 150,'.PHP_EOL; |
173 $outstr .= ' ranges: [{ startValue: -20, endValue: 0, startWidth: 5, endWidth: 5, style: { fill: \'#3399FF\', stroke: \'#3399FF\' }},'.PHP_EOL; |
173 $outstr .= ' ranges: [{ startValue: -20, endValue: 0, startWidth: 5, endWidth: 5, style: { fill: \'#3399FF\', stroke: \'#3399FF\' }},'.PHP_EOL; |
174 $outstr .= ' { startValue: 0, endValue: 25, startWidth: 5, endWidth: 5, style: { fill: \'#FC6A6A\', stroke: \'#FC6A6A\' }}],'.PHP_EOL; |
174 $outstr .= ' { startValue: 0, endValue: 25, startWidth: 5, endWidth: 5, style: { fill: \'#FC6A6A\', stroke: \'#FC6A6A\' }}],'.PHP_EOL; |
175 $outstr .= ' ticksMinor: { interval: 1, size: \'5%\' },'.PHP_EOL; |
175 $outstr .= ' ticksMinor: { interval: 1, size: \'5%\' },'.PHP_EOL; |
182 $outstr .= ' });'.PHP_EOL; |
182 $outstr .= ' });'.PHP_EOL; |
183 } |
183 } |
184 |
184 |
185 $outstr .= ' setInterval(function(){'.PHP_EOL; |
185 $outstr .= ' setInterval(function(){'.PHP_EOL; |
186 $outstr .= ' $.getJSON("getstate.php?uuid='.$unit.'", function(data) {'.PHP_EOL; |
186 $outstr .= ' $.getJSON("getstate.php?uuid='.$unit.'", function(data) {'.PHP_EOL; |
187 if ("$air_state" == "OK") { |
187 if ("$air_state" == "YES") { |
188 $outstr .= ' $("#load_air_'.$unr.'").html(data.air_temperature);'.PHP_EOL; |
188 $outstr .= ' $("#load_air_'.$unr.'").html(data.air_temperature);'.PHP_EOL; |
189 $outstr .= ' $("#gaugeContainer_air'.$unr.'").jqxGauge(\'value\', data.air_temperature);'.PHP_EOL; |
189 $outstr .= ' $("#gaugeContainer_air'.$unr.'").jqxGauge(\'value\', data.air_temperature);'.PHP_EOL; |
190 } |
190 } |
191 if ("$beer_state" == "OK") { |
191 if ("$beer_state" == "YES") { |
192 $outstr .= ' $("#load_beer_'.$unr.'").html(data.beer_temperature);'.PHP_EOL; |
192 $outstr .= ' $("#load_beer_'.$unr.'").html(data.beer_temperature);'.PHP_EOL; |
193 $outstr .= ' $("#gaugeContainer_beer'.$unr.'").jqxGauge(\'value\', data.beer_temperature);'.PHP_EOL; |
193 $outstr .= ' $("#gaugeContainer_beer'.$unr.'").jqxGauge(\'value\', data.beer_temperature);'.PHP_EOL; |
194 } |
194 } |
195 if ("$chiller_state" == "OK") { |
195 if ("$chiller_state" == "YES") { |
196 $outstr .= ' $("#gaugeContainer_chiller'.$unr.'").jqxGauge(\'value\', data.chiller_temperature);'.PHP_EOL; |
196 $outstr .= ' $("#gaugeContainer_chiller'.$unr.'").jqxGauge(\'value\', data.chiller_temperature);'.PHP_EOL; |
197 } |
197 } |
198 $outstr .= ' $("#load_target_lo_'.$unr.'").html(data.target_temperature_lo);'.PHP_EOL; |
198 $outstr .= ' $("#load_target_lo_'.$unr.'").html(data.target_temperature_lo);'.PHP_EOL; |
199 $outstr .= ' $("#load_target_hi_'.$unr.'").html(data.target_temperature_hi);'.PHP_EOL; |
199 $outstr .= ' $("#load_target_hi_'.$unr.'").html(data.target_temperature_hi);'.PHP_EOL; |
200 $outstr .= ' $("#load_select_'.$unr.'").html(data.mode);'.PHP_EOL; |
200 $outstr .= ' $("#load_select_'.$unr.'").html(data.mode);'.PHP_EOL; |
228 $outstr .= ' });'.PHP_EOL; |
228 $outstr .= ' });'.PHP_EOL; |
229 $outstr .= ' </script>'.PHP_EOL; |
229 $outstr .= ' </script>'.PHP_EOL; |
230 |
230 |
231 $outstr .= ' <div id="fermentor">'.PHP_EOL; |
231 $outstr .= ' <div id="fermentor">'.PHP_EOL; |
232 $outstr .= ' <div id="fermentor_thermometers">'.PHP_EOL; |
232 $outstr .= ' <div id="fermentor_thermometers">'.PHP_EOL; |
233 if (("$air_state" == "OK") && ("$beer_state" == "OK") && ("$chiller_state" == "OK")) { |
233 if (("$air_state" == "YES") && ("$beer_state" == "YES") && ("$chiller_state" == "YES")) { |
234 $outstr .= ' <div id="gaugeContainer_air'.$unr.'" style="float: left; margin-top: 10px; margin-left: 10px;"></div>'.PHP_EOL; |
234 $outstr .= ' <div id="gaugeContainer_air'.$unr.'" style="float: left; margin-top: 10px; margin-left: 10px;"></div>'.PHP_EOL; |
235 $outstr .= ' <div id="gaugeContainer_beer'.$unr.'" style="float: right; margin-top: 10px; margin-right: 10px;"></div>'.PHP_EOL; |
235 $outstr .= ' <div id="gaugeContainer_beer'.$unr.'" style="float: right; margin-top: 10px; margin-right: 10px;"></div>'.PHP_EOL; |
236 $outstr .= ' <div id="gaugeContainer_chiller'.$unr.'" style="float: left; margin-top: 200px;"></div>'.PHP_EOL; |
236 $outstr .= ' <div id="gaugeContainer_chiller'.$unr.'" style="float: left; margin-top: 200px;"></div>'.PHP_EOL; |
237 } else if (("$air_state" == "OK") && ("$beer_state" == "OK")) { |
237 } else if (("$air_state" == "YES") && ("$beer_state" == "YES")) { |
238 $outstr .= ' <div id="gaugeContainer_air'.$unr.'" style="float: left; margin-top: 48px; margin-left: 48px;"></div>'.PHP_EOL; |
238 $outstr .= ' <div id="gaugeContainer_air'.$unr.'" style="float: left; margin-top: 48px; margin-left: 48px;"></div>'.PHP_EOL; |
239 $outstr .= ' <div id="gaugeContainer_beer'.$unr.'" style="float: right; margin-top: 48px; margin-right: 48px;"></div>'.PHP_EOL; |
239 $outstr .= ' <div id="gaugeContainer_beer'.$unr.'" style="float: right; margin-top: 48px; margin-right: 48px;"></div>'.PHP_EOL; |
240 } else if ("$air_state" == "OK") { |
240 } else if ("$air_state" == "YES") { |
241 $outstr .= ' <div id="gaugeContainer_air'.$unr.'" style="margin-top: 48px; margin-left: 222px;"></div>'.PHP_EOL; |
241 $outstr .= ' <div id="gaugeContainer_air'.$unr.'" style="margin-top: 48px; margin-left: 222px;"></div>'.PHP_EOL; |
242 } |
242 } |
243 $outstr .= ' </div>'.PHP_EOL; |
243 $outstr .= ' </div>'.PHP_EOL; |
244 |
244 |
245 $outstr .= ' <div id="fermentor_panel_top">'.PHP_EOL; |
245 $outstr .= ' <div id="fermentor_panel_top">'.PHP_EOL; |