manual override for pump

This commit is contained in:
Senad Uka
2016-07-02 10:18:18 +02:00
parent d94ae908f4
commit 656dee3fe6
6 changed files with 118 additions and 11 deletions

View File

@@ -90,6 +90,25 @@ Template.state.helpers({
}
},
start_inflow_button_class: function() {
var stateObject = controller_state();
if(stateObject.config && stateObject.config.manualInflow && stateObject.state.out_valve === 'closed' && ( stateObject.state.in_valve === 'closed' || stateObject.state.in_valve === 'closing')) {
return 'btn btn-danger'
} else {
return 'hidden btn btn-danger'
}
},
stop_inflow_button_class: function() {
var stateObject = controller_state();
if(stateObject.config && stateObject.config.manualInflow && stateObject.state.out_valve === 'closed' && ( stateObject.state.in_valve === 'open' || stateObject.state.in_valve === 'opening')) {
return 'btn btn-danger'
} else {
return 'hidden btn btn-danger'
}
},
pretty_days: function(daysInNumbers) {
var days = ["Nedjelja", "Ponedjeljak", "Utorak", "Srijeda", "Četvrtak", "Petak", "Subota"];
if (!daysInNumbers || daysInNumbers.length == 0) {
@@ -125,6 +144,16 @@ Template.state.events({
Meteor.call('closeOutValve', controller_id)
},
'click #start_inflow_now': function() {
var controller_id = Session.get('controller_id');
Meteor.call('openInValve', controller_id)
},
'click #stop_inflow_now': function() {
var controller_id = Session.get('controller_id');
Meteor.call('closeInValve', controller_id)
},
'click #run_settings': function() {
Modal.show('settings');
},