From b818a27e17e439f15f09103fe8a25d7f9288c098 Mon Sep 17 00:00:00 2001 From: Sam Reid <reids@colorado.edu> Date: Fri, 26 Aug 2022 11:12:48 -0600 Subject: [PATCH] Add tandemSuffix option, specify and match conventions, see https://github.com/phetsims/tandem/issues/267 --- js/common/view/EnergySkateParkControlPanel.js | 4 +++- js/common/view/EnergySkateParkGravityControls.js | 6 +++--- js/common/view/EnergySkateParkMassControls.js | 4 +++- js/common/view/EnergySkateParkVisibilityControls.js | 12 ++++++------ js/common/view/PhysicalSlider.js | 2 +- 5 files changed, 16 insertions(+), 12 deletions(-) diff --git a/js/common/view/EnergySkateParkControlPanel.js b/js/common/view/EnergySkateParkControlPanel.js index 056a263d..75d2bb8a 100644 --- a/js/common/view/EnergySkateParkControlPanel.js +++ b/js/common/view/EnergySkateParkControlPanel.js @@ -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 ); } diff --git a/js/common/view/EnergySkateParkGravityControls.js b/js/common/view/EnergySkateParkGravityControls.js index 3ac118de..0ac76b2b 100644 --- a/js/common/view/EnergySkateParkGravityControls.js +++ b/js/common/view/EnergySkateParkGravityControls.js @@ -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 } @@ -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 ); } diff --git a/js/common/view/EnergySkateParkMassControls.js b/js/common/view/EnergySkateParkMassControls.js index 70a5287a..9a0884f3 100644 --- a/js/common/view/EnergySkateParkMassControls.js +++ b/js/common/view/EnergySkateParkMassControls.js @@ -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 ); } diff --git a/js/common/view/EnergySkateParkVisibilityControls.js b/js/common/view/EnergySkateParkVisibilityControls.js index 33421d14..f5e19d19 100644 --- a/js/common/view/EnergySkateParkVisibilityControls.js +++ b/js/common/view/EnergySkateParkVisibilityControls.js @@ -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 ) { @@ -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 } ); } diff --git a/js/common/view/PhysicalSlider.js b/js/common/view/PhysicalSlider.js index b6fda158..82547823 100644 --- a/js/common/view/PhysicalSlider.js +++ b/js/common/view/PhysicalSlider.js @@ -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) */