Closed arouinfar closed 1 year ago
@samreid @zepumph @arouinfar and I discussed this, and agree that all non-contact ammeter tandems should be removed from studio for CCK DC-Virtual Lab. We plan to uninstrument this so that users cannot encounter any possibly buggy behavior by adding these sensors in the Virtual Lab version of the sim.
If clients want to show non-contact ammeters in the Lab screen, they can use the standard version of the sim with screens=2.
This is ready for review. @arouinfar please confirm that all noncontact ammeter tandems are showing correctly in both sims and all screens.
For the code review, specifying showNoncontactAmmeters: true,
js/intro/view/IntroScreenView.ts could lead to trouble since it allows a model to create noncontact ammeters but the view to not show them. So I think the solution for that part would be to assign it to the model and use something like model.isShowNoncontactAmmeters
.
For this code: could we skip creating them altogether if showNoncontactAmmeters
is false? Or does that cause problems?
this.ammeters = [
new Ammeter( providedOptions?.showNoncontactAmmeters ? metersTandem.createTandem( 'ammeter1' ) : Tandem.OPT_OUT, 1 ),
new Ammeter( providedOptions?.showNoncontactAmmeters ? metersTandem.createTandem( 'ammeter2' ) : Tandem.OPT_OUT, 2 )
];
Everything else in the code review looks great. Reassigning to @matthew-blackman for the code review issues. Leaving assigned to @arouinfar to review the runtime behavior and API.
@samreid and I worked on a way to accomplish the second recommendation from the comment above, but ran into complexity creep with SensorToolbox. Pasting the patch that we worked on below (almost in working order but becoming overly complex) in case we ever want to pursue this approach in the future.
@samreid I think this warrants a final review before closing, given the issues we explored in the patch above.
I no longer see any reference to the non-contact ammeters in the cck-dc-virtual-lab tree. So from a design perspective, everything looks good.
@samreid and I reviewed the most recent commit and agree that this issue can be closed.
Tangentially related to https://github.com/phetsims/qa/issues/900 and discovered while reviewing https://github.com/phetsims/circuit-construction-kit-common/issues/865.
CCK: DC - Virtual Lab is nearly identical to its parent sim. There are two primary differences:
screens=2
)Non-contact ammeters are still visible in the Studio Tree and can be found under:
circuitConstructionKitDcVirtualLab.labScreen.model.meters
circuitConstructionKitDcVirtualLab.labScreen.view.meterNodes
circuitConstructionKitDcVirtualLab.labScreen.view.sensorToolbox
Clients can use
isActiveProperty
to add the non-contact ammeter to the play area of the sim. However, it is not possible to make them visible in the toolbox.view.sensorToolbox.noncontactAmmeterToolNode.visibleProperty
istrue
by default, but no icon appears in the toolbox. I assumed that the default would befalse
and clients could set it totrue
to give students access to non-contact ammeters.I see two options
view.sensorToolbox.noncontactAmmeterToolNode.visibleProperty
so it has the expected behavior -- defaultfalse
, but clients can set it totrue
to add non-contact ammeters to the toolbox. This would be consistent with how we generally handle the PhET-iO instrumentation of derivative sims.screens=2
.I am fine with either option, so I'll leave it up to @samreid and @matthew-blackman to decide.