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 9736e81 commit 44df743
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions js/common-sm/model/SMField.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Copyright 2024, University of Colorado Boulder

//REVIEW Incomplete doc. What does this class add?
/**
* The SMField adds functionality common between the Fields in the Sources and Measures screens.
*
Expand Down
2 changes: 2 additions & 0 deletions js/common-sm/model/SMModel.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Copyright 2024, University of Colorado Boulder

//REVIEW Incomplete doc. What does this class add?
/**
* The SMModel adds functionality common between the Models in the Sources and Measures screens.
*
Expand All @@ -22,6 +23,7 @@ export default class SMModel<T extends SMField> extends VSMModel<T> {

public readonly customLauncherMechanismProperty: PhetioProperty<LauncherMechanism>;

//REVIEW constructor should be protected
public constructor( fields: T[], providedOptions: SMModelOptions ) {

super( fields, providedOptions );
Expand Down
1 change: 1 addition & 0 deletions js/common-vsm/model/LauncherMechanism.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export default class LauncherMechanism extends PhetioObject {
}
projectileDataLab.register( 'LauncherMechanism', LauncherMechanism );

//REVIEW Use the correct pattern for static instances. Constructor should be private and these should all be 'public static readonly' fields of customLauncherMechanismProperty.
export const SPRING = new LauncherMechanism( Tandem.GLOBAL_MODEL.createTandem( 'launcherMechanisms' ).createTandem( 'spring' ), 23, 0.5 );
export const PRESSURE = new LauncherMechanism( Tandem.GLOBAL_MODEL.createTandem( 'launcherMechanisms' ).createTandem( 'pressure' ), 24, 0.2 );
export const EXPLOSION = new LauncherMechanism( Tandem.GLOBAL_MODEL.createTandem( 'launcherMechanisms' ).createTandem( 'explosion' ), 25, 1.2 );
Expand Down
2 changes: 2 additions & 0 deletions js/common-vsm/model/VSMField.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Copyright 2023-2024, University of Colorado Boulder

//REVIEW Incomplete doc. What does this class add?
/**
* The VSMField is an extension of the Field class that adds fields for the VSM models.
*
Expand Down Expand Up @@ -203,6 +204,7 @@ export default class VSMField extends Field {
public override reset(): void {
super.reset();

this.angleStabilizerProperty.reset();
this.continuousLaunchTimer.reset();
}

Expand Down
2 changes: 2 additions & 0 deletions js/common-vsm/model/VSMModel.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Copyright 2023-2024, University of Colorado Boulder

//REVIEW Incomplete doc. What does this class add?
/**
* The VSMModel is the base class for the Variability, Sources, and Measurement (VSM) models.
*
Expand Down Expand Up @@ -67,6 +68,7 @@ export default class VSMModel<T extends VSMField> extends PDLModel<T> {

public readonly launcherProperty: DynamicProperty<Launcher, Launcher, T>;

//REVIEW constructor should be protected
public constructor( fields: T[], providedOptions: VSMModelOptions<T> ) {

const options = optionize<VSMModelOptions<T>, SelfOptions, PDLModelOptions<T>>()( {
Expand Down

1 comment on commit 44df743

@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.