phetsims / charges-and-fields

"Charges And Fields" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
8 stars 7 forks source link

Suppress sensor display until dropped #81

Closed phet-steele closed 8 years ago

phet-steele commented 8 years ago

@arouinfar @andrewadare When values are checked (and with charges in the field), sensors begin reading values immediately after being grabbed from the toolbox. However, there is no arrow until the sensor is dropped into the play area. It's my opinion that we can't have value readings without also an arrow stemming from the sensor. Especially since one of the sensor values directly relates to the state of the arrow (degrees). The alternative would be to not have the sensors displaying any values until dropped into the play area.

caf01

For phetsims/tasks/issues/661. Troubleshooting information: Name: ‪Charges And Fields‬ URL: http://www.colorado.edu/physics/phet/dev/html/charges-and-fields/1.0.0-dev.15/charges-and-fields_en.html Version: 1.0.0-dev.15 2016-07-28 14:16:27 UTC Features missing: touch Flags: pixelRatioScaling User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.106 Safari/537.36 Language: en-US Window: 1920x1002 Pixel Ratio: 2/1 WebGL: WebGL 1.0 (OpenGL ES 2.0 Chromium) GLSL: WebGL GLSL ES 1.0 (OpenGL ES GLSL ES 1.0 Chromium) Vendor: WebKit (WebKit WebGL) Vertex: attribs: 16 varying: 32 uniform: 1024 Texture: size: 16384 imageUnits: 16 (vertex: 16, combined: 16) Max viewport: 16384x16384 OES_texture_float: true Dependencies JSON: {"assert":{"sha":"7d27130a","branch":"master"},"axon":{"sha":"56e95e01","branch":"master"},"babel":{"sha":"b0a15003","branch":"master"},"brand":{"sha":"f0b1f7da","branch":"master"},"charges-and-fields":{"sha":"9163b74d","branch":"master"},"chipper":{"sha":"bdc6b525","branch":"master"},"dot":{"sha":"6ee3c51e","branch":"master"},"joist":{"sha":"50af4ae6","branch":"master"},"kite":{"sha":"88f0c3a0","branch":"master"},"phet-core":{"sha":"c48bf320","branch":"master"},"phetcommon":{"sha":"83ea84c8","branch":"master"},"scenery":{"sha":"942889ad","branch":"master"},"scenery-phet":{"sha":"eaa4be69","branch":"master"},"sherpa":{"sha":"5ddfccd4","branch":"master"},"sun":{"sha":"85b7fc95","branch":"master"},"tandem":{"sha":"6cc3e843","branch":"master"}}

veillette commented 8 years ago

Maybe @arouinfar can concur on this, but I seem to recall that Mike Dubson requested that the electric sensor should not display (initially) any measurement. This would mean that the sensor should not be displaying any values until dropped into the play area.

ariel-phet commented 8 years ago

@veillette I believe is correct, lets go with no value until dropped into play area

The rational was to be able to ask a predictive question...ie hold the sensor in a particular spot and ask "what will the field here be?"

arouinfar commented 8 years ago

@veillette I believe is correct, lets go with no value until dropped into play area

I agree. For similar reasons, we also decided to prevent charges from updating the E-field lines until they are dropped into the playspace.

veillette commented 8 years ago

The electricFieldSensor has a property called isActive. The visibility of the fieldStrength label and the direction label should be set by isActive.

andrewadare commented 8 years ago

@phet-steele is there anything to do here? If not, can we close this?

arouinfar commented 8 years ago

@andrewadare currently the angle and magnitude associated with the sensor is visible before it's placed (assuming Values is on). We'd like to change the behavior so that the sensor does not display any information until it is dropped into the playspace.

andrewadare commented 8 years ago

@arouinfar gotcha, I think the above commit does what you specified, and is what @veillette recommended.

Even if the Values checkbox is selected, the sensor labels are invisible initially, and only appear after the sensor is first dropped and picked up again.

arouinfar commented 8 years ago

Looks good @andrewadare!

phet-steele commented 8 years ago

What I'm seeing in master while starting with Values unchecked: caf04 @andrewadare ignore this if master is just unstable right now and shouldn't be tested with yet.

arouinfar commented 8 years ago

Good catch @phet-steele. I didn't see this when I first looked at master.

andrewadare commented 8 years ago

@phet-steele thanks for catching this. My bug fixes on master are new work, and could thus be characterized as "unstable" (as we see), but it's worth it for you to have a look and report issues. The sooner we catch them, the better.

phet-steele commented 8 years ago

@andrewadare this works well, with one small problem. If there is no net charge (or no charge at all) in the play area, the sensors will display a single dashed line before dropped, instead of no dashed lines. Showing both dashed lines once dropped is fine here:

caf05

andrewadare commented 8 years ago

@phet-steele good catch, let me see what I can do about that.

phet-steele commented 8 years ago

Behaves well for me, thank you @andrewadare.