Commit 400c513c authored by Mathieu Giraud's avatar Mathieu Giraud
Browse files

Merge branch 'feature-c/4077' into 'dev'

clones.js : fix clones distribution loading time issue

See merge request !595
parents 48bf444e 4cbd38c5
Pipeline #116471 passed with stages
in 7 minutes and 17 seconds
...@@ -1770,6 +1770,7 @@ Clone.prototype = { ...@@ -1770,6 +1770,7 @@ Clone.prototype = {
} }
var values = [] var values = []
var axes_obj = this.m.axes var axes_obj = this.m.axes
var available_axes = this.m.available_axes
for (var a = 0; a < axes.length; a++) { for (var a = 0; a < axes.length; a++) {
var axe = axes[a] var axe = axes[a]
...@@ -1777,10 +1778,10 @@ Clone.prototype = { ...@@ -1777,10 +1778,10 @@ Clone.prototype = {
if (axe == undefined || naxe == undefined){ if (axe == undefined || naxe == undefined){
console.default.error("Getter: not axis " + axe + "; ("+naxe+")") console.default.error("Getter: not axis " + axe + "; ("+naxe+")")
} }
if (axes_obj.available()[naxe] != undefined && axes_obj.available()[naxe].fct != undefined) { if (available_axes[naxe] != undefined && available_axes[naxe].fct != undefined) {
var value = axes_obj.available()[naxe].fct(this, timepoint) var value = available_axes[naxe].fct(this, timepoint)
if (round && axes_obj.available()[naxe] != undefined && axes_obj.available()[naxe].round != undefined){ if (round && available_axes[naxe] != undefined && available_axes[naxe].round != undefined){
value = axes_obj.available()[naxe].round(value) value = available_axes[naxe].round(value)
} }
values.push( value ) values.push( value )
} else { } else {
...@@ -1881,11 +1882,11 @@ Clone.prototype = { ...@@ -1881,11 +1882,11 @@ Clone.prototype = {
value = tmpValue value = tmpValue
} }
var axes_obj = this.m.axes
var naxe = this.m.distrib_convertion[axe] var naxe = this.m.distrib_convertion[axe]
if (axes_obj.available()[naxe] != undefined) { var available_axes = this.m.available_axes
if (axes_obj.available()[naxe].set != undefined) { if (available_axes[naxe] != undefined) {
axes_obj.available()[naxe].set(this, value) if (available_axes[naxe].set != undefined) {
available_axes[naxe].set(this, value)
} else { } else {
console.default.warn( "Axe present and NOT settable: " + axe + ";" + naxe) console.default.warn( "Axe present and NOT settable: " + axe + ";" + naxe)
} }
......
...@@ -63,6 +63,7 @@ function Model() { ...@@ -63,6 +63,7 @@ function Model() {
this.NORM_EXTERNAL = "external" this.NORM_EXTERNAL = "external"
this.normalization_mode = this.NORM_FALSE this.normalization_mode = this.NORM_FALSE
this.axes = new Axes(this) this.axes = new Axes(this)
this.available_axes = this.axes.available()
setInterval(function(){return self.updateIcon()}, 100); setInterval(function(){return self.updateIcon()}, 100);
} }
......
...@@ -657,7 +657,7 @@ Segment.prototype = { ...@@ -657,7 +657,7 @@ Segment.prototype = {
fillAxisBox: function (axisBox, clone) { fillAxisBox: function (axisBox, clone) {
axisBox.removeAllChildren(); axisBox.removeAllChildren();
var axOpts = Clone.prototype.axisOptions(); var axOpts = Clone.prototype.axisOptions();
var available_axis = (new Axes(this.m)).available(); var available_axis = this.m.available_axes
for (var i in this.selectedAxis) { for (var i in this.selectedAxis) {
var span = document.createElement('span'); var span = document.createElement('span');
var axis = this.selectedAxis[i]; var axis = this.selectedAxis[i];
......
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