Closed pixelzoom closed 7 months ago
Hmm... I'm not sure how I'm going to do this when these Properties are all on global
. The Properties are created as singletons, there's no way to pass anything to them, and this is the current PhET-iO convention. I'll probably need to discuss with @arouinfar.
This was a big change, touching 47 files. In order to conditionally instrument Preferences Properties, I had to convert FELPreferences to a class (instead of a collection of globals), instantiate an instance of FELPreferences for each sim, and pass that instances (or specific Properties) through constructors.
@arouinfar please review. For all sims in the suite:
global.model.preferences
in Studio, verify that only relevant Properties appear.This was a big change, touching 47 files.
A big change indeed!!
@arouinfar please review.
I reviewed as requested, and all sims have the appropriate properties visible under global.model.preferences
and have the correct controls under Preferences > SImulation with the desired defaults.
This comment may have come just a bit late, but In Buoyancy, we used the packageJSON.name
to determine what preferences were instrumented statically. I'm going to reopen so @pixelzoom can see this comment, but feel free to close with no work.
Thanks, I see how using packageJSON.name
would’ve saved me some time. But I’m not wild about the pattern we’ve been using for Preferences model/view. Or using packageJSON.name
to configure what perhaps should not be globals in the first place. But I don’t feel strongly that you shouldn’t use that pattern.
Noticed while working on #136 ...
Currently, all Preferences Properties are instrumented and featured in all sims in the FEL suite. These elements should not be instrumented in sims where they are not relevant:
@arouinfar FYI.