From 7718315a642c3e6b0d816c03033c4f9cdf5c1e17 Mon Sep 17 00:00:00 2001 From: samreid Date: Mon, 11 Sep 2017 09:13:25 -0600 Subject: [PATCH] Made TNumber nonparametric and moved range/units to NumberProperty, see https://github.com/phetsims/axon/issues/137 --- js/ohms-law/model/OhmsLawModel.js | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/js/ohms-law/model/OhmsLawModel.js b/js/ohms-law/model/OhmsLawModel.js index 2f6336e..02c89a8 100644 --- a/js/ohms-law/model/OhmsLawModel.js +++ b/js/ohms-law/model/OhmsLawModel.js @@ -25,28 +25,23 @@ define( function( require ) { // @public {Property.} in volts this.voltageProperty = new NumberProperty( OhmsLawConstants.VOLTAGE_RANGE.getDefaultValue(), { tandem: tandem.createTandem( 'voltageProperty' ), - phetioValueType: TNumber( { - units: 'volts', - range: OhmsLawConstants.VOLTAGE_RANGE - } ) + units: 'volts', + range: OhmsLawConstants.VOLTAGE_RANGE } ); // @public {Property.} in Ohms this.resistanceProperty = new NumberProperty( OhmsLawConstants.RESISTANCE_RANGE.getDefaultValue(), { tandem: tandem.createTandem( 'resistanceProperty' ), - phetioValueType: TNumber( { - units: 'ohms', - range: OhmsLawConstants.RESISTANCE_RANGE - } ) + units: 'ohms', + range: OhmsLawConstants.RESISTANCE_RANGE } ); // @public {Property.} create a derived property that tracks the current in milli amps this.currentProperty = new DerivedProperty( [ this.voltageProperty, this.resistanceProperty ], computeCurrent, { tandem: tandem.createTandem( 'currentProperty' ), - phetioValueType: TNumber( { - units: 'milliamperes' - } ) + units: 'milliamperes', + phetioValueType: TNumber } ); } @@ -129,7 +124,7 @@ define( function( require ) { if ( !this.currentRange ) { // @private, use the getter - this.currentRange = new Range( OhmsLawModel.getMinCurrent(), OhmsLawModel.getMaxCurrent() ); + this.currentRange = new Range( OhmsLawModel.getMinCurrent(), OhmsLawModel.getMaxCurrent() ); } return this.currentRange; }