Skip to content

Commit

Permalink
Add tandemSuffix option, specify and match conventions, see phetsims/…
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed Aug 26, 2022
1 parent fb40b57 commit b818a27
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 12 deletions.
4 changes: 3 additions & 1 deletion js/common/view/EnergySkateParkControlPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ class EnergySkateParkControlPanel extends Panel {

let frictionControls = null;
if ( options.showFrictionControls ) {
frictionControls = new FrictionSlider( model.frictionProperty, userControlledPropertySet.frictionControlledProperty, tandem.createTandem( 'frictionSlider' ) );

// TODO: https://github.com/phetsims/tandem/issues/267 rename the class, perhaps up the hierarchy
frictionControls = new FrictionSlider( model.frictionProperty, userControlledPropertySet.frictionControlledProperty, tandem.createTandem( 'frictionControl' ) );
children.push( frictionControls );
}

Expand Down
6 changes: 3 additions & 3 deletions js/common/view/EnergySkateParkGravityControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ class EnergySkateParkGravityControls extends VBox {
assert && assert( !options.gravityNumberControlOptions.numberDisplayOptions.valuePattern,
'valuePattern of the gravity number control is set by EnergySkateParkGravityControls' );
}
const gravityControlInMetersPerSecondSquared = new GravityNumberControl( gravityMagnitudeProperty, userControlledProperty, tandem.createTandem( 'gravityControlInMetersPerSecondSquared' ), options.gravityNumberControlOptions );
const gravityControlInNewtonsPerKilogram = new GravityNumberControl( gravityMagnitudeProperty, userControlledProperty, tandem.createTandem( 'gravityControlInNewtonsPerKilogram' ), merge( {}, options.gravityNumberControlOptions, {
const gravityControlInMetersPerSecondSquared = new GravityNumberControl( gravityMagnitudeProperty, userControlledProperty, tandem.createTandem( 'gravityInMetersPerSecondSquaredControl' ), options.gravityNumberControlOptions );
const gravityControlInNewtonsPerKilogram = new GravityNumberControl( gravityMagnitudeProperty, userControlledProperty, tandem.createTandem( 'gravityInNewtonsPerKilogramControl' ), merge( {}, options.gravityNumberControlOptions, {
numberDisplayOptions: {
valuePattern: gravityNewtonsPerKilogramPatternString
}
Expand All @@ -85,7 +85,7 @@ class EnergySkateParkGravityControls extends VBox {
}

if ( options.includeGravitySlider ) {
const gravitySlider = new GravitySlider( gravityMagnitudeProperty, userControlledProperty, tandem.createTandem( 'gravitySlider' ) );
const gravitySlider = new GravitySlider( gravityMagnitudeProperty, userControlledProperty, tandem.createTandem( 'gravityControl' ) );
children.push( gravitySlider );
}

Expand Down
4 changes: 3 additions & 1 deletion js/common/view/EnergySkateParkMassControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ class EnergySkateParkMassControls extends VBox {

let massSlider = null;
if ( options.includeMassSlider ) {
massSlider = new MassSlider( massProperty, userControlledProperty, massRange, tandem.createTandem( 'massSlider' ) );

// TODO: https://github.com/phetsims/tandem/issues/267 rename the class
massSlider = new MassSlider( massProperty, userControlledProperty, massRange, tandem.createTandem( 'massNumberControl' ) );
children.push( massSlider );
}

Expand Down
12 changes: 6 additions & 6 deletions js/common/view/EnergySkateParkVisibilityControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,27 +79,27 @@ class EnergySkateParkVisibilityControls extends VBox {

if ( options.showPieChartCheckbox ) {
const iconNode = EnergySkateParkCheckboxItem.createPieChartIcon( tandem.createTandem( 'pieChartIcon' ) );
this.addCheckboxContent( pieChartString, iconNode, model.pieChartVisibleProperty, tandem.createTandem( 'pieChartCheckboxContent' ) );
this.addCheckboxContent( pieChartString, iconNode, model.pieChartVisibleProperty, tandem.createTandem( 'pieChartCheckbox' ) );
}

if ( options.showGridCheckbox ) {
const iconNode = EnergySkateParkCheckboxItem.createGridIcon( tandem.createTandem( 'gridIcon' ) );
this.addCheckboxContent( controlsShowGridString, iconNode, model.gridVisibleProperty, tandem.createTandem( 'gridCheckboxContent' ) );
this.addCheckboxContent( controlsShowGridString, iconNode, model.gridVisibleProperty, tandem.createTandem( 'gridCheckbox' ) );
}

if ( options.showSpeedCheckbox ) {
const iconNode = EnergySkateParkCheckboxItem.createSpeedometerIcon( tandem.createTandem( 'speedIcon' ) );
this.addCheckboxContent( propertiesSpeedString, iconNode, model.speedometerVisibleProperty, tandem.createTandem( 'speedCheckboxContent' ) );
this.addCheckboxContent( propertiesSpeedString, iconNode, model.speedometerVisibleProperty, tandem.createTandem( 'speedCheckbox' ) );
}

if ( options.showSkaterPathCheckbox ) {
const iconNode = EnergySkateParkCheckboxItem.createSamplesIcon( tandem.createTandem( 'pathIcon' ) );
this.addCheckboxContent( controlsPathString, iconNode, model.saveSamplesProperty, tandem.createTandem( 'pathCheckboxContent' ) );
this.addCheckboxContent( controlsPathString, iconNode, model.saveSamplesProperty, tandem.createTandem( 'pathCheckbox' ) );
}

if ( options.showReferenceHeightCheckbox ) {
const iconNode = EnergySkateParkCheckboxItem.createReferenceHeightIcon( tandem.createTandem( 'referenceHeightIcon' ) );
this.addCheckboxContent( controlsReferenceHeightString, iconNode, model.referenceHeightVisibleProperty, tandem.createTandem( 'referenceHeightCheckboxContent' ) );
this.addCheckboxContent( controlsReferenceHeightString, iconNode, model.referenceHeightVisibleProperty, tandem.createTandem( 'referenceHeightCheckbox' ) );
}

if ( options.showStickToTrackCheckbox ) {
Expand All @@ -108,7 +108,7 @@ class EnergySkateParkVisibilityControls extends VBox {
// this is the only checkbox that controls model physics, if it gets changed
// by the user we may need to clear saved data or do other things
const userControlledProperty = model.userControlledPropertySet.stickingToTrackControlledProperty;
this.addCheckboxContent( controlsStickToTrackString, iconNode, model.stickingToTrackProperty, tandem.createTandem( 'stickingCheckboxContent' ), {
this.addCheckboxContent( controlsStickToTrackString, iconNode, model.stickingToTrackProperty, tandem.createTandem( 'stickingCheckbox' ), {
userControlledProperty: userControlledProperty
} );
}
Expand Down
2 changes: 1 addition & 1 deletion js/common/view/PhysicalSlider.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* NumberControl to leverage the layout of the label and slider so that it conveniently matches the layout
* with other NumberControls used in this sim.
*
* @author Same Reid (PhET Interactive Simulations)
* @author Sam Reid (PhET Interactive Simulations)
* @author Jesse Greenberg (PhET Interactive Simulations)
*/

Expand Down

0 comments on commit b818a27

Please sign in to comment.