Commit 39e0d296 authored by Mikael Salson's avatar Mikael Salson

model_loader.js: Override data with analysis's content

The documentation says that the analysis overrides what is in the Vidjil
file. We do so.
parent a7040f3f
......@@ -393,24 +393,10 @@ Model_loader.prototype = {
if (this.analysis.samples) {
var s = this.analysis.samples
//replace names
for (var i=0; i<s.number; i++){
var pos = this.samples.original_names.indexOf(s.original_names[i])
if (pos != -1){
if (s.names[i] != "") this.samples.names[pos] = s.names[i]
}
}
this.samples.order = []
for (var i=0; i<s.order.length; i++){
var pos = this.samples.original_names.indexOf(s.original_names[s.order[i]])
if ( pos != -1) this.samples.order.push(pos)
}
for (var i=0; i<this.samples.number; i++){
var pos = s.original_names.indexOf(this.samples.original_names[i])
if (pos == -1) this.samples.order.push(i)
}
//replace names, timestamps, order...
for (var key in s)
if (s[key].length == this.samples.number)
this.samples[key] = s[key]
}
//tags
......@@ -580,4 +566,4 @@ Model_loader.prototype = {
},
};
\ No newline at end of file
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment