mirror of
https://github.com/xibyte/jsketcher
synced 2025-12-24 01:15:25 +01:00
caching parameters for solving
This commit is contained in:
parent
2cabcefa8b
commit
71eeeff10e
2 changed files with 12 additions and 1 deletions
|
|
@ -2,6 +2,10 @@ TCAD.parametric = {};
|
|||
|
||||
/** @constructor */
|
||||
TCAD.parametric.Param = function(id, value) {
|
||||
this.reset(id, value);
|
||||
};
|
||||
|
||||
TCAD.parametric.Param.prototype.reset = function(id, value) {
|
||||
this.id = id;
|
||||
this.value = value;
|
||||
this.j = -1;
|
||||
|
|
|
|||
|
|
@ -454,7 +454,14 @@ TCAD.TWO.ParametricManager.prototype.prepareForSubSystem = function(locked, subS
|
|||
}
|
||||
var _p = pdict[p.id];
|
||||
if (_p === undefined) {
|
||||
_p = new TCAD.parametric.Param(p.id, p.get());
|
||||
if (p.__cachedParam__ === undefined) {
|
||||
_p = new TCAD.parametric.Param(p.id, p.get());
|
||||
p.__cachedParam__ = _p;
|
||||
} else {
|
||||
_p = p.__cachedParam__;
|
||||
_p.reset(p.id, p.get());
|
||||
}
|
||||
|
||||
_p._backingParam = p;
|
||||
pdict[p.id] = _p;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue