Added proper barrel image handling based on input / sensor readings #10
@@ -44,11 +44,16 @@ Template.state.helpers({
|
||||
|
||||
bucket_image: function() {
|
||||
var sensor = last_sensor_reading();
|
||||
if (sensor && sensor.tankFull === "1") {
|
||||
return "/images/barell_full.png";
|
||||
} else {
|
||||
return "/images/barell_draining.png";
|
||||
var stateObject = controller_state();
|
||||
if (sensor) {
|
||||
if (sensor.tankFull === 1 && (stateObject.state.out_valve === 'closed' || stateObject.state.out_valve === 'opening')) return "/images/barellFull.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,
|
||||
|
||||
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 |