phetsims / circuit-construction-kit-common

"Circuit Construction Kit: Basics" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
10 stars 10 forks source link

Uninstrument switch `isEditableProperty` #931

Closed arouinfar closed 1 year ago

arouinfar commented 1 year ago

Related to #917

Most circuit components are adjustable in some way (e.g. resistance, voltage, current rating). image

To prevent users from editing a circuit component, clients can set isEditableProperty to false, which would hide the slider in the screenshot above.

Switches do not have a tunable Property (like resistance) so isEditableProperty doesn't actually do anything. Can we get rid of it @samreid?

samreid commented 1 year ago

We would probably add a ternary operator where isEditableProperty is instrumented--to use Tandem.OPT_OUT for Switch circuit elements.

matthew-blackman commented 1 year ago

@samreid ready for review

samreid commented 1 year ago

Excellent, nice work @matthew-blackman. Closing.