Skip to content

Commit

Permalink
REVIEW comments, #32
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelzoom committed Mar 4, 2024
1 parent 10c0ea5 commit ce4fe63
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions js/common-vsm/model/VSMField.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ export default class VSMField extends Field {
super( launchers, launcherProperty, PDLUtils.colorForFieldIndex( VSMFieldIdentifierValues.indexOf( identifier ) ), options );
this.continuousLaunchTimer = new PDLEventTimer( PDLConstants.MINIMUM_TIME_BETWEEN_LAUNCHES, options.tandem.createTandem( 'continuousLaunchTimer' ) );

//REVIEW Why is this not a NumberProperty?
this.latestLaunchAngleProperty = new Property<number>( this.meanAngleProperty.value, {
tandem: providedOptions.tandem.createTandem( 'latestLaunchAngleProperty' ),
phetioReadOnly: true,
Expand All @@ -90,6 +91,7 @@ export default class VSMField extends Field {
phetioFeatured: true
} );

//REVIEW Why is this not a NumberProperty?
this.latestLaunchSpeedProperty = new Property<number>( 0, {
tandem: providedOptions.tandem.createTandem( 'latestLaunchSpeedProperty' ),
phetioReadOnly: true,
Expand Down
3 changes: 3 additions & 0 deletions js/common/model/Histogram.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ export default class Histogram {
shouldPlayMeanTone: () => boolean, // See the method declaration in PDLModel.ts
playMeanTone: () => void, // See the method declaration in PDLModel.ts
providedOptions: HistogramOptions ) {

//REVIEW Why is this not a NumberProperty?
this.selectedBinWidthProperty = new Property<number>( 1, {
validValues: [ 0.5, 1, 2, 5, 10 ],
tandem: providedOptions.tandem.createTandem( 'selectedBinWidthProperty' ),
Expand All @@ -101,6 +103,7 @@ export default class Histogram {
phetioValueType: NumberIO
} );

//REVIEW Why is this not a NumberProperty?
this.selectedTotalBinsProperty = new Property<number>( 10, {
validValues: [ 10, 20, 50, 100, 200 ],
tandem: providedOptions.tandem.createTandem( 'selectedTotalBinsProperty' ),
Expand Down
1 change: 1 addition & 0 deletions js/common/model/Launcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export default class Launcher extends PhetioObject {
public readonly meanLaunchSpeedProperty: DynamicProperty<number, number, LauncherMechanism>;
public readonly standardDeviationSpeedProperty: TReadOnlyProperty<number>;

//REVIEW Is the doc for param launcherNumber correct here? For PDLColors.mysteryLauncherColorProfiles, custom is not index 0.
public constructor( public readonly mysteryOrCustom: MysteryOrCustom, launcherMechanism: LauncherMechanism, standardDeviationAngle: number,
// 1-6 for the mystery launchers.
// 0 for custom
Expand Down
3 changes: 3 additions & 0 deletions js/measures/model/IntervalTool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import IOType from '../../../../tandem/js/types/IOType.js';
import NumberIO from '../../../../tandem/js/types/NumberIO.js';
import Property from '../../../../axon/js/Property.js';

//REVIEW Vague names, constants should be uppercase, group all constants together.
const max = 100;
const min = 0;

Expand All @@ -30,6 +31,7 @@ const DEFAULT_EDGE_2 = 60;

export default class IntervalTool extends PhetioObject {

//REVIEW document fields
private _edge1: number;
private _edge2: number;
public readonly changedEmitter = new Emitter();
Expand All @@ -48,6 +50,7 @@ export default class IntervalTool extends PhetioObject {
this._edge1 = DEFAULT_EDGE_1;
this._edge2 = DEFAULT_EDGE_2;

//REVIEW Why is this not a NumberProperty?
this.dataFractionProperty = new Property<number>( 0, {
tandem: options.tandem.createTandem( 'dataFractionProperty' ),
phetioFeatured: true,
Expand Down
2 changes: 2 additions & 0 deletions js/measures/model/MeasuresField.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ export type MeasuresFieldOptions = SelfOptions & StrictOmit<SMFieldOptions, 'isL

export default class MeasuresField extends SMField {

//REVIEW For all Property<number | null>, what is the semantics of null?

// This Property represents the average distance (horizontal displacement) of landed projectiles.
public readonly meanDistanceProperty: Property<number | null>;

Expand Down
1 change: 1 addition & 0 deletions js/sampling/model/SamplingModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ export default class SamplingModel extends PDLModel<SamplingField> {
samplingLaunchModeProperty.value = launchMode;
} );

//REVIEW Why is this not a NumberProperty?
this.sampleSizeProperty = new Property<number>( 2, {
validValues: SAMPLE_SIZES,
tandem: options.tandem.createTandem( 'sampleSizeProperty' ),
Expand Down

1 comment on commit ce4fe63

@pixelzoom
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.