Skip to content

Commit

Permalink
Adding pixel representation to the phetio state, see #42
Browse files Browse the repository at this point in the history
  • Loading branch information
AgustinVallejo committed Oct 4, 2024
1 parent e15e50c commit d8dc0fb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions js/coins/view/CoinExperimentMeasurementArea.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,10 @@ export default class CoinExperimentMeasurementArea extends VBox {
}
} );

sceneModel.coinSet.measuredDataChangedEmitter.addListener( () => {
this.measuredCoinsPixelRepresentation.redraw( sceneModel.coinSet.measuredValues );
} );

sceneModel.preparingExperimentProperty.link( () => this.measuredCoinsPixelRepresentation.abortAllAnimations( 0 ) );

// Create the node that will be used to cover (aka "mask") the coin so that its state can't be seen.
Expand Down
2 changes: 2 additions & 0 deletions js/coins/view/CoinSetPixelRepresentation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ export default class CoinSetPixelRepresentation extends CanvasNode {
const fps = 40;
const totalFrames = 4 * MEASUREMENT_PREPARATION_TIME / fps;


// TODO: Try isSettingPhetioStateProperty.value ? 0 : MEASUREMENT_PREPARATION_TIME, https://github.com/phetsims/quantum-measurement/issues/39
this.populatingAnimation = new Animation( {
to: totalFrames,
duration: MEASUREMENT_PREPARATION_TIME,
Expand Down

0 comments on commit d8dc0fb

Please sign in to comment.