Skip to content

Commit

Permalink
Update documentation, see #183
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed Feb 27, 2024
1 parent 0c2f806 commit ddba251
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
9 changes: 9 additions & 0 deletions js/common-vsm/model/VSMModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,15 @@ export default class VSMModel<T extends VSMField> extends PDLModel<T> {
} );
}

/**
* When the launch button is pressed, the behavior depends on a variety of factors:
* - If AUTO_GENERATE_DATA_PROPERTY is true, then the field is cleared and new projectiles are generated.
* - If the singleOrContinuousProperty is 'single', then a single projectile is launched.
* - If the singleOrContinuousProperty is 'continuous', then isContinuousLaunchingProperty is toggled
* If toggled to true, it begins by launching the first projectile in that series.
*
* See also the superclass documentation.
*/
public override launchButtonPressed(): void {

if ( AUTO_GENERATE_DATA_PROPERTY.value ) {
Expand Down
4 changes: 4 additions & 0 deletions js/common/model/PDLModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,10 @@ export default abstract class PDLModel<T extends Field> implements TModel {
} );
}

/**
* This method is called when the launch button is pressed. The launch button has multi-modal behaviors where its behavior
* differs depending on the current state of the simulation.
*/
public abstract launchButtonPressed(): void;

public step( dt: number ): void {
Expand Down
9 changes: 9 additions & 0 deletions js/sampling/model/SamplingModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,15 @@ export default class SamplingModel extends PDLModel<SamplingField> {
} );
}

/**
* When the launch button is pressed, the behavior depends on a variety of factors:
* - If AUTO_GENERATE_DATA_PROPERTY is true, then the field is cleared and new samples are generated.
* - If the singleOrContinuousProperty is 'single', then a single projectile is launched, beginning a new sample.
* - If the singleOrContinuousProperty is 'continuous', then isContinuousLaunchingProperty is toggled
* If toggled to true, it starts creating samples.
*
* See also the superclass documentation.
*/
public override launchButtonPressed(): void {

const field = this.fieldProperty.value;
Expand Down

0 comments on commit ddba251

Please sign in to comment.