phetsims / neuron

"Neuron" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
1 stars 3 forks source link

trying to grab the playback marker causes an exception #138

Closed jbphet closed 7 years ago

jbphet commented 7 years ago

On the current master version, if the user checks the "Concentrations" and "Potential Chart" check boxes, then stimulates the neuron, then grabs the playback marker on the chart and attempts to drag it backwards, and exception is thrown. Here is the stack trace:

getSodiumExteriorConcentration (NeuronModel.js?bust=1499277395802:904)
updateConcentrationReadoutValues (ConcentrationReadoutLayerNode.js?bust=1499277395802:77)
(anonymous) (ConcentrationReadoutLayerNode.js?bust=1499277395802:150)
emit2 (Emitter.js?bust=1499277395802:147)
_notifyObservers (Property.js?bust=1499277395802:207)
_setAndNotifyObservers (Property.js?bust=1499277395802:196)
set (Property.js?bust=1499277395802:140)
setPlaybackState (NeuronModel.js?bust=1499277395802:1120)
setTime (RecordAndPlaybackModel.js?bust=1499277395802:162)
drag (ChartCursor.js?bust=1499277395802:83)
move (SimpleDragHandler.js?bust=1499277395802:131)
dispatchToPointer (Input.js?bust=1499277395802:774)
dispatchEvent (Input.js?bust=1499277395802:747)
branchChangeEvents (Input.js?bust=1499277395802:685)
moveEvent (Input.js?bust=1499277395802:650)
mouseMove (Input.js?bust=1499277395802:351)
run (BatchedDOMEvent.js?bust=1499277395802:71)
fireBatchedEvents (Input.js?bust=1499277395802:202)
batchEvent (Input.js?bust=1499277395802:178)
batchWindowEvent (BrowserEvents.js?bust=1499277395802:279)
onmousemove (BrowserEvents.js?bust=1499277395802:489)

I suspect this is related to the recent conversion away from PropertySet, see https://github.com/phetsims/axon/issues/102.

Assigning to @Denz1994, since he did the conversion.

Denz1994 commented 7 years ago

After reviewing the cause of this issue, I can no longer reproduce it and found out that NeuronModel.js was an inheriting from RecordPlayBackModel.js as a propertySet(). After removing the propertySet() inheritance from RecordPlayBackModel.js, I then had to do the same for NeuronModel.

This was explained as a 'clever' means of inheriting propertySet() and RecordPlayBackModel which was a method used in the original java sim. Thanks for the help @jbphet.