Skip to content

Commit

Permalink
Adjust tandems associated with each screen, see #824
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed Jan 31, 2022
1 parent 0546317 commit 96f3a43
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions js/model/Circuit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,13 @@ class Circuit {
// @public {NumberProperty} - All wires share the same resistivity, which is defined by
// resistance = resistivity * length. On the Lab Screen, there is a wire resistivity control
this.wireResistivityProperty = new NumberProperty( CCKCConstants.DEFAULT_RESISTIVITY, {
tandem: this.includeLabElements ? tandem.parentTandem.createTandem( 'wireResistivityProperty' ) : Tandem.OPT_OUT
tandem: tandem.parentTandem.createTandem( 'wireResistivityProperty' )
} );

// @public {NumberProperty} - All batteries share a single internal resistance value, which can be edited with
// a control on the Lab Screen
this.sourceResistanceProperty = new NumberProperty( CCKCConstants.DEFAULT_BATTERY_RESISTANCE, {
tandem: this.includeLabElements ? tandem.parentTandem.createTandem( 'sourceResistanceProperty' ) : Tandem.OPT_OUT
tandem: tandem.parentTandem.createTandem( 'sourceResistanceProperty' )
} );

// @public {ObservableArrayDef.<CircuitElement>} - The different types of CircuitElement the circuit may
Expand Down
2 changes: 1 addition & 1 deletion js/view/CircuitLayerNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ class CircuitLayerNode extends Node {
new PhetioGroup( ( tandem: Tandem, circuitElement: CircuitElement ) => new CCKCLightBulbNode( screenView, this, circuitElement as LightBulb, this.model.isValueDepictionEnabledProperty, this.model.viewTypeProperty, tandem ),
() => [ this.circuit.lightBulbGroup.archetype ], {
phetioType: PhetioGroup.PhetioGroupIO( Node.NodeIO ),
tandem: tandem.createTandem( 'highResistanceLightBulbNodeGroup' ),
tandem: circuit.includeLabElements ? tandem.createTandem( 'highResistanceLightBulbNodeGroup' ) : Tandem.OPT_OUT,
supportsDynamicState: false
} ) );
initializeCircuitElementType( ( e: CircuitElement ) => e instanceof Resistor, this.fixedCircuitElementLayer,
Expand Down
9 changes: 5 additions & 4 deletions js/view/SensorToolbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,10 @@ class SensorToolbox extends CCKCPanel {
new Vertex( new Vector2( CCKCConstants.SERIES_AMMETER_LENGTH, 0 ) ),
Tandem.OPTIONAL
);
const seriesAmmeterNodeIcon = new SeriesAmmeterNode( null, null, seriesAmmeterIcon, tandem.createTandem( 'seriesAmmeterNodeIcon' ), {
isIcon: true
} );
const seriesAmmeterNodeIcon = new SeriesAmmeterNode( null, null, seriesAmmeterIcon,
circuit.includeLabElements ? tandem.createTandem( 'seriesAmmeterNodeIcon' ) : Tandem.OPT_OUT, {
isIcon: true
} );
const createSeriesAmmeter = ( position: Vector2 ) => {
const halfLength = CCKCConstants.SERIES_AMMETER_LENGTH / 2;
const startVertex = circuit.vertexGroup.createNextElement( position.plusXY( -halfLength, 0 ) );
Expand All @@ -158,7 +159,7 @@ class SensorToolbox extends CCKCPanel {
touchAreaExpansionTop: 15,
touchAreaExpansionRight: 3,
touchAreaExpansionBottom: 0,
tandem: tandem.createTandem( 'seriesAmmeterToolNode' )
tandem: circuit.includeLabElements ? tandem.createTandem( 'seriesAmmeterToolNode' ) : Tandem.OPT_OUT
} );
const allSeriesAmmetersInPlayArea = new DerivedProperty( [ circuit.circuitElements.lengthProperty ], ( ( length: number ) => {
return circuit.circuitElements.count( circuitElement => circuitElement instanceof SeriesAmmeter ) === MAX_SERIES_AMMETERS;
Expand Down

0 comments on commit 96f3a43

Please sign in to comment.