Ignore:
Timestamp:
02/26/14 11:19:05 (10 years ago)
Author:
mmichalski
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • js/viewer-f0/js/main.js

    r134 r143  
    1414    neurons: [],
    1515    neuroConns: [],
     16    neuroClasses: [],
    1617    modelOne: undefined,
    1718    _graphicsEngine: new GraphicsEngine(),
     19    _neuronDrawer: new NeuronDrawer(),
    1820    downloadXML: function () {
    1921        var local = this;
    2022        $.ajax({
    21             url: "http://localhost:63342/FramestickFavi/f0def.xml",
     23            url: "http://www.framsticks.com/files/dev/files/f0def.xml",
    2224            dataType: "xml",
    2325            async: false,
     
    3133            }
    3234        })
    33 
    3435    },
    3536    parseGeneXml: function () {
    36         var nodes = $(this.xml.find("CLASS"));
     37        this._parseClass($(this.xml.find("CLASS")));
     38        this._parseNeuroClass($(this.xml.find("NEUROCLASS")))
     39    },
     40    _parseClass: function(nodes){
    3741        var local = this;
    3842
     
    5660
    5761        });
     62    },
     63    _parseNeuroClass: function(data){
     64
     65        for(var i = 0; i < data.length; i++)
     66        {
     67            var neuroClass = new NeuroClass();
     68            neuroClass.setModel(data);
     69            this.neuroClasses.push(neuroClass);
     70        }
    5871    },
    5972    analyseLine: function (line) {
     
    108121    downloadCreature: function () {
    109122        var lines;
    110         /*$.ajax({
    111             url: "http://localhost:63342/FramestickFavi/creatures/" + this.debugCreatureName + ".txt",
     123        $.ajax({
     124            url: "http://localhost:63343/FramestickFavi/creatures/" + this.debugCreatureName + ".txt",
    112125            async: false,
    113126            dataType: "text",
     
    120133            }
    121134
    122         });*/
     135        });
    123136
    124         lines = $("#geno").val();
    125         lines = lines.split("\n");
     137        //lines = $("#geno").val();
     138        //lines = lines.split("\n");
    126139
    127140        return lines;
     
    153166        //this._graphicsEngine.debugTest();
    154167        this._graphicsEngine.renderScene();
     168
     169        this._neuronDrawer.initializeScene();
     170        new SmartLayout(this.neurons, this.neuroConns);
     171        this._neuronDrawer.drawNetwork(this.neurons, this.neuroConns, einfos);
     172        this._neuronDrawer.renderScene();
     173
    155174    }
    156175
     
    162181    geneWindow.parseCreature();
    163182    geneWindow.mainLoop();
    164     //geneWindow.context = window.open("window.html", "Window", "width=200,height=100");
    165183
    166184}
Note: See TracChangeset for help on using the changeset viewer.