-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set State problems with particle locations and container width #276
Comments
@Nancy-Salpepi said:
Fixed in e8aaef0. |
The reason that the particles updated the first time that state was set is that the number of particles had changed, and that triggers an update of the view. When the number of particles is constant, and all that changes is their positions, there was nothing telling the view to update when state was set. In 98b2d2d, I added a listener that explicitly calls So... The particles and container size should now update correctly when state is set while the sim is paused. @Nancy-Salpepi please verify, close if OK. |
Working great! Closing. |
Sorry. I see this again in phetsims/qa#1107 |
It works correctly on main but not in 1.1.0-rc.1 |
This behavior would be typical of a missing cherry-pick. But the commits above were all made before the 1.1 branch was created on 7/10/24 @ 5:55PM. And I confirmed that the changes in the commits for this issue (e8aaef0, 98b2d2d, 4753e62) are present in the gas-properties 1.1 branch. |
For particle positions, broken in 1.1.0-rc.1, OK in main. For container size, OK in both 1.1.0-rc.1 and main. @Nancy-Salpepi is that what you are seeing too? |
Yes that is what I see @pixelzoom |
Duh... The problem is a difference between built and unbuilt versions. The workaround added in 98b2d2d looks like this: if ( assert && Tandem.PHET_IO_ENABLED ) {
phet.phetio.phetioEngine.phetioStateEngine.stateSetEmitter.addListener( () => {
if ( !model.isPlayingProperty.value ) {
particleSystemNode.update();
}
} );
} That chunk of code was copied from elsewhere, from a case that we want to execute only if assertions are enabled. Hence the |
The primary fix is 081fbea, the other commits are for patching release branches. @Nancy-Salpepi please review. You can test unbuilt using main in phetmarks. You can test the built version using 1.2.0-dev.1. Leave this open for verification in 1.1.0-rc.2. |
Looks good in 1.2.0-dev.1 and on main. |
@pixelzoom on the Diffusion Screen using Studio/State I noticed that if I increase the radius of either particle and then launch the sim, the particles in the launched/downstream sim can partially cross the container wall. This issue isn't present in 1.2.0-dev.1 or in main. I'm guessing it may have been related to this issue? |
Yes, that's right. Both mass and radius were not being deserialized, and that was fixed in 081fbea. So while it was a problem in 1.1.0-dev.rc.1, it is no longer a problem in main and (upcoming) 1.1.0-rc.2. So we're still ready for 1.1.0-rc.2. for this issue. |
Please verify for particle locations and container width in phetsims/qa#1123 and phetsims/qa#1124. Please verify for particle locations in phetsims/qa#1125. (Container width is fixed in Diffusion.) Follow "Steps to reproduce" in #276 (comment), and something similar in the Diffusion screen. If everything looks OK, please close. |
Looks good in rc.2 for all sims. |
Test device
MacBook Air M1 chip
Operating System
14.5
Browser
Safari 17.5
Problem description
For phetsims/qa#1100, and possibly related to #269 in the State Wrapper on all screens, the first time I set state with the sim paused, the state of the particles in the downstream sim matches the upstream. If I unpause the upstream sim and allow the particles to move a bit before pausing again, the downstream sim will not match the upstream sim when setting state. Everything else does update (the graphs, pressure, temperature etc). Once I press play, the particles in the downstream sim update. On Reset All the state is correctly set.
This also happens whens I resize the container. It will not update the second time I set state.
Steps to reproduce
Here is an example:
Visuals
ParticleState.mp4
The text was updated successfully, but these errors were encountered: