diff --git a/js/coins/view/MultiCoinTestBox.ts b/js/coins/view/MultiCoinTestBox.ts index 1eb16ab..49fbee8 100644 --- a/js/coins/view/MultiCoinTestBox.ts +++ b/js/coins/view/MultiCoinTestBox.ts @@ -9,6 +9,7 @@ */ import Property from '../../../../axon/js/Property.js'; +import TEmitter from '../../../../axon/js/TEmitter.js'; import TReadOnlyProperty from '../../../../axon/js/TReadOnlyProperty.js'; import Dimension2 from '../../../../dot/js/Dimension2.js'; import Vector2 from '../../../../dot/js/Vector2.js'; @@ -18,12 +19,10 @@ import WithRequired from '../../../../phet-core/js/types/WithRequired.js'; import { Color, HBox, HBoxOptions, LinearGradient, Node, Rectangle } from '../../../../scenery/js/imports.js'; import isSettingPhetioStateProperty from '../../../../tandem/js/isSettingPhetioStateProperty.js'; import TwoStateSystemSet from '../../common/model/TwoStateSystemSet.js'; -import QuantumMeasurementConstants from '../../common/QuantumMeasurementConstants.js'; import quantumMeasurement from '../../quantumMeasurement.js'; -import { MAX_COINS, MULTI_COIN_EXPERIMENT_QUANTITIES } from '../model/CoinsExperimentSceneModel.js'; +import { MULTI_COIN_EXPERIMENT_QUANTITIES } from '../model/CoinsExperimentSceneModel.js'; import { ExperimentMeasurementState } from '../model/ExperimentMeasurementState.js'; import SmallCoinNode, { SmallCoinDisplayMode } from './SmallCoinNode.js'; -import TEmitter from '../../../../axon/js/TEmitter.js'; type SelfOptions = EmptySelfOptions; export type MultiCoinTestBoxOptions = SelfOptions & WithRequired; @@ -178,15 +177,6 @@ export default class MultiCoinTestBox extends HBox { else if ( this.numberOfActiveSystemsProperty.value === 100 ) { setOffsets( BOX_SIZE, 10, 10 ); } - else if ( this.numberOfActiveSystemsProperty.value === MAX_COINS ) { - // N rows of N = sqrt( Hollywooded number of coins ) - const sideLength = Math.sqrt( QuantumMeasurementConstants.HOLLYWOODED_MAX_COINS ); - const BoxDimension = new Dimension2( - BOX_SIZE.width * QuantumMeasurementConstants.COIN_SET_AREA_PROPORTION + 3 * QuantumMeasurementConstants.HOLLYWOODED_MAX_COINS_RADII, - BOX_SIZE.height * QuantumMeasurementConstants.COIN_SET_AREA_PROPORTION + 3 * QuantumMeasurementConstants.HOLLYWOODED_MAX_COINS_RADII - ); - setOffsets( BoxDimension, sideLength, sideLength ); - } return offset; } @@ -204,7 +194,7 @@ export default class MultiCoinTestBox extends HBox { radius = 6; } else { - radius = QuantumMeasurementConstants.HOLLYWOODED_MAX_COINS_RADII; + radius = 2; } return radius; } diff --git a/js/coins/view/MultipleCoinAnimations.ts b/js/coins/view/MultipleCoinAnimations.ts index b5817e7..0abc0fe 100644 --- a/js/coins/view/MultipleCoinAnimations.ts +++ b/js/coins/view/MultipleCoinAnimations.ts @@ -9,18 +9,17 @@ */ import TProperty from '../../../../axon/js/TProperty.js'; +import isSettingPhetioStateProperty from '../../../../tandem/js/isSettingPhetioStateProperty.js'; import Tandem from '../../../../tandem/js/Tandem.js'; import Animation from '../../../../twixt/js/Animation.js'; import Easing from '../../../../twixt/js/Easing.js'; import { MEASUREMENT_PREPARATION_TIME } from '../../common/model/TwoStateSystemSet.js'; -import QuantumMeasurementConstants from '../../common/QuantumMeasurementConstants.js'; import quantumMeasurement from '../../quantumMeasurement.js'; import CoinsExperimentSceneModel, { MULTI_COIN_EXPERIMENT_QUANTITIES } from '../model/CoinsExperimentSceneModel.js'; import CoinExperimentMeasurementArea from './CoinExperimentMeasurementArea.js'; import CoinsExperimentSceneView from './CoinsExperimentSceneView.js'; import MultiCoinTestBox from './MultiCoinTestBox.js'; import SmallCoinNode from './SmallCoinNode.js'; -import isSettingPhetioStateProperty from '../../../../tandem/js/isSettingPhetioStateProperty.js'; const COIN_TRAVEL_ANIMATION_DURATION = MEASUREMENT_PREPARATION_TIME * 0.95; @@ -43,11 +42,10 @@ public readonly startIngressAnimationForCoinSet: ( forReprepare: boolean ) => vo // The 10000 coins case will be animated separately const ANIMATION_QUANTITIES = MULTI_COIN_EXPERIMENT_QUANTITIES.filter( quantity => quantity !== 10000 ); ANIMATION_QUANTITIES.forEach( quantity => { - const quantityToCreate = Math.min( quantity, QuantumMeasurementConstants.HOLLYWOODED_MAX_COINS ); const radius = MultiCoinTestBox.getRadiusFromCoinQuantity( quantity ); const coinNodes: SmallCoinNode[] = []; - _.times( quantityToCreate, () => { - coinNodes.push( new SmallCoinNode( radius, { visible: quantity !== 10000, tandem: Tandem.OPT_OUT } ) ); // TODO: Find a better way to not display these coins https://github.com/phetsims/quantum-measurement/issues/39 + _.times( quantity, () => { + coinNodes.push( new SmallCoinNode( radius, { tandem: Tandem.OPT_OUT } ) ); } ); movingCoinNodes.set( quantity, coinNodes ); } ); diff --git a/js/common/QuantumMeasurementConstants.ts b/js/common/QuantumMeasurementConstants.ts index bf5a7be..a3dfcad 100644 --- a/js/common/QuantumMeasurementConstants.ts +++ b/js/common/QuantumMeasurementConstants.ts @@ -11,6 +11,7 @@ import quantumMeasurement from '../quantumMeasurement.js'; const QuantumMeasurementConstants = { LAYOUT_BOUNDS: ScreenView.DEFAULT_LAYOUT_BOUNDS, + COIN_SET_AREA_PROPORTION: 0.9, // Side of the explicit coin area with respect to the measurement area SCREEN_VIEW_X_MARGIN: 15, SCREEN_VIEW_Y_MARGIN: 15, ALPHA: '\u03b1', @@ -19,25 +20,7 @@ const QuantumMeasurementConstants = { SPIN_DOWN_ARROW_CHARACTER: '\u2b63', CLASSICAL_UP_SYMBOL: '\uD83C\uDF1E\uFE0E\uFE0E', // 🌞 Sun symbol CLASSICAL_DOWN_SYMBOL: '\u263D', // 🌙 Moon Symbol - KET: '\u27e9', - COIN_SET_AREA_PROPORTION: 0.9, // Side of the explicit coin area with respect to the measurement area - - HOLLYWOODED_MAX_COINS_RADII: 2, - HOLLYWOODED_MAX_COINS: 121 // This number should be used when *showing* fewer coins than the max allowed. - /** - * TODO: Temporary list of square numbers for the hollywooded number of coins above. https://github.com/phetsims/quantum-measurement/issues/39 - * N N*N - * 20 400 - * 25 625 - * 30 900 - * 35 1225 - * 40 1600 - * 50 2500 - * 60 3600 - * 70 4900 - * 90 8100 - * 100 10000 - */ + KET: '\u27e9' }; quantumMeasurement.register( 'QuantumMeasurementConstants', QuantumMeasurementConstants );