phetsims / beers-law-lab

"Beer's Law Lab" is an educational simulation in HTML5, by PhET Interactive Simulations.
http://phet.colorado.edu/en/simulation/beers-law-lab
GNU General Public License v3.0
2 stars 9 forks source link

Add PhET-iO instrumentation for "Concentration:" label #297

Closed pixelzoom closed 1 year ago

pixelzoom commented 1 year ago

Add PhET-iO instrumentation for "Concentration:" label, after #270 is addressed.

Instrumentation should probably be similar to the "Evaporation:" label in EvaporationPanel.ts:

    const stringProperty = new DerivedProperty(
      [ BeersLawLabStrings.pattern[ '0labelStringProperty' ], BeersLawLabStrings.evaporationStringProperty ],
      ( pattern: string, evaporationString: string ) => StringUtils.format( pattern, evaporationString ), {
        tandem: labelTextTandem.createTandem( Text.STRING_PROPERTY_TANDEM_NAME ),
        phetioValueType: StringIO
      }
    );
pixelzoom commented 1 year ago

The "Concentration:" string Property was instrumented in the above commit. It's a little different than the other "Label:" string Properties because it's shared with 8 NumberControls (see https://github.com/phetsims/beers-law-lab/issues/270). It's tandem name is "concentrationStringProperty" instead of simply "stringProperty". And it looks like this in the Studio tree:

screenshot_2057

@arouinfar please review. You'll probably want to review https://github.com/phetsims/beers-law-lab/issues/270 at the same time.

arouinfar commented 1 year ago

Thanks @pixelzoom, looks good in master.