From 5fd9a4160c1a424a0c599e02830d34cdd2df8584 Mon Sep 17 00:00:00 2001 From: zepumph Date: Mon, 11 Oct 2021 16:59:41 -0600 Subject: [PATCH] update instrumentation of evaporate -> shear off terminology, https://github.com/phetsims/friction/issues/236 --- js/friction/model/FrictionModel.js | 11 ++++++----- js/friction/view/FrictionScreenView.js | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/js/friction/model/FrictionModel.js b/js/friction/model/FrictionModel.js index f5130c21..28ed6d41 100644 --- a/js/friction/model/FrictionModel.js +++ b/js/friction/model/FrictionModel.js @@ -181,8 +181,8 @@ class FrictionModel extends PhetioObject { this.scheduledShearingAmount = 0; // @public (phet-io) - Instrumented so that PhET-iO clients can get a message when an atom shears off - this.shearingEmitter = new Emitter( { - tandem: tandem.createTandem( 'shearingEmitter' ), + this.shearedOffEmitter = new Emitter( { + tandem: tandem.createTandem( 'shearedOffEmitter' ), phetioDocumentation: 'Emits when atoms shear off from the top book', phetioReadOnly: true } ); @@ -220,7 +220,8 @@ class FrictionModel extends PhetioObject { // @public (read-only) {NumberProperty} - number of rows of atoms available to shear off, goes down as book wears away this.atomRowsToShearOffProperty = new NumberProperty( TOP_BOOK_ATOM_STRUCTURE.length - 1, { - tandem: tandem.createTandem( 'atomRowsToShearOffProperty' ) + tandem: tandem.createTandem( 'atomRowsToShearOffProperty' ), + phetioReadOnly: true } ); // @private - are books in contact? @@ -248,7 +249,7 @@ class FrictionModel extends PhetioObject { // {number} the count of how many atoms have been sheared off this.numberOfAtomsShearedOff = 0; - this.shearingEmitter.addListener( () => { + this.shearedOffEmitter.addListener( () => { this.numberOfAtomsShearedOff += 1; } ); @@ -440,7 +441,7 @@ class FrictionModel extends PhetioObject { // randomly choose an non-sheared-off atom and shear off it const atomsToShearOff = dotRandom.sample( notYetShearedAtoms ); atomsToShearOff.shearOff(); - this.shearingEmitter.emit(); + this.shearedOffEmitter.emit(); // cause some cooling due to shearing this.scheduledShearingAmount = this.scheduledShearingAmount + SHEAR_OFF_AMPLITUDE_REDUCTION; diff --git a/js/friction/view/FrictionScreenView.js b/js/friction/view/FrictionScreenView.js index ee9993f9..cda2eb7e 100644 --- a/js/friction/view/FrictionScreenView.js +++ b/js/friction/view/FrictionScreenView.js @@ -226,7 +226,7 @@ class FrictionScreenView extends ScreenView { rateChangesAffectPlayingSounds: false } ); soundManager.addSoundGenerator( moleculeBreakOffSoundClip ); - model.shearingEmitter.addListener( () => { + model.shearedOffEmitter.addListener( () => { // don't play for every sheared off atom or it's too noisy if ( model.numberOfAtomsShearedOff % 4 === 0 ) {