Skip to content

Commit

Permalink
Made TNumber nonparametric and moved range/units to NumberProperty, see
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed Sep 11, 2017
1 parent c4ec484 commit 0304740
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions js/resistance-in-a-wire/model/ResistanceInAWireModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,28 +28,22 @@ define( function( require ) {
// @public {Property.<number>} in Ohm*cm
this.resistivityProperty = new NumberProperty( ResistanceInAWireConstants.RESISTIVITY_RANGE.defaultValue, {
tandem: tandem.createTandem( 'resistivityProperty' ),
phetioValueType: TNumber( {
units: 'ohm-centimeters',
range: ResistanceInAWireConstants.RESISTIVITY_RANGE
} )
units: 'ohm-centimeters',
range: ResistanceInAWireConstants.RESISTIVITY_RANGE
} );

// @public {Property.<number>} in cm
this.lengthProperty = new NumberProperty( ResistanceInAWireConstants.LENGTH_RANGE.defaultValue, {
tandem: tandem.createTandem( 'lengthProperty' ),
phetioValueType: TNumber( {
units: 'centimeters',
range: ResistanceInAWireConstants.LENGTH_RANGE
} )
units: 'centimeters',
range: ResistanceInAWireConstants.LENGTH_RANGE
} );

// @public {Property.<number>} in cm^2
this.areaProperty = new NumberProperty( ResistanceInAWireConstants.AREA_RANGE.defaultValue, {
tandem: tandem.createTandem( 'areaProperty' ),
phetioValueType: TNumber( {
units: 'centimeters-squared',
range: ResistanceInAWireConstants.AREA_RANGE
} )
units: 'centimeters-squared',
range: ResistanceInAWireConstants.AREA_RANGE
} );

// Derived property that tracks the resistance of the wire
Expand All @@ -59,7 +53,8 @@ define( function( require ) {
return resistivity * length / area;
}, {
tandem: tandem.createTandem( 'resistanceProperty' ),
phetioValueType: TNumber( { units: 'ohms' } )
units: 'ohms',
phetioValueType: TNumber
}
);
}
Expand Down

0 comments on commit 0304740

Please sign in to comment.