Added proper barrel image handling based on input / sensor readings
@@ -44,11 +44,16 @@ Template.state.helpers({
|
|||||||
|
|
||||||
bucket_image: function() {
|
bucket_image: function() {
|
||||||
var sensor = last_sensor_reading();
|
var sensor = last_sensor_reading();
|
||||||
if (sensor && sensor.tankFull === "1") {
|
var stateObject = controller_state();
|
||||||
return "/images/barell_full.png";
|
if (sensor) {
|
||||||
} else {
|
if (sensor.tankFull === 1 && (stateObject.state.out_valve === 'closed' || stateObject.state.out_valve === 'opening')) return "/images/barellFull.png";
|
||||||
return "/images/barell_draining.png";
|
else if (sensor.tankFull === 0 && (stateObject.state.out_valve === 'closed' || stateObject.state.out_valve === 'opening')) return "/images/barellNotFull.png";
|
||||||
|
else if (sensor.tankFull === 1 && (stateObject.state.out_valve === 'open' || stateObject.state.out_valve === 'closing')) return "/images/barellWateringFull.png";
|
||||||
|
else if (sensor.tankFull === 0 && (stateObject.state.out_valve === 'open' || stateObject.state.out_valve === 'closing')) return "/images/barellWateringNotFull.png"
|
||||||
|
else if (sensor.tankFull === 0 && stateObject.state.in_valve === 'open') return "/images/barellFillingUp.png";
|
||||||
|
else return "/images/statusAmber.png";
|
||||||
}
|
}
|
||||||
|
else return "/images/statusRed.png";
|
||||||
},
|
},
|
||||||
|
|
||||||
last_sensor_reading: last_sensor_reading,
|
last_sensor_reading: last_sensor_reading,
|
||||||
|
|||||||
BIN
app/public/images/barellFillingUp.png
Normal file
|
After Width: | Height: | Size: 71 KiB |
BIN
app/public/images/barellFull.png
Normal file
|
After Width: | Height: | Size: 61 KiB |
BIN
app/public/images/barellNotFull.png
Normal file
|
After Width: | Height: | Size: 59 KiB |
BIN
app/public/images/barellWateringFull.png
Normal file
|
After Width: | Height: | Size: 88 KiB |
BIN
app/public/images/barellWateringNotFull.png
Normal file
|
After Width: | Height: | Size: 82 KiB |
|
Before Width: | Height: | Size: 56 KiB |
|
Before Width: | Height: | Size: 53 KiB |
BIN
app/public/images/statusAmber.png
Normal file
|
After Width: | Height: | Size: 5.0 KiB |
BIN
app/public/images/statusBlue.png
Normal file
|
After Width: | Height: | Size: 5.0 KiB |
BIN
app/public/images/statusGreen.png
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
BIN
app/public/images/statusRed.png
Normal file
|
After Width: | Height: | Size: 4.7 KiB |