Commit 0d325877 authored by marc duez's avatar marc duez

clones.js : fix clones distribution loading time issue

minimize call to axes_obj.available()
axes_obj.available() does not return a struct pointer but rebuild the struct completely at each call
parent 48bf444e
Pipeline #116388 passed with stages
in 6 minutes and 7 seconds
......@@ -1770,6 +1770,7 @@ Clone.prototype = {
}
var values = []
var axes_obj = this.m.axes
var available_axes = axes_obj.available()
for (var a = 0; a < axes.length; a++) {
var axe = axes[a]
......@@ -1777,10 +1778,10 @@ Clone.prototype = {
if (axe == undefined || naxe == undefined){
console.default.error("Getter: not axis " + axe + "; ("+naxe+")")
}
if (axes_obj.available()[naxe] != undefined && axes_obj.available()[naxe].fct != undefined) {
var value = axes_obj.available()[naxe].fct(this, timepoint)
if (round && axes_obj.available()[naxe] != undefined && axes_obj.available()[naxe].round != undefined){
value = axes_obj.available()[naxe].round(value)
if (available_axes[naxe] != undefined && available_axes[naxe].fct != undefined) {
var value = available_axes[naxe].fct(this, timepoint)
if (round && available_axes[naxe] != undefined && available_axes[naxe].round != undefined){
value = available_axes[naxe].round(value)
}
values.push( value )
} else {
......@@ -1883,9 +1884,10 @@ Clone.prototype = {
var axes_obj = this.m.axes
var naxe = this.m.distrib_convertion[axe]
if (axes_obj.available()[naxe] != undefined) {
if (axes_obj.available()[naxe].set != undefined) {
axes_obj.available()[naxe].set(this, value)
var available_axes = axes_obj.available()
if (available_axes[naxe] != undefined) {
if (available_axes[naxe].set != undefined) {
available_axes[naxe].set(this, value)
} else {
console.default.warn( "Axe present and NOT settable: " + axe + ";" + naxe)
}
......
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