Skip to content

Commit

Permalink
Cleaned up functions, see #86
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed Nov 21, 2017
1 parent 128aab9 commit a71d301
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 20 deletions.
6 changes: 4 additions & 2 deletions js/faradays-law/model/FaradaysLawModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ define( function( require ) {
return inherit( Object, FaradaysLawModel, {

/**
* @public - restore to initial conditions
* Restore to initial conditions
* @public
*/
reset: function() {
this.magnet.reset();
Expand All @@ -100,6 +101,7 @@ define( function( require ) {
/**
* Move the model forward in time
* @param {number} dt - in seconds
* @public
*/
step: function( dt ) {
this.bottomCoil.step( dt );
Expand All @@ -108,7 +110,7 @@ define( function( require ) {
},

/**
* returns true if magnet intersects coil bounds
* Returns true if magnet intersects coil bounds
* @returns {boolean}
* @private
*/
Expand Down
2 changes: 1 addition & 1 deletion js/faradays-law/model/Voltmeter.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ define( function( require ) {

/**
* Voltmeter needle evolution over time
* @param dt
* @param {number} dt - elasped time in seconds
*/
step: function( dt ) {

Expand Down
1 change: 0 additions & 1 deletion js/faradays-law/view/CoilsWiresNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ define( function( require ) {
* @constructor
*/
function CoilsWiresNode( view, showTopCoilProperty ) {

Node.call( this );

// bottom coil, left bottom wire
Expand Down
2 changes: 1 addition & 1 deletion js/faradays-law/view/ControlPanelNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ define( function( require ) {
var faradaysLawShowFieldLinesString = require( 'string!FARADAYS_LAW/faradays-law.showFieldLines' );

/**
* @param {FaradaysLawModel} model - 'Faradays Law' simulation model
* @param {FaradaysLawModel} model
* @param {Tandem} tandem
* @constructor
*/
Expand Down
2 changes: 1 addition & 1 deletion js/faradays-law/view/FlipMagnetButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ define( function( require ) {
}

/**
* Create curved arrow for button
* Create curved arrow to display on the button
* @param {number} rotation
* @returns {Node}
*/
Expand Down
15 changes: 7 additions & 8 deletions js/faradays-law/view/MagnetFieldLines.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,11 @@ define( function( require ) {
createSideFieldLines( magnet.flippedProperty, -1 ) // bottom
]
} );

magnet.showFieldLinesProperty.linkAttribute( this, 'visible' );
}

/**
* Create single arrow
* Creates a single arrow
* @param {Object} [options]
* @returns {Path}
*/
Expand All @@ -61,22 +60,22 @@ define( function( require ) {

/**
* Create ellipse with arrows on it.
* @param a - major axis of ellipse
* @param b - minor axis of ellipse
* @param arrowPositions - array of angle positions of arrows on ellipse
* @param flippedProperty - is magnet flipped
* @param {number} radiusX - major axis of ellipse
* @param {number} radiusY - minor axis of ellipse
* @param {number[]} arrowPositions - array of angle positions of arrows on ellipse
* @param {BooleanProperty} flippedProperty - is magnet flipped
* @param {Object} [options]
* @returns {Node}
*/
var createArcWithArrow = function( a, b, arrowPositions, flippedProperty, options ) {
var createArcWithArrow = function( radiusX, radiusY, arrowPositions, flippedProperty, options ) {
var arcWithArrow = new Node();
options = _.extend( {
stroke: '#ffffff',
lineWidth: 3
}, options );

// arc
var ellipticalShape = new Shape().ellipticalArc( 0, 0, a, b, 0, 0, 2 * Math.PI );
var ellipticalShape = new Shape().ellipticalArc( 0, 0, radiusX, radiusY, 0, 0, 2 * Math.PI );
arcWithArrow.addChild( new Path( ellipticalShape, {
stroke: options.stroke,
lineWidth: options.lineWidth
Expand Down
8 changes: 4 additions & 4 deletions js/faradays-law/view/MagnetNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ define( function( require ) {
}

/**
* @param magnetWidth - width of Magnet
* @param magnetHeight - height of Magnet
* @param label - label on half of magnet
* @param backgroundColor
* @param {number} magnetWidth - width of Magnet
* @param {number} magnetHeight - height of Magnet
* @param {string} label - label on half of magnet
* @param {Color} backgroundColor
* @param {Object} [options]
* @returns {Node}
*/
Expand Down
4 changes: 2 additions & 2 deletions js/faradays-law/view/MagnetNodeWithField.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ define( function( require ) {
var MAGNET_ARROW_LENGTH = 30;

/**
* @param {FaradaysLawModel} model - 'Faradays Law' simulation model
* @param {Tandem} tandem - this node is not instrumented but the input listener is
* @param {FaradaysLawModel} model
* @param {Tandem} tandem
* @constructor
*/
function MagnetNodeWithField( model, tandem ) {
Expand Down

0 comments on commit a71d301

Please sign in to comment.