Skip to content

Commit

Permalink
Only instrument some relevant experiment elements, see #63
Browse files Browse the repository at this point in the history
  • Loading branch information
AgustinVallejo committed Dec 20, 2024
1 parent f354f4a commit d2ab63b
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 24 deletions.
6 changes: 4 additions & 2 deletions js/photons/view/LaserNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ export default class LaserNode extends Node {
},
right: modelViewTransform.modelToViewX( model.position.x ),
centerY: modelViewTransform.modelToViewY( model.position.y ),
tandem: providedOptions.tandem.createTandem( 'laserPointerNode' )
tandem: providedOptions.tandem.createTandem( 'laserPointerNode' ),
phetioVisiblePropertyInstrumented: false
} );
const caption = new Text( QuantumMeasurementStrings.photonSourceStringProperty, {
font: new PhetFont( 12 ),
Expand Down Expand Up @@ -103,7 +104,8 @@ export default class LaserNode extends Node {
nodeChildren.push( labelAlignBox );
}
const options = optionize<LaserNodeOptions, SelfOptions, NodeOptions>()( {
children: nodeChildren
children: nodeChildren,
phetioVisiblePropertyInstrumented: false
}, providedOptions );

super( options );
Expand Down
2 changes: 1 addition & 1 deletion js/photons/view/MirrorNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default class MirrorNode extends Node {

public constructor( model: Mirror,
modelViewTransform: ModelViewTransform2,
providedOptions: MirrorNodeOptions ) {
providedOptions?: MirrorNodeOptions ) {

// Define an offset for positioning the mirror. This is needed because the photons reflect based on their center
// positions, and if the mirror isn't offset a bit, the photons can appear to go partially through the mirror.
Expand Down
5 changes: 3 additions & 2 deletions js/photons/view/PhotonDetectorNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default class PhotonDetectorNode extends Node {

public constructor( model: PhotonDetector,
modelViewTransform: ModelViewTransform2,
providedOptions: PhotonDetectorNodeOptions ) {
providedOptions?: PhotonDetectorNodeOptions ) {

// Create the detection aperture. This is essentially the anchor point for reset of the layout, meaning that the
// other nodes are positioned relative to this.
Expand Down Expand Up @@ -141,7 +141,8 @@ export default class PhotonDetectorNode extends Node {

const options = optionize<PhotonDetectorNodeOptions, SelfOptions, NodeOptions>()(
{
children: [ aperture, bodyRectangle, countReadout, label ]
children: [ aperture, bodyRectangle, countReadout, label ],
phetioVisiblePropertyInstrumented: false
},
providedOptions
);
Expand Down
4 changes: 3 additions & 1 deletion js/photons/view/PhotonPolarizationAngleControl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ export default class PhotonPolarizationAngleControl extends Panel {
const options = optionize<PhotonPolarizationAngleControlOptions, SelfOptions, PanelOptions>()( {
fill: QuantumMeasurementColors.controlPanelFillColorProperty,
stroke: QuantumMeasurementColors.controlPanelStrokeColorProperty,
cornerRadius: 5
cornerRadius: 5,
xMargin: 10,
yMargin: 10
}, providedOptions );

const titleProperty = new Text( QuantumMeasurementStrings.photonPolarizationAngleStringProperty, {
Expand Down
19 changes: 4 additions & 15 deletions js/photons/view/PhotonTestingArea.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,30 +82,19 @@ class PhotonTestingArea extends Node {

const verticalPolarizationDetector = new PhotonDetectorNode(
model.verticalPolarizationDetector,
photonTestingAreaModelViewTransform,
{
tandem: providedOptions.tandem.createTandem( 'verticalPolarizationDetector' )
}
photonTestingAreaModelViewTransform
);
const horizontalPolarizationDetector = new PhotonDetectorNode(
model.horizontalPolarizationDetector,
photonTestingAreaModelViewTransform,
{
tandem: providedOptions.tandem.createTandem( 'horizontalPolarizationDetector' )
}
photonTestingAreaModelViewTransform
);

const polarizingBeamSplitterNode = new PolarizingBeamSplitterNode(
model.polarizingBeamSplitter,
photonTestingAreaModelViewTransform,
{
tandem: providedOptions.tandem.createTandem( 'polarizingBeamSplitterNode' )
}
photonTestingAreaModelViewTransform
);

const mirror = new MirrorNode( model.mirror, photonTestingAreaModelViewTransform, {
tandem: providedOptions.tandem.createTandem( 'mirror' )
} );
const mirror = new MirrorNode( model.mirror, photonTestingAreaModelViewTransform );

const options = optionize<PhotonTestingAreaOptions, SelfOptions, NodeOptions>()( {
children: [
Expand Down
3 changes: 1 addition & 2 deletions js/photons/view/PhotonsExperimentSceneView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,7 @@ class PhotonsExperimentSceneView extends Node {
cornerRadius: 5,
xMargin: 20,
yMargin: 10,
align: 'center',
tandem: providedOptions.tandem.createTandem( 'averagePolarizationTitlePanel' )
align: 'center'
}
);

Expand Down
2 changes: 1 addition & 1 deletion js/photons/view/PolarizingBeamSplitterNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default class PolarizingBeamSplitterNode extends Node {

public constructor( model: PolarizingBeamSplitter,
modelViewTransform: ModelViewTransform2,
providedOptions: PolarizingBeamSplitterNodeOptions ) {
providedOptions?: PolarizingBeamSplitterNodeOptions ) {

const nodeSize = new Dimension2(
modelViewTransform.modelToViewDeltaX( model.size.width ),
Expand Down

0 comments on commit d2ab63b

Please sign in to comment.