Skip to content

Commit

Permalink
note the mass of heavy and light particles in phetioDocumentation, #30
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelzoom committed May 1, 2024
1 parent 3c6f183 commit 58116e4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
5 changes: 4 additions & 1 deletion js/common/model/HeavyParticle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,14 @@ import Particle from './Particle.js';

export default class HeavyParticle extends Particle {

// equivalent to N2 (nitrogen), in AMU, rounded to the closest integer
public static readonly MASS = 28;

public constructor() {
super( {

// ParticleOptions
mass: 28, // equivalent to N2 (nitrogen), in AMU, rounded to the closest integer
mass: HeavyParticle.MASS,
radius: GasPropertiesConstants.HEAVY_PARTICLES_RADIUS, // pm
colorProperty: GasPropertiesColors.heavyParticleColorProperty,
highlightColorProperty: GasPropertiesColors.heavyParticleHighlightColorProperty
Expand Down
4 changes: 3 additions & 1 deletion js/common/model/LightParticle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@ import Particle from './Particle.js';

export default class LightParticle extends Particle {

public static readonly MASS = 4; // equivalent to He (helium), in AMU, rounded to the closest integer

public constructor() {
super( {

// ParticleOptions
mass: 4, // equivalent to He (helium), in AMU, rounded to the closest integer
mass: LightParticle.MASS,
radius: GasPropertiesConstants.LIGHT_PARTICLES_RADIUS, // pm
colorProperty: GasPropertiesColors.lightParticleColorProperty,
highlightColorProperty: GasPropertiesColors.lightParticleHighlightColorProperty
Expand Down
4 changes: 2 additions & 2 deletions js/common/model/ParticleSystem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,15 @@ export default class ParticleSystem {
numberType: 'Integer',
range: GasPropertiesConstants.HEAVY_PARTICLES_RANGE,
tandem: tandem.createTandem( 'numberOfHeavyParticlesProperty' ),
phetioDocumentation: 'Number of heavy particles in the container.',
phetioDocumentation: `Number of heavy particles (mass = ${HeavyParticle.MASS} AMU) in the container.`,
hasListenerOrderDependencies: true // TODO: https://github.com/phetsims/gas-properties/issues/186
} );

this.numberOfLightParticlesProperty = new NumberProperty( GasPropertiesConstants.LIGHT_PARTICLES_RANGE.defaultValue, {
numberType: 'Integer',
range: GasPropertiesConstants.LIGHT_PARTICLES_RANGE,
tandem: tandem.createTandem( 'numberOfLightParticlesProperty' ),
phetioDocumentation: 'Number of light particles in the container.',
phetioDocumentation: `Number of light particles (mass = ${LightParticle.MASS} AMU) in the container.`,
hasListenerOrderDependencies: true // TODO: https://github.com/phetsims/gas-properties/issues/186
} );

Expand Down

0 comments on commit 58116e4

Please sign in to comment.