2015-10-13 14:12:34 +02:00
|
|
|
import Ember from 'ember';
|
|
|
|
|
|
|
|
export default Ember.Controller.extend({
|
|
|
|
S1Entity: function() {
|
|
|
|
var entity = null;
|
|
|
|
|
|
|
|
this.model.forEach(function (_entity) {
|
|
|
|
if (_entity.id === 'S1_ElectricalGrid') {
|
|
|
|
entity = _entity;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
return entity;
|
|
|
|
}.property('model.[]'),
|
|
|
|
|
|
|
|
S2Entity: function() {
|
|
|
|
var entity = null;
|
|
|
|
|
|
|
|
this.model.forEach(function (_entity) {
|
|
|
|
if (_entity.id === 'S2_ElectricalGrid') {
|
|
|
|
entity = _entity;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
return entity;
|
|
|
|
}.property('model.[]'),
|
|
|
|
|
|
|
|
actions: {
|
2015-10-14 09:55:04 +02:00
|
|
|
showProperty1Values(property) {
|
2015-10-13 14:12:34 +02:00
|
|
|
var id = property.id;
|
|
|
|
|
|
|
|
var prop = null;
|
|
|
|
|
|
|
|
this.get('S1Entity').get('properties').forEach(function (proper) {
|
|
|
|
if (proper.id === id) {
|
|
|
|
prop = proper;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
this.set('S1Property', prop);
|
2015-10-14 09:55:04 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
showProperty2Values(property) {
|
|
|
|
var id = property.id;
|
|
|
|
|
|
|
|
var prop = null;
|
|
|
|
|
|
|
|
this.get('S2Entity').get('properties').forEach(function (proper) {
|
|
|
|
if (proper.id === id) {
|
|
|
|
prop = proper;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
this.set('S2Property', prop);
|
2015-10-13 14:12:34 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|