Closed arouinfar closed 1 year ago
I'd like to be involved in this implementation, but I also assigned @matthew-blackman in case we collaborate.
@matthew-blackman and I do not feel objectGroup
is the most precise and appropriate name. We are wondering--how about something like miscellaneousGroup
or miscellaneousItemGroup
or miscellaneousObjectGroup
? @arouinfar what do you think?
I don't love "miscellaneous" here. It's long and prone to typos. Maybe householdObjects
or everydayObjects
? These both have their own baggage, but I think it makes up for it with better interpretability.
Discussed with @matthew-blackman and @samreid and we decided to proceed with householdObjectGroup
. @matthew-blackman will take the lead on implementation.
Note that householdObjectGroup
should have the same phetioFeatured
behavior as the resistors.
@samreid I think this is in a good place for you to review before I move on to adjusting the appropriate resistor-type-specific properties like isEditableProperty and isColorCodeVisibleProperty.
I'm seeing some duplicated code between createExtremeResistorToolNode
and createHouseholdObjectToolNode
and createExtremeResistorToolNode
that would be good to factor out even more, let me know if we should collaborate on this.
@matthew-blackman and I took an initial look:
Using https://github.com/phetsims/circuit-construction-kit-common/blob/3d68e37f5304a7120a9d255871faf7fdfa0c9e4b/js/view/CircuitElementToolFactory.ts as a model, I unified the resistor type methods. It seems to be working OK but could use a review by @matthew-blackman.
This is looking great, thanks @samreid for reviewing and refactoring. It looks like there is one remaining issue in studio:
@samreid I have a fix for the circuit elements, but these properies are still showing in the archetype of the householdObjects group. Let's find a time to work on finalizing this together.
Fixed, thanks. @arouinfar ready for review. Please close if all is well.
Looks great, thanks!
Related to #917
model.circuit.resistorGroup
andview.circuitLayerNode.resistorNodeGroup
contains different resistor types: standard resistors, grab-bag objects (pencil, coin, etc.), and high-resistance resistors, which is inconsistent with how we structure the groups for batteries and light bulbs.Collapsing all of these resistors into one group makes it harder to distinguish between them. It also means that resistors will have properties that are not always applicable. For example, there isn't any reason for the pencil to have
isEditiableProperty
orisColorCodeVisibleProperty
.In discussions with @matthew-blackman and @samreid we decided to split the resistor group into three separate groups:
resistorGroup
for the standard resistors that support color coding.extremeResistorGroup
for the resistors with a larger range of resistances that do not support color coding.objectGroup
for the items that were originally in the "grab bag" in Java (pencil, coin, etc.) and have a fixed resistance.