Commit 44f548e9 authored by Marc Duez's avatar Marc Duez Committed by Mathieu Giraud
Browse files

model.js : normalization is computed for a specific time_order using a clone size,

so we need to call update_normalization if the time_order change or if the clone_size change
parent 0e93dd49
......@@ -555,13 +555,13 @@ Graph.prototype = {
return a[1] - b[1]
})
var result = [];
//save new time point order
for (var i = 0; i < this.m.time_order.length; i++) {
this.m.time_order[i] = list[i][0]
result[i] = list[i][0]
}
//call model update
this.m.update()
this.m.changeTimeOrder(result)
}
},
......
......@@ -753,6 +753,12 @@ Model.prototype = {
this.norm = tmp
},
update_normalization: function () {
if (this.normalization.B != 0){
this.compute_normalization( this.normalization.id, this.normalization.B)
}
},
/*
*
* */
......@@ -1077,10 +1083,14 @@ Model.prototype = {
var startTime = new Date()
.getTime();
var elapsedTime = 0;
this.update_normalization();
this.updateModel();
for (var i = 0; i < this.view.length; i++) {
this.view[i].update();
}
elapsedTime = new Date()
.getTime() - startTime;
console.log("update() : " + elapsedTime);
......@@ -1091,7 +1101,12 @@ Model.prototype = {
*
* */
updateElem: function (list) {
if ( list.indexOf(this.normalisattion.id) != -1 ){
this.update_normalization()
}
this.updateModel()
for (var i = 0; i < this.view.length; i++) {
this.view[i].updateElem(list);
}
......@@ -1333,6 +1348,14 @@ Model.prototype = {
this.time_order[b] = tmp;
this.update()
},
/*
*
* */
changeTimeOrder: function (list) {
this.time_order = list
this.update()
},
/*
*
......
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