mirror of
https://git.rwth-aachen.de/acs/public/villas/web/
synced 2025-03-16 00:00:03 +01:00
45 lines
856 B
JavaScript
45 lines
856 B
JavaScript
![]() |
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: {
|
||
|
showPropertyValues(property) {
|
||
|
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);
|
||
|
console.log(prop);
|
||
|
}
|
||
|
}
|
||
|
});
|