source: js/viewer-f0/js/Structures/NeuroClass.js @ 143

Last change on this file since 143 was 143, checked in by mmichalski, 10 years ago

Load NeuroClass? from f0def.xml and load correct xml from server

File size: 932 bytes
Line 
1function NeuroClass() {
2    this.class = {};//obiekt z cechami klasy
3    this._properties = {};//obiekt z propertisami
4}
5
6//pobranie danych o klasie
7//pobranie danych o propertisach
8
9NeuroClass.prototype.setModel = function(data)
10{
11    var self = this;
12    $(data).each(function () {
13        $.each(this.attributes, function () {
14            self.class[this.name] = this.value;
15        });
16    });
17
18    var nodes = data[0].children;
19
20    for (var i = 0; i < nodes.length; i++) {
21        var node = $(nodes[i]);
22        this.addProperties(node);
23    }
24}
25
26NeuroClass.prototype.addProperties = function (data) {
27    var properties = {};
28
29    $(data).each(function () {
30        $.each(this.attributes, function () {
31            properties[this.name] = this.value;
32        });
33
34    });
35
36    //properties["VALUE"] = typeof(properties["DEF"]) === 'undefined' ? 0 : properties["DEF"];
37
38    this._properties[properties["ID"]] = properties;
39}
Note: See TracBrowser for help on using the repository browser.