Skip to content

Commit

Permalink
move common tangible code to tangible repo,
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph committed Apr 7, 2020
1 parent 10a357b commit 95712aa
Show file tree
Hide file tree
Showing 9 changed files with 69 additions and 91,954 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ git clone https://github.com/phetsims/sherpa.git
git clone https://github.com/phetsims/sun.git
git clone https://github.com/phetsims/tambo.git
git clone https://github.com/phetsims/tandem.git
git clone https://github.com/phetsims/tangible.git
git clone https://github.com/phetsims/utterance-queue.git
```
(2) Start an http-server
Expand Down
8 changes: 6 additions & 2 deletions gravity-force-lab_en.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,12 @@
},
"phet": {
"requirejsNamespace": "GRAVITY_FORCE_LAB",
"preload": [
"../tangible/js/preload/mechamarkers-21f16221e414ec2dca68bbfbb866369eea7abd70.js"
],
"phetLibs": [
"inverse-square-law-common"
"inverse-square-law-common",
"tangible"
],
"runnable": true,
"supportedBrands": [
Expand Down Expand Up @@ -103,7 +107,7 @@
'../sherpa/lib/TextEncoderLite-3c9f6f0.js',
'../tandem/js/PhetioIDUtils.js',
'../chipper/js/SimVersion.js',
'../gravity-force-lab/js/view/mechamarkers-controller/mechamarkers-21f16221e414ec2dca68bbfbb866369eea7abd70.js'
'../tangible/js/preload/mechamarkers-21f16221e414ec2dca68bbfbb866369eea7abd70.js'
];

if ( brand === 'phet-io' ) {
Expand Down
4 changes: 2 additions & 2 deletions js/view/GravityForceLabScreenView.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import GravityForceLabForceDescriber from './describers/GravityForceLabForceDesc
import GravityForceLabPositionDescriber from './describers/GravityForceLabPositionDescriber.js';
import GravityForceLabRulerDescriber from './describers/GravityForceLabRulerDescriber.js';
import MassDescriber from './describers/MassDescriber.js';
import MarkerInput from './mechamarkers-controller/MarkerInput.js';
import GravityForceLabMarkerInput from './mechamarkers-controller/GravityForceLabMarkerInput.js';
import GravityForceLabAlertManager from './GravityForceLabAlertManager.js';
import GravityForceLabControlPanel from './GravityForceLabControlPanel.js';
import GravityForceLabScreenSummaryNode from './GravityForceLabScreenSummaryNode.js';
Expand Down Expand Up @@ -80,7 +80,7 @@ function GravityForceLabScreenView( model, tandem ) {
} );

// wire up to marker input
MarkerInput.init( model );
GravityForceLabMarkerInput.init( model );

const alertManager = new GravityForceLabAlertManager( model, massDescriber, forceDescriber );

Expand Down
15 changes: 0 additions & 15 deletions js/view/mechamarkers-controller/.eslintrc.js

This file was deleted.

57 changes: 57 additions & 0 deletions js/view/mechamarkers-controller/GravityForceLabMarkerInput.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
// Copyright 2020, University of Colorado Boulder

/**
* This file is to prototype mechamarkers as an input controller to a phetsim, see https://github.com/phetsims/a11y-research/issues/153
* @author Michael Kauzmann (PhET Interactive Simulations)
*/

// modules
import gravityForceLab from '../../gravityForceLab.js';
import SliderGroupMarker from '../../../../tangible/js/SliderGroupMarker.js';
import MarkerInput from '../../../../tangible/js/MarkerInput.js';

// constants
const CONSTANT_SIZE_MARKER = 18; // change this marker number to toggle constant radius

class GravityForceLabMarkerInput extends MarkerInput {

/**
* @param {GravityForceLabModel} model
*/
static init( model ) {

let previousButtonPresent = false;

const mass1PositionSlider = new SliderGroupMarker( 'mass1Position', 'slider',
model.object1.positionProperty, {
range: model.object1.enabledRangeProperty
} );
// const mass2PositionSlider = new SliderGroupMarker( 'mass1Position', 'slider',
// model.object2.positionProperty, {
// range: model.object2.enabledRangeProperty
// } );
const mass1MassSlider = new SliderGroupMarker( 'mass1Position', 'slider',
model.object1.valueProperty );
const mass2MassSlider = new SliderGroupMarker( 'mass1Position', 'slider',
model.object2.valueProperty );

// initialize Mechamarkers with GFL specific update function.
super.init( Mechamarkers => {

mass1PositionSlider.update();

// This breaks right now because both positions will be set to the same value
// mass2PositionSlider.update();
mass1MassSlider.update();
mass2MassSlider.update();

if ( Mechamarkers.getMarker( CONSTANT_SIZE_MARKER ).present !== previousButtonPresent ) {
Mechamarkers.getMarker( CONSTANT_SIZE_MARKER ).present && model.constantRadiusProperty.toggle();
previousButtonPresent = Mechamarkers.getMarker( CONSTANT_SIZE_MARKER ).present;
}
} );
}
}

gravityForceLab.register( 'GravityForceLabMarkerInput', GravityForceLabMarkerInput );
export default GravityForceLabMarkerInput;
113 changes: 0 additions & 113 deletions js/view/mechamarkers-controller/MarkerInput.js

This file was deleted.

12 changes: 0 additions & 12 deletions js/view/mechamarkers-controller/README.md

This file was deleted.

Loading

0 comments on commit 95712aa

Please sign in to comment.